home...

Virtual Treeview

The complete eGroups/YahooGroups mailing list archive
(2000-12-05 to 2002-04-14, 5715 messages)


About...

About this compilation

A simple Delphi program was written to:
  • download all messages from YahooGroups server via standard HTML interface
  • remove all text that's not related to VirtualTreeview component (ads, additional layout,...)
  • slightly modify cross references to other messages because file names have been changed
  • change subject lines - remove [VirtualTreeView] subject tag, adjust case (changed to lowercase) in replies
  • add a title to each message
  • create MS HTML Help project file with correct settings
HTML Help format was chosen because it offers powerful text search engine.
Compiled by Miha Remec, 2002, and released to VirtualTreeview community.


New VirtualTreeView List

From: "George Smith" [gsmith@b...]
Date: Tue Dec 5, 2000 5:42 pm
Subject: New VirtualTreeView List

Great and thanks mike.


test to see if group active

From: "George Smith" [gsmith@b...]
Date: Wed Dec 6, 2000 10:06 pm
Subject: test to see if group active

 | Replies | Author | Date
3 | Re: test to see if group active | Mike Lischke | Thu 12/7/2000


re: test to see if group active

From: Mike Lischke [m.lischke@d...]
Date: Thu Dec 7, 2000 10:38 am
Subject: RE: [VirtualTreeview] test to see if group active

Hi George,

> -----Original Message-----
> From: George Smith [mailto:[gsmith@b...]]
> Sent: Wednesday, December 06, 2000 11:07 PM
> To: VirtualTreeView
> Subject: [VirtualTreeview] test to see if group active
>

Actually, "active" is the wrong word :-) I have not had the opportunity
until last night to change the VT page so other people know about the
mailing list. All I can say is: "and then there were three..." (btw, a title
of an album of Genesis in the late 70s) :-)

Ciao, Mike


Custom Draw for the whole node?

From: [elinzon@n...]
Date: Thu Dec 7, 2000 12:09 pm
Subject: Custom Draw for the whole node?

Mike, could you pleage suggest the best way to handle node drawing? I
mean, the whole string in tree mode - this is nesessory for
string/column concatenation. (btw... there are four now... :))

 | Replies | Author | Date
5 | Re: Custom Draw for the whole node? | Mike Lischke | Thu 12/7/2000


re: Custom Draw for the whole node?

From: Mike Lischke [m.lischke@d...]
Date: Thu Dec 7, 2000 12:30 pm
Subject: RE: [VirtualTreeview] Custom Draw for the whole node?

> -----Original Message-----
> From: [elinzon@n...] [mailto:[elinzon@n...]]
> Sent: Thursday, December 07, 2000 1:09 PM
> To: VirtualTreeview@egroups.com
> Subject: [VirtualTreeview] Custom Draw for the whole node?
>
>
> Mike, could you pleage suggest the best way to handle node drawing? I
> mean, the whole string in tree mode - this is nesessory for
> string/column concatenation. (btw... there are four now... :))

Actually, we are still three, because I'm subscribed with two different
eMail addresses :o]

Now, what where do you want to draw a node, in a string tree or a draw tree?
Anything special to draw or just the node's caption?

Ciao, Mike


Testing the advanced demo

From: [tny@w...]
Date: Thu Dec 7, 2000 8:08 pm
Subject: Testing the advanced demo

Hey
I have just downloaded the VitualTreeView and it seems to be good.
I use Delphi 4 Pro and I have two questions about the Advanced demo.

When I compile it, there is no function
called "IncludeTrailingBackslash". (I made one by my self)

On the Drawtree page the text on the selected folder is removed each
time I expand the folder ?

Is there some components I am missing in my installation or is there
a bug ?

Torben Nygaard

 | Replies | Author | Date
7 | Re: Testing the advanced demo | Mike Lischke | Fri 12/8/2000
9 | Re: Testing the advanced demo | Torben Nygaard | Fri 12/8/2000
11 | Re: Testing the advanced demo | Mike Lischke | Fri 12/8/2000


re: Testing the advanced demo

From: Mike Lischke [m.lischke@d...]
Date: Fri Dec 8, 2000 8:21 am
Subject: RE: [VirtualTreeview] Testing the advanced demo

Hi Torben,

> When I compile it, there is no function
> called "IncludeTrailingBackslash". (I made one by my self)

Well, this is a function introduced by Delphi 5. Right, I could have written
a replacement for D4, but... :o]

> On the Drawtree page the text on the selected folder is removed each
> time I expand the folder ?

This seems to be a bug in the demo. I have not yet heard about this effect.
Perhaps it has todo with Delphi 4? Anybody else with this problem?

Ciao, Mike

 | Replies | Author | Date
9 | Re: Testing the advanced demo | Torben Nygaard | Fri 12/8/2000


Drag and Drop sample ? Any ?

From: "Jeurk " [knipjo@h...]
Date: Fri Dec 8, 2000 11:03 am
Subject: Drag and Drop sample ? Any ?

Hi,
Did someone achieve to make nodes drag and drop ?
I'm unable to drag and drop nodes... The operation start is working,
The drag over is working, the drop is working, but nothing happens
after that, and the node is not moved neither copyed...
It's strange, the old code I used is no longer working...it works but
does nothing.
Would someone be kind enought to show me a sample on how to move nodes
with a drag and drop operation in the tree ? Maybe you have a sample
around ?
That would be great.
Thanks guys...
John.

 | Replies | Author | Date
10 | Re: Drag and Drop sample ? Any ? | Mike Lischke | Fri 12/8/2000
12 | Re: Drag and Drop sample ? Any ? | Jeurk | Sun 12/10/2000
17 | Re: Drag and Drop sample ? Any ? | Tony Zubets | Tue 12/12/2000
22 | Re: Drag and Drop sample ? Any ? | Mike Lischke | Tue 12/12/2000
23 | Re: Drag and Drop sample ? Any ? | Jeurk | Wed 12/13/2000
97 | Re: Drag and Drop sample ? Any ? | Mike Lischke | Fri 1/5/2001


re: Testing the advanced demo

From: "Torben Nygaard" [tny@w...]
Date: Fri Dec 8, 2000 11:05 am
Subject: RE: [VirtualTreeview] Testing the advanced demo

Hey Mike

I have worked on it, and found that in
"procedure TMainForm.VDT1DrawNode" you use this line
Canvas.TextOut(NodeRect.Left + 2, Y, extractFileName(Data.FullPath));

But for a folder in D4 the extractFileName returns an emty string.
So i made a litle modfication an it seems to work.

//----------------------------
var sss : string;
var i : integer;
.....
sss:=ExtractFileName(Data.FullPath);
if sss = '' then
begin
i:= length(Data.FullPath);
ii:=i-1;
repeat
dec(i);
if data.fullpath[i] = '\' then
begin
sss:= copy(data.fullpath,i+1,ii-i);
i:=1;
end;
until i <= 1;
end;
Canvas.TextOut(NodeRect.Left + 2, Y,sss);
//----------------------------

Torben

-----Original Message-----
From: Mike Lischke [mailto:[m.lischke@d...]]
Sent: Friday, December 08, 2000 9:22 AM
To: 'VirtualTreeview@egroups.com'
Subject: RE: [VirtualTreeview] Testing the advanced demo

Hi Torben,

> When I compile it, there is no function
> called "IncludeTrailingBackslash". (I made one by my self)

Well, this is a function introduced by Delphi 5. Right, I could have written
a replacement for D4, but... :o]

> On the Drawtree page the text on the selected folder is removed each
> time I expand the folder ?

This seems to be a bug in the demo. I have not yet heard about this effect.
Perhaps it has todo with Delphi 4? Anybody else with this problem?

Ciao, Mike


re: Drag and Drop sample ? Any ?

From: Mike Lischke [m.lischke@d...]
Date: Fri Dec 8, 2000 12:45 pm
Subject: RE: [VirtualTreeview] Drag and Drop sample ? Any ?

Hallo John,

welcome to the mailing list. Fine that you also has joined us :o]

> Did someone achieve to make nodes drag and drop ?
> I'm unable to drag and drop nodes... The operation start is working,
> The drag over is working, the drop is working, but nothing happens
> after that, and the node is not moved neither copyed...

I know I have still this question from you pending in my queue, but can only
occasionally manage to do support during the week. This is one reason why I
created the mailing list. Sorry for not being able to answer you yet. Can
you post here the drop code you have used?

To all,

I just have uploaded version 1.29 of VT which contains fixes for some
problems which have been reported to me in the past two weeks.

Btw: I have also prepared a new demo (called OLE) which shall demonstrate
cut'n, copy and paste as well as drag'n drop with VT. It is not ready yet,
so don't get too excited :-) If anybody wants to contribute to this or any
other demo then please don't hesitate and send your contribution to me.
Other users will be thankful, that's for sure.

Ciao, Mike

 | Replies | Author | Date
12 | Re: Drag and Drop sample ? Any ? | Jeurk | Sun 12/10/2000
17 | Re: Drag and Drop sample ? Any ? | Tony Zubets | Tue 12/12/2000
22 | Re: Drag and Drop sample ? Any ? | Mike Lischke | Tue 12/12/2000
23 | Re: Drag and Drop sample ? Any ? | Jeurk | Wed 12/13/2000


re: Testing the advanced demo

From: Mike Lischke [m.lischke@d...]
Date: Fri Dec 8, 2000 12:50 pm
Subject: RE: [VirtualTreeview] Testing the advanced demo

> I have worked on it, and found that in
> "procedure TMainForm.VDT1DrawNode" you use this line
> Canvas.TextOut(NodeRect.Left + 2, Y,
> extractFileName(Data.FullPath));

Thank you, that's great news. Now I remember what I did there. I used the
fact that e.g. "c:\folder a\folder b" without a trailing backslash will
return "folder b" from ExtractFileName. This way I could omit distinction
checks for folders and files. I will fix this in the demos.

Ciao, Mike


re: Drag and Drop sample ? Any ?

From: "Jeurk " [knipjo@h...]
Date: Sun Dec 10, 2000 2:43 am
Subject: Re: Drag and Drop sample ? Any ?

Mike,

> I know I have still this question from you pending in my queue,
> created the mailing list. Sorry for not being able to answer you
Really mike, no problem, that's why I'm here ;)
We are all busy persons, and you are probably even busyer then I am...
I still don't have a family ;)

> you post here the drop code you have used?
look at the end of that thread... In fact it was a code snap
you allready sent to me some time ago.
don't worry, let's say I wait until the release of your sample...

> I just have uploaded version 1.29 of VT which contains fixes for
I could not check if my problem go away with that because the
server seems down...

> cut'n, copy and paste as well as drag'n drop with VT. It is not
ready yet,
not ready, but maybe you could already send to me what you have, so
I could inspire. Of course you make no support for it :)

See you.
John.

//////////////////
procedure TFRM_WWW_main.vstFavoriteDragDrop(Sender: TBaseVirtualTree;
Source: TObject; DataObject: IDataObject; const Formats: array of
Word;
Shift: TShiftState; Pt: TPoint; var Effect: Integer; Mode:
TDropMode);
var
I: Integer;
AttachMode: TVTNodeAttachMode;
begin
if Length(Formats) > 0 then
begin
// OLE drag'n drop
// if the native tree format is listed then use this and accept
the drop, otherwise recject (ignore) it
for I := 0 to High(Formats) do
if Formats[I] = CF_VIRTUALTREE then
begin
case Mode of
dmAbove:
AttachMode := amInsertBefore;
dmOnNode:
// nodes are moved in reverse logical order to
speed up reindexing of siblings
// so you need to specify the reverse mode here to
that you actually want
AttachMode := amAddChildLast;
dmBelow:
AttachMode := amInsertAfter;
else
AttachMode := amNowhere;
end;
// in the case the drop target does an optimized move
Effect is set to DROPEFFECT_NONE
// to indicate this also to the drag source (so the
source doesn't need to take any further action)
Sender.ProcessDrop(DataObject, Sender.DropTargetNode,
Effect, AttachMode);
Break;
end;
end
else
begin
// VCL drag'n drop, Effects contains by default both move and
copy effect suggestion,
// as usual the application has to find out what operation is
finally to do
Beep;
end;
end;


VirtualTreeView for C++Builder 5

From: [javfran@d...]
Date: Sun Dec 10, 2000 4:21 pm
Subject: VirtualTreeView for C++Builder 5

Hi...
(Sorry for my english)

The original pas file in C++Builder no work, for positions of the
records.

I change the position of that records, and it work.

What is the next step?

Atte.

Javier....

 | Replies | Author | Date
14 | Re: VirtualTreeView for C++Builder 5 | Mike Lischke | Sun 12/10/2000
132 | Re: VirtualTreeView for C++Builder 5 | [lyann@o...] | Tue 1/9/2001
133 | Re: VirtualTreeView for C++Builder 5 | Ed Hamilton | Tue 1/9/2001
135 | Re: VirtualTreeView for C++Builder 5 | Mike Lischke | Wed 1/10/2001
136 | Re: VirtualTreeView for C++Builder 5 | Mike Lischke | Wed 1/10/2001


re: VirtualTreeView for C++Builder 5

From: "Mike Lischke" [public@l...]
Date: Sun Dec 10, 2000 8:54 pm
Subject: RE: [VirtualTreeview] VirtualTreeView for C++Builder 5

> The original pas file in C++Builder no work, for positions of the
> records.
>
> I change the position of that records, and it work.
>
> What is the next step?

What next step? I suppose you must include the unit into a package and install
this. Then you will
have a new icon in your component palette.

Ciao, Mike

 | Replies | Author | Date
132 | Re: VirtualTreeView for C++Builder 5 | [lyann@o...] | Tue 1/9/2001
133 | Re: VirtualTreeView for C++Builder 5 | Ed Hamilton | Tue 1/9/2001


To correct the main source

From: [javfran@d...]
Date: Mon Dec 11, 2000 11:14 pm
Subject: To correct the main source

Hi...

I upload the modificated source to the files of this gruop.

My next steps , is the upload of the change in de pas file.

Atte..

Javier


XML and trees

From: "Emanuele Quinto" [emanuele_quinto@y...]
Date: Mon Dec 11, 2000 11:47 pm
Subject: XML and trees

Ok, let's start describing my task:

edit XML files

As you know XML it is the yet next big thing...
I'm interested in XML because I need to save info for
a web site and seems an interesting technique for separating
presentation from content.
Now, I have to set a tool to edit friendly data contained
in the files.

I start from the scratch using a delphi application; I
load XML in DOM (MSXML or Open XML from http://www.philo.de/xml)
and I create on the fly edit box and so on.
Isn't a good tool, I know, so I'm looking around...

First I try to use TWebbrowser (IE embedded in Delphi); ok, now
I can see my XML file well formatted and so on. The problem is
while I can see the file rendered in HTL I can't access at all
to the XML DOM, just HTML DOM. So I can't edit data.

Ok, I figure I have to use TreeView. I start rendering in
IE-like stile the XML file and access to the data using Data
pointer linked to the Node. Well it goes.
But, but, the look it is very unconfortable; how about
wrapped text ? how about decent scrolling ? Forget...

Looking around I find VirtualTreeView. Mmmmh seems interesting,
but how to use ? I try to understand the examples but I can't
figure how to solve my simple problem...

So long there is someone interested help me in this task ?

Let me know...

ema


re: Drag and Drop sample ? Any ?

From: "Tony Zubets" [nexus@o...]
Date: Tue Dec 12, 2000 10:02 am
Subject: Re: Drag and Drop sample ? Any ?

--- In [VirtualTreeview@egroups.com, Mike Lischke <m.lischke@d...]
wrote:
> Hallo John,
>
> welcome to the mailing list. Fine that you also has joined us :o]
>
> > Did someone achieve to make nodes drag and drop ?
> > I'm unable to drag and drop nodes... The operation start is
working,
> > The drag over is working, the drop is working, but nothing happens
> > after that, and the node is not moved neither copyed...
>
> I know I have still this question from you pending in my queue, but
can only
> occasionally manage to do support during the week. This is one
reason why I
> created the mailing list. Sorry for not being able to answer you
yet. Can
> you post here the drop code you have used?
>
> To all,
>
> I just have uploaded version 1.29 of VT which contains fixes for
some
> problems which have been reported to me in the past two weeks.
>

Hi!

I've got the same problems with dragging nodes in tree (in new
version of VT too) :(
All the process is quite clear, but when the node is dropped -
nothing happens with the tree structure (nodes are not moved neither
copyed). It seems that something goes wrong in the ProcessOLEData
routine...

And another question is: when I change the DragImageKind to
diMainColumnOnly there is no drag image at all (may be the reason is
that I have headers turned off?). Can you please help me with an
advise how to get a drag image that consists only of the Node's image
and its Caption (similar to the standard drag image of the M$
treeview).

Thanks in advance!
=Tony

 | Replies | Author | Date
22 | Re: Drag and Drop sample ? Any ? | Mike Lischke | Tue 12/12/2000
23 | Re: Drag and Drop sample ? Any ? | Jeurk | Wed 12/13/2000


small bug with version 1.29

From: "Jeurk " [knipjo@h...]
Date: Tue Dec 12, 2000 1:35 pm
Subject: small bug with version 1.29

Hello Mike.
It seems they is a new bug introduced by version 1.29.
At least it was not present in 1.25, I double checked.
The problem is that in a stringview when you select a row
Only the first column is draw correctly, the other are
painted in black. only for the selected row. strange.
I can send you a shot if you don't see what I mean...
John.

 | Replies | Author | Date
19 | Re: small bug with version 1.29 | sven | Tue 12/12/2000
21 | Re: small bug with version 1.29 | Mike Lischke | Tue 12/12/2000
20 | Re: small bug with version 1.29 | Mike Lischke | Tue 12/12/2000


re: small bug with version 1.29

From: sven [h.sven@g...]
Date: Tue Dec 12, 2000 4:32 pm
Subject: Re: [VirtualTreeview] small bug with version 1.29

Hello

I noticed a behavior that also concerns the selected rows.
The rows that are selected (not the one that has the focus) don't show any
icon.

Is it a bug in v1.29 or is there something different to do from v1.25?

with kind regards
sven

At Tuesday 12.12.00, you wrote:
>Hello Mike.
>It seems they is a new bug introduced by version 1.29.
>At least it was not present in 1.25, I double checked.
>The problem is that in a stringview when you select a row
>Only the first column is draw correctly, the other are
>painted in black. only for the selected row. strange.
>I can send you a shot if you don't see what I mean...
>John.
>
>
>
>To unsubscribe from this group, send an email to:
>VirtualTreeview-unsubscribe@egroups.com

 | Replies | Author | Date
21 | Re: small bug with version 1.29 | Mike Lischke | Tue 12/12/2000


re: small bug with version 1.29

From: "Mike Lischke" [public@l...]
Date: Tue Dec 12, 2000 8:35 pm
Subject: RE: [VirtualTreeview] small bug with version 1.29

Hi John,

> It seems they is a new bug introduced by version 1.29.
> At least it was not present in 1.25, I double checked.
> The problem is that in a stringview when you select a row
> Only the first column is draw correctly, the other are
> painted in black. only for the selected row. strange.
> I can send you a shot if you don't see what I mean...

Yes you are right. I have tried to fix the not working background customization
(OnGetDrawInfo), but
got more problems that it solved. I have to investigate this yet...

Ciao, Mike


re: small bug with version 1.29

From: "Mike Lischke" [public@l...]
Date: Tue Dec 12, 2000 8:36 pm
Subject: RE: [VirtualTreeview] small bug with version 1.29

Sven,

> I noticed a behavior that also concerns the selected rows.
> The rows that are selected (not the one that has the focus) don't show any
> icon.
>
> Is it a bug in v1.29 or is there something different to do from v1.25?

Yes, this problem is also related to the background painting problem. The
string tree tries to
delete a cell's background after the base tree class has already painted all
the decoration.

Ciao, Mike


re: Re: Drag and Drop sample ? Any ?

From: "Mike Lischke" [public@l...]
Date: Tue Dec 12, 2000 8:38 pm
Subject: RE: [VirtualTreeview] Re: Drag and Drop sample ? Any ?

> I've got the same problems with dragging nodes in tree (in new
> version of VT too) :(
> All the process is quite clear, but when the node is dropped -
> nothing happens with the tree structure (nodes are not moved neither
> copyed). It seems that something goes wrong in the ProcessOLEData
> routine...

Mmh, I will try to improve the OLE demo to have drag'n drop included as soon as
possible. But so
close before christmas I'm more than busy. I can't simply tell when I will find
the time. In the
time from 22. October to 5. January I won't even have access to a computer (the
hardest time in the
whole year ;-)).

> And another question is: when I change the DragImageKind to
> diMainColumnOnly there is no drag image at all (may be the reason is
> that I have headers turned off?). Can you please help me with an
> advise how to get a drag image that consists only of the Node's image
> and its Caption (similar to the standard drag image of the M$
> treeview).

Perhaps I have overlooked something? The check goes like:

if (not UseColumns or (coVisible in Items[Column].FOptions)) and
(not MainOnly or (Column = 0)) then

which means a column is painted (in PaintTo) if no columns are used (then the
main column is painted
by default) or the column is visible and
either this is actually the main column being painted or all columns are
allowed to be painted.

Since you have hidden the header UseColumns is False which makes the first part
True. MainOnly is
True so the only problem could arise from Column never getting 0.

Ah yes, this could be the problem. If no columns are used the Column is -1 and
the loop stopps after
the first run. It seems I have to extend the check to:

(not MainOnly or ((Column + 1) in [0, 1])) then

Ciao, Mike

 | Replies | Author | Date
23 | Re: Drag and Drop sample ? Any ? | Jeurk | Wed 12/13/2000


re: Drag and Drop sample ? Any ?

From: "Jeurk " [knipjo@h...]
Date: Wed Dec 13, 2000 2:33 pm
Subject: Re: Drag and Drop sample ? Any ?

> close before christmas I'm more than busy. I can't simply tell when
I will find the time. In the
> time from 22. October to 5. January I won't even have access to a
computer (the hardest time in the
> whole year ;-)).
I think we all agree on the fact that in the following next couple
of weeks we are gonna be really busy.
So I will say that we will probably see a drag and drop demo
somewhere in Q1 2001 :)
Have you thought Mike, of a way to reports bugs easily for you ?
So you could post a bug list and we will stop bugging you with already
known bugs...

I have a couple of others remarks about the drawtree...
I have a drawtree with about 300-400 nodes, when I drag some nodes
around took from the beginning of the tree speed is fine.
But when I try to drag around nodes from the end of the tree they
move only slowly around. Any hint about that ?
Node selection is also slow. And when I say slow, it's compared
to the stringtree...

I never used the drawtree before. I don't like the node selection
system.
I prefer the way the string tree is working.
By the way, a node in the drawtree does not show a selection. the
only way I found to get a line node selection is to use the
selectwhole line option.
I imagine this is related to the draw problems you currently have...

I switched to the drawtree because I needed to add a small preview to
each node...
Is this feasable in a stringTree ?

Do you think it would be possible to add an option to let the
virtualtree
draw on multiple columns ? Like in a simple listview...
Maybe simply by asking the tree to draw different views?

I had other questions but forgot them :)

Anyway, we have the source ;)
So, so, so...
Let's say happy christmas and happy new year...
John.


DB aware Virtual Tree

From: [paul.thornton@c...]
Date: Thu Dec 14, 2000 12:31 pm
Subject: DB aware Virtual Tree

Hi All,

I was wondering whether anyone had started to develop a Data Aware
version of Virtual Tree... wouldn't it be nice to get rid of a DBGrid
and replace it with a DBVirtualTree? Thought I'd ask the question
before I started to have a go myself.

Cheers,
Paul

 | Replies | Author | Date
43 | Re: DB aware Virtual Tree | adem baba | Sat 12/23/2000


OnDragDrop & OnDragOver never gets called !

From: [mathias.thorell@s...]
Date: Thu Dec 14, 2000 2:01 pm
Subject: OnDragDrop & OnDragOver never gets called !

Hello !

This is what I'm trying to do :

I want the user to be able to drag a node (or more than one if
voMultiSelect is set in the Tree) to, for example a simple TEdit.

VirtualStringTree->DragMode = dmAutomatic;

The problem is that neither the OnDragOver nor the OnDragDrop event
is ever fired in the TEdit component ! Why is that ?
I can see the nodes as a dragcursor while I'm moving around in the
VirtualStringTree, but as soon as I leave that component, I get the
"drop rejected" cursor :--(

And why doesn't VirtualStringTree have the OnStartDrag event
implemented ?

/TIA
Mathias Thorell
Senior Flight Test Ebgineer
Gripen, Saab AB
Sweden

 | Replies | Author | Date
26 | Re: OnDragDrop & OnDragOver never gets called ! | Mike Lischke | Thu 12/14/2000
27 | Re: OnDragDrop & OnDragOver never gets called ! | [mathias.thorell@s...] | Thu 12/14/2000


re: OnDragDrop & OnDragOver never gets called !

From: Mike Lischke [m.lischke@d...]
Date: Thu Dec 14, 2000 2:06 pm
Subject: RE: [VirtualTreeview] OnDragDrop & OnDragOver never gets called !

Hi Mathias,

> I want the user to be able to drag a node (or more than one if
> voMultiSelect is set in the Tree) to, for example a simple TEdit.
>
> VirtualStringTree->DragMode = dmAutomatic;
>
> The problem is that neither the OnDragOver nor the OnDragDrop event
> is ever fired in the TEdit component ! Why is that ?

Delphi uses a proprietary drag'n drop scheme (with internal window and a lot
of support code). I wanted, however, VT to be system standard (OLE).
Unfortunately, you cannot have both schemes working at the same time and
also the actual implementation is quite different. Hence I only allowed OLE
dragging (and accepting VCL dragging by forwarding).

Ciao, Mike

 | Replies | Author | Date
27 | Re: OnDragDrop & OnDragOver never gets called ! | [mathias.thorell@s...] | Thu 12/14/2000


re: OnDragDrop & OnDragOver never gets called !

From: [mathias.thorell@s...]
Date: Thu Dec 14, 2000 2:14 pm
Subject: Re: OnDragDrop & OnDragOver never gets called !

--- In [VirtualTreeview@egroups.com, Mike Lischke <m.lischke@d...]
wrote:

> Delphi uses a proprietary drag'n drop scheme (with internal window
and a lot
> of support code). I wanted, however, VT to be system standard (OLE).
> Unfortunately, you cannot have both schemes working at the same time
and
> also the actual implementation is quite different. Hence I only
allowed OLE
> dragging (and accepting VCL dragging by forwarding).

So that means I have to rewrite all code to use OLE D'n'd ?
I'm quite familiar with VCL D'n'd, but so far (luckilly) I've never
had to use OLE...
Is it possible to use OLE to accomplish what I'm trying to do ? (OLE
Drag->VCL drop) ? And if so, is there any good examples on that ?

Or, is it possible to get a copy of TTreeNT that works in BCB5
(the version of TTreeNT I've got works in run-time, but not in
design-time) ?

/MT


re: Re: OnDragDrop & OnDragOver never gets call ed !

From: Mike Lischke [m.lischke@d...]
Date: Thu Dec 14, 2000 2:28 pm
Subject: RE: [VirtualTreeview] Re: OnDragDrop & OnDragOver never gets call ed !

> So that means I have to rewrite all code to use OLE D'n'd ?
> I'm quite familiar with VCL D'n'd, but so far (luckilly) I've never
> had to use OLE...

That's the price, yes (if you want standard VCL controls to accept OLE dd).

> Is it possible to use OLE to accomplish what I'm trying to do ? (OLE
> Drag->VCL drop) ? And if so, is there any good examples on that ?

Not in that sense. You cannot use the VCL dd system when an OLE dd operation
is in process because in both cases a hidden window is involved and to only
one are messages sent (mouse, keyboard). You can however create an
IDropTarget implementation (use what's in VT, it is not that difficult and
much more flexible then) and register all your windowed controls as OLE drop
targets using an instance of the same interface. Use the IDropTarget to get
notified about drag over and drop events. It's rather simple. Use the
GetDataSourceTree implementation in VT to get the source tree (if it is a
tree and then use the default drag/drop events for further processing (if
yous still need VCL dd to be used).

> Or, is it possible to get a copy of TTreeNT that works in BCB5
> (the version of TTreeNT I've got works in run-time, but not in
> design-time) ?

Not possible. TreeNT's development is closed.

Ciao, Mike


Directory Tree View

From: [dcase@s...]
Date: Tue Dec 19, 2000 10:20 am
Subject: Directory Tree View

Has anyone created a drive and directory tree view using VT. We need
one to act as a backup folders selector and if there is one out there
we could use it would make a bunch easier.

Thanks.

Msg For Mike - Great Work, but it sure is different :-)

 | Replies | Author | Date
30 | Re: Directory Tree View | Mike Lischke | Tue 12/19/2000
31 | Struggling with selection | Will Watts | Tue 12/19/2000


re: Directory Tree View

From: Mike Lischke [m.lischke@d...]
Date: Tue Dec 19, 2000 1:19 pm
Subject: RE: [VirtualTreeview] Directory Tree View

> Has anyone created a drive and directory tree view using VT. We need
> one to act as a backup folders selector and if there is one out there
> we could use it would make a bunch easier.

When I created the demo I thought about making a directory tree, but for
time reason I left it the way it is now in the advanced demo. You could
essentially take the system treeview from Brad Stowers and replace the
normal treeview by VT. This should not be that hard and take at most a
couple of afternoons. Btw. the link is www.delphifreestuff.com.

Ciao, Mike


Struggling with selection

From: "Will Watts" [willw@a...]
Date: Tue Dec 19, 2000 6:58 pm
Subject: Struggling with selection

Hi,

I'm sure I'm being very dense, but I am having trouble with making
Selections work *before* the user has clicked on the
VirtualTreeView.

To show my problem: drop a new button on the main form of the
Minimal demo. Add an event handler like this:

procedure TMainForm.Button2Click(Sender: TObject);
begin
VST.Selected[VST.GetFirstNode] := true;
end;

When the application is first run, clicking this button does not
cause the first node to show selected. However, if the user clicks
somewhere on the TreeView and selects a node, thereafter the
button works as expected.

Please, what am I doing wrong?

An excellent control btw - I've been very impressed indeed.

Regards

Will

Will Watts Direct Line +44 20 8400 6104
Applied Industrial Systems Ltd Main Voice +44 20 8400 6100
10 Barley Mow Passage Fax +44 20 8742 2456
Chiswick London W4 4PH Web http://www.applied.co.uk


re: Struggling with selection

From: Mike Lischke [m.lischke@d...]
Date: Wed Dec 20, 2000 11:48 am
Subject: RE: [VirtualTreeview] Struggling with selection

Hi Will,

> To show my problem: drop a new button on the main form of the
> Minimal demo. Add an event handler like this:
>
> procedure TMainForm.Button2Click(Sender: TObject);
> begin
> VST.Selected[VST.GetFirstNode] := true;
> end;
>
> When the application is first run, clicking this button does not
> cause the first node to show selected. However, if the user clicks
> somewhere on the TreeView and selects a node, thereafter the
> button works as expected.

Sorry for giving the most stressed answer of programmers for bugs in their
software: on my system it works.

Which version of VT do you have? I'm already on 1.31 (which has not yet been
published) but I have not changed code concerning the selection behaviour so
it should be the same at least as version 1.29. Have you tried to force a
repaint (move the window to the screen border)? Perhaps it is a paint
problem.

> An excellent control btw - I've been very impressed indeed.

Thank you :-)

Ciao, Mike

 | Replies | Author | Date
33 | Re: Struggling with selection | Will Watts | Wed 12/20/2000
34 | Re: Struggling with selection | Mike Lischke | Wed 12/20/2000
35 | Re: Struggling with selection | Will Watts | Wed 12/20/2000
36 | Re: Struggling with selection | Mike Lischke | Wed 12/20/2000
37 | Re: Struggling with selection | Will Watts | Wed 12/20/2000


re: Struggling with selection

From: "Will Watts" [willw@a...]
Date: Wed Dec 20, 2000 12:30 pm
Subject: RE: [VirtualTreeview] Struggling with selection

Mike,

On 20 Dec 2000, at 12:48, Mike Lischke wrote:

> Sorry for giving the most stressed answer of programmers for bugs in
> their software: on my system it works.

Oooh I never ever say that! :-)

> Which version of VT do you have? I'm already on 1.31 (which has not
> yet been published) but I have not changed code concerning the
> selection behaviour so it should be the same at least as version 1.29.

Duh. I was using 1.26, although I was sure I had grabbed it very
recently... However I have grabbed 1.29 and it doesn't make any
difference. :-(

> Have you tried to force a repaint (move the window to the screen
> border)? Perhaps it is a paint problem.

Tried that, no soap. Sorry.

Is it an OS problem? I don't think so. I'm running Win2k Pro - but
my colleague sees the same running WinNT 4.

I am compiling with D5 with the 5.01 patch applied. I have a few
add-ons (RxLib, ADO Express, Toolbar 97, InfoPower) but nothing
I'd have thought that would interfere with the behaviour of your code.
I added code that reports the state of Selected after each click of
the button and it behaves correctly ie toggles between Selected
and unselected - even though it is not displayed.

If you want to tell me where the drawing code is etc I'll be happy to
trace it through - the code is a bit big to get one's head around at
first read! Or I could email you my zipped compiled program
directly to see if you see this behaviour on your machine. Or
whatever. I'd like to suss this!

Regards

Will

Will Watts Direct Line +44 20 8400 6104
Applied Industrial Systems Ltd Main Voice +44 20 8400 6100
10 Barley Mow Passage Fax +44 20 8742 2456
Chiswick London W4 4PH Web http://www.applied.co.uk


re: Struggling with selection

From: Mike Lischke [m.lischke@d...]
Date: Wed Dec 20, 2000 12:45 pm
Subject: RE: [VirtualTreeview] Struggling with selection

Will,

> Is it an OS problem? I don't think so. I'm running Win2k Pro - but
> my colleague sees the same running WinNT 4.

I don't think it is an OS related problem. I'm running W2K too and just
checked the simple demo again and it works as expected.

> I am compiling with D5 with the 5.01 patch applied.

So do I.

>I have a few
> add-ons (RxLib, ADO Express, Toolbar 97, InfoPower) but nothing
> I'd have thought that would interfere with the behaviour of
> your code.

Very unlikely that it conflicts.

> I added code that reports the state of Selected after each click of
> the button and it behaves correctly ie toggles between Selected
> and unselected - even though it is not displayed.

Weird. The state is okay but it isn't painted correctly.

> If you want to tell me where the drawing code is etc I'll be happy to
> trace it through - the code is a bit big to get one's head around at
> first read!

Please go to line 17098 (can be a bit different because of the newer version
I have). You are then in DoPaintNode of the string tree. There are these
lines:

if (Column = FFocusedColumn) or (voFullRowSelect in FOptions) then
begin
// draw selection and focus rect
if vsSelected in Node.States then
begin
if Focused then
begin
Brush.Color := clHighLight;
Font.Color := clHighlightText;
end
else
begin
Brush.Color := clBtnFace;
Font.Color := Self.Font.Color;
end;
if voGridExtensions in FOptions then
FillRect(ClippingRect)
else
FillRect(NodeRect);
end
else

which paint the selection. Debug it this way:
- start application
- add nodes (if not already done)
- do selection via code and button click
- alt-tab to Delphi and set a breakpoint on the first line given above
- alt-tab to the app. which should trigger the breakpoint
- check whether "if vsSelected in Node.States then" is true and which path
is taken

>Or I could email you my zipped compiled program
> directly to see if you see this behaviour on your machine. Or
> whatever. I'd like to suss this!

Let us try first what you get out from the check above. Have you made any
change to the demo code other than the mouse click and report code?

Ciao, Mike

 | Replies | Author | Date
35 | Re: Struggling with selection | Will Watts | Wed 12/20/2000


re: Struggling with selection

From: "Will Watts" [willw@a...]
Date: Wed Dec 20, 2000 1:31 pm
Subject: RE: [VirtualTreeview] Struggling with selection

Hi Mike,

On 20 Dec 2000, at 13:45, Mike Lischke wrote:

> Please go to line 17098 (can be a bit different because of the newer
> version I have). You are then in DoPaintNode of the string tree. There
> are these lines:
>
> if (Column = FFocusedColumn) or (voFullRowSelect in FOptions) then

Column = -1, FFocusedColumn = -2
FOptions = [voAcceptOLEDrop, voAutoDropExpand,
voAutoTristateTracking, voInitOnSave, voShowButtons,
voShowRoot, voShowLines, voToggleOnDblClick]

So it doesn't take the if.

> if vsSelected in Node.States then

For the record

Node.States=[vsInitialized, vsSelected]

so I guess if we had got to here we would be all right.

I'd suppose what happens after this is of no interest - I have a
Columns problem?

> Have you made any change to the demo code other than the mouse
> click and report code?

Not unless I have done so by accident or in my sleep... Always
possible of course - maybe your comeback on this email will be
'Why did you set the Columns property clDontSetThis to "True"'
and I will be covered with embarassment. But if so it is accidental.

Wait. You are being very helpful. The least I can do is do my part
properly. So: unpacked Minimal from Demos.zip to new directory,
added my button and the line of code again. Same behaviour.

Will

Will Watts Direct Line +44 20 8400 6104
Applied Industrial Systems Ltd Main Voice +44 20 8400 6100
10 Barley Mow Passage Fax +44 20 8742 2456
Chiswick London W4 4PH Web http://www.applied.co.uk


re: Struggling with selection

From: Mike Lischke [m.lischke@d...]
Date: Wed Dec 20, 2000 2:03 pm
Subject: RE: [VirtualTreeview] Struggling with selection

> >
> > if (Column = FFocusedColumn) or (voFullRowSelect in
> FOptions) then
>
> Column = -1, FFocusedColumn = -2
> FOptions = [voAcceptOLEDrop, voAutoDropExpand,
> voAutoTristateTracking, voInitOnSave, voShowButtons,
> voShowRoot, voShowLines, voToggleOnDblClick]
>
> So it doesn't take the if.

Ok, here my solution. Change VT to the following code:

procedure TBaseVirtualTree.SetSelected(Node: PVirtualNode; Value: Boolean);

begin
if Assigned(Node) and (Node <> FRoot) and (Value xor (vsSelected in
Node.States)) then
begin
if Value then
begin
if not (voMultiSelect in FOptions) then
ClearSelection;
AddToSelection(Node);
if FFocusedColumn = InvalidColumn then
FFocusedColumn := FHeader.MainColumn;
end
else
RemoveFromSelection(Node);
if IsVisible[Node] then
InvalidateNode(Node);
end;
end;

The problem is related to not setting the focused column sometimes. Usually
it is set by method SetOptions on load of a tree and hence hides the true
problem (because you will almost always use a different options set than the
default).

For all listeners: this code will of course be included in the next version,
so you don't need to touch VT's code if you don't need a fix for this
problem immediately.

Ciao, Mike

 | Replies | Author | Date
37 | Re: Struggling with selection | Will Watts | Wed 12/20/2000


re: Struggling with selection

From: "Will Watts" [willw@a...]
Date: Wed Dec 20, 2000 3:16 pm
Subject: RE: [VirtualTreeview] Struggling with selection

Mike,

On 20 Dec 2000, at 15:03, Mike Lischke wrote:

> Ok, here my solution.

That's fixed it. Many thanks!

W

Will Watts Direct Line +44 20 8400 6104
Applied Industrial Systems Ltd Main Voice +44 20 8400 6100
10 Barley Mow Passage Fax +44 20 8742 2456
Chiswick London W4 4PH Web http://www.applied.co.uk


version 1.31

From: "Mike Lischke" [public@l...]
Date: Wed Dec 20, 2000 8:05 pm
Subject: version 1.31

Hi all,

I just uploaded version 1.31 to my homepage. Note that the demos are not
updated yet. I will do this
tomorrow.

Ciao, Mike

Dipl. Ing. Mike Lischke
Senior software developer
--
Homepage: http://www.lischke-online.de
GraphicEx: http://www.lischke-online.de/Graphics.html
Virtual Treeview: http://www.lischke-online.de/VirtualTreeview.html
Unicode Edit and library: http://www.lischke-online.de/Unicode.html


flicker when FullRowSelect

From: [kevin@i...]
Date: Thu Dec 21, 2000 7:56 am
Subject: flicker when FullRowSelect

Hi,

I'm using v 1.29.
When voFullRowSelect in Options,
After background is erased,there is a flicker below the cursor
the size of ficker is the size of curosr,
the color of ficker is color of the focused item.

How could I solve the problem ?

Regards,
Kevin Lu

 | Replies | Author | Date
40 | Re: flicker when FullRowSelect | Mike Lischke | Thu 12/21/2000
41 | Re: flicker when FullRowSelect | KevinLu | Thu 12/21/2000


re: flicker when FullRowSelect

From: "Mike Lischke" [public@l...]
Date: Thu Dec 21, 2000 8:33 am
Subject: RE: [VirtualTreeview] flicker when FullRowSelect

Hi Kevin,

> I'm using v 1.29.
> When voFullRowSelect in Options,
> After background is erased,there is a flicker below the cursor
> the size of ficker is the size of curosr,
> the color of ficker is color of the focused item.

This sounds like a graphics board problem where there are interferences between
the cursor and the
screen content. Anyone with a better idea?

Kevin, what OS are you running and what graphics board do you have?

Ciao, Mike


re: flicker when FullRowSelect

From: "KevinLu" [kevin@i...]
Date: Thu Dec 21, 2000 8:37 am
Subject: Re: [VirtualTreeview] flicker when FullRowSelect

I don't think it's a graphics board problem because it only happened with
VirtualTreeview.
I'm using win2000 with G200.

----- Original Message -----
From: "Mike Lischke" [public@l...]
To: <VirtualTreeview@egroups.com>
Sent: Thursday, December 21, 2000 4:33 PM
Subject: RE: [VirtualTreeview] flicker when FullRowSelect

> Hi Kevin,
>
> > I'm using v 1.29.
> > When voFullRowSelect in Options,
> > After background is erased,there is a flicker below the cursor
> > the size of ficker is the size of curosr,
> > the color of ficker is color of the focused item.
>
> This sounds like a graphics board problem where there are interferences
between the cursor and the
> screen content. Anyone with a better idea?
>
> Kevin, what OS are you running and what graphics board do you have?
>
> Ciao, Mike
>
>
>
> To unsubscribe from this group, send an email to:
> VirtualTreeview-unsubscribe@egroups.com
>
>


Rel 1.31 virtual draw tree seems not perfect

From: "Jeurk " [knipjo@h...]
Date: Fri Dec 22, 2000 10:47 am
Subject: Rel 1.31 virtual draw tree seems not perfect

Hello All,
Hello Mike,
I tryed the latest version you released, and it seems to me
that the drawtree is not drawing very good. I admit that
it's working in your demos, but not in my programm.
So I'll way some more time and look around for what I can do.
The problem is that I can only select the first node of my tree,
the others are unseltable and even hardly drawn...
Strange. I' think I'm going back to the stringTree...
The only thing that I will lack is the ability to set the nodes
height. Doesn't matter that much...
Just to say :)
See you friends...

John.

 | Replies | Author | Date
80 | Re: Rel 1.31 virtual draw tree seems not perfect | Mike Lischke | Fri 1/5/2001


re: DB aware Virtual Tree

From: "adem baba" [adembaba@e...]
Date: Sat Dec 23, 2000 4:57 am
Subject: Re: DB aware Virtual Tree

Now, this would definitely be something interesting to tackle; after
all, all the commercial stuff I have seen simply suck in a big way.

The tough part is the user interface where you let the user (i.e.
software guy) make the choices as to what will be the parent and
child and data fields, without having to create numerical
relationships like most commercial suckers do.

To help the thing be really flexible, I would use something like
xQuery component (ah, it is not open source, though) which does not
need BDE or ODBC to do SQL... Then you could have a different SQL
filter even for every single node (or, level)....

I wish I had the time and talent...

Maybe the giftier among us --say, Mike himself-- could be tempted,
who knows :-))

--- In [VirtualTreeview@egroups.com, paul.thornton@c...] wrote:
> Hi All,
>
> I was wondering whether anyone had started to develop a Data Aware
> version of Virtual Tree... wouldn't it be nice to get rid of a
DBGrid
> and replace it with a DBVirtualTree? Thought I'd ask the question
> before I started to have a go myself.
>
> Cheers,
> Paul


OnRowChanged + OnRowChanging and OnColumnChanged and OnColumnChanging

From: "adem baba" [adembaba@e...]
Date: Sat Dec 23, 2000 5:30 am
Subject: OnRowChanged + OnRowChanging and OnColumnChanged and OnColumnChanging

Mike,

OnFocusChanged and OnFocusChanging are useful, but, what if I am
testing whether the user changed (or is about to change) row or
column.

OK, OnFocusChanging does --sort of-- help for column change issue,
but how do I do it for rows, and is it not a good idea to put those
four functions in at this stage.

It would not break any code either :-)

 | Replies | Author | Date
78 | Re: OnRowChanged + OnRowChanging and OnColumnChan | Mike Lischke | Fri 1/5/2001


Row (Cell) Selection Color

From: "adem baba" [adembaba@e...]
Date: Sat Dec 23, 2000 5:34 am
Subject: Row (Cell) Selection Color

Mike,

Since you are aiming further than Windows (Linux), would it not be a
good idea to let us have the freedom to choose colors for selected
rows?

I know I could do that using events, but, hey...

 | Replies | Author | Date
79 | Re: Row (Cell) Selection Color | Mike Lischke | Fri 1/5/2001


problems with header

From: "Simon Lau" [jonarr@s...]
Date: Sun Dec 24, 2000 10:16 am
Subject: problems with header

Hi,

I've got a slight problem with VT (v1.29 and 1.31). Everytime i perform the
following steps using Delphi IDE, it crashes:

Create a TVirtualStringTree
Set RootNodeCount to 5
Make Header Visible
Add 5 columns (or 4)
Make last column not visible
Crash (hangs, no error - infinate loop it seems)

If i leave RootNodeCount to zero, it does not crash.
Also, it doesn't appear to crash if i make the first column not visible.

And if I have a program which has a StringTree configured in the same way as
above (but with all columns visible), and i have a button to make the last
column not visible, pressing the buton crashes the program (hangs - no
error)

I'll have a peek at the code to find out why (or try).

Anyway, Merry Christmas all.
simon

 | Replies | Author | Date
64 | Re: problems with header | Werner Lehmann | Sat 12/30/2000
82 | Re: problems with header | Mike Lischke | Fri 1/5/2001
100 | Re: problems with header | Werner Lehmann | Fri 1/5/2001
104 | Re: problems with header | Mike Lischke | Sat 1/6/2001


Selection colors ...

From: Dude [dude@a...]
Date: Mon Dec 25, 2000 4:24 pm
Subject: Selection colors ...

Excellent component! A joy to use! but ...

(v1.31) ... selected font color is hardcoded to white in procedure
TCustomVirtualStringTree.DoPaintNode(). Shouldn't it be clHighLightText? I
have trouble seeing the selected text as my system <clHighLight> color is
quite bright.

And another thing. It would be nice to have more control over selected node
colors. I don't want to interfere users system wide color selections, but I
have an implementation that needs node level #0 to not show selection
colors. Any ideas how to do this?

Best Regards,
Seppo Hurme

 | Replies | Author | Date
48 | Re: Selection colors ... | Ashley Clark | Mon 12/25/2000
49 | Re: Selection colors ... | Dude | Mon 12/25/2000
50 | Re: Selection colors ... | Ashley Clark | Mon 12/25/2000
51 | Re: Selection colors ... | Dude | Mon 12/25/2000
59 | Re: Selection colors ... | Ashley Clark | Wed 12/27/2000
60 | Re: Selection colors ... | Ashley Clark | Wed 12/27/2000
83 | Re: Selection colors ... | Mike Lischke | Fri 1/5/2001
81 | Re: Selection colors ... | Mike Lischke | Fri 1/5/2001


re: Selection colors ...

From: Ashley Clark [aclark@g...]
Date: Mon Dec 25, 2000 7:29 pm
Subject: Re: [VirtualTreeview] Selection colors ...

* Dude in "[VirtualTreeview] Selection colors ..." dated 2000/12/25
* 18:24 wrote:

> And another thing. It would be nice to have more control over
> selected node colors. I don't want to interfere users system wide
> color selections, but I have an implementation that needs node level
> #0 to not show selection colors. Any ideas how to do this?

Use OnPaintText event to paint the canvas if you're on a selected node
in level #0.

--
chalk slayer

Attachment
attachment
Type: application/pgp-signature
Size: 1k 		Download

 | Replies | Author | Date
49 | Re: Selection colors ... | Dude | Mon 12/25/2000
50 | Re: Selection colors ... | Ashley Clark | Mon 12/25/2000
51 | Re: Selection colors ... | Dude | Mon 12/25/2000
59 | Re: Selection colors ... | Ashley Clark | Wed 12/27/2000
60 | Re: Selection colors ... | Ashley Clark | Wed 12/27/2000
83 | Re: Selection colors ... | Mike Lischke | Fri 1/5/2001


re: Selection colors ...

From: Dude [dude@a...]
Date: Mon Dec 25, 2000 9:26 pm
Subject: Re: [VirtualTreeview] Selection colors ...

> > And another thing. It would be nice to have more control over
> > selected node colors. I don't want to interfere users system wide
> > color selections, but I have an implementation that needs node level
> > #0 to not show selection colors. Any ideas how to do this?
>
>Use OnPaintText event to paint the canvas if you're on a selected node
>in level #0.

OnPaintText doesn't seem to provide the node rectangle.

 | Replies | Author | Date
50 | Re: Selection colors ... | Ashley Clark | Mon 12/25/2000
51 | Re: Selection colors ... | Dude | Mon 12/25/2000
59 | Re: Selection colors ... | Ashley Clark | Wed 12/27/2000
60 | Re: Selection colors ... | Ashley Clark | Wed 12/27/2000
83 | Re: Selection colors ... | Mike Lischke | Fri 1/5/2001


re: Selection colors ...

From: Ashley Clark [aclark@g...]
Date: Mon Dec 25, 2000 10:11 pm
Subject: Re: [VirtualTreeview] Selection colors ...

* Dude in "Re: [VirtualTreeview] Selection colors ..." dated 2000/12/25
* 23:26 wrote:

> > > And another thing. It would be nice to have more control over
> > > selected node colors. I don't want to interfere users system wide
> > > color selections, but I have an implementation that needs node
> > > level #0 to not show selection colors. Any ideas how to do this?
> >
> >Use OnPaintText event to paint the canvas if you're on a selected
> >node in level #0.
>
> OnPaintText doesn't seem to provide the node rectangle.

Well, I can't say I do it correctly but this works for me.

begin
if (Sender.GetNodeLevel(Node) = 0) then
with Canvas do
begin
if TextType = ttStatic then
Font.Style := [fsItalic];

if (vsSelected in Node.States) and Sender.Focused then
Font.Color := clHighlightText
else
Font.Color := clBlue;
end;
end;

I use this in my own program and it works very well.

--
hacker sally

Attachment
attachment
Type: application/pgp-signature
Size: 1k 		Download

 | Replies | Author | Date
51 | Re: Selection colors ... | Dude | Mon 12/25/2000
59 | Re: Selection colors ... | Ashley Clark | Wed 12/27/2000
60 | Re: Selection colors ... | Ashley Clark | Wed 12/27/2000
83 | Re: Selection colors ... | Mike Lischke | Fri 1/5/2001


re: Selection colors ...

From: Dude [dude@a...]
Date: Mon Dec 25, 2000 10:27 pm
Subject: Re: [VirtualTreeview] Selection colors ...

> > > > And another thing. It would be nice to have more control over
> > > > selected node colors. I don't want to interfere users system wide
> > > > color selections, but I have an implementation that needs node
> > > > level #0 to not show selection colors. Any ideas how to do this?
> > >
> > >Use OnPaintText event to paint the canvas if you're on a selected
> > >node in level #0.
> >
> > OnPaintText doesn't seem to provide the node rectangle.
>
>Well, I can't say I do it correctly but this works for me.
>
>begin
> if (Sender.GetNodeLevel(Node) = 0) then
> with Canvas do
> begin
> if TextType = ttStatic then
> Font.Style := [fsItalic];
>
> if (vsSelected in Node.States) and Sender.Focused then
> Font.Color := clHighlightText
> else
> Font.Color := clBlue;
> end;
>end;
>
>I use this in my own program and it works very well.

Thanks for the snippet. Doesn't seem to do anything on my machine when node
is selected - I still get the default selection colors. Does your selected
font color change if you try another color in your <Font.Color :=
clHighlightText>?

 | Replies | Author | Date
59 | Re: Selection colors ... | Ashley Clark | Wed 12/27/2000
60 | Re: Selection colors ... | Ashley Clark | Wed 12/27/2000
83 | Re: Selection colors ... | Mike Lischke | Fri 1/5/2001


Using the node data

From: Werner Lehmann [wl@b...]
Date: Tue Dec 26, 2000 12:28 am
Subject: Using the node data

Hi list,

I have worked previously with a virtual listview and listbox and the
'virtual' concept is not new to me. Alas, I got some trouble with under-
standing the PVirtualNode data concept.

Consider the following requirements:
- a tree should contain the files of one directory as top level nodes
- each file should be represented by a simple class instance

Currently I use an extra TObjectList which is filled first (FindFirst,
-Next, -Close loop). Then I do NodeDataSize:=sizeof(pointer); and in
OnInitNode I have this:

procedure TMain.vtQueueInitNode(Sender: TBaseVirtualTree; ParentNode,
Node: PVirtualNode; var InitialStates: TVirtualNodeInitStates);
begin
TObject(Sender.GetNodeData(Node)^):=List[Node.Index];
end;

(List is a TObjectList which holds instances of a simple data container
class describing properties of a file).

This looks somehow awkward and although it works I am not sure if this
is the way to go.

How could I do the same without using an extra list? None of the examples
use a dedicated extra data structure. But I don't know how to do the
above without it. Would need a method "AddNode(const Data: pointer);"
to add a new object instance to the tree while the directory is scanned
for files but it does not exist.

I would not mind the extra list (to the contrary: I even prefer it). But
to keep the order of the items in list and in tree control in sync extra
(and error-prone) householding is needed. In my first tries with the tree
I simply ignored the data and relied solely on the Node.Index as I am used
to do with a virtual listview. But the drag-and-drop implementation got
quite complicated with all special cases of selected nodes and still having
to keep both list and tree in sync.

I finally managed to put something usable together but discovered that the
selected states of the dragged nodes stayed at their old places and did not
move with dragged nodes (of course). And because it looked already more
complicated than it should be I decided to try the data field of PVirtualNode^
and rely on the .MoveTo method which is probably designed for these cases.

Regards,
WL

 | Replies | Author | Date
56 | Re: Using the node data | Jeurk | Tue 12/26/2000
57 | Re: Using the node data | Werner Lehmann | Wed 12/27/2000
88 | Re: Using the node data | Mike Lischke | Fri 1/5/2001
101 | Re: Using the node data | Werner Lehmann | Fri 1/5/2001
106 | Re: Using the node data | Mike Lischke | Sat 1/6/2001
110 | Re: Using the node data | Werner Lehmann | Sat 1/6/2001


Drag-And-Drop: Solution and Bug

From: Werner Lehmann [wl@b...]
Date: Tue Dec 26, 2000 12:31 am
Subject: Drag-And-Drop: Solution and Bug

Hi,

I am playing around with drag and drop (within one tree only). Unfortunately
the examples don't work with 1.31 anymore and they don't even show how the
actual movement operation should be implemented (they allow DND but do not
perform a copy or move operation if I am not mistaken).

So I came up with this code (which works now, comments welcome of course):

procedure TMain.vtQueueDragDrop(Sender: TBaseVirtualTree; Source: TObject;
DataObject: IDataObject; const Formats: array of Word;
Shift: TShiftState; Pt: TPoint; var Effect: Integer; Mode: TDropMode);
begin
with Sender do
(*) if (Mode=dmBelow) or ((DropTargetNode=GetNextSibling(GetFirstSelected))
and (SelectedCount=1)) then
MoveSelected(Sender, DropTargetNode)
else
MoveSelected(Sender, GetPreviousSibling(DropTargetNode));
end;

procedure TMain.MoveSelected(Tree: TBaseVirtualTree; MoveBelowNode:
PVirtualNode);
var
SelectedNodes: TNodeArray;
i: integer;
begin
with Tree do begin
SelectedNodes:=GetSortedSelection(true);
for i:=0 to SelectedCount-1 do begin
if SelectedNodes[i]<>MoveBelowNode then
MoveTo(SelectedNodes[i], MoveBelowNode, amInsertAfter, false);
MoveBelowNode:=GetNextSibling(MoveBelowNode);
if MoveBelowNode=nil then MoveBelowNode:=GetFirstNode;
end;
ScrollIntoView(GetFirstSelected);
end;
end;

The line marked with (*) previously did not contain the part after the 'or',
which surfaced a bug in MoveTo (line #9019):

procedure TBaseVirtualTree.MoveTo(Source, Target: PVirtualNode; Mode:
TVTNodeAttachMode;
ChildrenOnly: Boolean);

If (Source=Target) we get an endless loop in InternalConnectNode (line #8748ff):

procedure TBaseVirtualTree.InternalConnectNode(Node, Destination: PVirtualNode;
Target: TBaseVirtualTree;
...
// reindex all following nodes (line #8805)
Run := Node;
while Assigned(Run) do
begin
Inc(Run.Index);
Run := Run.NextSibling;
end;
...

Somehow (Run=Run.NextSibling) holds here...

I suggest a check at the beginning of MoveTo.

Regards,
WL

PS: How can I prevent that the user can switch to a copy operation (if he keeps
the ctrl key pressed down)? I can show the 'disallowed' cursor if so but would
prefer to not allow showing the '+' in the first place...

 | Replies | Author | Date
87 | Re: Drag-And-Drop: Solution and Bug | Mike Lischke | Fri 1/5/2001
169 | Re: Drag-And-Drop: Solution and Bug | [HBender@E...] | Fri 1/12/2001
102 | Re: Drag-And-Drop: Solution and Bug | Werner Lehmann | Fri 1/5/2001
108 | Re: Drag-And-Drop: Solution and Bug | Mike Lischke | Sat 1/6/2001
170 | Re: Drag-And-Drop: Solution and Bug | Mike Lischke | Fri 1/12/2001


VirtalTreeView with C++ Builder 5

From: [ed@h...]
Date: Tue Dec 26, 2000 1:24 am
Subject: VirtalTreeView with C++ Builder 5

I use CB5 and would like to use VTV (looks cool). There's some kind
of problem, though, with IDataObject/IDropSource/IDropObject. The
hpp file has the following code:

public:
operator IDropTarget*(void) { return (IDropTarget*)&__IDropTarget; }
operator IDropSource*(void) { return (IDropSource*)&__IDropSource; }
operator IDataObject*(void) { return (IDataObject*)&__IDataObject; }

They all generate:
[C++ Error] VirtualTrees.hpp(422): E2076 Overloadable operator
expected

I tried commenting them out but get another error on this code:

typedef DynamicArray<TCacheEntry > TCache;
[C++ Error] VirtualTrees.hpp(462): E2451 Undefined
symbol 'TCacheEntry'
[C++ Error] VirtualTrees.hpp(462): E2299 Cannot generate template
specialization from 'DynamicArray<T>'

Has anybody successfully used VTV with CB5?

Thanks,
Ed Hamilton

 | Replies | Author | Date
86 | Re: VirtalTreeView with C++ Builder 5 | Mike Lischke | Fri 1/5/2001


Bug in TBaseVirtualTree.InvalidateToBottom

From: [kevin@i...]
Date: Tue Dec 26, 2000 10:48 am
Subject: Bug in TBaseVirtualTree.InvalidateToBottom

Hi,

Sometime I will got AV in TBaseVirtualTree.InvalidateToBottom
and I found the reason is that when InvalidateToBottom call
CompareNodePositions(Node, CurrentNode), the CurrentNode may be nil

Regards,
Kevin Lu

 | Replies | Author | Date
85 | Re: Bug in TBaseVirtualTree.InvalidateToBottom | Mike Lischke | Fri 1/5/2001


re: Using the node data

From: "Jeurk " [knipjo@h...]
Date: Tue Dec 26, 2000 10:49 pm
Subject: Re: Using the node data

Hi,
> How could I do the same without using an extra list? None of the
examples
> use a dedicated extra data structure.
You should take another look... Look at the advanced demo.

It shows a sample on how to work on files...
For examples the node data looks like that:

// node data record for the thumbnail treeview (VDT1)
PImageData = ^TImageData;
TImageData = record
FullPath: String;
IsFolder: Boolean;
OpenIndex,
CloseIndex: Integer; // image indices into the system image list
Image: TBitmap;
// some image properties, preformatted
Properties: String;
end;

> above without it. Would need a method "AddNode(const Data:
pointer);"
You should do an addnode first, they after that, or in the onINitNode
event
get the node data that was allocated to you by the tree, with a
Data := Sender.GetNodeData(Node);

after that if data is not nil, then you can store things in it:

// top level node, initialize first enumeration
Data.FullPath := ImageFolderLabel.Caption;
Data.IsFolder := True;

> I simply ignored the data and relied solely on the Node.Index as I
am used
that's not the good approach...

tell me if teh demos are not enought for you to understand...
the advanced demo shows a good approacg for directory walking in the
draw tree panel,
take a look at all the events...
good luck.

John.


re: Re: Using the node data

From: Werner Lehmann [wl@b...]
Date: Wed Dec 27, 2000 12:47 am
Subject: Re: [VirtualTreeview] Re: Using the node data

Jeurk wrote:
>
> > above without it. Would need a method "AddNode(const Data:
> pointer);"
> You should do an addnode first, they after that, or in the onINitNode
> event
> get the node data that was allocated to you by the tree, with a
> Data := Sender.GetNodeData(Node);

Doh. I was looking for a method AddNode (which could with this signature
only be part of a Node class type). Instead it is called AddChild and
does the same thing. Ok, that clears up some things...

> > I simply ignored the data and relied solely on the Node.Index as I
> am used
> that's not the good approach...

Why not? After all, the 'virtual' means more or less application owned
data and not Virtual Treeview owned data. It's the way in which virtual
listview and listbox work. Although even they provide data pointers for
each item. Just working with the indexes is not evil for simple lists.
It gets complicated for real trees though :)

> tell me if teh demos are not enought for you to understand...
> the advanced demo shows a good approacg for directory walking in the
> draw tree panel,
> take a look at all the events...
> good luck.

No, it's all clear now, thank you.

Regards,
WL


Missing OnFreeNode causes mem leaks?

From: Werner Lehmann [wl@b...]
Date: Wed Dec 27, 2000 8:52 am
Subject: Missing OnFreeNode causes mem leaks?

Hi,

I am testing to store a reference to a class instance in the
data part of a VirtualNode. Problem comes with freeing that
instance: if I start and immediately close the app OnFreeNode
will only be called for nodes which have been visible (about 70%
were invisible because I did not scroll down to them).

If I only use OnFreeNode for clean up code (destructor calling)
I get a memory leak of course.

Can fix that by setting the node to an initialized state manually:

Node:=vtQueue.AddChild(nil);
TObject(vtQueue.GetNodeData(Node)^):=TTest.Create(SR.Name);
Include(Node.States, vsInitialized);

Is this how it should be done? Somehow I would prefer a method
for that purpose.

If I am not mistaken even the advanced demo has this problem:
the drawtree gets populated by dynamic data which includes string
types (being reference counted). This data is only finalized in
OnFreeNode which will not be called for invisible nodes (nodes
which have not been scrolled into view; not non-existing child
nodes).

Note: I did not check that this is really the case with the
advanced demo since it is not compatible with v1.31 and I did
not make the necessary changes...

Regards,
WL

 | Replies | Author | Date
89 | Re: Missing OnFreeNode causes mem leaks? | Mike Lischke | Fri 1/5/2001
99 | Re: Missing OnFreeNode causes mem leaks? | Werner Lehmann | Fri 1/5/2001
105 | Re: Missing OnFreeNode causes mem leaks? | Mike Lischke | Sat 1/6/2001
109 | Re: Missing OnFreeNode causes mem leaks? | Werner Lehmann | Sat 1/6/2001
111 | Re: Missing OnFreeNode causes mem leaks? | Mike Lischke | Sat 1/6/2001
120 | Re: Missing OnFreeNode causes mem leaks? | Mike Lischke | Mon 1/8/2001


re: Selection colors ...

From: Ashley Clark [aclark@g...]
Date: Wed Dec 27, 2000 11:28 pm
Subject: Re: [VirtualTreeview] Selection colors ...

* Dude in "Re: [VirtualTreeview] Selection colors ..." dated 2000/12/26
* 00:27 wrote:

> Thanks for the snippet. Doesn't seem to do anything on my machine
> when node is selected - I still get the default selection colors.
> Does your selected font color change if you try another color in your
> <Font.Color := clHighlightText>?

Well, it works perfectly here. If I replace clHighlightText with clRed
then the static text when selected becomes red, just as expected. Do
you use any other drawing methods maybe? Or maybe you were expecting
the snippet to change both static and normal text colors? (Hint: it
only changes the static text color)

--
really hacks

Attachment
attachment
Type: application/pgp-signature
Size: 1k 		Download


re: Selection colors ...

From: Ashley Clark [aclark@g...]
Date: Wed Dec 27, 2000 11:31 pm
Subject: Re: [VirtualTreeview] Selection colors ...

* Dude in "Re: [VirtualTreeview] Selection colors ..." dated 2000/12/26
* 00:27 wrote:

> Thanks for the snippet. Doesn't seem to do anything on my machine
> when node is selected - I still get the default selection colors.
> Does your selected font color change if you try another color in your
> <Font.Color := clHighlightText>?

Excuse the last message I sent, apparently it only affects the static
text. Looks like a bug to me...

--
hacker sally

Attachment
attachment
Type: application/pgp-signature
Size: 1k 		Download


Some questions

From: Björn Lindell [bli@c...]
Date: Fri Dec 29, 2000 7:31 am
Subject: Some questions

Hello,
I have recently started using the TVirtualStringTree, and I have a bunch of
questions
that I have collected on the way.
(The questions apply to a project where I am using it as a TListView
replacement)

1) Node editing - editing other than the first column
I have multiple columns, but it seems only the first column will be
user-edited.
Just in case, I put Allowed := true in OnEditing, but it makes no
difference.
Are there any conflicting settings

2) Node editing - OnNewText
Is this the event to handle in order to change the underlying data?

3) Node editing - custom editors
I would like to have, for instance, a combobox and a TDateTimePicker as
editor, I know there are examples
in the demo source, but is there any "well-isolated" source for these that I
can integrate
easily into my existing project?

4) Node editing - editing multiple rows at once.
I don't expect this as a feature in the TVirtualTreeview, but in my current
project
I have a need of say, selecting a number of rows and then when the user
edits a column, the
change apply to all selected. Of course I know I could do this by having a
dialog box
for editing, but is there some more treeview-integrated approach?

5) Double-click on column separator in header
Is there a way to get the same effect as in the ordinary TListview, that
when
one double-clicks the column-separator in the header, the column
automatically
resizes according to the size of the largest entry in the column?

6) Autosizing of columns
Is there a way to get the columns to automatically adjust their width to the
size of
a) Their header caption
b) The row with the largets column entry
as similar to the TListview properties

7) Data connected to TVirtualTreeColumn
I found that I needed to have "structural information" connected to each
column,
for instance "display format" etc. I solved this by adding a new property
"Data : TObject"
to the class and then when adding columns in run-time, setting this
Data-property
to my custom class that defined this information.
Is there currently a better way to do this without me having to adjust the
sources
in "VirtualTrees.pas"?
I would rather prefer to derive a subclass of TVirtualTreeColumn that had
this property
and was defined in my own source, but when adding columns,
TVirtualTreeColumn is
always used as far as I can see (it is defined by "inherited
Create(TVirtualTreeColumn)"
in "TVirtualTreeColumns.create")

8) Column numbering
In for instance the "OnGetText" event, there is a "Column : integer"
argument,
being the index of the column. Is this the index of the visible order of
columns or is
it the original order of columns? If the user moves a column from say third
place to
first place, will the Column value be "0" instead of "2" or will it still be
"2"? Also,
what happens if columns are hidden?
On the other hand, if the index is kept the same regardless of reorderings,
how can
one programmatically find out the ordering of the columns (for instance in
order to
save the changes made by a user)

9) Problem (maybe not fault of TVirtualTreeView)
I found that if I tried debugging my own procedures called during OnGetText
from
within Delphi, the application and Delphi (and sometimes Windows) would
completely
lock up. Now, I want to stress I am not certain this is because of
TVirtualTreeView,
but are there any known issues with debugging code triggered by for instance
display
events in TVirtualTreeView? This happened on Win98

Regards,
Björn Lindell

 | Replies | Author | Date
65 | Re: Some questions | Werner Lehmann | Sat 12/30/2000
68 | Re: Some questions | Jeurk | Sat 12/30/2000
67 | Re: Some questions | =?iso-8859-1?Q?Bj=F6rn_Lindel | Sat 12/30/2000
90 | Re: Some questions | Mike Lischke | Fri 1/5/2001


Iterating through items?

From: [soli@m...]
Date: Fri Dec 29, 2000 2:26 pm
Subject: Iterating through items?

Hi All,

i can't find out how can I iterate through
the treeview's items? Somehow like in the old
style treeviews:

for i:=0 to tree.Items.Count-1 do
begin
..
end;

Thanks in advance,
Söli

 | Replies | Author | Date
63 | Re: Iterating through items? | Werner Lehmann | Sat 12/30/2000
69 | Re: Iterating through items? | Jeurk | Sat 12/30/2000
91 | Re: Iterating through items? | Mike Lischke | Fri 1/5/2001


re: Iterating through items?

From: Werner Lehmann [wl@b...]
Date: Sat Dec 30, 2000 12:13 am
Subject: Re: [VirtualTreeview] Iterating through items?

[soli@m...] wrote:
>
> Hi All,
>
> i can't find out how can I iterate through
> the treeview's items? Somehow like in the old
> style treeviews:
>
> for i:=0 to tree.Items.Count-1 do
> begin
> ..
> end;

Well. I guess you must go through all chained lists recursively.
TBaseVirtualTree.IterateSubtree does that for you if you provide
a callback function (for instance a local function).

It would probably be quite an impact on the performance if an
absolute index would have to be maintained for all nodes. Especially
on big lists where each structure change (insert, delete) would
mean a change to all subsequent nodes.

WL


re: problems with header

From: Werner Lehmann [wl@b...]
Date: Sat Dec 30, 2000 12:55 am
Subject: Re: [VirtualTreeview] problems with header

Simon Lau wrote:
>
> Hi,
>
> I've got a slight problem with VT (v1.29 and 1.31). Everytime i perform the
> following steps using Delphi IDE, it crashes:
>
> Create a TVirtualStringTree
> Set RootNodeCount to 5
> Make Header Visible
> Add 5 columns (or 4)
> Make last column not visible
> Crash (hangs, no error - infinate loop it seems)

Yes, error is reproducible.

I suggest this fix:

//------------------------------------------------------------------------------\
----------------------------------------

procedure TBaseVirtualTree.AdjustPaintCellRect(Node: PVirtualNode;
ColumnPosition: Integer; var NextNonEmpty: Integer;
var ClipRect: TRect);

// used in descendants to modify the clip rectangle of the current column while
painting a certain node

begin
NextNonEmpty := ColumnPosition + 1;

// (WL) fix to avoid endless loop if last column is invisible
with FHeader.FColumns do
while (NextNonEmpty < Count) and not (coVisible in
Items[NextNonEmpty].FOptions) do
inc(NextNonEmpty);
end;

//------------------------------------------------------------------------------\
----------------------------------------

WL


re: Some questions

From: Werner Lehmann [wl@b...]
Date: Sat Dec 30, 2000 1:00 am
Subject: Re: [VirtualTreeview] Some questions

Björn Lindell wrote:
>
> 1) Node editing - editing other than the first column
> I have multiple columns, but it seems only the first column will be
> user-edited.
> Just in case, I put Allowed := true in OnEditing, but it makes no
> difference.
> Are there any conflicting settings

Simply set options voEditable and voExtendedFocus.

> 2) Node editing - OnNewText
> Is this the event to handle in order to change the underlying data?

No. If you data has to be changed, simply change your data. If you want
to update the node then, call InvalidateNode or Invalidate.

Hm, checking this code returns this:

FOnNewText: TVSTNewTextEvent; // used to notify the application about an
edited node caption

So this should be pretty self explaining.

> in the demo source, but is there any "well-isolated" source for these that I

Well-isolated? Don't know what you mean but probably not.

> 4) Node editing - editing multiple rows at once.
> I don't expect this as a feature in the TVirtualTreeview, but in my current
> project
> I have a need of say, selecting a number of rows and then when the user
> edits a column, the
> change apply to all selected. Of course I know I could do this by having a
> dialog box
> for editing, but is there some more treeview-integrated approach?

Not very desirable GUI wise. The inplace editor would only be on one node (you
can have
only one caret anyway) but the change would go to more than one. I suggest you
group by
that common data column (make it one node with child nodes) and just edit that
one.

> 5) Double-click on column separator in header
> Is there a way to get the same effect as in the ordinary TListview, that
> when
> one double-clicks the column-separator in the header, the column
> automatically
> resizes according to the size of the largest entry in the column?

I back that. No way with built-in capabilities as far as I can see. Possible
drawback: the text(widths) of all nodes in that column would have to be
retrieved.
Big list => bad idea.

> 6) Autosizing of columns
> Is there a way to get the columns to automatically adjust their width to the
> size of
> a) Their header caption
> b) The row with the largets column entry
> as similar to the TListview properties

I don't see a built-in one but it would be nice (and would have the same problem
as with your previous question). I suggest you just implement it? :)

> 7) Data connected to TVirtualTreeColumn
> I found that I needed to have "structural information" connected to each
> column,
> for instance "display format" etc. I solved this by adding a new property
> "Data : TObject"
> to the class and then when adding columns in run-time, setting this
> Data-property
> to my custom class that defined this information.
> Is there currently a better way to do this without me having to adjust the
> sources
> in "VirtualTrees.pas"?

Hm, I would strongly suggest that Mike adds a Tag or Data property. I am also
used to it from the QuantumGrid of DevExpress.

> 8) Column numbering
> In for instance the "OnGetText" event, there is a "Column : integer"
> argument,
> being the index of the column. Is this the index of the visible order of
> columns or is
> it the original order of columns? If the user moves a column from say third
> place to
> first place, will the Column value be "0" instead of "2" or will it still be
> "2"? Also,
> what happens if columns are hidden?
> On the other hand, if the index is kept the same regardless of reorderings,
> how can
> one programmatically find out the ordering of the columns (for instance in
> order to
> save the changes made by a user)

Dunno, but I will need to know this soon as well. But this is just a matter of
try and see (or examine source).

> 9) Problem (maybe not fault of TVirtualTreeView)
> I found that if I tried debugging my own procedures called during OnGetText
> from
> within Delphi, the application and Delphi (and sometimes Windows) would
> completely
> lock up. Now, I want to stress I am not certain this is because of
> TVirtualTreeView,
> but are there any known issues with debugging code triggered by for instance
> display
> events in TVirtualTreeView? This happened on Win98

No lock-ups on Win2k here.

WL

 | Replies | Author | Date
68 | Re: Some questions | Jeurk | Sat 12/30/2000


Reenviar: Please reply to unsubscribe from VirtualTreeview

From: [JoseRobl@i...]
Date: (Date Unavailable)
Subject: Reenviar: Please reply to unsubscribe from VirtualTreeview

_______________________________________________________________
Date de alta en inicia y dispondrás de correo y espacio para tu página
personal. http://inicia.es
From: eGroups Notification [confirm-unsub-WJaLNTY-GpI5niSJPJiBfvLnNFA@egroups.com>
Date: Thu Dec 28, 2000 12:06 am
Subject: Please reply to unsubscribe from VirtualTreeview
To: [JoseRobl@i...]

Hello,

We have received a request from you to unsubscribe from the
VirtualTreeview group. Please confirm your request by
replying to this message. If you do not wish to unsubscribe from
VirtualTreeview, please ignore this message.

Regards,

eGroups Customer Support
VCard
Moreno Robles José Luis [JoseRobl@i...]

N/A

 Plaza Lluis Companys Nº2 1ºB
Montornes
Barna
08170
Spain
 Work: 935722214

Replies Author Date


re: Some questions

From: Björn Lindell [bli@c...]
Date: Sat Dec 30, 2000 10:27 am
Subject: Re: [VirtualTreeview] Some questions

Just want to point out I am no stranger to searching through the
source code looking for answers, but since I am new to the
VirtualTreeview, I am keen to learn to do stuff "the right way",
even if I can figure out some work-around way etc.

I am also no stranger to implementing extensions to the tree myself,
it is just that I want to wait until I have a better knowledge of the
component before starting to do it, in order to write better code.

----- Original Message -----
From: "Werner Lehmann" [wl@b...]
To: <VirtualTreeview@egroups.com>
Sent: Saturday, December 30, 2000 2:00 AM
Subject: Re: [VirtualTreeview] Some questions

> Simply set options voEditable and voExtendedFocus.

Did the trick (I missed out on the "voExtendedFocus" thing)

>
> > in the demo source, but is there any "well-isolated" source for these
that I
>
> Well-isolated? Don't know what you mean but probably not.

I mean, I was looking for a self-contained add-on unit with in-place
editors, instead of trying to extract the goods from an existing demo where
the in-place editing stuff is mixed with other stuff. I ask this also as
mentioned
above for the reason that I want to do it "the right way". When I glanced
att the advanced demo that had in-place editors I found code that
overrides window message loops and such functions, which might be necessary,
but since I anticipate a wrong move with this may cause serious
hard-to-detect
problems I was looking for a well-tested existing solution rather than
trying
to recreate it myself.

>
> > 4) Node editing - editing multiple rows at once.
> > I don't expect this as a feature in the TVirtualTreeview, but in my
current
> > project
> > I have a need of say, selecting a number of rows and then when the user
> > edits a column, the
> > change apply to all selected. Of course I know I could do this by having
a
> > dialog box
> > for editing, but is there some more treeview-integrated approach?
>
> Not very desirable GUI wise. The inplace editor would only be on one node
(you can have
> only one caret anyway) but the change would go to more than one. I suggest
you group by
> that common data column (make it one node with child nodes) and just edit
that one.
>
I agree with the GUI point, I am just asking for ideas here. The grouping
would not work,
since all columsn should be editable, and it should be possible to edit
several nodes even
if they don't share the same column data.

I have currently made a separate TFrame that is used to editing one or more
nodes
(as in the Delphi Object Inspector, although extremely simplistic).

I am thinking about implementing a parallell TVirtualTreeView,
with just one node and exactly the same columns as in the main tree,
and each column in that node gets its contents from the corresponding
column in the main tree. If more than one node is selected in the main tree,
the column value
will be blank unless all selected nodes has the same value in that column
(or maybe I'll always
use the value of the first node selected, not decided yet)

> > 5) Double-click on column separator in header
> > Is there a way to get the same effect as in the ordinary TListview, that
> > when
> > one double-clicks the column-separator in the header, the column
> > automatically
> > resizes according to the size of the largest entry in the column?
>
> I back that. No way with built-in capabilities as far as I can see.
Possible
> drawback: the text(widths) of all nodes in that column would have to be
retrieved.
> Big list => bad idea.

I agree with the drawback, to get similar effect to TListview one would need
to
initialize all uninitialized nodes as well to get to the correct width.
In order to get it working it seems one need to put a new event in
"virtualtrees.pas" for
"OnHeaderSplitterDblClick" or so, since both single
and double click on header splitter today is used only as a means of
starting the
"manual resize".
Then in the event handler one could do the actual resizing

>
> > 6) Autosizing of columns
> > Is there a way to get the columns to automatically adjust their width to
the
> > size of
> > a) Their header caption
> > b) The row with the largets column entry
> > as similar to the TListview properties
>
> I don't see a built-in one but it would be nice (and would have the same
problem
> as with your previous question). I suggest you just implement it? :)

Maybe I will... (but it will have to wait until next year...)

/Björn


re: Some questions

From: "Jeurk " [knipjo@h...]
Date: Sat Dec 30, 2000 3:29 pm
Subject: Re: Some questions

> > 2) Node editing - OnNewText
> > Is this the event to handle in order to change the underlying
data?
This is just a way to know that the user has edited the text of a node
and has pressed enter. for example when you rename a file or
something. You should rename the linked file for real in that event
I think.

> > in the demo source, but is there any "well-isolated" source for
these that I
This is maybe a problem with a demos that tries to give you more then
just the basics.
But I agree, the demos should be split, or at least should use more
units...But we can try to do this. Let's just way the next demo
update to try to do it.

> > 5) and 6) also Double-click on column separator in header
> > Is there a way to get the same effect as in the ordinary
TListview, that
Mike says that this is against his virtual concept. Because, it's
possible
that all the nodes are still not initialized. In fact the only nodes
that we are sure they are initialized are the one we can see.
So to do your effect we should initialized all the nodes in the
whole tree, that is not acceptable. You would say, so just do it
for the visible nodes. I agree with that. Also we cannot do it
automatically
because that way the size of the header would constantly change
to adapt to the nodes width...

> > 8) Column numbering
> > how can
> > one programmatically find out the ordering of the columns (for
instance in
> > order to
> > save the changes made by a user)
I use something like that to be sure I always get the right text
for the right column:
if TVirtualStringTree(Sender).Header.Columns[Column].Text = 'Name'
then
begin
Text := P^.PNode.Site_display_name;
end;
This uses some more time but works in all cases.

John.


re: Iterating through items?

From: "Jeurk " [knipjo@h...]
Date: Sat Dec 30, 2000 3:34 pm
Subject: Re: Iterating through items?

> i can't find out how can I iterate through
> the treeview's items? Somehow like in the old
> style treeviews:
>
> for i:=0 to tree.Items.Count-1 do
> begin
> ..
> end;

Hi,
I would suggest something like that:

procedure test;
var
P: PVirtualNode;
begin
P := vst.GetFirstNode;
while P <> nil do
begin
//your stuff on the node

//then go to the next
P := vst.GetNext(P);
end;
end;

This will get you all the nodes hidden or not, visible or not.
The side effect with such a stuff is always that after that all
the nodes of your tree will be initialized...But we may not care :)
John.

 | Replies | Author | Date
91 | Re: Iterating through items? | Mike Lischke | Fri 1/5/2001


John's Bug report with sample...

From: "Jonx" [knipjo@h...]
Date: Sat Dec 30, 2000 4:30 pm
Subject: John's Bug report with sample...

Hi all,
May I suggest something guys ???
I can see that we all have nice suggestions to do...
that we have found some bugs...
And that some of us even solved some bugs...
This will be quite a work for Mike when he comes back
from hollydays :)
So my suggestion would be that each of you (if you want of course)
should post a message again, but that will give a complete list
of all the bugs/suggestion/solution he gave since a while and that are
still not solved...
A good thing would also be that you join a small sample
source + exe in a zip file
showing for exemple all the bugs you talk about (if you can of course)
But I think this would be something cool for Mike, and
something cool for us
because we could get some fast update from Mike (at least
faster if he has
to try to reproduce all the things we sent him)....
Of course, don't forget to tell which version you are using
and about which tree
you are talking...
See you all next year...
John.

PS: by the way, someone was requesting a small sample of how
to load a table in a tree...
Look at my sample, it's a very simplistic demo.

So my bug list is here :
ver 1.31
stringtree:
When you try to select programmaticaly a node, let's say by a
button click
then the node nor the tree will not show any selection or
focus. The only way
this will work is to select a node in the tree one time by
mouse, after that the selection
stuff is showing something...

I cannot show a simple sample of that bug, I could give a
bigger out...
The problem is that when I try to select nodes in my tree
starting from under the tree
going up the tree, then when my mouse reaches the last node
then I get some exceptions
index out of the list (-1)

When you change the selection of one node, all the nodes are
redrawn, is this normal ??

When you select a node the icon and the line are no longer
drawn for the selected node
I cannot find what option makes this... but you can look in
my sample...Maybe it's just
a bug that comes from the fact that my tree has survived more
then one version and
that if I create if from scratch it will work ???

And here is the attached sample...

Attachment
bugs john 30-12-2000.zip
Type: application/x-zip-compressed
Size: 408k 		Download

Attachment
mouse select bug.jpg
Type: image/jpeg
Size: 17k 		Download

 | Replies | Author | Date
71 | Re: John's Bug report with sample... | Werner Lehmann | Mon 1/1/2001
95 | Re: John's Bug report with sample... | Mike Lischke | Fri 1/5/2001
92 | Re: John's Bug report with sample... | Mike Lischke | Fri 1/5/2001
98 | Re: John's Bug report with sample... | Werner Lehmann | Fri 1/5/2001


re: John's Bug report with sample...

From: Werner Lehmann [wl@b...]
Date: Mon Jan 1, 2001 3:38 pm
Subject: Re: [VirtualTreeview] John's Bug report with sample...

John,

Jonx wrote:
>
> So my suggestion would be that each of you (if you want of course)
> should post a message again, but that will give a complete list
> of all the bugs/suggestion/solution he gave since a while and that are
> still not solved...

well, it's not like the traffic on this list would exceed 0.71 msgs/day? :)

> A good thing would also be that you join a small sample
> source + exe in a zip file
> showing for exemple all the bugs you talk about (if you can of course)
> But I think this would be something cool for Mike, and
> something cool for us
> because we could get some fast update from Mike (at least
> faster if he has
> to try to reproduce all the things we sent him)....
> Of course, don't forget to tell which version you are using
> and about which tree
> you are talking...

Understand what you are pointing at and probably a good idea. But see below...

> PS: by the way, someone was requesting a small sample of how
> to load a table in a tree...
> Look at my sample, it's a very simplistic demo.

Please, do not post large mails to the list (580K ist definitely large).
There is a better alternative: egroups provides a common file area, just
upload your files to the VirtualTreeview list file space.

> I cannot show a simple sample of that bug, I could give a
> bigger out...
> The problem is that when I try to select nodes in my tree
> starting from under the tree
> going up the tree, then when my mouse reaches the last node
> then I get some exceptions
> index out of the list (-1)

The same thing just happened to me. It turned out that the error was
caused by this line:

function TBaseVirtualTree.HandleDrawSelection(X, Y: Integer): Boolean;
...
if WithImages and (DoGetImageIndex(Run, ikNormal, -1) > -1) then
...

This results in a OnGetImageIndex event with the Column parameter being -1.
Don't know what this should mean at all. Anyway, after I checked for that
value in my event handler the error was gone so I suggest you try that as
well.

Mike, why do you send a -1 Column to the event handler? I can only imagine
that this could be for the case when UseColumns was false but it is not (in
my application).

> When you select a node the icon and the line are no longer
> drawn for the selected node
> I cannot find what option makes this... but you can look in
> my sample...Maybe it's just
> a bug that comes from the fact that my tree has survived more
> then one version and
> that if I create if from scratch it will work ???

I had the very same problem which made me search for options and looking into
the tree sources for hours. Updating to 1.31 solved that.

> And here is the attached sample...

Which would look better in the egroups list file space.

BTW, egroups also provides a chat applet for all list members if the need for
some real time communication arises sometime...

Regards,
WL

 | Replies | Author | Date
95 | Re: John's Bug report with sample... | Mike Lischke | Fri 1/5/2001


re: Digest Number 19

From: "knipper john" [knipjo@h...]
Date: Tue Jan 2, 2001 7:49 pm
Subject: Re: [VirtualTreeview] Digest Number 19

>Please, do not post large mails to the list (580K ist definitely large).
>There is a better alternative: egroups provides a common file area, just
>upload your files to the VirtualTreeview list file space.
You are definitelly right.. I'm sorry guys, I did not thought it will send
my sample to all of you...Even if it's logic :(
I will post it to the common file area next time...
Sorry again.

>The same thing just happened to me. It turned out that the error was
>caused by this line:
Ok thanks. It's working for me also...

John.

_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.


Small memory leak ?

From: [pchessa@p...]
Date: Thu Jan 4, 2001 8:46 am
Subject: Small memory leak ?

Hi Mike,

Looks like the FScrollBarOptions member created in
"TBaseVirtualTree.Create" is never freed.
Am I wrong?
(I'm using v1.31)

Best regards

 | Replies | Author | Date
93 | Re: Small memory leak ? | Mike Lischke | Fri 1/5/2001


Sort Method

From: [cahaya.h@b...]
Date: Thu Jan 4, 2001 3:22 pm
Subject: Sort Method

How to use sort method ? Please give some example.

Thx.

 | Replies | Author | Date
75 | Re: Sort Method | Werner Lehmann | Fri 1/5/2001
94 | Re: Sort Method | Mike Lischke | Fri 1/5/2001
123 | Re: Sort Error | [gpan@c...] | Mon 1/8/2001


re: Sort Method

From: Werner Lehmann [wl@b...]
Date: Fri Jan 5, 2001 9:00 am
Subject: Re: [VirtualTreeview] Sort Method

[cahaya.h@b...] wrote:
>
> How to use sort method ? Please give some example.

This is how I do it.

procedure SortTree(Tree: TVirtualStringTree; Ascending: boolean);
var Dummy: TDummy;

procedure SortNode(Parent: PVirtualNode);
var Child: PVirtualNode;
begin
Child:=Tree.GetFirstChild(Parent);
while Child<>nil do begin
SortNode(Child);
Child:=Tree.GetNextSibling(Child);
end;
Tree.Sort(Parent, 0, Ascending, Dummy.CompareFunction, false);
end;

begin
Dummy:=TDummy.Create;
try
SortNode(nil);
finally
Dummy.Free;
end;
end;

The Dummy object is only needed because the compare function is a method
pointer not a function pointer like in other cases in the VCL. If you do
the sorting in a method of your form class you can just pass the name of
the compare method and drop all that dummy stuff (including the try...
finally).

In any case, here's how the compare function looks like:

function TDummy.CompareFunction(Sender: TBaseVirtualTree; Node1, Node2:
PVirtualNode; Column: integer): integer;
var Obj1, Obj2: TObject;
begin
Obj1:=GetObject(Sender, Node1);
Obj2:=GetObject(Sender, Node2);
if (Obj1 is TNodeData) then
if (Obj2 is TRow) then
result:=-1
else {(Obj2 is TNodeData)}
result:=AnsiCompareText(TNodeData(Obj1).Text, TNodeData(Obj2).Text)
else
if (Obj2 is TNodeData) then
result:=1
else {(Obj2 is TRow)}
result:=AnsiCompareText(TRow(Obj1).Columns[Column].Text,
TRow(Obj2).Columns[Column].Text);
end;

You just have to extract the sort criteria out of Node1 and Node2 and
compare them. If they are strings you can use AnsiCompareText as I did.

Regards,
WL

 | Replies | Author | Date
94 | Re: Sort Method | Mike Lischke | Fri 1/5/2001
123 | Re: Sort Error | [gpan@c...] | Mon 1/8/2001


Custom drawing in TVirtualStringTree

From: "Philippe Chessa" [pchessa@p...]
Date: Fri Jan 5, 2001 11:31 am
Subject: Custom drawing in TVirtualStringTree

Hi all,

I spent several hours uselessly to do the following and was not able
to find an example in the various demos projects:
I have a VirtualStringTree and I would like to change the way some
texts are drawn.
I can change the font for example with the OnPaintText event but how
can I change the text position (I would like to simulate LeftJustify
or RightJustify). I tried to change the CellRect or ItemRect in the
different On(Before|After)(Cell|Item)Paint but with no effect.

Thank you very much in advance for your help

Philippe

 | Replies | Author | Date
77 | Re: Custom drawing in TVirtualStringTree | [jascha@c...] | Fri 1/5/2001
84 | Re: Custom drawing in TVirtualStringTree | Philippe Chessa | Fri 1/5/2001
112 | Re: Custom drawing in TVirtualStringTree | [jascha@c...] | Sat 1/6/2001
96 | Re: Custom drawing in TVirtualStringTree | Mike Lischke | Fri 1/5/2001
113 | Custom drawing in TVirtualStringTree | Jascha Gordon | Sat 1/6/2001
114 | Re: Custom drawing in TVirtualStringTree | Mike Lischke | Sat 1/6/2001
115 | Re: Custom drawing in TVirtualStringTree | Mike Lischke | Sat 1/6/2001
119 | Re: Custom drawing in TVirtualStringTree | Will Watts | Mon 1/8/2001
116 | Re: Custom drawing in TVirtualStringTree | [jascha@c...] | Sun 1/7/2001


re: Custom drawing in TVirtualStringTree

From: [jascha@c...]
Date: Fri Jan 5, 2001 3:16 pm
Subject: Re: Custom drawing in TVirtualStringTree

Phillipe,

I have recently added a column alignment property to the base
treeview and string treeview - it aligns the header and contents in
the string treeview. I have also added a few other things such as
fixed columns a OnHeaderDragOver event.

I have not fully tested it yet - the only bug I am aware of is that
it does not work if you are using static text as well as 'normal'
text.

I can send you a copy if you want.

Jascha

 | Replies | Author | Date
84 | Re: Custom drawing in TVirtualStringTree | Philippe Chessa | Fri 1/5/2001
112 | Re: Custom drawing in TVirtualStringTree | [jascha@c...] | Sat 1/6/2001


re: OnRowChanged + OnRowChanging and OnColumnChanged and OnColumnChanging

From: "Mike Lischke" [public@l...]
Date: Fri Jan 5, 2001 3:56 pm
Subject: RE: [VirtualTreeview] OnRowChanged + OnRowChanging and OnColumnChanged and OnColumnChanging

Hi Adem,

> OnFocusChanged and OnFocusChanging are useful, but, what if I am
> testing whether the user changed (or is about to change) row or
> column.
>
> OK, OnFocusChanging does --sort of-- help for column change issue,
> but how do I do it for rows, and is it not a good idea to put those
> four functions in at this stage.
>
> It would not break any code either :-)

But it would introduce redundancy. OnFocusChanging does carry all information
you need. You'll get
the old and the new node (row change) and the old and new column (column
change). The only flaw in
this concept is that currently OnFocusChanging is called twice for a node if
mouse selecting. I will
fix this soon.

Ciao, Mike


re: Row (Cell) Selection Color

From: "Mike Lischke" [public@l...]
Date: Fri Jan 5, 2001 3:56 pm
Subject: RE: [VirtualTreeview] Row (Cell) Selection Color

> Since you are aiming further than Windows (Linux), would it not be a
> good idea to let us have the freedom to choose colors for selected
> rows?

Actually, by using clBtnFace you are free to pick the color. It is a kind of
"virtual" color which
uses what the user set in his/her system. Under Linux there will surely be a
similar mechanism (be
it integrated in KDE, Gnome etc. or not). What I'm more concerned about is the
OLE stuff, which is
not available under Linux (a big disadvantage).

You should be aware that the various customization events have been introduced
for exactly that
goal: to modify colors, layout etc. to your needs.

Ciao, Mike


re: Rel 1.31 virtual draw tree seems not perfect

From: "Mike Lischke" [public@l...]
Date: Fri Jan 5, 2001 3:56 pm
Subject: RE: [VirtualTreeview] Rel 1.31 virtual draw tree seems not perfect

> I tryed the latest version you released, and it seems to me
> that the drawtree is not drawing very good. I admit that
> it's working in your demos, but not in my programm.

Mmmh, very risky conclusion. The tree works in one implementation but in
another it does not, so the
tree is bad? I will not exclude that this might be the case but isn't it much
more likely that the
implementation where it does not work is bad/wrong/erronous?

> The problem is that I can only select the first node of my tree,
> the others are unseltable and even hardly drawn...

Sounds really strange. Can you make a demo and upload it to the file area of
eGroups? The I and
other interested parties may have a look to see what's wrong.

> The only thing that I will lack is the ability to set the nodes
> height. Doesn't matter that much...

Hu? The node height is not a feature of the draw tree, but of the base tree, so
you can use it in
the string tree too.

Ciao, Mike


re: Selection colors ...

From: "Mike Lischke" [public@l...]
Date: Fri Jan 5, 2001 3:56 pm
Subject: RE: [VirtualTreeview] Selection colors ...

Hi Seppo,

> Excellent component! A joy to use! but ...

Yes, yes, more ;-) But seriously, thank your for the compliment!

> (v1.31) ... selected font color is hardcoded to white in procedure
> TCustomVirtualStringTree.DoPaintNode(). Shouldn't it be clHighLightText? I
> have trouble seeing the selected text as my system <clHighLight> color is
> quite bright.

I have already fixed this but not yet published.

> And another thing. It would be nice to have more control over selected node
> colors. I don't want to interfere users system wide color selections, but I
> have an implementation that needs node level #0 to not show selection
> colors. Any ideas how to do this?

The colors should reflect the tasks they indicate. You must have a reason why
you don't want to show
selection at level 0. Perhaps disabling all nodes at level 0 helps.

Ciao, Mike


re: problems with header

From: "Mike Lischke" [public@l...]
Date: Fri Jan 5, 2001 3:56 pm
Subject: RE: [VirtualTreeview] problems with header

Hi Simon,

> I've got a slight problem with VT (v1.29 and 1.31). Everytime i perform the
> following steps using Delphi IDE, it crashes:
>
> Create a TVirtualStringTree
> Set RootNodeCount to 5
> Make Header Visible
> Add 5 columns (or 4)
> Make last column not visible
> Crash (hangs, no error - infinate loop it seems)

I tried this out and found it to be a bug. The NextColIndex variable is not set
for invisible nodes
which causes this behaviour. I will fix this soon. Thank you for the report.

Ciao, Mike


re: Selection colors ...

From: "Mike Lischke" [public@l...]
Date: Fri Jan 5, 2001 3:56 pm
Subject: RE: [VirtualTreeview] Selection colors ...

>
> Thanks for the snippet. Doesn't seem to do anything on my machine when node
> is selected - I still get the default selection colors. Does your selected
> font color change if you try another color in your <Font.Color :=
> clHighlightText>?

Mmmh, perhaps there should really be some more color properties. Which one
would you like to see
too? Is it a good idea to enlarge the already long list of properties just to
have some colors to
pick? Is this not too specific? I assume only very few people will ever change
the selection color
etc.

Ciao, Mike


re: Custom drawing in TVirtualStringTree

From: "Philippe Chessa" [pchessa@p...]
Date: Fri Jan 5, 2001 3:56 pm
Subject: Re: Custom drawing in TVirtualStringTree

--- In [VirtualTreeview@egroups.com, [jascha@c...] wrote:
> Phillipe,
>
> I have recently added a column alignment property to the base
> treeview and string treeview - it aligns the header and contents in
> the string treeview. I have also added a few other things such as
> fixed columns a OnHeaderDragOver event.
>
> I have not fully tested it yet - the only bug I am aware of is that
> it does not work if you are using static text as well as 'normal'
> text.
>
> I can send you a copy if you want.
>
> Jascha

Jascha,

Thanks for the reply. I would be pleased to receive a copy.
But does it mean that what I tried to do is not possible with the
standard version?

Cheers

Replies Author Date


re: Bug in TBaseVirtualTree.InvalidateToBottom

From: "Mike Lischke" [public@l...]
Date: Fri Jan 5, 2001 3:56 pm
Subject: RE: [VirtualTreeview] Bug in TBaseVirtualTree.InvalidateToBottom

Hi Kevin,

> Sometime I will got AV in TBaseVirtualTree.InvalidateToBottom
> and I found the reason is that when InvalidateToBottom call
> CompareNodePositions(Node, CurrentNode), the CurrentNode may be nil

Thank you for this report. I will have a look at the problem.

Ciao, Mike


re: VirtalTreeView with C++ Builder 5

From: "Mike Lischke" [public@l...]
Date: Fri Jan 5, 2001 3:56 pm
Subject: RE: [VirtualTreeview] VirtalTreeView with C++ Builder 5

Hi Ed,

> I use CB5 and would like to use VTV (looks cool). There's some kind
> of problem, though, with IDataObject/IDropSource/IDropObject. The
> hpp file has the following code:
>
> public:
> operator IDropTarget*(void) { return (IDropTarget*)&__IDropTarget; }
> operator IDropSource*(void) { return (IDropSource*)&__IDropSource; }
> operator IDataObject*(void) { return (IDataObject*)&__IDataObject; }
>
> They all generate:
> [C++ Error] VirtualTrees.hpp(422): E2076 Overloadable operator
> expected
>
> I tried commenting them out but get another error on this code:
>
> typedef DynamicArray<TCacheEntry > TCache;
> [C++ Error] VirtualTrees.hpp(462): E2451 Undefined
> symbol 'TCacheEntry'
> [C++ Error] VirtualTrees.hpp(462): E2299 Cannot generate template
> specialization from 'DynamicArray<T>'
>
> Has anybody successfully used VTV with CB5?

I'm not sure whether I already answered this to you or anyone else. AFAIK there
is a problem with
BCB regarding Delphi code. There was a short discussion about this and Virtual
Tree in a BCB news
group. They solved it by moving around some declarations (like TCache). Sorry
for being so
unspecific but my knowledge about BCB is limited to that I'm aware that it
exists :-/

Ciao, Mike


re: Drag-And-Drop: Solution and Bug

From: "Mike Lischke" [public@l...]
Date: Fri Jan 5, 2001 3:56 pm
Subject: RE: [VirtualTreeview] Drag-And-Drop: Solution and Bug

> I am playing around with drag and drop (within one tree only). Unfortunately
> the examples don't work with 1.31 anymore

Yes, this was my fault. I updated the external demo sources but forgot to
update those in the main
zip.

> and they don't even show how the
> actual movement operation should be implemented (they allow DND but do not
> perform a copy or move operation if I am not mistaken).

This is correct. There is a OLE demo in preparation (for drag'n drop and
cut/copy'n paste).

> procedure TMain.vtQueueDragDrop(Sender: TBaseVirtualTree; Source: TObject;
> DataObject: IDataObject; const Formats: array of Word;
> Shift: TShiftState; Pt: TPoint; var Effect: Integer; Mode: TDropMode);
> begin
> with Sender do
> (*) if (Mode=dmBelow) or ((DropTargetNode=GetNextSibling(GetFirstSelected))
> and (SelectedCount=1)) then
> MoveSelected(Sender, DropTargetNode)
> else
> MoveSelected(Sender, GetPreviousSibling(DropTargetNode));
> end;

You should not forget to check if DropTargetNode is assigned at all.

> procedure TMain.MoveSelected(Tree: TBaseVirtualTree; MoveBelowNode:
PVirtualNode);
> var
> SelectedNodes: TNodeArray;
> i: integer;
> begin
> with Tree do begin
> SelectedNodes:=GetSortedSelection(true);
> for i:=0 to SelectedCount-1 do begin
> if SelectedNodes[i]<>MoveBelowNode then
> MoveTo(SelectedNodes[i], MoveBelowNode, amInsertAfter, false);
> MoveBelowNode:=GetNextSibling(MoveBelowNode);
> if MoveBelowNode=nil then MoveBelowNode:=GetFirstNode;
> end;
> ScrollIntoView(GetFirstSelected);
> end;
> end;

SelectedCount is the number of all selected nodes in the tree but you have
retrieved a sorted
selection with resolved parent-child relations (i.e. nodes which are children
of selected nodes are
not returned in the result). This will potentially be less nodes than the
complete selection so the
loop

for I := 0 to SelectedCount - 1 do

might crash. Use

for I := 0 to High(SelectedNode) do

instead. Furthermore, since you do not copy/move conditionally you may well use
ProcessDrop. I have
to make the drop demo first to show the exact usage, however.

> // reindex all following nodes (line #8805)
> Run := Node;
> while Assigned(Run) do
> begin
> Inc(Run.Index);
> Run := Run.NextSibling;
> end;
> Somehow (Run=Run.NextSibling) holds here...

Very suspect! This sounds as would Run be the hidden root node (which contains
references to itself
in NextSibling and PreviousSibling to mark it as the root node). There went
something wrong and you
should carefully check how this could happen.

> I suggest a check at the beginning of MoveTo.

For what should there be a check?

> PS: How can I prevent that the user can switch to a copy operation (if he
keeps
> the ctrl key pressed down)? I can show the 'disallowed' cursor if so but would
> prefer to not allow showing the '+' in the first place...

This is determined in DoDragging. See this line:

AllowedEffects := DROPEFFECT_COPY or DROPEFFECT_MOVE {or DROPEFFECT_LINK};

Does it make sense to create a published property?

Ciao, Mike

 | Replies | Author | Date
169 | Re: Drag-And-Drop: Solution and Bug | [HBender@E...] | Fri 1/12/2001


re: Using the node data

From: "Mike Lischke" [public@l...]
Date: Fri Jan 5, 2001 3:56 pm
Subject: RE: [VirtualTreeview] Using the node data

Hi Werner,

> I have worked previously with a virtual listview and listbox and the
> 'virtual' concept is not new to me. Alas, I got some trouble with under-
> standing the PVirtualNode data concept.
>
> Consider the following requirements:
> - a tree should contain the files of one directory as top level nodes
> - each file should be represented by a simple class instance
>
> Currently I use an extra TObjectList which is filled first (FindFirst,
> -Next, -Close loop). Then I do NodeDataSize:=sizeof(pointer); and in
> OnInitNode I have this:
>
> procedure TMain.vtQueueInitNode(Sender: TBaseVirtualTree; ParentNode,
> Node: PVirtualNode; var InitialStates: TVirtualNodeInitStates);
> begin
> TObject(Sender.GetNodeData(Node)^):=List[Node.Index];
> end;

This approach is fine, you should however use a simple node data structure and
always assign the
result of GetNodeData to a local variable of this type:

type
PNodeData = ^TNodeData;
TNodeData = record
Entry: TMyFileClass;
end;

procedure TMain.vtQueueInitNode(Sender: TBaseVirtualTree; ParentNode,
Node: PVirtualNode; var InitialStates: TVirtualNodeInitStates);

var
Data: PNodeData;

begin
Data := Sender.GerNodeData(Node);
Data.Entry := List[Node.Index];
end;

This is much clearer I believe.

> None of the examples use a dedicated extra data structure.

This is not true. Please look at the MVC Demo from Marian Aldenhovel. He has
used separate classes
and even extended this model a bit.

> I finally managed to put something usable together but discovered that the
> selected states of the dragged nodes stayed at their old places and did not
> move with dragged nodes (of course).

I don't understand. Being selected is an inherent property of a node and moves
as the node moves. If
you copy a node then both the original node as well as its copy should be
selected afterwards.

Ciao, Mike


re: Missing OnFreeNode causes mem leaks?

From: "Mike Lischke" [public@l...]
Date: Fri Jan 5, 2001 3:56 pm
Subject: RE: [VirtualTreeview] Missing OnFreeNode causes mem leaks?

> I am testing to store a reference to a class instance in the
> data part of a VirtualNode. Problem comes with freeing that
> instance: if I start and immediately close the app OnFreeNode
> will only be called for nodes which have been visible (about 70%
> were invisible because I did not scroll down to them).

Actually, they were not initialized. Uninitialized nodes should not have any
associated data yet.

> If I only use OnFreeNode for clean up code (destructor calling)
> I get a memory leak of course.
>
> Can fix that by setting the node to an initialized state manually:
>
> Node:=vtQueue.AddChild(nil);
> TObject(vtQueue.GetNodeData(Node)^):=TTest.Create(SR.Name);
> Include(Node.States, vsInitialized);
>
> Is this how it should be done? Somehow I would prefer a method
> for that purpose.

Yep, this is a valid way to fill your nodes. You could also use an extra member
in the node data
which takes SR.Name (obviously a string variable) and keeps it until the node
is really initialized.
Then use OnInit, take the mentioned member and create your Test class from it.
Another way is like I
did in the advanced demo (when expanding a node).

Ciao, Mike


re: Some questions

From: "Mike Lischke" [public@l...]
Date: Fri Jan 5, 2001 3:56 pm
Subject: RE: [VirtualTreeview] Some questions

Hi Björn,

you got already some answers to your questions. Let me however also have a look
and give you some
comments even if they have already been mentioned.

> 1) Node editing - editing other than the first column
> I have multiple columns, but it seems only the first column will be
> user-edited.

voExtendedFocus in Options

> 2) Node editing - OnNewText
> Is this the event to handle in order to change the underlying data?

Can be used for this task, yes. It is mainly a simple notification to let the
app. know when a
node's caption has been changed. This way you don't need to write a node editor
to learn when
editing is done. The event OnEdited does not give you the opportunity to know
both the old and the
new caption.

> 3) Node editing - custom editors
> I would like to have, for instance, a combobox and a TDateTimePicker as
> editor, I know there are examples
> in the demo source, but is there any "well-isolated" source for these that I
> can integrate easily into my existing project?

No, there are no isolated examples. This is non-trivial stuff and requires some
extra effort to be
understood. I know it would help if it would be in a separate demo, but not
much...

> 4) Node editing - editing multiple rows at once.
> I don't expect this as a feature in the TVirtualTreeview, but in my current
> project I have a need of say, selecting a number of rows and then when the
user
> edits a column, the change apply to all selected. Of course I know I could do
> this by having a dialog box for editing, but is there some more
treeview-integrated approach?

Making this somehow working in the tree is in my opinion irritating. I would
expect to get asked for
the value and then all concerned nodes are updated at once.

> 5) Double-click on column separator in header
> Is there a way to get the same effect as in the ordinary TListview, that
> when one double-clicks the column-separator in the header, the column
> automatically resizes according to the size of the largest entry in the
column?

This would be counter productive. What is the largest entry? The largest one
currently initialized?
The largest one ever? The largest entry of all nodes currently in the tree
(they would need to get
initialized then, all)? If you have a good idea how to decide which size the
column should get then
tell me and we can discuss it.

> 6) Autosizing of columns
> Is there a way to get the columns to automatically adjust their width to the
> size of
> a) Their header caption
> b) The row with the largets column entry

No. Do you really need that? I found this feature very unreliable in the list
view. The width was
always wrong and I had to adjust it manually. I haven't used this feature since
years then...

> 7) Data connected to TVirtualTreeColumn
> I found that I needed to have "structural information" connected to each
> column, for instance "display format" etc. I solved this by adding a new
property
> "Data : TObject" to the class and then when adding columns in run-time,
setting this
> Data-property to my custom class that defined this information.

Mmmh, I got a very similar request yesterday. There was a wish for Data:
TObject and Tag: Integer. I
can accept the latter as this is consistent among the TComponent model
(although TVirtualTreeColumn
is a TPersistent) but the data property is something I consider as too special
to be included. Other
opinions?

> Is there currently a better way to do this without me having to adjust the
> sources in "VirtualTrees.pas"?

No.

> 8) Column numbering
> In for instance the "OnGetText" event, there is a "Column : integer"
> argument, being the index of the column. Is this the index of the visible
order of
> columns or is it the original order of columns? If the user moves a column
from say third
> place to first place, will the Column value be "0" instead of "2" or will it
still be
> "2"? Also, what happens if columns are hidden?

Hopefully the model I designed is easy to understand. Generally speaking,
column indices do not
change for the lifetime unless columns are deleted or added. The first column
added is the main
column (the one containing the tree) and will always have index 0. The column
values passed to
various events is always the index into the column collection where 0 is the
main column and the
other columns are number in the order they are stored in the collection. Note:
there is a special
case (value -1) passed to some events (OnGetText etc.) which means that there
is no column used or
the header is hidden. Usually this value is handle as would it be 0.

> On the other hand, if the index is kept the same regardless of reorderings,
> how can one programmatically find out the ordering of the columns (for
instance in
> order to save the changes made by a user)

To determine the position of column query its Position property. In order to
save a header along
with all its properties (and colum definitions) use THeader.SaveToStream. Note:
when storing the
header data together with tree data always save header data first because the
loader routine for
tree data does not stop loading until the stream is exhausted regardless of
whether the data belongs
to the tree or not. This is a known design flaw, but I don't know yet how to
fix this without
breaking existing code.

> 9) Problem (maybe not fault of TVirtualTreeView)
> I found that if I tried debugging my own procedures called during OnGetText
> from within Delphi, the application and Delphi (and sometimes Windows) would
> completely lock up. Now, I want to stress I am not certain this is because of
> TVirtualTreeView, but are there any known issues with debugging code triggered
> by for instance display events in TVirtualTreeView? This happened on Win98

Not that I know of, but (without snide remarks) Win9x is not a system I would
develop software on. I
know, it is often simply a question of money, but if you can afford it then use
Windows 2000.

Ciao, Mike


re: Re: Iterating through items?

From: "Mike Lischke" [public@l...]
Date: Fri Jan 5, 2001 3:56 pm
Subject: RE: [VirtualTreeview] Re: Iterating through items?

> I would suggest something like that:
>
> procedure test;
> var
> P: PVirtualNode;
> begin
> P := vst.GetFirstNode;
> while P <> nil do
> begin
> //your stuff on the node
>
> //then go to the next
> P := vst.GetNext(P);
> end;
> end;
>
> This will get you all the nodes hidden or not, visible or not.
> The side effect with such a stuff is always that after that all
> the nodes of your tree will be initialized...But we may not care :)

In order to avoid validating all nodes in this process you can use
GetNextNoInit instead of GetNext.

Ciao, Mike


re: John's Bug report with sample...

From: "Mike Lischke" [public@l...]
Date: Fri Jan 5, 2001 3:56 pm
Subject: RE: [VirtualTreeview] John's Bug report with sample...

> I can see that we all have nice suggestions to do...
> that we have found some bugs...
> And that some of us even solved some bugs...
> This will be quite a work for Mike when he comes back
> from hollydays :)

This tree keeps me busy anyway, so why not? On the other hand there aren't so
many bugs actually. I
have much more suggestions for enhancements and currently only 4 bugs on my
list.

> So my suggestion would be that each of you (if you want of course)
> should post a message again, but that will give a complete list
> of all the bugs/suggestion/solution he gave since a while and that are
> still not solved...

Mmh, one reason why I made VT open source is that I don't want to (and cannot)
make all changes and
improvements myself. Currently I primarily remove bugs when I get informed
about them. Since VT is
now part of JEDI VCL (www.delpi-jedi.org) it will soon be place into the online
version control
system, which allows collaborate work via Internet. Until then I would like to
delay all
enhancements and just collect ideas.

> A good thing would also be that you join a small sample
> source + exe in a zip file showing for exemple all the
> bugs you talk about (if you can of course)

We should not post attachments to the list. There is a file area on eGroups
(20MB) where you can put
the samples etc. in.

> When you try to select programmaticaly a node, let's say by a
> button click
> then the node nor the tree will not show any selection or
> focus. The only way
> this will work is to select a node in the tree one time by
> mouse, after that the selection
> stuff is showing something...

Not a bug but a feature :-) The tree needs to be updated to show the selection.

> The problem is that when I try to select nodes in my tree
> starting from under the tree going up the tree, then when
> my mouse reaches the last node then I get some exceptions
> index out of the list (-1).

I cannot reproduce this problem. I think it would be much easier when you try
to find out where the
value -1 comes from and where it is wrongly used.

> When you change the selection of one node, all the nodes are
> redrawn, is this normal ??

Depends. If multi selection is enabled and the selection is changed without
modifier key (ctrl,
shift) and there are currently more than node selected then the previous
selection must be erased.

> When you select a node the icon and the line are no longer
> drawn for the selected node

Could be the paint bug introduced in version 1.29 (I cannot execute your
example since I don't have
DBDemos installed). This bug has been fixed in version 1.31.

Ciao, Mike


re: Small memory leak ?

From: "Mike Lischke" [public@l...]
Date: Fri Jan 5, 2001 3:56 pm
Subject: RE: [VirtualTreeview] Small memory leak ?

Hi pchessa,

> Looks like the FScrollBarOptions member created in
> "TBaseVirtualTree.Create" is never freed.
> Am I wrong?

Yes, this was a bug. Already fixed but not yet published.

Ciao, Mike


re: Sort Method

From: "Mike Lischke" [public@l...]
Date: Fri Jan 5, 2001 3:56 pm
Subject: RE: [VirtualTreeview] Sort Method

> > How to use sort method ? Please give some example.
>
> This is how I do it.
>
> procedure SortTree(Tree: TVirtualStringTree; Ascending: boolean);
> var Dummy: TDummy;
> ....

> You just have to extract the sort criteria out of Node1 and Node2 and
> compare them. If they are strings you can use AnsiCompareText as I did.

Perfect Werner, I just like to add that there is also a FileCompare method in
the advanced demo.

Note: TVirtualStringTree works with Unicode strings so you might consider using
a Unicode function
to compare strings (if they are Unicode of course) otherwise wrong results will
be returned with
AnsiCompareString.

Ciao, Mike


re: John's Bug report with sample...

From: "Mike Lischke" [public@l...]
Date: Fri Jan 5, 2001 3:56 pm
Subject: RE: [VirtualTreeview] John's Bug report with sample...

> The same thing just happened to me. It turned out that the error was
> caused by this line:
>
> function TBaseVirtualTree.HandleDrawSelection(X, Y: Integer): Boolean;
> ...
> if WithImages and (DoGetImageIndex(Run, ikNormal, -1) > -1) then
> ...
>
> This results in a OnGetImageIndex event with the Column parameter being -1.
> Don't know what this should mean at all. Anyway, after I checked for that
> value in my event handler the error was gone so I suggest you try that as
> well.

This is something which should perhaps be communicated a bit more. -1 means
there is no particular
column involved. Either there is no column defined or the header is hidden (or
I want something
special like in this case).

> Mike, why do you send a -1 Column to the event handler? I can only imagine
> that this could be for the case when UseColumns was false but it is not (in
> my application).

The correct offset of the text for a node depends on various conditions and one
is the image and the
state image. The question was which column should be used to retrieve the
correct image index. Draw
selection can only happen in the main column but it could also be that there is
no column at all.
Since -1 is (or should) usually act like 0 it was the more general choice.

> BTW, egroups also provides a chat applet for all list members if the need for
> some real time communication arises sometime...

Yes, this is a cool feature. If there are enough requests then we can make a
real time talk via
eGroups chat.

Ciao, Mike


re: Custom drawing in TVirtualStringTree

From: "Mike Lischke" [public@l...]
Date: Fri Jan 5, 2001 3:56 pm
Subject: RE: [VirtualTreeview] Custom drawing in TVirtualStringTree

Hi Philippe,

> I spent several hours uselessly to do the following and was not able
> to find an example in the various demos projects:
> I have a VirtualStringTree and I would like to change the way some
> texts are drawn.
> I can change the font for example with the OnPaintText event but how
> can I change the text position (I would like to simulate LeftJustify
> or RightJustify). I tried to change the CellRect or ItemRect in the
> different On(Before|After)(Cell|Item)Paint but with no effect.

If you don't want to modify VirtualTrees.pas then you have to go with the draw
tree. The string tree
does its painting quite independent from the application (despite the various
paint cycle events).

Ciao, Mike


re: Re: Drag and Drop sample ? Any ?

From: "Mike Lischke" [public@l...]
Date: Fri Jan 5, 2001 3:57 pm
Subject: RE: [VirtualTreeview] Re: Drag and Drop sample ? Any ?

Hi all,

I hope you had a very nice x-mas and wish you all a happy and successfull new
year. Now let's come
back to the business. I will go through each posting on this list and add
comments where necessary
within the next couple of hours. John is first...

> -----Original Message-----
> From: Jeurk [mailto:[knipjo@h...]]
> Sent: Wednesday, December 13, 2000 3:34 PM
> To: VirtualTreeview@egroups.com
> Subject: [VirtualTreeview] Re: Drag and Drop sample ? Any ?
>
> So I will say that we will probably see a drag and drop demo
> somewhere in Q1 2001 :)

I think the drag'n drop demo should be finished as soon as possible. I got
guite a lot of personal
eMail about this which shows me the importance. I can't promise anything,
however...

> Have you thought Mike, of a way to reports bugs easily for you ?
> So you could post a bug list and we will stop bugging you with already
> known bugs...

Yes, I have. Fortunately, there are not many bug reports until now and those I
got don't repeat very
often particular cases.

VT is now part of the JEDI VCL as some of you might know already (see also
www.delphi-jedi.org).
This VCL will be put into an online version control system (as the JEDI code
library JCL (a general
purpose and very good lib, hint, hint) already is). Once this happened we can
start modifying VT
publicly. Additionally, there is a bug tracking system and various other nice
and useful features.

> I have a drawtree with about 300-400 nodes, when I drag some nodes
> around took from the beginning of the tree speed is fine.
> But when I try to drag around nodes from the end of the tree they
> move only slowly around. Any hint about that ?
> Node selection is also slow. And when I say slow, it's compared
> to the stringtree...

Mmmh, difficult to say. The draw does not optimize as the string tree does, so
for draw selection
associtated events might be queried very often.

> I never used the drawtree before. I don't like the node selection
> system. I prefer the way the string tree is working.
> By the way, a node in the drawtree does not show a selection. the
> only way I found to get a line node selection is to use the
> selectwhole line option.
> I imagine this is related to the draw problems you currently have...

No, this is not related to any paint problem (which have all been fixed in
version 1.31, btw.). The
draw tree does only provide the infrastructure for the tree. Your application
is responsible for
painting the content of a node. This includes also the selection and focus
rectangle.

> I switched to the drawtree because I needed to add a small preview to
> each node...
> Is this feasable in a stringTree ?

Of course it is. Look up the various paint cycle parts (before erase, after
item paint etc.).

> Do you think it would be possible to add an option to let the
> virtualtree draw on multiple columns ? Like in a simple listview...
> Maybe simply by asking the tree to draw different views?

Adding the option would not be difficult. Adding the ability would be hard, as
you need more than
just painting.

> I had other questions but forgot them :)

Well, perhaps your brain serves you now better in the new year and you remember
your questions :-)

Ciao, Mike

Dipl. Ing. Mike Lischke
Senior software developer
--
Homepage: http://www.lischke-online.de
GraphicEx: http://www.lischke-online.de/Graphics.html
Virtual Treeview: http://www.lischke-online.de/VirtualTreeview.html
Unicode Edit and library: http://www.lischke-online.de/Unicode.html


re: John's Bug report with sample...

From: Werner Lehmann [wl@b...]
Date: Fri Jan 5, 2001 11:28 pm
Subject: Re: [VirtualTreeview] John's Bug report with sample...

Mike Lischke wrote:
>
> > The problem is that when I try to select nodes in my tree
> > starting from under the tree going up the tree, then when
> > my mouse reaches the last node then I get some exceptions
> > index out of the list (-1).
>
> I cannot reproduce this problem. I think it would be much easier when you try
to find out where the
> value -1 comes from and where it is wrongly used.

This problem is already solved. See my other posting in this
thread for details, John's answer in 'Re: [VirtualTreeview] Digest Number 19'.

WL


re: Missing OnFreeNode causes mem leaks?

From: Werner Lehmann [wl@b...]
Date: Fri Jan 5, 2001 11:31 pm
Subject: Re: [VirtualTreeview] Missing OnFreeNode causes mem leaks?

Mike Lischke wrote:
>
> Yep, this is a valid way to fill your nodes. You could also use an extra
member in the node data
> which takes SR.Name (obviously a string variable) and keeps it until the node
is really initialized.
> Then use OnInit, take the mentioned member and create your Test class from
it. Another way is like I
> did in the advanced demo (when expanding a node).

Ok. I prefer to initialize right away (that is instanciating a class)
since the data is available right after AddChild and not later. And it
will be more than a string.

I am using the node data's now only to store object references which are
also held in a TObjectList to be sure that they are really freed and to
ease access (I want to dynamically change the tree structure which re-
quires a complete rebuild of the nodes. This way the data is already avail-
able in the objectlist).

You seem to have overlooked this paragraph which points out a potential
problem with the advanced demo... I cite myself

> If I am not mistaken even the advanced demo has this problem:
> the drawtree gets populated by dynamic data which includes string
> types (being reference counted). This data is only finalized in
> OnFreeNode which will not be called for invisible nodes (nodes
> which have not been scrolled into view; not non-existing child
> nodes).

Regards,
WL

 | Replies | Author | Date
105 | Re: Missing OnFreeNode causes mem leaks? | Mike Lischke | Sat 1/6/2001


re: problems with header

From: Werner Lehmann [wl@b...]
Date: Fri Jan 5, 2001 11:29 pm
Subject: Re: [VirtualTreeview] problems with header

Mike Lischke wrote:
>
> Hi Simon,
>
> I tried this out and found it to be a bug. The NextColIndex variable is not
set for invisible nodes
> which causes this behaviour. I will fix this soon. Thank you for the report.

Did you see that I already suggested a fix in this thread?
Of course feel free to choose another way; you know that
code a lot better than I do :)

WL

 | Replies | Author | Date
104 | Re: problems with header | Mike Lischke | Sat 1/6/2001


re: Using the node data

From: Werner Lehmann [wl@b...]
Date: Fri Jan 5, 2001 11:32 pm
Subject: Re: [VirtualTreeview] Using the node data

Mike Lischke wrote:
>
> > procedure TMain.vtQueueInitNode(Sender: TBaseVirtualTree; ParentNode,
> > Node: PVirtualNode; var InitialStates: TVirtualNodeInitStates);
> > begin
> > TObject(Sender.GetNodeData(Node)^):=List[Node.Index];
> > end;
>
> This approach is fine, you should however use a simple node data structure
and always assign the
> result of GetNodeData to a local variable of this type:
>
> type
> PNodeData = ^TNodeData;
> TNodeData = record
> Entry: TMyFileClass;
> end;
>
> procedure TMain.vtQueueInitNode(Sender: TBaseVirtualTree; ParentNode,
> Node: PVirtualNode; var InitialStates: TVirtualNodeInitStates);
>
> var
> Data: PNodeData;
>
> begin
> Data := Sender.GerNodeData(Node);
> Data.Entry := List[Node.Index];
> end;
>
> This is much clearer I believe.

You are probably right and I think I would do it that way if I were to start
from scratch. Right now I have to change to much code (well not that much really
but enough to avoid it :).

I have capsuled the data access in these routines:

// Extracts an object from Tree / Node

function GetObject(Tree: TBaseVirtualTree; Node: PVirtualNode): TObject;
var Data: pointer;
begin
assert(Node<>nil);
Data:=Tree.GetNodeData(Node);
result:=TObject(Data^);
end;

// Replaces/Sets object in Tree / Node

procedure SetObject(Tree: TBaseVirtualTree; Node: PVirtualNode; Obj: TObject);
var Data: pointer;
begin
assert(Node<>nil);
Data:=Tree.GetNodeData(Node);
TObject(Data^):=Obj;
end;

I would like to see these as methods in the tree class. Maybe as getter/setter
for a property:

property DataObject[Node: PVirtualNode]: TObject read GetDataObject write
SetDataObject;

Note: I have read your comments about classes vs. records. But since I am not
dealing with millions of nodes (and I believe this is true for the majority of
users of these components) I prefer classes over records and don't worry about
the 4 VMT bytes or the instantiation time.

Another thing: you defined all these callback functions as method types ('of
object').
This effectively prevents me to use local compare etc. functions. I would like
to see
a simple overloaded version of these functions which take callbacks of simple
functional types. Having to create a dummy object looks rather ugly in my code:

type
TDummy = class
// compare functions
function CompareFunction(Sender: TBaseVirtualTree; Node1, Node2:
PVirtualNode; Column: integer): integer;
// iterate procedures
procedure FindData(Sender: TBaseVirtualTree; Node: PVirtualNode; Data:
pointer; var Abort: boolean);
procedure FreeData(Sender: TBaseVirtualTree; Node: PVirtualNode; Data:
pointer; var Abort: boolean);
end;

(I know your motivation about this, several times I had the same problem of
having
to use plain functions when the rest of my code consisted of methods, with the
problem
of not being able to access the instance data (at least not easy and clean).
But while
you can make a functional type out of a method (and get around that said
limitation)
I don't know a way to accomplish the opposite.
You probably say now why the hell doesn't he use a class? Well. These are just
toolbox
functions. They share no common attributes...)

> I don't understand. Being selected is an inherent property of a node and
moves as the node moves. If
> you copy a node then both the original node as well as its copy should be
selected afterwards.

I know. This was a problem with my first approach. I was used to a virtual
listview where
it suffices to just use the index of the listitems to access some data
structure. This
is not possible anymore with a tree structure of course.

WL

 | Replies | Author | Date
106 | Re: Using the node data | Mike Lischke | Sat 1/6/2001


re: Drag-And-Drop: Solution and Bug

From: Werner Lehmann [wl@b...]
Date: Fri Jan 5, 2001 11:05 pm
Subject: Re: [VirtualTreeview] Drag-And-Drop: Solution and Bug

Mike Lischke wrote:
>
> This is correct. There is a OLE demo in preparation (for drag'n drop and
cut/copy'n paste).

There seems to be a DND demo already but I have not figured out how
to use it yet. The left tree is invisible...

> > procedure TMain.vtQueueDragDrop(Sender: TBaseVirtualTree; Source: TObject;
>
> You should not forget to check if DropTargetNode is assigned at all.

DropTargetNode can be nil in a dragdrop event? Probably if the drop is below
the nodes I guess.

> for I := 0 to SelectedCount - 1 do
>
> might crash. Use
>
> for I := 0 to High(SelectedNode) do

Hehe, I already found that out the hard way :)

> instead. Furthermore, since you do not copy/move conditionally you may well
use ProcessDrop. I have
> to make the drop demo first to show the exact usage, however.

I revamped that move code after DND. Since there are quite some complicated
cases of which nodes can be selected (different levels, gaps in between, target
node in between) I am now creating a top level temporary node which gets all
these selected nodes as child (with .MoveTo) and after that I move the nodes
again to their droptargetnode with respect to the dropmode (below, onnode,
above).

This way all complicated cases don't have to be considered. Very little
performance
penalty probably. I don't have that many nodes anyway (always <<5000).

> > Somehow (Run=Run.NextSibling) holds here...
>
> Very suspect! This sounds as would Run be the hidden root node (which
contains references to itself
> in NextSibling and PreviousSibling to mark it as the root node). There went
something wrong and you
> should carefully check how this could happen.

The code that produced that error is gone for a week or so. But I definitely
traced the problem down to that line. Which of course results in an endless
loop. Unfortunately I don't know the exact circumstances anymore.

> > I suggest a check at the beginning of MoveTo.
>
> For what should there be a check?

Ah, I remember now. Consider this line:

Tree.MoveTo(Node, Node, amInsertAfter, false);

This will surface the error very soon. Admittedly, it does not seem to make a
lot of sense. But this happened at some time in my traversal code in one of
these mentionen 'complicated' move cases. Good defensive programming would
just do nothing in MoveTo if source=target :)

> > PS: How can I prevent that the user can switch to a copy operation (if he
keeps
> > the ctrl key pressed down)? I can show the 'disallowed' cursor if so but
would
> > prefer to not allow showing the '+' in the first place...
>
> This is determined in DoDragging. See this line:
>
> AllowedEffects := DROPEFFECT_COPY or DROPEFFECT_MOVE {or DROPEFFECT_LINK};
>
> Does it make sense to create a published property?

Hm, I cannot change that without modifying the source or deriving a descendant.
I would expect this in OnDragAllowed/DoBeforeDrag. A property would also be
fine. I am just a little bit concerned that the number of properties may rise
to high. I am always a friend of nested/grouped (thematically) properties :)
This also with respect to the selected-color-property and other-color-property
problem.

WL

 | Replies | Author | Date
108 | Re: Drag-And-Drop: Solution and Bug | Mike Lischke | Sat 1/6/2001


Welcome back Mike

From: "Jeurk " [knipjo@h...]
Date: Sat Jan 6, 2001 3:12 am
Subject: Welcome back Mike

I hope you did not miss your computer too much ;)

Thanks for all your comments...

I can see that I still have a lot more to learn, like allways :)

About all the bugs I reported, I was using rel. 1.31.
I'll wait for your next release and your next demos to get
a chance to make some more tests on this.

About the suggestions:
I only have one for the moment, When I call savetofile or loadfromfile
I would like to get the event, first for the tree... I mean that I
would
like to be able to save to the file some additionnal information
like my treedata version number or saving date or whatever. Something
like an onsavenode but for the root node. I know it's nil but it's
only an image :)

Happy new year to you and your family.

John.

 | Replies | Author | Date
107 | Re: Welcome back Mike | Mike Lischke | Sat 1/6/2001


re: problems with header

From: "Mike Lischke" [public@l...]
Date: Sat Jan 6, 2001 8:59 am
Subject: RE: [VirtualTreeview] problems with header

Hi Werner,

> Did you see that I already suggested a fix in this thread?
> Of course feel free to choose another way; you know that
> code a lot better than I do :)

I appreciate very much the help you gave here, but please be patient with me. I
had over 300 eMails
to process in the past 2 days. It could well be that I have overlooked or
misunderstood one :-)

Ciao, Mike


re: Missing OnFreeNode causes mem leaks?

From: "Mike Lischke" [public@l...]
Date: Sat Jan 6, 2001 9:03 am
Subject: RE: [VirtualTreeview] Missing OnFreeNode causes mem leaks?

> You seem to have overlooked this paragraph which points out a potential
> problem with the advanced demo... I cite myself
>
> > If I am not mistaken even the advanced demo has this problem:
> > the drawtree gets populated by dynamic data which includes string
> > types (being reference counted). This data is only finalized in
> > OnFreeNode which will not be called for invisible nodes (nodes
> > which have not been scrolled into view; not non-existing child
> > nodes).

:o] This one I had not overlooked but I thought it would be obvious after my
other description.
Nodes which have not yet been initialized do not have data to be freed (or
should not have at
least). In the tree itself there is no data stored which must be freed (other
than then node
record). The only thing stored there is the width of a node, not a string.

Ciao, Mike


re: Using the node data

From: "Mike Lischke" [public@l...]
Date: Sat Jan 6, 2001 9:27 am
Subject: RE: [VirtualTreeview] Using the node data

> I would like to see these as methods in the tree class. Maybe as getter/setter
> for a property:
>
> property DataObject[Node: PVirtualNode]: TObject read GetDataObject write
SetDataObject;

Sorry to reject this, but this is one specific wish which will conflict with
other wishes. You
always should keep in mind that the tree is in no way responsible for managing
your data. It
supplies the infrastructure for display nothing else. Otherwise I give up the
strict separation of
data and representation. Every such special access method limits the usage of
VT a bit more. Where
would you store the object reference? At the start of the node record, at the
end? Would you allow
other data then in the node record or do you want to prohibit anything else and
force the user to
always use a class?

> Note: I have read your comments about classes vs. records. But since I am not
> dealing with millions of nodes (and I believe this is true for the majority of
> users of these components) I prefer classes over records and don't worry about
> the 4 VMT bytes or the instantiation time.

:o] You can implement whatever you like.

> Another thing: you defined all these callback functions as method types ('of
object').
> This effectively prevents me to use local compare etc. functions. I would
like to see
> a simple overloaded version of these functions which take callbacks of simple
> functional types. Having to create a dummy object looks rather ugly in my
code:

I don't understand why somebody would prefer non-object callbacks (because it
is very specific in
its parameter list and can so not be represented by a library function or
similar), but since it
does not harm functionality I will include such an overloaded function.

Ciao, Mike


re: Welcome back Mike

From: "Mike Lischke" [public@l...]
Date: Sat Jan 6, 2001 10:24 am
Subject: RE: [VirtualTreeview] Welcome back Mike

Hi John,

> I hope you did not miss your computer too much ;)

Don't ask me ;-)

> I only have one for the moment, When I call savetofile or loadfromfile
> I would like to get the event, first for the tree... I mean that I

I don't understand. When you call SaveToFile then you know that you are saving
in this very moment.
What sense does an event then make?

> Happy new year to you and your family.

Thank you.

Ciao, Mike


re: Drag-And-Drop: Solution and Bug

From: "Mike Lischke" [public@l...]
Date: Sat Jan 6, 2001 10:24 am
Subject: RE: [VirtualTreeview] Drag-And-Drop: Solution and Bug

> >
> > For what should there be a check?
>
> Ah, I remember now. Consider this line:
>
> Tree.MoveTo(Node, Node, amInsertAfter, false);
>
> This will surface the error very soon. Admittedly, it does not seem to make a
> lot of sense. But this happened at some time in my traversal code in one of
> these mentionen 'complicated' move cases. Good defensive programming would
> just do nothing in MoveTo if source=target :)

I don't share this philosophy. I would agree with an assert statement, but
generally to check if all
conditions are fine is a huge waste of CPU cycles because the vast majority of
cases uses correct
conditions otherwise the application would not work. I don't share the
mentality which deligates
responsibilities to something else. The application is responsible to be error
free for its code
just as the tree is for *its* code. Without going too deep into this problem I
agree that sometimes
checks are important and necessary (e.g. if human life depends on working code,
but this is hardly
true for VT).

> Hm, I cannot change that without modifying the source or deriving a
descendant.
> I would expect this in OnDragAllowed/DoBeforeDrag.

This does not work correctly because auto drag/drop with then be left out.

> A property would also be fine. I am just a little bit concerned that the
> number of properties may rise to high.

So do I. This is one of my main concerns when discussing about enhancements.
The core problem is
that there are as many wishes for enhancements as there are users of VT.

Ciao, Mike


re: Missing OnFreeNode causes mem leaks?

From: Werner Lehmann [wl@b...]
Date: Sat Jan 6, 2001 12:16 pm
Subject: Re: [VirtualTreeview] Missing OnFreeNode causes mem leaks?

Mike Lischke wrote:
>
> > You seem to have overlooked this paragraph which points out a potential
> > problem with the advanced demo... I cite myself
> >
> > > If I am not mistaken even the advanced demo has this problem:
> > > the drawtree gets populated by dynamic data which includes string
> > > types (being reference counted). This data is only finalized in
> > > OnFreeNode which will not be called for invisible nodes (nodes
> > > which have not been scrolled into view; not non-existing child
> > > nodes).
>
> :o] This one I had not overlooked but I thought it would be obvious after my
other description.
> Nodes which have not yet been initialized do not have data to be freed (or
should not have at
> least). In the tree itself there is no data stored which must be freed (other
than then node
> record). The only thing stored there is the width of a node, not a string.

I don't mean to be pushy here (could care less about a leak in the demo)
but let me show you exactly what I meant (yes, of course I understood your
node-not-initialized point in the first place, even before my first post
on this topic). See this code from the advanced demo:

if (SR.Attr and faDirectory <> 0) or CanDisplay(NewName) then
begin
ChildNode := Sender.AddChild(Node);
ChildData := Sender.GetNodeData(ChildNode);
ChildData.FullPath := NewName;
ChildData.IsFolder := (SR.Attr and faDirectory <> 0);
if not ChildData.IsFolder then
ChildData.Properties := Format('%n KB', [SR.Size / 1024]);
GetOpenAndClosedIcons(ChildData.FullPath, ChildData.OpenIndex,
ChildData.CloseIndex);
end;

Clearly some strings are stored within the data of a node (FullPath,
Properties). When is this data freed? There is no single Dispose in the
code and just one 'Finalize', this one in the FreeNode event.

Putting things together: you add child nodes, fill them with to-be-freed
data, but yet do not include vsInitialized in the node state (I was under the
impression that AddChild would do that but it doesn't). If this node will
remain
invsible (read: stay uninitialized state-wise because outside the visible part
of the tree) no FreeNode event will occur, the data will not be freed, you will
have a leak. As I take it.

Regards,
WL

 | Replies | Author | Date
111 | Re: Missing OnFreeNode causes mem leaks? | Mike Lischke | Sat 1/6/2001


re: Using the node data

From: Werner Lehmann [wl@b...]
Date: Sat Jan 6, 2001 12:29 pm
Subject: Re: [VirtualTreeview] Using the node data

Mike Lischke wrote:
>
> > I would like to see these as methods in the tree class. Maybe as
getter/setter
> > for a property:
> >
> > property DataObject[Node: PVirtualNode]: TObject read GetDataObject write
SetDataObject;
>
> Sorry to reject this, but this is one specific wish which will conflict with
other wishes. You
> always should keep in mind that the tree is in no way responsible for
managing your data. It
> supplies the infrastructure for display nothing else. Otherwise I give up the
strict separation of
> data and representation. Every such special access method limits the usage of
VT a bit more. Where
> would you store the object reference? At the start of the node record, at the
end? Would you allow
> other data then in the node record or do you want to prohibit anything else
and force the user to
> always use a class?

No no. I was just thinking of an additional way to access the data field of a
PVirtualNode as a TObject reference. Exactly what my routines Get/SetObject do.
No additional object field necessary (on my part). Of course I can do that in a
descendant as well. Just would like to see that in the distributed version of
the
tree.

As a sidenote this would also be consistent with how the VCL manages this stuff
(for instance TStrings.Objects).

I share your view of the 'virtual' part of the components. But what could be
more
virtual than a single pointer to a different structure/object instance? On the
other
hand, in the advanced demo you explicitly store data in the nodes (PImageData).
IMO this is less 'virtual' than an object reference would be.

> I don't understand why somebody would prefer non-object callbacks (because it
is very specific in
> its parameter list and can so not be represented by a library function or
similar), but since it
> does not harm functionality I will include such an overloaded function.

Hm, this may be more difficult than I thought first. The second and overloaded
version can not simply call its associated/other version because the callback
parameter type does not match. Ok, maybe you can come up with something easy.

Regards,
WL


re: Missing OnFreeNode causes mem leaks?

From: "Mike Lischke" [public@l...]
Date: Sat Jan 6, 2001 12:37 pm
Subject: RE: [VirtualTreeview] Missing OnFreeNode causes mem leaks?

> Clearly some strings are stored within the data of a node (FullPath,
> Properties). When is this data freed? There is no single Dispose in the
> code and just one 'Finalize', this one in the FreeNode event.

Ops.

I'll have a look at it next week. Thank you.

Ciao, Mike


re: Custom drawing in TVirtualStringTree

From: [jascha@c...]
Date: Sat Jan 6, 2001 1:37 pm
Subject: Re: Custom drawing in TVirtualStringTree

Phillipe,

Here is some code that does what you want for a draw tree in the node
drawing event - i.e. no change to Mike's source:

procedure TForm1.VirtualDrawTree1DrawNode(Sender: TBaseVirtualTree;
Canvas: TCanvas; Node: PVirtualNode; ClipRect, NodeRect: TRect;
Column: Integer);
var
NodeText: WideString;
TheFormat: integer;
r: TRect;
begin
NodeText := format('A %d %d',[Node^.Index, Column]); // dummy text
do what you require here
case TVirtualDrawTree(Sender).Header.Columns[Column].Alignment of
taLeftJustify: TheFormat := DT_LEFT;
taCenter: TheFormat := DT_CENTER;
taRightJustify: TheFormat := DT_RIGHT;
end;
r.TopLeft := NodeRect.TopLeft;
r.BottomRight := ClipRect.BottomRight;
dec(r.Right,2);
DrawTextW(Canvas.Handle,PWideChar(NodeText),Length
(NodeText),r,TheFormat);
end;

I will send you the unit directly.

Jascha


Custom drawing in TVirtualStringTree

From: Jascha Gordon [jascha@c...]
Date: Sat Jan 6, 2001 1:49 pm
Subject: [VirtualTreeview] Custom drawing in TVirtualStringTree

Philippe,

Unit attached

Jascha

Attachment
VirtualTrees.pas
Type: application/octet-stream
Size: 607k 		Download

 | Replies | Author | Date
114 | Re: Custom drawing in TVirtualStringTree | Mike Lischke | Sat 1/6/2001
115 | Re: Custom drawing in TVirtualStringTree | Mike Lischke | Sat 1/6/2001
119 | Re: Custom drawing in TVirtualStringTree | Will Watts | Mon 1/8/2001
116 | Re: Custom drawing in TVirtualStringTree | [jascha@c...] | Sun 1/7/2001


re: Custom drawing in TVirtualStringTree

From: "Mike Lischke" [public@l...]
Date: Sat Jan 6, 2001 2:01 pm
Subject: RE: [VirtualTreeview] Custom drawing in TVirtualStringTree

> Unit attached

Jascha, I appreciate your help but please do not post attachments to the
mailing list (you haven't
even compressed it). You can either send it directly to Philippe or place it
into the file area on
eGroups.

Ciao, Mike

 | Replies | Author | Date
115 | Re: Custom drawing in TVirtualStringTree | Mike Lischke | Sat 1/6/2001
119 | Re: Custom drawing in TVirtualStringTree | Will Watts | Mon 1/8/2001
116 | Re: Custom drawing in TVirtualStringTree | [jascha@c...] | Sun 1/7/2001


re: Custom drawing in TVirtualStringTree

From: "Mike Lischke" [public@l...]
Date: Sat Jan 6, 2001 2:08 pm
Subject: RE: [VirtualTreeview] Custom drawing in TVirtualStringTree

All,

eMail attachments to this list are from now on prohibited. eGroups will
automatically remove any
attachment before sending a message to all of the (meanwhile 85) members.

Ciao, Mike

 | Replies | Author | Date
119 | Re: Custom drawing in TVirtualStringTree | Will Watts | Mon 1/8/2001


re: Custom drawing in TVirtualStringTree

From: [jascha@c...]
Date: Sun Jan 7, 2001 5:24 pm
Subject: Re: Custom drawing in TVirtualStringTree

Mike,

I apologise profusely - I haven't used egroups before and didn't
consider the consequences of my actions. Also, sorry to everyone else
who had the endure the download time for this.

What is the etiquette to get a member's e-mail address so they can be
sent directly?

Manby apologies,

Jascha

> Jascha, I appreciate your help but please do not post attachments
to the mailing list (you haven't
> even compressed it). You can either send it directly to Philippe or
place it into the file area on
> eGroups.


Restrict node selection

From: Werner Lehmann [wl@b...]
Date: Sun Jan 7, 2001 10:50 pm
Subject: Restrict node selection

Hi,

how can I ensure that only direct child nodes of the same
parent node can be selected? There is no event like OnSelect
or OnCanSelect (which would be handy here). And Option
voLevelSelectConstraint allows equally levelled child
nodes of different parent nodes to be selected at the same
time.

Any idea?

Regards,
WL

 | Replies | Author | Date
121 | Re: Restrict node selection | Mike Lischke | Mon 1/8/2001
126 | Re: Restrict node selection | Werner Lehmann | Tue 1/9/2001
128 | Re: Restrict node selection | Mike Lischke | Tue 1/9/2001


Sorting glyphs

From: Werner Lehmann [wl@b...]
Date: Mon Jan 8, 2001 12:05 am
Subject: Sorting glyphs

Hi,

I want to show sorting glyphs (small arrows) in the header row. How
should I go about that? It appears that there is no built-in property
for that. The only way that I see is to use the column's imageindex
property. But the columns share one imagelist with the tree. And this
imagelist is the system imagelist in my application. As far as I know
this list does not contain these sorting glyphs. And even if I chose
one of these images it is painted with a clWindow background and not
clBtnFace.

How can I work around this or am I overlooking something simple?

Speaking of imagelists: it is probably not very wise to change the
system imagelist (unless making a copy before which could be quite
big). How can I show other, non-system-imagelist, icons/images in
the tree, for instance in other columns but the first one?

Regards,
WL

 | Replies | Author | Date
122 | Re: Sorting glyphs | Mike Lischke | Mon 1/8/2001
127 | Re: Sorting glyphs | Werner Lehmann | Tue 1/9/2001
129 | Re: Sorting glyphs | Mike Lischke | Tue 1/9/2001
131 | Re: Sorting glyphs | Jeurk | Tue 1/9/2001
137 | Re: Sorting glyphs | Mike Lischke | Wed 1/10/2001


re: Custom drawing in TVirtualStringTree

From: "Will Watts" [willw@a...]
Date: Mon Jan 8, 2001 10:49 am
Subject: RE: [VirtualTreeview] Custom drawing in TVirtualStringTree

On 6 Jan 2001, at 15:08, Mike Lischke wrote:

> eMail attachments to this list are from now on prohibited.

Hurrah! TVM!

W

Will Watts Direct Line +44 20 8400 6104
Applied Industrial Systems Ltd Main Voice +44 20 8400 6100
10 Barley Mow Passage Fax +44 20 8742 2456
Chiswick London W4 4PH Web http://www.applied.co.uk


re: Missing OnFreeNode causes mem leaks?

From: Mike Lischke [public@l...]
Date: Mon Jan 8, 2001 12:03 pm
Subject: RE: [VirtualTreeview] Missing OnFreeNode causes mem leaks?

Hi Werner,

> Clearly some strings are stored within the data of a node (FullPath,
> Properties). When is this data freed? There is no single
> Dispose in the
> code and just one 'Finalize', this one in the FreeNode event.

Well, you are totally right. The problem is that I have splitted the
initialization into two parts: the file enumeration and the image loading.
This should be in one place (ideally OnInitNode).

I have now changed the demo to:

if (SR.Attr and faDirectory <> 0) or CanDisplay(NewName) then
begin
ChildNode := Sender.AddChild(Node);
ChildData := Sender.GetNodeData(ChildNode);
ChildData.FullPath := NewName;
ChildData.IsFolder := (SR.Attr and faDirectory <> 0);
if not ChildData.IsFolder then
ChildData.Properties := Format('%n KB', [SR.Size / 1024]);
GetOpenAndClosedIcons(ChildData.FullPath, ChildData.OpenIndex,
ChildData.CloseIndex);

// The following call is needed to make initialization
complete, but this is, well, suboptimal.
// A better way would be to initialize all parts of the node
in one place (OnInitNode).
// If the following would not be there then the strings
assigned above might not be freed
// because without initialization no OnFreeNode.
Sender.ValidateNode(ChildNode, False);
end;

> Putting things together: you add child nodes, fill them with
> to-be-freed data, but yet do not include vsInitialized in the node state
> (I was under the impression that AddChild would do that but it doesn't).

With good reasons. Just because a node is added does not mean it should
already be considered as being initialized. Being initialized is rather a
property which is particularly important for the application not the tree
itself. The tree must free the node record anyway, regardless of the state
of the node.

Ciao, Mike


re: Restrict node selection

From: Mike Lischke [public@l...]
Date: Mon Jan 8, 2001 2:48 pm
Subject: RE: [VirtualTreeview] Restrict node selection

Hi Werner,

> how can I ensure that only direct child nodes of the same
> parent node can be selected? There is no event like OnSelect
> or OnCanSelect (which would be handy here). And Option
> voLevelSelectConstraint allows equally levelled child
> nodes of different parent nodes to be selected at the same
> time.

No, there is no event for selectively allow node selection, but you can
disable those nodes which should not be selected. Is this an acceptable way?
Adding an event just for selection will significantly slow down the
selection process.

Ciao, Mike


re: Sorting glyphs

From: Mike Lischke [public@l...]
Date: Mon Jan 8, 2001 3:28 pm
Subject: RE: [VirtualTreeview] Sorting glyphs

> I want to show sorting glyphs (small arrows) in the header row. How
> should I go about that? It appears that there is no built-in property
> for that. The only way that I see is to use the column's imageindex
> property. But the columns share one imagelist with the tree. And this
> imagelist is the system imagelist in my application. As far as I know
> this list does not contain these sorting glyphs. And even if I chose
> one of these images it is painted with a clWindow background and not
> clBtnFace.

Well, using the image index of the columns was the way I have managed this
too. It prevents you from having two images in the header and can also make
problems in cases like yours, but generally it is an acceptable way. I'm not
sure if there should be an own image list just for the header. There are
already two for the tree and some more used globally (check images).

> Speaking of imagelists: it is probably not very wise to change the
> system imagelist (unless making a copy before which could be quite
> big). How can I show other, non-system-imagelist, icons/images in
> the tree, for instance in other columns but the first one?

Well, you could use the system image list for the state images in the tree
and use an own list for the normal and header images.

Ciao, Mike


re: Sort Error

From: [gpan@c...]
Date: Mon Jan 8, 2001 9:13 pm
Subject: Re: Sort Error

Hello all,

Am getting a error of [Error] TestTree.pas(335): Incompatible
types: 'HGDIOBJ' and 'TBaseVirtualTree'when I try to compile with the
routine below, on GetObject, any ideas?.

Thanks in advance.

Geoffrey Pan

> function TfrmTestTree.CompareFunction(Sender: TBaseVirtualTree;
Node1, Node2: PVirtualNode; Column: integer): integer;
> var Obj1, Obj2: TObject;
> begin
> Obj1:=GetObject(Sender, Node1);
> Obj2:=GetObject(Sender, Node2);
> if (Obj1 is TNodeData) then
> if (Obj2 is TRow) then
> result:=-1
> else {(Obj2 is TNodeData)}
> result:=AnsiCompareText(TNodeData(Obj1).Text, TNodeData
(Obj2).Text)
> else
> if (Obj2 is TNodeData) then
> result:=1
> else {(Obj2 is TRow)}
> result:=AnsiCompareText(TRow(Obj1).Columns[Column].Text, TRow
(Obj2).Columns[Column].Text);
> end;


re: Re: Sort Error

From: Werner Lehmann [wl@b...]
Date: Mon Jan 8, 2001 11:06 pm
Subject: Re: [VirtualTreeview] Re: Sort Error

[gpan@c...] wrote:
>
> Hello all,
>
> Am getting a error of [Error] TestTree.pas(335): Incompatible
> types: 'HGDIOBJ' and 'TBaseVirtualTree'when I try to compile with the
> routine below, on GetObject, any ideas?.

Geoffrey,

You are trying to use an example that I posted earlier directly without
changes. It is nothing but an example and you cannot use without adjusting
it to your needs.

You get the error because GetObject is unfortunately a windows GDI function
which has the same name as the one which I defined.

Your compare function looks probably different, this is dependant on the
actual data that you may store in the nodes. Take a look at the advanced
demo where you find another example of a compare function:

function TMainForm.FileCompare(Sender: TBaseVirtualTree; Node1, Node2:
PVirtualNode; Column: Integer): Integer;

// used to sort the image draw tree

var
Data1,
Data2: PImageData;

begin
Data1 := Sender.GetNodeData(Node1);
Data2 := Sender.GetNodeData(Node2);
// folder are always before files
if Data1.IsFolder <> Data2.IsFolder then
begin
// one of both is a folder the other a file
if Data1.IsFolder then
Result := -1
else
Result := 1;
end
else // both are of same type (folder or file)
Result := CompareText(Data1.FullPath, Data2.FullPath);
end;

Once again: you extract the data out of the nodes and have to do a compare
operation on this data. How exactly this comparison works depends on your
actual data (type).

Regards,
WL

 | Replies | Author | Date
125 | Re: Sort Error | Geoffrey Pan | Mon 1/8/2001


re: Re: Sort Error

From: "Geoffrey Pan" [gpan@c...]
Date: Mon Jan 8, 2001 11:49 pm
Subject: RE: [VirtualTreeview] Re: Sort Error

Looked like it, thanks :).

-----Original Message-----
From: Werner Lehmann [mailto:[wl@b...]]
Sent: Monday, January 08, 2001 5:06 PM
To: [VirtualTreeview@egroups.com
Subject: Re: [VirtualTreeview] Re: Sort Error

gpan@c...] wrote:
>
> Hello all,
>
> Am getting a error of [Error] TestTree.pas(335): Incompatible
> types: 'HGDIOBJ' and 'TBaseVirtualTree'when I try to compile with the
> routine below, on GetObject, any ideas?.

Geoffrey,

You are trying to use an example that I posted earlier directly without
changes. It is nothing but an example and you cannot use without adjusting
it to your needs.

You get the error because GetObject is unfortunately a windows GDI function
which has the same name as the one which I defined.

Your compare function looks probably different, this is dependant on the
actual data that you may store in the nodes. Take a look at the advanced
demo where you find another example of a compare function:

function TMainForm.FileCompare(Sender: TBaseVirtualTree; Node1, Node2:
PVirtualNode; Column: Integer): Integer;

// used to sort the image draw tree

var
Data1,
Data2: PImageData;

begin
Data1 := Sender.GetNodeData(Node1);
Data2 := Sender.GetNodeData(Node2);
// folder are always before files
if Data1.IsFolder <> Data2.IsFolder then
begin
// one of both is a folder the other a file
if Data1.IsFolder then
Result := -1
else
Result := 1;
end
else // both are of same type (folder or file)
Result := CompareText(Data1.FullPath, Data2.FullPath);
end;

Once again: you extract the data out of the nodes and have to do a compare
operation on this data. How exactly this comparison works depends on your
actual data (type).

Regards,
WL

To unsubscribe from this group, send an email to:
VirtualTreeview-unsubscribe@egroups.com


re: Restrict node selection

From: Werner Lehmann [wl@b...]
Date: Tue Jan 9, 2001 8:59 am
Subject: Re: [VirtualTreeview] Restrict node selection

Mike,

Mike Lischke wrote:
>
> No, there is no event for selectively allow node selection, but you can
> disable those nodes which should not be selected. Is this an acceptable way?
> Adding an event just for selection will significantly slow down the
> selection process.

Hm, not really (acceptable). Would produce visible flickering (I suppose) and
confuse the user (huh? where's my selection now? bug!!!). I think I will ex-
periment with an event. Or maybe try to add another option like
voSiblingSelectConstraint. How does that sound to you? (of course I don't want
to change too much which will not be in the official distribution since I would
have to change that each time again when a new release comes out).

Regards,
WL


re: Sorting glyphs

From: Werner Lehmann [wl@b...]
Date: Tue Jan 9, 2001 9:00 am
Subject: Re: [VirtualTreeview] Sorting glyphs

Mike Lischke wrote:
>
> Well, using the image index of the columns was the way I have managed this
> too. It prevents you from having two images in the header and can also make
> problems in cases like yours, but generally it is an acceptable way. I'm not
> sure if there should be an own image list just for the header. There are
> already two for the tree and some more used globally (check images).

Ok, speaking frankly I would like a dedicated header imagelist. Remember that
you are not wasting resources as this could be the same imagelist as any other
already used (if the component user wishes so).

Furthermore, header images often have to be smaller than the usual images.
But a imagelist fixes image dimensions for all contained bitmaps. So I would
really suggest to add a Header.Images property. You could even set that
property automatically if someone changes Columns[n].ImageIndex and
Header.Images
was nil while .Images was not (although I advise against it, and only in design
time of course).

> Well, you could use the system image list for the state images in the tree
> and use an own list for the normal and header images.

Great idea! Works good and saves me from having to copy the system imagelist! :)

BTW, don't you think that sorting glyphs should be a built-in property?
Something
like Header.Columns[n].SortGlyph in [sgNone, sgUp, sgDown]? I could try to add
that feature on this weekend... but we should determine how the header should be
drawn with other header options that change the appearance of it (another image,
alignment).

And finally I have noticed that Layout = blGlyphRight not only places the glyph
on the right side of the header text but also aligns (!) the header right in its
column. Is this by design? Only by chance I found out that margin = 0 is header
left alignment, margin = -1 is header center alignment, and setting the layout
to
blGlyphRight is header right alignment now. Seems a little bit inconsistent.

In any case I would like to mimic the explorer sort glyph style here (as I come
to think of it as the best in visual terms). Explorer has the header text left
aligned and the glyph (with some space) right beside the text. Which seems not
to be possible now.

Regards,
WL


re: Restrict node selection

From: Mike Lischke [public@l...]
Date: Tue Jan 9, 2001 9:37 am
Subject: RE: [VirtualTreeview] Restrict node selection

Werner,

> Hm, not really (acceptable). Would produce visible flickering
> (I suppose) and confuse the user (huh? where's my selection now? bug!!!).

I don't think so. A disabled node is drawn with a dimmed color and cannot be
selected (but still clicked). Hence it would be a good solution (unless you
don't like the visual appearance). I think this won't be more confusing than
constrained selection or child-only selection.

> I think I will experiment with an event. Or maybe try to add another
option like
> voSiblingSelectConstraint. How does that sound to you?

Well, VT is open source and you can make whatever changes you like. Still,
I'm afraid that more checks will slow down the selection process
significantly.

> (of course I don't want to change too much which will not be in the
official
> distribution since I would have to change that each time again when a new
release comes out).

At the time being it is all a bit complicated, but I hope to get VT into the
online VCS (version control system) of JEDI within a couple of weeks. Not
sure however what the plans are. I will have to ask.

Ciao, Mike


re: Sorting glyphs

From: Mike Lischke [public@l...]
Date: Tue Jan 9, 2001 10:00 am
Subject: RE: [VirtualTreeview] Sorting glyphs

> Ok, speaking frankly I would like a dedicated header
> imagelist. Remember that you are not wasting resources as this could be
the same
> imagelist as any other already used (if the component user wishes so).

So be it then. I'm currently working on the tree and have already included
some of the suggestions I got. I will also remove some more bugs
(fortunately these are all minor problems). After this process I will
publish a new version. This time VT will get a new major version as I think
more then 30 minor version are enough to justify a 2.0.

> You could even set that property automatically if someone changes
> Columns[n].ImageIndex and Header.Images
> was nil while .Images was not (although I advise against it,
> and only in design time of course).

Well, programmers are lazy, but we should draw a limit and do not too much
automatisms. If the image index is accessed without a valid image list then
nothing happens.

> BTW, don't you think that sorting glyphs should be a built-in
> property? Something like Header.Columns[n].SortGlyph in [sgNone, sgUp,
sgDown]? I
> could try to add that feature on this weekend... but we should determine
how
> the header should be drawn with other header options that change the
appearance of
> it (another image, alignment).

I'm curious what others on the mailing list have to say about this. Anybody
out there with an opinion regard the sort glyphs? Other ideas, additional
features in this regard?

If we take in the glyphs then I'd say we should place them as the explorer
does. I don't have a particular preference so I think the usual way is the
best way.

> And finally I have noticed that Layout = blGlyphRight not
> only places the glyph on the right side of the header text but also aligns
(!) the
> header right in its column. Is this by design? Only by chance I found out
that
> margin = 0 is header left alignment, margin = -1 is header center
alignment, and
> setting the layout to blGlyphRight is header right alignment now. Seems a
little
> bit inconsistent.

No, not inconsistent. This is all by design. Actually, most of the layout
stuff has been taken from the bit button implementation in the VCL. Using
margin and spacing you can very well fine tune the glyph and text layout of
the header.

Ciao, Mike

 | Replies | Author | Date
131 | Re: Sorting glyphs | Jeurk | Tue 1/9/2001


Selection rows using "window"

From: Björn Lindell [bli@c...]
Date: Tue Jan 9, 2001 12:48 pm
Subject: Selection rows using "window"

When selecting nodes by dragging with the mouse
to create a rectangle/window, the window only
selects rows if the window includes the first column.
Is there a way to get the selection to include all
rows that the selection window includes "vertically", even if
the selection window doesn't include the leftmost
column?

This would be similar to the way rows are selected
in TListView (report style) when "RowSelect" is enabled
for the list view.

NOTE: I have "voFullRowSelect" enabled, also tried
enabling "voExtendedFocus" but it made no difference to this.

/Björn

 | Replies | Author | Date
138 | Re: Selection rows using "window" | Mike Lischke | Wed 1/10/2001
139 | Re: Selection rows using "window" | =?iso-8859-1?Q?Bj=F6rn_Lindel | Wed 1/10/2001
141 | Re: Selection rows using "window" | Mike Lischke | Wed 1/10/2001


re: Sorting glyphs

From: "Jeurk " [knipjo@h...]
Date: Tue Jan 9, 2001 7:26 pm
Subject: Re: Sorting glyphs

Hi,
>> I only have one for the moment, When I call savetofile or
>> loadfromfile I would like to get the event, first for the tree...
>> mean that I

>I don't understand. When you call SaveToFile then you know that
>you are saving in this very moment. What sense does an event then
>make?
You are right I don't need an event. And you are right, that I know
when a save operation is under way.
You see, I know how to save a tree to a file. No problem about that.
Lets say, I want to add the program version and the program name
in the saved tree file. I not going to store those information
in each node. In fact I want to be able to test, just before loading
if the file is really a saved tree file and which node structure was
used to handle the nodes in the loaded tree file. So I would like
to be able to get my hands on the stream just before each node gets
loaded...do you see what I mean ? Maybe you mean that I can do it by
hand ? Could you explain me how, please ?

--- In [VirtualTreeview@egroups.com, Mike Lischke <public@l...] wrote:
--- about header glyphs
> publish a new version.
Great news...

> If we take in the glyphs then I'd say we should place them as the
explorer
> does. I don't have a particular preference so I think the usual way
is the
> best way.
I agree as long as I can have a way of choosing the glyph...

About the glyphs, I had a similar problem about the icons in the tree.
Often you need to use system images, and also sometimes you need some
more icons, because you want to show some special stuff with your own
icons. What I do for the moment is handling my own imagelist and
adding by hand all the icons I need. this takes a lot of space and
has many times the same icon in it. Ok, I could come out with some
improvement but someone said ;) we are lazy people, at least I am.
Ok, I stop talking, I had the following idea about all those
imagelists.
Do you think the following would be easy to do:
Lets says that we would have an imagelistLIST property with it's own
simplistic propert editor. I could add as many imagelists I want.
So all the imagelist properties we have around would be defined by
a couple of values, the imagelist index and the icon index.
Lets say we would have something like that:
ImagelistList\
SystemImages\
Images\
StateImages\
HeaderImages\
SortImages\
Perso1\
Perso2\

The first list would have a special treatment that would give access
to
the real imagelist, like with the dfsImagelist (delphifreestuff)
The others would be custom lists.
So the places that need icons would not ask for an icon index but
woould use an imagelist indx and an icon index, that way I could mix
icons from different lists if I want.
After thinking a litle more It would be enought to have only two lists
included in the component, the system imagelist and a standard image
list...
Does someone understand what I try to explain ??
Well I hope :)

See you.

John.


re: VirtualTreeView for C++Builder 5

From: [lyann@o...]
Date: Tue Jan 9, 2001 8:50 pm
Subject: Re: VirtualTreeView for C++Builder 5

I've installed The VirtualTreeView In BCB5.0. I get the two icons in
the components library, but I get an error when I compile an
application containing one of thoses components (in VirtualTrees.hpp)
Has anybody get the same error ?
Thanks
yann

 | Replies | Author | Date
133 | Re: VirtualTreeView for C++Builder 5 | Ed Hamilton | Tue 1/9/2001


re: Re: VirtualTreeView for C++Builder 5

From: "Ed Hamilton" [ed@h...]
Date: Tue Jan 9, 2001 9:45 pm
Subject: RE: [VirtualTreeview] Re: VirtualTreeView for C++Builder 5

I can't get it to install because VTV won't compile. How did you manage to
compile it. I'll help you figure out your answer when I get it installed.

Regards,
Ed Hamilton

-----Original Message-----
From: [lyann@o...] [mailto:[lyann@o...]]
Sent: Tuesday, January 09, 2001 12:50 PM
To: VirtualTreeview@egroups.com
Subject: [VirtualTreeview] Re: VirtualTreeView for C++Builder 5

I've installed The VirtualTreeView In BCB5.0. I get the two icons in
the components library, but I get an error when I compile an
application containing one of thoses components (in VirtualTrees.hpp)
Has anybody get the same error ?
Thanks
yann

To unsubscribe from this group, send an email to:
VirtualTreeview-unsubscribe@egroups.com


New option for selection restriction

From: Werner Lehmann [wl@b...]
Date: Wed Jan 10, 2001 12:34 am
Subject: New option for selection restriction

Hi,

I have added a new option to my 'personal' :) version of the virtual
tree. It is called voSiblingSelectConstraint (as opposed to the existing
voLevelSelectConstraint). If this option is set only nodes with the same
parent node are selectable.

Please note that both SelectConstraint options together make no sense.

The necessary changes (only a few) are shown below in case anyone is
interested and likes to have that option as well.

Mike Lischke wrote:
> Well, VT is open source and you can make whatever changes you like. Still,
> I'm afraid that more checks will slow down the selection process
> significantly.

In my tests I did not notice a slowdown. But I did not expect it either. If
the option is not set this is just one extra boolean test, if it is set I
need the extra boolean plus two integer comparisons. Hardly very stressing
for current CPUs.

Hopefully I could convince you to at least consider adding this to the
distribution.

Here are the changes I made (full file available on request). Lines marked
with ! are changed/new.

(1) add the option (line 191ff):

...
voRightClickSelect, // select node on right click
! voSiblingSelectConstraint, // constrain selection to nodes with same parent
voShowBackground, // use the background image if there's one
...

(2) clear selection if option is to be set (line 9778ff):

...
if (voMultiSelect in (ToBeCleared + ToBeSet)) or
! ([voLevelSelectConstraint, voSiblingSelectConstraint] * ToBeSet <> [])
then
ClearSelection;
...

(3) new check in selection routine InternalAddToSelection (line 12305ff):

var
I, J: Integer;
CurrentEnd: Integer;
! Constrained, SiblingConstrained: Boolean;

begin
...
begin
Constrained := voLevelSelectConstraint in FOptions;
! SiblingConstrained := voSiblingSelectConstraint in FOptions;
if Constrained and (FLastSelectionLevel = -1) then
FLastSelectionLevel := GetNodeLevel(NewItems[0]);

for I := 0 to NewLength - 1 do
! if ([vsSelected, vsDisabled] * NewItems[I].States <> []) or
! (Constrained and (Cardinal(FLastSelectionLevel) <>
GetNodeLevel(NewItems[I]))) or
! (SiblingConstrained and (FSelectionCount > 0) and
(FSelection[0].Parent <> NewItems[i].Parent)) then
Inc(Cardinal(NewItems[I]))
else
Include(NewItems[I].States, vsSelected);
end;
...

Regards,
WL

 | Replies | Author | Date
140 | Re: New option for selection restriction | Mike Lischke | Wed 1/10/2001
149 | Re: New option for selection restriction | Werner Lehmann | Thu 1/11/2001
151 | Re: New option for selection restriction | Mike Lischke | Thu 1/11/2001


re: Re: VirtualTreeView for C++Builder 5

From: Mike Lischke [public@l...]
Date: Wed Jan 10, 2001 9:45 am
Subject: RE: [VirtualTreeview] Re: VirtualTreeView for C++Builder 5

> I can't get it to install because VTV won't compile. How did
> you manage to
> compile it. I'll help you figure out your answer when I get
> it installed.

I just got a message form Peter Fraser who was able to compile VT. Here is
his comment:

The reason TVirtualTree doesn't compile is because the automaticaly
generated header file (produced by Delphi/Builder) has a class declaration
after it's used.
It's something to do with the way the compiler works and what I've done to
get around it is to move the following records earlier in the pascal file.

The problem is basically with TCacheEntry and TColumnData records. I've
moved their declarations to line 324 and it seems to work. After you have
compiled the package look at the VirtualTrees.hpp file and search for the
2 record names above. They should be *before* their use.
Note that you will have to delete the .hpp file or it won't get
re-generated!
-- cite end

I will now move the mentioned declarations in the Delphi file as described
above. I had the impression the problem cannot be solved in the Delphi code,
but this is obviously wrong.

Ciao, Mike


re: VirtualTreeView for C++Builder 5

From: Mike Lischke [public@l...]
Date: Wed Jan 10, 2001 9:55 am
Subject: RE: [VirtualTreeview] VirtualTreeView for C++Builder 5

> I will now move the mentioned declarations in the Delphi file
> as described above.

Note: you have to move PVirtualNode = ^PVirtualNode too:

type
TBaseVirtualTree = class;
PVirtualNode = ^TVirtualNode;

TCacheEntry = record
Node: PVirtualNode;
AbsoluteTop: Cardinal;
end;

// used to cache the column strings and widths of one node during a paint
cycle to optimize access
TColumnData = record
Visible: Boolean;
Text: WideString;
Width: Cardinal;
end;
...

Ciao, Mike


re: Re: Sorting glyphs

From: Mike Lischke [public@l...]
Date: Wed Jan 10, 2001 10:47 am
Subject: RE: [VirtualTreeview] Re: Sorting glyphs

Hi John,

> Lets say, I want to add the program version and the program name
> in the saved tree file. I not going to store those information
> in each node. In fact I want to be able to test, just before loading
> if the file is really a saved tree file and which node structure was
> used to handle the nodes in the loaded tree file. So I would like
> to be able to get my hands on the stream just before each node gets
> loaded...do you see what I mean ?

Yes I see. But also this task is trivial. What I did in one of my projects
was to create a file stream, write my application specific marks to it and
then let the header and the tree itself store their data in this stream.
When loading I open a new file stream, read out the signature, then the
header and finally the tree. Similar to this:

if DirectoryExists(ProgramPath) then
begin
Stream := TFileStream.Create(ProgramPath + 'VT4.bak', fmCreate);
// save sort values first
Stream.WriteBuffer(FCurrentSortColumn, SizeOf(FCurrentSortColumn));
Stream.WriteBuffer(FSortAscending, SizeOf(FSortAscending));
// then the header
ProfileTree.Header.SaveToStream(Stream);
// and finally the tree itself
ProfileTree.SaveToStream(Stream);
Stream.Free;
// if saving was successful we can delete the old data file and
replace it with the new one
if FileExists(ProgramPath + 'VT4.dat') then
DeleteFile(ProgramPath + 'VT4.dat');
RenameFile(ProgramPath + 'VT4.bak', ProgramPath + 'VT4.dat');
end;

> After thinking a litle more It would be enought to have only two lists
> included in the component, the system imagelist and a standard image
> list...
> Does someone understand what I try to explain ??
> Well I hope :)

Fortunately you have seen that it is not so important to have half a dozen
image lists ;-) It would add extraordinary effort to determine hit positions
etc. The traffic over the events would increase much more and one would have
to consider every possible combination of existant images, as currently
implemented, but only for normal and state images. I think with the new
version (which I hope to get out comming week end) containing an image list
for the header and two for the tree (and eventually the sort glyph) it
should be enough for 99.9% of all senseful cases.

Ciao, Mike


re: Selection rows using "window"

From: Mike Lischke [public@l...]
Date: Wed Jan 10, 2001 12:07 pm
Subject: RE: [VirtualTreeview] Selection rows using "window"

Hi Björn,

> When selecting nodes by dragging with the mouse
> to create a rectangle/window, the window only
> selects rows if the window includes the first column.
> Is there a way to get the selection to include all
> rows that the selection window includes "vertically", even if
> the selection window doesn't include the leftmost
> column?

I suppose with "leftmost column" you mean the main column (the one which
contains the tree). I write this because you can drag that column to the far
right and then it is the rightmost column.

Actually, I've been thinking about this feature but have not implemented it
because of the work the implementation requires.

> This would be similar to the way rows are selected
> in TListView (report style) when "RowSelect" is enabled
> for the list view.

I'd say this is a bit different (or I understood you wrong). The listview
cannot select single subitems (for good reasons).

Ciao, Mike


re: Selection rows using "window"

From: Björn Lindell [bli@c...]
Date: Wed Jan 10, 2001 12:36 pm
Subject: Re: [VirtualTreeview] Selection rows using "window"

Hello Mike,

>> This would be similar to the way rows are selected
>> in TListView (report style) when "RowSelect" is enabled
>> for the list view.
>
>I'd say this is a bit different (or I understood you wrong). The listview
>cannot select single subitems (for good reasons).
>

What I was looking for was a way to select the whole row, regardless
of which subitem was "included" in the selection region.
But I can understand your reasoning around selecting groups of subitems.

By the way, is there some way I can get the hints of the tree to be
displayed
in multiple lines (in "normal delphi hints" multiline is possible by adding
CRLF)?

/Björn


re: New option for selection restriction

From: Mike Lischke [public@l...]
Date: Wed Jan 10, 2001 1:50 pm
Subject: RE: [VirtualTreeview] New option for selection restriction

Hi Werner,

> I have added a new option to my 'personal' :) version of the virtual
> tree. It is called voSiblingSelectConstraint (as opposed to
> the existing voLevelSelectConstraint). If this option is set only nodes
> with the same parent node are selectable.

It seems I have got very insistent users of Virtual Treeview otherwise I
cannot explain why I get beaten so long until I do what they request :-).
Another guy suggested to make the main column switchable and I rejected it
because I saw no sense. Finally, however, after a long discussion and
getting some source code I implemented this feature. And so did I with your
suggestion :o]

> (3) new check in selection routine InternalAddToSelection
> (line 12305ff):
>
> var
> I, J: Integer;
> CurrentEnd: Integer;
> ! Constrained, SiblingConstrained: Boolean;
>
> begin
> ...
> begin
> Constrained := voLevelSelectConstraint in FOptions;
> ! SiblingConstrained := voSiblingSelectConstraint in FOptions;
> if Constrained and (FLastSelectionLevel = -1) then
> FLastSelectionLevel := GetNodeLevel(NewItems[0]);
>
> for I := 0 to NewLength - 1 do
> ! if ([vsSelected, vsDisabled] * NewItems[I].States <> []) or
> ! (Constrained and (Cardinal(FLastSelectionLevel) <>
> GetNodeLevel(NewItems[I]))) or
> ! (SiblingConstrained and (FSelectionCount > 0) and
> (FSelection[0].Parent <> NewItems[i].Parent)) then
> Inc(Cardinal(NewItems[I]))
> else
> Include(NewItems[I].States, vsSelected);
> end;

I had to change the code a bit because you rely here on the first entry in
the selection array which can be any node (this array is sorted by memory
locations to quickly find a node using a binary search). The better way is
to use the selection range anchor which is set to the first selected node
ever. The full code will be in the new version later this week.

;-) I hope you are happy now!

Ciao, Mike


re: Selection rows using "window"

From: Mike Lischke [public@l...]
Date: Wed Jan 10, 2001 2:10 pm
Subject: RE: [VirtualTreeview] Selection rows using "window"

> By the way, is there some way I can get the hints of the tree to be
> displayed in multiple lines (in "normal delphi hints" multiline is
> possible by adding CRLF)?

At the time being there is no such feature. The main problem is that VT uses
Unicode (even if this is not of any interest for most of you). Unicode,
however, can carry every language written somewhere on this small world
(plus many ancient and artifical scripts like agyptian hiroglyphs or the
klingon language).

Unfortunately, word breaking is totally different in those various languages
and the necessary APIs are not available on Win9x. WinNT/2K has no problems
with them, but I cannot and don't want to limit VT to WinNT only. I have not
even a clue about Linux and its Unicode abilities.

Currently I'm also working on my Unicode library (which is part of JEDI code
library JCL, see www.delphi-jedi.org). I will soon include word wrap support
and once this is done I can think about making multiline hints. This might
take, however, several months.

Ciao, Mike


Drag and drop question

From: [pete.fraser@s...]
Date: Wed Jan 10, 2001 6:11 pm
Subject: Drag and drop question

I'm trying to implement drag and drop and it's not working quite as I
expected.

I've got a VirtualTree and a richedit on a form and want to drag from
one to the other.

When I do so, the source node on the tree disappears and the text
appears in the RichEdit but none of the Richedits
OnDragOver/OnDragDrop events get called. I also didn't want the tree
node to disappear. How can I stop this action?

Rgds Pete

 | Replies | Author | Date
146 | Re: Drag and drop question | Mike Lischke | Wed 1/10/2001
152 | Re: Drag and drop question | [pete.fraser@s...] | Thu 1/11/2001


FixedCols for VirtualTreeView

From: [vincentsoft@h...]
Date: Wed Jan 10, 2001 7:07 pm
Subject: FixedCols for VirtualTreeView

Has anybody implemted this feature? Just like the FixedCols of TCustomDrawGrid.

 | Replies | Author | Date
154 | Re: FixedCols for VirtualTreeView | [jascha@c...] | Thu 1/11/2001


re: FixedCols for VirtualTreeView

From: "Mike Lischke" [public@l...]
Date: Wed Jan 10, 2001 8:33 pm
Subject: RE: [VirtualTreeview] FixedCols for VirtualTreeView

> Has anybody implemented this feature? Just like the FixedCols in
> TCustomGrid.

Not that I know of. VT is not a grid, please keep this in mind.

Ciao, Mike


re: Drag and drop question

From: "Mike Lischke" [public@l...]
Date: Wed Jan 10, 2001 8:33 pm
Subject: RE: [VirtualTreeview] Drag and drop question

Hi Peter,

> I'm trying to implement drag and drop and it's not working quite as I
> expected.
>
> I've got a VirtualTree and a richedit on a form and want to drag from
> one to the other.

TRichEdit is the only control in the VCL which does accept OLE drag'n drop by
default. Since VT uses
this too you can drag to the edit at all.

> When I do so, the source node on the tree disappears and the text
> appears in the RichEdit but none of the Richedits
> OnDragOver/OnDragDrop events get called.

This is because Borland implemented their own drag'n drop handling which is not
compatible with
Windows and the OLE system. Drag'n drop to rich edit is handled internally by
the control and no
notification is sent to the VCL (which could trigger the mentioned events).

>I also didn't want the tree node to disappear. How can I stop this action?

As you would do with every drag'n drop operation in Windows: press the Ctrl
key. VT cannot control
what effect a target window accepts by default and rich edit obviously prefers
moves instead copies.

Ciao, Mike

Dipl. Ing. Mike Lischke
Senior software developer
--
Homepage: http://www.lischke-online.de
GraphicEx: http://www.lischke-online.de/Graphics.html
Virtual Treeview: http://www.lischke-online.de/VirtualTreeview.html
Unicode Edit and library: http://www.lischke-online.de/Unicode.html

 | Replies | Author | Date
152 | Re: Drag and drop question | [pete.fraser@s...] | Thu 1/11/2001


Editing a branch

From: [lyann@o...]
Date: Wed Jan 10, 2001 8:37 pm
Subject: Editing a branch

Hi,
I am using an editable tree. I get an Edit component that comes above
my value, allowing me to edit it, but when I type <ENTER>, the
modified value is replaced by the previous one.
How can I do to get the value from the Edit-box, to save it in my data
and refresh the tree?

Thanks
Yann

 | Replies | Author | Date
148 | Re: Editing a branch | Mike Lischke | Wed 1/10/2001
155 | Re: Editing a branch | [lyann@o...] | Thu 1/11/2001
157 | Re: Editing a branch | Mike Lischke | Thu 1/11/2001


re: Editing a branch

From: "Mike Lischke" [public@l...]
Date: Wed Jan 10, 2001 9:16 pm
Subject: RE: [VirtualTreeview] Editing a branch

Hi Yann,

> I am using an editable tree. I get an Edit component that comes above
> my value, allowing me to edit it, but when I type <ENTER>, the
> modified value is replaced by the previous one.
> How can I do to get the value from the Edit-box, to save it in my data
> and refresh the tree?

Do you use a normal TEdit control? If yes then look at TEdit.Text. The built-in
edit control use the
OnNewText event, btw., to notify the application about an edited node.

Ciao, Mike

PS: I get all your messages twice. What is the reason?

 | Replies | Author | Date
155 | Re: Editing a branch | [lyann@o...] | Thu 1/11/2001


re: New option for selection restriction

From: Werner Lehmann [wl@b...]
Date: Wed Jan 10, 2001 10:08 pm
Subject: Re: [VirtualTreeview] New option for selection restriction

Mike Lischke wrote:
>
> > I have added a new option to my 'personal' :) version of the virtual
> > tree. It is called voSiblingSelectConstraint (as opposed to
> > the existing voLevelSelectConstraint). If this option is set only nodes
> > with the same parent node are selectable.
>
> It seems I have got very insistent users of Virtual Treeview otherwise I
> cannot explain why I get beaten so long until I do what they request :-).

You sound a little bit... annoyed. I hope this is still more fun than worry...

> Another guy suggested to make the main column switchable and I rejected it
> because I saw no sense. Finally, however, after a long discussion and
> getting some source code I implemented this feature. And so did I with your
> suggestion :o]

Good news for me, bad news for you (it appears). I hope not. Not sure what
a switchable main column is. The tree column can already be hidden/shown and
moved to other places. But I'll see.

> I had to change the code a bit because you rely here on the first entry in
> the selection array which can be any node (this array is sorted by memory
> locations to quickly find a node using a binary search). The better way is
> to use the selection range anchor which is set to the first selected node
> ever. The full code will be in the new version later this week.

Any selected node will do here. If the selection array contains no unselected
nodes (as it's name implies) this should be all the same. Selection anchor is
ok by me.

> ;-) I hope you are happy now!

I'm on steroids! Well, thanks for including that change. I am looking forward
to the next version.

Regards,
WL

 | Replies | Author | Date
151 | Re: New option for selection restriction | Mike Lischke | Thu 1/11/2001


re: Re: Sorting glyphs - my solution...

From: "Jay Shanker" [jshanker@s...]
Date: Wed Jan 10, 2001 3:24 am
Subject: Re: [VirtualTreeview] Re: Sorting glyphs - my solution...

> About the glyphs, I had a similar problem about the icons in the tree.
> Often you need to use system images, and also sometimes you need some
> more icons, because you want to show some special stuff with your own
> icons. What I do for the moment is handling my own imagelist and
> adding by hand all the icons I need. this takes a lot of space and
> has many times the same icon in it. Ok, I could come out with some
> improvement but someone said ;) we are lazy people, at least I am.
> Ok, I stop talking, I had the following idea about all those
> imagelists.
> Do you think the following would be easy to do:
> Lets says that we would have an imagelistLIST property with it's own
> simplistic propert editor. I could add as many imagelists I want.
> So all the imagelist properties we have around would be defined by
> a couple of values, the imagelist index and the icon index.
> Lets say we would have something like that:
> ImagelistList\
> SystemImages\
> Images\
> StateImages\
> HeaderImages\
> SortImages\
> Perso1\
> Perso2\

Hi all,

The above idea might only complicate it.
I use a solution where I create the Imagelist I need, dynamically (at runtime).

To ensure that there is no duplication if glyphs ( my imagelist generally
contains a
combination of system icons as well as custom icons), I have an associated
StringList. (It is easy to forget the power of
TStringList.IndexOfObject(Object))

For every icon I add to the imagelist I add an associated object to the
stringlist.
The code goes like this:

imgIdx := stringList.IndexOfObject(Icon); // If icon already exists this call
returns an index >= 0
if imIdx < 0 then // This icon is unique
begin
idx:=stringList.AddObject(cap,Icon);
idx := imgList.AddIcon(Icon);
end;

When you are finished adding icons, you can delete the string list.
This works perfectly in my applications where I have to use a system icon
if there is one or a custom icon in case there is none.

Bye,

Jay

[Non-text portions of this message have been removed]


re: New option for selection restriction

From: "Mike Lischke" [public@l...]
Date: Thu Jan 11, 2001 7:16 am
Subject: RE: [VirtualTreeview] New option for selection restriction

> > It seems I have got very insistent users of Virtual Treeview otherwise I
> > cannot explain why I get beaten so long until I do what they request :-).
>
> You sound a little bit... annoyed. I hope this is still more fun than worry...

No, no, this was meant to be a joke (hence the smiley after it). I found it
funny how long VT users
"fight" to get a particular feature. It's difficult to write jokes in a
different language...

Ciao, Mike


re: Drag and drop question

From: [pete.fraser@s...]
Date: Thu Jan 11, 2001 9:20 am
Subject: Re: Drag and drop question

Unfortunately Mike, I need the ability to catch the drag and drop in
the RichEdit - actually RobertDunn's version but similar - as I want
to do something different than just copy the text. It's also not
ideal to have to hold Ctrl down - my Customers have already
complained about that before :(

If there's a chance that you could add a property to turn off the
auto-delete function that would be good. A property to make drag and
drop work like the rest of the VCL would also be good.
I could investigate this further and add the code myself but if I
want it I'm sure that others may want it...

Rgds Pete

--- In [VirtualTreeview@egroups.com, "Mike Lischke" <public@l...]
wrote:
> Hi Peter,
>
> > I'm trying to implement drag and drop and it's not working quite
as I
> > expected.
> >
> > I've got a VirtualTree and a richedit on a form and want to drag
from
> > one to the other.
>
> TRichEdit is the only control in the VCL which does accept OLE
drag'n drop by default. Since VT uses
> this too you can drag to the edit at all.
>
>
> > When I do so, the source node on the tree disappears and the text
> > appears in the RichEdit but none of the Richedits
> > OnDragOver/OnDragDrop events get called.
>
> This is because Borland implemented their own drag'n drop handling
which is not compatible with
> Windows and the OLE system. Drag'n drop to rich edit is handled
internally by the control and no
> notification is sent to the VCL (which could trigger the mentioned
events).
>
> >I also didn't want the tree node to disappear. How can I stop this
action?
>
> As you would do with every drag'n drop operation in Windows: press
the Ctrl key. VT cannot control
> what effect a target window accepts by default and rich edit
obviously prefers moves instead copies.
>
> Ciao, Mike
>
> Dipl. Ing. Mike Lischke
> Senior software developer
> --
> Homepage: http://www.lischke-online.de
> GraphicEx: http://www.lischke-online.de/Graphics.html
> Virtual Treeview: http://www.lischke-online.de/VirtualTreeview.html
> Unicode Edit and library: http://www.lischke-online.de/Unicode.html


re: FixedCols for VirtualTreeView

From: "Fraser, Peter [Soundcraft UK]" [pete.fraser@s...]
Date: Thu Jan 11, 2001 10:41 am
Subject: RE: [VirtualTreeview] FixedCols for VirtualTreeView

For those who are interested (and Mike?)
I've added standard VCL drag and drop handling to VirtualTreeView as
follows:

I added a property - although it could be added as part of the options,
OleDragDrop which specifies if OLE drag and drop is enabled
(default=enabled)
I then modified BeginDrag to use this and call the inherited function
instead. See code below..

In private section of TCustomVirtualStringTree:

FOleDragDrop: Boolean; // flag to specify if drag
and drop is OLE or Standard VCL

In public section of TCustomVirtualStringTree:

property OleDragDrop: Boolean read FOleDragDrop write FOleDragDrop
default true;

In published section of TVirtualStringTree:

property OleDragDrop;

In TBaseVirtualTree.Create:
Add:
FOleDragDrop := True;

in TBaseVirtualTree.BeginDrag:

procedure TBaseVirtualTree.BeginDrag(Immediate: Boolean; Threshold:
Integer);

// reintroduced method to start OLE drag'n drop instead VCL drag'n drop

begin
if not FOleDragDrop then
inherited // call default VCL drag/drop code
else
begin
if (FStates * [tsDragPending, tsDragging]) = [] then
begin
// drag starting position is already recorded in WMMouseDown
if Threshold < 0 then
FDragThreshold := Mouse.DragThreshold
else
FDragThreshold := Threshold;
if Immediate then
DoDragging(FDragStartPos)
else
Include(FStates, tsDragPending);
end;
end;
end;

Mike,
It would be nice to add this - please? or make it part of options - just as
long as the functionality is there - please?

Rgds Pete
=======================================
Home: [pete.fraser@f...] <mailto:[pete.fraser@f...]

Work: [pete.fraser@s...] <mailto:[pete.fraser@s...]
WWW: http://www.frasersoft.co.uk <http://www.frasersoft.co.uk/>


re: FixedCols for VirtualTreeView

From: [jascha@c...]
Date: Thu Jan 11, 2001 12:40 pm
Subject: Re: FixedCols for VirtualTreeView

--- In [VirtualTreeview@egroups.com, [vincentsoft@h...] wrote:
> Has anybody implemted this feature? Just like the FixedCols of
TCustomDrawGrid.

Yes, I have added a FixedColumns property to the header that
specifies a column index. All columns up to and including that index
cannot be moved and no other column can be dragged into that range
either.

I can e-mail it to you if you want - it is something like beta - i.e.
not tested in a live environment so you use it as is or merge the
code as you see fit. I have not submitted it to Mike yet as I want to
test it further and probably have some other features to add.

Due to my *mistake* last week you may well have received the code
already as an attachment! If you want it e-mail me at
jascha@c...]

Regards,

Jascha


re: Editing a branch

From: [lyann@o...]
Date: Thu Jan 11, 2001 1:31 pm
Subject: Re: Editing a branch

Thanks, it is working great !
Your component is so great, It gives a lot more value to my
application. Now, I can connect to my robot via TCP, and display a
tree of all the instruments, sensors, and controllers, and edit them
graphically... Cool !

> PS: I get all your messages twice. What is the reason?
No Idea.... Sorry... Maybe my mail server?


re: FixedCols for VirtualTreeView

From: Mike Lischke [public@l...]
Date: Thu Jan 11, 2001 1:36 pm
Subject: RE: [VirtualTreeview] FixedCols for VirtualTreeView

Hi Peter,

> if not FOleDragDrop then
> inherited // call default VCL drag/drop code
>
> Mike,
> It would be nice to add this - please? or make it part of
> options - just as
> long as the functionality is there - please?

Sometimes I'm so stupid, it is scary. Implementating optional VCL dd is so
simple I haven't simply seen the solution. I thought it would be like
simulating the CM_DRAG messages...

Please excuse my ignorance and thank you Peter for this solution. Of course
I will take it into VT 2.0. The only change I will make is to give the
switch another name to fit better into the Drag* properties group (I'm
thinking of DragType, as DragKind is already taken).

Ciao, Mike


re: Re: Editing a branch

From: Mike Lischke [public@l...]
Date: Thu Jan 11, 2001 1:37 pm
Subject: RE: [VirtualTreeview] Re: Editing a branch

> Thanks, it is working great !

You are welcome :o]

> > PS: I get all your messages twice. What is the reason?
> No Idea.... Sorry... Maybe my mail server?

This message came only once, mmmh.

Ciao, Mike


re: FixedCols for VirtualTreeView

From: "Fraser, Peter [Soundcraft UK]" [pete.fraser@s...]
Date: Thu Jan 11, 2001 1:34 pm
Subject: RE: [VirtualTreeview] FixedCols for VirtualTreeView

It's looking like it's not as simple as I thought as now I can't get the RH
mouse context menu to work when the new flag is false (i.e.VCL drag/drop).
Further investgation under way unless you know of a solution.

Rgds Pete
=======================================
Home: [pete.fraser@f...] <mailto:[pete.fraser@f...]
Work: [pete.fraser@s...] <mailto:[pete.fraser@s...]
WWW: http://www.frasersoft.co.uk <http://www.frasersoft.co.uk/>

> -----Original Message-----
> From: Mike Lischke [mailto:[public@l...]]
> Sent: 11 January 2001 13:36
> To: 'VirtualTreeview@egroups.com'
> Subject: RE: [VirtualTreeview] FixedCols for VirtualTreeView
>
>
> Hi Peter,
>
> > if not FOleDragDrop then
> > inherited // call default VCL drag/drop code
> >
> > Mike,
> > It would be nice to add this - please? or make it part of
> > options - just as
> > long as the functionality is there - please?
>
> Sometimes I'm so stupid, it is scary. Implementating optional
> VCL dd is so
> simple I haven't simply seen the solution. I thought it would be like
> simulating the CM_DRAG messages...
>
> Please excuse my ignorance and thank you Peter for this
> solution. Of course
> I will take it into VT 2.0. The only change I will make is to give the
> switch another name to fit better into the Drag* properties group (I'm
> thinking of DragType, as DragKind is already taken).
>
> Ciao, Mike
>
> To unsubscribe from this group, send an email to:
> VirtualTreeview-unsubscribe@egroups.com
>
>
>


re: FixedCols for VirtualTreeView

From: "Fraser, Peter [Soundcraft UK]" [pete.fraser@s...]
Date: Thu Jan 11, 2001 2:20 pm
Subject: RE: [VirtualTreeview] FixedCols for VirtualTreeView

I'm trying to get the VirtualTree to be auto-sorted when adding nodes.
What is the correct way to do this.
I can see the Sort function but it looks as if it's a callback.
Is there any way to do this without calling Sort everytime I add a node?

Rgds Pete
=======================================
Home: [pete.fraser@f...] <mailto:[pete.fraser@f...]

Work: [pete.fraser@s...] <mailto:[pete.fraser@s...]
WWW: http://www.frasersoft.co.uk <http://www.frasersoft.co.uk/>


re: FixedCols for VirtualTreeView

From: Mike Lischke [public@l...]
Date: Thu Jan 11, 2001 2:32 pm
Subject: RE: [VirtualTreeview] FixedCols for VirtualTreeView

> I'm trying to get the VirtualTree to be auto-sorted when adding nodes.
> What is the correct way to do this.
> I can see the Sort function but it looks as if it's a callback.
> Is there any way to do this without calling Sort everytime I
> add a node?

Not possible. The Sort method is the only way to get the tree sorted.

Ciao, Mike


Sorting TreeView

From: "Fraser, Peter [Soundcraft UK]" [pete.fraser@s...]
Date: Thu Jan 11, 2001 4:38 pm
Subject: Sorting TreeView

So if that's true what do all the parameters mean.
Node: what's this used for? all nodes under this one? how to sort whole
tree?
Column: column we sort on?
Ascending: sort forwards/backwards?
Compare: function to do compare on
DoInit: what?

It would be more compatible with the VCL tree if you added a Sorted property
and a n event to do actual sort. Then when adding, inserting nodes you could
do the sort automatically. I know I don't ask for much <g> but the closer it
is to the VCL tree, the easier it is to port from the VCL tree - which I am
having to do :(
You would probably need to add a SortColumn property also.
If you don't want to do it - do you want me to look into it? There's an
offer you can't refuse :)

Rgds Pete

> > I'm trying to get the VirtualTree to be auto-sorted when
> adding nodes.
> > What is the correct way to do this.
> > I can see the Sort function but it looks as if it's a callback.
> > Is there any way to do this without calling Sort everytime I
> > add a node?
>
> Not possible. The Sort method is the only way to get the tree sorted.
>
> Ciao, Mike
>
> To unsubscribe from this group, send an email to:
> VirtualTreeview-unsubscribe@egroups.com
>
>
>

 | Replies | Author | Date
167 | Re: Sorting TreeView | Mike Lischke | Fri 1/12/2001
175 | Re: Sorting TreeView | Fraser, Peter [Soundcraft UK] | Fri 1/12/2001
179 | Re: Sorting TreeView | Mike Lischke | Sat 1/13/2001
189 | Re: Sorting TreeView | Geoffrey Pan | Sun 1/14/2001
190 | Sorting TreeView | Geoffrey Pan | Sun 1/14/2001
191 | Re: Sorting TreeView | Mike Lischke | Mon 1/15/2001


Source Code Download

From: [dralder@c...]
Date: Thu Jan 11, 2001 8:37 pm
Subject: Source Code Download

Is there somewhere the sourcecode available?
Especially

VirtualTrees.pas
VirtualTrees.dcr
VirtualTrees.res
DFS.inc

 | Replies | Author | Date
163 | Re: Source Code Download | Geoffrey Pan | Thu 1/11/2001
164 | Re: Source Code Download | =?iso-8859-1?Q?Bj=F6rn_Lindel | Thu 1/11/2001
165 | Forcing complete init on create | Geoffrey Pan | Fri 1/12/2001
176 | Re: Source Code Download | [dralder@c...] | Sat 1/13/2001


re: Source Code Download

From: "Geoffrey Pan" [gpan@c...]
Date: Thu Jan 11, 2001 8:51 pm
Subject: RE: [VirtualTreeview] Source Code Download

VirtualTrees is distributed as open source on Mike's website

-----Original Message-----
From: [dralder@c...] [mailto:[dralder@c...]]
Sent: Thursday, January 11, 2001 2:38 PM
To: VirtualTreeview@egroups.com
Subject: [VirtualTreeview] Source Code Download

Is there somewhere the sourcecode available?
Especially

VirtualTrees.pas
VirtualTrees.dcr
VirtualTrees.res
DFS.inc

To unsubscribe from this group, send an email to:
VirtualTreeview-unsubscribe@egroups.com


re: Source Code Download

From: Björn Lindell [bli@c...]
Date: Thu Jan 11, 2001 9:11 pm
Subject: Re: [VirtualTreeview] Source Code Download

http://www.lischke-online.de/VirtualTreeview.html

/Björn

----- Original Message -----
From: [dralder@c...]
To: [VirtualTreeview@egroups.com>
Sent: Thursday, January 11, 2001 9:37 PM
Subject: [VirtualTreeview] Source Code Download

> Is there somewhere the sourcecode available?
> Especially
>
> VirtualTrees.pas
> VirtualTrees.dcr
> VirtualTrees.res
> DFS.inc
>
>
> To unsubscribe from this group, send an email to:
> VirtualTreeview-unsubscribe@egroups.com
>
>

Replies | Author | Date
165 | Forcing complete init on create | Geoffrey Pan | Fri 1/12/2001


Forcing complete init on create

From: "Geoffrey Pan" [gpan@c...]
Date: Fri Jan 12, 2001 3:17 am
Subject: Forcing complete init on create

Any idea on how I could force all nodes to be initialized upon create?, or
at least what part of the code to look in?

The problem is that sorting will only sort initialized nodes, which can
cause some strange issues.

Thanks in advance.


re: Forcing complete init on create

From: Mike Lischke [public@l...]
Date: Fri Jan 12, 2001 8:43 am
Subject: RE: [VirtualTreeview] Forcing complete init on create

> Any idea on how I could force all nodes to be initialized
> upon create?, or
> at least what part of the code to look in?

ValidateNode(nil); for all nodes.

> The problem is that sorting will only sort initialized nodes,
> which can cause some strange issues.

That's the reason why there is a DoInit switch.

Ciao, Mike


re: Sorting TreeView

From: Mike Lischke [public@l...]
Date: Fri Jan 12, 2001 12:19 pm
Subject: RE: [VirtualTreeview] Sorting TreeView

> So if that's true what do all the parameters mean.

You already got it, almost, Peter.

> Node: what's this used for? all nodes under this one?

"Sort" sorts a Node's child nodes.

>how to sort whole tree?

This is not possible in one step. You can Sort(nil) for the top level nodes
and then go iteratively through the tree (e.g. IterateTree) and sort
children and grandchildren.

> Column: column we sort on?

Of course, what else?

> Ascending: sort forwards/backwards?

Ascending means nodes with higher index have the larger values.

> Compare: function to do compare on

Yep. Since the tree does nothing know about the node's data the application
has to provide a comparation function to determine the actual order.

> DoInit: what?

To allow to initialize child nodes if they aren't already. Otherwise wrong
results can appear.

> It would be more compatible with the VCL tree if you added a
> Sorted property and an event to do actual sort. Then when adding,
> inserting nodes you could do the sort automatically.

Actually, I don't care about compatibility to TTreeview. This may sound
harsh, but VT is so different and TTreeview has got so many (design)
problems it would perhaps be a shame to be too compatible. I already added
methods to make porting easier (e.g. AddChild) which fundamentally collide
with the virtual approach of VT (ValidateNode(nil, True) and FullExpand are
the worst of all). With every of those comfort functions, which could easily
be implemented in the application using a couple of lines, VT will go
farther away from its initial goal. This goal however is the main reason why
VT is so fast etc.

> I know I don't ask for much <g> but the closer it is to the VCL tree, the
easier
> it is to port from the VCL tree - which I am having to do :(

With every method, with every property and with every option added to the
tree porting from other tree implementation will become even more difficult,
not to speak about absolute newcomers trying to understand the
implementation at all.

Don't think I want to avoid work. It is probably easy to implement a
sort-on-add/insert and I believe I have shown that I (carefully) extend the
tree whenever needed. But you (generally speaking) should really think about
what should be added. I agree, however, that sorting is probably an
important extensions to VT and the discussions about the sort glyph show
that I'm already on the way to a more complete sort solution.

> You would probably need to add a SortColumn property also.

This would then be necessary to determine on which column to sort when doing
auto sort. Btw. You should be aware that sorting always needs validated
nodes, so you should always expect time penalties when enabling this.

> If you don't want to do it - do you want me to look into it?
> There's an offer you can't refuse :)

Yes, why not. If you think you can make this work then go ahead. I
appreciate any help which frees me from things. Then I can focus on other
stuff which requires my attention.

Ciao, Mike


FAQ collection

From: Mike Lischke [public@l...]
Date: Fri Jan 12, 2001 12:36 pm
Subject: FAQ collection

Hi all,

I've got a proposal for a way to create a FAQ for Virtual Treeview and want
to know if there are any volunteers on this mailing list who would like to
take the job. It basically requires to listen to this list and copy'n paste
all questions and their answers into a plain document. Of couse some
postprocessing would be necessary to make questions being correct english
language and perhaps to reformulate them a bit if the problem is not easy to
extract (e.g. for non-native english speakers). Some ordering and
maintaining an index/content table is important too.

I would publish this document on my homepage (of course with the name of the
maintainer in large letters ;-)) and would also include it into the
distribution.

Having such a FAQ/code collection would be useful for everyone concerned
with Virtual Treeview. The power user, who does not have to repeat over and
over again answers to simple questions and the normal user, who comes across
a problem which already has been solved.

Ciao, Mike

Mike Lischke
digital publishing AG, Munich, Germany
R&D Senior software engineer


re: Drag-And-Drop: Solution and Bug

From: [HBender@E...]
Date: Fri Jan 12, 2001 2:20 pm
Subject: Re: Drag-And-Drop: Solution and Bug

> This is determined in DoDragging. See this line:
>
> AllowedEffects := DROPEFFECT_COPY or DROPEFFECT_MOVE {or
DROPEFFECT_LINK};
>
> Does it make sense to create a published property?
>

Yes, it does, definitely!
Heri


re: Re: Drag-And-Drop: Solution and Bug

From: Mike Lischke [public@l...]
Date: Fri Jan 12, 2001 2:37 pm
Subject: RE: [VirtualTreeview] Re: Drag-And-Drop: Solution and Bug

> > Does it make sense to create a published property?
> >
>
> Yes, it does, definitely!

This is already done and appears in version 2.0. The property is called
DragOperations and can take (doCopy, doMove, doLink).

Ciao, Mike


Reenviar: Please reply to unsubscribe from VirtualTreeview

From: [JoseRobl@i...]
Date: Fri Jan 12, 2001 10:34 pm
Subject: Reenviar: Please reply to unsubscribe from VirtualTreeview

Unscribe from VirtualTreeview.

_______________________________________________________________
Date de alta en inicia y dispondrás de correo y espacio para tu página
personal. http://inicia.es

[Non-text portions of this message have been removed]


re: Reenviar: Please reply to unsubscribe from VirtualTreeview

From: "Hickman, Paul" [paul.hickman@f...]
Date: Fri Jan 12, 2001 4:18 pm
Subject: RE: [VirtualTreeview] Reenviar: Please reply to unsubscribe from VirtualTreeview

-----Original Message-----
From: [JoseRobl@i...] [mailto:[JoseRobl@i...]]
Sent: 12 January 2001 15:34
To: VirtualTreeview@egroups.com
Subject: [VirtualTreeview] Reenviar: Please reply to unsubscribe from
VirtualTreeview

Unscribe from VirtualTreeview.

_______________________________________________________________
Date de alta en inicia y dispondrás de correo y espacio para tu página
personal. http://inicia.es

[Non-text portions of this message have been removed]

To unsubscribe from this group, send an email to:
VirtualTreeview-unsubscribe@egroups.com

 | Replies | Author | Date
173 | Re: Reenviar: Please reply to unsubscribe from V | Mike Lischke | Fri 1/12/2001


re: Reenviar: Please reply to unsubscribe from VirtualTreeview

From: "Mike Lischke" [public@l...]
Date: Fri Jan 12, 2001 5:23 pm
Subject: RE: [VirtualTreeview] Reenviar: Please reply to unsubscribe from VirtualTreeview

> To unsubscribe from this group, send an email to:
> VirtualTreeview-unsubscribe@egroups.com

You should perhaps read the line above.

Ciao, Mike


DragAndDrop with ProcessDrop

From: Bender Heri [HBender@E...]
Date: Fri Jan 12, 2001 6:33 pm
Subject: DragAndDrop with ProcessDrop

ProcessDrop does not work properly (with MoveTo it works fine!). Here my
code (TCEFileTree is a derivation of TVirtualStringTree):

procedure TCEFileTree.OnDragDropCallback(Sender: TBaseVirtualTree; Source:
TObject; DataObject: IDataObject;
const
Formats: array of Word; Shift: TShiftState; Pt: TPoint; var Effect: Integer;
Mode: TDropMode);
var
oFileTree : TCEFileTree absolute Source;
pSourceNode : PVirtualNode;
pDestNode : PVirtualNode;
begin
if Source = self then begin
pSourceNode := oFileTree.FocusedNode;
pDestNode := GetNodeAt(pt.x,pt.y);
assert(pSourceNode <> nil);
assert(pDestNode <> nil);

{$ifdef DropWithProcessDrop}
Effect := DROPEFFECT_MOVE;
Sender.ProcessDrop(DataObject,pDestNode,effect,amAddChildFirst);
{$else}
MoveTo(pSourceNode,pDestNode,amAddChildFirst,False);
Effect := DROPEFFECT_NONE;
{$endif}

end
else
effect := DropEffect_None;
end;

In the function ProcessOLEData, the call to Source.GetSortedCutCopySet(True)
delivers no nodes (no wonder, I have not copied or cut, I have drag and
dropped !).
If I leave the effect like it comes in into the above code (3 = Move or
Copy), then not the optimized section in ProcessOleData is executed. And
there first the ClearSelection is called. The call after to
DataObject.GetData ends up in RenderData, where no selected node can be
found.

What is wrong?

Heri

 | Replies | Author | Date
178 | Re: DragAndDrop with ProcessDrop | Mike Lischke | Sat 1/13/2001


re: Sorting TreeView

From: "Fraser, Peter [Soundcraft UK]" [pete.fraser@s...]
Date: Fri Jan 12, 2001 12:57 pm
Subject: RE: [VirtualTreeview] Sorting TreeView

Mike,
Now that I think about it more it is better not to have it quite so built
in. When I add a node, I don't want the whole tree sorting, just the
siblings for this node's level.
However it might be useful to have a function to call to Sort the whole tree
- it's the kind of thing that people might want and rather than everyone
inventing it.
I'll look into some ideas - perhaps after you've added the Sorting icon bits
- and post them here for comments.

Thanks for the info.
Pete

> -----Original Message-----
> From: Mike Lischke [mailto:[public@l...]]
> Sent: 12 January 2001 12:19
> To: 'VirtualTreeview@egroups.com'
> Subject: RE: [VirtualTreeview] Sorting TreeView
>
>
> > So if that's true what do all the parameters mean.
>
> You already got it, almost, Peter.
>
> > Node: what's this used for? all nodes under this one?
>
> "Sort" sorts a Node's child nodes.
>
> >how to sort whole tree?
>
> This is not possible in one step. You can Sort(nil) for the
> top level nodes
> and then go iteratively through the tree (e.g. IterateTree) and sort
> children and grandchildren.
>
> > Column: column we sort on?
>
> Of course, what else?
>
> > Ascending: sort forwards/backwards?
>
> Ascending means nodes with higher index have the larger values.
>
> > Compare: function to do compare on
>
> Yep. Since the tree does nothing know about the node's data
> the application
> has to provide a comparation function to determine the actual order.
>
> > DoInit: what?
>
> To allow to initialize child nodes if they aren't already.
> Otherwise wrong
> results can appear.
>
>
> > It would be more compatible with the VCL tree if you added a
> > Sorted property and an event to do actual sort. Then when adding,
> > inserting nodes you could do the sort automatically.
>
> Actually, I don't care about compatibility to TTreeview. This
> may sound
> harsh, but VT is so different and TTreeview has got so many (design)
> problems it would perhaps be a shame to be too compatible. I
> already added
> methods to make porting easier (e.g. AddChild) which
> fundamentally collide
> with the virtual approach of VT (ValidateNode(nil, True) and
> FullExpand are
> the worst of all). With every of those comfort functions,
> which could easily
> be implemented in the application using a couple of lines, VT will go
> farther away from its initial goal. This goal however is the
> main reason why
> VT is so fast etc.
>
> > I know I don't ask for much <g> but the closer it is to the
> VCL tree, the
> easier
> > it is to port from the VCL tree - which I am having to do :(
>
> With every method, with every property and with every option
> added to the
> tree porting from other tree implementation will become even
> more difficult,
> not to speak about absolute newcomers trying to understand the
> implementation at all.
>
> Don't think I want to avoid work. It is probably easy to implement a
> sort-on-add/insert and I believe I have shown that I
> (carefully) extend the
> tree whenever needed. But you (generally speaking) should
> really think about
> what should be added. I agree, however, that sorting is probably an
> important extensions to VT and the discussions about the sort
> glyph show
> that I'm already on the way to a more complete sort solution.
>
> > You would probably need to add a SortColumn property also.
>
> This would then be necessary to determine on which column to
> sort when doing
> auto sort. Btw. You should be aware that sorting always needs
> validated
> nodes, so you should always expect time penalties when enabling this.
>
> > If you don't want to do it - do you want me to look into it?
> > There's an offer you can't refuse :)
>
> Yes, why not. If you think you can make this work then go ahead. I
> appreciate any help which frees me from things. Then I can
> focus on other
> stuff which requires my attention.

 | Replies | Author | Date
179 | Re: Sorting TreeView | Mike Lischke | Sat 1/13/2001
189 | Re: Sorting TreeView | Geoffrey Pan | Sun 1/14/2001
190 | Sorting TreeView | Geoffrey Pan | Sun 1/14/2001


re: Source Code Download

From: [dralder@c...]
Date: Sat Jan 13, 2001 8:57 am
Subject: Re: Source Code Download

Thanks a lot. The component is really GREAT
--- In [VirtualTreeview@egroups.com, Björn Lindell [bli@c...] wrote:
> http://www.lischke-online.de/VirtualTreeview.html
>
> /Björn
>
>
> ----- Original Message -----
> From: <dralder@c...]
> To: <VirtualTreeview@egroups.com>
> Sent: Thursday, January 11, 2001 9:37 PM
> Subject: [VirtualTreeview] Source Code Download
>
>
> > Is there somewhere the sourcecode available?
> > Especially
> >
> > VirtualTrees.pas
> > VirtualTrees.dcr
> > VirtualTrees.res
> > DFS.inc
> >
> >
> > To unsubscribe from this group, send an email to:
> > VirtualTreeview-unsubscribe@egroups.com
> >
> >


Version 2 Submissions Deadline

From: [jascha@c...]
Date: Sat Jan 13, 2001 10:21 am
Subject: Version 2 Submissions Deadline

Mike,

What is the deadline for inclusion of submissions for version 2 and
when will it be released? Also, how do we submit code?

Regards,

Jascha

 | Replies | Author | Date
180 | Re: Version 2 Submissions Deadline | Mike Lischke | Sat 1/13/2001
181 | Re: Version 2 Submissions Deadline | [jascha@c...] | Sat 1/13/2001
185 | Re: Version 2 Submissions Deadline | Mike Lischke | Sun 1/14/2001
194 | Re: Version 2 Submissions Deadline | [jascha@c...] | Mon 1/15/2001
183 | Re: Version 2 Submissions Deadline | Jeurk | Sun 1/14/2001
184 | Re: Version 2 Submissions Deadline | Mike Lischke | Sun 1/14/2001
195 | Re: Version 2 Submissions Deadline | [jascha@c...] | Mon 1/15/2001
182 | Re: Version 2 Submissions Deadline | Cyril VELTER | Sat 1/13/2001
186 | Re: Version 2 Submissions Deadline | Mike Lischke | Sun 1/14/2001


re: DragAndDrop with ProcessDrop

From: "Mike Lischke" [public@l...]
Date: Sat Jan 13, 2001 2:02 pm
Subject: RE: [VirtualTreeview] DragAndDrop with ProcessDrop

Hallo Heri,

> In the function ProcessOLEData, the call to Source.GetSortedCutCopySet(True)
> delivers no nodes (no wonder, I have not copied or cut, I have drag and
> dropped !).
> If I leave the effect like it comes in into the above code (3 = Move or
> Copy), then not the optimized section in ProcessOleData is executed. And
> there first the ClearSelection is called. The call after to
> DataObject.GetData ends up in RenderData, where no selected node can be
> found.
>
> What is wrong?

It is a bug and now fixed. I have looked into this and found that I have not
finished a change I
made when I improved drag'n drop handling. This happens sometimes when I
suddenly get assigned to
another task.

Ciao, Mike


re: Sorting TreeView

From: "Mike Lischke" [public@l...]
Date: Sat Jan 13, 2001 2:02 pm
Subject: RE: [VirtualTreeview] Sorting TreeView

Hi Peter,

> Now that I think about it more it is better not to have it quite so built
> in. When I add a node, I don't want the whole tree sorting, just the
> siblings for this node's level.

I have implemented it this way.

> However it might be useful to have a function to call to Sort the whole tree
> - it's the kind of thing that people might want and rather than everyone
> inventing it.

Also this one is now implemented and to get rid of the problem "compare
function of object or not" I
have changed this to an event (OnCompareNodes). This way is necessary too to do
auto sort (which is
now an option in the tree).

Ciao, Mike

 | Replies | Author | Date
189 | Re: Sorting TreeView | Geoffrey Pan | Sun 1/14/2001
190 | Sorting TreeView | Geoffrey Pan | Sun 1/14/2001


re: Version 2 Submissions Deadline

From: "Mike Lischke" [public@l...]
Date: Sat Jan 13, 2001 2:27 pm
Subject: RE: [VirtualTreeview] Version 2 Submissions Deadline

Jascha,

> What is the deadline for inclusion of submissions for version 2 and
> when will it be released? Also, how do we submit code?

This is a good question. I want to have version 2 ready this weekend (not sure
if I get all ready,
including help and demos). Currently code submissions happen by posting a
proposal here in the list
and (if accepted) I copy them out or make a similar implementation (as with the
OLE/VCL drag'n drop
proposal).

This situation will persist until I get a FreeVCS server to put the control in.
This will likely be
the JEDI-VCL VCS project, but could well be any other server/project too.

Ciao, Mike

 | Replies | Author | Date
181 | Re: Version 2 Submissions Deadline | [jascha@c...] | Sat 1/13/2001
185 | Re: Version 2 Submissions Deadline | Mike Lischke | Sun 1/14/2001
194 | Re: Version 2 Submissions Deadline | [jascha@c...] | Mon 1/15/2001
183 | Re: Version 2 Submissions Deadline | Jeurk | Sun 1/14/2001
184 | Re: Version 2 Submissions Deadline | Mike Lischke | Sun 1/14/2001
195 | Re: Version 2 Submissions Deadline | [jascha@c...] | Mon 1/15/2001


re: Version 2 Submissions Deadline

From: [jascha@c...]
Date: Sat Jan 13, 2001 7:02 pm
Subject: Re: Version 2 Submissions Deadline

Mike,

Below are the header notes I have added summarising the fixes /
enhancements I have made. Let me know which of these (if any) you
might wish to incorporate. I can send you the full source if you want
(via direct mail this time!).

// 2-JAN-2000 DJG: (all changed lines marked "// DJG")
// - added OnHeaderDragOver to TBaseVirtualTree and made published
in TVirtualDrawTree and TVirtualStringTree
// that provides a CanDrop boolean var parameter allowing header
dropping to be blocked
// - added Header.FixedColumn: integer to TVTHeader that prevents
dragging of columns with index < FixedColumn and
// also prevents other columns being dragged before any column
with index < FixedColumn
// - added handling of coMovable column option
// - fix to force redrawing of header at design time if Images
changes (see TBaseVirtualTree.SetImages)
// - fix for bug that prevents DefaultText being cleared in object
inspector (see TCustomVirtualstringTree.DefineProperties)
// - added Alignment property to column that sets the column header
alignment
// string tree also uses this to align text but does not work
when static text is drawn and Alignment <> taLeftJustify
// - fix to ensure that ParentColor=true is streamed to dfm (see
TVirtual...Tree.ParentColor property declarations)

Regards,

Jascha

 | Replies | Author | Date
185 | Re: Version 2 Submissions Deadline | Mike Lischke | Sun 1/14/2001
194 | Re: Version 2 Submissions Deadline | [jascha@c...] | Mon 1/15/2001


re: Version 2 Submissions Deadline

From: "Cyril VELTER" [cyril.velter@l...]
Date: Sat Jan 13, 2001 9:45 pm
Subject: Re: Version 2 Submissions Deadline

Hello,

Three more proposals :

* Make the EditTimer delay a propertie of the tree (instead of the hard
coded 1000 ms)

* Provide a way (I've done it with an event) to create a custom
DragDropManager to allow custom format and management of OLE drag and drop.

* Ask the application (with an event for example) for Column headers
informations (like you already do so nicely for nodes).

Thanks for creating this nice control.

cyril

PS : I've used Sleuth CodeWatch on an application I've made with
VirtualTreeView, and it show me several leaks and errors :

* Palette leak (which number depend on the usage). The original
allocation is at line 6536 of VirtualTreeView 1.31 (in function makepalette
of TBaseVirtualTree.PrepareBitmaps).
* Global Memory Handle leak : only one leak, original allocation at line
3469 (TVTDragDropManager.RenderData)

 | Replies | Author | Date
186 | Re: Version 2 Submissions Deadline | Mike Lischke | Sun 1/14/2001


re: Version 2 Submissions Deadline

From: "Jeurk " [knipjo@h...]
Date: Sun Jan 14, 2001 3:47 am
Subject: Re: Version 2 Submissions Deadline

--- Our dear, "Mike Lischke" [public@l...] wrote:
>I've got a proposal for a way to create a FAQ for Virtual
>Treeview and want to know if there are any volunteers on
>this mailing list who would like to
I was thinking about that, but was stopped by the fact that you gave
out the component to the jedi group...
Right now, I don't have that much time and my english is not that
perfect...
But if nobody volonteers I can start working on it...as time permits.
What is the way you thought of ?
Also, it would be great to have a section where people could
contribute with samples...

> This is a good question. I want to have version 2 ready this
> weekend (not sure if I get all ready,
This would be great. Maybe if it's not completly ready you could
post an as is release ?

> This situation will persist until I get a FreeVCS server to put the
control in. This will likely be
> the JEDI-VCL VCS project, but could well be any other
server/project too.
I saw somewhere you are not that hot on move to sourceforge... how
is that ? Is that jedi project still alive ? I think their site is
just such a mess...

John.

 | Replies | Author | Date
184 | Re: Version 2 Submissions Deadline | Mike Lischke | Sun 1/14/2001
195 | Re: Version 2 Submissions Deadline | [jascha@c...] | Mon 1/15/2001


re: Re: Version 2 Submissions Deadline

From: "Mike Lischke" [public@l...]
Date: Sun Jan 14, 2001 9:14 am
Subject: RE: [VirtualTreeview] Re: Version 2 Submissions Deadline

Hi John,

> I was thinking about that, but was stopped by the fact that you gave
> out the component to the jedi group...

Basically yes, but you should know that contributions to JEDI are not
maintained by ghosts
afterwards. I still are responsible for my component and all what's to do with
it.

> But if nobody volonteers I can start working on it...as time permits.
> What is the way you thought of ?

Very easy, I imagine it so that you would simply read all messages floating
around in this mailing
list and copy out code and other useful answers made by anyone here into a
document which can be
distributed. Of course, code must often be restructured, lengthy discussions
must be trimmed so the
question and the answer can nicely be seen. Also a content table would be
great. That's more or less
what I would expect.

> Also, it would be great to have a section where people could
> contribute with samples...

Mmm, for now the mailing list is enough, I think.

> This would be great. Maybe if it's not completly ready you could
> post an as is release ?

Actually, I came quite far, but now I have proposals for additions. Let me see
what I get done
today.

> I saw somewhere you are not that hot on move to sourceforge... how
> is that ?

Very simple. I already work with FreeVCS (JEDI and in my company). Sourceforge
is totally different
and is webbased. Additionally, I do not like the organization of the site very
much, but this is not
so important. The keypoint is that I have to optimize what I do as much as
possible (and several
version control systems are not very optimal). If I don't get any FreeVCS
servers, then I will
perhaps go with SourceForge, but this can wait.

>Is that jedi project still alive ? I think their site is
> just such a mess...

:o] I agree. The portal is not very appealing. But just this very morning I got
an eMail on the JEDI
main list which asked for links to publish and a short notification about a
soon-to-be-expected
update. Here a snippet:

-----
I'm building the next generation JEDI Portal, a collection of links
connecting the JEDI/Delphi community to itself. In it I hope to publish a
huge amount of links to the special Delphi sites we all come back to again
and again. The grunt work (html etc) is done and lots of new fresh links
have been added. I plan the launch the new Portal site along with the next
major website update. Thanks for your contribution to the JEDI Portal website!
----- end quote

In JEDI is a lot going on. E.g. very soon you can also expect the first full
release of the JEDI
code library. This one is really great, once you used it you will never want to
go without with.
Sorry for this shameless plug :-) but as member of the JEDI steering team I
feel responsible to
inform people about JEDI.

Ciao, Mike


re: Re: Version 2 Submissions Deadline

From: "Mike Lischke" [public@l...]
Date: Sun Jan 14, 2001 11:06 am
Subject: RE: [VirtualTreeview] Re: Version 2 Submissions Deadline

Hi Jascha,

> Below are the header notes I have added summarising the fixes /
> enhancements I have made. Let me know which of these (if any) you
> might wish to incorporate. I can send you the full source if you want
> (via direct mail this time!).

This is quite a lot of stuff and I would like to delay it to the next version
after 2.0. But let me
comment on them so we can clarify things.

> // 2-JAN-2000 DJG: (all changed lines marked "// DJG")

Perfect. With an increasing number of contributors it makes no sense anymore to
keep every name in
the source. I will therefore not keep individual change comments in the source.
However they are
very useful to see where things are changed and so I recommend always to use
this kind of marks when
contributing code directly in the original source.

Please send your version to [public@l...]

> // - added OnHeaderDragOver to TBaseVirtualTree and made published
> in TVirtualDrawTree and TVirtualStringTree
> // that provides a CanDrop boolean var parameter allowing header
> dropping to be blocked

ok.

> // - added Header.FixedColumn: integer to TVTHeader that prevents
> dragging of columns with index < FixedColumn and
> // also prevents other columns being dragged before any column
> with index < FixedColumn

Have you also thought about how to visually represent a fixed column? I do not
see any advantage
over the existing solution (particularly with OnHeaderDragOver) without also
painting the tree
somehow different.

> // - added handling of coMovable column option

ok.

> // - fix to force redrawing of header at design time if Images
> changes (see TBaseVirtualTree.SetImages)

Not needed anymore, the header has now an own image list.

> // - fix for bug that prevents DefaultText being cleared in object
> inspector (see TCustomVirtualstringTree.DefineProperties)

What bug?

> // - added Alignment property to column that sets the column header
> alignment
> // string tree also uses this to align text but does not work
> when static text is drawn and Alignment <> taLeftJustify

Basically a good idea, but it should of course entirely work. I was thinking
about this alignment
feature too but did not implement it because of the required work. It is not
only to paint the text
according to the alignment (this is the simpler task) but you have to make sure
that hit tests take
alignment into account. And special methods like HandleDrawSelection use their
own hit testing. This
can become quite complicated and should also not too much influence the speed
of the tree.

> // - fix to ensure that ParentColor=true is streamed to dfm (see
> TVirtual...Tree.ParentColor property declarations)

ok.

Ciao, Mike

 | Replies | Author | Date
194 | Re: Version 2 Submissions Deadline | [jascha@c...] | Mon 1/15/2001


re: Re: Version 2 Submissions Deadline

From: "Mike Lischke" [public@l...]
Date: Sun Jan 14, 2001 11:06 am
Subject: RE: [VirtualTreeview] Re: Version 2 Submissions Deadline

Hi Cyril,

> * Make the EditTimer delay a propertie of the tree (instead of the hard
> coded 1000 ms)

good idea (and easy to implement :-)), done.

> * Provide a way (I've done it with an event) to create a custom
> DragDropManager to allow custom format and management of OLE drag and drop.

Aaah, very nice. I thought nobody would ever create another drop manager. Are
there any new formats
of general interest. Could you create a demo for this? I assume you have
included the callback in
CreateWnd. Have you found any special issues to consider?

> * Ask the application (with an event for example) for Column headers
> informations (like you already do so nicely for nodes).

Mmh, do you really think this useful. The information in the header is static
and stored in real
properties. What would you win implementing callbacks?

> PS : I've used Sleuth CodeWatch on an application I've made with
> VirtualTreeView, and it show me several leaks and errors :
>
> * Palette leak (which number depend on the usage). The original
> allocation is at line 6536 of VirtualTreeView 1.31 (in function makepalette
> of TBaseVirtualTree.PrepareBitmaps).

This is not really a leak. The palette is automatically freed in Graphics.pas
when the bitmaps are
destroyed, but it seems CodeWatch does not know this fact.

> * Global Memory Handle leak : only one leak, original allocation at line
> 3469 (TVTDragDropManager.RenderData)

Sleuth CodeWatch seems not to be the best informed leak checker around.
According to MSDN
ReleaseStgMedium will take care about the allocated memory if punkForRelease is
nil:

-----
pUnkForRelease
Pointer to an interface instance that allows the sending process to control the
way the storage is
released when the receiving process calls the ReleaseStgMedium function. If
pUnkForRelease is NULL,
ReleaseStgMedium uses default procedures to release the storage; otherwise,
ReleaseStgMedium uses
the specified IUnknown interface.
----- end of quote

Until now I have not heard anything which gives different information.

Anyway, I appreciate very mcuh that VT is continously checked for memory leaks
etc. This ensures a
high quality control.

Ciao, Mike


re: Re: Version 2 Submissions Deadline

From: "Cyril VELTER" [cyril.velter@l...]
Date: Sun Jan 14, 2001 1:39 pm
Subject: Re: [VirtualTreeview] Re: Version 2 Submissions Deadline

Hello,

> > * Provide a way (I've done it with an event) to create a custom
> > DragDropManager to allow custom format and management of OLE drag and
drop.
>
> Aaah, very nice. I thought nobody would ever create another drop manager.
Are there any new formats
> of general interest. Could you create a demo for this? I assume you have
included the callback in
> CreateWnd. Have you found any special issues to consider?

There are two things that I want to do :
* Be able to create a custom Text representation of a node (or a
selection of nodes) which not only rely on the text presented in the tree,
but also on my application internal representation of the object behind the
node(s).
* Be able de drag/drop between process a custom format. CF_VTREFERENCE
do that but I've a problem with WriteNode trying to populate childrens of
selected nodes.

So the custom dragdropmanager is a solution to solve these. But, chosing
to write a custom manager, require to drop the format management done by the
tree.

Another approach would be to make the current drag drop manager query
the application for the text representation of the node selection. and to
make WriteNode virtual so it can be overriden.

For now I've modified CreateWnd as follow :

// OLE drag'n drop preparation (this is also used for clipboard
operations, so create it always)
if Assigned(FOnCreateDragDropManager) then
FOnCreateDragDropManager(self,FDragManager);
// If the callback failed to create a manager, create a default one
if (FDragManager=nil) then
begin
FDragManager := TVTDragDropManager.Create(Self);
FDragManager.SetOLEFormats(FOLEFormats);
end;

>
>
> > * Ask the application (with an event for example) for Column headers
> > informations (like you already do so nicely for nodes).
>
> Mmh, do you really think this useful. The information in the header is
static and stored in real
> properties. What would you win implementing callbacks?
>

It's usefull for me because the information in headers are not always
statics. I've a tree which shows informations in a fairly generic way and
depending on the datas, the header titles should change.

thanks,

cyril

 | Replies | Author | Date
197 | Re: Version 2 Submissions Deadline | Mike Lischke | Mon 1/15/2001


Version 2.0 prerelease

From: "Mike Lischke" [public@l...]
Date: Sun Jan 14, 2001 6:07 pm
Subject: Version 2.0 prerelease

Hi all,

I have just uploaded Virtual Treeview 2.0 to the file area of eGroups (see
http://www.egroups.com/files/VirtualTreeview/). There you can download a copy
of the demo sources
too as well as three compiled demos.

Please, I would really appreciate if you could have a look at the demos
(particularly the OLE demo
which should demonstrate fairly how drag'n drop handling is done). If you have
suggestions or
anything else then don't hesitate and post them to this list so I can improve
the release before
posting it to the major Delphi sites.

Ciao, Mike

Dipl. Ing. Mike Lischke
Senior software developer
--
Homepage: http://www.lischke-online.de
GraphicEx: http://www.lischke-online.de/Graphics.html
Virtual Treeview: http://www.lischke-online.de/VirtualTreeview.html
Unicode Edit and library: http://www.lischke-online.de/Unicode.html

 | Replies | Author | Date
208 | Re: Version 2.0 prerelease | Werner Lehmann | Wed 1/17/2001
267 | Re: Version 2.0 prerelease | Mike Lischke | Wed 1/24/2001
283 | Re: Version 2.0 prerelease | Werner Lehmann | Wed 1/24/2001


re: Sorting TreeView

From: "Geoffrey Pan" [gpan@c...]
Date: Sun Jan 14, 2001 9:48 pm
Subject: RE: [VirtualTreeview] Sorting TreeView

Auto Sort option under what name?. Can't seem to find it.

Thanks in advance.

Geoffrey Pan

-----Original Message-----
From: Mike Lischke [mailto:[public@l...]]
Sent: Saturday, January 13, 2001 8:02 AM
To: VirtualTreeview@egroups.com
Subject: RE: [VirtualTreeview] Sorting TreeView

Hi Peter,

> Now that I think about it more it is better not to have it quite so built
> in. When I add a node, I don't want the whole tree sorting, just the
> siblings for this node's level.

I have implemented it this way.

> However it might be useful to have a function to call to Sort the whole
tree
> - it's the kind of thing that people might want and rather than everyone
> inventing it.

Also this one is now implemented and to get rid of the problem "compare
function of object or not" I
have changed this to an event (OnCompareNodes). This way is necessary too to
do auto sort (which is
now an option in the tree).

Ciao, Mike

To unsubscribe from this group, send an email to:
VirtualTreeview-unsubscribe@egroups.com

 | Replies | Author | Date
190 | Sorting TreeView | Geoffrey Pan | Sun 1/14/2001


Sorting TreeView

From: "Geoffrey Pan" [gpan@c...]
Date: Sun Jan 14, 2001 10:04 pm
Subject: Sorting TreeView

Mike,

voAutoSort does not get tested (and OnCompareNode not fired ) for when new
nodes are added with the RootNodeCount being reset, is this a bug?

Thanks in advance,

Geoffrey Pan
[gpan@c...]


re: Sorting TreeView

From: Mike Lischke [public@l...]
Date: Mon Jan 15, 2001 8:36 am
Subject: RE: [VirtualTreeview] Sorting TreeView

Hi Geoffrey,

> voAutoSort does not get tested (and OnCompareNode not fired )
> for when new
> nodes are added with the RootNodeCount being reset, is this a bug?

No, this is intended. Only the compatibility methods do the auto sort
currently (AddChild, InsertNode) and of course the set methods for
SortColumn and SortDirection. I still hesitate to ballast the fast native
methods/properties like RootNodeCount, ChildCount etc. with that lazyness
feature. I know it is switchable by voAutoSort, but I feel uncomfortable...
It seems I have to get used to it first.

Ciao, Mike


Install VTW on Delphi 3

From: [murasr1.eti@m...]
Date: Mon Jan 15, 2001 9:56 am
Subject: Install VTW on Delphi 3

I was trying install VirtualTreeView on D3 but I wasn't successfull.

1.In Uses part of unit VirtualTrees.pas is unit ImgList which is not
containing in D3 sources.

2. When I used ImgList from D5 by compilation apears many errors.

What I must to do / to prepare for this?

Thanks for Help.

 | Replies | Author | Date
193 | Re: Install VTW on Delphi 3 | Mike Lischke | Mon 1/15/2001


re: Install VTW on Delphi 3

From: Mike Lischke [public@l...]
Date: Mon Jan 15, 2001 10:07 am
Subject: RE: [VirtualTreeview] Install VTW on Delphi 3

Hi,

> I was trying install VirtualTreeView on D3 but I wasn't successfull.

No wonder, VT uses a lot of specific things only available in Delphi 4 and
higher. VT is specified for Delphi 4 and higher (and will also be ported to
Kylix).

> 1.In Uses part of unit VirtualTrees.pas is unit ImgList which is not
> containing in D3 sources.

If this would be the only thing then you would quickly be ready. Just leave
out ImgLst from the uses clause. In D3 the image list stuff was located in
ComCtrls.pas.

Unfortunately you will have a really hard time to port VT over (actually
down) to D3 because you have to replace all dynamic arrays to plain memory
and take care about allocation and deallocation manually. I don't remember
what VCL specific things are new in D4+ (just like TScreen.Hint font was new
in D5), but I expect quite a lot which you all have to emulate somewhow.
Such a port will be really difficult.

Ciao, Mike


re: Version 2 Submissions Deadline

From: [jascha@c...]
Date: Mon Jan 15, 2001 11:46 am
Subject: Re: Version 2 Submissions Deadline

> > // - added Header.FixedColumn: integer to TVTHeader that
prevents
> > dragging of columns with index < FixedColumn and
> > // also prevents other columns being dragged before any column
> > with index < FixedColumn
>
> Have you also thought about how to visually represent a fixed
column? I do not see any advantage
> over the existing solution (particularly with OnHeaderDragOver)
without also painting the tree
> somehow different.

What is the existing solution? The drawback with OnHeaderDragOver is
that it does not prevent the dragging of the column in the first
place. Also the FixedColumns property is far simpler than simulating
the feature with events. I take your point about a visual indication
of fixed columns - I haven't implemented this - although through the
multitude of presentation options and events it would not be hard for
a virtual treeview user to implement a visual indication if they wish.

> > // - fix to force redrawing of header at design time if Images
> > changes (see TBaseVirtualTree.SetImages)
>
> Not needed anymore, the header has now an own image list.

Fine, I think that is a good addition. The fix involved invalidating
the header in TBaseVirtualTree.SetImages so it gets redrawn on
assignment of a new images list thus:

if not (csLoading in ComponentState) then
begin // DJG
Invalidate;
FHeader.Invalidate(nil); // DJG fix to force redrawing of header
at design time
end; // DJG

> > // - fix for bug that prevents DefaultText being cleared in
object
> > inspector (see TCustomVirtualstringTree.DefineProperties)
>
> What bug?

In TCustomVirtualstringTree.DefineProperties, you set the HasData
parameter to FDefaultText <> '' which prevents an empty DefaultText
from being streamed. This means that one cannot clear DefaultText at
design time because on loading of the form at runtime the DefaultText
is initialised to 'Node' (in Create) and since the blank value
entered at design time was not streamed it remains as 'Node'. The fix
is to set HasData to true so that all values get streamed.

> > // - added Alignment property to column that sets the column
header
> > alignment
> > // string tree also uses this to align text but does not work
> > when static text is drawn and Alignment <> taLeftJustify
>
> Basically a good idea, but it should of course entirely work. I was
thinking about this alignment
> feature too but did not implement it because of the required work.
It is not only to paint the text
> according to the alignment (this is the simpler task) but you have
to make sure that hit tests take
> alignment into account. And special methods like
HandleDrawSelection use their own hit testing. This
> can become quite complicated and should also not too much influence
the speed of the tree.

I agree that this is not finished yet - I have got it working to the
point required for my app (which uses row selection and therefore
does not care about hit tests). I will try to do this when I get the
chance.

As an aside, does anyone actually use the static text? I cannot see
that it serves much purpose - everything can be done via the normal
text property with custom painting if really necessary. It
significantly complicates the alignment implementation and slows down
tree painting. I didn't implement alignment in the string tree as it
would introduce a subtle change in ordering of the calls to DoGetText
if alignment is right justify (static would have to be retrieved
first) and Centering of text becomes very difficult as one has to get
the text bounds of both normal and static to know where to place them
*before* actually drawing them - i.e. two extra calls to DoGetText
are then required.

Any comments?

I will send the unit as is to you directly so you can take the bits
you see fit.

Regards,

Jascha


re: Version 2 Submissions Deadline

From: [jascha@c...]
Date: Mon Jan 15, 2001 11:54 am
Subject: Re: Version 2 Submissions Deadline

> >I've got a proposal for a way to create a FAQ for Virtual
> >Treeview and want to know if there are any volunteers on
> >this mailing list who would like to
> I was thinking about that, but was stopped by the fact that you gave
> out the component to the jedi group...
> Right now, I don't have that much time and my english is not that
> perfect...
> But if nobody volonteers I can start working on it...as time
permits.
> What is the way you thought of ?
> Also, it would be great to have a section where people could
> contribute with samples...

I can edit the English if you would like.

Jascha


re: tree alignment (was: Version 2 Submissions Deadline)

From: "Mike Lischke" [public@l...]
Date: Mon Jan 15, 2001 10:09 pm
Subject: RE: [VirtualTreeview] tree alignment (was: Version 2 Submissions Deadline)

> What is the existing solution? The drawback with OnHeaderDragOver is
> that it does not prevent the dragging of the column in the first
> place.

Currently you can switch off that a column (in the header) is clickable which
will effectively
switch off that it can be dragged around. You can currently also switch off to
show the drop mark
(the little circle with the triangle in it). In OnHeaderDragOver you could then
(as in any drag over
event handler) deny dropping a column which would then prevent the final drop.

> Also the FixedColumns property is far simpler than simulating
> the feature with events. I take your point about a visual indication
> of fixed columns - I haven't implemented this - although through the
> multitude of presentation options and events it would not be hard for
> a virtual treeview user to implement a visual indication if they wish.

True, but you want a convinient way for fixed columns and take extra effort to
accomplish that, but
you leave the user of the tree alone after half the way. My problem is not so
much to implement a
visual representation but to have an idea how this should look like (clBtnFace
as background, never
clickable and selectable?). What is a fixed column actually? Perhaps this
should be defined
primarily, since disallowed dragging cannot be the criterion, because I can
imagine that somebody
wants to reorder fixed columns and I don't see why this should be prohibited.

> In TCustomVirtualstringTree.DefineProperties, you set the HasData
> parameter to FDefaultText <> '' which prevents an empty DefaultText
> from being streamed. This means that one cannot clear DefaultText at
> design time because on loading of the form at runtime the DefaultText
> is initialised to 'Node' (in Create) and since the blank value
> entered at design time was not streamed it remains as 'Node'. The fix
> is to set HasData to true so that all values get streamed.

Ok. Thanks for clarifying this.

> As an aside, does anyone actually use the static text? I cannot see
> that it serves much purpose - everything can be done via the normal
> text property with custom painting if really necessary.

No, you have not yet realized the major difference between static and normal
text :-) The latter can
be edited, selected etc. Static text is like a label which cannot be modified.
For instance I use
normal and static text in one product of my company to show the name of a
chapter (whose caption can
be changed) and the words in it (which cannot be changed for obvious reasons).
Another application
is an image database browser I wrote, where the normal text represents the
image category and the
static text the number of images (I have also columns with other info like file
size, image size
etc.).

Generally speaking, static text is particularly useful for captions which are
only partially
editable (like special keys) or contain special information which does not fit
into an own column.

> It significantly complicates the alignment implementation and slows down
> tree painting. I didn't implement alignment in the string tree as it
> would introduce a subtle change in ordering of the calls to DoGetText
> if alignment is right justify (static would have to be retrieved
> first) and Centering of text becomes very difficult as one has to get
> the text bounds of both normal and static to know where to place them
> *before* actually drawing them - i.e. two extra calls to DoGetText
> are then required.

I could agree with an limitation of tree features. Say, static text is only
"recommended" if
alignment of the column is left oriented. Actually, for every other aligment I
would just ignore
static text settings (TVirtualStringTree.PaintNode). Btw, I'm also interested
in different
alignments because of the Unicode features of the string tree. For instance
hebrew and arabic text
is written right-to-left (which is automatically handled by ExtTextOutW) and
right aligned (which is
not yet implemented). Also, the tree lines must be painted on the right hand
side. I've seen a
screen shot of this and must say it looks very funny to European eyes.

> I will send the unit as is to you directly so you can take the bits
> you see fit.

I got it and found it quite so as I have expect it. The movable option for a
column was simply
forgotten by me. The text output in TCustomVirtualStringTree.DoPaintNode is
almost finished when
static text is disabled. Some small issues need to be considered, e.g. the Bidi
mode (bidirectional
mode) must be taken into account finally. Should it override the alignment
settings or vice versa?
Are there any arabic or hebrew speaking people on this list?

Ciao, Mike


re: Re: Version 2 Submissions Deadline

From: "Mike Lischke" [public@l...]
Date: Mon Jan 15, 2001 10:09 pm
Subject: RE: [VirtualTreeview] Re: Version 2 Submissions Deadline

> It's usefull for me because the information in headers are not always
> statics. I've a tree which shows informations in a fairly generic way and
> depending on the datas, the header titles should change.

And what about custom draw for the header? Wouldn't this be enough?

Ciao, Mike


Need for speed ( ~ = > 10%)

From: "adem baba" [adembaba@e...]
Date: Tue Jan 16, 2001 2:35 am
Subject: Need for speed ( ~ = > 10%)

Hi guys,

OK, VT is faster than a lot of your wildest dreams already,
but if you really want it go faster (i.e around 10%) you
must give QMemory (v1.02) a try.

They fly...

QMemory is written by Andrew Driazgov.

(
it is available from DSP and Tory's;
named sth like ADQMemory.zip
)

 | Replies | Author | Date
199 | Re: Need for speed ( ~ = > 10%) | Geoffrey Pan | Tue 1/16/2001
200 | Re: Need for speed ( ~ = > 10%) | Mike Lischke | Tue 1/16/2001


re: Need for speed ( ~ = > 10%)

From: "Geoffrey Pan" [gpan@c...]
Date: Tue Jan 16, 2001 2:59 am
Subject: RE: [VirtualTreeview] Need for speed ( ~ = > 10%)

1) Not sure advertising allowed on list :P

2) Kylix compatibility (which Mike has mentioned intent on porting)

Just my two cents worth :)

-----Original Message-----
From: adem baba [mailto:[adembaba@e...]]
Sent: Monday, January 15, 2001 8:35 PM
To: VirtualTreeview@egroups.com
Subject: [VirtualTreeview] Need for speed ( ~ = > 10%)

Hi guys,

OK, VT is faster than a lot of your wildest dreams already,
but if you really want it go faster (i.e around 10%) you
must give QMemory (v1.02) a try.

They fly...

QMemory is written by Andrew Driazgov.

(
it is available from DSP and Tory's;
named sth like ADQMemory.zip
)

To unsubscribe from this group, send an email to:
VirtualTreeview-unsubscribe@egroups.com


re: Need for speed ( ~ = > 10%)

From: Mike Lischke [public@l...]
Date: Tue Jan 16, 2001 9:09 am
Subject: RE: [VirtualTreeview] Need for speed ( ~ = > 10%)

> 1) Not sure advertising allowed on list :P

Good point Geoffrey.

adem, I think Andrew will announce his manager in the news groups so people
will be notified. The memory manager has nothing to do with VT so please
keep this list clean. Thank you.

Ciao, Mike

> Hi guys,
>
> OK, VT is faster than a lot of your wildest dreams already,
> but if you really want it go faster (i.e around 10%) you
> must give QMemory (v1.02) a try.


re: Re: Version 2 Submissions Deadline

From: Bender Heri [HBender@E...]
Date: Tue Jan 16, 2001 10:52 am
Subject: RE: [VirtualTreeview] Re: Version 2 Submissions Deadline

> For now I've modified CreateWnd as follow :
>
> // OLE drag'n drop preparation (this is also used for clipboard
> operations, so create it always)
> if Assigned(FOnCreateDragDropManager) then
> FOnCreateDragDropManager(self,FDragManager);
> // If the callback failed to create a manager, create a default one
> if (FDragManager=nil) then
> begin
> FDragManager := TVTDragDropManager.Create(Self);
> FDragManager.SetOLEFormats(FOLEFormats);
> end;
>
>

I often use components by subclassing them instead of installing it to the
IDE. So please follow the standard to provide for each Delphi event a own
virtual procedure (in this case a DoCreateDragDropManager) which can be
overridden in descendents.

Heri Bender


Re-painting a node

From: "Fraser, Peter [Soundcraft UK]" [pete.fraser@f...]
Date: Tue Jan 16, 2001 2:08 pm
Subject: Re-painting a node

Hi there.
Does anyone know how to force VirtualTree node to be re-painted.
I've changed some information in my database and I want the image states to
change.
I've tried calling Invalidate() but this doesn't work - it doesn't force a
call to paint().
What's the corect solution please?

Thanks, Pete

 | Replies | Author | Date
203 | Re: Re-painting a node | Mike Lischke | Tue 1/16/2001
204 | Re: Re-painting a node | Werner Lehmann | Tue 1/16/2001
205 | Re: Re-painting a node | [pete.fraser@f...] | Tue 1/16/2001
206 | Re: Re-painting a node | Pete Fraser | Tue 1/16/2001
207 | Re: Re-painting a node | Mike Lischke | Tue 1/16/2001
209 | Re: Re-painting a node | Pete Fraser | Wed 1/17/2001
210 | Re: Re-painting a node | Pete Fraser | Wed 1/17/2001


re: Re-painting a node

From: Mike Lischke [public@l...]
Date: Tue Jan 16, 2001 2:27 pm
Subject: RE: [VirtualTreeview] Re-painting a node

> Does anyone know how to force VirtualTree node to be re-painted.
> I've changed some information in my database and I want the
> image states to
> change.
> I've tried calling Invalidate() but this doesn't work - it
> doesn't force a
> call to paint().
> What's the corect solution please?

RepaintNode(..); is the solution, Peter.

Ciao, Mike


re: Re-painting a node

From: Werner Lehmann [wl@b...]
Date: Tue Jan 16, 2001 2:29 pm
Subject: Re: [VirtualTreeview] Re-painting a node

Fraser, Peter [Soundcraft UK] wrote:

> Hi there.
> Does anyone know how to force VirtualTree node to be re-painted.
> I've changed some information in my database and I want the image states to
> change.

Look at InvalidateNode(Node: PVirtualNode) method.

WL

 | Replies | Author | Date
205 | Re: Re-painting a node | [pete.fraser@f...] | Tue 1/16/2001
206 | Re: Re-painting a node | Pete Fraser | Tue 1/16/2001
207 | Re: Re-painting a node | Mike Lischke | Tue 1/16/2001
209 | Re: Re-painting a node | Pete Fraser | Wed 1/17/2001
210 | Re: Re-painting a node | Pete Fraser | Wed 1/17/2001


re: Re-painting a node

From: [pete.fraser@f...]
Date: Tue Jan 16, 2001 3:37 pm
Subject: Re: Re-painting a node

--- In [VirtualTreeview@egroups.com, Werner Lehmann <wl@b...] wrote:
> Fraser, Peter [Soundcraft UK] wrote:
>
> > Hi there.
> > Does anyone know how to force VirtualTree node to be re-painted.
> > I've changed some information in my database and I want the image
states to
> > change.
>
> Look at InvalidateNode(Node: PVirtualNode) method.

Unfortunately InvalidateNode() and RepaintNode don't call to get the
new indexes. Any more ideas or is this a bug?

Rgds Pete

 | Replies | Author | Date
206 | Re: Re-painting a node | Pete Fraser | Tue 1/16/2001
207 | Re: Re-painting a node | Mike Lischke | Tue 1/16/2001
209 | Re: Re-painting a node | Pete Fraser | Wed 1/17/2001
210 | Re: Re-painting a node | Pete Fraser | Wed 1/17/2001


re: Re-painting a node

From: "Pete Fraser" [pete.fraser@f...]
Date: Tue Jan 16, 2001 6:03 pm
Subject: Re: Re-painting a node

More information follows:

RepaintNode() calls GetDisplayRect(Node, -1) which doesn't call the
OnGetImageXXXX events.
However replacing with GetDisplayRect(Node, -1, True) does call the
image events.

However, even after changing this, the node is not repainted with the
new images until changing selected nodes.

Any other ideas?

Rgds Pete


re: Re: Re-painting a node

From: "Mike Lischke" [public@l...]
Date: Tue Jan 16, 2001 9:18 pm
Subject: RE: [VirtualTreeview] Re: Re-painting a node

> Unfortunately InvalidateNode() and RepaintNode don't call to get the
> new indexes. Any more ideas or is this a bug?

I don't understand this. I have changed the code in the Advanced demo to:

procedure TMainForm.AnimationTimerTimer(Sender: TObject);

// used to keep the animations going

var
I: Integer;

begin
for I := 0 to 3 do
with Animation[I] do
Current := (Current + 1) mod Count;
//VST4.Invalidate;
with VST4 do
if Assigned(GetFirstNode.FirstChild) then
InvalidateNode(GetFirstNode.FirstChild);
end;

and it works perfectly.

Ciao, Mike

> Rgds Pete
Btw. What's your correct name: Pete or Peter?

 | Replies | Author | Date
209 | Re: Re-painting a node | Pete Fraser | Wed 1/17/2001
210 | Re: Re-painting a node | Pete Fraser | Wed 1/17/2001


re: Version 2.0 prerelease

From: Werner Lehmann [wl@b...]
Date: Tue Jan 16, 2001 11:59 pm
Subject: Re: [VirtualTreeview] Version 2.0 prerelease

Mike Lischke wrote:
>
> I have just uploaded Virtual Treeview 2.0 to the file area of eGroups (see

Mike,

here some remarks I wrote down while reviewing the 2.0 release:

* All color properties have been grouped into a Colors property. Very good,
cleans up the already large property list and makes properties easy to find.
Existing code needs only minor modifications.
Error(?): the DropTargetColor does not get streamed to the DFM. It reverts to
clHighlight after the project is loaded. The same is true for DropMarkColor,
probably for everything in .Colors.*

* The DropMark wasn't shown and I was almost at adding it the bug list when I
found the new voShowDropmark property :) (maybe its default should be true,
not
false, to be consistent with previous behaviour?).

* DefaultText property still does not stream empty value to DFM

* What is the idea behind setting ParentColor to false (just out of curiosity):
- new default value for ParentColor

* I just missed another option: hoShowSortGlyphs (the damned sorting glyphs in
the header just refused to show :). Looks very good now. Thanks for
implementing
that :)
I see two problems with it right now (minor stuff from my point of view
but...):
(1) Try and set a header imagelist, set an imageindex of the sorted column and
make the Layout blGlyphRight. Effect: The header caption is now only '...'
and both images (sort/imagelist bitmap) overlap very ugly. The desired
behaviour (IMO!) should place the sort glyph right beside the image. If it
would be the other way round and sorting column changes on runtime the
image-
list bitmap would 'warp' to the left / the caption to the right.
(2) The default value for Header.SortColumn is -1. To indicate that no column
is
being sorted. Very well but why did you include an extra option for that
purpose then? (this is the trap I fell in and mentioned above :)

PS: I just notice another odd behaviour: I removed the header imagelist. The
sorted column caption is now completely gone and only the glyph is left (still
blGlyphRight). If I make a different column 'sorted' and blGlyphRight, the
caption
is abbreviated with three dots and only the first letter shows. Although
there is
plenty of space.

My two cents: if you ever should implement a
per-column-alignment/justification
feature: make it independent of the glyph layout (Column[n].Layout). The
caption
would then be aligned as the nodes in that column and the glyph layout would
just
determine if the glyph would be left/right/whatever relative to the header
caption.

I would like to see this alignment as well. Right now it does not seem to be
possible
to show 'comma-aligned' (or even only right-aligned) numbers in a column
without
ownerdrawing.

For clarification: what does voAutoSort? Does this work together with
AddChild?

BTW (this is not about v2.0 in particular), the DragImageKind.... it looks
already nice but there is one problem: it consists only of the visible selected
nodes. Not so nice if the last node is only partially visible (cut off by bottom
border of control) because this will be the case in the drag image as well.
Could this be left out from the image unless this node was the only one to
be dragged? Furthermore, at least on Win2K the shell (explorer) shows a cute
blended-out drag image. This effect is hard to describe, the translucency of
the dragimage grows towards its borders while the image is 100% opaque at the
selection/drag anchor node. You probably noticed that already. Do you see any
chance to get that for cheap?

> Please, I would really appreciate if you could have a look at the demos
(particularly the OLE demo
> which should demonstrate fairly how drag'n drop handling is done). If you
have suggestions or
> anything else then don't hesitate and post them to this list so I can improve
the release before
> posting it to the major Delphi sites.

I did not find problems with it unless it is intended that the trees should be
able to accept (and include in the tree) files being dragged from explorer.

Regards,
WL


re: Re-painting a node

From: "Pete Fraser" [pete.fraser@f...]
Date: Wed Jan 17, 2001 9:00 am
Subject: Re: Re-painting a node

> Btw. What's your correct name: Pete or Peter?
If you look on my birth certificate it's Peter.
However, most people call me Pete.

Rgds Pete

 | Replies | Author | Date
210 | Re: Re-painting a node | Pete Fraser | Wed 1/17/2001


re: Re-painting a node

From: "Pete Fraser" [pete.fraser@f...]
Date: Wed Jan 17, 2001 9:13 am
Subject: Re: Re-painting a node

--- In [VirtualTreeview@egroups.com, "Pete Fraser" <pete.fraser@f...]
Mike,
It gets painted corectly with Invalidate() ONLY InvalidateNode does
NOT work. I'd tried so many ideas that I'd forgotten about something
I'd missed out in the port which was why Invalidate didn't work, the
first time I tried it.

Thanks for the pointer to the advanced Demo.

Rgds Pete


Making a node visible

From: "Pete Fraser" [pete.fraser@f...]
Date: Wed Jan 17, 2001 5:57 pm
Subject: Making a node visible

If I expand all nodes in the tree, the previously focussed node can
be off-screen.
I therefore have 2 questions:

a) (Mike) Could this be changed so that it is on screen if it was
previously.

b) Is there a function to bring it back on screen again i.e. visible.

(Mike) A secondary request is that if a focused node is deleted,
after the deletion no nodes are selected. It would be nice if the
next sibling was selected or previous sibling if no next.

Rgds Pete

 | Replies | Author | Date
212 | Re: Making a node visible | Mike Lischke | Wed 1/17/2001
215 | Re: Making a node visible | Pete Fraser | Thu 1/18/2001


re: Making a node visible

From: "Mike Lischke" [public@l...]
Date: Wed Jan 17, 2001 6:21 pm
Subject: RE: [VirtualTreeview] Making a node visible

Hi Pete,

> a) (Mike) Could this be changed so that it is on screen if it was
> previously.

I do not generally expect that the focused node is still in view when doing a
full expand.

> b) Is there a function to bring it back on screen again i.e. visible.

Yes, there is. Its name is Tree.ScrollIntoView.

> (Mike) A secondary request is that if a focused node is deleted,
> after the deletion no nodes are selected. It would be nice if the
> next sibling was selected or previous sibling if no next.

I have taken this into the todo list, but am not sure how to give the focus. In
Explorer it is the
parent node of the deleted node. But what about multiselection? In TTreeView
the focused is also the
(only) selected node. In multiselection scenarios however it could be that an
unselected node is
focused. Is this a good action?

Ciao, Mike

 | Replies | Author | Date
215 | Re: Making a node visible | Pete Fraser | Thu 1/18/2001


Re-loading a saved tree

From: "Mauricio Longo" [mlongo@c...]
Date: Wed Jan 17, 2001 10:09 pm
Subject: Re-loading a saved tree

Hi,

I'm new VirtualTreeview and I ran into a strange problem in my first
application. I think I may be missing something obvious, but can't
seem to figure out what.

I altered the "minimal" example to save the tree through a call to
SaveToFile and then reload the original contents after clearing the
tree through a call to LoadFromFile.

After reloading the tree structure seems correct. However, not a
single node displays it's text.

If any one can give a hint...

Thanks!

Mauricio Longo

 | Replies | Author | Date
220 | Re: Re-loading a saved tree | Mike Lischke | Thu 1/18/2001


Digests - Back Issues

From: "Philippe Chessa" [pchessa@p...]
Date: Thu Jan 18, 2001 8:30 am
Subject: Digests - Back Issues

Hi all,

I receive a message digest every day since I have subscribed this
group.
I was wondering how to get the digests prior my subscription?

Thanks in advance

Philippe

 | Replies | Author | Date
217 | Re: Digests - Back Issues | Mike Lischke | Thu 1/18/2001


re: Making a node visible

From: "Pete Fraser" [pete.fraser@f...]
Date: Thu Jan 18, 2001 9:03 am
Subject: Re: Making a node visible

> > b) Is there a function to bring it back on screen again i.e.
visible.
>
> Yes, there is. Its name is Tree.ScrollIntoView.

Great, finding some things one wants to do in the help file is
like ..... needles and haystacks....

> > (Mike) A secondary request is that if a focused node is deleted,
> > after the deletion no nodes are selected. It would be nice if the
> > next sibling was selected or previous sibling if no next.
>
> I have taken this into the todo list, but am not sure how to give
the focus. In Explorer it is the
> parent node of the deleted node. But what about multiselection? In
TTreeView the focused is also the
> (only) selected node. In multiselection scenarios however it could
be that an unselected node is
> focused. Is this a good action?

Tricky one,
In single selection mode:
If parent of deleted node - make it focussed
If no parent, focus next(previous if no next) sibling of deleted node.

If in multi-select I think it's the same as you are only changing the
focused node NOT the selection.

Thanks,
Pete


Sorting by column

From: [rieni@m...]
Date: Thu Jan 18, 2001 10:23 am
Subject: Sorting by column

I've seen a few notes / examples about how to sort the Tree but it's
still not so very clear for me. I need a very simple example like
this:

I have 3 columns.
In the first column: names of schools.
As childs for the school:
pupilnames in column 0
adress in column 1
telefon in column 2

When I click on a column-title I want to sort the Tree.
How can I do this?

Rieni
Norway

 | Replies | Author | Date
218 | Re: Sorting by column | Mike Lischke | Thu 1/18/2001
245 | Re: Sorting by column | [rieni@m...] | Mon 1/22/2001
247 | Sorting by column | [rieni@m...] | Mon 1/22/2001
248 | Re: Sorting by column | Pete Fraser | Mon 1/22/2001
274 | Re: Sorting by column | Mike Lischke | Wed 1/24/2001


re: Digests - Back Issues

From: Mike Lischke [public@l...]
Date: Thu Jan 18, 2001 1:11 pm
Subject: RE: [VirtualTreeview] Digests - Back Issues

Hi Phillipe,

> I receive a message digest every day since I have subscribed this
> group.
> I was wondering how to get the digests prior my subscription?

You can view all messages by selecting the mailing list home page (here
www.egroups.com/group/VirtualTreeview) and you will see a map titled
"Message archive by month". Click on any of the numbers to get to the
message list. Another option is to click the "Messages" link on the left
hand side of the page.

Ciao, Mike


re: Sorting by column

From: Mike Lischke [public@l...]
Date: Thu Jan 18, 2001 3:00 pm
Subject: RE: [VirtualTreeview] Sorting by column

> I've seen a few notes / examples about how to sort the Tree but it's
> still not so very clear for me. I need a very simple example like
> this:
>
> I have 3 columns.
> In the first column: names of schools.
> As childs for the school:
> pupilnames in column 0
> adress in column 1
> telefon in column 2
>
> When I click on a column-title I want to sort the Tree.
> How can I do this?

Firstly, you should use version 2.0 of Virtual Treeview for this task
because some special support for sorting has been built in there. Secondly,
you have two options in this new version (which you can download at the time
being from the eGroups file area of this mailing list
(www.egroups.com/files/VirtualTreeview). One option for sorting is to
include voAutoSort in Tree.Options and set the sort direction and sort
column (in this order) in the tree's header class. The other option is to
set direction and sort column (without auto sort option set) and call
Tree.Sort afterwards with the just set direct and sort column.

Ciao, Mike

 | Replies | Author | Date
245 | Re: Sorting by column | [rieni@m...] | Mon 1/22/2001


feature freeze

From: Mike Lischke [public@l...]
Date: Thu Jan 18, 2001 3:00 pm
Subject: feature freeze

Hi all,

Unfortunately I have bad news. I'm just updating a product of my company
with version 2.0 of VT and found a problem. For persistent user settings the
app. stores the tree's header properties into a stream, directly followed by
the tree data itself. With the recent enhancements however (MainColumn,
SortColumn and SortDirection) it would be necessary to save and restore
additional properties to be consistent. Whoever gets an update of the
product will then not be able to load their previous settings due to the
changed stream format. The product I'm talking about has been sold > 100.000
times all over Europe and I'm now in serious trouble without an acceptable
solution yet :-(

The consequences for Virtual Treeview are clear however: I will no longer
add properties to the base and string trees unless there is a very, very
good reason to do so ("would be cool" does not qualify). Hence if you want
special features in the future then please derive your own tree class and
add the stuff you think which is necessary.

From this day on VT's feature list is frozen!

Concerned from this decision are all features which have property
representation in the tree (new options, new properties, some deleted or
renamed, changed behaviour etc.). Of course the hunt for bugs and leaks will
continue unbroken. Also internal improvements can and will be done in the
future, but, for instance, I will not implement fixed columns.

I think this decision is also good for all those developers which have used
VT already in products which depend on consistent and reliable behaviour.
Since VT has been downloaded more than 10.000 times in the past 8 weeks it
is very likely that there are many such products already or nearly out.

Mike Lischke
R&D Senior software engineer

 | Replies | Author | Date
221 | Re: feature freeze | Bender Heri | Thu 1/18/2001
222 | Re: feature freeze | =?iso-8859-1?Q?Bj=F6rn_Lindel | Thu 1/18/2001
223 | Re: feature freeze | Werner Lehmann | Thu 1/18/2001
224 | Re: feature freeze | Mike Lischke | Thu 1/18/2001
225 | Re: feature freeze | Mike Lischke | Thu 1/18/2001
226 | Re: feature freeze | Geoffrey Pan | Thu 1/18/2001
227 | Re: feature freeze | Mike Lischke | Thu 1/18/2001
232 | Re: feature freeze | Werner Lehmann | Sat 1/20/2001
269 | Re: feature freeze | Mike Lischke | Wed 1/24/2001


re: Re-loading a saved tree

From: Mike Lischke [public@l...]
Date: Thu Jan 18, 2001 3:07 pm
Subject: RE: [VirtualTreeview] Re-loading a saved tree

Hi Mauricio,

> I altered the "minimal" example to save the tree through a call to
> SaveToFile and then reload the original contents after clearing the
> tree through a call to LoadFromFile.
>
> After reloading the tree structure seems correct. However, not a
> single node displays it's text.

The problem can easily be solved. In the Minimal demo I have left the
soSaveCaptions options active, so the captions of all nodes are saved to the
file. When doing LoadFromFile the tree tries to assign the caption strings
to the corresponding nodes using the OnNewText event. This is the keypoint
for you.

If you want more sophisticated streaming the switch off soSaveCaptions and
handle all the stuff yourself using OnSaveNode and OnLoadNode. Btw. These
events are also necessary for drag'n drop.

Ciao, Mike


re: feature freeze

From: Bender Heri [HBender@E...]
Date: Thu Jan 18, 2001 3:27 pm
Subject: RE: [VirtualTreeview] feature freeze

> -----Original Message-----
> From: Mike Lischke [mailto:[public@l...]]
> Sent: Thursday, January 18, 2001 4:01 PM
>
> Unfortunately I have bad news. I'm just updating a product of
> my company
> with version 2.0 of VT and found a problem. For persistent
> user settings the
> app. stores the tree's header properties into a stream,
> directly followed by
> the tree data itself. With the recent enhancements however
> (MainColumn,
> SortColumn and SortDirection) it would be necessary to save
> and restore
> additional properties to be consistent. Whoever gets an update of the
> product will then not be able to load their previous settings
> due to the
> changed stream format. The product I'm talking about has been
> sold > 100.000
> times all over Europe and I'm now in serious trouble without
> an acceptable
> solution yet :-(
>

Hallo Mike,

If an application stores data in a native format there should always be a
header which consists at least of a recognition field and a version field.
If you have omitted that in the Version 1.0, so it's no problem to introduce
this in the verison 2. The consequence: Version 1 cannot read streams of
version 2 (normal), but version 2 can read streams of version 1 (again
normal). The criteria for the version 2 reader is the presence of this
version field if it interprets the stream as version 1 stream or as version
2 stream.

Heri


re: feature freeze

From: Björn Lindell [bli@c...]
Date: Thu Jan 18, 2001 3:32 pm
Subject: Re: [VirtualTreeview] feature freeze

Mike, I can fully understand if you want to freeze VT for the sake of your
own products. If not for those products, the community would probably
not have such a fine, free component as VT.

However, I still have some personal reflections on the versioning problem,
perhaps they may be of help:
I have not myself used the SaveToStream/Load features,
but after a quick look in the source code I noticed that you store
version information first. Would it not be possible that LoadFromStream
took the version into account and if the older version that you mention
was found it would not attempt to load those properties that are new to
the streaming. Or is it the case that you had an old stream format that
didn't support versioning?
You could also include versioning considerations within conditional
directives, so those that don't require support for older versions could
exclude the code through a compiler directive.

/Björn

----- Original Message -----
From: "Mike Lischke" [public@l...]
To: <VirtualTreeview@egroups.com>
Sent: Thursday, January 18, 2001 4:00 PM
Subject: [VirtualTreeview] feature freeze

> Hi all,
>
> Unfortunately I have bad news. I'm just updating a product of my company
> with version 2.0 of VT and found a problem. For persistent user settings
the
> app. stores the tree's header properties into a stream, directly followed
by
> the tree data itself. With the recent enhancements however (MainColumn,
> SortColumn and SortDirection) it would be necessary to save and restore
> additional properties to be consistent. Whoever gets an update of the
> product will then not be able to load their previous settings due to the
> changed stream format. The product I'm talking about has been sold >
100.000
> times all over Europe and I'm now in serious trouble without an acceptable
> solution yet :-(
>
> The consequences for Virtual Treeview are clear however: I will no longer
> add properties to the base and string trees unless there is a very, very
> good reason to do so ("would be cool" does not qualify). Hence if you want
> special features in the future then please derive your own tree class and
> add the stuff you think which is necessary.
>
> From this day on VT's feature list is frozen!
>
> Concerned from this decision are all features which have property
> representation in the tree (new options, new properties, some deleted or
> renamed, changed behaviour etc.). Of course the hunt for bugs and leaks
will
> continue unbroken. Also internal improvements can and will be done in the
> future, but, for instance, I will not implement fixed columns.
>
> I think this decision is also good for all those developers which have
used
> VT already in products which depend on consistent and reliable behaviour.
> Since VT has been downloaded more than 10.000 times in the past 8 weeks it
> is very likely that there are many such products already or nearly out.
>
>
> Mike Lischke
> R&D Senior software engineer
>
>
> To unsubscribe from this group, send an email to:
> VirtualTreeview-unsubscribe@egroups.com
>
>


re: feature freeze

From: Werner Lehmann [wl@b...]
Date: Thu Jan 18, 2001 3:38 pm
Subject: Re: [VirtualTreeview] feature freeze

Mike Lischke wrote:

> additional properties to be consistent. Whoever gets an update of the
> product will then not be able to load their previous settings due to the
> changed stream format. The product I'm talking about has been sold > 100.000
> times all over Europe and I'm now in serious trouble without an acceptable
> solution yet :-(

Well. It would have been wise to just stream certain properties
out which the user may change at runtime. Everything else is already
fixed in the DFM resource or changed by program code. This does not
help you now of course.

From my point of view you have only two possibilites (if I rule a
downgrade to v1.31 or previous out):
(1) No preferences compatibility for all 100000 customers for this version
(2) You create a v1.31 tree at runtime, use its streaming methods
as import module and copy relevant properties over to the new tree.
Tedious, sure, but I see no alternative in the given situation. Hope-
fully this conversion is needed only once (if the preferences stream
has a version tag which can be used to distinguish between both stream
formats).

> The consequences for Virtual Treeview are clear however: I will no longer
> add properties to the base and string trees unless there is a very, very
> good reason to do so ("would be cool" does not qualify). Hence if you want
> special features in the future then please derive your own tree class and
> add the stuff you think which is necessary.
>
> From this day on VT's feature list is frozen!
>
> Concerned from this decision are all features which have property
> representation in the tree (new options, new properties, some deleted or
> renamed, changed behaviour etc.). Of course the hunt for bugs and leaks will
> continue unbroken. Also internal improvements can and will be done in the
> future, but, for instance, I will not implement fixed columns.

I don't think (hope) that this is the ultimate word on this. There are
always good reasons for changing the tree itself and not deriving a new
component. The most prominent of these is the limitation that you cannot
change enumerated types (Options!) in descendants, maybe not even add
fields to the Headers/Colors/etc nested properties. Don't you think that
we can come up with something clever allowing us to still add property
based features?

WRT the 100000 customer of yours: the most painless solution would
be to copy & paste the existing code (StringTree) and continue with
enhancements under a different name. Not especially nice but...
painless.

I have no particular enhancement in mind currently that would require
a new property but a general feature freeze is not very desirable. Only
for streaming reasons.

My two cents. Comments?

Regards,
WL


re: feature freeze

From: Mike Lischke [public@l...]
Date: Thu Jan 18, 2001 3:38 pm
Subject: RE: [VirtualTreeview] feature freeze

> If an application stores data in a native format there should
> always be a
> header which consists at least of a recognition field and a
> version field.
> If you have omitted that in the Version 1.0, so it's no
> problem to introduce
> this in the verison 2. The consequence: Version 1 cannot read
> streams of
> version 2 (normal), but version 2 can read streams of version 1 (again
> normal). The criteria for the version 2 reader is the presence of this
> version field if it interprets the stream as version 1 stream
> or as version
> 2 stream.

Mm, I thought of something similar. For the tree I have a stream version
from the beginning, but not for the header and columns. For determining the
header stream version I could write -1 as first entry (currently the first
entry is the column count which can never be negative). This seems to solve
at least this very problem. Thank you for the tip.

Other problems cannot be solved this way however. For instance introducing a
new option will not make it automatically appear in existing projects, even
if it is part of the default value.

Ciao, Mike


re: feature freeze

From: Mike Lischke [public@l...]
Date: Thu Jan 18, 2001 3:45 pm
Subject: RE: [VirtualTreeview] feature freeze

Björn,

> Mike, I can fully understand if you want to freeze VT for the
> sake of your own products.

I know it looks not very flexible, but a released product (or component in
this case) should not change too often if one expects it to be used in
serious projects. For hobbyists this is a limitation without reasons, but we
(my company) really use VT in commercial projects and I cannot afford to
maintain two versions of VT so there is one which must then be a compromise
(as always in live as you surely know).

> However, I still have some personal reflections on the
> versioning problem, perhaps they may be of help:
> I have not myself used the SaveToStream/Load features,
> but after a quick look in the source code I noticed that you store
> version information first.

The problem here is that the header streaming is totally independent from
the tree streaming (for flexibility). So the only chance I have (at least as
I can see it currently) is to use a value which usually will never appear in
the old header stream format to identify the new one.

Ciao, Mike


re: feature freeze

From: "Geoffrey Pan" [gpan@c...]
Date: Thu Jan 18, 2001 4:03 pm
Subject: RE: [VirtualTreeview] feature freeze

Mike,

In looking thru the code for the streaming you are using there may be a
solution in maintaining backwards compatibility with the existing code base
in the area directly following the size range defined by Itemcount.

In your stream loading and saving code you are writing the item count to the
data stream and ignoring any miscellany data that comes after it. Extended
options could then possibly be written in that area and be totally invisible
to existing non-compatible versions.

Of course, then in the additional options, the block could be started by the
length of the additional options, which future versions could then read and
test for compared to the number that they do actually support.

Let me know if this makes any sense :)

Geoffrey Pan
[gpan@c...]

-----Original Message-----
From: Mike Lischke [mailto:[public@l...]]
Sent: Thursday, January 18, 2001 9:01 AM
To: 'VirtualTreeview@egroups.com'
Subject: [VirtualTreeview] feature freeze

Hi all,

Unfortunately I have bad news. I'm just updating a product of my company
with version 2.0 of VT and found a problem. For persistent user settings the
app. stores the tree's header properties into a stream, directly followed by
the tree data itself. With the recent enhancements however (MainColumn,
SortColumn and SortDirection) it would be necessary to save and restore
additional properties to be consistent. Whoever gets an update of the
product will then not be able to load their previous settings due to the
changed stream format. The product I'm talking about has been sold > 100.000
times all over Europe and I'm now in serious trouble without an acceptable
solution yet :-(

The consequences for Virtual Treeview are clear however: I will no longer
add properties to the base and string trees unless there is a very, very
good reason to do so ("would be cool" does not qualify). Hence if you want
special features in the future then please derive your own tree class and
add the stuff you think which is necessary.

From this day on VT's feature list is frozen!

Concerned from this decision are all features which have property
representation in the tree (new options, new properties, some deleted or
renamed, changed behaviour etc.). Of course the hunt for bugs and leaks will
continue unbroken. Also internal improvements can and will be done in the
future, but, for instance, I will not implement fixed columns.

I think this decision is also good for all those developers which have used
VT already in products which depend on consistent and reliable behaviour.
Since VT has been downloaded more than 10.000 times in the past 8 weeks it
is very likely that there are many such products already or nearly out.

Mike Lischke
R&D Senior software engineer

To unsubscribe from this group, send an email to:
VirtualTreeview-unsubscribe@egroups.com


re: feature freeze

From: Mike Lischke [public@l...]
Date: Thu Jan 18, 2001 4:10 pm
Subject: RE: [VirtualTreeview] feature freeze

Hi Werner,

> Well. It would have been wise to just stream certain properties
> out which the user may change at runtime. Everything else is already
> fixed in the DFM resource or changed by program code. This does not
> help you now of course.

The problem with this solution is that you cannot predetermine which
properties will be changed this way. A consistent solution should therefor
save all (relevant) properties.

> (1) No preferences compatibility for all 100000 customers for
> this version

If it would only be the preferences then I would perhaps not care, but the
content of the tree is saved into the same data file (and I thought this
would be clever... stupid it was :-( ). Unfortunately, this content might be
collected by the user over many hours and loosing this will make them cry
(and my boss beat me, if not worse).

> (2) You create a v1.31 tree at runtime, use its streaming methods
> as import module and copy relevant properties over to the new tree.
> Tedious, sure, but I see no alternative in the given situation. Hope-
> fully this conversion is needed only once (if the preferences stream
> has a version tag which can be used to distinguish between both stream
> formats).

This would mean to maintain two sources which is unacceptable and a
nightmare.

> I don't think (hope) that this is the ultimate word on this. There are
> always good reasons for changing the tree itself and not
> deriving a new component. The most prominent of these is the limitation
that
> you cannot change enumerated types (Options!) in descendants, maybe not
even add
> fields to the Headers/Colors/etc nested properties. Don't you think that
> we can come up with something clever allowing us to still add property
> based features?

To hold a back door open for those special cases I wrote that for very, very
good reasons (and be it only to solve a serious bug) I will accept property
changes. But I will think about every proposal very carefully, believe me.

> WRT the 100000 customer of yours: the most painless solution would
> be to copy & paste the existing code (StringTree) and continue with
> enhancements under a different name. Not especially nice but...
> painless.

Two sources...

and don't forget all those who already have produced applications. IT
business is a fast business as you know.

> I have no particular enhancement in mind currently that would require
> a new property but a general feature freeze is not very
> desirable. Only for streaming reasons.

Actually, I had already a feature freeze in May, but took this more and more
lax when I realized that there were only very few bugs reported. Another
fault...

Anyway, thank you for your help. Btw: I still have your other mail in the
pipeline, but have to make the last product working again first. Then I will
answer.

Ciao, Mike


OnContextPopup

From: Bohuslav Švancara [boh.svancara@q...]
Date: Thu Jan 18, 2001 7:32 pm
Subject: OnContextPopup

Hi Mike!

Can you add OnContextPopup event please?

Regards,

Bohuslav Svancara
[softprojekt@i...]

 | Replies | Author | Date
229 | Re: OnContextPopup | Mike Lischke | Thu 1/18/2001


re: OnContextPopup

From: "Mike Lischke" [public@l...]
Date: Thu Jan 18, 2001 8:17 pm
Subject: RE: [VirtualTreeview] OnContextPopup

> Can you add OnContextPopup event please?

There is an OnGetPopuMenu event which does the same and more as OnContextPopup.
But if you insist of
having the latter then assign an event handler at run time (the event is part
of TControl).

Ciao, Mike

Dipl. Ing. Mike Lischke
Senior software developer
--
Homepage: http://www.lischke-online.de
GraphicEx: http://www.lischke-online.de/Graphics.html
Virtual Treeview: http://www.lischke-online.de/VirtualTreeview.html
Unicode Edit and library: http://www.lischke-online.de/Unicode.html


Getting the selected node

From: [lyann@o...]
Date: Fri Jan 19, 2001 9:26 pm
Subject: Getting the selected node

Hi,

I need to get a pointer on the selected node (in my case, I can only
select one at the time).
How can I do?
Do I have to scan all the nodes using the
GetSelected(Node: PVirtualNode): Boolean; method ?

Thanks for your help and your extraordinary component.
Yann

 | Replies | Author | Date
231 | Re: Getting the selected node | Werner Lehmann | Sat 1/20/2001


re: Getting the selected node

From: Werner Lehmann [wl@b...]
Date: Sat Jan 20, 2001 12:35 am
Subject: Re: [VirtualTreeview] Getting the selected node

[lyann@o...] wrote:
>
> I need to get a pointer on the selected node (in my case, I can only
> select one at the time).

Use GetFirstSelected.

WL


re: feature freeze

From: Werner Lehmann [wl@b...]
Date: Sat Jan 20, 2001 1:18 pm
Subject: Re: [VirtualTreeview] feature freeze

Mike Lischke wrote:
>
> The problem with this solution is that you cannot predetermine which
> properties will be changed this way. A consistent solution should therefor
> save all (relevant) properties.

Sure. And in a way being compatible with future enhancements. I know, it is
easy to say that when it's too late. Sorry.

> If it would only be the preferences then I would perhaps not care, but the
> content of the tree is saved into the same data file (and I thought this
> would be clever... stupid it was :-( ). Unfortunately, this content might be
> collected by the user over many hours and loosing this will make them cry
> (and my boss beat me, if not worse).

Ouch :(

> > (2) You create a v1.31 tree at runtime, use its streaming methods
> > as import module and copy relevant properties over to the new tree.
> > Tedious, sure, but I see no alternative in the given situation. Hope-
> > fully this conversion is needed only once (if the preferences stream
> > has a version tag which can be used to distinguish between both stream
> > formats).
>
> This would mean to maintain two sources which is unacceptable and a
> nightmare.

Not really. The v1.31 source is fixed. Feature freezed. And only used as
'import module' for your existing installations. No changes to that source
need to happen (unless there are really serious bugs which are only relevant
to the streaming system). Of course it is your decision (and your work! :)
but I would go that way. This should not be too much work and the only major
drawback that I can see is some overhead in EXE size because of the two tree
versions being included.

Of course: the streaming needs to be reworked then so that this unfortunate
situation cannot happen in the future again.

> and don't forget all those who already have produced applications. IT
> business is a fast business as you know.

You said 10000 downloads in 8 weeks. No serious application is being shipped in
only two months. And even then: these people still have the choice to just stick
with 'their' tree versions. Noone is forced to use any newer versions. This
would effectively also mean a feature freeze. But the development of newer
versions can go on. Personally I am motivated to work on Open Source if there
is room for improvements. If changes are restricted to bugfixes there is not
much fun left.

> Actually, I had already a feature freeze in May, but took this more and more
> lax when I realized that there were only very few bugs reported. Another
> fault...

Not from my point of view, I am glad that these latest additions were made,
especially the sorting glyphs which just 'needed to be in there' :)

> Anyway, thank you for your help. Btw: I still have your other mail in the
> pipeline, but have to make the last product working again first. Then I will
> answer.

Ok. Thanks for the info.

Regards,
WL


Background

From: [jens.treichler@u...]
Date: Sun Jan 21, 2001 5:46 pm
Subject: Background

Hi folks,

I would like to have a striped background (similar to the
advanced Demo - Grid), but with a tree view.
Is there any way to determine the row, counted from the top,
the tree is currently painting ?
Or is there any other chance to have this effect ?

I have tried the BeforeItemErase event with a flag saying
what color the last node had,
but when a node get's selected this won't work.
Any suggestions ?

Best regards
Jens

 | Replies | Author | Date
237 | Re: Background | Werner Lehmann | Sun 1/21/2001
249 | Re: Background | [jens.treichler@u...] | Mon 1/22/2001
264 | Re: Background | Mike Lischke | Wed 1/24/2001
951 | Background | Werner Lehmann | Thu 3/29/2001


Subclassing StringTree: problem with property setting

From: Werner Lehmann [wl@b...]
Date: Sun Jan 21, 2001 4:30 pm
Subject: Subclassing StringTree: problem with property setting

Hi,

I have subclassed TCustomVirtualStringTree and am trying to set some
properties in the constructor. This does not work with the following
two properties. The code compiles ok but when I drop the descendant
component on my form the IDE complains 'Control '' has no parent'.

Constructor looks like this:

constructor TMyTree.Create(AOwner: TComponent);
begin
inherited;
...
DefaultNodeHeight:=17; // this prop
with Header do begin
...
Height:=16; // and this
...
end;
...
end;

Any idea?

Regards,
WL


Basic printing

From: "Peter Evans" [pgevans@m...]
Date: Sun Jan 21, 2001 8:42 pm
Subject: Basic printing

I have used TreeNT so am interested in the new VirtualTreeview.
I like the support for languages and the ability to get a grid.
I have run the demo 'Advanced.exe' and looked at the Help file. Take 2
cases.
At this stage I am only looking for a high level overview.

Case 1.
The demo on tab "Speed". (Traditional tree). Is it possible to print out
this tree?
Do I use methods in VirtualTreeview or another component?
What about the different languages that may be displayed?

Case 2.
The demo on tab "Tree as grid". Is it possible to print out this grid?
Do I use methods in VirtualTreeview or another component?
What about the different languages that my be displayed?

Regards, Peter Evans

 | Replies | Author | Date
236 | Re: Basic printing | Werner Lehmann | Sun 1/21/2001
265 | Re: Basic printing | Mike Lischke | Wed 1/24/2001
365 | Re: Basic printing | Peter Evans | Tue 1/30/2001


re: Basic printing

From: Werner Lehmann [wl@b...]
Date: Sun Jan 21, 2001 10:21 pm
Subject: Re: [VirtualTreeview] Basic printing

Peter Evans wrote:
>
> Case 1.
> The demo on tab "Speed". (Traditional tree). Is it possible to print out
> this tree?
> Do I use methods in VirtualTreeview or another component?

I believe you can use the PaintTo method with a printer canvas.

> What about the different languages that may be displayed?

Should make no difference as long as the fonts are installed and
display correctly on screen.

> Case 2.
> The demo on tab "Tree as grid". Is it possible to print out this grid?
> What about the different languages that my be displayed?

Same answers.

WL


re: Background

From: Werner Lehmann [wl@b...]
Date: Sun Jan 21, 2001 10:25 pm
Subject: Re: [VirtualTreeview] Background

[jens.treichler@u...] wrote:
>
> I would like to have a striped background (similar to the
> advanced Demo - Grid), but with a tree view.
> Is there any way to determine the row, counted from the top,
> the tree is currently painting ?
> Or is there any other chance to have this effect ?

I would try this in OnAfterItemErase. This event provides an ItemRect.

if odd(ItemRect.Top div DefaultNodeHeight) then
...
else
...

Untested.

WL

 | Replies | Author | Date
249 | Re: Background | [jens.treichler@u...] | Mon 1/22/2001


Not acceptet

From: [rieni@m...]
Date: Mon Jan 22, 2001 7:48 am
Subject: Not acceptet

Hei,
I use a VirtualStringTree with just strings in it. I want to drag and
drop to another object/component f.i. a panel, an editbox or a
calender. But even if I set the OnDragOver to 'accept:=true', none of
these components want to accept things from the VirtualStringTree.
Why is that and what can I do with it?
Marinus
Norway

 | Replies | Author | Date
240 | Re: Not acceptet | Werner Lehmann | Mon 1/22/2001
243 | Re: Not acceptet | [rieni@m...] | Mon 1/22/2001
271 | Re: Not acceptet | Mike Lischke | Wed 1/24/2001
272 | Re: Not acceptet | Mike Lischke | Wed 1/24/2001


re: Not acceptet

From: Werner Lehmann [wl@b...]
Date: Mon Jan 22, 2001 8:00 am
Subject: Re: [VirtualTreeview] Not acceptet

[rieni@m...] wrote:
>
> Why is that and what can I do with it?

The component implements OLE drag and drop which is not
compatible with the VCL drag and drop method. You can drop
on other trees and on the richedit control.

With v2.0 VCL dnd support has been introduced. I did not
check that out but you may try. v2.0 is only available in
the file area of this mailing list AFAIK.

Regards,
WL

 | Replies | Author | Date
243 | Re: Not acceptet | [rieni@m...] | Mon 1/22/2001


re: VirtualTreeview is IE4 dependant!

From: Werner Lehmann [wl@b...]
Date: Mon Jan 22, 2001 8:00 am
Subject: Re: [VirtualTreeview] VirtualTreeview is IE4 dependant!

Geoffrey Pan wrote:
>
> N

Elaborate?

WL


re: Not acceptet

From: [rieni@m...]
Date: Mon Jan 22, 2001 9:02 am
Subject: Re: Not acceptet

--- In [VirtualTreeview@egroups.com, Werner Lehmann [wl@b...] wrote:
> rieni@m...] wrote:
> >
> > Why is that and what can I do with it?
>
> The component implements OLE drag and drop which is not
> compatible with the VCL drag and drop method. You can drop
> on other trees and on the richedit control.
>
> With v2.0 VCL dnd support has been introduced. I did not
> check that out but you may try. v2.0 is only available in
> the file area of this mailing list AFAIK.
>
> Regards,
> WL

Thank yoy very much, it works !!
Marinus, Norway


VirtualTreeview is IE4 dependant!

From: [gpan@c...]
Date: Mon Jan 22, 2001 9:06 am
Subject: VirtualTreeview is IE4 dependant!

My email server is acting up :P, truncating messages.

Basically VT uses the Flatscrollbar, which is a comctl 4.72
enhancement. This came with IE 4.0 and better.

Apps that use VT won't run without this comctl update.

 | Replies | Author | Date
246 | Re: VirtualTreeview is IE4 dependant! | [developpeur@c...] | Mon 1/22/2001


re: Sorting by column

From: [rieni@m...]
Date: Mon Jan 22, 2001 9:34 am
Subject: Re: Sorting by column

--- In [VirtualTreeview@egroups.com, Mike Lischke <public@l...] wrote:
> > I've seen a few notes / examples about how to sort the Tree but
it's
> > still not so very clear for me. I need a very simple example like
> > this:
> >
> > I have 3 columns.
> > In the first column: names of schools.
> > As childs for the school:
> > pupilnames in column 0
> > adress in column 1
> > telefon in column 2
> >
> > When I click on a column-title I want to sort the Tree.
> > How can I do this?
>
> Firstly, you should use version 2.0 of Virtual Treeview for this
task
> because some special support for sorting has been built in there.
Secondly,
> you have two options in this new version (which you can download at
the time
> being from the eGroups file area of this mailing list
> (www.egroups.com/files/VirtualTreeview). One option for sorting is
to
> include voAutoSort in Tree.Options and set the sort direction and
sort
> column (in this order) in the tree's header class. The other option
is to
> set direction and sort column (without auto sort option set) and
call
> Tree.Sort afterwards with the just set direct and sort column.
>
> Ciao, Mike


re: VirtualTreeview is IE4 dependant!

From: [developpeur@c...]
Date: Mon Jan 22, 2001 10:03 am
Subject: Re: VirtualTreeview is IE4 dependant!

Why doesn't implement a CustomDrawScrollbar for VT ? (and after for
all VCL Component :))


Sorting by column

From: [rieni@m...]
Date: Mon Jan 22, 2001 10:10 am
Subject: Sorting by column

Hei,
Something went wrong in my last reply. But here's my problem:
I have 3 columns.
In the first column: names of schools.
As childs for the school:
pupilnames in column 0
adress in column 1
telefon in column 2
When I click on a column-title I want to sort the Tree by column.
How can I do this?

I installed version 2.0.
Now I have 2 options:
A. voAutoSort=true, I set Header.SortColumn and Header.SortDirection.
What do I write in the OnHeaderClick-procedure? Nothing (because it's
automatic) or what?
B. voAutoSort=false,
What do I write in the OnHeaderClick-procedure? Something like this:

procedure TfrmVrt.VSTHeaderClick(Sender: TBaseVirtualTree;
Column: Integer);
begin
with VST,Header do
begin
SortColumn:=Column;
if SortDirection = sdAscending then
SortDirection := sdDescending
else
SortDirection := sdAscending;
?This >> Sort(GetFirstSelected,SortColumn, SortDirection, False);
?This >> SortTree(SortColumn, SortDirection, False);
end;
end;

I tried several options but I cann't get it work. The tree does
nothing at all. Are there other properties/options I've forgot. Can I
only sort by the maincolumn (like i the Advanced DrawTree) ?

This must be a boaring question for you all, isn't it?

Marinus
Norway

 | Replies | Author | Date
248 | Re: Sorting by column | Pete Fraser | Mon 1/22/2001


re: Sorting by column

From: "Pete Fraser" [pete.fraser@f...]
Date: Mon Jan 22, 2001 5:24 pm
Subject: Re: Sorting by column

Mike said that there is a call-back event when sorting was going on.

The event is called OnCompareNodes and you *must* set a handler for
it as otherwise VirtualTree doesn't know about your data.

HTH Pete


re: Background

From: [jens.treichler@u...]
Date: Mon Jan 22, 2001 9:05 pm
Subject: Re: Background

--- In [VirtualTreeview@egroups.com, Werner Lehmann <wl@b...] wrote:
>
> if odd(ItemRect.Top div DefaultNodeHeight) then
> ...
> else
> ...
>
> Untested.
>
> WL

It works, thanks alot. But sometimes a row index would
not that bad, for example if the row's have different sizes.
Then a calculation for the row would be a pain.
Why not giving this information to the event ?

Jens


Problem with header popup

From: [jens.treichler@u...]
Date: Mon Jan 22, 2001 9:12 pm
Subject: Problem with header popup

Hi,

I'am using Version 2.0 pre.
When I assign a popupmenu to the header,
it get's called on the scrollbars, too. Is this
normal behaviour ?
Also when I popup this menu on the header and the
tree is scrolled some lines vertically, mouse moves on the menu scoll
the tree back to top. Has anyone else seen this effect?

Jens

 | Replies | Author | Date
251 | Comctl 4.7 dependency | Geoffrey Pan | Mon 1/22/2001


Comctl 4.7 dependency

From: "Geoffrey Pan" [gpan@c...]
Date: Mon Jan 22, 2001 11:45 pm
Subject: Comctl 4.7 dependency

Any chance there a test could be added to use the "standard" scrollbar
instead of flat when on older comctl?


re: Comctl 4.7 dependency

From: Werner Lehmann [wl@b...]
Date: Tue Jan 23, 2001 12:20 am
Subject: Re: [VirtualTreeview] Comctl 4.7 dependency

Geoffrey Pan wrote:
>
> Any chance there a test could be added to use the "standard" scrollbar
> instead of flat when on older comctl?

Why don't you write a function that tests if the version of comctl32
suffices?

> Apps that use VT won't run without this comctl update.

Which error message is brought up then?

WL

 | Replies | Author | Date
259 | Re: Comctl 4.7 dependency | Geoffrey Pan | Wed 1/24/2001


re: Subclassing StringTree: problem with proper ty setting

From: Bender Heri [HBender@E...]
Date: Tue Jan 23, 2001 9:26 am
Subject: RE: [VirtualTreeview] Subclassing StringTree: problem with proper ty setting

I had the same problem. To solve it I introduced a new constructor:

CreateWithParent(AOwner : TComponent; aParent : TWinControl);
var
boVisible : Boolean;
begin
inherited Create(AOwner);

boVisible := Visible;
Visible := False;
try
// overtake values:
Parent := aParent;

// init some values:
InitTree;
...

finally
Visible := boVisible;
end;
end;

The trick with the visible stuff is to avoid a different appearance as you
intend (which will show a short time while the tree is initializing) by
setting the respective properties afterwards.

Heri

> -----Original Message-----
> From: Werner Lehmann [mailto:[wl@b...]]
> Sent: Sunday, January 21, 2001 5:31 PM
> To: VirtualTreeview
> Subject: [VirtualTreeview] Subclassing StringTree: problem
> with property
> setting
>
>
> Hi,
>
> I have subclassed TCustomVirtualStringTree and am trying to set some
> properties in the constructor. This does not work with the following
> two properties. The code compiles ok but when I drop the descendant
> component on my form the IDE complains 'Control '' has no parent'.
>
> Constructor looks like this:
>
> constructor TMyTree.Create(AOwner: TComponent);
> begin
> inherited;
> ...
> DefaultNodeHeight:=17; // this prop
> with Header do begin
> ...
> Height:=16; // and this
> ...
> end;
> ...
> end;
>
> Any idea?
>
> Regards,
> WL
>
>
> To unsubscribe from this group, send an email to:
> VirtualTreeview-unsubscribe@egroups.com
>
>
>

 | Replies | Author | Date
254 | Re: Subclassing StringTree: problem with proper t | Werner Lehmann | Tue 1/23/2001
266 | Re: Subclassing StringTree: problem with proper t | Mike Lischke | Wed 1/24/2001
275 | Re: Subclassing StringTree: problem with proper t | Mike Lischke | Wed 1/24/2001


re: Subclassing StringTree: problem with proper ty setting

From: Werner Lehmann [wl@b...]
Date: Tue Jan 23, 2001 9:46 am
Subject: Re: [VirtualTreeview] Subclassing StringTree: problem with proper ty setting

Bender Heri wrote:

> I had the same problem. To solve it I introduced a new constructor:
>
> CreateWithParent(AOwner : TComponent; aParent : TWinControl);
> var
> boVisible : Boolean;
> begin
> inherited Create(AOwner);
>
> boVisible := Visible;
> Visible := False;
> try
> // overtake values:
> Parent := aParent;
>
> // init some values:
> InitTree;
> ...
>
> finally
> Visible := boVisible;
> end;
> end;
>
> The trick with the visible stuff is to avoid a different appearance as you
> intend (which will show a short time while the tree is initializing) by
> setting the respective properties afterwards.

Heri,

I am using the derived component as every other VCL palette
control. AFAIK I cannot just introduce a new parent parameter
to the constructor.

Strange enough: changing for instance the height within the
constructor of a derived class has never been a problem for
my previous components. I believe that there must be some magic
lurking anywhere...

Regards,
WL

BTW, do you know if and how it is possible to use design time
packages on a per-project basis? I have derived a highly specialized
component which will not make any sense outside the context of
my current project...


Deriving an EditLink

From: "Thierry Andry" [Form@a...]
Date: Tue Jan 23, 2001 12:31 pm
Subject: Deriving an EditLink

Hello,

In Delphi demo example (advanced), I found

TPropertyEditLink = class(TInterfacedObject, IVTEditLink)

that will create a new editor. It means that PropertyEditLink is publicly
derived from two base classes.

So in C++, I have to write

class TPropertyEditLink : public TInterfacedObject, public IVTEditLink {

But when I compile my project, I have

[C++ Error] Editor.h(8): E2278 Multiple base classes not supported for VCL
classes.

Huuu, does that mean that I cannot use own-designed editor in C++ ???

Is there any other dev that use VT with BCB 5.0 ??

Thanks,

T.

 | Replies | Author | Date
257 | Re: Deriving an EditLink | =?iso-8859-1?q?Roland_Bed=FCr | Tue 1/23/2001
262 | Re: Deriving an EditLink | Mike Lischke | Wed 1/24/2001


Catching start of drag

From: "Pete Fraser" [pete.fraser@f...]
Date: Tue Jan 23, 2001 2:15 pm
Subject: Catching start of drag

Firstly, this is using the V2 beta code.

I'm trying to catch the start of a drag event when using VCL drag and
drop. There doesn't seem to be an event to catch this and OnStartDrag
hasn't been published.

I need to catch this as I want to drag a node onto another component,
whose contents depends on the node selected. Thus if node 1 is
selected and then I try to drag node 2, when the drag starts node 1
needs to be re-selected (node 2 is stored in the OnStartDrag).

Any ideas?
Obviously my preferred solution is for Mike to publish
OnStart/EndDrag in the standard tree but I don't know if he will
(Mike?) based on previous posts.

Alternatively I could derive from VirtualTree but that isn't ideal...

Has anyone tried any other ideas?

Rgds Pete

 | Replies | Author | Date
263 | Re: Catching start of drag | Mike Lischke | Wed 1/24/2001
276 | Re: Catching start of drag | Pete Fraser | Wed 1/24/2001
281 | Re: Catching start of drag | Mike Lischke | Wed 1/24/2001
287 | Re: Catching start of drag | Pete Fraser | Thu 1/25/2001
305 | Re: Catching start of drag | Mike Lischke | Fri 1/26/2001


re: Deriving an EditLink

From: "Roland Bedürftig" [Beduerftig@S...]
Date: Tue Jan 23, 2001 4:28 pm
Subject: Re: Deriving an EditLink

--- In [VirtualTreeview@egroups.com, "Thierry Andry" <Form@a...] wrote:
>
> Hello,
>
> In Delphi demo example (advanced), I found
>
> TPropertyEditLink = class(TInterfacedObject, IVTEditLink)
>
> Is there any other dev that use VT with BCB 5.0 ??
>

Hi,

today I started to use VT with BCB 5.0. I try to changed my source
written with the component TreeNT to use the new VT.
My first step download VT and installed VT under BCB 5.0 was easy.

Have you translate the demo written in delphi to BCB or have you
started write our own demo to understand how VT works ?

I think a good idea is in the first step to translate the delphi demo
and then modify the demo to the own problems.

I will started to work with VT in the next days.

Bye
Roland


re: Deriving an EditLink

From: Werner Lehmann [wl@b...]
Date: Tue Jan 23, 2001 5:54 pm
Subject: Re: [VirtualTreeview] Deriving an EditLink

Thierry Andry wrote:

> In Delphi demo example (advanced), I found
>
> TPropertyEditLink = class(TInterfacedObject, IVTEditLink)
>
> that will create a new editor. It means that PropertyEditLink is publicly
> derived from two base classes.

No. IVTEditLink should be an Interface not a Class (hence the
capital I). Delphi (and CPPB) do not support multiple inheritance
but a class can implement multiple interfaces.

Regards,
WL


re: Comctl 4.7 dependency

From: "Geoffrey Pan" [gpan@c...]
Date: Wed Jan 24, 2001 1:39 am
Subject: RE: [VirtualTreeview] Comctl 4.7 dependency

(exename) is linked to missing export comctl32.dll:InitializeFlatSB

-----Original Message-----
From: Werner Lehmann [mailto:[wl@b...]]
Sent: Monday, January 22, 2001 6:20 PM
To: VirtualTreeview@egroups.com
Subject: Re: [VirtualTreeview] Comctl 4.7 dependency

Geoffrey Pan wrote:
>
> Any chance there a test could be added to use the "standard" scrollbar
> instead of flat when on older comctl?

Why don't you write a function that tests if the version of comctl32
suffices?

> Apps that use VT won't run without this comctl update.

Which error message is brought up then?

WL

To unsubscribe from this group, send an email to:
VirtualTreeview-unsubscribe@egroups.com


Invisible Nodes

From: [jens.treichler@u...]
Date: Wed Jan 24, 2001 6:57 am
Subject: Invisible Nodes

Hi,
I would like to ask the users of VirtualTreeview whether there is a
need to toggle the visibility (show/hide) of nodes. Currently it is
difficult to implement
a filter function. The only way I see is a reinit of the treenodes.
This has the disadvantage of loosing the hierarchy of nodes which
might be cpu intensive
to generate or memory intensive to store. Also the status of the nodes
likes expanded of selected get lost or must be stored prior to
filtering.

I checked the sources an found the procedures getnodeat and
getnextvisible to be changed accordingly. Also the cache routines and
the selection would need an update.
Is an invisible node feature worth the trouble ?
Jens

 | Replies | Author | Date
261 | Re: Invisible Nodes | Pete Fraser | Wed 1/24/2001
277 | Re: Invisible Nodes | Mike Lischke | Wed 1/24/2001


re: Invisible Nodes

From: "Pete Fraser" [pete.fraser@f...]
Date: Wed Jan 24, 2001 10:09 am
Subject: Re: Invisible Nodes

I'd like this as well....but according to Mike it's not trivial.
It's not high up on my list but I would like it at sometime.

Rgds Pete

--- In [VirtualTreeview@egroups.com, jens.treichler@u...] wrote:
> Hi,
> I would like to ask the users of VirtualTreeview whether there is a
> need to toggle the visibility (show/hide) of nodes. Currently it is
> difficult to implement
> a filter function. The only way I see is a reinit of the treenodes.
> This has the disadvantage of loosing the hierarchy of nodes which
> might be cpu intensive
> to generate or memory intensive to store. Also the status of the
nodes
> likes expanded of selected get lost or must be stored prior to
> filtering.


re: Deriving an EditLink

From: Mike Lischke [public@l...]
Date: Wed Jan 24, 2001 1:27 pm
Subject: RE: [VirtualTreeview] Deriving an EditLink

Hi Thierry,

> TPropertyEditLink = class(TInterfacedObject, IVTEditLink)
>
> So in C++, I have to write
>
> class TPropertyEditLink : public TInterfacedObject, public
> IVTEditLink {

Unfortunately, I don't know much about BCB so I can't really help here. But
as already mentioned in another mail the property edit link class is not
build from several classes but from another class plus some interfaces. I
recommend that you convert VirtualTrees.pas into VirtualTrees.hpp and look
at the resulting translation of the built-in generic editor. This is surely
the best start point.

> Is there any other dev that use VT with BCB 5.0 ??

Indeed there are. Thank Pete Fraser the news about VT also reached the
Borland C++ forums and some of the BCB programmers subscribed here too. They
might not listen all the time here but if you ask your question you will
likely also get an useful answer.

Ciao, Mike


re: Catching start of drag

From: Mike Lischke [public@l...]
Date: Wed Jan 24, 2001 1:40 pm
Subject: RE: [VirtualTreeview] Catching start of drag

Hi Pete,

> I'm trying to catch the start of a drag event when using VCL drag and
> drop. There doesn't seem to be an event to catch this and OnStartDrag
> hasn't been published.

> Obviously my preferred solution is for Mike to publish
> OnStart/EndDrag in the standard tree but I don't know if he will
> (Mike?) based on previous posts.

Well, although I had a lot of other things to do the passed days I have
found a solution for the streaming problem, I think. I will tell more in one
of the other 30 mails I have to answer.

Since adding an event does not harm existing implementations in any way I
have no problems to publish OnStartDrag and OnEndDrag. My concerns however
belong to the ambiguity which raises from this. Both events are only related
to a VCL dd operation but will raise the question for getting them also
during OLE dd, I'm sure. Every other dd event however is triggered in both
situations.

I think the only solution from this situation would be to create new events
(which also take the data object as parameter) and trigger them with OLE as
well as VCL dd. This would make the parameters lists different to the
standard but, well...., which parameter list in VT is the same 8-)?

Other opinions? Please note that it can take a couple of days until this is
implemented. Not sure when I will find the time. Or are there volunteers for
this task?

Ciao, Mike

 | Replies | Author | Date
276 | Re: Catching start of drag | Pete Fraser | Wed 1/24/2001


re: Re: Background

From: Mike Lischke [public@l...]
Date: Wed Jan 24, 2001 1:43 pm
Subject: RE: [VirtualTreeview] Re: Background

Hi Jens,

> It works, thanks alot. But sometimes a row index would
> not that bad, for example if the row's have different sizes.
> Then a calculation for the row would be a pain.
> Why not giving this information to the event ?

Well, this is a good idea. Should the index be counted starting with 0 when
painting the top node in the client area or would you prefer the absolute
index? The former would be faster...

Ciao, Mike


re: Basic printing

From: Mike Lischke [public@l...]
Date: Wed Jan 24, 2001 2:00 pm
Subject: RE: [VirtualTreeview] Basic printing

Hi Peter,

> Case 1.
> The demo on tab "Speed". (Traditional tree). Is it possible
> to print out this tree?
> Do I use methods in VirtualTreeview or another component?
> What about the different languages that may be displayed?

Since printing a tree will be handled very differently by developers I have
only implemented a kind of generic method called PaintTo. By passing in a
well prepared canvas (with proper window and viewport settings) you can
print the tree however you like. On the other hand it involves a bit more
work than with having a dedicated print routine.

The languages don't matter at all. Since VT uses Unicode for strings it is
well prepared for every language on this earth. This includes BYZANTINE
MUSICAL SYMBOL FTHORA ENARMONIOS ANTIFONIA (as specified in the latest
Unicode version) as well as Gothic and Old Italic scripts. The key point is
that you have the proper *font* to display the glyphs. Arial Unicode MS is
the most complete font I know of, but it still contains glyphs only for
characters definied up to Unicode version 2.0. Most of the languages used
today (including hebrew, far east, east and west european scripts) can be
displayed with this font, however.

> Case 2.
> The demo on tab "Tree as grid". Is it possible to print out this grid?
> Do I use methods in VirtualTreeview or another component?
> What about the different languages that my be displayed?

Also here is valid that you have to build your own print routine around
PaintTo (printer setup, size determination and page advancing if the tree
does not fit onto one page). Thank to Unicode there is no problem displaying
many different languages on the same page, provided the printer supports
soft fonts, which means it can download non-existing fonts (or the print
system uses other mechanisms to send the glyph strokes to the printer).

Ciao, Mike


re: Subclassing StringTree: problem with proper ty setting

From: Mike Lischke [public@l...]
Date: Wed Jan 24, 2001 2:09 pm
Subject: RE: [VirtualTreeview] Subclassing StringTree: problem with proper ty setting

Hi Werner,

> I have subclassed TCustomVirtualStringTree and am trying to set some
> properties in the constructor. This does not work with the following
> two properties. The code compiles ok but when I drop the descendant
> component on my form the IDE complains 'Control '' has no parent'.
>
> Constructor looks like this:
>
> constructor TMyTree.Create(AOwner: TComponent);
> begin
> inherited;
> ...
> DefaultNodeHeight:=17; // this prop
> with Header do begin
> ...
> Height:=16; // and this
> ...
> end;
> ...
> end;

This effect is actually caused by the fact that the marked lines will try to
create a window handle. This should not happen in a class constructor
however. The solution is to avoid this by checking in the set methods
whether the control's window handle has already been created. I will include
this in version 2.0.

Ciao, Mike


re: Version 2.0 prerelease

From: Mike Lischke [public@l...]
Date: Wed Jan 24, 2001 2:23 pm
Subject: RE: [VirtualTreeview] Version 2.0 prerelease

Hi Werner,

thank you very much for your extensive test and bug report! See below for my
comments:

> Error(?): the DropTargetColor does not get streamed to the
> DFM. It reverts to clHighlight after the project is loaded. The same is
true
> for DropMarkColor, probably for everything in .Colors.*

Yes this was a bug (which has been fixed). Although the class TVTColors is
never touched as a whole when streaming, it is required however to have a
write method for Tree.Colors, otherwise the entire property is ignored.

> * The DropMark wasn't shown and I was almost at adding it the
> bug list when I found the new voShowDropmark property :) (maybe its
default
> should be true, not false, to be consistent with previous behaviour?).

Actually, the drop mark is shown by default. But in existing projects where
Tree.Options has already been saved to DFM this is ignored. Instead the
saved data will be loaded of course. Whilst removing an option is quite bad
adding one is also not without drawbacks. Not only that the new option
cannot be set when loading old data from DFM it can be set wrongly in code
which does not store text representations of the enumeration type. The
reason is that enumeration types are stored as collection of bits in
alphabetical order of the participating identifiers. If you now add a new
identifier which is alphabetically somewhere inbetween it will automatically
cause all entries following it (alphabetically) to move one bit "up".

In our case voShowDropmark took the place (bit) where voShowHorzGridLine
was. Imagine you have saved Tree.Options using a type cast to Cardinal and
had voShowHorzGridLine set then you will receive now voShowDropmark as being
set, although it has not been there when you saved Options. The reason is
that the bit which was voShowHorzGridLine (and which was set) is now
interpreted as being voShowDropmark.

> * DefaultText property still does not stream empty value to DFM

Fixed. I had not had the opportunity to fixed that in the prerelease.

> * What is the idea behind setting ParentColor to false (just
> out of curiosity):
> - new default value for ParentColor

ParentColor is True when the control should use the same color as its
parent. This does not apply to VT because it used clWindow as default while
its parent (usually a form or panel) uses clBtnFace as default.
ParentColor's default value is True for TControl and is saved to DFM if it
is True at design time. Now I need it to be False (otherwise it will reset
the tree's color) and have so to give it as default value False to have it
stored when it is True (in which case the setting in the tree constructor
for ParentColor := False is changed to True).

> (1) Try and set a header imagelist, set an imageindex of the sorted
column and
> make the Layout blGlyphRight. Effect: The header caption is now only
'...'
> and both images (sort/imagelist bitmap) overlap very ugly.

My intention was to limit the number of visible glyphs on the right hand
side if the sort glyph is shown. Well, I will have to redesign glyph
placing...

> (2) The default value for Header.SortColumn is -1. To indicate that no
column is
> being sorted. Very well but why did you include an extra option for
that
> purpose then? (this is the trap I fell in and mentioned above :)

Sorting a column and showing that it is sorted is not the same. It could
well be that somebody wants to auto sort a certain column without showing
the sort glyph.

> PS: I just notice another odd behaviour: I removed the header imagelist.
The
> sorted column caption is now completely gone and only the glyph is left
(still
> blGlyphRight). If I make a different column 'sorted' and blGlyphRight,
the caption
> is abbreviated with three dots and only the first letter shows. Although
there is
> plenty of space.

This is strange. I checked this a could not reproduce this behaviour. Can
you make me a small demo showing it?

> My two cents: if you ever should implement a
per-column-alignment/justification
> feature: make it independent of the glyph layout (Column[n].Layout). The
caption
> would then be aligned as the nodes in that column and the glyph layout
would just
> determine if the glyph would be left/right/whatever relative to the
header caption.

Thank you, I will consider your suggestions. I'm not sure, however, if this
will make its way into version 2.0.

> I would like to see this alignment as well. Right now it
> does not seem to be possible to show 'comma-aligned' (or even only
right-aligned)
> numbers in a column without ownerdrawing.

Comma align arrangements are quite difficult, though not impossible. The
main problem is that the width of the characters in a font differs so you
have to calculate the start position of a string from a right hand (comma)
position. I will think about this feature when I implement right-to-left
alignment for arabic and hebrew bidi settings.

> For clarification: what does voAutoSort? Does this work
> together with AddChild?

Yes, with AddChild and InsertNode, but not with SetChildCount (as triggered
by setting the Tree.ChildCount[Node]).

> BTW (this is not about v2.0 in particular), the
> DragImageKind.... it looks already nice but there is one problem:
> it consists only of the visible selected
> nodes.
> Furthermore, at least on Win2K the shell (explorer) shows a cute
> blended-out drag image. This effect is hard to describe, the
> translucency of the dragimage grows towards its borders while the image is

> 100% opaque at the selection/drag anchor node. You probably noticed that
> already. Do you see any chance to get that for cheap?

I know somebody would request this some day :-P The main argument speaking
*for* implementing it is that you can nicely blend out the drag image and
can keep it small (which will be a great speed improvement for large tree
windows). The main argument *against* it is that I have to change the drag
image implementation quite a lot. Since necessary work was never a reason
for me no to start doing things the latter argument is not something wich
will prevent the implementation. It is actually the time needed to do so.
I'll take the suggestion into the Todo list.

> I did not find problems with it unless it is intended that
> the trees should be
> able to accept (and include in the tree) files being dragged
> from explorer.

Yes, this is intended. Nice feature, isn't it ;-) ? You can even select and
drag text from IE or Word to the trees and a node with the text will be
added.

Ciao, Mike


Unicode under Win98 // Was: Basic printing

From: Dieter Köhler [dieter.koehler@p...]
Date: Wed Jan 24, 2001 2:25 pm
Subject: Unicode under Win98 // Was: Basic printing

> The languages don't matter at all. Since VT uses Unicode for strings it is
> well prepared for every language on this earth. This includes BYZANTINE
> MUSICAL SYMBOL FTHORA ENARMONIOS ANTIFONIA (as specified in the latest
> Unicode version) as well as Gothic and Old Italic scripts. The key point is
> that you have the proper *font* to display the glyphs. Arial Unicode MS is
> the most complete font I know of, but it still contains glyphs only for
> characters definied up to Unicode version 2.0. Most of the languages used
> today (including hebrew, far east, east and west european scripts) can be
> displayed with this font, however.

Can one use e.g. Hebrew and Western Scripts in one and the same
TVirtualStringTree entry under Win98? If not under Win98, then under Win2000,
etc.? What about bi-directonality and normalization of combining characters?
Is there a good web-site which covers all these "How to use Unicode in
Delphi"-issues in detail?

Dieter


re: feature freeze

From: Mike Lischke [public@l...]
Date: Wed Jan 24, 2001 2:35 pm
Subject: RE: [VirtualTreeview] feature freeze

> > Actually, I had already a feature freeze in May, but took
> this more and more
> > lax when I realized that there were only very few bugs
> reported. Another
> > fault...
>
> Not from my point of view, I am glad that these latest
> additions were made,
> especially the sorting glyphs which just 'needed to be in there' :)
>
> > Anyway, thank you for your help. Btw: I still have your
> other mail in the
> > pipeline, but have to make the last product working again
> first. Then I will
> > answer.

In the meantime I have managed to fix the stream problem. While I did this I
also fixed another limitation in the general streaming stuff. Originally
everything in the passed stream was read by LoadFromStream and
AddFromStream, but if there was additional data after the tree stuff the
loader methods would get into serious trouble. I have now increased the tree
stream version to 2 and removed the minor version which was without meaning
anymore (now both tree and header have only one simple version number).
Version 2 of the tree has been extended with a count value to know when to
stop loading nodes from stream.

As this trouble has warned me not to be too lax when changing the tree I
will still watch very carefull what to add. This will however (as I already
have precised) not lead to a total feature freeze but only to very careful
decisions when it comes to interface changes which might break existing
projects (and be it only those of my company if nobody else cares (yet)).

Ciao, Mike


re: feature freeze

From: Mike Lischke [public@l...]
Date: Wed Jan 24, 2001 2:50 pm
Subject: RE: [VirtualTreeview] feature freeze

Hi Geoffrey,

> Of course, then in the additional options, the block could be
> started by the length of the additional options, which future versions
could
> then read and test for compared to the number that they do actually
support.

Thank you for your ideas too. As I already wrote I have found a solution
which is acceptable I think. The main problem was to introduce a stream
version for the header data without breaking existing data. I have managed
this by using this simple code in TVTHeader.LoadFromStream:

// determine whether the stream contains data without a version number
ReadBuffer(Dummy, SizeOf(Dummy));
if Dummy > -1 then
begin
// seek back to undo read operation if this is an old stream format
Seek(-SizeOf(Dummy), soFromCurrent);
Version := -1;
end
else // read version number if this is a "versionized" format
ReadBuffer(Version, SizeOf(Version));
Columns.LoadFromStream(Stream, Version);

The version number is also passed through to allow columns to load the tag
value which was not there in earlier version. For the extended tree options
I had explicit to work around the wrong settings in the project.
Particularly the latter is not generally acceptable, hence my resentiments
regarding the change of published properties and methods.

Ciao, Mike


re: Not acceptet

From: Mike Lischke [public@l...]
Date: Wed Jan 24, 2001 2:51 pm
Subject: RE: [VirtualTreeview] Not acceptet

Hi Marinus,

> I use a VirtualStringTree with just strings in it. I want to drag and
> drop to another object/component f.i. a panel, an editbox or a
> calender. But even if I set the OnDragOver to 'accept:=true', none of
> these components want to accept things from the VirtualStringTree.
> Why is that and what can I do with it?

Virtual Treeview does not support VCL drag'n drop yet but starting with
version 2.0 this will be implemented. Please be patient until its release...

Ciao, Mike


re: Not acceptet

From: Mike Lischke [public@l...]
Date: Wed Jan 24, 2001 2:52 pm
Subject: RE: [VirtualTreeview] Not acceptet

> [rieni@m...] wrote:
> >
> > Why is that and what can I do with it?
>
> The component implements OLE drag and drop which is not
> compatible with the VCL drag and drop method. You can drop
> on other trees and on the richedit control.
>
> With v2.0 VCL dnd support has been introduced. I did not
> check that out but you may try. v2.0 is only available in
> the file area of this mailing list AFAIK.

Oops, wrong order, so I answered an already answered mail :o]

Ciao, Mike


re: VirtualTreeview is IE4 dependant!

From: Mike Lischke [public@l...]
Date: Wed Jan 24, 2001 2:55 pm
Subject: RE: [VirtualTreeview] VirtualTreeview is IE4 dependant!

> Basically VT uses the Flatscrollbar, which is a comctl 4.72
> enhancement. This came with IE 4.0 and better.
>
> Apps that use VT won't run without this comctl update.

Mmm, I didn't expect that there are still Win95 machines without ComCtrl
4.72 or up. But on the other hand I want to make the control as independent
as possible from the system and its configuration. IIRC there is already
support in the VCL to use either flat or normal scrollbars (at least for
Delphi 5, can anybody confirm this for Delphi 4 too?).

Ciao, Mike

 | Replies | Author | Date
278 | Re: VirtualTreeview is IE4 dependant! | Geoffrey Pan | Wed 1/24/2001


re: Sorting by column

From: Mike Lischke [public@l...]
Date: Wed Jan 24, 2001 3:18 pm
Subject: RE: [VirtualTreeview] Sorting by column

> I installed version 2.0.
> Now I have 2 options:
> A. voAutoSort=true, I set Header.SortColumn and Header.SortDirection.
> What do I write in the OnHeaderClick-procedure? Nothing (because it's
> automatic) or what?

Actually it is a bit different. A header click does not always mean the user
wants to sort the column. So there is no automatic assignment for the
particular column to be the new sort column. You have to assign it in your
OnHeaderClick event. If you have voAutoSort set then the Header.SortColumn
assignment will automatically sort the tree, otherwise you have to call
Tree.Sort(...) explicitely.

See also the advanced demo (DrawTree.OnHeaderClick).

> This must be a boaring question for you all, isn't it?

No it isn't at all. You asked questions which are related not only to a
quite new control but even to a not yet released version, hence this is
fully justified.

Ciao, Mike


re: Subclassing StringTree: problem with proper ty setting

From: Mike Lischke [public@l...]
Date: Wed Jan 24, 2001 3:23 pm
Subject: RE: [VirtualTreeview] Subclassing StringTree: problem with proper ty setting

> I am using the derived component as every other VCL palette
> control. AFAIK I cannot just introduce a new parent parameter
> to the constructor.

I have already included the check for a valid handle (HandleAllocated) which
should solve this problem elegantly.

> Strange enough: changing for instance the height within the
> constructor of a derived class has never been a problem for
> my previous components. I believe that there must be some magic
> lurking anywhere...

This case here is a bit different. When setting the height of a control does
not mean that its window handle is created. The value is just stored (as it
is now in VT too). The height you have set in the constructor was that of
the header.

Ciao, Mike


re: Catching start of drag

From: "Pete Fraser" [pete.fraser@f...]
Date: Wed Jan 24, 2001 3:25 pm
Subject: Re: Catching start of drag

> Since adding an event does not harm existing implementations in any
way I
> have no problems to publish OnStartDrag and OnEndDrag. My concerns
however
> belong to the ambiguity which raises from this. Both events are
only related
> to a VCL dd operation but will raise the question for getting them
also
> during OLE dd, I'm sure. Every other dd event however is triggered
in both
> situations.

If you published the OnStart/EndDrag events you would then have VCL
events for free. The only code you would have to add would be the OLE
drag and drop events which (I guess) you have code for and therefore
would find easier to implement. (Adding a new event would make it
more 'different' for other users and also mean more code needing to
be written. Using the same event for both types of dnd isn't a
problem is it?)

It also means that I could get going using the 'published' method,
the OLE could be added later when consistency is required.

That's my preferred method anyway <g>

Rgds
Pete


re: Invisible Nodes

From: Mike Lischke [public@l...]
Date: Wed Jan 24, 2001 3:31 pm
Subject: RE: [VirtualTreeview] Invisible Nodes

> I would like to ask the users of VirtualTreeview whether there is a
> need to toggle the visibility (show/hide) of nodes.
>
> I checked the sources an found the procedures getnodeat and
> getnextvisible to be changed accordingly. Also the cache routines and
> the selection would need an update.
> Is an invisible node feature worth the trouble ?

The more I think about this (because it has quite often suggested to me) the
more I think it isn't so hard as I thought initially (and the benefits you
mentioned are acceptable). However it is much more difficult than you see
here. There are other methods concerned like GetNextVisible,
GetPreviousVisible. You have to change the general visibility idea of a node
which is currently that a node is visible if all of its parents are
expanded. Additionally, you have to consider all those cases where an
enumeration happens and this can become especially difficult because in
routines like HandleDrawSelection you have to do an additional test.

Further changes will involve taking the true visibility into account
optionally when it comes to processing ranges of nodes (like in
IterateSubtree, GetSortedSelection, GetNextSelected, GetPreviousSelected
etc.).

What do other user say to the idea?

Ciao, Mike


re: VirtualTreeview is IE4 dependant!

From: "Geoffrey Pan" [gpan@c...]
Date: Wed Jan 24, 2001 3:38 pm
Subject: RE: [VirtualTreeview] VirtualTreeview is IE4 dependant!

Thanks Mike,

Somewhat confused by what you mean by support in the VCL to use either flat
or normal scrollbars, unless you're meaning porting it to use TScrollBar
(please pardon for my ignorance), in tests with VT on IE3.0 (and anything
previously) VT causes the error which was posted in the other message.

Was thinking of adding a DllGetVersion test on comctl32, but the referencing
itself causes the app to not run (probably because the FlatSB_XXX group
isn't exported in anything earlier than 4.72).

Would appreciate any pointers on this. Thanks in advance.

Geoffrey Pan

-----Original Message-----
From: Mike Lischke [mailto:[public@l...]]
Sent: Wednesday, January 24, 2001 8:56 AM
To: 'VirtualTreeview@egroups.com'
Subject: RE: [VirtualTreeview] VirtualTreeview is IE4 dependant!

> Basically VT uses the Flatscrollbar, which is a comctl 4.72
> enhancement. This came with IE 4.0 and better.
>
> Apps that use VT won't run without this comctl update.

Mmm, I didn't expect that there are still Win95 machines without ComCtrl
4.72 or up. But on the other hand I want to make the control as independent
as possible from the system and its configuration. IIRC there is already
support in the VCL to use either flat or normal scrollbars (at least for
Delphi 5, can anybody confirm this for Delphi 4 too?).

Ciao, Mike

To unsubscribe from this group, send an email to:
VirtualTreeview-unsubscribe@egroups.com


re: Unicode under Win98 // Was: Basic printing

From: Mike Lischke [public@l...]
Date: Wed Jan 24, 2001 3:55 pm
Subject: RE: [VirtualTreeview] Unicode under Win98 // Was: Basic printing

Hi Dieter,

> Can one use e.g. Hebrew and Western Scripts in one and the same
> TVirtualStringTree entry under Win98? If not under Win98,
> then under Win2000,
> etc.?

In short: yes it is or will be possible.

Basically, all my efforts regarding Unicode (and that is currently my main
task, not VT as you might think :-) because the JCL which contains my
Unicode unit is soon to be released in version 1.0), all my efforts have
been also targetted at the little brothers of Windows (Win9x and WinME) too.
By looking at the advanced demo under Win95 you will see it works beautiful.
See also my Unicode page www.lischke-online.de/Unicode.html.

> What about bi-directonality and normalization of
> combining characters?
> Is there a good web-site which covers all these "How to use Unicode in
> Delphi"-issues in detail?

Unfortunately, there are no other sites known to me which deal with Unicode
in Delphi other than mine (on a free basis, see http://www.lingscape.com/
for a commercial libary). Earl F. Glynn has created a small project (see
http://www.efg2.com/lab/OtherProjects/Unicode.htm) which uses, however,
mainly my experiences (I had quite some conversation with Earl at the time
he made the example). But in his typical (and excellent) manner he collect
links to more resources which might be useful for you too.

The tree itself will not generally take care about normalization as its task
is to display a hierarchical structure not to do string manipulation (except
ShortenString, for this it might become necessary to include some
normalization support, think of left hand side arabic string shortage).

Usually an application should only store normalized strings if this is
important (e.g. for collation). Additionally the operating system supports a
kind of in-place combining if a string consists, say, of a base character
and a combining character like a diacritical mark (e.g. n¸) which will then
automatically combined by ExtTextOutW. From this support can (and will) also
VT profit.

Ciao, Mike


re: VirtualTreeview is IE4 dependant!

From: Mike Lischke [public@l...]
Date: Wed Jan 24, 2001 4:08 pm
Subject: RE: [VirtualTreeview] VirtualTreeview is IE4 dependant!

> Somewhat confused by what you mean by support in the VCL to
> use either flat or normal scrollbars, unless you're meaning
> porting it to use TScrollBar (please pardon for my ignorance),
> in tests with VT on IE3.0 (and anything
> previously) VT causes the error which was posted in the other message.

In Delphi 5 (but not Delphi 4 I believe) there is a unit FlatSB.pas which is
a wrapper around the flat scrollbar APIs with fallback to normal scroll bars
if necessary. You could do a little test for me so I know it works. Please
go to the uses clause in the implementation section of VirtualTrees.pas and
insert (just after CommCtrl.pas) the FlatSB.pas unit. CommCtrl should be
left in for the moment to have some constants still declared. The result
should look like:

..
implementation

{$R VirtualTrees.res}

uses
Consts, Math, ShlObj, CommCtrl, FlatSB;

resourcestring
..

Since VT does now work with FlatSB.pas there should be no more static links
to the flat scrollbar APIs. Compile a demo with this change and see if it
works on the system in question.

Ciao, Mike

 | Replies | Author | Date
282 | Re: VirtualTreeview is IE4 dependant! | Geoffrey Pan | Wed 1/24/2001
284 | Re: VirtualTreeview is IE4 dependant! | Mike Lischke | Wed 1/24/2001


re: Re: Catching start of drag

From: Mike Lischke [public@l...]
Date: Wed Jan 24, 2001 4:32 pm
Subject: RE: [VirtualTreeview] Re: Catching start of drag

> If you published the OnStart/EndDrag events you would then have VCL
> events for free. The only code you would have to add would be the OLE
> drag and drop events which (I guess) you have code for and therefore
> would find easier to implement. (Adding a new event would make it
> more 'different' for other users and also mean more code needing to
> be written. Using the same event for both types of dnd isn't a
> problem is it?)

Well, then I would have two begin drag methods, one for VCL dd and one for
OLE dd. Shouldn't there be a single event?

Ciao, Mike

 | Replies | Author | Date
287 | Re: Catching start of drag | Pete Fraser | Thu 1/25/2001
305 | Re: Catching start of drag | Mike Lischke | Fri 1/26/2001


re: VirtualTreeview is IE4 dependant!

From: "Geoffrey Pan" [gpan@c...]
Date: Wed Jan 24, 2001 4:56 pm
Subject: RE: [VirtualTreeview] VirtualTreeview is IE4 dependant!

Works great Mike, VT runs on 4.00.0950 (clean install) with no IE with that
unit added to the implements. Thanks again.

Geoffrey Pan

-----Original Message-----
From: Mike Lischke [mailto:[public@l...]]
Sent: Wednesday, January 24, 2001 10:09 AM
To: 'VirtualTreeview@egroups.com'
Subject: RE: [VirtualTreeview] VirtualTreeview is IE4 dependant!

> Somewhat confused by what you mean by support in the VCL to
> use either flat or normal scrollbars, unless you're meaning
> porting it to use TScrollBar (please pardon for my ignorance),
> in tests with VT on IE3.0 (and anything
> previously) VT causes the error which was posted in the other message.

In Delphi 5 (but not Delphi 4 I believe) there is a unit FlatSB.pas which is
a wrapper around the flat scrollbar APIs with fallback to normal scroll bars
if necessary. You could do a little test for me so I know it works. Please
go to the uses clause in the implementation section of VirtualTrees.pas and
insert (just after CommCtrl.pas) the FlatSB.pas unit. CommCtrl should be
left in for the moment to have some constants still declared. The result
should look like:

..
implementation

{$R VirtualTrees.res}

uses
Consts, Math, ShlObj, CommCtrl, FlatSB;

resourcestring
..

Since VT does now work with FlatSB.pas there should be no more static links
to the flat scrollbar APIs. Compile a demo with this change and see if it
works on the system in question.

Ciao, Mike

To unsubscribe from this group, send an email to:
VirtualTreeview-unsubscribe@egroups.com

 | Replies | Author | Date
284 | Re: VirtualTreeview is IE4 dependant! | Mike Lischke | Wed 1/24/2001


re: Version 2.0 prerelease

From: Werner Lehmann [wl@b...]
Date: Wed Jan 24, 2001 6:42 pm
Subject: Re: [VirtualTreeview] Version 2.0 prerelease

Mike Lischke wrote:
>
> thank you very much for your extensive test and bug report! See below for my
> comments:

you're welcome. After all of your work a test is the least I can do.

> Actually, the drop mark is shown by default. But in existing projects where
> Tree.Options has already been saved to DFM this is ignored. Instead the
> saved data will be loaded of course. Whilst removing an option is quite bad
...
> alphabetical order of the participating identifiers. If you now add a new
> identifier which is alphabetically somewhere inbetween it will automatically
> cause all entries following it (alphabetically) to move one bit "up".
...
> set, although it has not been there when you saved Options. The reason is
> that the bit which was voShowHorzGridLine (and which was set) is now
> interpreted as being voShowDropmark.

Yes, I know all that stuff about the internal representation of enums. For some
time now I am saving all my enumerated types as strings to avoid this problem
and
to have a more readable representation in the registry / the ini file /
whatever.
You probably know the SetString unit by Ray Lischner? It's quite useful for
that.
And the DFM contains (AFAIK) the info in the same format.

> ParentColor is True when the control should use the same color as its
> parent. This does not apply to VT because it used clWindow as default while
> its parent (usually a form or panel) uses clBtnFace as default.
> ParentColor's default value is True for TControl and is saved to DFM if it
> is True at design time. Now I need it to be False (otherwise it will reset
> the tree's color) and have so to give it as default value False to have it
> stored when it is True (in which case the setting in the tree constructor
> for ParentColor := False is changed to True).

Lol. Thanks for clarifying this (uhm, at least on second read it became somewhat
clear to me :)

> My intention was to limit the number of visible glyphs on the right hand
> side if the sort glyph is shown. Well, I will have to redesign glyph
> placing...

Hm, it is my belief that as long as the glyphs can be assigned by imagelist and
/or sorting glyph they should show properly...

> Sorting a column and showing that it is sorted is not the same. It could
> well be that somebody wants to auto sort a certain column without showing
> the sort glyph.

I see. Ok then. Was not taking the AutoSort feature into account.

> This is strange. I checked this a could not reproduce this behaviour. Can
> you make me a small demo showing it?

I'll try. Of course my project moved on since then....

> Thank you, I will consider your suggestions. I'm not sure, however, if this
> will make its way into version 2.0.

I will have the need to show right aligned number columns. I have not yet
investigated
on how to do it. But it is not very urgent :)

> Comma align arrangements are quite difficult, though not impossible. The
> main problem is that the width of the characters in a font differs so you
> have to calculate the start position of a string from a right hand (comma)
> position. I will think about this feature when I implement right-to-left
> alignment for arabic and hebrew bidi settings.

I don't worry so much about comma alignment. Even with a proportional font like
Arial I get this for free: all digits are of the same width. If I display all
numbers with equally sized mantissa (two decimal digits for instance) the comma
alignment needs no special consideration. It's just the need for a right-aligned
text. Somewhere in the code I have seen parts which may deal with that but I
have to look deeper in this... or you could just say if you have a simple
alignment
already built-in?

> I know somebody would request this some day :-P The main argument speaking

Hehe :)

> *for* implementing it is that you can nicely blend out the drag image and
> can keep it small (which will be a great speed improvement for large tree
> windows). The main argument *against* it is that I have to change the drag
> image implementation quite a lot. Since necessary work was never a reason
> for me no to start doing things the latter argument is not something wich
> will prevent the implementation. It is actually the time needed to do so.
> I'll take the suggestion into the Todo list.

I did not examine the drag image creation routine in detail but isn't it
possible
to just let that function do its stuff (unchanged with the exception of the last
and potentially cut-off item) and then just do a radial (or whatever) blend-out
from some coordinates (the selection anchor) to the borders? I am not so into
this graphics matter though and don't know how to do this *fast*.

> > I did not find problems with it unless it is intended that
> > the trees should be
> > able to accept (and include in the tree) files being dragged
> > from explorer.
>
> Yes, this is intended. Nice feature, isn't it ;-) ? You can even select and
> drag text from IE or Word to the trees and a node with the text will be
> added.

Nice yes. And notice the 'unless': it is not working for me :| But I may
triple-check.

Regards,
WL


re: VirtualTreeview is IE4 dependant!

From: "Mike Lischke" [public@l...]
Date: Wed Jan 24, 2001 7:27 pm
Subject: RE: [VirtualTreeview] VirtualTreeview is IE4 dependant!

> Works great Mike, VT runs on 4.00.0950 (clean install) with no IE with that
> unit added to the implements. Thanks again.

Excellent news :-)

Ciao, Mike


Background/ invisible nodes

From: [jens.treichler@u...]
Date: Wed Jan 24, 2001 11:24 pm
Subject: Background/ invisible nodes

Hi Mike,

It would be nice to have the current erased row from the top of
the current view as parameter in BeforeItemErase. I'm not
sure if the total row index is of much help, because one might
expand a node not currently in view, which will limit the
benefit of this parameter.
I found another effect. When resizing a Vtree with
a splitter, repaint (but not resize) will stop when the cursor,
while on the splitter and LBDown, is reaching a node with a just
appearing tooltip/hint.
Last one is about the partial redraw while scrolling.
This is ok when using the scrollbars. But when using a wheel mouse
tree never get the appropriate scoll messages (SB_ENDSCROLL ?)
thus leading to incorrectly drawn item backgrounds. Could you check
that, because wheel mouse is becoming a kind of standard these days.

I thought about the show/hide node thing. I would suggest to make it
an option, like VsDisabled. This flag would only be of influence to
view. For all other task (selection,drag etc) the application could
check , if necessary , for this flag and decide what to do
with hidden nodes. Does this make implementation easier ?
Jens

 | Replies | Author | Date
303 | Re: Background/ invisible nodes | Mike Lischke | Fri 1/26/2001
347 | Re: Background/ invisible nodes | [jens.treichler@u...] | Sun 1/28/2001
349 | Re: Background/ invisible nodes | Mike Lischke | Sun 1/28/2001
353 | Re: Background/ invisible nodes | [jens.treichler@u...] | Sun 1/28/2001
357 | Re: Background/ invisible nodes | Mike Lischke | Mon 1/29/2001


Marquee/lasso select?

From: "Anthony Mills" [amills@m...]
Date: Thu Jan 25, 2001 1:23 am
Subject: Marquee/lasso select?

Mike, I'm more impressed with your control (and its associated Web page)
than I have ever been with any control, period.

Given the flexibility of VirtualTreeview, I've taken to converting some of
the listviews in my app to VTs. Here are the issues concerning that (I'm
using the version 2.0 beta posted to eGroups):

* No right-aligning of columns
* No marquee/lasso selection
* VCL drag 'n' drop doesn't seem to be quite there yet (OnDragOver isn't
giving me a proper Source value); converting to OLE dd would require a fair
number of code changes
* When voRightClickSelect is on and the user right-clicks on a multiple
selection, it shouldn't deselect the other selected items

Glad to hear you're going after right-aligning columns bit (and relieved
that you solved the header streaming problem!).

Regards,

Tony

 | Replies | Author | Date
304 | Re: Marquee/lasso select? | Mike Lischke | Fri 1/26/2001


re: Catching start of drag

From: "Pete Fraser" [pete.fraser@f...]
Date: Thu Jan 25, 2001 9:53 am
Subject: Re: Catching start of drag

--- In [VirtualTreeview@egroups.com, Mike Lischke <public@l...] wrote:
> > If you published the OnStart/EndDrag events you would then have
VCL
> > events for free. The only code you would have to add would be the
OLE
> > drag and drop events which (I guess) you have code for and
therefore
> > would find easier to implement. (Adding a new event would make it
> > more 'different' for other users and also mean more code needing
to
> > be written. Using the same event for both types of dnd isn't a
> > problem is it?)
>
> Well, then I would have two begin drag methods, one for VCL dd and
one for
> OLE dd. Shouldn't there be a single event?
>
> Ciao, Mike

Can't the OLE dnd call the VCL dnd events?
The only difference would be that you would get sent an event with
the 'TObject' Sender etc.

Rgds Pete

 | Replies | Author | Date
305 | Re: Catching start of drag | Mike Lischke | Fri 1/26/2001


re: Drag and Drop - VCL style

From: "Pete Fraser" [pete.fraser@f...]
Date: Thu Jan 25, 2001 1:24 pm
Subject: Re: Drag and Drop - VCL style

Things are never as simple as they seem :(
Making the OnStartDrag event published in VirtualStringTree doesn't
work properly as the event gets called whenever the tree's focused
node is changed :(
On the VCL tree, and in fact other components, this event only gets
called when the mouse actually starts to move the node.
I'm going to investigate why this happens and try to provide a fix.
If anyone else has found a fix please could they let me know.

Rgds Pete

 | Replies | Author | Date
289 | Re: Drag and Drop - VCL style | Bender Heri | Thu 1/25/2001
290 | Re: Drag and Drop - VCL style | Pete Fraser | Thu 1/25/2001
307 | Re: Drag and Drop - VCL style | Mike Lischke | Fri 1/26/2001
291 | Re: Drag and Drop - VCL style | Pete Fraser | Thu 1/25/2001
312 | Re: Drag and Drop - VCL style | Mike Lischke | Fri 1/26/2001
295 | Best way to determine column clicked on? | Geoffrey Pan | Thu 1/25/2001
296 | Updating imageindex | Geoffrey Pan | Thu 1/25/2001
311 | Re: Drag and Drop - VCL style | Mike Lischke | Fri 1/26/2001


re: Re: Drag and Drop - VCL style

From: Bender Heri [HBender@E...]
Date: Thu Jan 25, 2001 1:38 pm
Subject: RE: [VirtualTreeview] Re: Drag and Drop - VCL style

If the DragMode of a control is dmManual then you have to assign a event
handler OnMouseDown. There you can call Control.BeginDrag(False,5). The
first parameter says to not begin immediatly, the second says it should
begin after the user has moved 5 pixels. In either case the StartDrag event
is called just after the call to BeginDrag.

Heri

> -----Original Message-----
> From: Pete Fraser [mailto:[pete.fraser@f...]]
> Sent: Thursday, January 25, 2001 2:25 PM
> To: VirtualTreeview@egroups.com
> Subject: [VirtualTreeview] Re: Drag and Drop - VCL style
>
>
> Things are never as simple as they seem :(
> Making the OnStartDrag event published in VirtualStringTree doesn't
> work properly as the event gets called whenever the tree's focused
> node is changed :(
> On the VCL tree, and in fact other components, this event only gets
> called when the mouse actually starts to move the node.
> I'm going to investigate why this happens and try to provide a fix.
> If anyone else has found a fix please could they let me know.
>
> Rgds Pete
>
>
> To unsubscribe from this group, send an email to:
> VirtualTreeview-unsubscribe@egroups.com
>
>
>

 | Replies | Author | Date
290 | Re: Drag and Drop - VCL style | Pete Fraser | Thu 1/25/2001
307 | Re: Drag and Drop - VCL style | Mike Lischke | Fri 1/26/2001
291 | Re: Drag and Drop - VCL style | Pete Fraser | Thu 1/25/2001
312 | Re: Drag and Drop - VCL style | Mike Lischke | Fri 1/26/2001


re: Drag and Drop - VCL style

From: "Pete Fraser" [pete.fraser@f...]
Date: Thu Jan 25, 2001 4:40 pm
Subject: Re: Drag and Drop - VCL style

Thanks for the suggestion. This is what I'll have to do for the
moment.

Mike,
It would be nice to get this to work properly. At present the
BeginDrag call is made when the node is selected, but should only
happen when the mouse is actually moved. I think this is where the
problem is.
I have created a simple example using your tree and the standard tree
and tried to compare the two stacks when performing a drag operation
and this is what I've found. Not sure how to fix it though :( Needs
more work.
Rgds Pete

--- In [VirtualTreeview@egroups.com, Bender Heri [HBender@E...] wrote:
> If the DragMode of a control is dmManual then you have to assign a
event
> handler OnMouseDown. There you can call Control.BeginDrag(False,5).
The
> first parameter says to not begin immediatly, the second says it
should
> begin after the user has moved 5 pixels. In either case the
StartDrag event
> is called just after the call to BeginDrag.
>
> Heri
>
> > -----Original Message-----
> > From: Pete Fraser [mailto:pete.fraser@f...]]
> > Sent: Thursday, January 25, 2001 2:25 PM
> > To: VirtualTreeview@egroups.com
> > Subject: [VirtualTreeview] Re: Drag and Drop - VCL style
> >
> >
> > Things are never as simple as they seem :(
> > Making the OnStartDrag event published in VirtualStringTree
doesn't
> > work properly as the event gets called whenever the tree's
focused
> > node is changed :(
> > On the VCL tree, and in fact other components, this event only
gets
> > called when the mouse actually starts to move the node.
> > I'm going to investigate why this happens and try to provide a
fix.
> > If anyone else has found a fix please could they let me know.
> >
> > Rgds Pete
> >
> >
> > To unsubscribe from this group, send an email to:
> > VirtualTreeview-unsubscribe@egroups.com
> >
> >
> >

 | Replies | Author | Date
307 | Re: Drag and Drop - VCL style | Mike Lischke | Fri 1/26/2001


re: Drag and Drop - VCL style

From: "Pete Fraser" [pete.fraser@f...]
Date: Thu Jan 25, 2001 5:15 pm
Subject: Re: Drag and Drop - VCL style

--- In [VirtualTreeview@egroups.com, Bender Heri <HBender@E...] wrote:
> If the DragMode of a control is dmManual then you have to assign a
event
> handler OnMouseDown. There you can call Control.BeginDrag(False,5).
The
> first parameter says to not begin immediatly, the second says it
should
> begin after the user has moved 5 pixels. In either case the
StartDrag event
> is called just after the call to BeginDrag.

That was almost right but not quite.
You must catch MouseMove messages and if you get one with the Left
mouse button held down, then call BeginDrag - in TControl NOT
VirtualStringTree(which is protected anyway).

I think this needs fixing in dmAutomatic mode when VCL dragging is in
force.

Rgds Pete


TVTHeader Columns

From: Tony Cardalda [software@z...]
Date: Thu Jan 25, 2001 5:27 pm
Subject: TVTHeader Columns

Hi there!

Is it possible for you to display the TVTHeader.Columns.Text instead of
'column 0..x' when editing the collectionItems ?

Gracias,
TC

 | Replies | Author | Date
313 | Re: TVTHeader Columns | Mike Lischke | Fri 1/26/2001
368 | Re: TVTHeader Columns | Werner Lehmann | Wed 1/31/2001
373 | Re: TVTHeader Columns | Mike Lischke | Wed 1/31/2001
375 | Re: TVTHeader Columns | Werner Lehmann | Wed 1/31/2001
376 | Re: TVTHeader Columns | Mike Lischke | Wed 1/31/2001


AV on AddChild

From: Tony Cardalda [software@z...]
Date: Thu Jan 25, 2001 5:55 pm
Subject: AV on AddChild

When initializing a VirtualStringTree with

vt.RootNodeCount := 10

everything goes fine

but when I add a root-node by

vt.RootNodeCount := vtRootNodeCount + 1;

or

vt.AddChild(nil);

and I move down to the newly inserted item (gettext only prints the
Index)
then I get an AV.

The debugger stops at line 16113 in VirtualTrees.pas (2.0; 14-jan)
on procedure TBaseVirtualTree.SetChildCount at the following line:

Node.LastChild := Child.PrevSibling;

Do I have to do something after adding new rootnodes?

Thanks,
TC.

 | Replies | Author | Date
294 | Re: AV on AddChild | Geoffrey Pan | Thu 1/25/2001
314 | Re: AV on AddChild | Mike Lischke | Fri 1/26/2001


re: AV on AddChild

From: "Geoffrey Pan" [gpan@c...]
Date: Thu Jan 25, 2001 7:07 pm
Subject: RE: [VirtualTreeview] AV on AddChild

Did you populate data for the node, in InitNodeData. Remember that VT pulls
the data in as it needs it. Rootnodecount change causes InitNode to get
fired, and then GetNodeText to be fired if its visible.

-----Original Message-----
From: Tony Cardalda [mailto:[software@z...]]
Sent: Thursday, January 25, 2001 11:55 AM
To: 'VirtualTreeview@egroups.com'
Subject: [VirtualTreeview] AV on AddChild

When initializing a VirtualStringTree with

vt.RootNodeCount := 10

everything goes fine

but when I add a root-node by

vt.RootNodeCount := vtRootNodeCount + 1;

or

vt.AddChild(nil);

and I move down to the newly inserted item (gettext only prints the
Index)
then I get an AV.

The debugger stops at line 16113 in VirtualTrees.pas (2.0; 14-jan)
on procedure TBaseVirtualTree.SetChildCount at the following line:

Node.LastChild := Child.PrevSibling;

Do I have to do something after adding new rootnodes?

Thanks,
TC.

To unsubscribe from this group, send an email to:
VirtualTreeview-unsubscribe@egroups.com


Best way to determine column clicked on?

From: "Geoffrey Pan" [gpan@c...]
Date: Thu Jan 25, 2001 7:08 pm
Subject: Best way to determine column clicked on?

Would appreciate any comments on the best way to determine which column is
clicked on, can't seem to find a event that carries that info.

Thanks,
Geoffrey Pan

 | Replies | Author | Date
296 | Updating imageindex | Geoffrey Pan | Thu 1/25/2001


Updating imageindex

From: "Geoffrey Pan" [gpan@c...]
Date: Thu Jan 25, 2001 8:20 pm
Subject: Updating imageindex

Mike,

Is there any method to update a node's image index after its been added?
(without deleting the node first). Actually this applied to updating any
part of a node's data.

Thanks in advance.

Geoffrey Pan.


re: Updating imageindex

From: Werner Lehmann [wl@b...]
Date: Thu Jan 25, 2001 9:39 pm
Subject: Re: [VirtualTreeview] Updating imageindex

Geoffrey Pan wrote:
>
> Is there any method to update a node's image index after its been added?
> (without deleting the node first). Actually this applied to updating any
> part of a node's data.

We already had that topic. I wrote InvalidateNode at that time and this
works (at least) for me...

Regards,
WL


re: Best way to determine column clicked on?

From: Werner Lehmann [wl@b...]
Date: Thu Jan 25, 2001 9:39 pm
Subject: Re: [VirtualTreeview] Best way to determine column clicked on?

Geoffrey Pan wrote:
>
> Would appreciate any comments on the best way to determine which column is
> clicked on, can't seem to find a event that carries that info.

OnHeaderClick?

Or do you really mean the column? Then try GetHitTestInfoAt.

Regards,
WL


Catch 22?

From: "adem baba" [adembaba@e...]
Date: Fri Jan 26, 2001 12:35 am
Subject: Catch 22?

Mike,

Your site names Jedi as then new home; when I go to Jedi (whose site
badly needs a re-design) and try to locate VT, I am pointed back to
your site...

You might make the excersise a liitle more fun by placing a link to
http://www.delphi-jedi.org/Jedi:VCLCOMPONENTS:36152
which is where they link back to your page
http://www.lischke-online.de/VirtualTreeview.html

But, what I would do is this: put a pointer at your
site to http://www.egroups.com/group/VirtualTreeview
after all this is where all the action is.

Cheers,

 | Replies | Author | Date
310 | Re: Catch 22? | Mike Lischke | Fri 1/26/2001
319 | Re: Catch 22? | [adembaba@e...] | Fri 1/26/2001
326 | Re: Catch 22? | Mike Lischke | Sat 1/27/2001
2235 | Struggling with upgrade 1.31 -> 2.4.21 | Will Watts | Wed 6/6/2001
2236 | Re: Struggling with upgrade 1.31 -> 2.4.21 | Jim Kueneman | Wed 6/6/2001


Bug in BeginUpdate/EndUpdate general area

From: "Anthony Mills" [amills@m...]
Date: Fri Jan 26, 2001 2:44 am
Subject: Bug in BeginUpdate/EndUpdate general area

http://209.91.76.202/treeviewbug.gif

Data in this treeview is accessed through a couple levels of indirection,
and I accomplish sorting the treeview by sorting one of the levels of
pointers inside a BeginUpdate / EndUpdate pair.

This works, except VirtualStringTree doesn't seem to recalculate the node
screen areas correctly; each node is limited to the screen length of the
original text string. The actual text changes, but ellipses show up. When
the nodes in question are selected, the full text reappears.

Is this related to the fact that the nodes' local data records don't change
during the sort?

Regards,

Tony

 | Replies | Author | Date
308 | Re: Bug in BeginUpdate/EndUpdate general area | Mike Lischke | Fri 1/26/2001


My mistake

From: Tony Cardalda [software@z...]
Date: Fri Jan 26, 2001 11:01 am
Subject: My mistake

Shoot!
I found the error of the AV in RootNodeCount.

I filled it with some Collection.Count -1;
And filling in a negative number will result in a AV;
please replace the first line of SetChildCount in:

begin
if NewChildCount <= 0 then
DeleteChildren(Node)
else
begin

But fortunately I found another bug (-:

When setting the first column to Autosize; some text's will be
abbreviated; even if there is enough space. When clicking on the item,
the full text is shown.

Also; when TVTHeader columns are defined; wouldn't it be nice to let
them popup when doubleclicking the VST in the IDE instead of generating
a FldChange() event?

Hasta la pasta,

TC.

 | Replies | Author | Date
306 | Re: My mistake | Mike Lischke | Fri 1/26/2001
354 | Re: My mistake | Tony Cardalda | Mon 1/29/2001
358 | Re: My mistake | Mike Lischke | Mon 1/29/2001
369 | Re: My mistake | Werner Lehmann | Wed 1/31/2001
370 | Re: My mistake | Werner Lehmann | Wed 1/31/2001


Bug in EditNode

From: Tony Cardalda [software@z...]
Date: Fri Jan 26, 2001 12:21 pm
Subject: Bug in EditNode

On a fresh TVirtualStringTree
(no headercolumns)

the following code results in a "List Index out of bounds(0)".

var
Node: PVirtualNode
begin
Node := VST.AddChild(nil);
VST.EditNode(Node, 0);
end;

The editnode tries to obtain rect (GetDisplayRect)
on line 13874 at:
FHeader.FColumns.GetColumnBounds(Column, Result.Left,
Result.Right);

of course, I should have passed -1 as a parameter; but an extra check
would prevent an error.
However, technically spoken the zero is correct; I meant column 0 (the
first one), so may be it's better to accept the 0 parameter and handle
it properly in the EditNode proc.

Ciao,

TC.

 | Replies | Author | Date
309 | Re: Bug in EditNode | Mike Lischke | Fri 1/26/2001


re: Background/ invisible nodes

From: "Mike Lischke" [public@l...]
Date: Fri Jan 26, 2001 12:32 pm
Subject: RE: [VirtualTreeview] Background/ invisible nodes

Hi Jens,

> It would be nice to have the current erased row from the top of
> the current view as parameter in BeforeItemErase. I'm not
> sure if the total row index is of much help, because one might
> expand a node not currently in view, which will limit the
> benefit of this parameter.

I'm not sure if there really would be a benefit at all when including such a
parameter. Have you
tried Tree.GetDisplayRect to determine a nodes bounds.

> I found another effect. When resizing a Vtree with
> a splitter, repaint (but not resize) will stop when the cursor,
> while on the splitter and LBDown, is reaching a node with a just
> appearing tooltip/hint.

This is not a bug of VT but appears with every VCL control with enabled hints.
There must be a bug
in the splitter implementation.

> Last one is about the partial redraw while scrolling.
> This is ok when using the scrollbars. But when using a wheel mouse
> tree never get the appropriate scoll messages (SB_ENDSCROLL ?)
> thus leading to incorrectly drawn item backgrounds.

This one is something I can't reproduce. E.g. in the advanced demo I can set a
background and it
will draw correctly also when scrolling with the wheel.

> I thought about the show/hide node thing. I would suggest to make it
> an option, like VsDisabled. This flag would only be of influence to
> view. For all other task (selection,drag etc) the application could
> check , if necessary , for this flag and decide what to do
> with hidden nodes. Does this make implementation easier ?

Not at all, sorry. An additional option makes it even more difficult. I would
have to make first a
full implementation and then switch off some parts conditionally.

Ciao, Mike

 | Replies | Author | Date
347 | Re: Background/ invisible nodes | [jens.treichler@u...] | Sun 1/28/2001
349 | Re: Background/ invisible nodes | Mike Lischke | Sun 1/28/2001
353 | Re: Background/ invisible nodes | [jens.treichler@u...] | Sun 1/28/2001


re: Marquee/lasso select?

From: "Mike Lischke" [public@l...]
Date: Fri Jan 26, 2001 12:32 pm
Subject: RE: [VirtualTreeview] Marquee/lasso select?

Hi Anthony,

> Mike, I'm more impressed with your control (and its associated Web page)
> than I have ever been with any control, period.

<red face> Oh, thank you </red face> :o]

> * No right-aligning of columns

This is on the todo list.

> * No marquee/lasso selection

Hu? Of course is there a marquee. Please see the demos (e.g. the Minimal
project) which show clearly
how to select several nodes with the mouse using a selection rectangle.

> * VCL drag 'n' drop doesn't seem to be quite there yet (OnDragOver isn't
> giving me a proper Source value); converting to OLE dd would require a fair
> number of code changes

This is currently under investigation. Version 2.0 of VT will have VCL dd.

> * When voRightClickSelect is on and the user right-clicks on a multiple
> selection, it shouldn't deselect the other selected items

Depends. The option voRightClickSelect means that the right mouse button will
behave in most aspects
like the left mouse button (actually the second mouse button will behave like
the first one). This
includes of course removing the current selection.

Ciao, Mike

Dipl. Ing. Mike Lischke
Senior software developer
--
Homepage: http://www.lischke-online.de
GraphicEx: http://www.lischke-online.de/Graphics.html
Virtual Treeview: http://www.lischke-online.de/VirtualTreeview.html
Unicode Edit and library: http://www.lischke-online.de/Unicode.html


re: Re: Catching start of drag

From: "Mike Lischke" [public@l...]
Date: Fri Jan 26, 2001 12:32 pm
Subject: RE: [VirtualTreeview] Re: Catching start of drag

> Can't the OLE dnd call the VCL dnd events?
> The only difference would be that you would get sent an event with
> the 'TObject' Sender etc.

The OnStartDrag event comes with a parameter DragObject which can be set by the
application. This
must still be possible as well as handled when called by OLE dd (where it makes
no sense, btw.). On
the other hand having the data object passed there could be useful at times,
but is not so
important.

Ciao, Mike


re: My mistake

From: "Mike Lischke" [public@l...]
Date: Fri Jan 26, 2001 2:51 pm
Subject: RE: [VirtualTreeview] My mistake

> I filled it with some Collection.Count -1;
> And filling in a negative number will result in a AV;
> please replace the first line of SetChildCount in:
>
> begin
> if NewChildCount <= 0 then
> DeleteChildren(Node)
> else
> begin

What version of VT do you have Tony? The code should look like:

procedure TBaseVirtualTree.SetRootNodeCount(Value: Cardinal);

begin
// don't set the root node count until all other properties (in particular
the OnInitNode event)
have been set
if csLoading in ComponentState then
FRoot.ChildCount := Value
else
if FRoot.ChildCount <> Value then
begin
BeginUpdate;
InterruptValidation;
SetChildCount(FRoot, Value);
EndUpdate;
end;
end;

and Value is defined as cardinal so it can never become negative.

> When setting the first column to Autosize; some text's will be
> abbreviated; even if there is enough space. When clicking on the item,
> the full text is shown.

Does not happen in Advanced demo (properties tree), so could you please make a
small demo...

> Also; when TVTHeader columns are defined; wouldn't it be nice to let
> them popup when doubleclicking the VST in the IDE instead of generating
> a FldChange() event?

I'm not sure if I get this. Do you mean the event handler which is
automatically inserted into the
source code when double clicking the control? If yes then sorry, but I have no
intention to write
also a component editor...

Ciao, Mike


re: Re: Drag and Drop - VCL style

From: "Mike Lischke" [public@l...]
Date: Fri Jan 26, 2001 2:51 pm
Subject: RE: [VirtualTreeview] Re: Drag and Drop - VCL style

> It would be nice to get this to work properly. At present the
> BeginDrag call is made when the node is selected, but should only
> happen when the mouse is actually moved. I think this is where the
> problem is.

Somehow there is something strange. I get totally different (and consistent)
results. I have used a
button and assigned an OnStartDrag handler with break point as well as
dmAutomatic. As soon as I
press the left mouse button I get the event. This happens also when I use
dmManual and a
BeginDrag(False/True) call. This does confirm the correct behaviour of VT as
well as my
expectations.

I had the impression (and it is confirmed now) that BeginDrag is not called
first after the mouse
has moved a bit. I don't know what you expect as all works as it "always" was.
BeginDrag is always
called in the left mouse button down handling process, this is in VT so, in
TButton so and is also
in TTreeview so...

Ciao, Mike


re: Bug in BeginUpdate/EndUpdate general area

From: "Mike Lischke" [public@l...]
Date: Fri Jan 26, 2001 2:51 pm
Subject: RE: [VirtualTreeview] Bug in BeginUpdate/EndUpdate general area

Hi Anthony,

> Data in this treeview is accessed through a couple levels of indirection,
> and I accomplish sorting the treeview by sorting one of the levels of
> pointers inside a BeginUpdate / EndUpdate pair.
>
> This works, except VirtualStringTree doesn't seem to recalculate the node
> screen areas correctly; each node is limited to the screen length of the
> original text string. The actual text changes, but ellipses show up. When
> the nodes in question are selected, the full text reappears.

Wrong caption lengths (perhaps with improper ellipsises) are almost always an
indication that the
text of a node has changed without letting the string tree know which needs to
update the internal
node width value.

When sorting a tree however this should never become a problem because the
nodes each as a whole is
moved not only parts of it. Actually, you don't need to move around your data
when trying to sort a
tree (unless the default handling is not enough for you), but just implement a
OnCompareNodes event
which must return whether two given nodes are considered as being equal, the
first is larger or the
first is smaller. What criterion you consider to decide which node is larger
than another is totally
up to you but you don't need to move things around. The tree will take care of
this. It will even
care about sorting in ascending or descending order, your compare function
should always compare as
would it be in ascending order.

Ciao, Mike


re: Bug in EditNode

From: "Mike Lischke" [public@l...]
Date: Fri Jan 26, 2001 2:51 pm
Subject: RE: [VirtualTreeview] Bug in EditNode

> of course, I should have passed -1 as a parameter; but an extra check
> would prevent an error.
> However, technically spoken the zero is correct; I meant column 0 (the
> first one), so may be it's better to accept the 0 parameter and handle
> it properly in the EditNode proc.

Thank you Tony. But instead of an extra check I have included assertions to get
a valid node and a
valid column.

Ciao, Mike


re: Catch 22?

From: "Mike Lischke" [public@l...]
Date: Fri Jan 26, 2001 2:51 pm
Subject: RE: [VirtualTreeview] Catch 22?

Hi Adem,

> Your site names Jedi as then new home;

So? Where does it mention JEDI as new home? I can't find anything like this on
my pages.

> when I go to Jedi (whose site badly needs a re-design)

yep, I know. Our web team is working on this.

> and try to locate VT, I am pointed back to your site...

And, what is your problem with this? Currently the membership of controls and
components is merely
determine by listing the link and a short description about the stuff on the
JEDI site.

Ciao, Mike

 | Replies | Author | Date
319 | Re: Catch 22? | [adembaba@e...] | Fri 1/26/2001
326 | Re: Catch 22? | Mike Lischke | Sat 1/27/2001
2235 | Struggling with upgrade 1.31 -> 2.4.21 | Will Watts | Wed 6/6/2001
2236 | Re: Struggling with upgrade 1.31 -> 2.4.21 | Jim Kueneman | Wed 6/6/2001


re: Re: Drag and Drop - VCL style

From: "Mike Lischke" [public@l...]
Date: Fri Jan 26, 2001 2:51 pm
Subject: RE: [VirtualTreeview] Re: Drag and Drop - VCL style

> Things are never as simple as they seem :(
> Making the OnStartDrag event published in VirtualStringTree doesn't
> work properly as the event gets called whenever the tree's focused
> node is changed :(
> On the VCL tree, and in fact other components, this event only gets
> called when the mouse actually starts to move the node.
> I'm going to investigate why this happens and try to provide a fix.
> If anyone else has found a fix please could they let me know.

Ok, let me know what you find out.

Ciao, Mike


re: Re: Drag and Drop - VCL style

From: "Mike Lischke" [public@l...]
Date: Fri Jan 26, 2001 2:51 pm
Subject: RE: [VirtualTreeview] Re: Drag and Drop - VCL style

> If the DragMode of a control is dmManual then you have to assign a event
> handler OnMouseDown. There you can call Control.BeginDrag(False,5). The
> first parameter says to not begin immediatly, the second says it should
> begin after the user has moved 5 pixels. In either case the StartDrag event
> is called just after the call to BeginDrag.

Please try to avoid a manual drag start by calling BeginDrag yourself. This may
confuse some logic
in the mouse down handling. Instead use OnDragAllowed together with dmManual
which will ensure that
only for allowed situations dragging can start and additonally that the correct
mouse down
processing order is kept.

Ciao, Mike


re: TVTHeader Columns

From: "Mike Lischke" [public@l...]
Date: Fri Jan 26, 2001 2:51 pm
Subject: RE: [VirtualTreeview] TVTHeader Columns

Hi Tony,

> Is it possible for you to display the TVTHeader.Columns.Text instead of
> 'column 0..x' when editing the collectionItems ?

You have not looked up the source code, have you? The Text property of the
columns is a wide string
and the VCL is not able to display wide strings correctly, hence I had to use
something simpler.
Perhaps this is fixed in Delhpi 6 but even then I have at least to provide a
fallback for D5 and
lower.

Ciao, Mike


re: AV on AddChild

From: "Mike Lischke" [public@l...]
Date: Fri Jan 26, 2001 2:51 pm
Subject: RE: [VirtualTreeview] AV on AddChild

Hi Tony,

> When initializing a VirtualStringTree with
>
> vt.RootNodeCount := 10
>
> everything goes fine
>
> but when I add a root-node by
>
> vt.RootNodeCount := vtRootNodeCount + 1;
>
> or
>
> vt.AddChild(nil);
>
> and I move down to the newly inserted item (gettext only prints the
> Index)
> then I get an AV.

As you can see in the Advanced demo I used a similar line in AddButtonClick:

RootNodeCount := RootNodeCount + Count;

and it works perfectly. I assume in your case there is something different
wrong. Can you send me a
very simple test project which shows the behaviour? I will then see what I can
do...

Ciao, Mike


Multiselect Drag & Drop

From: [jose.lalancette@v...]
Date: Fri Jan 26, 2001 6:35 pm
Subject: Multiselect Drag & Drop

Hi,

Has anyone managed to do some multiselect drag & drop with the String
Tree ? I'm using the dtVCL drag type and doing it manually.

The problem is that I cannot drag more than one node at a time,
because when you left click on one node, the others are de-
selected... I know that there is no support for multiselection in the
VCL, but there must be a workaround!

I`ve found a way to do it, but it`s different from the one we are
used to in the Window Explorer, and I`d prefer something closer to
the standard if at all possible.

TIA !
JL

 | Replies | Author | Date
320 | Re: Multiselect Drag & Drop | Werner Lehmann | Fri 1/26/2001
323 | Yahoo Groups | Geoffrey Pan | Sat 1/27/2001
329 | Re: Yahoo Groups | Mike Lischke | Sat 1/27/2001
327 | Re: Multiselect Drag & Drop | Mike Lischke | Sat 1/27/2001


IBO and TreeView

From: "Paul Gallagher" [paul@t...]
Date: Fri Jan 26, 2001 8:22 pm
Subject: IBO and TreeView

I am considering building a descendant class IBO-aware version of VirtualTree.
Would this be a problem with the licensing if the source for the descendant was
distributed to other IBO users?

TIA
Paul Gallagher

[Non-text portions of this message have been removed]

 | Replies | Author | Date
317 | Re: IBO and TreeView | Mike Lischke | Fri 1/26/2001
318 | Re: IBO and TreeView | Paul Gallagher | Fri 1/26/2001
321 | Re: IBO and TreeView | [adembaba@e...] | Sat 1/27/2001
328 | Re: IBO and TreeView | Mike Lischke | Sat 1/27/2001
324 | Re: IBO and TreeView | Paul Gallagher | Sat 1/27/2001
325 | Node reorg | Geoffrey Pan | Sat 1/27/2001
330 | Re: Node reorg | Mike Lischke | Sat 1/27/2001
337 | Re: Node reorg | Geoffrey Pan | Sat 1/27/2001
344 | Re: Node reorg | Mike Lischke | Sun 1/28/2001


re: IBO and TreeView

From: "Mike Lischke" [public@l...]
Date: Fri Jan 26, 2001 8:42 pm
Subject: RE: [VirtualTreeview] IBO and TreeView

Hi Paul,

> I am considering building a descendant class IBO-aware version of
VirtualTree. Would this
> be a problem with the licensing if the source for the descendant was
distributed to other
> IBO users?

Such a port would be great. I had already a discussion with Jason Wharton about
this issue but
neither he nor I know enough to make an efficient DB tree from VT. I can see
some obvious solutions
(like RecordCount for RootNodeCount, a query for each node to iterate through a
data set) but this
is all far away from efficiency and elegance. I would love to see IBO
implementation and hope it
will be available for free. Count on me if you need assistance and/or internal
details...

Ciao, Mike


re: IBO and TreeView

From: "Paul Gallagher" [paul@t...]
Date: Fri Jan 26, 2001 8:57 pm
Subject: Re: [VirtualTreeview] IBO and TreeView

Great. I have already built an IBO-aware version of the std Treeview
component, so it should not be that hard to convert it to VirtualTree. It
was READONLY though. For my application, I did not need an editable tree.
And I really have to question how many others need an editable data-aware
tree. A tree just doesn't seem like the correct "format" for editing data.
My application was a tree view of a Bill of Materials, and was generated
through a self-recursive stored procedure, and therefore was only readonly.

If I get it to work, I will distribute it free to all.

Paul

----- Original Message -----
From: "Mike Lischke" [public@l...]
To: [VirtualTreeview@yahoogroups.com>
Sent: Friday, January 26, 2001 2:42 PM
Subject: RE: [VirtualTreeview] IBO and TreeView

> Hi Paul,
>
> > I am considering building a descendant class IBO-aware version of
VirtualTree. Would this
> > be a problem with the licensing if the source for the descendant was
distributed to other
> > IBO users?
>
> Such a port would be great. I had already a discussion with Jason Wharton
about this issue but
> neither he nor I know enough to make an efficient DB tree from VT. I can
see some obvious solutions
> (like RecordCount for RootNodeCount, a query for each node to iterate
through a data set) but this
> is all far away from efficiency and elegance. I would love to see IBO
implementation and hope it
> will be available for free. Count on me if you need assistance and/or
internal details...
>
> Ciao, Mike
>
>
> To unsubscribe from this group, send an email to:
> VirtualTreeview-unsubscribe@egroups.com
>
>
>
>

 | Replies | Author | Date
321 | Re: IBO and TreeView | adembaba@e...] | Sat 1/27/2001
328 | Re: IBO and TreeView | Mike Lischke | Sat 1/27/2001


re: Catch 22?

From: [adembaba@e...]
Date: Fri Jan 26, 2001 11:33 pm
Subject: Re: Catch 22?

Hi Mike,

> > Your site names Jedi as then new home;
>
> So? Where does it mention JEDI as new home? I can't find anything
like this on my pages.

OK. You are right, of course. It is not your site, it was you here
that mentioned that VT is donated to Jedi. I must have remebered that
and stuck with it as written (at your page) truth.

> > when I go to Jedi (whose site badly needs a re-design)
>
> yep, I know. Our web team is working on this.

This is good to hear. Wish I could help.

> > and try to locate VT, I am pointed back to your site...
>
> And, what is your problem with this? Currently the membership of
controls and components is merely
> determine by listing the link and a short description about the
stuff on the JEDI site.

My problem is, I am not sure whether it is Jedi, your site or here
(now Yahoo Groups) that keeps the latest source code. That is why I
keep looking at 3 place at once --great for hit ratings :-), but
somewhat frustarting on my side.

Cheers,

 | Replies | Author | Date
326 | Re: Catch 22? | Mike Lischke | Sat 1/27/2001
2235 | Struggling with upgrade 1.31 -> 2.4.21 | Will Watts | Wed 6/6/2001
2236 | Re: Struggling with upgrade 1.31 -> 2.4.21 | Jim Kueneman | Wed 6/6/2001


re: Multiselect Drag & Drop

From: Werner Lehmann [wl@b...]
Date: Fri Jan 26, 2001 11:20 pm
Subject: Re: [VirtualTreeview] Multiselect Drag & Drop

[jose.lalancette@v...] wrote:
>
> Hi,
>
> Has anyone managed to do some multiselect drag & drop with the String
> Tree ? I'm using the dtVCL drag type and doing it manually.

Yes, but I use OLE DND because it was the only method available when
I started with that code.

> The problem is that I cannot drag more than one node at a time,
> because when you left click on one node, the others are de-
> selected... I know that there is no support for multiselection in the
> VCL, but there must be a workaround!

Strange. I can multiselect nodes (provided that the option is set) and
if I click on a selected node and hold the mouse button I can drag the
whole selection... so this works for me.

WL

 | Replies | Author | Date
323 | Yahoo Groups | Geoffrey Pan | Sat 1/27/2001
329 | Re: Yahoo Groups | Mike Lischke | Sat 1/27/2001
327 | Re: Multiselect Drag & Drop | Mike Lischke | Sat 1/27/2001


re: IBO and TreeView

From: [adembaba@e...]
Date: Sat Jan 27, 2001 12:40 am
Subject: Re: IBO and TreeView

This is great news.

But, have you considered Zeos Database Lib which is open source and
free and claim to be fast
(see http://www.zeos.dn.ua/eng/zeos_news_diagrams.html)

My lifespan permitting I would like to contribute to your efforts.

Chhers,

--- In [VirtualTreeview@y...], "Paul Gallagher" [paul@t...] wrote:
> Great. I have already built an IBO-aware version of the std Treeview
> component, so it should not be that hard to convert it to
VirtualTree. It
> was READONLY though. For my application, I did not need an editable
tree.
> And I really have to question how many others need an editable data-
aware
> tree. A tree just doesn't seem like the correct "format" for
editing data.
> My application was a tree view of a Bill of Materials, and was
generated
> through a self-recursive stored procedure, and therefore was only
readonly.
>
> If I get it to work, I will distribute it free to all.
>
> Paul
>
> ----- Original Message -----
> From: "Mike Lischke" [public@l...]
> To: [VirtualTreeview@y...]
> Sent: Friday, January 26, 2001 2:42 PM
> Subject: RE: [VirtualTreeview] IBO and TreeView
>
>
> > Hi Paul,
> >
> > > I am considering building a descendant class IBO-aware version
of
> VirtualTree. Would this
> > > be a problem with the licensing if the source for the
descendant was
> distributed to other
> > > IBO users?
> >
> > Such a port would be great. I had already a discussion with Jason
Wharton
> about this issue but
> > neither he nor I know enough to make an efficient DB tree from
VT. I can
> see some obvious solutions
> > (like RecordCount for RootNodeCount, a query for each node to
iterate
> through a data set) but this
> > is all far away from efficiency and elegance. I would love to see
IBO
> implementation and hope it
> > will be available for free. Count on me if you need assistance
and/or
> internal details...
> >
> > Ciao, Mike
> >
> >
> > To unsubscribe from this group, send an email to:
> > VirtualTreeview-unsubscribe@egroups.com
> >
> >
> >
> >

 | Replies | Author | Date
328 | Re: IBO and TreeView | Mike Lischke | Sat 1/27/2001


Marquees, VCL dragging, right-clicking, and resetting caption lengths

From: "Anthony Mills" [amills@m...]
Date: Sat Jan 27, 2001 2:25 am
Subject: Marquees, VCL dragging, right-clicking, and resetting caption lengths

> > * No marquee/lasso selection
>
> Hu? Of course is there a marquee. Please see the demos (e.g. the Minimal
project) which show clearly
> how to select several nodes with the mouse using a selection rectangle.

Upon further investigation, you're right, there is ... but not when using
voFullRowSelect.

> > * VCL drag 'n' drop doesn't seem to be quite there yet (OnDragOver isn't
> > giving me a proper Source value); converting to OLE dd would require a
fair
> > number of code changes

This problem has been solved; I was expecting OnDragOver's Source parameter
to be a TControl instead of a TDragControlObject. Once I figured that out,
everything worked. I published OnEndDrag, assigned it, and that worked too.

Unfortunately, it only works if I call BeginDrag directly on OnMouseDown. I
tried the OnDragAllowed route as I believe you advised to someone else, but
OnDragOver is only called once (I need updates on every mouse move) and
OnEndDrag doesn't work between forms. Calling BeginDrag directly breaks
marquee selection, though.

> > * When voRightClickSelect is on and the user right-clicks on a multiple
> > selection, it shouldn't deselect the other selected items
>
> Depends. The option voRightClickSelect means that the right mouse button
will behave in most aspects
> like the left mouse button (actually the second mouse button will behave
like the first one). This
> includes of course removing the current selection.

What I want is this: when I right-click on:
* one of the nodes in a selection, it focuses the node, preserves the
current selection, and shows the context menu
* an unselected node, it focuses and selects the node before showing the
context menu

Unfortunately, if voRightClickSelect is on, it breaks the first point, and
if voRightClickSelect is off, it breaks the second one. I tried adding a bit
of code to OnMouseDown to implement this:

Node := Tree.GetNodeAt(X, Y);
if (Node <> nil) and not (vsSelected in Node^.States) then begin
Tree.ClearSelection;
Tree.Selected[Node] := True;
end;

However, this breaks multiselection, for one thing, so I can see that a real
implementation would take more knowledge than I have at the present. ;-)

> Wrong caption lengths (perhaps with improper ellipsises) are almost always
an indication that the
> text of a node has changed without letting the string tree know which
needs to update the internal
> node width value.

> When sorting a tree however this should never become a problem because the
nodes each as a whole is
> moved not only parts of it. Actually, you don't need to move around your
data when trying to sort a
> tree (unless the default handling is not enough for you), but just
implement a OnCompareNodes event
> which must return whether two given nodes are considered as being equal,
the first is larger or the
> first is smaller. What criterion you consider to decide which node is
larger than another is totally
> up to you but you don't need to move things around. The tree will take
care of this. It will even
> care about sorting in ascending or descending order, your compare function
should always compare as
> would it be in ascending order.

I use TBaseVirtualTree.SortTree to sort one of the trees, but the other one
points to data that is stored in a manner too complex to use SortTree for.

I fixed this by calling ReinitChildren(nil, True) upon the sort completion.

Regards,

Anthony Mills

 | Replies | Author | Date
331 | Re: Marquees, VCL dragging, right-clicking, and r | Mike Lischke | Sat 1/27/2001


Yahoo Groups

From: "Geoffrey Pan" [gpan@c...]
Date: Sat Jan 27, 2001 2:51 am
Subject: Yahoo Groups

Anyone been to this group web page lately? . Not exactly impressed by the
Yahoo-ism.

 | Replies | Author | Date
329 | Re: Yahoo Groups | Mike Lischke | Sat 1/27/2001


re: Re: IBO and TreeView

From: "Paul Gallagher" [paul@t...]
Date: Sat Jan 27, 2001 3:53 am
Subject: Re: [VirtualTreeview] Re: IBO and TreeView

Never heard of it, but I'll look at it.

----- Original Message -----
From: [adembaba@e...]
To: [VirtualTreeview@yahoogroups.com>
Sent: Friday, January 26, 2001 6:40 PM
Subject: [VirtualTreeview] Re: IBO and TreeView

> This is great news.
>
> But, have you considered Zeos Database Lib which is open source and
> free and claim to be fast
> (see http://www.zeos.dn.ua/eng/zeos_news_diagrams.html)
>
> My lifespan permitting I would like to contribute to your efforts.
>
> Chhers,
>
>
> --- In [VirtualTreeview@y...], "Paul Gallagher" [paul@t...] wrote:
> > Great. I have already built an IBO-aware version of the std Treeview
> > component, so it should not be that hard to convert it to
> VirtualTree. It
> > was READONLY though. For my application, I did not need an editable
> tree.
> > And I really have to question how many others need an editable data-
> aware
> > tree. A tree just doesn't seem like the correct "format" for
> editing data.
> > My application was a tree view of a Bill of Materials, and was
> generated
> > through a self-recursive stored procedure, and therefore was only
> readonly.
> >
> > If I get it to work, I will distribute it free to all.
> >
> > Paul
> >
> > ----- Original Message -----
> > From: "Mike Lischke" [public@l...]
> > To: <VirtualTreeview@y...]
> > Sent: Friday, January 26, 2001 2:42 PM
> > Subject: RE: [VirtualTreeview] IBO and TreeView
> >
> >
> > > Hi Paul,
> > >
> > > > I am considering building a descendant class IBO-aware version
> of
> > VirtualTree. Would this
> > > > be a problem with the licensing if the source for the
> descendant was
> > distributed to other
> > > > IBO users?
> > >
> > > Such a port would be great. I had already a discussion with Jason
> Wharton
> > about this issue but
> > > neither he nor I know enough to make an efficient DB tree from
> VT. I can
> > see some obvious solutions
> > > (like RecordCount for RootNodeCount, a query for each node to
> iterate
> > through a data set) but this
> > > is all far away from efficiency and elegance. I would love to see
> IBO
> > implementation and hope it
> > > will be available for free. Count on me if you need assistance
> and/or
> > internal details...
> > >
> > > Ciao, Mike
> > >
> > >
> > > To unsubscribe from this group, send an email to:
> > > VirtualTreeview-unsubscribe@egroups.com
> > >
> > >
> > >
> > >
>
>
> To unsubscribe from this group, send an email to:
> VirtualTreeview-unsubscribe@egroups.com
>
>
>
>

 | Replies | Author | Date
325 | Node reorg | Geoffrey Pan | Sat 1/27/2001
330 | Re: Node reorg | Mike Lischke | Sat 1/27/2001
337 | Re: Node reorg | Geoffrey Pan | Sat 1/27/2001
344 | Re: Node reorg | Mike Lischke | Sun 1/28/2001


Node reorg

From: "Geoffrey Pan" [gpan@c...]
Date: Sat Jan 27, 2001 5:00 am
Subject: Node reorg

Quick question,

Not familiar with drag and drop, how is the best way to allow users to
reorganize the order of nodes with drag/drop in VT?. With dragmode set to
auto, it shows the drag image, but when I drop it, it goes back to the
original location.

Would appreciate any pointers.

Thanks in advance

 | Replies | Author | Date
330 | Re: Node reorg | Mike Lischke | Sat 1/27/2001
337 | Re: Node reorg | Geoffrey Pan | Sat 1/27/2001
344 | Re: Node reorg | Mike Lischke | Sun 1/28/2001


re: Re: Catch 22?

From: "Mike Lischke" [public@l...]
Date: Sat Jan 27, 2001 8:38 am
Subject: RE: [VirtualTreeview] Re: Catch 22?

> > yep, I know. Our web team is working on this.
>
> This is good to hear. Wish I could help.

You can! If you like to take part in the development then subscribe to the JEDI
main list and ask
there whom to contact. As there is a leader for every team there must be one
for the Web site too.
And we need active people...

> My problem is, I am not sure whether it is Jedi, your site or here
> (now Yahoo Groups) that keeps the latest source code. That is why I
> keep looking at 3 place at once --great for hit ratings :-), but
> somewhat frustarting on my side.

Well, there is only one site to look for the real code and this is my homepage.
I have placed the
2.0 prerelease into the file area of the mailing list because it was convinient
(and we have the
place, so why not use it). I hope this makes it a bit more comfortable for you
and anyone else who's
irritated.

Ciao, Mike


re: Multiselect Drag & Drop

From: "Mike Lischke" [public@l...]
Date: Sat Jan 27, 2001 8:41 am
Subject: RE: [VirtualTreeview] Multiselect Drag & Drop

> Strange. I can multiselect nodes (provided that the option is set) and
> if I click on a selected node and hold the mouse button I can drag the
> whole selection... so this works for me.

This is again a problem with the VCL and I feel again confirmed not to enhance
the tree for such
things like VCL dd. The reason is the mouse button up message which is sent
when dragging starts
(only in VCL dd mode). The tree keeps a flag whether to remove the current
selection or not. This
flag is (in OLE dd mode) removed when dragging really started. In VCL dd I
cannot remove this flag
because the mouse up message is sent before the mouse down message even
returned! On the other hand,
I cannot simply leave out the flag when I start VCL dd because it could well be
possible that the
user does not want to really start dd and in this case the selection must be
cleared. I have no idea
yet how to solve this dilemma...

Ciao, Mike


re: Re: IBO and TreeView

From: "Mike Lischke" [public@l...]
Date: Sat Jan 27, 2001 8:48 am
Subject: RE: [VirtualTreeview] Re: IBO and TreeView

> But, have you considered Zeos Database Lib which is open source and
> free and claim to be fast
> (see http://www.zeos.dn.ua/eng/zeos_news_diagrams.html)

The data aware tree should be so designed that the developer only needs to
exchange an interface to
the underlying database/client driver. I don't know, however, how to make this
a fast interface...

Ciao, Mike


re: Yahoo Groups

From: "Mike Lischke" [public@l...]
Date: Sat Jan 27, 2001 8:56 am
Subject: RE: [VirtualTreeview] Yahoo Groups

> Anyone been to this group web page lately? . Not exactly impressed by the
> Yahoo-ism.

Yesterday they switch the mailing list names (e.g. here it is now
VirtualTreeview@yahoogroups.com
instead of VirtualTreeview@egroups.com). For some reasons not obvious to me I
can't get my sort
rules in Outlook 2000 to work again, although I changed all list addresses (I'm
on a dozen lists, so
I need this feature).

It is also not so obvious how to login now into yahoo groups and at present the
acquisition of a
yahoo id does not work because the server is not accessible.

Ciao, Mike


re: Node reorg

From: "Mike Lischke" [public@l...]
Date: Sat Jan 27, 2001 9:05 am
Subject: RE: [VirtualTreeview] Node reorg

Geoffrey,

> Not familiar with drag and drop, how is the best way to allow users to
> reorganize the order of nodes with drag/drop in VT?. With dragmode set to
> auto, it shows the drag image, but when I drop it, it goes back to the
> original location.

Please have a look at the OLE demo in prerelease 2.0 (hope you have already
downloaded it, it is
currently difficult (at least for me) to get to any web server because of DNS
problems). To switch
off the drag image look up Tree.DragImagKind.

Ciao, Mike

 | Replies | Author | Date
337 | Re: Node reorg | Geoffrey Pan | Sat 1/27/2001
344 | Re: Node reorg | Mike Lischke | Sun 1/28/2001


re: Marquees, VCL dragging, right-clicking, and resetting caption lengths

From: "Mike Lischke" [public@l...]
Date: Sat Jan 27, 2001 12:20 pm
Subject: RE: [VirtualTreeview] Marquees, VCL dragging, right-clicking, and resetting caption lengths

Hi Anthony,

> Upon further investigation, you're right, there is ... but not when using
> voFullRowSelect.

There is a german saying, perhaps you can translate it somehow: "Man hat es nie
an allen vier
Zipfeln". ;-) The sense is about: "You can't have it all together".

> Unfortunately, it only works if I call BeginDrag directly on OnMouseDown.

Somehow do I get different results. In the OLE dd demo I have set the second
tree to use VCL dd and
set in OnDragAllowed the Allowed parameter always to True and it works
perfectly.

> I tried the OnDragAllowed route as I believe you advised to someone else, but
> OnDragOver is only called once (I need updates on every mouse move) and
> OnEndDrag doesn't work between forms. Calling BeginDrag directly breaks
> marquee selection, though.

Yes, OnDragAllowed is the prefered way of manually starting drag'n drop.
OnDragOver works also
correctly for me. With OLE dd it is called frequently even if the mouse is not
moved and using OLE
dd it is called on every mouse move. I can't say anything about OnEndDrag
though.

> What I want is this: when I right-click on:
> * one of the nodes in a selection, it focuses the node, preserves the
> current selection, and shows the context menu
> * an unselected node, it focuses and selects the node before showing the
> context menu

I just have fixed this problem. The keypoint was to cancel pending states like
selection removal and
edit mode to avoid interferences with popup menus.

Ciao, Mike


re: Re: IBO and TreeView

From: "Paul Gallagher" [paul@t...]
Date: Sat Jan 27, 2001 2:47 pm
Subject: Re: [VirtualTreeview] Re: IBO and TreeView

I think there are going to be two totally different scenarios.

1. The data that is fed into the tree is from a single table, structured
specifically for a tree view. There is a PARENT field, and ID field. The
PARENT field tells the tree which node the ID belongs to. The root nodes
have a PARENT field value of -1. This is how the other(TeeTree, DreamTree,
etc) trees work.

2. The tree will display master detail relationships. The root node is the
master record, and the child node is the detail record. This is the one I
really question is necessary.

The former scenario, is what is used for displaying data for multi-level
Bill of Materials, or could be used for displaying drill-down properties.
But either BOM, or drill-down, will require a "built" table, that will most
likely be created from a Stored Procedure, that will most likely not be
editable.

Any comments and thoughts on this are welcome.

Paul Gallagher

----- Original Message -----
From: "Mike Lischke" [public@l...]
To: [VirtualTreeview@yahoogroups.com>
Sent: Saturday, January 27, 2001 2:48 AM
Subject: RE: [VirtualTreeview] Re: IBO and TreeView

> > But, have you considered Zeos Database Lib which is open source and
> > free and claim to be fast
> > (see http://www.zeos.dn.ua/eng/zeos_news_diagrams.html)
>
> The data aware tree should be so designed that the developer only needs to
exchange an interface to
> the underlying database/client driver. I don't know, however, how to make
this a fast interface...
>
> Ciao, Mike
>
>
>
> To unsubscribe from this group, send an email to:
> VirtualTreeview-unsubscribe@egroups.com
>
>
>
>

Replies Author Date


Hi there, (from igor)

From: [guclu.ongun@i...]
Date: Sat Jan 27, 2001 3:14 pm
Subject: Hi there, (from igor)

Mike,

I just started to use your master-piece. Thank you very much (and to
the other people spent time on VTV).

I, also, just subscribe to the list, so do not know what is going on.
Anyway, I'd like to report the following problem:

- In Advanced demo, Properties page (VST3) when I try to change 2nd
column's coVisible option to false Delphi locks out (Delphi 5 Ent
SP1). But this works for the first column fine.

may be my fault ;-)

c.u.
and thanks all again.

 | Replies | Author | Date
343 | Re: Hi there, (from igor) | Mike Lischke | Sun 1/28/2001
348 | Re: Hi there, (from igor) | [guclu.ongun@i...] | Sun 1/28/2001
350 | Re: Hi there, (from igor) | Mike Lischke | Sun 1/28/2001


re: Re: IBO and TreeView

From: "Mauricio Longo" [mlongo@c...]
Date: Sat Jan 27, 2001 4:46 pm
Subject: Re: [VirtualTreeview] Re: IBO and TreeView

Paul,

I've worked on this problem over the last 4 years. What I have to say may
not be very incoraging but I think it is better said than not. :-)

I haven't found a single tree control that would work for me. :-(

That said, let's take a look at the problem.

I work on applications that have data that is hierarchical in nature. A bit
diffenrent from a bill of materials since a material can be part of several
others, but a similar approach could be created.

First, I've found that loading up the tree is unthinkable. It will give you
performance that is worth garbage so let's not go down that path.

So, if we can't load the tree the next solution is to load it up one node at
a time. This may be seem like a not to elegant approach, but it does work.
It is actually the fastest thing I could come up with to load the data in
the tree - just one simple query will get you the nodes you need, provided
that you have the Parent/Id fields.

Now you have another problem. How do you know if each of the returned child
nodes hs children of it's own. If your building an application that will
work with lists of hundreds of sub items, perhaps its just better to say
they do and let the little plus apear besides every node.

If you are working on a more controled kind of application, where you know
there will be but a few subnodes, then you could execute a query for each,
asking how many childs they have. This way you'd know if they have children
or not.

One way to speed this up is to create a flag that informs you if that
particular type of node supports children - mind you that I'm saying to
store info on if they *have* children but on if they *accept* children.

Just as a suggestion, you might find it faster to implement a permanent
tree-table structure that references items in a materials table than to
build one everytime you need it. It might also represent a bit more work to
maintain the table, but believe me, it is not all that much, after you've
gotten used to this sort of implementation.

I've done it on Paradox, SQL Server, Interbase and Zipfiles. You get really
used to it. :-)

Just some thoughts...

All my best,

Mauricio Longo

> I think there are going to be two totally different scenarios.
>
> 1. The data that is fed into the tree is from a single table, structured
> specifically for a tree view. There is a PARENT field, and ID field. The
> PARENT field tells the tree which node the ID belongs to. The root nodes
> have a PARENT field value of -1. This is how the other(TeeTree, DreamTree,
> etc) trees work.
>
> 2. The tree will display master detail relationships. The root node is the
> master record, and the child node is the detail record. This is the one I
> really question is necessary.
>
> The former scenario, is what is used for displaying data for multi-level
> Bill of Materials, or could be used for displaying drill-down properties.
> But either BOM, or drill-down, will require a "built" table, that will
most
> likely be created from a Stored Procedure, that will most likely not be
> editable.
>
> Any comments and thoughts on this are welcome.
>
> Paul Gallagher
>


re: Re: IBO and TreeView

From: "Paul Gallagher" [paul@t...]
Date: Sat Jan 27, 2001 4:11 pm
Subject: Re: [VirtualTreeview] Re: IBO and TreeView

> First, I've found that loading up the tree is unthinkable. It will give
you
> performance that is worth garbage so let's not go down that path.

Not sure I agree with this. Im not sure what you mean by "loading up", but I
used the load one node at a time method. I have "hardcoded" the
functionality into an app using the TeeTree. The tree table data is built
with a fairly complex self-recursive stored procedure on the server.
Granted, I have not used it with thousands of records, but the performance I
have seen so far, is extremely fast. In my app, I could scroll through the
records with the nav buttons as fast as I want, with the tree set to
AutoExpand. The tree would completely update and display at whatever the
scroll rate was on the nav buttons, probably about 10-15 records per second.
The stored procedure was called and the table built after EVERY AfterScroll
event of the Master table. If there are many records, then perhaps IBO's
functionality could come into play here. It will only request the required
records from the server. If you scroll down through the tree, then IBO will
request additional data from the server. I don't know how this could be made
to work with a StoredProcedure, but it is just a thought.

I guess I have to re-iterate my personal opinion on trees. I don't think a
tree is a very effective or "user-friendly" way of displaying or editing a
database. It should only be used for special applications, where the tree
offers some benefit. I would bet that in most of these special cases, there
will not be a vast amount of data, so then speed should not be an issue.

Most of what I am saying so far is just theory and guesses, because I have
not thoroughly studied the way the VTree functions. What I like about it
though, is the speed, and the fact that it is open-source.

Thanks for the input.

Paul Gallagher


re: Re: IBO and TreeView

From: "Mauricio Longo" [mlongo@c...]
Date: Sat Jan 27, 2001 6:33 pm
Subject: Re: [VirtualTreeview] Re: IBO and TreeView

>
> > First, I've found that loading up the tree is unthinkable. It will give
> you
> > performance that is worth garbage so let's not go down that path.
>
> Not sure I agree with this. Im not sure what you mean by "loading up", but
I
> used the load one node at a time method. I have "hardcoded" the
> functionality into an app using the TeeTree. The tree table data is built
> with a fairly complex self-recursive stored procedure on the server.

I mean to load all records at once in the tree is unthinkable. I work with
hierarchical data from just a few items - to millions of rows - a Tree is
THE only user friendly to display data which by it's own nature makes up a
tree. :-)

So, you need to load data on a node-by-node bases. On expanding a node, you
read it's children...

All my best,

Mauricio Longo
[mlongo@c...]


re: Node reorg

From: "Geoffrey Pan" [gpan@c...]
Date: Sat Jan 27, 2001 6:29 pm
Subject: RE: [VirtualTreeview] Node reorg

Yes, noticed the new demo.

Don't see any ability to reorder nodes within the same parent, please
correct me if I'm mistaken.

Thanks in advance,

Geoffrey Pan

-----Original Message-----
From: Mike Lischke [mailto:[public@l...]]
Sent: Saturday, January 27, 2001 3:06 AM
To: VirtualTreeview@yahoogroups.com
Subject: RE: [VirtualTreeview] Node reorg

Geoffrey,

> Not familiar with drag and drop, how is the best way to allow users to
> reorganize the order of nodes with drag/drop in VT?. With dragmode set to
> auto, it shows the drag image, but when I drop it, it goes back to the
> original location.

Please have a look at the OLE demo in prerelease 2.0 (hope you have already
downloaded it, it is
currently difficult (at least for me) to get to any web server because of
DNS problems). To switch
off the drag image look up Tree.DragImagKind.

Ciao, Mike

To unsubscribe from this group, send an email to:
VirtualTreeview-unsubscribe@egroups.com

 | Replies | Author | Date
344 | Re: Node reorg | Mike Lischke | Sun 1/28/2001


Banded Columns in grid more than one row of cells per node

From: emanuel [emanuel@n...]
Date: Sun Jan 28, 2001 7:47 am
Subject: Banded Columns in grid more than one row of cells per node

support,

1. sGrid
is it possible to allocate celss per bands per node ?
so:

so:
node 1:
FLd1 | fld2 | fld3 |
fld4 | |
node 2:
FLd1 | fld2 | fld3 |
fld4 | |

pls note fld3.height=2. all other .height=1 (as example)

Emanuel

 | Replies | Author | Date
339 | Mouse events | Geoffrey Pan | Sat 1/27/2001
346 | Re: Mouse events | Mike Lischke | Sun 1/28/2001
351 | Re: Mouse events | Geoffrey Pan | Sun 1/28/2001
342 | Re: Banded Columns in grid more than one row of c | Mike Lischke | Sun 1/28/2001
352 | Re: Banded Columns in grid more than one row of c | [emanuelil@y...] | Sun 1/28/2001
356 | Re: Banded Columns in grid more than one row of c | Mike Lischke | Mon 1/29/2001


Mouse events

From: "Geoffrey Pan" [gpan@c...]
Date: Sat Jan 27, 2001 11:28 pm
Subject: Mouse events

Wondering is there a way to stop a mouse event from bubbling downstream
events, like a Cancel parameter.

Looking thru the code I don't see this, but maybe I've missed something.

Basically am looking for a way to cancel a click from triggering events
downstream.

(Hope I'm making sense) :)

 | Replies | Author | Date
346 | Re: Mouse events | Mike Lischke | Sun 1/28/2001
351 | Re: Mouse events | Geoffrey Pan | Sun 1/28/2001


re: IBO and TreeView

From: [adembaba@e...]
Date: Sun Jan 28, 2001 5:52 am
Subject: Re: IBO and TreeView

I have dabbled with quite a few DBTreeView stuff and IMHO all suck;
mainly because of this parent-child numbering plan...

I admit, most of the underlying database engines available have not
been SQL, so linking nodes based on parent-child numbers seemed more
or less the only way. But, when you are playing with a true SQL
engine why bother with that cludgy solution.

What I *really* would like to see something similar in metaphor to
ActionLists where you could have a number of parameterized queries
which each node (or group, or level) could be assigned. This way, you
could not only make the whole thing dynamic, but you also could have
self-determination as to whether the displayed data is/are read-only
or not (the query itself will determine that)

Just a thought,

Cheers,

--- In [VirtualTreeview@y...], "Paul Gallagher" [paul@t...] wrote:
> I think there are going to be two totally different scenarios.
>
> 1. The data that is fed into the tree is from a single table,
structured
> specifically for a tree view. There is a PARENT field, and ID
field. The
> PARENT field tells the tree which node the ID belongs to. The root
nodes
> have a PARENT field value of -1. This is how the other(TeeTree,
DreamTree,
> etc) trees work.
>
> 2. The tree will display master detail relationships. The root node
is the
> master record, and the child node is the detail record. This is the
one I
> really question is necessary.
>
> The former scenario, is what is used for displaying data for multi-
level
> Bill of Materials, or could be used for displaying drill-down
properties.
> But either BOM, or drill-down, will require a "built" table, that
will most
> likely be created from a Stored Procedure, that will most likely
not be
> editable.
>
> Any comments and thoughts on this are welcome.
>
> Paul Gallagher
>
> ----- Original Message -----
> From: "Mike Lischke" [public@l...]
> To: [VirtualTreeview@y...]
> Sent: Saturday, January 27, 2001 2:48 AM
> Subject: RE: [VirtualTreeview] Re: IBO and TreeView
>
>
> > > But, have you considered Zeos Database Lib which is open source
and
> > > free and claim to be fast
> > > (see http://www.zeos.dn.ua/eng/zeos_news_diagrams.html)
> >
> > The data aware tree should be so designed that the developer only
needs to
> exchange an interface to
> > the underlying database/client driver. I don't know, however, how
to make
> this a fast interface...
> >
> > Ciao, Mike
> >
> >
> >
> > To unsubscribe from this group, send an email to:
> > VirtualTreeview-unsubscribe@egroups.com
> >
> >
> >
> >


re: Re: IBO and TreeView

From: "Paul Gallagher" [paul@t...]
Date: Sun Jan 28, 2001 5:59 am
Subject: Re: [VirtualTreeview] Re: IBO and TreeView

I will try to get the basic data-aware functionality going. Then whoever
wants to add to it can. If I get it to work, I will make sure it is
available to both the IBO, and VTree groups. Perhaps this could be the first
DBTree that actually works properly. :-)

Paul Gallagher

----- Original Message -----
From: [adembaba@e...]
To: [VirtualTreeview@yahoogroups.com>
Sent: Saturday, January 27, 2001 11:52 PM
Subject: [VirtualTreeview] Re: IBO and TreeView

> I have dabbled with quite a few DBTreeView stuff and IMHO all suck;
> mainly because of this parent-child numbering plan...
>
> I admit, most of the underlying database engines available have not
> been SQL, so linking nodes based on parent-child numbers seemed more
> or less the only way. But, when you are playing with a true SQL
> engine why bother with that cludgy solution.
>
> What I *really* would like to see something similar in metaphor to
> ActionLists where you could have a number of parameterized queries
> which each node (or group, or level) could be assigned. This way, you
> could not only make the whole thing dynamic, but you also could have
> self-determination as to whether the displayed data is/are read-only
> or not (the query itself will determine that)
>
> Just a thought,
>
> Cheers,
>
> --- In [VirtualTreeview@y...], "Paul Gallagher" [paul@t...] wrote:
> > I think there are going to be two totally different scenarios.
> >
> > 1. The data that is fed into the tree is from a single table,
> structured
> > specifically for a tree view. There is a PARENT field, and ID
> field. The
> > PARENT field tells the tree which node the ID belongs to. The root
> nodes
> > have a PARENT field value of -1. This is how the other(TeeTree,
> DreamTree,
> > etc) trees work.
> >
> > 2. The tree will display master detail relationships. The root node
> is the
> > master record, and the child node is the detail record. This is the
> one I
> > really question is necessary.
> >
> > The former scenario, is what is used for displaying data for multi-
> level
> > Bill of Materials, or could be used for displaying drill-down
> properties.
> > But either BOM, or drill-down, will require a "built" table, that
> will most
> > likely be created from a Stored Procedure, that will most likely
> not be
> > editable.
> >
> > Any comments and thoughts on this are welcome.
> >
> > Paul Gallagher
> >
> > ----- Original Message -----
> > From: "Mike Lischke" [public@l...]
> > To: <VirtualTreeview@y...]
> > Sent: Saturday, January 27, 2001 2:48 AM
> > Subject: RE: [VirtualTreeview] Re: IBO and TreeView
> >
> >
> > > > But, have you considered Zeos Database Lib which is open source
> and
> > > > free and claim to be fast
> > > > (see http://www.zeos.dn.ua/eng/zeos_news_diagrams.html)
> > >
> > > The data aware tree should be so designed that the developer only
> needs to
> > exchange an interface to
> > > the underlying database/client driver. I don't know, however, how
> to make
> > this a fast interface...
> > >
> > > Ciao, Mike
> > >
> > >
> > >
> > > To unsubscribe from this group, send an email to:
> > > VirtualTreeview-unsubscribe@egroups.com
> > >
> > >
> > >
> > >
>
>
>
> To unsubscribe from this group, send an email to:
> VirtualTreeview-unsubscribe@egroups.com
>
>
>
>

 | Replies | Author | Date
345 | Re: IBO and TreeView | Mike Lischke | Sun 1/28/2001


re: Banded Columns in grid more than one row of cells per node

From: "Mike Lischke" [public@l...]
Date: Sun Jan 28, 2001 10:30 am
Subject: RE: [VirtualTreeview] Banded Columns in grid more than one row of cells per node

Hi Emanuel,

> support,

actually, we are all just Delphi programmers who share an interest (Virtual
Treeview) so don't
expect a commercial support team here...

> 1. sGrid
> is it possible to allocate celss per bands per node ?
> so:
>
> so:
> node 1:
> FLd1 | fld2 | fld3 |
> fld4 | |
> node 2:
> FLd1 | fld2 | fld3 |
> fld4 | |

I have no idea what you mean here. There are no bands in VT and the term "cell"
is only used to
denote a subitem of a node (and used for lack of a better term). There is no
cell as in, say,
TStringGrid.

Ciao, Mike

Dipl. Ing. Mike Lischke
Senior software developer
--
Homepage: http://www.lischke-online.de
GraphicEx: http://www.lischke-online.de/Graphics.html
Virtual Treeview: http://www.lischke-online.de/VirtualTreeview.html
Unicode Edit and library: http://www.lischke-online.de/Unicode.html

 | Replies | Author | Date
352 | Re: Banded Columns in grid more than one row of c | [emanuelil@y...] | Sun 1/28/2001


re: Hi there, (from igor)

From: "Mike Lischke" [public@l...]
Date: Sun Jan 28, 2001 10:30 am
Subject: RE: [VirtualTreeview] Hi there, (from igor)

Hi Igor,

welcome to the list. There was long time no speak between us. How are you and
how's your 3D graphics
going? Your stuff is still on my homepage :o]

> - In Advanced demo, Properties page (VST3) when I try to change 2nd
> column's coVisible option to false Delphi locks out (Delphi 5 Ent
> SP1). But this works for the first column fine.

This problem was a bug in VT and has been fixed meanwhile. You can go to the
file area of egroups
(now yahoogroups) and download a 2.0 prerelease of VT. Some problems have been
reported however
which I have mostly fixed. Currently I'm implementing a feature to hide single
nodes without
deleting them.

I hope to get out a new prerelease this evening, but it could well take longer.

Ciao, Mike

Dipl. Ing. Mike Lischke
Senior software developer
--
Homepage: http://www.lischke-online.de
GraphicEx: http://www.lischke-online.de/Graphics.html
Virtual Treeview: http://www.lischke-online.de/VirtualTreeview.html
Unicode Edit and library: http://www.lischke-online.de/Unicode.html

 | Replies | Author | Date
348 | Re: Hi there, (from igor) | [guclu.ongun@i...] | Sun 1/28/2001
350 | Re: Hi there, (from igor) | Mike Lischke | Sun 1/28/2001


re: Node reorg

From: "Mike Lischke" [public@l...]
Date: Sun Jan 28, 2001 10:30 am
Subject: RE: [VirtualTreeview] Node reorg

> Don't see any ability to reorder nodes within the same parent, please
> correct me if I'm mistaken.

Well, reordering is quite easy. Do a MoveTo with amInsertBefore and
amInsertAfter modes. This
corresponds quite closely to the way you can handle drag'n drop.

Ciao, Mike


re: Re: IBO and TreeView

From: "Mike Lischke" [public@l...]
Date: Sun Jan 28, 2001 10:30 am
Subject: RE: [VirtualTreeview] Re: IBO and TreeView

> I will try to get the basic data-aware functionality going. Then whoever
> wants to add to it can. If I get it to work, I will make sure it is
> available to both the IBO, and VTree groups. Perhaps this could be the first
> DBTree that actually works properly. :-)

To my pleasure I see that there are experts working on a DB aware VT who know
the matter. I will
closely follow the development and have also good news.

The JEDI VCS server has been opened for JVCL projects and I have been promoted
to a project admin.
As soon as I find the time (likely the comming week) I will create a VT
project. So for all
interested in corporate work should go and download the FreeVCS client from
www.freevcs.de which is
required to access the archive. Note: in order to avoid unnecessary downloads
think about what you
want to do. For working with the JEDI VCS you only need the FreeVCS client
(either standalone or IDE
expert, or both). Download also the fix for the comparation program FreeVCS
Diff. This little tool
compares two textfiles and with the patch it is much faster doing this.

The other stuff (application server, service, DBISAM database etc.) is NOT
necessary unless you want
to install a local VCS server. In this case however, I recommend the free IB6
server instead of
DBISAM.

Since the access to the FreeVCS server is limited to registered users I need to
know a login name
from you. Send your request privately to [public@l...] and I will
create an account for
you. Don't tell me a password, you can set it when you have logged with a
default password.

Because I'm also the FreeVCS server admin in my company I will give some help
for interested people
regarding FreeVCS on this list for a short period of time (if necessary).

Ciao, Mike


re: Mouse events

From: "Mike Lischke" [public@l...]
Date: Sun Jan 28, 2001 10:30 am
Subject: RE: [VirtualTreeview] Mouse events

> Wondering is there a way to stop a mouse event from bubbling downstream
> events, like a Cancel parameter.

Mmm, unusual idea :-) Stopping an event from going through the whole chain
could be done by
capturing the associated message and not giving it to the inherited handler.
What exactly do you
want to do?

Ciao, Mike

 | Replies | Author | Date
351 | Re: Mouse events | Geoffrey Pan | Sun 1/28/2001


re: Background/ invisible nodes

From: [jens.treichler@u...]
Date: Sun Jan 28, 2001 12:04 pm
Subject: Re: Background/ invisible nodes

Hi Mike,

>
> > Last one is about the partial redraw while scrolling.
> > This is ok when using the scrollbars. But when using a wheel mouse
> > tree never get the appropriate scoll messages (SB_ENDSCROLL ?)
> > thus leading to incorrectly drawn item backgrounds.
>
> This one is something I can't reproduce. E.g. in the advanced demo
I can set a background and it
> will draw correctly also when scrolling with the wheel.
>
OK, this is my fault but still a miracle to me
to reproduce, just assign an BeforeItemErase event handler to a tree

if odd((ItemRect.top) div tree.DefaultNodeHeight) then
color := clwhite
else color := clgreen;
EraseAction := eaColor;

One should believe that on row has one color, green or white.
But try it...
This is the right code for the purpose.
if odd((ItemRect.top-vtree.OffsetY) div tree.DefaultNodeHeight) then
color := clwhite
else color := clgreen;
EraseAction := eaColor;

> > I thought about the show/hide node thing. I would suggest to make
it
> > an option, like VsDisabled. This flag would only be of influence
to
> > view. For all other task (selection,drag etc) the application
could
> > check , if necessary , for this flag and decide what to do
> > with hidden nodes. Does this make implementation easier ?
>
> Not at all, sorry. An additional option makes it even more
difficult. I would have to make first a
> full implementation and then switch off some parts conditionally.

Will we ever see this feature ?

Mike, I just coded a print routine for a tree. To fill in the pages
I use a metafile for each page. My version of Virtualtree does
not print der vertical gidlines correct in the area not visible on
screen. It looks like the BitBlit of the tree's DrawDottedVLine
fails for some strange reason. If I use BLACKNESS instead of
SRCCOPY it looks {black (:-)} ok.
How about a header paintto method ?

Jens

 | Replies | Author | Date
349 | Re: Background/ invisible nodes | Mike Lischke | Sun 1/28/2001
353 | Re: Background/ invisible nodes | [jens.treichler@u...] | Sun 1/28/2001


re: Hi there, (from igor)

From: [guclu.ongun@i...]
Date: Sun Jan 28, 2001 1:22 pm
Subject: Re: Hi there, (from igor)

Much changed after my military obligation completion. We have formed
a new software company and we are working on custom DB management and
communication projects while trying to finish my PhD. So, I could not
realy work on the 3D joy of life.

As a hobby, I try to design a front end using your treeview for
relational database display and editing together with automatic
reporting using QuickReport 3 standart for delphi community. We'll
see what I can do.

If it happens to be a usable framework, what are your terms to use
your tree view in our commercial products? (I really could not fetch
the Mozilla Licience 1.1 rather than being a generic guarding.)

Here for any assignment on anything you want...

c.u. ;-)
igor

 | Replies | Author | Date
350 | Re: Hi there, (from igor) | Mike Lischke | Sun 1/28/2001


re: Re: Background/ invisible nodes

From: "Mike Lischke" [public@l...]
Date: Sun Jan 28, 2001 1:31 pm
Subject: RE: [VirtualTreeview] Re: Background/ invisible nodes

> This is the right code for the purpose.
> if odd((ItemRect.top-vtree.OffsetY) div tree.DefaultNodeHeight) then
> color := clwhite
> else color := clgreen;
> EraseAction := eaColor;

Don't forget that nodes can have different heights. Additionally, it might be
easier just to check
Odd(Tree.AbsoluteIndex) or Odd(Node.Index) for alternating colors in a child
list only. The latter
works very well in grid like trees with only top level nodes.

> Will we ever see this feature ?

Well, I'm just over it in this very minute (when I don't write eMails :-)). But
it is really tough
stuff, particularly the navigation functions (GetNextVisible etc.) need a quite
complex loop system
now.

> Mike, I just coded a print routine for a tree. To fill in the pages
> I use a metafile for each page. My version of Virtualtree does
> not print der vertical gidlines correct in the area not visible on
> screen. It looks like the BitBlit of the tree's DrawDottedVLine
> fails for some strange reason. If I use BLACKNESS instead of
> SRCCOPY it looks {black (:-)} ok.

Mmm, I need to see the code and step through it. Note, there is an option to
switch of grid lines.
But it seems not to be the problem because you wrote only about vertical grid
lines not horizontal
lines. The used BitBlt operation should really work since it is a very basic
operation. Please look
how large the stipple bitmap is.

> How about a header paintto method ?

There is a protected PaintHeader method (e.g. for the drag image). Move this
into the public
section.

Ciao, Mike

 | Replies | Author | Date
353 | Re: Background/ invisible nodes | [jens.treichler@u...] | Sun 1/28/2001


re: Re: Hi there, (from igor)

From: "Mike Lischke" [public@l...]
Date: Sun Jan 28, 2001 1:34 pm
Subject: RE: [VirtualTreeview] Re: Hi there, (from igor)

> If it happens to be a usable framework, what are your terms to use
> your tree view in our commercial products? (I really could not fetch
> the Mozilla Licience 1.1 rather than being a generic guarding.)

Well, the MPL basically states that you can use the software under protection
for anything you like
including commercial software. There are some restrictions but basically this
is the point. For
details you will have to look deeper into the legal stuff...

Ciao, Mike


re: Mouse events

From: "Geoffrey Pan" [gpan@c...]
Date: Sun Jan 28, 2001 1:48 pm
Subject: RE: [VirtualTreeview] Mouse events

Mike,

Am trying to catch the mouse event before it actually causes anything (i.e a
OnBeforeEdit) and ability to drop the message from bubbling to downstream
handlers (for example, to create a non-selectable item in a list).

This is actually for a alternative checklist implementation (custom) where
we have set one column as owner-drawn. Currently VT behaviour will select
the node once the MouseDown event occurs, even if its supposed to be a
non-selectable node (and then I have to fire ToggleNode on it to unselect
it). The ability to trap and cancel the message would help avoid that.

In effect, this would make it possible to create a node that is able to
respond to mouse events, but is non-selectable.

(There are other ways to achieve this, but having a ability to pre-process
the mouse event would be a nice feature :) )

Basically this is something similar to what can be achieved by setting
Cancel := true on OnCloseQuery for example.

If you want me to submit a extension that implements I can.

Thanks,
Geoffrey

-----Original Message-----
From: Mike Lischke [mailto:[public@l...]]
Sent: Sunday, January 28, 2001 4:30 AM
To: VirtualTreeview@yahoogroups.com
Subject: RE: [VirtualTreeview] Mouse events

> Wondering is there a way to stop a mouse event from bubbling downstream
> events, like a Cancel parameter.

Mmm, unusual idea :-) Stopping an event from going through the whole chain
could be done by
capturing the associated message and not giving it to the inherited handler.
What exactly do you
want to do?

Ciao, Mike

To unsubscribe from this group, send an email to:
VirtualTreeview-unsubscribe@egroups.com


re: Banded Columns in grid more than one row of cells per node

From: [emanuelil@y...]
Date: Sun Jan 28, 2001 1:55 pm
Subject: Re: Banded Columns in grid more than one row of cells per node

Hi mike,
I just ask on col's view possibility, to give more than one col
(one under another) per node, so u can see a 'full' picture of
node 'record' . I illustrate it down for 2 nodes :

Node1 :
Col1 | Col2 | Col3 |
Col4 | |
node 2:
Col1 | Col2 | Col3 |
Col4 | |

now u have any idea ?

Emanuel


re: Background/ invisible nodes

From: [jens.treichler@u...]
Date: Sun Jan 28, 2001 2:47 pm
Subject: Re: Background/ invisible nodes

Hi Mike

> Mmm, I need to see the code and step through it. Note, there is an
option to switch of grid lines.
> But it seems not to be the problem because you wrote only about
vertical grid lines not horizontal
> lines. The used BitBlt operation should really work since it is a
very basic operation. Please look
> how large the stipple bitmap is.

Just found the bug while seting setwindoworgex...
You are using the SelectClipRgn function.
The SDK States:
The SelectClipRgn function assumes that the coordinates for a region
are specified in device units.
You should use LPtoDP here.

Jens


re: My mistake

From: Tony Cardalda [software@z...]
Date: Mon Jan 29, 2001 10:57 am
Subject: RE: [VirtualTreeview] My mistake

> -----Original Message-----
> From: Mike Lischke [mailto:[public@l...]]
> Sent: Friday, January 26, 2001 15:52
> To: VirtualTreeview@yahoogroups.com
> Subject: RE: [VirtualTreeview] My mistake
>
>
> > I filled it with some Collection.Count -1;
> > And filling in a negative number will result in a AV;
> > please replace the first line of SetChildCount in:
> >
> > begin
> > if NewChildCount <= 0 then
> > DeleteChildren(Node)
> > else
> > begin
>
> What version of VT do you have Tony? The code should look like:

Version 14-01-2001.

>
> procedure TBaseVirtualTree.SetRootNodeCount(Value: Cardinal);
>
> begin
> // don't set the root node count until all other properties
> (in particular the OnInitNode event)
> have been set
> if csLoading in ComponentState then
> FRoot.ChildCount := Value
> else
> if FRoot.ChildCount <> Value then
> begin
> BeginUpdate;
> InterruptValidation;
> SetChildCount(FRoot, Value);
> EndUpdate;
> end;
> end;
>
> and Value is defined as cardinal so it can never become negative.

You are right; it will pass the minus one as 4294967295 (!)
And after that it chokes.

>
> > When setting the first column to Autosize; some text's will be
> > abbreviated; even if there is enough space. When clicking
> on the item,
> > the full text is shown.
>
> Does not happen in Advanced demo (properties tree), so could
> you please make a small demo...
>

Again, you are right.
I filled the VST on response of another VST with different values.
VST.Clear solved the caching problem.

>
> > Also; when TVTHeader columns are defined; wouldn't it be nice to let
> > them popup when doubleclicking the VST in the IDE instead
> of generating
> > a FldChange() event?
>
> I'm not sure if I get this. Do you mean the event handler
> which is automatically inserted into the
> source code when double clicking the control? If yes then
> sorry, but I have no intention to write
> also a component editor...
>

No, it's not what I meant.
To display the column property editor you should first lookup the Header
property and then press ... on Columns.
May be its nice that showing this property editor also popups when
doubleclicking the VST.

> Ciao, Mike
>
>
> To unsubscribe from this group, send an email to:
> VirtualTreeview-unsubscribe@egroups.com
>
>
>

Saludos,
TC.


re: Mouse events

From: "Mike Lischke" [public@l...]
Date: Mon Jan 29, 2001 9:39 pm
Subject: RE: [VirtualTreeview] Mouse events

> Am trying to catch the mouse event before it actually causes anything (i.e a
> OnBeforeEdit) and ability to drop the message from bubbling to downstream
> handlers (for example, to create a non-selectable item in a list).

My idea would be to override WndProc of the control (if you derive your own
one) or subclass it by setting a new window procedure and check there for
unwanted mouse down messages. By not passing it to the originial handler the
message is effectly stopped on its way down.

Ciao, Mike


re: Re: Banded Columns in grid more than one row of cells per node

From: "Mike Lischke" [public@l...]
Date: Mon Jan 29, 2001 9:39 pm
Subject: RE: [VirtualTreeview] Re: Banded Columns in grid more than one row of cells per node

Hi Emanuel,

> I just ask on col's view possibility, to give more than one col
> (one under another) per node, so u can see a 'full' picture of
> node 'record' . I illustrate it down for 2 nodes :
>
> Node1 :
> Col1 | Col2 | Col3 |
> Col4 | |
> node 2:
> Col1 | Col2 | Col3 |
> Col4 | |
>
> now u have any idea ?

Well, well, I think I understand. Is it that you want a kind of column wrap, so
all what is hidden on the right hand side is wrapped to the next line? If yes I
then I have to say this is not possible. A node has one simple rectangle place
and columns go in one single line. It would be a nightmare to manage scrolling
with wrapping columns.

Ciao, Mike


re: Background/ invisible nodes

From: "Mike Lischke" [public@l...]
Date: Mon Jan 29, 2001 9:39 pm
Subject: RE: [VirtualTreeview] Background/ invisible nodes

> Just found the bug while seting setwindoworgex...
> You are using the SelectClipRgn function.
> The SDK States:
> The SelectClipRgn function assumes that the coordinates for a region
> are specified in device units.
> You should use LPtoDP here.

Thank you for pointing this out and also for your personal mail. I will have to
work this out...

To all:

I just have uploaded version 2.1 of VT to the file area of yahoogroups. In the
past four days I implemented node local visibility. That means you can now show
or hide nodes individually without rebuilding the whole tree or parts of it.

This required a slight change in the visibility paradigm as now the term
"visible" refers to the property of a node to be marked as being visible (state
vsVisible), while the previous "visible" term (former IsVisible property) has
now been expanded to "visible path" (as property VisiblePath) which means that
all parent nodes of a particular node are expanded. Both properties together
make now up the property "fully visible" (as property FullyVisible). When
created every node is by default visible. This is a new kind of handling node
states because previously all nodes started with empty states. The visible
state can be removed in OnInitNode making so a node initially being hidden.

Unfortunately, the additional flag vsVisible caused the TVirtualNodeState type
to grow to a word sized type (because vsVisible is the nineth member), which in
turn broke again the streaming system because the type is also used in the
chunk records. You can see again how careful one should be before adding new
features. For future enhancements I have now added a reserved cardinal field to
the chunk record.

Please check the new version in your application and tell me any error you may
find together with a precise description how to reproduce the bug.

Ciao, Mike


re: My mistake

From: "Mike Lischke" [public@l...]
Date: Mon Jan 29, 2001 9:39 pm
Subject: RE: [VirtualTreeview] My mistake

>
> > and Value is defined as cardinal so it can never become negative.
>
> You are right; it will pass the minus one as 4294967295 (!)
> And after that it chokes.

You have range and overflow checking switched off. This is not a good idea as
long as the code is not yet correctly working.

> Again, you are right.
> I filled the VST on response of another VST with different values.
> VST.Clear solved the caching problem.

Using InvalidateNode would also help. The string tree "listens" to this method
and resets its cached width.

> No, it's not what I meant.
> To display the column property editor you should first lookup the Header
> property and then press ... on Columns.
> May be its nice that showing this property editor also popups when
> doubleclicking the VST.

Also this feature would require a component editor (to override the design time
default behaviour). If somebody on this list likes to implement such a nice
tool then please go ahead...

Ciao, Mike


New file uploaded to VirtualTreeview

From: [VirtualTreeview@yahoogroups.com>
Date: Mon Jan 29, 2001 9:40 pm
Subject: New file uploaded to VirtualTreeview

Hello,

This email message is a notification to let you know that
a file has been uploaded to the Files area of the VirtualTreeview
group.

File : /VirtualTrees.zip
Uploaded by : [public@l...]
Description : Prerelease of VT version 2.1 (core unit only)

You can access this file at the URL

http://groups.yahoo.com/group/VirtualTreeview/files/VirtualTrees.zip

To learn more about eGroups file sharing, please visit

http://help.yahoo.com/help/us/groups/files

Regards,

[public@l...]
Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms

Replies | Author | Date
360 | New file uploaded to VirtualTreeview | [VirtualTreeview@y...] | Mon 1/29/2001
420 | New file uploaded to VirtualTreeview | [VirtualTreeview@y...] | Sun 2/4/2001
576 | New file uploaded to VirtualTreeview | [VirtualTreeview@y...] | Sun 2/18/2001
588 | New file uploaded to VirtualTreeview | [VirtualTreeview@y...] | Sun 2/18/2001
636 | New file uploaded to VirtualTreeview | [VirtualTreeview@y...] | Mon 2/26/2001
696 | New file uploaded to VirtualTreeview | [VirtualTreeview@y...] | Tue 3/6/2001
778 | New file uploaded to VirtualTreeview | [VirtualTreeview@y...] | Thu 3/15/2001
834 | New file uploaded to VirtualTreeview | [VirtualTreeview@y...] | Fri 3/23/2001


New file uploaded to VirtualTreeview

From: [VirtualTreeview@yahoogroups.com>
Date: Mon Jan 29, 2001 9:46 pm
Subject: New file uploaded to VirtualTreeview

Hello,

This email message is a notification to let you know that
a file has been uploaded to the Files area of the VirtualTreeview
group.

File : /Advanced.zip
Uploaded by : [public@l...]
Description : Compiled advanced demo version 2.1

You can access this file at the URL

http://groups.yahoo.com/group/VirtualTreeview/files/Advanced.zip

To learn more about eGroups file sharing, please visit

http://help.yahoo.com/help/us/groups/files

Regards,

public@l...]
Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms


chat

From: "Mike Lischke" [public@l...]
Date: Mon Jan 29, 2001 9:58 pm
Subject: chat

Just to let you know: Yahoo (just like egroups ago) allows to meet in the chat
room of the mailing list. If there is enough demand we can set up a date and I
will be available for direct talk. You can do this of course also without me.
Just use http://groups.yahoo.com/group/VirtualTreeview/chat to start chatting.

Ciao, Mike

Dipl. Ing. Mike Lischke
Senior software developer
--
Homepage: http://www.lischke-online.de
GraphicEx: http://www.lischke-online.de/Graphics.html
Virtual Treeview: http://www.lischke-online.de/VirtualTreeview.html
Unicode Edit and library: http://www.lischke-online.de/Unicode.html


Custom checkboxes images

From: [fdcastel@y...]
Date: Tue Jan 30, 2001 4:11 pm
Subject: Custom checkboxes images

I need to use custom checkboxes images in VT (v1.31).

Studying the code (GREAT work, Mike!) I found a FCheckImages
property in TBaseVirtualTree, but it is declared as private
(doh!).

FCheckImages always point to one of 4 global imagelists in
VT unit (according with FCheckImageKind property). I could
change one of them, but they are inaccessible (declared in
implementation section, geee!).

Of course, I could change the source to add a 5th imagelist
(blergh!), move the FCheckImages declaration to protected
(easy!) or add some "GetCheckBoxImageList" event (maybe...),
but I prefer mantain the source code intact.

Anyone have some tips to do it WITHOUT change the source ??

TIA

F.D.Castel

 | Replies | Author | Date
363 | Re: Custom checkboxes images | Mike Lischke | Tue 1/30/2001
364 | Re: Custom checkboxes images | Fabio Augusto Dal Castel | Tue 1/30/2001


re: Custom checkboxes images

From: "Mike Lischke" [public@l...]
Date: Tue Jan 30, 2001 4:55 pm
Subject: RE: [VirtualTreeview] Custom checkboxes images

> I need to use custom checkboxes images in VT (v1.31).
>
> Anyone have some tips to do it WITHOUT change the source ??

Yes, quite easy to accomplish :-) Look into VirtualTrees.res.

Ciao, Mike

 | Replies | Author | Date
364 | Re: Custom checkboxes images | Fabio Augusto Dal Castel | Tue 1/30/2001


re: Custom checkboxes images

From: "Fabio Augusto Dal Castel" [fdcastel@y...]
Date: Tue Jan 30, 2001 5:36 pm
Subject: Re: Custom checkboxes images

> Yes, quite easy to accomplish :-) Look into VirtualTrees.res.

Of course!!! How I don't think this before?

I needed change this in only one app. I'll mantain a .res only
for it. Thanks Mike!

But anyway, if anyone have any clue/hack on how to do this
only coding the app (without change the VT source code/resources)
I would like to know.

Thanks again!

F.D.Castel


re: Basic printing

From: "Peter Evans" [pgevans@m...]
Date: Tue Jan 30, 2001 9:10 pm
Subject: Re: [VirtualTreeview] Basic printing

Thank you, you have put me on the right track.


re: Re: Banded Columns in grid more than one row of cells per node

From: Werner Lehmann [wl@b...]
Date: Tue Jan 30, 2001 10:25 pm
Subject: Re: [VirtualTreeview] Re: Banded Columns in grid more than one row of cells per node

Mike Lischke wrote:
>
> Well, well, I think I understand. Is it that you want a kind of column wrap,
so all what is hidden on the right hand side is wrapped to the next line? If
yes I then I have to say this is not possible. A node has one simple rectangle
place and columns go in one single line. It would be a nightmare to manage
scrolling with wrapping columns.

Mike,

I believe he is up to something different. What he wants is not a
column wraparound. I think he wants to have each 'node', lets call
it row for that matter, to have more than one line. And a free form
column layout. The express quantum grid from DevExpress has such a
feature. Imagine you want to display a record with multiple attributes
in each row/node, and one of these would be an image, others some
text. The image could go over the whole height of each row while the
other text attributes would go into 'sublines' within the row. DevExpress
has probably a picture of how this looks like if I could not explain
this good enough.

I have made such a control derived from TCustomListbox which utilizes
the owner draw style. The layout of each node can be assembled similar
to a html table with this one. Of course it is not so far developed
as VTree (and has less than 17,000 lines of code :).

Ownerdraw is probably the way Emanuel will have to go too. Unless you
care about implementing this but it sounds like a good deal of work.

Regards,
WL


Drawing a translucent node while dragging

From: "Fabio Augusto Dal Castel" [fdcastel@y...]
Date: Tue Jan 30, 2001 10:50 pm
Subject: Drawing a translucent node while dragging

Looking at VT features, I saw that the headers are draw in a
translucent way when dragging.

I want to do this with the nodes. When I drag a large node (eg.
"My largest directory name") over a small one (eg. "Temp") the
large almost cover all the small when using DragImageKing =
diComplete or diMainColumnOnly. If the dragging node was draw
partly transparent over the target the user could see it better.

I don't asking for a full implementation, only a few tips about
where I should start. Probably I must use the SimpleAlpha
function in the PaintTo method. But when? where?

I'll start the working now. Any help will be welcome.

Some tips this time, Mike? I wonder if you had a good purpose to
don't do it yet (too hard? please tell me!). What about a
DragImageKing = diTranslucent in the future ?

TIA

Fabio

 | Replies | Author | Date
372 | Re: Drawing a translucent node while dragging | Mike Lischke | Wed 1/31/2001


re: TVTHeader Columns

From: Werner Lehmann [wl@b...]
Date: Wed Jan 31, 2001 12:28 am
Subject: Re: [VirtualTreeview] TVTHeader Columns

Mike Lischke wrote:
>
> Hi Tony,
>
> > Is it possible for you to display the TVTHeader.Columns.Text instead of
> > 'column 0..x' when editing the collectionItems ?
>
> You have not looked up the source code, have you? The Text property of the
columns is a wide string
> and the VCL is not able to display wide strings correctly, hence I had to use
something simpler.
> Perhaps this is fixed in Delhpi 6 but even then I have at least to provide a
fallback for D5 and
> lower.

Isn't it possible to somehow convert it to an AnsiString? At least
with west european codepages this should not be a problem. Don't know
what to with others though. Maybe keep the current for these only then?

WL


re: My mistake

From: Werner Lehmann [wl@b...]
Date: Wed Jan 31, 2001 12:36 am
Subject: Re: [VirtualTreeview] My mistake

Mike Lischke wrote:
>
> > No, it's not what I meant.
> > To display the column property editor you should first lookup the Header
> > property and then press ... on Columns.
> > May be its nice that showing this property editor also popups when
> > doubleclicking the VST.
>
> Also this feature would require a component editor (to override the design
time default behaviour). If somebody on this list likes to implement such a
nice tool then please go ahead...

I did it. You may want to add the following code to the source. You may
also want to split up the source and create a different file for the
editor as Borland suggests.

Note that you also need to add lib\dclstd50.dcp to the requires part of
your design time package to get this code to compile.

Regards,
WL

...

implementation

{$R VirtualTrees.res}

uses
Consts, Math, ShlObj, CommCtrl, DsgnIntf, ColnEdit; // two additional units
needed

type
TVirtualTreeEditor = class (TDefaultEditor)
public
procedure Edit; override;
end;

...

{ TVirtualTreeEditor }

procedure TVirtualTreeEditor.Edit;
begin
ShowCollectionEditor(Designer, Component,
(Component as TBaseVirtualTree).Header.Columns, 'Columns');
end;

...


re: My mistake

From: Werner Lehmann [wl@b...]
Date: Wed Jan 31, 2001 9:15 am
Subject: Re: [VirtualTreeview] My mistake

Werner Lehmann wrote:
>
> I did it. You may want to add the following code to the source. You may

I forgot an important detail :)

procedure Register;

begin
RegisterComponents('Virtual Controls', [TVirtualStringTree,
TVirtualDrawTree]);
RegisterComponentEditor(TVirtualStringTree, TVirtualTreeEditor);
RegisterComponentEditor(TVirtualDrawTree, TVirtualTreeEditor);
end;

Regards,
WL


re: Re: Banded Columns in grid more than one ro w of cells per node

From: Mike Lischke [public@l...]
Date: Wed Jan 31, 2001 10:33 am
Subject: RE: [VirtualTreeview] Re: Banded Columns in grid more than one ro w of cells per node

Hi Werner,

> I believe he is up to something different. What he wants is not a
> column wraparound. I think he wants to have each 'node', lets call
> it row for that matter, to have more than one line. And a free form
> column layout. The express quantum grid from DevExpress has such a
> feature. Imagine you want to display a record with multiple attributes
> in each row/node, and one of these would be an image, others some
> text. The image could go over the whole height of each row while the
> other text attributes would go into 'sublines' within the
> row. DevExpress
> has probably a picture of how this looks like if I could not explain
> this good enough.
>

Thank you for clarifying this. I know the DevExpress stuff and find them
excellent (at least what I can see from the demos). But I have no plans to
implement such a grid feature. The Quantum grid is a grid with some (few)
tree features not a tree on its own. I have doubts that uniting too many
controls into one will have a positive effect at the end.

However, people can derive a new control form VT and make it working the way
they want. I have no problem with that (quite the opposite is true, I
appreciate this), but I feel it is wrong to build it into the base class.

> Ownerdraw is probably the way Emanuel will have to go too.

I agree here. Ownerdraw would be the best way for quick results.

Ciao, Mike


re: Drawing a translucent node while dragging

From: Mike Lischke [public@l...]
Date: Wed Jan 31, 2001 10:57 am
Subject: RE: [VirtualTreeview] Drawing a translucent node while dragging

Hi Fabio,

> Looking at VT features, I saw that the headers are draw in a
> translucent way when dragging.
>
> I want to do this with the nodes. When I drag a large node (eg.
> "My largest directory name") over a small one (eg. "Temp") the
> large almost cover all the small when using DragImageKing =
> diComplete or diMainColumnOnly. If the dragging node was draw
> partly transparent over the target the user could see it better.

I have no doubts that this would be much better. Since I only work on W2K
(at home and in the office) I know this blend effect quite well and like it
:o]

> I don't asking for a full implementation, only a few tips about
> where I should start. Probably I must use the SimpleAlpha
> function in the PaintTo method. But when? where?
> I'll start the working now. Any help will be welcome.
>
> Some tips this time, Mike? I wonder if you had a good purpose to
> don't do it yet (too hard? please tell me!). What about a
> DragImageKing = diTranslucent in the future ?

There are several reasons why I have not implemented such a cool thing.

Firstly, VT was the first control ever with a full drag image (W2K was not
out yet at the time when I made it).

Secondly, there was no example how it could look like nor how to implement
it. I asked the greatest Win API gurus I know of (some of you may know
www.experts-exchange.com) and searched the news groups but nobody could come
up with a workable solution. Finally I got help by one of my bosses (Arne
Schapers, the german readers may know him from his DirectX articles in the
c't). Arne gave me the base part of the solution as it is now.

Thirdly, when I implemented the blending for the header and later the hint I
also thought about the main drag image. But it turned out that with large
control window sizes this will become much to slow. Now I understood why in
W2K they fade out the drag image so it never becomes larger than, say, about
300 x 300 pixels.

Fourthly, when I finally got the idea how to do it I never found the time to
actually impelement it. There was always something more important to do so I
delayed it all the time :o]

Now there are you Fabio and I'm very pleased that you want to take the task
to implement a blended drag image. My suggestion is that you always limit
the image size to a maximum amount, but you have to make sure to show the
correct part of the tree. Look into TBaseDragDropManager.DragStart where the

FOwner.PaintTo(BM.Canvas, Bounds, True, FOwner.FDragImageKind =
diMainColumnOnly, False, False);

call actully paints the tree to an offscreen bitmap which is the source for
everything following. You can use the SimpleAlpha routine for blending just
like the header does. I think if you get reasonable results, say, on a Win95
350Mhz machine then we consider it as being fast enough (we could perhaps
optimize for pf24Bit and pf32Bit, currently only pf24Bit is supported and
implicetly converted by Windows if rendered to other formats). Perhaps a new
blend function is needed, however, since you have to fade the drag image in
addition to the normal blend. This means the transparency factor varies over
the image (one way would be to modulate the blend factor by X * X + Y * Y
with X = 0 and Y = 0 at the center of the drag image).

I would not invent a new drag image option. I think we should just use what
there is already but replace the transparent image by the blended one. I
have the feeling the new solution could well be smaller than the former and
requires less resources, but that's only a feeling.

Ciao, Mike


re: TVTHeader Columns

From: Mike Lischke [public@l...]
Date: Wed Jan 31, 2001 11:00 am
Subject: RE: [VirtualTreeview] TVTHeader Columns

> Isn't it possible to somehow convert it to an AnsiString? At least
> with west european codepages this should not be a problem. Don't know
> what to with others though. Maybe keep the current for these
> only then?

I tried to convert the Unicode caption to MBCS but failed because the string
might contain text in various languages and for the convertion you need the
exact locale. Additonally, what about mixed languages, not installed fonts
for a particular language, etc.?

Ciao, Mike


re: design time editor (was: My mistake)

From: Mike Lischke [public@l...]
Date: Wed Jan 31, 2001 11:04 am
Subject: RE: [VirtualTreeview] design time editor (was: My mistake)

> I did it. You may want to add the following code to the
> source. You may also want to split up the source and create a different
file for the
> editor as Borland suggests.

Thank you Werner. Of course I will split the design time and run time code
and create a registration unit. This will add another file, however, for a
quite small benefit, but the solution is small too and who knows, perhaps
there will be more design time code in the future :-)

Ciao, Mike


re: TVTHeader Columns

From: Werner Lehmann [wl@b...]
Date: Wed Jan 31, 2001 11:30 am
Subject: Re: [VirtualTreeview] TVTHeader Columns

Mike Lischke wrote:
>
> I tried to convert the Unicode caption to MBCS but failed because the string
> might contain text in various languages and for the convertion you need the
> exact locale. Additonally, what about mixed languages, not installed fonts
> for a particular language, etc.?

I am not so much into the Unicode stuff (for instance I always thought that
Unicode was MBCS already) but I would do this rather pragmatic. If every other
byte in the WideString is zero, the conversion would just be to drop these
zero bytes and get an AnsiString. If not: everything stays as it is now.

Would work on many systems I suppose. Performance can be neglected (only design-
time, small strings).

Regards,
WL


re: TVTHeader Columns

From: Mike Lischke [public@l...]
Date: Wed Jan 31, 2001 11:46 am
Subject: RE: [VirtualTreeview] TVTHeader Columns

> I am not so much into the Unicode stuff (for instance I
> always thought that Unicode was MBCS already) but I would do this rather
> pragmatic. If every other byte in the WideString is zero, the conversion
would just be
> to drop these zero bytes and get an AnsiString. If not: everything stays
as
> it is now.

Mmh for the time being the code could check for a character > 255 and
displays a default string in this case otherwise convert the WideString to
ANSI. Unfortunately, even if we would write a new collection editor it would
not work to display Unicode strings because the the entire OTA works only
with ANSI strings :-/

Ciao, Mike


arabic and hebrew scripts

From: Mike Lischke [public@l...]
Date: Wed Jan 31, 2001 2:14 pm
Subject: arabic and hebrew scripts

Can anybody on this list provide me with some meaningfull arabic and/or
hebrew text which I can show in an application demonstrating right-to-left
directionality? I would be very happy if I could get text for a couple of
nodes in both langugages along with the english (or even german)
translation.

I'm using Outlook 2000 so I can directly read UTF-8 encoded eMails (provided
yahoogroups does not make any modification to the text). A simple Word 2000
document would serve as well, of course. If all fails I accept also
character hex codes.

Thank you in advance and

Ciao, Mike

 | Replies | Author | Date
378 | Way to change foreground text color for a cell | Geoffrey Pan | Wed 1/31/2001
379 | Re: Way to change foreground text color for a cel | Geoffrey Pan | Wed 1/31/2001
381 | Re: Way to change foreground text color for a cel | Fabio Augusto Dal Castel | Wed 1/31/2001


Way to change foreground text color for a cell

From: "Geoffrey Pan" [gpan@c...]
Date: Wed Jan 31, 2001 4:21 pm
Subject: Way to change foreground text color for a cell

I know this can be done with customdraw, but then other cells don't get
rendered(if they are owner-drawn) any suggestions?

Need to change the text forecolor on a cell-by-cell basis in one column,
while still leaving the other columns as default.

Thanks in advance

 | Replies | Author | Date
379 | Re: Way to change foreground text color for a cel | Geoffrey Pan | Wed 1/31/2001
381 | Re: Way to change foreground text color for a cel | Fabio Augusto Dal Castel | Wed 1/31/2001


re: Way to change foreground text color for a cell

From: "Geoffrey Pan" [gpan@c...]
Date: Wed Jan 31, 2001 5:18 pm
Subject: RE: [VirtualTreeview] Way to change foreground text color for a cell

Found answer. Thanks :).

-----Original Message-----
From: Geoffrey Pan [mailto:[gpan@c...]]
Sent: Wednesday, January 31, 2001 10:21 AM
To: VirtualTreeview@yahoogroups.com
Subject: [VirtualTreeview] Way to change foreground text color for a
cell

I know this can be done with customdraw, but then other cells don't get
rendered(if they are owner-drawn) any suggestions?

Need to change the text forecolor on a cell-by-cell basis in one column,
while still leaving the other columns as default.

Thanks in advance

To unsubscribe from this group, send an email to:
VirtualTreeview-unsubscribe@egroups.com


re: Way to change foreground text color for a c ell

From: Bender Heri [HBender@E...]
Date: Wed Jan 31, 2001 5:25 pm
Subject: RE: [VirtualTreeview] Way to change foreground text color for a c ell

> -----Original Message-----
> From: Geoffrey Pan [mailto:[gpan@c...]]
> Sent: Wednesday, January 31, 2001 5:21 PM
> To: VirtualTreeview@yahoogroups.com
> Subject: [VirtualTreeview] Way to change foreground text color for a
> cell
>
>
> I know this can be done with customdraw, but then other cells
> don't get
> rendered(if they are owner-drawn) any suggestions?
>
> Need to change the text forecolor on a cell-by-cell basis in
> one column,
> while still leaving the other columns as default.
>
In the event OnPaintText you get a canvas, a node and a column parameter.
There you can adjust the canvas properties as you like.

Heri Bender


re: Way to change foreground text color for a cell

From: "Fabio Augusto Dal Castel" [fdcastel@y...]
Date: Wed Jan 31, 2001 6:07 pm
Subject: Re: Way to change foreground text color for a cell

Change the Canvas.Font.Color in the OnPaintText Event.
Don't need to be owner draw...

[]'s
Fabio.


Descendant component

From: "Paul Gallagher" [paul@t...]
Date: Thu Feb 1, 2001 3:44 am
Subject: Descendant component

I am building a descendant of the VirtualTree component that will be IBO aware.

In the descendantcomponent, when I add a root node, I am using this:
VTree.RootNodeCount := Count + 1;

But then, to set the text of the node just added, should I intercept the
OnGetText event, or is there a method to set the text directly? If I should
intercept the OnGetText event, I could use a little help on how to do that.

I am VERY new to VirtualTree, and my component writing skills are not that
good, so assume the worst. <g>

Paul

[Non-text portions of this message have been removed]

 | Replies | Author | Date
385 | Re: Descendant component | Mike Lischke | Thu 2/1/2001
393 | Re: Descendant component | Paul Gallagher | Fri 2/2/2001
394 | Re: Descendant component | Paul Gallagher | Fri 2/2/2001
395 | Re: Descendant component | Geoffrey Pan | Fri 2/2/2001
396 | Re: Descendant component | Ondrej Kelle | Fri 2/2/2001
397 | Re: Descendant component | Ondrej Kelle | Fri 2/2/2001
398 | Re: Descendant component | Bender Heri | Fri 2/2/2001
402 | Re: Descendant component | Mike Lischke | Fri 2/2/2001
403 | Re: Descendant component | Mike Lischke | Fri 2/2/2001


Can you point me in the right direction?

From: [d.lindsey@d...]
Date: Thu Feb 1, 2001 4:05 am
Subject: Can you point me in the right direction?

Hi,
Started using VirtualTreeView but every now and then during program
testing if the mouse simply moves onto the component I get an access
violation (write of address). Now one time I had a program compiling
and running fine, then when I went back into Delphi to do some more
work on it the violation returned. I am sure this problem is unique
to my setup, but I can hone in on the problem. I have even removed
some event methods to see if it was my code.
Can one got any ideas?
Regards
David

 | Replies | Author | Date
384 | Re: Can you point me in the right direction? | =?iso-8859-1?Q?Bj=F6rn_Lindel | Thu 2/1/2001
388 | Re: Can you point me in the right direction? | [d.lindsey@d...] | Thu 2/1/2001
390 | Re: Can you point me in the right direction? | =?iso-8859-1?Q?Bj=F6rn_Lindel | Thu 2/1/2001


re: Can you point me in the right direction?

From: Björn Lindell [bli@c...]
Date: Thu Feb 1, 2001 7:25 am
Subject: Re: [VirtualTreeview] Can you point me in the right direction?

Maybe this is similar to a problem I had, sometimes
when running from within the IDE, the whole app, and system
would lock up. This has however only happened on a W98-machine.
When running W95 or W2K I have never experienced those problems.
Basically, I stopped using the W98-install for that purpose.
I have never experienced any similar problems outside of Delphi.
I don't think this was with the 2.0 of VT, but that is not to say that
the problem (if it is caused by VT) has gone away, since I dont use
it through W98 anymore.

/Björn

----- Original Message -----
From: [d.lindsey@d...]
To: [VirtualTreeview@yahoogroups.com>
Sent: Thursday, February 01, 2001 5:05 AM
Subject: [VirtualTreeview] Can you point me in the right direction?

> Hi,
> Started using VirtualTreeView but every now and then during program
> testing if the mouse simply moves onto the component I get an access
> violation (write of address). Now one time I had a program compiling
> and running fine, then when I went back into Delphi to do some more
> work on it the violation returned. I am sure this problem is unique
> to my setup, but I can hone in on the problem. I have even removed
> some event methods to see if it was my code.
> Can one got any ideas?
> Regards
> David
>
>
>
> To unsubscribe from this group, send an email to:
> VirtualTreeview-unsubscribe@egroups.com
>
>

Replies Author Date


re: Descendant component

From: Mike Lischke [public@l...]
Date: Thu Feb 1, 2001 10:40 am
Subject: RE: [VirtualTreeview] Descendant component

Hi Paul,

> In the descendantcomponent, when I add a root node, I am using this:
> VTree.RootNodeCount := Count + 1;
>
> But then, to set the text of the node just added, should I
> intercept the OnGetText event, or is there a method to set
> the text directly? If I should intercept the OnGetText event,
> I could use a little help on how to do that.

It appears that mixing streamlined and event driven systems like databases
and VT is a very difficult job. The main point is, and you should always
have this in golden letters in front of your eyes, VT asks the application
when something is needed. This is totally different to what standard
controls do (and is the main part of the new paradigm). Usually controls are
pumped with data which is never or at least not immediately used which
causes a lot of overhead.

The problem with linear data is that you often have no random access to it
(or only with serious trouble). Databases are such a linear medium. I don't
know how to implement an effective DB aware VT. If I would know then I would
do it myself. The only thing I know is that also as DBTree VT should ask its
data on demand.

But now to your problem: I assume you have somewhere a datasource which is
accessible by every part of the tree. So when you add the new root node then
you can immediately call ValidateNode with the newly added node. In the
OnInitNode event (or the overriden DoInitNode method) you can then acces the
datasource which still points to the same record which caused the node to be
added. Hence you can fill the node with all the stuff you need.

Another approach would be to continue work in the code where you added the
node. Retrieve the node's data record and fill it immediately after you have
added it. If you don't have data in the node's record which must be freed
when deleting the node you should be very fine this way. Otherwise you have
to make the node being initialized or there will be no callback before the
node is released and a memory leak is the result. To make the node
initialized you can still call ValidateNode (or InitNode in tree
descentants) or just set the vsInitialized state. The latter is not
encouraged unless you don't publish OnInitNode.

My most prefered version is some kind of bookmark which is stored in the
node (along with a caption to show), nothing else. And whenever data is
needed then the datasource is navigated to the stored bookmark and the other
data is read (for grids, columns etc.). Additionally, you could free child
nodes immediately after a node has been collapsed, saving so resources. But
this would require to execute the query for this node again and again.

You see, I have no solution yet and I hope you will find an elegant and
effective way.

Ciao, Mike


(Almost) Translucent Dragging Nodes

From: "Fabio Augusto Dal Castel" [fdcastel@y...]
Date: Thu Feb 1, 2001 3:47 pm
Subject: (Almost) Translucent Dragging Nodes

Well.. While the solution aren't ready (can take a looong time
until I get a full working algorithm), here goes a quick-and-
dirty way. The idea is "puncture" the image with the background
(transparent) color. It's the same that Windows Desktop does.

Here is the function (In the lack of a better name ;)

procedure XorPixels(BM: TBitmap);
var
BackColor: TColor;
RGBBackColor: TRGBTriple;
x, y: Integer;
Line: PRGBTripleArr;
begin
BackColor := ColorToRGB(FOwner.Color);
RGBBackColor.rgbtRed := GetRValue(BackColor);
RGBBackColor.rgbtGreen := GetGValue(BackColor);
RGBBackColor.rgbtBlue := GetBValue(BackColor);

BM.PixelFormat := pf24bit;
for y := 0 to BM.Height - 1 do
begin
Line := BM.ScanLine[y];
for x := 0 to BM.Width - 1 do
if Boolean((y xor x) and 1) then // Simple, huh?
Line[x] := RGBBackColor;
end;
BM.PixelFormat := pfDevice;
end;

To use it, simply add the line

XorPixels(BM);

after the "FOwner.PaintTo(BM.Canvas, ..." on
TBaseDragDropManager.DragStart.

It isn't so cool as the Alpha Blending effect, but it is a
start.

That's all folks!

Fabio

 | Replies | Author | Date
389 | Re: (Almost) Translucent Dragging Nodes | Fabio Augusto Dal Castel | Thu 2/1/2001


Need help with DropManager.DragStart & DragMove

From: "Fabio Augusto Dal Castel" [fdcastel@y...]
Date: Thu Feb 1, 2001 7:34 pm
Subject: Need help with DropManager.DragStart & DragMove

Mike.

I've studying your code for dragging. All that BitBlts are
driving me nuts!

The DragMove code is well commented. However the DragStart
isn't. Neither are the properties (private fields) of
TBaseDragDropManager.

Can you please give me an general overview of algorithm and
a brief description (what is it for) of

- FMask, FImage, FMouseSpot
- FBackOldDC, FBackNewDC, FWorkDC, FCopyDC
- FHPicBMP, FHMaskBMP, FOldWorkBMP, FOldCopyBMP,
FOldBackOldBMP, FOldBackNewBMP

or (if there is too much to say) could you give me some
related links ?

P.S.: Sorry to all folks for post this message here, but I
don't want send a mail directly to Mike. I don't like when
someone in a newsgroup send a message directly to my
mailbox...

P.S.2: Of course, if anybody could help me I will be very
grateful!

TIA

Fabio


re: Can you point me in the right direction?

From: [d.lindsey@d...]
Date: Thu Feb 1, 2001 10:01 pm
Subject: Re: Can you point me in the right direction?

Björn,
You may have something here as this is happening on a W98 machine and
in general I have no end of problems (java etc.) with this fault-
ridden product. However, my problem does occur outside the IDE. Once
I have a compile with this problem it there to stay irrespective of
the IDE presence. I will run a compiled version of this problem on
the Win2000 machine to see what happens. As I have been following
Mike's work since TreeNT, my feeling is it's a memory management
issue relating to windows. For example another problem I have is when
Word or FrontPage is run I have to reboot the machine before using
Delphi; these programs take control of memory for speed re-runs. A
similar thing could be happening with VirtualTree?

Regards
David


re: (Almost) Translucent Dragging Nodes

From: "Fabio Augusto Dal Castel" [fdcastel@y...]
Date: Thu Feb 1, 2001 11:00 pm
Subject: Re: (Almost) Translucent Dragging Nodes

Ups! I forgot the types declaration:

type
PRGBTripleArr = ^TRGBTripleArr;
TRGBTripleArr = array[Word] OF TRGBTriple;

However, I've did another implementation. It's a (very) little
faster, and doesn't need the types above:

procedure XorPixels(BM: TBitmap);
var
BackColor: TColor;
RGBBackColor: TRGBTriple;
x, y: Integer;
Line: PRGBTriple;
begin
BackColor := ColorToRGB(FOwner.Color);
RGBBackColor.rgbtRed := GetRValue(BackColor);
RGBBackColor.rgbtGreen := GetGValue(BackColor);
RGBBackColor.rgbtBlue := GetBValue(BackColor);

with BM do
begin
PixelFormat := pf24bit;
for y := 0 to Height - 1 do
begin
Line := ScanLine[y];
for x := 0 to Width - 1 do
begin
if Boolean((y xor x) and 1) then
Line^ := RGBBackColor;
Inc(Line);
end;
end;
PixelFormat := pfDevice;
end;
end;

Remember: The function uses FOwner property of
TBaseDragDropManager. This way it must be declared as a
method of TBaseDragDropManager or inside the DragStart.

That's all!

Fabio


re: Re: Can you point me in the right direction?

From: Björn Lindell [bli@c...]
Date: Thu Feb 1, 2001 11:27 pm
Subject: Re: [VirtualTreeview] Re: Can you point me in the right direction?

I never experienced my problem except from within Delphi, and I think
at least once it was when I was trying to debug code called from "OnGetText"
event. Although this does not at all prove that VT is the cause.
debugging code. Mind you, since I am still in the development phase, I
haven't
tested the app with W98 since the problem. Theoretically, the problem
could of course occur outside of Delphi, but since I am no stranger to
problems
occuring when using the IDE, the problem could as well be with Delphi or
some other component or due to some strange debugging dependency
(I am merely speculating here).

Regards,
Björn

From: [d.lindsey@d...]
To: <VirtualTreeview@yahoogroups.com>
Sent: Thursday, February 01, 2001 11:01 PM
Subject: [VirtualTreeview] Re: Can you point me in the right direction?

Björn,
You may have something here as this is happening on a W98 machine and
in general I have no end of problems (java etc.) with this fault-
ridden product. However, my problem does occur outside the IDE. Once
I have a compile with this problem it there to stay irrespective of
the IDE presence. I will run a compiled version of this problem on
the Win2000 machine to see what happens. As I have been following
Mike's work since TreeNT, my feeling is it's a memory management
issue relating to windows. For example another problem I have is when
Word or FrontPage is run I have to reboot the machine before using
Delphi; these programs take control of memory for speed re-runs. A
similar thing could be happening with VirtualTree?

Regards
David

To unsubscribe from this group, send an email to:
VirtualTreeview-unsubscribe@egroups.com


Version 2.1 issues

From: "Anthony Mills" [amills@m...]
Date: Fri Feb 2, 2001 12:21 am
Subject: Version 2.1 issues

I just tried substituting the newest prerelease source from the group's file
download spot.

Unfortunately, voRightClickSelect is still a bit off. Right-click on an
item, the context menu shows, great. Right-click on another item, the
context menu just goes away; it doesn't show another context menu for the
newly-selected item.

Also, if I have a multiselection, I can't drag it; as soon as I click in the
selection to start the drag, the rest of the selection disappears.

TBaseVirtualTree.InternalConnectNode seems to call GetFullyVisible with the
root node as a parameter when I do

Node := Tree.InsertNode(nil, amAddChildFirst);

This produces an assertion failure in GetFullyVisible due to it being passed
the root node.

Thanks Mike, keep up the great work!

Regards,

Tony

 | Replies | Author | Date
392 | Kylix! | Geoffrey Pan | Fri 2/2/2001
400 | Re: Version 2.1 issues | Mike Lischke | Fri 2/2/2001


Kylix!

From: "Geoffrey Pan" [gpan@c...]
Date: Fri Feb 2, 2001 1:31 am
Subject: Kylix!

Alive and well. Any idea if VT compiles on it yet/or scale of changes
needed?.

(Looking forward to getting a copy in a few weeks)


re: Descendant component

From: "Paul Gallagher" [paul@t...]
Date: Fri Feb 2, 2001 2:25 am
Subject: Re: [VirtualTreeview] Descendant component

Mike,

I need a little help with the ValidateNode Method. Im not quite sure how to
use it, and I don't see any examples. This is basically what Im doing. Its
probably all wrong, but at least it's a start.

I am incrementing RootNodeCount to add nodes, and then I need to somehow get
the value 's' to the caption property of my record.

procedure TIB_CustomVTree.LoadTree;
var
s : string;
begin
DataLink.DataSet.BufferFirst;
while not DataLink.DataSet.BufferEOF do
begin
RootNodeCount := RootNodeCount + 1;
ValidateNode(FNode, false);
s := DataLink.Dataset.FieldByName('DESCRIPTION').Value;
DataLink.DataSet.BufferNext;
end;
end;

TIA,
Paul Gallagher


re: Descendant component

From: "Paul Gallagher" [paul@t...]
Date: Fri Feb 2, 2001 2:54 am
Subject: Re: [VirtualTreeview] Descendant component

More on this.

I was using the DoInitNode event to add the data, but it seems like this
event is only called if the node is visible in the tree. As more nodes are
added that are out of view, the DoInitNode does not get called. Is that
right, or am I doing something wrong?

Paul

----- Original Message -----
From: "Paul Gallagher" [paul@t...]
To: <VirtualTreeview@yahoogroups.com>
Sent: Thursday, February 01, 2001 8:25 PM
Subject: Re: [VirtualTreeview] Descendant component

> Mike,
>
> I need a little help with the ValidateNode Method. Im not quite sure how
to
> use it, and I don't see any examples. This is basically what Im doing. Its
> probably all wrong, but at least it's a start.
>
> I am incrementing RootNodeCount to add nodes, and then I need to somehow
get
> the value 's' to the caption property of my record.
>
> procedure TIB_CustomVTree.LoadTree;
> var
> s : string;
> begin
> DataLink.DataSet.BufferFirst;
> while not DataLink.DataSet.BufferEOF do
> begin
> RootNodeCount := RootNodeCount + 1;
> ValidateNode(FNode, false);
> s := DataLink.Dataset.FieldByName('DESCRIPTION').Value;
> DataLink.DataSet.BufferNext;
> end;
> end;
>
> TIA,
> Paul Gallagher
>
>
>
> To unsubscribe from this group, send an email to:
> VirtualTreeview-unsubscribe@egroups.com
>
>
>
>

 | Replies | Author | Date
395 | Re: Descendant component | Geoffrey Pan | Fri 2/2/2001


re: Descendant component

From: "Geoffrey Pan" [gpan@c...]
Date: Fri Feb 2, 2001 5:36 am
Subject: RE: [VirtualTreeview] Descendant component

That is by design, the node only gets filled when its needed (scrolled into
view)

-----Original Message-----
From: Paul Gallagher [mailto:[paul@t...]]
Sent: Thursday, February 01, 2001 8:55 PM
To: [VirtualTreeview@yahoogroups.com
Subject: Re: [VirtualTreeview] Descendant component

More on this.

I was using the DoInitNode event to add the data, but it seems like this
event is only called if the node is visible in the tree. As more nodes are
added that are out of view, the DoInitNode does not get called. Is that
right, or am I doing something wrong?

Paul

----- Original Message -----
From: "Paul Gallagher" <paul@t...]
To: <VirtualTreeview@yahoogroups.com>
Sent: Thursday, February 01, 2001 8:25 PM
Subject: Re: [VirtualTreeview] Descendant component

> Mike,
>
> I need a little help with the ValidateNode Method. Im not quite sure how
to
> use it, and I don't see any examples. This is basically what Im doing. Its
> probably all wrong, but at least it's a start.
>
> I am incrementing RootNodeCount to add nodes, and then I need to somehow
get
> the value 's' to the caption property of my record.
>
> procedure TIB_CustomVTree.LoadTree;
> var
> s : string;
> begin
> DataLink.DataSet.BufferFirst;
> while not DataLink.DataSet.BufferEOF do
> begin
> RootNodeCount := RootNodeCount + 1;
> ValidateNode(FNode, false);
> s := DataLink.Dataset.FieldByName('DESCRIPTION').Value;
> DataLink.DataSet.BufferNext;
> end;
> end;
>
> TIA,
> Paul Gallagher
>
>
>
> To unsubscribe from this group, send an email to:
> VirtualTreeview-unsubscribe@egroups.com
>
>
>
>

To unsubscribe from this group, send an email to:
VirtualTreeview-unsubscribe@egroups.com


re: Descendant component

From: Ondrej Kelle [O.Kelle@d...]
Date: Fri Feb 2, 2001 8:41 am
Subject: RE: [VirtualTreeview] Descendant component

Hi Paul,

if I understand it correctly, VT can be used in two modes:

1. the 'virtual mode' (VT asks your application for data 'on demand' when it
needs it)
- You only set RootNodeCount, the rest is provided in your event handlers,
namely:
- OnInitNode: this is where you assign your application data to each node,
and can also modify InitialStates
- OnInitChildren: this is where you specify number of child nodes
- OnGetText: where you specify the display text of the node. You can keep
only some IDs in nodes' Data structures, and perform some kind of lookup in
this event handler, or you can choose to keep the strings directly in the
nodes data structures, initialized in OnInitNode... depending on your needs.

As you can see, VT relies a lot on the application code. In fact, I'm not
sure wheather a DB-aware component can be created so that it remains as
'open' as the descendant (read openness as the opposite for encapsulation).
I think you would have to trade off some of the openness but I haven't
analyzed this possibility thoroughly.

2. 'sequential mode' - not sure if this is a good term
- You don't set RootNodeCount, instead you add the nodes manually in code
- OnGetNodeChildren is not used
- OnExpanding is used to add subnodes manually

On the top level, you would do something similar to the following:

var
NewNode: PVirtualNode;

Tree.RootNodeCount := 0;
with MyDataSet do
begin
Open;
while not Eof do
begin
NewNode := Tree.AddChild(Tree.RootNode);
Tree.ReinitNode(NewNode, False); // causes OnInitNode to be called
immediately
Next;
end;
end;

By calling ReinitNode, you are making sure that OnInit sees the same record
of the dataset which you intend to add to the tree. Basically the same thing
would be done for lower levels in OnExpanding event.

You have undertaken a difficult task. I wish you success.

TOndrej


re: Descendant component

From: Ondrej Kelle [O.Kelle@d...]
Date: Fri Feb 2, 2001 8:58 am
Subject: RE: [VirtualTreeview] Descendant component

> if I understand it correctly, VT can be used in two modes

I forgot to mention the important distinction between the two modes: the
second mode initializes all nodes immediately after adding them to the tree.
The first mode does not, and the tree initializes only the visible nodes.
Nodes which do not fit into the client area of the tree (so they're not
visible initially) are initialized later when they become visible for the
first time (user scrolls down).


re: Descendant component

From: Bender Heri [HBender@E...]
Date: Fri Feb 2, 2001 9:26 am
Subject: RE: [VirtualTreeview] Descendant component

> -----Original Message-----
> From: Ondrej Kelle [mailto:[O.Kelle@d...]]
> Sent: Friday, February 02, 2001 9:41 AM
> To: 'VirtualTreeview@yahoogroups.com'
> Subject: RE: [VirtualTreeview] Descendant component
>
>
> Hi Paul,
>
> 2. 'sequential mode' - not sure if this is a good term
> - You don't set RootNodeCount, instead you add the nodes
> manually in code
> - OnGetNodeChildren is not used
> - OnExpanding is used to add subnodes manually
>
> On the top level, you would do something similar to the following:
>
> var
> NewNode: PVirtualNode;
>
> Tree.RootNodeCount := 0;
> with MyDataSet do
> begin
> Open;
> while not Eof do
> begin
> NewNode := Tree.AddChild(Tree.RootNode);
> Tree.ReinitNode(NewNode, False); // causes OnInitNode
> to be called
> immediately
> Next;
> end;
> end;
>
> By calling ReinitNode, you are making sure that OnInit sees
> the same record
> of the dataset which you intend to add to the tree. Basically
> the same thing
> would be done for lower levels in OnExpanding event.
>

Hi

I do it almost the same way although Mike is discouraging the use of
AddChild. I did not find annother way to link a node directly with a record
of a dataset.
Instead of calling reinitNode I fill the node data immediatly with a class
reference which holds all needed data:

procedure FillTree;
var
NewNode : PVirtualNode;
oNewNode : TMyNodeData;
begin
Tree.RootNodeCount := 0;
with MyDataSet do
begin
Open;
while not Eof do begin
NewNode := Tree.AddChild(Tree.RootNode);
oNewNode := TMyNodeData.Create;
<assign data from dataset to oNewNode>
ClassRefToNodeData(oNewNode,NewNode);
Next;
end;
end;
end;

procedure TCETree.ClassRefToNodeData(o : TObject; Node : PVirtualNode);
begin
move(o,(GetNodeData(Node))^,SizeOf(o));
end;

If the data loading takes too much time (maybe you have to execute several
sub queries) you can store only a bookmark in the class TMyNodeData. So you
can combine the VT paradigma with the old approach of filling a tree. VT
calls you when it needs the node to be initialized. There you can go to the
saved bookmark and do what is needed.

Heri


re: Need help with DropManager.DragStart & Drag Move

From: Mike Lischke [public@l...]
Date: Fri Feb 2, 2001 9:32 am
Subject: RE: [VirtualTreeview] Need help with DropManager.DragStart & Drag Move

Hi Fabio,

> I've studying your code for dragging. All that BitBlts are
> driving me nuts!

Hehe, you wanted it so ;-)

> The DragMove code is well commented. However the DragStart
> isn't. Neither are the properties (private fields) of
> TBaseDragDropManager.

Point taken. I have include some more description in the declaration part.

> Can you please give me an general overview of algorithm and
> a brief description (what is it for) of
>
> - FMask, FImage, FMouseSpot
> - FBackOldDC, FBackNewDC, FWorkDC, FCopyDC
> - FHPicBMP, FHMaskBMP, FOldWorkBMP, FOldCopyBMP,
> FOldBackOldBMP, FOldBackNewBMP

As I already wrote, the drag image management is not written by me and I
only have a vague clue about what this all is for. But you should keep in
mind that you don't need it anymore once you have the blending working. The
bitmaps are used to store the screen part which is currently hidden by the
drag image, a mask which describes which part of the drag image should be
blitted onto the screen and some work bitmaps which are needed in the
process of doing the image merging (screen and tree). FMouseSpot holds the
last mouse position.

Generally I'd say that you should orient yourself to the header dragging,
particularly

procedure TVirtualTreeColumns.DragTo(P: TPoint);

is a good start point. This method is already a derived version (from the
masked drag image stuff) but uses alpha blending.

Ciao, Mike


re: Version 2.1 issues

From: Mike Lischke [public@l...]
Date: Fri Feb 2, 2001 9:44 am
Subject: RE: [VirtualTreeview] Version 2.1 issues

Tony,

> Unfortunately, voRightClickSelect is still a bit off.
> Right-click on an item, the context menu shows, great. Right-click on
another item, the
> context menu just goes away; it doesn't show another context
> menu for the newly-selected item.

Mmmh, strange. In my case the popup menu appears as it should. I have used
however the PopupMenu property of VT.

> Also, if I have a multiselection, I can't drag it; as soon as
> I click in the selection to start the drag, the rest of the selection
disappears.

I don't understand this. Even with the assigned popup menu I still can drag
with left and right mouse button. Please be a bit patient. I will update the
demo this weekend and then you can have a look it.

> TBaseVirtualTree.InternalConnectNode seems to call
> GetFullyVisible

It seems I am a bit too restricitive here. I have changed it to:

function TBaseVirtualTree.GetFullyVisible(Node: PVirtualNode): Boolean;

// Determines whether the given node has the visibility flag set as well as
all its parents are expanded.

begin
Assert(Assigned(Node), 'Invalid parameter.');
Result := vsVisible in Node.States;
if Result and (Node <> FRoot) then
Result := VisiblePath[Node];
end;

Otherwise the tree would have to check all time whether the node is FRoot
before calling FullyVisible.

Ciao, Mike


re: Kylix!

From: Mike Lischke [public@l...]
Date: Fri Feb 2, 2001 9:46 am
Subject: RE: [VirtualTreeview] Kylix!

> Alive and well. Any idea if VT compiles on it yet/or scale of changes
> needed?.
>
> (Looking forward to getting a copy in a few weeks)

:-)) I read the news about Kylix too. But it is not sold yet and I was not
on the field test. It will take quite a while before I can make VT Kylix
compatible, because I need first to install Linux on my system, organized a
Kylix copy and have to rewrite quite a lot of code (e.g. ActiveX, OLE etc.
is not supported under Kylix). So please be patient....

Ciao, Mike


re: Descendant component

From: Mike Lischke [public@l...]
Date: Fri Feb 2, 2001 9:52 am
Subject: RE: [VirtualTreeview] Descendant component

Hi Paul,

> I need a little help with the ValidateNode Method. Im not
> quite sure how to
> use it, and I don't see any examples. This is basically what
> Im doing. Its
> probably all wrong, but at least it's a start.
>
> I am incrementing RootNodeCount to add nodes, and then I need
> to somehow get
> the value 's' to the caption property of my record.
>
> procedure TIB_CustomVTree.LoadTree;
> var
> s : string;
> begin
> DataLink.DataSet.BufferFirst;
> while not DataLink.DataSet.BufferEOF do
> begin
> RootNodeCount := RootNodeCount + 1;
> ValidateNode(FNode, false);
> s := DataLink.Dataset.FieldByName('DESCRIPTION').Value;
> DataLink.DataSet.BufferNext;
> end;
> end;

In this special case I would use:

procedure TIB_CustomVTree.LoadTree;
var
s: string;
Node: PVirtualNode;
Data: PIBNodeData;

begin
RootNodeCount := DataLink.DataSet.RecordCount;
DataLink.DataSet.BufferFirst;
Node := Root.FirstChild; // no real need to initialize the node
while not DataLink.DataSet.BufferEOF do
begin
Data := GetNodeData(Node);
Data.TheCaption := DataLink.Dataset.FieldByName('DESCRIPTION').Value;
DataLink.DataSet.BufferNext;
Node := Node.NextSibling; // no real need to initialize the node
end;
end;

Initializing the nodes can be avoided when you can make sure that the
assigned strings are freed somehow or don't need to be freed (e.g. use short
strings). Otherwise you have to modify the code to:

procedure TIB_CustomVTree.LoadTree;
var
s: string;
Node: PVirtualNode;
Data: PIBNodeData;

begin
RootNodeCount := DataLink.DataSet.RecordCount;
DataLink.DataSet.BufferFirst;
Node := GetFirstNode;
while not DataLink.DataSet.BufferEOF do
begin
Data := GetNodeData(Node);
Data.TheCaption := DataLink.Dataset.FieldByName('DESCRIPTION').Value;
DataLink.DataSet.BufferNext;
Node := GetNextSibling(Node);
end;
end;

Ciao, Mike


re: Descendant component

From: Mike Lischke [public@l...]
Date: Fri Feb 2, 2001 10:02 am
Subject: RE: [VirtualTreeview] Descendant component

> procedure FillTree;
> var
> NewNode : PVirtualNode;
> oNewNode : TMyNodeData;
> begin
> Tree.RootNodeCount := 0;
> with MyDataSet do
> begin
> Open;
> while not Eof do begin
> NewNode := Tree.AddChild(Tree.RootNode);
> oNewNode := TMyNodeData.Create;
> <assign data from dataset to oNewNode>
> ClassRefToNodeData(oNewNode,NewNode);
> Next;
> end;
> end;
> end;

The problem with your approach is however that the nodes get not initialized
in the loop and if they are never initialized (e.g. by scrolling them into
view) you will not get any free notification and your class instance will
not be freed causing so a memory leak. Only this fact is the reason why the
node should be initialized when data is stored in their user data area. If
you only store stuff which must not be freed (e.g. a couple of numbers) than
you don't need to intialized the node at all (this would be the ideal case).

Ciao, Mike


re: Descendant component

From: Bender Heri [HBender@E...]
Date: Fri Feb 2, 2001 10:12 am
Subject: RE: [VirtualTreeview] Descendant component

> -----Original Message-----
> From: Mike Lischke [mailto:[public@l...]]
> Sent: Friday, February 02, 2001 11:02 AM
> To: 'VirtualTreeview@yahoogroups.com'
> Subject: RE: [VirtualTreeview] Descendant component
>
>
> > procedure FillTree;
> > var
> > NewNode : PVirtualNode;
> > oNewNode : TMyNodeData;
> > begin
> > Tree.RootNodeCount := 0;
> > with MyDataSet do
> > begin
> > Open;
> > while not Eof do begin
> > NewNode := Tree.AddChild(Tree.RootNode);
> > oNewNode := TMyNodeData.Create;
> > <assign data from dataset to oNewNode>
> > ClassRefToNodeData(oNewNode,NewNode);
> > Next;
> > end;
> > end;
> > end;
>
> The problem with your approach is however that the nodes get
> not initialized
> in the loop and if they are never initialized (e.g. by
> scrolling them into
> view) you will not get any free notification and your class
> instance will
> not be freed causing so a memory leak. Only this fact is the
> reason why the
> node should be initialized when data is stored in their user
> data area. If
> you only store stuff which must not be freed (e.g. a couple
> of numbers) than
> you don't need to intialized the node at all (this would be
> the ideal case).
>
> Ciao, Mike

Hi Mike,
To solve this problem, would it be enough to call after ClassRefToNodeData:

NewNode.states := NewNode.states + vsInitialized;

?

Heri


re: Descendant component

From: Mike Lischke [public@l...]
Date: Fri Feb 2, 2001 10:20 am
Subject: RE: [VirtualTreeview] Descendant component

> To solve this problem, would it be enough to call after
> ClassRefToNodeData:
>
> NewNode.states := NewNode.states + vsInitialized;

Yep, this is one trick we used. If there is no need to set other data in
OnInitNode and also no other special things (like being selected etc.) need
to be set, then setting this style is harmless and does exactly what you
need. Btw, the optimized version of the line above is:

Include(NewNode.States, vsInitialized);

Ciao, Mike


OnFocusChanged

From: Dieter Köhler [dieter.koehler@p...]
Date: Fri Feb 2, 2001 6:26 pm
Subject: OnFocusChanged

I am using a VirtualStringTree from Version 1.31 in connection with another
component which desplays more detailed information realted to the node which has
the focus in the VirtualStringTree. To update the other component I use the
OnFocusChanged event of the VirtualStringTree. However, if I use the
VirtualStringTree.clear method no OnFocusChanged event is fired.
- Is this a bug in the VirtualStringTree component?
- What is the best way to inform my other component that the VirtualStringTree
has been cleared?

Dieter Köhler

 | Replies | Author | Date
410 | Re: OnFocusChanged | Mike Lischke | Sat 2/3/2001
412 | Re: OnFocusChanged | Dieter =?iso-8859-1?Q?K=F6hle | Sat 2/3/2001
417 | Re: OnFocusChanged | Mike Lischke | Sun 2/4/2001
418 | Re: OnFocusChanged | Dieter =?iso-8859-1?Q?K=F6hle | Sun 2/4/2001


re: Descendant component

From: "Paul Gallagher" [paul@t...]
Date: Fri Feb 2, 2001 7:46 pm
Subject: Re: [VirtualTreeview] Descendant component

Thanks Mike.

I think I have the "basics" figured out now. What's left is to write an
algorithm to load the tree efficiently. I had one that I was using on the
standard TTreeView, but it will not work here. The TTreeView component
basically is a hierarchal representation of a TStringList. Virtual Tree is a
little more complicated.

Paul

----- Original Message -----
From: "Mike Lischke" [public@l...]
To: <VirtualTreeview@yahoogroups.com>
Sent: Friday, February 02, 2001 3:52 AM
Subject: RE: [VirtualTreeview] Descendant component

> Hi Paul,
>
> > I need a little help with the ValidateNode Method. Im not
> > quite sure how to
> > use it, and I don't see any examples. This is basically what
> > Im doing. Its
> > probably all wrong, but at least it's a start.
> >
> > I am incrementing RootNodeCount to add nodes, and then I need
> > to somehow get
> > the value 's' to the caption property of my record.
> >
> > procedure TIB_CustomVTree.LoadTree;
> > var
> > s : string;
> > begin
> > DataLink.DataSet.BufferFirst;
> > while not DataLink.DataSet.BufferEOF do
> > begin
> > RootNodeCount := RootNodeCount + 1;
> > ValidateNode(FNode, false);
> > s := DataLink.Dataset.FieldByName('DESCRIPTION').Value;
> > DataLink.DataSet.BufferNext;
> > end;
> > end;
>
> In this special case I would use:
>
> procedure TIB_CustomVTree.LoadTree;
> var
> s: string;
> Node: PVirtualNode;
> Data: PIBNodeData;
>
> begin
> RootNodeCount := DataLink.DataSet.RecordCount;
> DataLink.DataSet.BufferFirst;
> Node := Root.FirstChild; // no real need to initialize the node
> while not DataLink.DataSet.BufferEOF do
> begin
> Data := GetNodeData(Node);
> Data.TheCaption := DataLink.Dataset.FieldByName('DESCRIPTION').Value;
> DataLink.DataSet.BufferNext;
> Node := Node.NextSibling; // no real need to initialize the node
> end;
> end;
>
>
> Initializing the nodes can be avoided when you can make sure that the
> assigned strings are freed somehow or don't need to be freed (e.g. use
short
> strings). Otherwise you have to modify the code to:
>
> procedure TIB_CustomVTree.LoadTree;
> var
> s: string;
> Node: PVirtualNode;
> Data: PIBNodeData;
>
> begin
> RootNodeCount := DataLink.DataSet.RecordCount;
> DataLink.DataSet.BufferFirst;
> Node := GetFirstNode;
> while not DataLink.DataSet.BufferEOF do
> begin
> Data := GetNodeData(Node);
> Data.TheCaption := DataLink.Dataset.FieldByName('DESCRIPTION').Value;
> DataLink.DataSet.BufferNext;
> Node := GetNextSibling(Node);
> end;
> end;
>
> Ciao, Mike
>
>
> To unsubscribe from this group, send an email to:
> VirtualTreeview-unsubscribe@egroups.com
>
>
>
>


On popup menus and multiselection

From: "Anthony Mills" [amills@m...]
Date: Fri Feb 2, 2001 8:25 pm
Subject: On popup menus and multiselection

> Mmmh, strange. In my case the popup menu appears as it should. I have used
> however the PopupMenu property of VT.

Ah. I have a dynamic popup menu going here:

procedure TMainForm.TreeGetPopupMenu(Sender: TBaseVirtualTree;
Node: PVirtualNode; Column: Integer; var AskParent: Boolean;
var PopupMenu: TPopupMenu);
var
I: Integer;
S: string;
begin
if Node <> nil then begin
// Create cascading menu in pmTree
end else begin
// Create normal menu
end;
PopupMenu := pmTree;
end;

I don't know if that affects it or not.

> I don't understand this. Even with the assigned popup menu I still can
drag
> with left and right mouse button. Please be a bit patient. I will update
the
> demo this weekend and then you can have a look it.

Yeah ... it's like it's deselecting the others on mouse down, not mouse up.

Anyway, our clients are really positive about the switch to VT. They say the
app feels a lot more responsive, and they like the way the flat look fits in
with the rest of the GUI design. And as for me, I like it a lot more too;
the virtual paradigm just works better.

Regards,

Tony

 | Replies | Author | Date
416 | Re: On popup menus and multiselection | Mike Lischke | Sun 2/4/2001


Installation

From: "Peter Evans" [pgevans@m...]
Date: Sat Feb 3, 2001 5:07 am
Subject: Installation

I have just tried to install VirtualTreeview using Delphi 4.

I installed VirtualTrees.pas into a package VirtView which is in the same
directory.
I did Install Component | Into new package.
I got message "Package VirtView.bpl will be built then installed. Continue?"

I continued then got 3 errors :-
1) WARNING. Duplicate resource(s).
2) Type 14 (ICON GROUP), ID MAINICON:
3)File D:\Unzipped\VirtualTreeview\VirtView.RES resource kept; file
VirtualTrees.res resource discarded.

I note that VirtView.bpl is 304kb so that looks about right.
I note that there is no icon on my component bar for tree view.

(Note - I have successfully used TreeNT and have it installed on my
component bar.)

How can I get the tree in my package with no errors?

Regards, Peter Evans

 | Replies | Author | Date
411 | Re: Installation | Mike Lischke | Sat 2/3/2001
457 | Re: Installation | Peter Evans | Thu 2/8/2001
462 | Re: Installation | Mike Lischke | Thu 2/8/2001
473 | Re: Installation | Peter Evans | Fri 2/9/2001
481 | Re: Installation | Mike Lischke | Fri 2/9/2001
509 | Re: Installation | Peter Evans | Tue 2/13/2001
590 | Re: Installation | Peter Evans | Mon 2/19/2001
591 | Re: Installation | Eric de Gooijer | Mon 2/19/2001
592 | Re: Installation | Louis Kessler | Mon 2/19/2001


re: OnFocusChanged

From: "Mike Lischke" [public@l...]
Date: Sat Feb 3, 2001 11:42 am
Subject: RE: [VirtualTreeview] OnFocusChanged

Hi Dieter,

> However, if I use the
> VirtualStringTree.clear method no OnFocusChanged event is fired.
> - Is this a bug in the VirtualStringTree component?

No, this is not a bug. OnFocusChange is only called when another node or column
gets the focus.

> - What is the best way to inform my other component that the VirtualStringTree
> has been cleared?

What about OnStructureChange?

Ciao, Mike

Dipl. Ing. Mike Lischke
Senior software developer
--
Homepage: http://www.lischke-online.de
GraphicEx: http://www.lischke-online.de/Graphics.html
Virtual Treeview: http://www.lischke-online.de/VirtualTreeview.html
Unicode Edit and library: http://www.lischke-online.de/Unicode.html


re: Installation

From: "Mike Lischke" [public@l...]
Date: Sat Feb 3, 2001 11:42 am
Subject: RE: [VirtualTreeview] Installation

Hi Peter,

> I continued then got 3 errors :-
> 1) WARNING. Duplicate resource(s).
> 2) Type 14 (ICON GROUP), ID MAINICON:
> 3)File D:\Unzipped\VirtualTreeview\VirtView.RES resource kept; file
> VirtualTrees.res resource discarded.

Obviously there are double resources. I don't know how they came into your
search path but I will
soon upload a new version of VT together with a package (and registration)
file. The list will get a
notification when this has been done. Please use the new files to install VT
and let me know how it
was going.

Ciao, Mike


re: OnFocusChanged

From: Dieter Köhler [dieter.koehler@p...]
Date: Sat Feb 3, 2001 12:52 pm
Subject: Re: [VirtualTreeview] OnFocusChanged

Hi Mike,

> > However, if I use the
> > VirtualStringTree.clear method no OnFocusChanged event is fired.
> > - Is this a bug in the VirtualStringTree component?
>
> No, this is not a bug. OnFocusChange is only called when another node or
column gets the focus.

I tried OnFocusChanging too, but this event is also only called when another
node or column gets the focus, but not if the focus disappears. So I would
suggest introducing an additional event BeforeFocusDisapears(Sender:
TBaseVirtualTree; OldNode: PVirtualNode; OldColumn: Integer); for such cases.

> > - What is the best way to inform my other component that the
VirtualStringTree
> > has been cleared?
>
> What about OnStructureChange?

When I tried it, I could not find out how to get access to the node which
currently has the focus. BTW: How could I distinguish between a node removed
and a node added inside the event procedure? Am I right, that this event is
triggered _after_ a node is added and _before_ it is removed, respectively?

Dieter

--
=====================================================================
Dieter Köhler, M. A. - [dieter.koehler@p...]
Mittlere Kaulberg 22, D-96049 Bamberg, +49(0)951-5190726
"http://www.philo.de/Philosophie-Seiten/": 1000+ Philosophie-Links
"http://www.philo.de/VirtualLibrary/14.de.htm": Deutsche Philo-Links
"http://www.philo.de/xml/": Open XML - XML-Komponenten für Delphi
=====================================================================

 | Replies | Author | Date
417 | Re: OnFocusChanged | Mike Lischke | Sun 2/4/2001


Virtual Treeview as list view and sorting on column...

From: Robert Palmqvist [robert.palmqvist@h...]
Date: Sat Feb 3, 2001 10:52 pm
Subject: Virtual Treeview as list view and sorting on column...

Hi all, I have tried to make Virtual Treeview behave like a
list view and also to find a solution to sort columns by
clicking the column headers.

My VirtualTree View almost look like a list view but any
comments from other users on "best practice" are welcome...

I have had no luck with the sorting, I just can't get it to
work :( I have tried the Sort method and I have made my own
TVTCompareFunction but I really don't know how to make it
sort all root nodes on different columns (it is just
strings in a TVirtualStringTree)...

Declaration
Procedure Sort(Node: PVirtualNode; Column: Integer;
Ascending: Boolean; Compare: TVTCompareFunction; DoInit:
Boolean = True);

What to use as the node value, VirtualStringTree1.RootNode?

What is "DoInit" doing? Should it be true or false?

Thanks for any answers and please forgive me if this is a
FAQ, I am new to this group (but I have read trough the
Virtual Treeview help files and example code,
the "Advanced" does modified sorting but only on child
nodes in a tree, not on columns in a list view way).

/ Robert

 | Replies | Author | Date
414 | Re: Virtual Treeview as list view and sorting on | =?iso-8859-1?Q?Bj=F6rn_Lindel | Sat 2/3/2001


re: Virtual Treeview as list view and sorting on column...

From: Björn Lindell [bli@c...]
Date: Sat Feb 3, 2001 5:44 pm
Subject: Re: [VirtualTreeview] Virtual Treeview as list view and sorting on column...

Hi Robert,

I've recently done the same thing, emulating a standard TListView in
report mode. I got most things I wanted working, except the following
minor issues, which I at the moment has put aside:

1) Selecting rows by dragging a window requires the window to include
the first "column"
2) Double-click on a header-separator

Note: Mike has explained the reasons for both these, if I recall correctly,
the
first one is because of intended "treeview"-behaviour and the second one is
because of the "virtual"-behaviour. You may check out my earlier postings
and the replies I got for details about this.

As for your questions, "Node" is the node which children should be sorted,
I always specify "nil" here so all nodes are sorted. "DoInit" means whether
VT should initialize nodes that are still "just virtual" so that they can be
sorted
upon. I implemented sorting in the following way:

i) Add the following variables to your form:

SortAscending: boolean;
LastSortColumn: integer;

ii) Create the following method in your form code:

function TForm1.DisplaySort(Sender: TBaseVirtualTree; Node1, Node2:
PVirtualNode; Column: Integer): Integer;
begin
result := CompareText(DoGetText(sender, node1, column, true),
DoGetText(sender, node2, column, true));
end;

iii) Connect the following code to VT's "OnHeaderClick"

procedure TFrmWin2Web.VSTHeaderClick(Sender: TBaseVirtualTree;
Column: Integer);
begin
if lastsortcolumn = column then
SortAscending := (not SortAscending)
else
SortAscending := true;

lastSortColumn := column;

Sender.Sort(nil, column, SortAscending, DisplaySort, true);
end;

iv) The function "DoGetText" is a function you implement yourself, that
just retrieves the display text of a specific row and column.
I use the same function for the "OnGetTextEvent"

/Björn

----- Original Message -----
From: "Robert Palmqvist" [robert.palmqvist@h...]
To: <VirtualTreeview@yahoogroups.com>
Sent: Saturday, February 03, 2001 4:52 PM
Subject: [VirtualTreeview] Virtual Treeview as list view and sorting on
column...

> Hi all, I have tried to make Virtual Treeview behave like a
> list view and also to find a solution to sort columns by
> clicking the column headers.
>
> My VirtualTree View almost look like a list view but any
> comments from other users on "best practice" are welcome...
>
> I have had no luck with the sorting, I just can't get it to
> work :( I have tried the Sort method and I have made my own
> TVTCompareFunction but I really don't know how to make it
> sort all root nodes on different columns (it is just
> strings in a TVirtualStringTree)...
>
> Declaration
> Procedure Sort(Node: PVirtualNode; Column: Integer;
> Ascending: Boolean; Compare: TVTCompareFunction; DoInit:
> Boolean = True);
>
> What to use as the node value, VirtualStringTree1.RootNode?
>
> What is "DoInit" doing? Should it be true or false?
>
> Thanks for any answers and please forgive me if this is a
> FAQ, I am new to this group (but I have read trough the
> Virtual Treeview help files and example code,
> the "Advanced" does modified sorting but only on child
> nodes in a tree, not on columns in a list view way).
>
> / Robert
>
>
>
>
>
>
> To unsubscribe from this group, send an email to:
> VirtualTreeview-unsubscribe@egroups.com
>
>


Locating a node by its data

From: "Paul Gallagher" [paul@t...]
Date: Sun Feb 4, 2001 2:21 am
Subject: Locating a node by its data

Say I have created a node record with field "ID". I want to add a child node to
a particular Node, that is referenced by the value in "ID".

Any suggestions what would be the most efficient way?

TIA
Paul Gallagher

[Non-text portions of this message have been removed]


re: On popup menus and multiselection

From: "Mike Lischke" [public@l...]
Date: Sun Feb 4, 2001 3:28 pm
Subject: RE: [VirtualTreeview] On popup menus and multiselection

Hi Anthony,

> Ah. I have a dynamic popup menu going here:
>
> procedure TMainForm.TreeGetPopupMenu(Sender: TBaseVirtualTree;
> Node: PVirtualNode; Column: Integer; var AskParent: Boolean;
> var PopupMenu: TPopupMenu);
> var
> I: Integer;
> S: string;
> begin
> if Node <> nil then begin
> // Create cascading menu in pmTree
> end else begin
> // Create normal menu
> end;
> PopupMenu := pmTree;
> end;
>
> I don't know if that affects it or not.

It does not, according to my trials. The menu as well as the tree still behave
as expected. Perhaps
it would be better that you make a small demo for me where the problem occurs
and I can so have a
look to see what is wrong. It should also not have anything to do with the
newer version of VT since
(I think) I have nothing changed which affects the right mouse button handling.

> Yeah ... it's like it's deselecting the others on mouse down, not mouse up.

There are circumstances where this behaviour is intended, please keep this in
mind. For example if
you click on an unselected node then the selection is of course cleared.

> Anyway, our clients are really positive about the switch to VT. They say the
> app feels a lot more responsive, and they like the way the flat look fits in
> with the rest of the GUI design. And as for me, I like it a lot more too;
> the virtual paradigm just works better.

Great to hear :o] although the virtual paradigm has its limits too (e.g. when
creating a tree from
linear data as from a database query).

Ciao, Mike


re: OnFocusChanged

From: "Mike Lischke" [public@l...]
Date: Sun Feb 4, 2001 3:28 pm
Subject: RE: [VirtualTreeview] OnFocusChanged

Hi Dieter,

> I tried OnFocusChanging too, but this event is also only called when another
> node or column gets the focus, but not if the focus disappears.

Basically, it can never happen that, once a node got the focus, the focus can
get lost. It can only
go to another column or node but never disappear. With one exception, however,
when the node is
deleted which currently has the focus. But in this case you *know* that the
focus might get lost
since *you* are triggering the node deletion.

However for better help by the tree for such cases I have changed the
InternalDisconnectNode method
which is responsible for resetting the focused node. It uses now the official
property FocusedNode
which will trigger the OnFocusChange event. Only one issue remains to be
resolved, namely how to
deal with the OnFocusChanging event in which the application can reject to
switch the focus. This
must not have influence on the disconnection chain as it would break a lot of
other things.

> > > - What is the best way to inform my other component that the
VirtualStringTree
> > > has been cleared?
> >
> > What about OnStructureChange?
>
> When I tried it, I could not find out how to get access to the node which
> currently has the focus. BTW: How could I distinguish between a node removed
> and a node added inside the event procedure? Am I right, that this event is
> triggered _after_ a node is added and _before_ it is removed, respectively?

I'm not sure why you are doing it all so complicated. When you call Tree.Clear
then you *know* the
currently focused node will loose the focus, so you can notify your other
components immediately
before or after you cleared the tree, whatever might fit.

Currently you cannot determine what happend when OnStructureChange was
triggered, but I have just
included a reason parameter which tells whether nodes have been added, deleted
or accumulated
actions are reported. This is available in version 2.2 of VT which will however
need a couple of
days before release since the alignment stuff is a much larger issue than I
thought initially.

Ciao, Mike


re: OnFocusChanged

From: Dieter Köhler [dieter.koehler@p...]
Date: Sun Feb 4, 2001 5:49 pm
Subject: Re: [VirtualTreeview] OnFocusChanged

> I'm not sure why you are doing it all so complicated. When you call
Tree.Clear then you *know* the
> currently focused node will loose the focus, so you can notify your other
components immediately
> before or after you cleared the tree, whatever might fit.

Well, this is the way I currently do it. However, what really is "complicated"
depends on ones encoding style. So, since I need to call Tree.Clear more than
once, doing the synchonization in an event is more naturally in respect of code
centralization. And it would be a more object orientated design: When modifying
the code I will not have to be aware of the focus any more.

Dieter

--
=====================================================================
Dieter Köhler, M. A. - [dieter.koehler@p...]
Mittlere Kaulberg 22, D-96049 Bamberg, +49(0)951-5190726
"http://www.philo.de/Philosophie-Seiten/": 1000+ Philosophie-Links
"http://www.philo.de/VirtualLibrary/14.de.htm": Deutsche Philo-Links
"http://www.philo.de/xml/": Open XML - XML-Komponenten für Delphi
=====================================================================


VirtualTree to IBO port

From: "Paul Gallagher" [paul@t...]
Date: Sun Feb 4, 2001 6:35 pm
Subject: VirtualTree to IBO port

I am uploading a file to both lists. This is my first attempt at porting the
VirtualTree to IBO.

It is very basic, but it works. There is very little optimization done as of
yet. When a node is added, it bascially just scans the entire tree for the
correct parent node. I need to become more familiar with how Virtual Tree
operates, before I can do any more.

A simple demo project is included as well.

Some suggestions as to how to eliminate the need of modifying IBO files would
be appreciated.

Paul Gallagher

[Non-text portions of this message have been removed]

 | Replies | Author | Date
421 | Re: VirtualTree to IBO port | Paul Gallagher | Sun 2/4/2001


New file uploaded to VirtualTreeview

From: [VirtualTreeview@yahoogroups.com>
Date: Sun Feb 4, 2001 6:48 pm
Subject: New file uploaded to VirtualTreeview

Hello,

This email message is a notification to let you know that
a file has been uploaded to the Files area of the VirtualTreeview
group.

File : /IB_VTree.zip
Uploaded by : [paul@t...]
Description : VTree to IBO port

You can access this file at the URL

http://groups.yahoo.com/group/VirtualTreeview/files/IB_VTree.zip

To learn more about file sharing for your group, please visit

http://help.yahoo.com/help/us/groups/files

Regards,

paul@t...]
Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms


re: VirtualTree to IBO port

From: "Paul Gallagher" [paul@t...]
Date: Sun Feb 4, 2001 7:37 pm
Subject: Re: [VirtualTreeview] VirtualTree to IBO port

Oops....
Don't really know what happened here, but move the line.

NodeDataSize := SizeOf(TVTreeRec);

from the constructor to the first line of the LoadData procedure.

Paul

----- Original Message -----
From: "Paul Gallagher" [paul@t...]
To: <IBObjects@egroups.com>; <virtualTreeview@yahoogroups.com>
Sent: Sunday, February 04, 2001 12:35 PM
Subject: [VirtualTreeview] VirtualTree to IBO port

> I am uploading a file to both lists. This is my first attempt at porting
the VirtualTree to IBO.
>
> It is very basic, but it works. There is very little optimization done as
of yet. When a node is added, it bascially just scans the entire tree for
the correct parent node. I need to become more familiar with how Virtual
Tree operates, before I can do any more.
>
> A simple demo project is included as well.
>
> Some suggestions as to how to eliminate the need of modifying IBO files
would be appreciated.
>
> Paul Gallagher
>
>
> [Non-text portions of this message have been removed]
>
>
>
> To unsubscribe from this group, send an email to:
> VirtualTreeview-unsubscribe@egroups.com
>
>
>
>


Adding property

From: "Paul Gallagher" [paul@t...]
Date: Sun Feb 4, 2001 9:18 pm
Subject: Adding property

In the descendant component I am building, I want to add a property to the
Header.Columns properties. It will be called TextField, or something similar.
It will correspond to the data column that this tree column will use.

I am really having trouble introducing this type of property. Can anyone help
me?

TIA
Paul

[Non-text portions of this message have been removed]

 | Replies | Author | Date
423 | Re: Adding property | Mike Lischke | Sun 2/4/2001
424 | Re: Adding property | Paul Gallagher | Sun 2/4/2001
425 | Re: Adding property | Paul Gallagher | Sun 2/4/2001
428 | Re: Adding property | =?iso-8859-1?Q?Bj=F6rn_Lindel | Mon 2/5/2001
431 | Re: Adding property | Paul Gallagher | Mon 2/5/2001


re: Adding property

From: "Mike Lischke" [public@l...]
Date: Sun Feb 4, 2001 9:36 pm
Subject: RE: [VirtualTreeview] Adding property

> In the descendant component I am building, I want to add a property to the
Header.Columns
> properties. It will be called TextField, or something similar. It will
correspond to the
> data column that this tree column will use.

Wouldn't be the Tag property enough for all extra data? The main problem is
that the tree does not
know about the new header class you have created and will always use the
"normal" header class. So
if you really want to add a field then you either have to do this in the
predefined class or change
the creation line in the tree's constructor.

Ciao, Mike


re: Adding property

From: "Paul Gallagher" [paul@t...]
Date: Sun Feb 4, 2001 9:44 pm
Subject: Re: [VirtualTreeview] Adding property

No, tag won't do it. I need a string field. What I did was to add the
property in the VirtualTrees.pas file.

This is really getting complicated. The node record must be created in the
component definition, but the component definition does not know how many
fields the user will want to display. What I will probably do, is just have
a single field that is displayed in the tree. If more are needed, then they
will have to be added in the app with code.

Paul

----- Original Message -----
From: "Mike Lischke" [public@l...]
To: <VirtualTreeview@yahoogroups.com>
Sent: Sunday, February 04, 2001 3:36 PM
Subject: RE: [VirtualTreeview] Adding property

> > In the descendant component I am building, I want to add a property to
the Header.Columns
> > properties. It will be called TextField, or something similar. It will
correspond to the
> > data column that this tree column will use.
>
> Wouldn't be the Tag property enough for all extra data? The main problem
is that the tree does not
> know about the new header class you have created and will always use the
"normal" header class. So
> if you really want to add a field then you either have to do this in the
predefined class or change
> the creation line in the tree's constructor.
>
> Ciao, Mike
>
>
>
> To unsubscribe from this group, send an email to:
> VirtualTreeview-unsubscribe@egroups.com
>
>
>
>


re: Adding property

From: "Paul Gallagher" [paul@t...]
Date: Sun Feb 4, 2001 10:39 pm
Subject: Re: [VirtualTreeview] Adding property

I have found an "ugly" solution, but it is a solution. I use this field
definition in the component definition:

type
PVTreeRec = ^TVTreeRec;
TVTreeRec = record
Caption: WideString;
ID: integer;
Parent: integer;
ColumnText: array [0..10] of string;

end;

I am temporarily using the MinWidth property of the column to store my
DataFieldIndex property. The downside, is that by using my array definition,
the component is limited to no more than 10 columns of data. I don't know if
it is possible to dynamically create an array field in a record. If it is,
then the number can be determined from the columncount.

Also, there is no TAG property for the Header.Column. Should one be added?
If it looks like this component will work, then maybe a column like
"DataColumn" could be added permanently. It would just be another unused
field if the IBO version is not running.

Paul

----- Original Message -----
From: "Paul Gallagher" [paul@t...]
To: [VirtualTreeview@yahoogroups.com>
Sent: Sunday, February 04, 2001 3:44 PM
Subject: Re: [VirtualTreeview] Adding property

> No, tag won't do it. I need a string field. What I did was to add the
> property in the VirtualTrees.pas file.
>
> This is really getting complicated. The node record must be created in the
> component definition, but the component definition does not know how many
> fields the user will want to display. What I will probably do, is just
have
> a single field that is displayed in the tree. If more are needed, then
they
> will have to be added in the app with code.
>
> Paul
>
> ----- Original Message -----
> From: "Mike Lischke" <public@l...]
> To: <VirtualTreeview@yahoogroups.com>
> Sent: Sunday, February 04, 2001 3:36 PM
> Subject: RE: [VirtualTreeview] Adding property
>
>
> > > In the descendant component I am building, I want to add a property to
> the Header.Columns
> > > properties. It will be called TextField, or something similar. It will
> correspond to the
> > > data column that this tree column will use.
> >
> > Wouldn't be the Tag property enough for all extra data? The main problem
> is that the tree does not
> > know about the new header class you have created and will always use the
> "normal" header class. So
> > if you really want to add a field then you either have to do this in the
> predefined class or change
> > the creation line in the tree's constructor.
> >
> > Ciao, Mike
> >
> >
> >
> > To unsubscribe from this group, send an email to:
> > VirtualTreeview-unsubscribe@egroups.com
> >
> >
> >
> >
>
>
>
> To unsubscribe from this group, send an email to:
> VirtualTreeview-unsubscribe@egroups.com
>
>
>
>


VT 2.1 Preview

From: [adembaba@e...]
Date: Mon Feb 5, 2001 7:10 am
Subject: VT 2.1 Preview

Mike,

I know this is not something directly related to
VT --it can not be, I havent compiled it yet :-)

When I try to compile it ask me for ColnEdit unit
which is in the $(DELPHI)\Source\Property Editors
directory. So I add that directory in the search
path. Then, ColnEdit unit uses 'ToolWnds' unit
but it does not exist in anyplace I checked.

Apparently it provides the TToolbarDesignWindow
which is the ancestor for the ColnEdit's
TCollectionEditor...

Could someone tell me what I am supposed to do
(or am I correct in suspecting that I might be
doing something really silly)

 | Replies | Author | Date
429 | Re: VT 2.1 Preview | Mike Lischke | Mon 2/5/2001
432 | Re: VT 2.1 Preview | [adembaba@e...] | Mon 2/5/2001
433 | Re: VT 2.1 Preview | Luis A. Hereira Aguilera | Mon 2/5/2001
434 | Re: VT 2.1 Preview | Mike Lischke | Mon 2/5/2001


Erreur on loading of my exe

From: [developpeur@c...]
Date: Mon Feb 5, 2001 8:07 am
Subject: Erreur on loading of my exe

With Version 2.1 i have message error : Property "Alignment" don't
exist in VirtualHeaderColumn, why ?

 | Replies | Author | Date
430 | Re: Erreur on loading of my exe | Mike Lischke | Mon 2/5/2001


re: Adding property

From: Björn Lindell [bli@c...]
Date: Mon Feb 5, 2001 8:27 am
Subject: Re: [VirtualTreeview] Adding property

I just looked in the sources for 2.1 and there is indeed
a Tag property that you could use. Why don't you just store
an index or object reference in the tag and then have
an external list that holds the actual stuff? I use the VT in
a similar manner myself, where each column needs field data
for formatting and stuff and I have a list with field definitions
and only store the pointer in the column.
Since you wanted a string to indicate the field, why
don't you try something like this:

In main code:

FieldList : TStringList;
...
FieldList := TStringList.create;

....
col := VST.Header.Columns.add;
col.Text := 'Field caption';
col.Tag := FieldList.addObject('My Field', col);
...
FieldList.Free

In this way, you can go both directions. Knowing a column
you can find the field name, and knowning the field name, you
can find the column (through FieldList.Objects).

Of course "FieldList" could be something more intelligent, for instance
a list of Field Definition objects or something.

Also, I disagree on adding a DataColumn to the VT , I don't see what extra
benefit
it brings to the general usage of VT, when there already is a "Tag"
property.

/Björn

----- Original Message -----
From: "Paul Gallagher" [paul@t...]
To: [VirtualTreeview@yahoogroups.com>
Sent: Sunday, February 04, 2001 11:39 PM
Subject: Re: [VirtualTreeview] Adding property

> I have found an "ugly" solution, but it is a solution. I use this field
> definition in the component definition:
>
> type
> PVTreeRec = ^TVTreeRec;
> TVTreeRec = record
> Caption: WideString;
> ID: integer;
> Parent: integer;
> ColumnText: array [0..10] of string;
>
> end;
>
> I am temporarily using the MinWidth property of the column to store my
> DataFieldIndex property. The downside, is that by using my array
definition,
> the component is limited to no more than 10 columns of data. I don't know
if
> it is possible to dynamically create an array field in a record. If it is,
> then the number can be determined from the columncount.
>
> Also, there is no TAG property for the Header.Column. Should one be added?
> If it looks like this component will work, then maybe a column like
> "DataColumn" could be added permanently. It would just be another unused
> field if the IBO version is not running.
>
> Paul
>
> ----- Original Message -----
> From: "Paul Gallagher" [paul@t...]
> To: <VirtualTreeview@yahoogroups.com>
> Sent: Sunday, February 04, 2001 3:44 PM
> Subject: Re: [VirtualTreeview] Adding property
>
>
> > No, tag won't do it. I need a string field. What I did was to add the
> > property in the VirtualTrees.pas file.
> >
> > This is really getting complicated. The node record must be created in
the
> > component definition, but the component definition does not know how
many
> > fields the user will want to display. What I will probably do, is just
> have
> > a single field that is displayed in the tree. If more are needed, then
> they
> > will have to be added in the app with code.
> >
> > Paul
> >
> > ----- Original Message -----
> > From: "Mike Lischke" <public@l...]
> > To: <VirtualTreeview@yahoogroups.com>
> > Sent: Sunday, February 04, 2001 3:36 PM
> > Subject: RE: [VirtualTreeview] Adding property
> >
> >
> > > > In the descendant component I am building, I want to add a property
to
> > the Header.Columns
> > > > properties. It will be called TextField, or something similar. It
will
> > correspond to the
> > > > data column that this tree column will use.
> > >
> > > Wouldn't be the Tag property enough for all extra data? The main
problem
> > is that the tree does not
> > > know about the new header class you have created and will always use
the
> > "normal" header class. So
> > > if you really want to add a field then you either have to do this in
the
> > predefined class or change
> > > the creation line in the tree's constructor.
> > >
> > > Ciao, Mike
> > >
> > >
> > >
> > > To unsubscribe from this group, send an email to:
> > > VirtualTreeview-unsubscribe@egroups.com
> > >
> > >
> > >
> > >
> >
> >
> >
> > To unsubscribe from this group, send an email to:
> > VirtualTreeview-unsubscribe@egroups.com
> >
> >
> >
> >
>
>
>
> To unsubscribe from this group, send an email to:
> VirtualTreeview-unsubscribe@egroups.com
>
>


re: VT 2.1 Preview

From: Mike Lischke [public@l...]
Date: Mon Feb 5, 2001 8:56 am
Subject: RE: [VirtualTreeview] VT 2.1 Preview

Hi Adem,

> I know this is not something directly related to
> VT --it can not be, I havent compiled it yet :-)
>
> When I try to compile it ask me for ColnEdit unit
> which is in the $(DELPHI)\Source\Property Editors
> directory. So I add that directory in the search
> path. Then, ColnEdit unit uses 'ToolWnds' unit
> but it does not exist in anyplace I checked.
>
> Apparently it provides the TToolbarDesignWindow
> which is the ancestor for the ColnEdit's
> TCollectionEditor...
>
> Could someone tell me what I am supposed to do
> (or am I correct in suspecting that I might be
> doing something really silly)

There was a description recently what to add so that the ColnEdit unit will
be found. In order to avoid that everyone has to go through this I have
created a package (the latest VT upload on yahoogroups) which uses as
required package dclstd50.dcp. So you don't need to inlcude the "Property
Editors" path. If you don't want to use VirtualTreesD5.dpk (e.g. because you
have your own package) then add dclstd50.dcp ($(Delphi)/lib folder) to the
requires list of your own package.

Ciao, Mike

 | Replies | Author | Date
432 | Re: VT 2.1 Preview | [adembaba@e...] | Mon 2/5/2001


re: Erreur on loading of my exe

From: Mike Lischke [public@l...]
Date: Mon Feb 5, 2001 8:57 am
Subject: RE: [VirtualTreeview] Erreur on loading of my exe

> With Version 2.1 i have message error : Property "Alignment" don't
> exist in VirtualHeaderColumn, why ?

Before you open a project which uses VT you have to recompile the package
where you placed VT in. Then the new properties are available.

Ciao, Mike


re: Adding property

From: "Paul Gallagher" [paul@t...]
Date: Mon Feb 5, 2001 1:14 pm
Subject: Re: [VirtualTreeview] Adding property

I do not see a tag property in my version of Virtual Tree. Perhaps it has
been added in 2.1

The tag property will actuall work ok. I have built a test of it using the
minwidth column as an index to the field. Works fine. I do need to do some
more work on it though.

Paul

----- Original Message -----
From: "Björn Lindell" [bli@c...]
To: [VirtualTreeview@yahoogroups.com>
Sent: Monday, February 05, 2001 2:27 AM
Subject: Re: [VirtualTreeview] Adding property

> I just looked in the sources for 2.1 and there is indeed
> a Tag property that you could use. Why don't you just store
> an index or object reference in the tag and then have
> an external list that holds the actual stuff? I use the VT in
> a similar manner myself, where each column needs field data
> for formatting and stuff and I have a list with field definitions
> and only store the pointer in the column.
> Since you wanted a string to indicate the field, why
> don't you try something like this:
>
> In main code:
>
> FieldList : TStringList;
> ...
> FieldList := TStringList.create;
>
> ....
> col := VST.Header.Columns.add;
> col.Text := 'Field caption';
> col.Tag := FieldList.addObject('My Field', col);
> ...
> FieldList.Free
>
>
>
> In this way, you can go both directions. Knowing a column
> you can find the field name, and knowning the field name, you
> can find the column (through FieldList.Objects).
>
> Of course "FieldList" could be something more intelligent, for instance
> a list of Field Definition objects or something.
>
> Also, I disagree on adding a DataColumn to the VT , I don't see what extra
> benefit
> it brings to the general usage of VT, when there already is a "Tag"
> property.
>
> /Björn
>
>
>
>
>
>
>
>
> ----- Original Message -----
> From: "Paul Gallagher" [paul@t...]
> To: [VirtualTreeview@yahoogroups.com>
> Sent: Sunday, February 04, 2001 11:39 PM
> Subject: Re: [VirtualTreeview] Adding property
>
>
> > I have found an "ugly" solution, but it is a solution. I use this field
> > definition in the component definition:
> >
> > type
> > PVTreeRec = ^TVTreeRec;
> > TVTreeRec = record
> > Caption: WideString;
> > ID: integer;
> > Parent: integer;
> > ColumnText: array [0..10] of string;
> >
> > end;
> >
> > I am temporarily using the MinWidth property of the column to store my
> > DataFieldIndex property. The downside, is that by using my array
> definition,
> > the component is limited to no more than 10 columns of data. I don't
know
> if
> > it is possible to dynamically create an array field in a record. If it
is,
> > then the number can be determined from the columncount.
> >
> > Also, there is no TAG property for the Header.Column. Should one be
added?
> > If it looks like this component will work, then maybe a column like
> > "DataColumn" could be added permanently. It would just be another
unused
> > field if the IBO version is not running.
> >
> > Paul
> >
> > ----- Original Message -----
> > From: "Paul Gallagher" <paul@t...]
> > To: <VirtualTreeview@yahoogroups.com>
> > Sent: Sunday, February 04, 2001 3:44 PM
> > Subject: Re: [VirtualTreeview] Adding property
> >
> >
> > > No, tag won't do it. I need a string field. What I did was to add the
> > > property in the VirtualTrees.pas file.
> > >
> > > This is really getting complicated. The node record must be created in
> the
> > > component definition, but the component definition does not know how
> many
> > > fields the user will want to display. What I will probably do, is just
> > have
> > > a single field that is displayed in the tree. If more are needed, then
> > they
> > > will have to be added in the app with code.
> > >
> > > Paul
> > >
> > > ----- Original Message -----
> > > From: "Mike Lischke" <public@l...]
> > > To: <VirtualTreeview@yahoogroups.com>
> > > Sent: Sunday, February 04, 2001 3:36 PM
> > > Subject: RE: [VirtualTreeview] Adding property
> > >
> > >
> > > > > In the descendant component I am building, I want to add a
property
> to
> > > the Header.Columns
> > > > > properties. It will be called TextField, or something similar. It
> will
> > > correspond to the
> > > > > data column that this tree column will use.
> > > >
> > > > Wouldn't be the Tag property enough for all extra data? The main
> problem
> > > is that the tree does not
> > > > know about the new header class you have created and will always use
> the
> > > "normal" header class. So
> > > > if you really want to add a field then you either have to do this in
> the
> > > predefined class or change
> > > > the creation line in the tree's constructor.
> > > >
> > > > Ciao, Mike
> > > >
> > > >
> > > >
> > > > To unsubscribe from this group, send an email to:
> > > > VirtualTreeview-unsubscribe@egroups.com
> > > >
> > > >
> > > >
> > > >
> > >
> > >
> > >
> > > To unsubscribe from this group, send an email to:
> > > VirtualTreeview-unsubscribe@egroups.com
> > >
> > >
> > >
> > >
> >
> >
> >
> > To unsubscribe from this group, send an email to:
> > VirtualTreeview-unsubscribe@egroups.com
> >
> >
>
>
>
> To unsubscribe from this group, send an email to:
> VirtualTreeview-unsubscribe@egroups.com
>
>
>
>


re: VT 2.1 Preview

From: [adembaba@e...]
Date: Mon Feb 5, 2001 6:58 pm
Subject: Re: VT 2.1 Preview

> If you don't want to use VirtualTreesD5.dpk
> (e.g. because you have your own package) then
> add dclstd50.dcp ($(Delphi)/lib folder) to the
> requires list of your own package.

Mike,

Thanks. I had overlooked that little line in your dpk.

Actually, I have created a MikeLischkeVCL.dpk in which
all your stuff is present. I find it easier that way.

Cheers,


re: Re: VT 2.1 Preview

From: "Luis A. Hereira Aguilera" [luison@u...]
Date: Mon Feb 5, 2001 8:20 pm
Subject: Re: [VirtualTreeview] Re: VT 2.1 Preview

Hi Mike

How I can give the focus to a node?

Sorry, this the way?

procedure TfrmTestVTV.VTVMouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
if Button = mbRight
then
with TVirtualStringTree(Sender) do
begin
Exclude(FocusedNode.States, vsSelected);
FocusedNode := GetNodeAt(X, Y);
Include(FocusedNode.States, vsSelected);
end
end;

Luison

 | Replies | Author | Date
434 | Re: VT 2.1 Preview | Mike Lischke | Mon 2/5/2001


re: Re: VT 2.1 Preview

From: "Mike Lischke" [public@l...]
Date: Mon Feb 5, 2001 9:49 pm
Subject: RE: [VirtualTreeview] Re: VT 2.1 Preview

Hi Luis,

> How I can give the focus to a node?
>
> procedure TfrmTestVTV.VTVMouseDown(Sender: TObject; Button: TMouseButton;
> Shift: TShiftState; X, Y: Integer);
> begin
> if Button = mbRight
> then
> with TVirtualStringTree(Sender) do
> begin
> Exclude(FocusedNode.States, vsSelected);
> FocusedNode := GetNodeAt(X, Y);
> Include(FocusedNode.States, vsSelected);
> end
> end;

Yep, perfect, except the Exclude and Include statements. They make no sense, so
you can take them
out. The focus giving procedure does not take selection into account, nor does
it influence the
current selection. Don't forget, however, that you might have to set the
focused column too (see
FocusedColumn).

Ciao, Mike


MainColumn in VT 2.1 Preview

From: Björn Lindell [bli@c...]
Date: Tue Feb 6, 2001 11:18 am
Subject: MainColumn in VT 2.1 Preview

Hi,
I just ported my app to the VT 2.1 Preview.
Everything went smooth, I just needed to
change a few obvious things the compiler
pointed out

However once thing (not really a bug) that I had
problem with was making a selection window,
I kept getting the classical "list index -1" errors.

The reason, as it turned out, was that I dynamically
add all columns at run-time. Therefore the MainColumn
remained -1 and caused the problem. Once I found
that out it was simple to fix, just setting MainColumn
to 0 after adding first column.

I am just thinking this might be a good default
behaviour for VT, that the first column added automatically
becomes the main column. For most situations this would
be what one wants (since there must be a main column at least
for selection to work). But maybe this will cause
compatibility problems...

Is there a reason for main column to be -1 in any situation
(except when there are no columns)?

/Björn

 | Replies | Author | Date
436 | Re: MainColumn in VT 2.1 Preview | Mike Lischke | Tue 2/6/2001


re: MainColumn in VT 2.1 Preview

From: Mike Lischke [public@l...]
Date: Tue Feb 6, 2001 11:22 am
Subject: RE: [VirtualTreeview] MainColumn in VT 2.1 Preview

Hi Björn,

> I am just thinking this might be a good default
> behaviour for VT, that the first column added automatically
> becomes the main column. For most situations this would
> be what one wants (since there must be a main column at least
> for selection to work). But maybe this will cause
> compatibility problems...
>
> Is there a reason for main column to be -1 in any situation
> (except when there are no columns)?

Yes, there is a reason......... I simply forgot to add the automatic
assignment :o]

Basically, when adding columns at design time the first column is
automatically the main column. I don't know why this does not work at
runtime. But I'll give it a shoot soon.

Ciao, Mike


Image problems, what am I doing wrong?

From: Robert Palmqvist [robert.palmqvist@h...]
Date: Tue Feb 6, 2001 10:44 pm
Subject: Image problems, what am I doing wrong?

I am still trying to make VirtualTreeView behave like a
ListView... My current problem is the images... I have
images for regular lines but they do not show up on
selected lines...

I have tried different solutions for the GetImageIndex
event. The current one only use the state image, but that
one is also hidden by the selection:

procedure TForm1.VirtualStringTree1GetImageIndex(Sender:
TBaseVirtualTree;
Node: PVirtualNode; Kind: TVTImageKind; Column: Integer;
var Index: Integer);
begin
if (Column = 0) and (Kind = ikState) then
Index:= PNodeData(Sender.GetNodeData(Node))^.ImageIndex;
end;

I used the following before that one but with the same
result:

procedure TForm1.VirtualStringTree1GetImageIndex(Sender:
TBaseVirtualTree;
Node: PVirtualNode; Kind: TVTImageKind; Column: Integer;
var Index: Integer);
begin
if (Column = 0) and (Kind in [ikNormal, ikSelected]) then
Index:= PNodeData(Sender.GetNodeData(Node))^.ImageIndex;
end;

Please help me get images in column zero even for my
selected lines :)

Thanks in advance / Robert

 | Replies | Author | Date
438 | Re: Image problems, what am I doing wrong? | Mike Lischke | Tue 2/6/2001
439 | Re: Image problems, what am I doing wrong? | Werner Lehmann | Tue 2/6/2001
440 | Re: Image problems, what am I doing wrong? | [mlaan@w...] | Tue 2/6/2001
441 | Re: Image problems, what am I doing wrong? | Geoffrey Pan | Tue 2/6/2001
442 | Autosort question | Geoffrey Pan | Tue 2/6/2001
444 | Re: Autosort question | Mike Lischke | Tue 2/6/2001
482 | Re: Autosort question | Mike Lischke | Fri 2/9/2001
443 | Re: Image problems, what am I doing wrong? | Mike Lischke | Tue 2/6/2001
445 | Re: Image problems, what am I doing wrong? | Robert Palmqvist | Tue 2/6/2001


re: Image problems, what am I doing wrong?

From: Mike Lischke [public@l...]
Date: Tue Feb 6, 2001 4:15 pm
Subject: RE: [VirtualTreeview] Image problems, what am I doing wrong?

Hi Robert,

> procedure TForm1.VirtualStringTree1GetImageIndex(Sender:
> TBaseVirtualTree;
> Node: PVirtualNode; Kind: TVTImageKind; Column: Integer;
> var Index: Integer);
> begin
> if (Column = 0) and (Kind = ikState) then
> Index:= PNodeData(Sender.GetNodeData(Node))^.ImageIndex;
> end;
>
> I used the following before that one but with the same
> result:
>
> procedure TForm1.VirtualStringTree1GetImageIndex(Sender:
> TBaseVirtualTree;
> Node: PVirtualNode; Kind: TVTImageKind; Column: Integer;
> var Index: Integer);
> begin
> if (Column = 0) and (Kind in [ikNormal, ikSelected]) then
> Index:= PNodeData(Sender.GetNodeData(Node))^.ImageIndex;
> end;
>
> Please help me get images in column zero even for my
> selected lines :)

This looks quite ok to me. Have you made sure that the Index assignment is
actually executed? If yes, which value is returned?

Have you tried to unconditionally return an index so every node in every
column gets the image (also when selected)? Ddoes it work?

Ciao, Mike


re: Image problems, what am I doing wrong?

From: Werner Lehmann [wl@b...]
Date: Tue Feb 6, 2001 4:33 pm
Subject: Re: [VirtualTreeview] Image problems, what am I doing wrong?

Robert Palmqvist wrote:
>
> procedure TForm1.VirtualStringTree1GetImageIndex(Sender:
> TBaseVirtualTree;
> Node: PVirtualNode; Kind: TVTImageKind; Column: Integer;
> var Index: Integer);
> begin
> if (Column = 0) and (Kind in [ikNormal, ikSelected]) then
> Index:= PNodeData(Sender.GetNodeData(Node))^.ImageIndex;
> end;
>
> Please help me get images in column zero even for my
> selected lines :)

This looks good. Should work (it does for me). I suppose you have
some other coincident problem here... Also make sure that the
ImageIndex in your NodeData record is never -1 (or test with a
fixed imageindex instead of retrieving it from the nodedata).

WL


re: Image problems, what am I doing wrong?

From: [mlaan@w...]
Date: Tue Feb 6, 2001 5:30 pm
Subject: Re: Image problems, what am I doing wrong?

Hi,

Robert Palmqvist [robert.palmqvist@h...] wrote:
> I am still trying to make VirtualTreeView behave like a
> ListView... My current problem is the images... I have
> images for regular lines but they do not show up on
> selected lines...

I had a similar problem, which was 'solved' by turning
Options|voGridExtensions off.

Greetings,
Martijn Laan

 | Replies | Author | Date
441 | Re: Image problems, what am I doing wrong? | Geoffrey Pan | Tue 2/6/2001
442 | Autosort question | Geoffrey Pan | Tue 2/6/2001
444 | Re: Autosort question | Mike Lischke | Tue 2/6/2001
482 | Re: Autosort question | Mike Lischke | Fri 2/9/2001
443 | Re: Image problems, what am I doing wrong? | Mike Lischke | Tue 2/6/2001


re: Re: Image problems, what am I doing wrong?

From: "Geoffrey Pan" [gpan@c...]
Date: Tue Feb 6, 2001 5:42 pm
Subject: RE: [VirtualTreeview] Re: Image problems, what am I doing wrong?

Hello Martin, good to see you.

-----Original Message-----
From: [mlaan@w...] [mailto:[mlaan@w...]]
Sent: Tuesday, February 06, 2001 11:31 AM
To: [VirtualTreeview@yahoogroups.com
Subject: [VirtualTreeview] Re: Image problems, what am I doing wrong?

Hi,

Robert Palmqvist <robert.palmqvist@h...] wrote:
> I am still trying to make VirtualTreeView behave like a
> ListView... My current problem is the images... I have
> images for regular lines but they do not show up on
> selected lines...

I had a similar problem, which was 'solved' by turning
Options|voGridExtensions off.

Greetings,
Martijn Laan

To unsubscribe from this group, send an email to:
VirtualTreeview-unsubscribe@egroups.com

 | Replies | Author | Date
442 | Autosort question | Geoffrey Pan | Tue 2/6/2001
444 | Re: Autosort question | Mike Lischke | Tue 2/6/2001
482 | Re: Autosort question | Mike Lischke | Fri 2/9/2001


Autosort question

From: "Geoffrey Pan" [gpan@c...]
Date: Tue Feb 6, 2001 6:12 pm
Subject: Autosort question

Does sorting have any impact when there are no columns defined, i.e just for
a plain VT..?

Can't seem to get it to sort when that is the case.

 | Replies | Author | Date
444 | Re: Autosort question | Mike Lischke | Tue 2/6/2001
482 | Re: Autosort question | Mike Lischke | Fri 2/9/2001


re: Re: Image problems, what am I doing wrong?

From: "Mike Lischke" [public@l...]
Date: Tue Feb 6, 2001 7:51 pm
Subject: RE: [VirtualTreeview] Re: Image problems, what am I doing wrong?

> I had a similar problem, which was 'solved' by turning
> Options|voGridExtensions off.

Really? Seems to be an unexpected bug (don't say all your bugs are unexpected
:-)). I will look at
this problem too.

Ciao, Mike


re: Autosort question

From: "Mike Lischke" [public@l...]
Date: Tue Feb 6, 2001 7:53 pm
Subject: RE: [VirtualTreeview] Autosort question

> Does sorting have any impact when there are no columns defined, i.e just for
> a plain VT..?
>
> Can't seem to get it to sort when that is the case.

It should not have any impact, but I have never tried this out. I will
investigate this too.

Ciao, Mike


re: Re: Image problems, what am I doing wrong?

From: Robert Palmqvist [robert.palmqvist@h...]
Date: Wed Feb 7, 2001 4:42 am
Subject: Re: [VirtualTreeview] Re: Image problems, what am I doing wrong?

You are right ~8) Turning voGridExtensions off did fix the
problem... I now wonder exactly what I lost by turning it
off? The help file states:

// use some special enhancements to simulate grid behaviour

It is hard to tell just by a quick look what those special
enhancements are (except from the image exclusion ;)...

By the way, thanks all for your support :))

/ Robert

> Hi,
>
> Robert Palmqvist [robert.palmqvist@h...] wrote:
> > I am still trying to make VirtualTreeView behave like a
> > ListView... My current problem is the images... I have
> > images for regular lines but they do not show up on
> > selected lines...
>
> I had a similar problem, which was 'solved' by turning
> Options|voGridExtensions off.
>
> Greetings,
> Martijn Laan
>
>
> ------------------------ Yahoo! Groups Sponsor -----------
----------~-~>
> eGroups is now Yahoo! Groups
> Click here for more details
> http://click.egroups.com/1/11231/1/_/_/_/981480645/
> ----------------------------------------------------------
-----------_->
>
> To unsubscribe from this group, send an email to:
> [VirtualTreeview-unsubscribe@egroups.com
>
>
>
>

Replies | Author | Date
446 | Re: Image problems, what am I doing wrong? | Mike Lischke | Tue 2/6/2001


re: Re: Image problems, what am I doing wrong?

From: "Mike Lischke" [public@l...]
Date: Tue Feb 6, 2001 10:43 pm
Subject: RE: [VirtualTreeview] Re: Image problems, what am I doing wrong?

> You are right ~8) Turning voGridExtensions off did fix the
> problem... I now wonder exactly what I lost by turning it
> off? The help file states:
>
> // use some special enhancements to simulate grid behaviour
>
> It is hard to tell just by a quick look what those special
> enhancements are (except from the image exclusion ;)...

The enhancements involve mainly the way how cells (selection) are drawn as well
as mouse selection
is handled. As I said, I will look into the image problem...

Ciao, Mike

 | Replies | Author | Date
447 | Re: Image problems, what am I doing wrong? | [mlaan@w...] | Tue 2/6/2001


re: Image problems, what am I doing wrong?

From: [mlaan@w...]
Date: Tue Feb 6, 2001 11:02 pm
Subject: Re: Image problems, what am I doing wrong?

Hi,

Mike Lischke" [public@l...] wrote:
> The enhancements involve mainly the way how cells (selection) are
> drawn as well as mouse selection is handled. As I said, I will look
> into the image problem...

The main reason I was using the voGridExtensions option is that when
a background image is used, voGridExtensions is off and
voFullRowSelect is on, the 'blue selection bar' is broken up into
multiple small bars (1 per column) which looks kind of silly.

I could be my fault though since I just recently discovered your
excellent component. :)

Greetings,
Martijn Laan


Small patch to VirtualTrees.pas

From: "Anthony Mills" [amills@m...]
Date: Wed Feb 7, 2001 1:19 am
Subject: Small patch to VirtualTrees.pas

In my code, I use a VirtualStringTree as a complex progress indicator and
thus periodically call InvalidateNode. However, some of my nodes were
uninitialized prior to the InvalidateNode call; thus, I propose the
following patch to VirtualTrees.pas:

Pre-patch lines 8765-:
function TBaseVirtualTree.InvalidateNode(Node: PVirtualNode): TRect;

// initiate repaint of given node and returns the just invalidated rectangle

begin
if FUpdateCount = 0 then
begin
Result := GetDisplayRect(Node, -1);
InvalidateRect(Handle, @Result, False);
end;
end;

Post-patch:
function TBaseVirtualTree.InvalidateNode(Node: PVirtualNode): TRect;

// initiate repaint of given node and returns the just invalidated rectangle

begin
if FUpdateCount = 0 then
begin
if Assigned(Node) and not (vsInitialized in Node.States) then
InitNode(Node);

Result := GetDisplayRect(Node, -1);
InvalidateRect(Handle, @Result, False);
end;
end;

Regards,

Tony

 | Replies | Author | Date
450 | Re: Small patch to VirtualTrees.pas | Mike Lischke | Wed 2/7/2001


IB_VTree

From: "Paul Gallagher" [paul@t...]
Date: Wed Feb 7, 2001 5:07 am
Subject: IB_VTree

With some great help from Konstantin and John Tomaselli, this component has
been reduced to a single file. I uploaded it to the file repository on EGroups,
I mean YahooGroups (when did that happen?). All that is necessary is to copy
the UserClasses file to the IBO directory, and build the IB_VTree package.

The component works for my simple needs, and is a vast improvement to the
standard TTreeView component I was using. As I need enhancements, I will update
the component. If anyone else wants to start enhancing, be my guest.

Paul

[Non-text portions of this message have been removed]

 | Replies | Author | Date
451 | Re: IB_VTree | Mike Lischke | Wed 2/7/2001
452 | Re: IB_VTree | [jens.treichler@u...] | Wed 2/7/2001
455 | Re: IB_VTree | [adembaba@e...] | Wed 2/7/2001
459 | Re: IB_VTree | Lester Caine | Thu 2/8/2001
453 | Re: IB_VTree | Paul Gallagher | Wed 2/7/2001
454 | Re: IB_VTree | Paul Gallagher | Wed 2/7/2001
456 | Re: IB_VTree | Paul Gallagher | Wed 2/7/2001
472 | Re: IB_VTree | [adembaba@e...] | Fri 2/9/2001
458 | Re: IB_VTree | Michael Silver | Thu 2/8/2001


re: Small patch to VirtualTrees.pas

From: Mike Lischke [public@l...]
Date: Wed Feb 7, 2001 8:48 am
Subject: RE: [VirtualTreeview] Small patch to VirtualTrees.pas

Hi Anthony,

> In my code, I use a VirtualStringTree as a complex progress
> indicator and
> thus periodically call InvalidateNode. However, some of my nodes were
> uninitialized prior to the InvalidateNode call; thus, I propose the
> following patch to VirtualTrees.pas:

I'm not sure what advantage the implicit initialization would bring. When
you call InvalidateNode on a node which was not yet initialized then it
means (usually) that it has not yet been display, hence it is not in the
client area and InvalidateNode is superfluous.

Can you explain a bit more why a node should be initialized in this case?

Ciao, Mike


re: IB_VTree

From: Mike Lischke [public@l...]
Date: Wed Feb 7, 2001 9:02 am
Subject: RE: [VirtualTreeview] IB_VTree

Hi Paul,

> With some great help from Konstantin and John Tomaselli, this
> component has been reduced to a single file. I uploaded it to
> the file repository on EGroups, I mean YahooGroups (when did
> that happen?). All that is necessary is to copy the
> UserClasses file to the IBO directory, and build the IB_VTree package.

Thank you for this port. Unfortunately, it does only work with IB objects
(not with any data source as I hoped). Additionally I have to rebuild the
entires source, is this correct? The problem is I have already a long time
ago moved all source files of IBO to another folder and keep only the
compiled units in path. This is because I will seldomly have to change
anything in the sources and debugging/stepping through IBO is the worst I
ever have seen (because of the unusual file structure).

Unfortunately, I still have not understood how to make a treeview
generically DB aware. As it is the IBO tree relies on a very special table
structure. I can imagine, however, that something totally different is to be
shown (e.g. master-detail relations etc.). Is there no way out to create a
new DB tree everytime a slightly different scenario must be visulized? I
tend more and more to the conclusion that a DB aware tree is more or less a
bad compromise. Treeviews and databases simply do not fit very well. Other
opinions?

Ciao, Mike

 | Replies | Author | Date
452 | Re: IB_VTree | [jens.treichler@u...] | Wed 2/7/2001
455 | Re: IB_VTree | [adembaba@e...] | Wed 2/7/2001
459 | Re: IB_VTree | Lester Caine | Thu 2/8/2001


re: IB_VTree

From: [jens.treichler@u...]
Date: Wed Feb 7, 2001 10:08 am
Subject: Re: IB_VTree

Hi folks,

what mike pointed out is in general my opinion, too.
I think a DB aware control should not rely a the database structure.
In one project I had the problem of having a tree like structure to
store in a
database. At this time I solved this by creating a special hierarchy
field of type string
with the following syntax:

level 1 No. sibling | level 2 No. sibling | .....

Sample: AABCB

means a node at level 5, second sibling.
This has the advantage of not using master detail tables. The control
could be independent of the underlying database type (IB,Oracle
whatever). Second: most databases are optimized for indexing or
querying strings and thus being fast at this.
Disadvantage:
Only a..z level and a..z sibling possible, but a solution might be to
use two or more char
as one index.
With the event structure of VT it should be possible to fire an SQL
query if, for
example the user expands a node ore generally for display of one
level.

Jens

--- In [VirtualTreeview@y...], Mike Lischke [public@l...] wrote:
> Hi Paul,
>
> > With some great help from Konstantin and John Tomaselli, this
> > component has been reduced to a single file. I uploaded it to
> > the file repository on EGroups, I mean YahooGroups (when did
> > that happen?). All that is necessary is to copy the
> > UserClasses file to the IBO directory, and build the IB_VTree
package.
>
> Thank you for this port. Unfortunately, it does only work with IB
objects
> (not with any data source as I hoped). Additionally I have to
rebuild the
> entires source, is this correct? The problem is I have already a
long time
> ago moved all source files of IBO to another folder and keep only
the
> compiled units in path. This is because I will seldomly have to
change
> anything in the sources and debugging/stepping through IBO is the
worst I
> ever have seen (because of the unusual file structure).
>
> Unfortunately, I still have not understood how to make a treeview
> generically DB aware. As it is the IBO tree relies on a very
special table
> structure. I can imagine, however, that something totally different
is to be
> shown (e.g. master-detail relations etc.). Is there no way out to
create a
> new DB tree everytime a slightly different scenario must be
visulized? I
> tend more and more to the conclusion that a DB aware tree is more
or less a
> bad compromise. Treeviews and databases simply do not fit very
well. Other
> opinions?
>
> Ciao, Mike


re: IB_VTree

From: "Paul Gallagher" [paul@t...]
Date: Wed Feb 7, 2001 1:13 pm
Subject: Re: [VirtualTreeview] IB_VTree

I don't think you have to rebuild the sources. I would agree that Trees and
Databases don't match. This is a limited use type of thing for special
cases.

Paul

----- Original Message -----
From: "Mike Lischke" [public@l...]
To: <VirtualTreeview@yahoogroups.com>
Sent: Wednesday, February 07, 2001 3:02 AM
Subject: RE: [VirtualTreeview] IB_VTree

> Hi Paul,
>
> > With some great help from Konstantin and John Tomaselli, this
> > component has been reduced to a single file. I uploaded it to
> > the file repository on EGroups, I mean YahooGroups (when did
> > that happen?). All that is necessary is to copy the
> > UserClasses file to the IBO directory, and build the IB_VTree package.
>
> Thank you for this port. Unfortunately, it does only work with IB objects
> (not with any data source as I hoped). Additionally I have to rebuild the
> entires source, is this correct? The problem is I have already a long time
> ago moved all source files of IBO to another folder and keep only the
> compiled units in path. This is because I will seldomly have to change
> anything in the sources and debugging/stepping through IBO is the worst I
> ever have seen (because of the unusual file structure).
>
> Unfortunately, I still have not understood how to make a treeview
> generically DB aware. As it is the IBO tree relies on a very special table
> structure. I can imagine, however, that something totally different is to
be
> shown (e.g. master-detail relations etc.). Is there no way out to create a
> new DB tree everytime a slightly different scenario must be visulized? I
> tend more and more to the conclusion that a DB aware tree is more or less
a
> bad compromise. Treeviews and databases simply do not fit very well. Other
> opinions?
>
> Ciao, Mike
>
>
> To unsubscribe from this group, send an email to:
> VirtualTreeview-unsubscribe@egroups.com
>
>
>
>


re: Re: IB_VTree

From: "Paul Gallagher" [paul@t...]
Date: Wed Feb 7, 2001 1:16 pm
Subject: Re: [VirtualTreeview] Re: IB_VTree

The table that the IB_VTree must have has an ID field and a Parent field.
You can then have infinite levels of branches. But again, it does need a
specially structured table, which is the only way I think a tree can
effectivly display a data table.

Someone mentioned that they would like to see the tree display
Master/Detail/Detail tables. I just don't think that is a realistic
situation.

Paul

----- Original Message -----
From: [jens.treichler@u...]
To: [VirtualTreeview@yahoogroups.com>
Sent: Wednesday, February 07, 2001 4:08 AM
Subject: [VirtualTreeview] Re: IB_VTree

> Hi folks,
>
> what mike pointed out is in general my opinion, too.
> I think a DB aware control should not rely a the database structure.
> In one project I had the problem of having a tree like structure to
> store in a
> database. At this time I solved this by creating a special hierarchy
> field of type string
> with the following syntax:
>
> level 1 No. sibling | level 2 No. sibling | .....
>
> Sample: AABCB
>
> means a node at level 5, second sibling.
> This has the advantage of not using master detail tables. The control
> could be independent of the underlying database type (IB,Oracle
> whatever). Second: most databases are optimized for indexing or
> querying strings and thus being fast at this.
> Disadvantage:
> Only a..z level and a..z sibling possible, but a solution might be to
> use two or more char
> as one index.
> With the event structure of VT it should be possible to fire an SQL
> query if, for
> example the user expands a node ore generally for display of one
> level.
>
> Jens
>
>
>
> --- In [VirtualTreeview@y...], Mike Lischke <public@l...] wrote:
> > Hi Paul,
> >
> > > With some great help from Konstantin and John Tomaselli, this
> > > component has been reduced to a single file. I uploaded it to
> > > the file repository on EGroups, I mean YahooGroups (when did
> > > that happen?). All that is necessary is to copy the
> > > UserClasses file to the IBO directory, and build the IB_VTree
> package.
> >
> > Thank you for this port. Unfortunately, it does only work with IB
> objects
> > (not with any data source as I hoped). Additionally I have to
> rebuild the
> > entires source, is this correct? The problem is I have already a
> long time
> > ago moved all source files of IBO to another folder and keep only
> the
> > compiled units in path. This is because I will seldomly have to
> change
> > anything in the sources and debugging/stepping through IBO is the
> worst I
> > ever have seen (because of the unusual file structure).
> >
> > Unfortunately, I still have not understood how to make a treeview
> > generically DB aware. As it is the IBO tree relies on a very
> special table
> > structure. I can imagine, however, that something totally different
> is to be
> > shown (e.g. master-detail relations etc.). Is there no way out to
> create a
> > new DB tree everytime a slightly different scenario must be
> visulized? I
> > tend more and more to the conclusion that a DB aware tree is more
> or less a
> > bad compromise. Treeviews and databases simply do not fit very
> well. Other
> > opinions?
> >
> > Ciao, Mike
>
>
>
>
>
> To unsubscribe from this group, send an email to:
> VirtualTreeview-unsubscribe@egroups.com
>
>
>
>


re: IB_VTree

From: [adembaba@e...]
Date: Wed Feb 7, 2001 9:36 pm
Subject: Re: IB_VTree

Mike,

[..]
> Unfortunately, it does only work with IB objects (not with any data
source
> as I hoped).

I was hoping the same thing :-(

> Additionally I have to rebuild the entires source, is this correct?
The
> problem is I have already a long time ago moved all source files of
IBO
> to another folder and keep only the compiled units in path. This is
> because I will seldomly have to change anything in the sources and
> debugging/stepping through IBO is the worst I ever have seen
(because
> of the unusual file structure).

My problem is, I would prefer using something other than IBObjects.

> Unfortunately, I still have not understood how to make a treeview
> generically DB aware. As it is the IBO tree relies on a very
special table
> structure. I can imagine, however, that something totally different
is to be
> shown (e.g. master-detail relations etc.). Is there no way out to
create a
> new DB tree everytime a slightly different scenario must be
visulized? I
> tend more and more to the conclusion that a DB aware tree is more
or less a
> bad compromise. Treeviews and databases simply do not fit very
well. Other
> opinions?

The reason why I am writing this at some length is simply due
to the fact that I am utterly useless when it comes to designing
or even modifying a visual component. If I had a clue where to
start and any hope that I could successfully finish it, I would
attempt it myself.

You are the TreeView guru (plus so many other interesting stuff),
so I have to turn around and ask you this:

Can you come up with <nested> TreeViews? I.e.: Is it possible that
every node level be given a different visual structure?

By that I mean this: Can I have a new set of headers (and of course
a different number of columns) for any node.

If it were possible, then it would be relatively easy to catch
TreeViews and Datasets in a very compromising situation :-)

What you would, then, do is this: Use a TQuery for every new node
level and let it use the data from its parent node(s) to generate
the Dataset to display.

OK, you might have to use a modified version of TQuery 'cos you'd
need a few pre-settable properties for the display purposes, but
that should be no problem at all..

 | Replies | Author | Date
459 | Re: IB_VTree | Lester Caine | Thu 2/8/2001


re: Re: IB_VTree

From: "Paul Gallagher" [paul@t...]
Date: Wed Feb 7, 2001 10:05 pm
Subject: Re: [VirtualTreeview] Re: IB_VTree

IBO and TDataset are quite different. The standard IBO access components do
not work with any other dataaware components. You have to use the
IBO_TDataset access components which WILL work with other standard data
aware components, but WILL NOT work with the standard IBO data aware
components.

If you need a data aware tree, there are several on the market. Dream
Company, TeeChart and Dev Express all have good ones. I prefer the TeeTree
component.

The reason I started this poject, is because there is no IBO-aware tree. If
I had to start somewhere I figured I might as well start with a good open
source tree like Virtual Tree.

Paul

----- Original Message -----
From: [adembaba@e...]
To: [VirtualTreeview@yahoogroups.com>
Sent: Wednesday, February 07, 2001 3:36 PM
Subject: [VirtualTreeview] Re: IB_VTree

> Mike,
>
> [..]
> > Unfortunately, it does only work with IB objects (not with any data
> source
> > as I hoped).
>
> I was hoping the same thing :-(
>
> > Additionally I have to rebuild the entires source, is this correct?
> The
> > problem is I have already a long time ago moved all source files of
> IBO
> > to another folder and keep only the compiled units in path. This is
> > because I will seldomly have to change anything in the sources and
> > debugging/stepping through IBO is the worst I ever have seen
> (because
> > of the unusual file structure).
>
> My problem is, I would prefer using something other than IBObjects.
>
> > Unfortunately, I still have not understood how to make a treeview
> > generically DB aware. As it is the IBO tree relies on a very
> special table
> > structure. I can imagine, however, that something totally different
> is to be
> > shown (e.g. master-detail relations etc.). Is there no way out to
> create a
> > new DB tree everytime a slightly different scenario must be
> visulized? I
> > tend more and more to the conclusion that a DB aware tree is more
> or less a
> > bad compromise. Treeviews and databases simply do not fit very
> well. Other
> > opinions?
>
> The reason why I am writing this at some length is simply due
> to the fact that I am utterly useless when it comes to designing
> or even modifying a visual component. If I had a clue where to
> start and any hope that I could successfully finish it, I would
> attempt it myself.
>
> You are the TreeView guru (plus so many other interesting stuff),
> so I have to turn around and ask you this:
>
> Can you come up with <nested> TreeViews? I.e.: Is it possible that
> every node level be given a different visual structure?
>
> By that I mean this: Can I have a new set of headers (and of course
> a different number of columns) for any node.
>
> If it were possible, then it would be relatively easy to catch
> TreeViews and Datasets in a very compromising situation :-)
>
> What you would, then, do is this: Use a TQuery for every new node
> level and let it use the data from its parent node(s) to generate
> the Dataset to display.
>
> OK, you might have to use a modified version of TQuery 'cos you'd
> need a few pre-settable properties for the display purposes, but
> that should be no problem at all..
>
>
>
>
>
> To unsubscribe from this group, send an email to:
> VirtualTreeview-unsubscribe@egroups.com
>
>
>
>

Replies Author Date


re: Installation

From: "Peter Evans" [pgevans@m...]
Date: Wed Feb 7, 2001 11:34 pm
Subject: Re: [VirtualTreeview] Installation

> > I continued then got 3 errors :-
> > 1) WARNING. Duplicate resource(s).
> > 2) Type 14 (ICON GROUP), ID MAINICON:
> > 3)File D:\Unzipped\VirtualTreeview\VirtView.RES resource kept; file
> > VirtualTrees.res resource discarded.
>
> Obviously there are double resources. I don't know how they came into your
search path but I will
> soon upload a new version of VT together with a package (and registration)
file. The list will get a

Today 8Feb01 I downloaded the new version of VT. (According to the email
subject "New file uploaded to VirtualTreeview' it is called VirtualTrees.zip
but it is now called 'VirtualTreeview.zip'.)

I am using Delphi 4.03 to compile.

I get the message - Undeclared identifier: 'TWMContextMenu' - line 1289
which is ::-

procedure WMContextMenu(var Message: TWMContextMenu); message
WM_CONTEXTMENU;

I suspect it is missing from Delphi 4 - Messages.pas

Is there some way to get around this problem so I can compile this in Delphi
4?

Regards, Peter Evans


re: Re: IB_VTree

From: "Michael Silver" [michaelas@y...]
Date: Thu Feb 8, 2001 4:03 am
Subject: Re: [VirtualTreeview] Re: IB_VTree

> Can you come up with <nested> TreeViews? I.e.: Is it possible that
> every node level be given a different visual structure?

Interesting idea! Probably worth exploring further.

I am have been working on a project with VirtualTreeview where is it pseudo
data aware. I basically pluck all the data from a dataset (basically like a
cache), and use the tree for grouping. It's really more of a fancy grid
than a treeview. It's only pseudo data aware because I don't inherite a new
treeview, I just have functions and methods that populate it. It pretty
much like the grid from Dev Express (just not near as fancy!). Perhaps for
version two of the software, I will try to implement a true data aware
treeview (i.e. a datasource property), but my goal right now is to get this
project done.

Even this type of data aware tree will not suit all, since many people don't
want to cycle through the entire dataset, or may have master detail
relationships, etc. I think there are lots of ways to make Mike's wonderful
treeview data aware, but none are a panacea. (But neither is a plain grid).

...Michael...

P.S. Mike: Thanks for developing such a wonderful component. The more I
use it, the more I am amazed. It is a truely great peice of code.

_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


re: IB_VTree

From: "Lester Caine" [lester@l...]
Date: Thu Feb 8, 2001 8:17 am
Subject: Re: IB_VTree

There are two schools of thought running at the moment.

A/ A component must do everthing for everyone.

B/ The most efficient component is designed for its job only.

IB_VTree is a type B component, just as IBObjects is a type B database
interface. Those of us who do not want the cumbersome overheads of
ODBC, ADO etc. Like the simplicity, and the power and speed this
provides.

I have an IB database that is a natural tree structure, and IB_VTree
solves a problem without my needing to do the job again. If I find I
need to add facilities to the component, I can, and those I will pass
on.

The source code is there is if people have a similar problem but are
using another database interface - The starting shell is always the
difficult bit.

Paul said when he started that IB_VTree was a simple solution to a
specific problem. If other people need an ODBC_VTree or ADO_VTree then
they have a head start on us ( and our simpathies <g> ) and a base to
work from.


re: Re: IB_VTree

From: Mike Lischke [public@l...]
Date: Thu Feb 8, 2001 8:41 am
Subject: RE: [VirtualTreeview] Re: IB_VTree

> Can you come up with <nested> TreeViews? I.e.: Is it possible that
> every node level be given a different visual structure?

The short answer is: no, I can't. Actually, VT is not designed to maintain
nested tree structures and it would require a great deal of recursion to get
this properly working. But to be honest, I doubt it will really be usefull.
E.g. I have looked at some DB demos (e.g. QuantumExpressGrid) and the main
impression I had was: "great component, impressive to look at, but I would
never use it that way, simply because I get lost in the much to complex
layout". With some work I would surely understand it some day, but not our
customers.

> By that I mean this: Can I have a new set of headers (and of course
> a different number of columns) for any node.

Since VT does not support invidiual column counts for nodes this is perhaps
the strongest reason agains a DB aware tree showing master-detail
relationship using VT.

Ciao, Mike


re: Re: IB_VTree

From: Mike Lischke [public@l...]
Date: Thu Feb 8, 2001 9:06 am
Subject: RE: [VirtualTreeview] Re: IB_VTree

Paul,

> IBO and TDataset are quite different. The standard IBO access
> components do not work with any other dataaware components. You have to
use the
> IBO_TDataset access components which WILL work with other
> standard data aware components, but WILL NOT work with the standard IBO
data aware
> components.

IIRC wasn't there a special IB datasource which was compatible with
TDatasource? Additionally, wouldn't be TDataset the natural source for the
tree data? Is IBO_TDataset derived from TDataset? I can't remember. It's
quite a while since I made the changes in IBO to read and write Unicode
data.

> If you need a data aware tree, there are several on the market. Dream
> Company, TeeChart and Dev Express all have good ones. I
> prefer the TeeTree component.

:-) Actually, I don't need a DB aware treeview. I've been asked several
times about one, however.

> The reason I started this poject, is because there is no
> IBO-aware tree. If I had to start somewhere I figured I might as well
start with
> a good open source tree like Virtual Tree.

Don't think I do not appreciate your work, Paul. Quite the opposite is true
as usually people only take what they can get without ever giving back
something to the community where they got all that fine stuff for free. I
hope the IBO people make heavy use of your IBVT so our both work pays off
well :o].

Ciao, Mike


re: Installation

From: Mike Lischke [public@l...]
Date: Thu Feb 8, 2001 9:14 am
Subject: RE: [VirtualTreeview] Installation

Hi Peter,

> Today 8Feb01 I downloaded the new version of VT. (According
> to the email subject "New file uploaded to VirtualTreeview' it is called
> VirtualTrees.zip but it is now called 'VirtualTreeview.zip'.)

Oops, I always try to stay with one identifier. In this case I prefer
"Virtual Treeview". But sometimes the brain serves not so well (e.g. I was
seriously sick the past two weeks and my son loves to sit on my knees when
I'm working with the computer at home, but he often takes my mind off then
:-)).

> I get the message - Undeclared identifier: 'TWMContextMenu'
> I suspect it is missing from Delphi 4 - Messages.pas

The declaration is:

WM_CONTEXTMENU = $007B;

Ciao, Mike


re: Re: IB_VTree

From: Mike Lischke [public@l...]
Date: Thu Feb 8, 2001 9:26 am
Subject: RE: [VirtualTreeview] Re: IB_VTree

Hi Michael,

> Even this type of data aware tree will not suit all, since
> many people don't want to cycle through the entire dataset, or may have
master detail
> relationships, etc. I think there are lots of ways to make
> Mike's wonderful treeview data aware, but none are a panacea. (But
neither is
> a plain grid).

No doubt, it is difficult to make one DB tree for all needs, but my hopes
are still that there is a configuration which matches, say, 80% of all
cases. This would then definetly be worth to be implemented. Every special
situation needs then some changes which could perhaps be made in the general
solution.

> P.S. Mike: Thanks for developing such a wonderful
> component. The more I use it, the more I am amazed.
> It is a truely great peice of code.

Thank you, great to hear that. I tell you a secrect ;-) but now I also find
out what VT can all be used for (not counted the usage as tree of course).
For instance yesterday I had a talk with somebody and we agreed to throw
away combo boxes, list boxes, check list boxes, grids and the like (from the
Delphi VCL) and only use VT for this from now on. If M$ would have thought a
bit more carefully they would have created a more generic tree and used it
e.g. in their drive combo boxes instead creating a totally different control
which does much of a tree (e.g. indentation). Of course our decision was
also considering the need for Unicode aware controls for all Windows (and
potentially the Linux) platforms.

Ciao, Mike


re: Re: IB_VTree

From: Mike Lischke [public@l...]
Date: Thu Feb 8, 2001 9:30 am
Subject: RE: [VirtualTreeview] Re: IB_VTree

Hi Lester,

> There are two schools of thought running at the moment.
>
> A/ A component must do everthing for everyone.
>
> B/ The most efficient component is designed for its job only.
>
> IB_VTree is a type B component, just as IBObjects is a type B
> database interface. Those of us who do not want the cumbersome overheads
of
> ODBC, ADO etc. Like the simplicity, and the power and speed this
> provides.

Well, I think the solution is (as so often) somewhere in the middle. One
component for all is of course not possible, while creating every time a new
component for similar but slightly different tasks is not acceptable. Hence
my wish to have a control which covers, say, 80% of the likely cases and
special editions for the rest.

Ciao, Mike

 | Replies | Author | Date
465 | Re: IB_VTree | Lester Caine | Thu 2/8/2001


re: IB_VTree

From: "Lester Caine" [lester@l...]
Date: Thu Feb 8, 2001 11:21 am
Subject: Re: IB_VTree

> Well, I think the solution is (as so often) somewhere in the middle.
One
> component for all is of course not possible, while creating every
time a new
> component for similar but slightly different tasks is not
acceptable. Hence
> my wish to have a control which covers, say, 80% of the likely cases
and
> special editions for the rest.

I'd class VirtualTreeview as a good specialist component (B). I just
get annoyed when people start start saying what they EXPECT which is a
side spur to the basic shrink wrap design. The current design is not
database aware - fine - end of story.

IB_VTree is a useful specialist use of VTree for the IBObjects market,
nothing more.

If people want more lets see some real input back rather than
complaints about what it does not do ( this comment really ties up
with complaints across a number of lists )


re: Re: IB_VTree

From: "Paul Gallagher" [paul@t...]
Date: Thu Feb 8, 2001 1:23 pm
Subject: Re: [VirtualTreeview] Re: IB_VTree

The beauty of this project is that the sources to VirtualTree and the
IB_TreeView are available free to all. The source of IBO is also free for
non commercial uses. If anyone needs to make changes they can. If someone
makes a change to VirtualTree that will likely be useful to others then Mike
can permanently add it to the source. Jason does this all the time with IBO,
and in fact he seems to encourage it.

Like I mentioned earlier, the basic framework connectivity of porting
Virtual Tree to IBO is done. In my opinion, that was the hard part. Now it's
just a matter of someone modifying the source to IB_VTree.pas to add
functionality. If someone desires a different datastructure, then there can
be a published property called StructureType added.

I'm not sure who is going to maintain the code for the IB_VTree. If Jason or
Mike don't want to deal with including it in their packages, then I can
setup a webpage where it can be downloaded.

Paul Gallagher

----- Original Message -----
From: "Mike Lischke" [public@l...]
To: <VirtualTreeview@yahoogroups.com>
Sent: Thursday, February 08, 2001 3:30 AM
Subject: RE: [VirtualTreeview] Re: IB_VTree

> Hi Lester,
>
> > There are two schools of thought running at the moment.
> >
> > A/ A component must do everthing for everyone.
> >
> > B/ The most efficient component is designed for its job only.
> >
> > IB_VTree is a type B component, just as IBObjects is a type B
> > database interface. Those of us who do not want the cumbersome overheads
> of
> > ODBC, ADO etc. Like the simplicity, and the power and speed this
> > provides.
>
> Well, I think the solution is (as so often) somewhere in the middle. One
> component for all is of course not possible, while creating every time a
new
> component for similar but slightly different tasks is not acceptable.
Hence
> my wish to have a control which covers, say, 80% of the likely cases and
> special editions for the rest.
>
> Ciao, Mike
>
>
> To unsubscribe from this group, send an email to:
> VirtualTreeview-unsubscribe@egroups.com
>
>
>
>


OnDragDrop with VCL Drag'n'Drop

From: Bender Heri [HBender@E...]
Date: Thu Feb 8, 2001 3:04 pm
Subject: OnDragDrop with VCL Drag'n'Drop

Hi all

I want to implement a VCL d'n'd (drag a control into the VT). There are
correctly DragOver events but never a DragDrop event. Neither there is a
WMLButtonUp message in the VT

Why? How to get informed of the end of a VCL d'n'd?

Heri

 | Replies | Author | Date
475 | Re: OnDragDrop with VCL Drag'n'Drop | Mike Lischke | Fri 2/9/2001
478 | Re: OnDragDrop with VCL Drag'n'Drop | Bender Heri | Fri 2/9/2001
479 | Re: OnDragDrop with VCL Drag'n'Drop | Bender Heri | Fri 2/9/2001


re: Re: IB_VTree

From: "Luis A. Hereira Aguilera" [luison@u...]
Date: Thu Feb 8, 2001 3:31 pm
Subject: Re: [VirtualTreeview] Re: IB_VTree

Hi

I use a way to show the relations master/details witth VTV. A column with
field names and another with data, in this way always there are two columns
and the information is changed, or the rate of the node for each subnode of
the tree.

Bye Luison


IVTEditLink & BCB5 ?

From: [mathias.thorell@s...]
Date: Thu Feb 8, 2001 3:38 pm
Subject: IVTEditLink & BCB5 ?

Hi !

Has anyone been able to implement a custom editor in BCB5, using the
IVTEditLink ?

Either I'm completly lost, or otherwise it's virtually impossible to
make it work...

Some example would be extremely helpful.

TIA,
Mathias Thorell

 | Replies | Author | Date
476 | Re: IVTEditLink & BCB5 ? | Mike Lischke | Fri 2/9/2001
484 | Re: IVTEditLink & BCB5 ? | [mathias.thorell@s...] | Sat 2/10/2001
488 | Re: IVTEditLink & BCB5 ? | Mike Lischke | Sat 2/10/2001


Cannot focus new node

From: Tony Cardalda [software@z...]
Date: Thu Feb 8, 2001 10:29 pm
Subject: Cannot focus new node

Hi all,

I got a little teeneeweenee problem:

When I add a new Node to a Tree without any Header columns this works
fine:

Node := svTab.AddChild(nil);
svTab.FocusedNode := Node;
svTab.EditNode(Node, -1);

But as soon as define one or more Header.columns, the same routine (of
course I replaced the minus one with a zero) will result in a "Node must
already be initialized." in function TBaseVirtualTree.GetPreviousVisible
(version 2.1; 29 Jan 2001)

I do not have any extra data defined. What did I do wrong this time (-;

Thanks,
Tony Cardalda.


Cannot focus new Node (sorry if this msg appears twice...)

From: Tony Cardalda [software@z...]
Date: Thu Feb 8, 2001 10:36 pm
Subject: Cannot focus new Node (sorry if this msg appears twice...)

Hi all,

I got a little teeneeweenee problem:

When I add a new Node to a Tree without any Header columns this works
fine:

Node := svTab.AddChild(nil);
svTab.FocusedNode := Node;
svTab.EditNode(Node, -1);

But as soon as define one or more Header.columns, the same routine (of
course I replaced the minus one with a zero) will result in a "Node must
already be initialized." in function TBaseVirtualTree.GetPreviousVisible
(version 2.1; 29 Jan 2001)

I do not have any extra data defined. What did I do wrong this time (-;

Thanks,
Tony Cardalda.

 | Replies | Author | Date
480 | Re: Cannot focus new Node (sorry if this msg appe | Mike Lischke | Fri 2/9/2001
483 | Use of VT as a drop-down list | Geoffrey Pan | Fri 2/9/2001
486 | Re: Use of VT as a drop-down list | Mike Lischke | Sat 2/10/2001


re: IB_VTree

From: [adembaba@e...]
Date: Fri Feb 9, 2001 12:25 am
Subject: Re: IB_VTree

> If you need a data aware tree, there are several on the market.
Dream
> Company, TeeChart and Dev Express all have good ones. I prefer the
TeeTree
> component.

I have DevExpress and IMCA stuff. They are OK to a point,
but both force you to re-arrange your data in the way they
expect it. This is hardly flexible.

> The reason I started this poject, is because there is no IBO-aware
tree. If
> I had to start somewhere I figured I might as well start with a
good open
> source tree like Virtual Tree.

I see. My fault; I was under the wrong impression.


re: Installation

From: "Peter Evans" [pgevans@m...]
Date: Thu Feb 8, 2001 10:40 pm
Subject: Re: [VirtualTreeview] Installation

I added the following lines ::-

{$IFDEF DFS_COMPILER_4}
type
TWMContextMenu = TWMMouse;
{$ENDIF}
{$IFDEF DFS_COMPILER_4}
const
WM_CONTEXTMENU = $007B;
{$ENDIF}

Unfortunately I get the same three (3) Error messages as previously.
So I am stuck!

Regards, Peter Evans


re: Re: IB_VTree

From: Mike Lischke [public@l...]
Date: Fri Feb 9, 2001 8:33 am
Subject: RE: [VirtualTreeview] Re: IB_VTree

> I'm not sure who is going to maintain the code for the
> IB_VTree. If Jason or Mike don't want to deal with including it in their
packages,
> then I can setup a webpage where it can be downloaded.

Good point. I will at least put IB_VTree as additional download on my
homepage, but I think any further changes will be related to the database
side of the tree. Hence I'd prefer to have the IBO group maintaining
IB_VTree.

Ciao, Mike


re: OnDragDrop with VCL Drag'n'Drop

From: Mike Lischke [public@l...]
Date: Fri Feb 9, 2001 8:34 am
Subject: RE: [VirtualTreeview] OnDragDrop with VCL Drag'n'Drop

Heri,

> I want to implement a VCL d'n'd (drag a control into the VT).
> There are
> correctly DragOver events but never a DragDrop event. Neither
> there is a
> WMLButtonUp message in the VT

I wonder if you have accepted the drag event in OnDragOver. Only if you
accept it you will also get OnDragDrop.

Ciao, Mike


re: IVTEditLink & BCB5 ?

From: Mike Lischke [public@l...]
Date: Fri Feb 9, 2001 8:38 am
Subject: RE: [VirtualTreeview] IVTEditLink & BCB5 ?

Hi Mathias,

> Has anyone been able to implement a custom editor in BCB5, using the
> IVTEditLink ?
>
> Either I'm completly lost, or otherwise it's virtually impossible to
> make it work...

What is your problem with that? I have successfully created new tree editors
several times (and I'm currently writing one for our inhouse property
inspector clone). But this all is Delphi, so there might be some very BCB
specific things preventing you from success. Unfortunately, I don't know BCB
very well so perhaps some of the other Builder gurus here can help you a bit
more than I...

Ciao, Mike

 | Replies | Author | Date
484 | Re: IVTEditLink & BCB5 ? | [mathias.thorell@s...] | Sat 2/10/2001
488 | Re: IVTEditLink & BCB5 ? | Mike Lischke | Sat 2/10/2001


re: Cannot focus new Node (sorry if this msg ap pears twice...)

From: Mike Lischke [public@l...]
Date: Fri Feb 9, 2001 8:40 am
Subject: RE: [VirtualTreeview] Cannot focus new Node (sorry if this msg ap pears twice...)

Hi Tony,

> When I add a new Node to a Tree without any Header columns this works
> fine:
>
> Node := svTab.AddChild(nil);
> svTab.FocusedNode := Node;
> svTab.EditNode(Node, -1);
>
> But as soon as define one or more Header.columns, the same routine (of
> course I replaced the minus one with a zero) will result in a
> "Node must
> already be initialized." in function
> TBaseVirtualTree.GetPreviousVisible

It seems I am a bit too restrictive there, but I have to go through the
sources first to be more specific. I'll do this next weekend and come back
to you then. Until then switch off assertions or comment out that one line.

Ciao, Mike


re: OnDragDrop with VCL Drag'n'Drop

From: Bender Heri [HBender@E...]
Date: Fri Feb 9, 2001 9:52 am
Subject: RE: [VirtualTreeview] OnDragDrop with VCL Drag'n'Drop

> Heri,
>
> > I want to implement a VCL d'n'd (drag a control into the VT).
> > There are
> > correctly DragOver events but never a DragDrop event. Neither
> > there is a
> > WMLButtonUp message in the VT
>
> I wonder if you have accepted the drag event in OnDragOver.
> Only if you
> accept it you will also get OnDragDrop.
>
> Ciao, Mike
>

Yes, I have. As said, there isn't even a WMLButtonUp message in the VT.

To make it clearer what I do:

I have a toolbar with TToolButtons on it, which represents new possible
nodes for the tree. I want to let the user drag a new node into the tree.
Here an excerpt from the DFM-File:

object NewCommandBtn: TToolButton
Left = 0
Top = 2
Hint = 'Drag a new command node to the destination place'
Caption = 'NewCommandBtn'
Grouped = True
ImageIndex = 12
Style = tbsCheck
OnMouseDown = NewCommandBtnMouseDown
OnStartDrag = NewCommandBtnStartDrag
end

That means the drag properties have all the default values
(dmManual,crDrag,dkDrag). In OnMouseDown I call:

btn.BeginDrag(False,5);

and in the OnStartDrag I do nothing yet.

And here an excerpt from my Debug output:

OnDragOverCallback: Source: TDragControlObject; Shift: []; DragState:
DragEnter; point: 108/-27; Mode: Nowhere; effect: COPY
OnDragOverCallback: Source: TDragControlObject; Shift: []; DragState:
DragMove; point: 108/-27; Mode: Nowhere; effect: COPY
...
// (as long the y is negative (dragging over the header) I just exit this
callback)
OnDragOverCallback: Source: TDragControlObject; Shift: []; DragState:
DragMove; point: 100/-1; Mode: Nowhere; effect: COPY
OnDragOverCallback: Source: TDragControlObject; Shift: []; DragState:
DragMove; point: 100/0; Mode: OnNode; effect: COPY
(now its dragged over the first node -> Accept = False):
OnDragOverCallback: VCL Drag over. Source: TDragControlObject
OnDragOverCallback: leaving. Accept: 0; Effect: NONE
OnDragOverCallback: Source: TDragControlObject; Shift: []; DragState:
DragMove; point: 99/1; Mode: OnNode; effect: COPY
OnDragOverCallback: VCL Drag over. Source: TDragControlObject
OnDragOverCallback: leaving. Accept: 0; Effect: NONE
...
// (The second node should accept the drag and set the effect to COPY (I
tried also with MOVE -> the same)):
OnDragOverCallback: Source: TDragControlObject; Shift: []; DragState:
DragMove; point: 98/19; Mode: OnNode; effect: COPY
OnDragOverCallback: VCL Drag over. Source: TDragControlObject
OnDragOverCallback: leaving. Accept: 1; Effect: COPY
// (Then I leave the Mouse button...):
OnDragOverCallback: Source: TDragControlObject; Shift: []; DragState:
DragLeave; point: 98/19; Mode: OnNode; effect: COPY
// (...and nothing happens anymore after this last DragLeave notification)

Of course I could do the needed action here. But unfortunatly this happens
also when I before did not accept the drag. It would be more convenient to
get a DragDrop callback.

Heri


re: OnDragDrop with VCL Drag'n'Drop

From: Bender Heri [HBender@E...]
Date: Fri Feb 9, 2001 10:04 am
Subject: RE: [VirtualTreeview] OnDragDrop with VCL Drag'n'Drop

> // (The second node should accept the drag and set the effect
> to COPY (I
> tried also with MOVE -> the same)):
> OnDragOverCallback: Source: TDragControlObject; Shift: []; DragState:
> DragMove; point: 98/19; Mode: OnNode; effect: COPY
> OnDragOverCallback: VCL Drag over. Source: TDragControlObject
> OnDragOverCallback: leaving. Accept: 1; Effect: COPY
> // (Then I leave the Mouse button...):
> OnDragOverCallback: Source: TDragControlObject; Shift: []; DragState:
> DragLeave; point: 98/19; Mode: OnNode; effect: COPY
> // (...and nothing happens anymore after this last DragLeave
> notification)
>
> Of course I could do the needed action here. But unfortunatly
> this happens
> also when I before did not accept the drag. It would be more
> convenient to
> get a DragDrop callback.
>
> Heri
>
Oh, I found the error. I exited the DragOver callback in the case of
DragState = DragLeave before I checked the acceptance. So the last DragOver
callback turned out in accept = false.
I did this because I ran into some troubles with the OLE Drag built in in
the VT. (I cannot remember what this troubles were exactly, some access
violation or assert(false) somewhere).
Now I do not exit the callback anymore if the drag is a VCL drag, set the
accept = true, and voilà: the DragDrop event is fired !

Heri


re: Cannot focus new Node (sorry if this msg appears twice...)

From: "Mike Lischke" [public@l...]
Date: Fri Feb 9, 2001 2:10 pm
Subject: RE: [VirtualTreeview] Cannot focus new Node (sorry if this msg appears twice...)

Tony,

> But as soon as define one or more Header.columns, the same routine (of
> course I replaced the minus one with a zero) will result in a "Node must
> already be initialized." in function TBaseVirtualTree.GetPreviousVisible
> (version 2.1; 29 Jan 2001)

I tried out this scenario and could not find any problem, but I remember that I
have already removed some of the assertions which were too restrictive. So it
seems this problem is already solved, but you have to wait for the next
prerelease to get your hands on the new source.

Ciao, Mike

 | Replies | Author | Date
483 | Use of VT as a drop-down list | Geoffrey Pan | Fri 2/9/2001
486 | Re: Use of VT as a drop-down list | Mike Lischke | Sat 2/10/2001


re: Installation

From: "Mike Lischke" [public@l...]
Date: Fri Feb 9, 2001 2:10 pm
Subject: RE: [VirtualTreeview] Installation

Peter,

> I added the following lines ::-
>
> {$IFDEF DFS_COMPILER_4}
> type
> TWMContextMenu = TWMMouse;
> {$ENDIF}
> {$IFDEF DFS_COMPILER_4}
> const
> WM_CONTEXTMENU = $007B;
> {$ENDIF}
>
>
> Unfortunately I get the same three (3) Error messages as previously.
> So I am stuck!

Strange. WM_CONTEXTMENU is already defined in Delphi 4 (Messages.pas, I
searched through the source here, but cannot use D4 because it is not
installed). TWMContextMenu however is not defined and the declaration using
TWMMouse is correct.

Please try it without the conditional defines. Can you give me the errors again
when they appear?

Ciao, Mike


re: Autosort question

From: "Mike Lischke" [public@l...]
Date: Fri Feb 9, 2001 2:10 pm
Subject: RE: [VirtualTreeview] Autosort question

Geoffrey,

>
> Does sorting have any impact when there are no columns defined, i.e just for
> a plain VT..?
>
> Can't seem to get it to sort when that is the case.

I verified this. The column has no impact on sorting. It isn't use in any way,
just passed along to
the compare event. So there must be something other wrong.

Ciao, Mike


Use of VT as a drop-down list

From: "Geoffrey Pan" [gpan@c...]
Date: Fri Feb 9, 2001 11:49 pm
Subject: Use of VT as a drop-down list

Mike, werner, anyone else who has done this with VT?. Noticed your comment
regarding to combo boxes, so was just wondering.

Geoffrey Pan.

 | Replies | Author | Date
486 | Re: Use of VT as a drop-down list | Mike Lischke | Sat 2/10/2001


re: IVTEditLink & BCB5 ?

From: [mathias.thorell@s...]
Date: Sat Feb 10, 2001 12:14 am
Subject: Re: IVTEditLink & BCB5 ?

--- In [VirtualTreeview@y...], Mike Lischke [public@l...] wrote:
> Hi Mathias,

> What is your problem with that? I have successfully created new tree
editors
> several times (and I'm currently writing one for our inhouse
property
> inspector clone). But this all is Delphi, so there might be some
very BCB
> specific things preventing you from success. Unfortunately, I don't
know BCB
> very well so perhaps some of the other Builder gurus here can help
you a bit
> more than I...

Well, since I can't find much in the chm-file about it, I've basically
tried this :
Creating a new class, inheriting from IVTEditLink, overriding all
methods.
In my tree's (TVirtualStringTree) OnCreatEditor, I create an instance
of my editlink class, and that's it. The compiler sais that it cannot
create an instance of an abstract class... And since the pascal code
is passing a pointer to a IVTEditLink (in the Result parameter), I'm
not even sure if I'm trying to de the correct thing at all...

/Mathias

 | Replies | Author | Date
488 | Re: IVTEditLink & BCB5 ? | Mike Lischke | Sat 2/10/2001


Select a node in run-time ?

From: [mathias.thorell@s...]
Date: Sat Feb 10, 2001 12:18 am
Subject: Select a node in run-time ?

Hi !

Why doesn't ->Selected[anodepointer] work ?
It doesn't show up, neither as a selcted node in the GUI, nor when I
immediatly call ->GetFirstSelectd().
I'm using VT 2.0 and BCB5, Win2000.
I also tried to assign ->FocusedNode to the Node I want to be selected
without any success.

And, how can a force a repaint of a node ? For instance, I'm changing
some of the data for the node, and I want the node to show up with
it's new text (that OnGetText is reading from my freshly changed data
portion) ?

Best regards, Mathias T.

 | Replies | Author | Date
487 | Re: Select a node in run-time ? | Mike Lischke | Sat 2/10/2001
497 | Re: Select a node in run-time ? | [mathias.thorell@s...] | Sun 2/11/2001
498 | Re: Select a node in run-time ? | Mike Lischke | Sun 2/11/2001
681 | Re: Select a node in run-time ? | [tias@t...] | Mon 3/5/2001
688 | Re: Select a node in run-time ? | Mike Lischke | Tue 3/6/2001
694 | Re: Select a node in run-time ? | [tias@m...] | Tue 3/6/2001
701 | Re: Select a node in run-time ? | Mike Lischke | Wed 3/7/2001


re: Use of VT as a drop-down list

From: "Mike Lischke" [public@l...]
Date: Sat Feb 10, 2001 8:18 am
Subject: RE: [VirtualTreeview] Use of VT as a drop-down list

> Mike, werner, anyone else who has done this with VT?. Noticed your comment
> regarding to combo boxes, so was just wondering.

What do you want to know, Geoffrey? Using VT as drop down list is almost the
same as with any other
win control. The main point is to make the drop down window a child of the
desktop, not of the combo
box main window, otherwise it will be clipped in the client area of your
application.

Ciao, Mike


re: Select a node in run-time ?

From: "Mike Lischke" [public@l...]
Date: Sat Feb 10, 2001 8:18 am
Subject: RE: [VirtualTreeview] Select a node in run-time ?

> Why doesn't ->Selected[anodepointer] work ?
> It doesn't show up, neither as a selcted node in the GUI, nor when I
> immediatly call ->GetFirstSelectd().

It *should* work. Can you please step through the SetSelected method and see
whether AddToSelection
is successfully executed?

> I also tried to assign ->FocusedNode to the Node I want to be selected
> without any success.

Focus and selection are different things. In VT (in opposition to TTreeView) a
node can be selected
only, focused only or both. Only one node can be focused at all while in
multiselection mode several
nodes can be selected.

> And, how can a force a repaint of a node ? For instance, I'm changing
> some of the data for the node, and I want the node to show up with
> it's new text (that OnGetText is reading from my freshly changed data
> portion) ?

Usually InvalidateNode does the trick. If your node is not yet in the client
area and you want to
have it there then call Tree.ScrollIntoView.

Ciao, Mike

 | Replies | Author | Date
497 | Re: Select a node in run-time ? | [mathias.thorell@s...] | Sun 2/11/2001
498 | Re: Select a node in run-time ? | Mike Lischke | Sun 2/11/2001
681 | Re: Select a node in run-time ? | [tias@t...] | Mon 3/5/2001


re: Re: IVTEditLink & BCB5 ?

From: "Mike Lischke" [public@l...]
Date: Sat Feb 10, 2001 8:18 am
Subject: RE: [VirtualTreeview] Re: IVTEditLink & BCB5 ?

Mathias,

> Well, since I can't find much in the chm-file about it, I've basically
> tried this :
> Creating a new class, inheriting from IVTEditLink, overriding all
> methods.
> In my tree's (TVirtualStringTree) OnCreatEditor, I create an instance
> of my editlink class, and that's it. The compiler sais that it cannot
> create an instance of an abstract class... And since the pascal code
> is passing a pointer to a IVTEditLink (in the Result parameter), I'm
> not even sure if I'm trying to de the correct thing at all...

Mmm, inheriting from the interface only will not give you the desired result
because you will just
declare a new interface instead of a concrete class. Basically, use the code as
it is in
VirtualTrees.pas/.hpp. The editor must be derived from a base class (here
TInterfacedObject because
of the reference mechanism) and implementing an interface known to the tree as
communication link
(here IVTEditLink). So basically the start point looks like:

type
TPropertyEditLink = class(TInterfacedObject, IVTEditLink)

Then you have to implement the various interface methods like

function BeginEdit: Boolean; stdcall;

Ciao, Mike


Solution for voAutosort/Listview mode problem & bug report.

From: Werner Lehmann [wl@b...]
Date: Sat Feb 10, 2001 2:12 pm
Subject: Solution for voAutosort/Listview mode problem & bug report.

Hi,

it seems I have discovered two bugs.

As some others before I had problem with AutoSort in listview mode
(=define as 'only the root node has children'). I could not get it
to do anything. Stepping through the code revealed the problem (or
at least what I think the problem is).

An assignment to Header.SortDirection or Header.SortColumn trigger
this procedure in VirtualTrees.pas:

procedure TBaseVirtualTree.SortTree(Column: Integer; Direction: TSortDirection;
DoInit: Boolean = True);

This method recursively sorts all childs of childs of the root node
(see line 11487ff for details). It does not sort the direct childs
of the root node though. In listview mode these are the only nodes
in the 'tree' so nothing happens.

One possible fix:

begin
BeginUpdate;
try
if Column > InvalidColumn then begin // change
DoSort(FRoot);
Sort(FRoot, Column, Direction, DoInit); // insert
end; // insert
finally
EndUpdate;
end;
end;

This works for me. Even better probably (but untested) is to do this
instead:

procedure DoSort(Node: PVirtualNode);
var
Run: PVirtualNode;
begin
Run := Node.FirstChild;
while Assigned(Run) do
begin
if DoInit and not (vsInitialized in Run.States) then
InitNode(Run);
if vsInitialized in Run.States then
begin
// depth-first sort
DoSort(Run);
Sort(Run, Column, Direction, DoInit);
end;
Run := Run.NextSibling;
end;
Sort(Node, Column, Direction, DoInit); // insert
end;

For your reference, my OnHeaderClick handler looks like this:

with (Sender as TVirtualStringTree).Header do
if SortColumn <> Column then begin
SortDirection := sdAscending;
SortColumn := Column;
end else
SortDirection := TSortDirection(1 - ord(SortDirection));

It might be wise to temporarily remove the voAutosort option flag
to prevent double sorting in the first branch of the if-statement
(Mike?).

On to the second problem which is related to this one: I had not yet
updated to v2.1 so I did it now to learn if this problem had been fixed.
Which was not the case. BTW, the *.dcr is missing from the distribution
zip from yahoogroups. And even if I copy my old one (from pre-v2.1) into
the directory I get only standard glyphs in the component palette, any
idea why?

v2.1 introduces a new problem. We have an endless loop between methods

procedure TBaseVirtualTree.EndUpdate;

and

procedure TBaseVirtualTree.SortTree(Column: Integer; Direction: TSortDirection;
DoInit: Boolean = True);

This happens if voAutosort is set in designtime. The order of methods
which are executed then (on start) looks like this:

TMain.Create
TBaseVirtualTree.SetNodeDataSize(4)
TBaseVirtualTree.Clear
TBaseVirtualTree.EndUpdate
TBaseVirtualTree.SortTree(-1,sdAscending,True)
TBaseVirtualTree.EndUpdate
TBaseVirtualTree.SortTree(-1,sdAscending,True)
TBaseVirtualTree.EndUpdate
TBaseVirtualTree.SortTree(-1,sdAscending,True)
TBaseVirtualTree.EndUpdate
TBaseVirtualTree.SortTree(-1,sdAscending,True)

... repeat until stack overflow :)

The reason is the one and only change to EndUpdate:

if voAutoSort in FOptions then
SortTree(FHeader.FSortColumn, FHeader.FSortDirection, True);

Mike, it looks like incrementing FUpdateCount before and decrementing
after could work around this problem. On the other hand this might
prevent needed Invalidation at other times. I suppose you have a better
idea on what to do here.

Regards,
WL

 | Replies | Author | Date
491 | Re: Solution for voAutosort/Listview mode problem | Mike Lischke | Sat 2/10/2001


Advanced Demo and VT 2.1

From: [info@t...]
Date: Sat Feb 10, 2001 6:09 pm
Subject: Advanced Demo and VT 2.1

Hi,

I'm trying to get the advanced demo with vt 2.1 to run.

On the properties page, which is the one I'll implement into my
project, an assertion comes up: Nodes must never be nil.

Also there is a compilation error:

"..Sort... not enough valid parameters...". After commenting that
out, the demo will run, but the property page is empty after that
assertion.

I don't have enough knowledge on those trees yet to fix that prob by
myself, so any help is appreciated.

Regards

Thomas

 | Replies | Author | Date
492 | Re: Advanced Demo and VT 2.1 | Mike Lischke | Sat 2/10/2001
493 | Re: Advanced Demo and VT 2.1 | [info@t...] | Sun 2/11/2001
494 | Re: Advanced Demo and VT 2.1 | Mike Lischke | Sun 2/11/2001
507 | Re: Advanced Demo and VT 2.1 | [info@t...] | Mon 2/12/2001


re: Solution for voAutosort/Listview mode problem & bug report.

From: "Mike Lischke" [public@l...]
Date: Sat Feb 10, 2001 7:34 pm
Subject: RE: [VirtualTreeview] Solution for voAutosort/Listview mode problem & bug report.

Hi Werner,

> As some others before I had problem with AutoSort in listview mode
> (=define as 'only the root node has children'). I could not get it
> to do anything. Stepping through the code revealed the problem (or
> at least what I think the problem is).

Thank you for analyzing these problems. In the wrong sort case you found a
hidden flaw which I
should have seen already when I designed the method. Interestingly enough,
everything which gets
added after the initial release of VT seems to have a problem or even a bug.
This was with the paint
stuff also the case. Of course it is not always so otherwise bug fixing would
not be possible, but
the tendency is interesting.

I have taken your solution and modified it a bit to:

procedure TBaseVirtualTree.SortTree(Column: Integer; Direction: TSortDirection;
DoInit: Boolean =
True);

//--------------- local function --------------------------------------------

procedure DoSort(Node: PVirtualNode);

// recursively sorts Node and its child nodes

var
Run: PVirtualNode;

begin
Sort(Node, Column, Direction, DoInit);

Run := Node.FirstChild;
while Assigned(Run) do
begin
if DoInit and not (vsInitialized in Run.States) then
InitNode(Run);
if vsInitialized in Run.States then
DoSort(Run);
Run := Run.NextSibling;
end;
end;

//--------------- end local function ----------------------------------------

begin
BeginUpdate;
try
if Column > InvalidColumn then
DoSort(FRoot);
finally
EndUpdate;
end;
end;

This should do the job (there is also no double sorting).

> BTW, the *.dcr is missing from the distribution
> zip from yahoogroups. And even if I copy my old one (from pre-v2.1) into
> the directory I get only standard glyphs in the component palette, any
> idea why?

Well, the *.dcr file is not included into the package file because it was not
there when I created
the package. Please change the *.dpk file to:

package VirtualTreesD5;

{$R *.RES}
{$R 'VirtualTrees.dcr'}
{$ALIGN ON}
{$ASSERTIONS ON}
...

> v2.1 introduces a new problem. We have an endless loop between methods
>
> Mike, it looks like incrementing FUpdateCount before and decrementing
> after could work around this problem. On the other hand this might
> prevent needed Invalidation at other times. I suppose you have a better
> idea on what to do here.

In this case I don't see any other solution than what you suggested. The main
problem is that
EndUpdate requires potentially a resort and the SortTree method runs faster
with locked updates. I
have replaced the BeginUpdate/EndUpdate calls by Inc/Dec(FUpdateCount) together
with an Invalidate
call. The internal caches are rescanned already in Sort(...).

Ciao, Mike


re: Advanced Demo and VT 2.1

From: "Mike Lischke" [public@l...]
Date: Sat Feb 10, 2001 7:37 pm
Subject: RE: [VirtualTreeview] Advanced Demo and VT 2.1

Hi Thomas,

> I'm trying to get the advanced demo with vt 2.1 to run.
>
> On the properties page, which is the one I'll implement into my
> project, an assertion comes up: Nodes must never be nil.
>
> Also there is a compilation error:
>
> "..Sort... not enough valid parameters...". After commenting that
> out, the demo will run, but the property page is empty after that
> assertion.

Mmm, difficult to say what causes these problems. I don't have them here, but
I'm continuously
modifying the sources, hence I have likely fixed this already. Which Delphi
version do you use and
can you send me a demo project showing the problem?

Ciao, Mike

 | Replies | Author | Date
493 | Re: Advanced Demo and VT 2.1 | [info@t...] | Sun 2/11/2001
494 | Re: Advanced Demo and VT 2.1 | Mike Lischke | Sun 2/11/2001
507 | Re: Advanced Demo and VT 2.1 | [info@t...] | Mon 2/12/2001


re: Advanced Demo and VT 2.1

From: [info@t...]
Date: Sun Feb 11, 2001 11:19 am
Subject: Re: Advanced Demo and VT 2.1

> Mmm, difficult to say what causes these problems. I don't have them
here, but I'm continuously
> modifying the sources, hence I have likely fixed this already.
Which Delphi version do you use and
> can you send me a demo project showing the problem?

Hi Mike,

I ve just uploaded the Exe file as advanced.zip. Its made from your
demo without modification.

This is a snapshot of the "sort problem"

if Sender.ChildCount[Node] > 0 then
Sender.Sort(Node, 0, True, FileCompare, False);

The compiler messages are:

[Fehler] Main.pas(1340): Inkompatible Typen: 'TSortDirection'
und 'Boolean'
[Fehler] Main.pas(1340): Nicht genügend wirkliche Parameter
[Fataler Fehler] Advanced.dpr(6): Verwendete Unit 'Main.pas' kann
nicht compiliert werden

Regards

Thomas

 | Replies | Author | Date
494 | Re: Advanced Demo and VT 2.1 | Mike Lischke | Sun 2/11/2001
507 | Re: Advanced Demo and VT 2.1 | [info@t...] | Mon 2/12/2001


re: Re: Advanced Demo and VT 2.1

From: "Mike Lischke" [public@l...]
Date: Sun Feb 11, 2001 11:57 am
Subject: RE: [VirtualTreeview] Re: Advanced Demo and VT 2.1

Thomas,

> I ve just uploaded the Exe file as advanced.zip. Its made from your
> demo without modification.

The executable is not of much use. I know were the assertion failure comes from
but this is not the
origin of the problem I think. Please stay with version 1.31 for the time being
until I get the next
official release out. The prerelease of v2.1 requires some changes in the demo
to work correctly and
if you can't do them by yourself then you have to wait until the official
release.

>
> This is a snapshot of the "sort problem"
>
> if Sender.ChildCount[Node] > 0 then
> Sender.Sort(Node, 0, True, FileCompare, False);

Yes, in v 2.1 if have removed the compare function from the method parameter
list since it would not
work with automatic sorting. Instead it is now an event. You can easily check
out the parameter list
by looking at the declaration of Sort(..).

Ciao, Mike

 | Replies | Author | Date
507 | Re: Advanced Demo and VT 2.1 | [info@t...] | Mon 2/12/2001


Drag n Drop

From: "Paul Gallagher" [paul@t...]
Date: Sun Feb 11, 2001 7:29 pm
Subject: Drag n Drop

Is there a demo of using Drag and Drop in Virtual Tree?

Paul

[Non-text portions of this message have been removed]

 | Replies | Author | Date
496 | Re: Drag n Drop | Mike Lischke | Sun 2/11/2001
4713 | Drag n Drop | Tom Hahn | Mon 11/19/2001
4720 | Re: Drag n Drop | Werner Lehmann | Mon 11/19/2001


re: Drag n Drop

From: "Mike Lischke" [public@l...]
Date: Sun Feb 11, 2001 7:52 pm
Subject: RE: [VirtualTreeview] Drag n Drop

Paul,

> Is there a demo of using Drag and Drop in Virtual Tree?

I'm just uploading a demo to the file area of yahoogroups. It is not fully
complete but should give
you a good idea about the inner workings.

Ciao, Mike


re: Select a node in run-time ?

From: [mathias.thorell@s...]
Date: Sun Feb 11, 2001 8:21 pm
Subject: Re: Select a node in run-time ?

--- In [VirtualTreeview@y...], "Mike Lischke" [public@l...] wrote:
> It *should* work. Can you please step through the SetSelected method
and see whether AddToSelection
> is successfully executed?

Yep, AddToSelection() is executed. But, as I stated before, when I
call ->GetFirstSelected() it returns NULL.

> Focus and selection are different things. In VT (in opposition to
TTreeView) a node can be selected
> only, focused only or both. Only one node can be focused at all
while in multiselection mode several
> nodes can be selected.

Yep, I know that. It was just a more or less desperate attempt to
select a node in run-time... ;-)

> Usually InvalidateNode does the trick. If your node is not yet in
the client area and you want to
> have it there then call Tree.ScrollIntoView.

That's what made me confused for a while, I mean the name
"InvalideNode" made me think that VT tried to destroy me node in some
peculiar way... Obviosly, it's not destroyed, and tracing thru the
code proves that InvalidateNode is executed.

Is it possible that the "NO_WIN32_LEAN_AND_MEAN" constant (I think
it's BCB5 specific) may cause this kind of behavior ?
I also have problem deriving from TCustomVirtualStringTree, in my
class' constructor I must use this code, otherwise I get an AV :
FSingletonNodeArray.Length = 1;
(Of course I have to make FSingletonNodeArray public in the hpp-file
also).
So, maybe I have some major compiling/linking flag that causes all
these strange behaviours ? Aprt from all this it *looks* like it's
working fine anyway, so keep up the good work, Mike !

Bset regards,
Mathias Thorell

 | Replies | Author | Date
498 | Re: Select a node in run-time ? | Mike Lischke | Sun 2/11/2001
681 | Re: Select a node in run-time ? | [tias@t...] | Mon 3/5/2001


re: Re: Select a node in run-time ?

From: "Mike Lischke" [public@l...]
Date: Sun Feb 11, 2001 8:44 pm
Subject: RE: [VirtualTreeview] Re: Select a node in run-time ?

Hi Mathias,

I'm sorry that I can't help you much with BCB, you know, I use Delphi :o]

> Yep, AddToSelection() is executed. But, as I stated before, when I
> call ->GetFirstSelected() it returns NULL.

This is strange. This means somewhere between the AddToSelection and the
GetFirstSelected calls the
selection is cleared for some reason. Please try the following:

- set a break point at the start of ClearSelection
- give this break point a group name in: Source Breakpoint Properties and
disable it
- set another break point in AddToSelection
- disable Break action in advanced break point settings but insert the group
name of the first break
point in the Enable group field

Now the breakpoint in ClearSelection is enabled after AddToSelection is called
and you can see
whether ClearSelection (or InternalClearSelection, try this out) is called
before GetFirstSelected.
Watch also that in AddToSelection the node is really added to the internal
selection array.

> That's what made me confused for a while, I mean the name
> "InvalideNode" made me think that VT tried to destroy me node in some
> peculiar way... Obviosly, it's not destroyed, and tracing thru the
> code proves that InvalidateNode is executed.

Well, it is difficult to find short names which still describe best what the
routine does.
InvalidateNode, Invalidate and the like are quite common so I thought it is
sufficient.

> Is it possible that the "NO_WIN32_LEAN_AND_MEAN" constant (I think
> it's BCB5 specific) may cause this kind of behavior ?

Depends. I don't know what gets disabled by this flag.

> I also have problem deriving from TCustomVirtualStringTree, in my
> class' constructor I must use this code, otherwise I get an AV :
> FSingletonNodeArray.Length = 1;

Is a dynamic array a class in BCB? In Delphi it is just this, an array, but
deallocated
automatically. In TBaseVirtualTree.Create there is a call to set the array's
length to 1. So why
have you had to insert your statement?

> So, maybe I have some major compiling/linking flag that causes all
> these strange behaviours ? Aprt from all this it *looks* like it's
> working fine anyway, so keep up the good work, Mike !

Great! Hope you get all the troublemakers fixed too.

Ciao, Mike

 | Replies | Author | Date
681 | Re: Select a node in run-time ? | [tias@t...] | Mon 3/5/2001


Indent

From: "Paul Gallagher" [paul@t...]
Date: Mon Feb 12, 2001 2:55 am
Subject: Indent

If I display a tree without the tree lines or buttons, then there is a fairly
large indent form the left of the tree view, where the lines would have been.
The only way I can see to eliminate the gap, is to reduce the Indent property,
but then that also reduces the indent of the branches.

Is there a way of reducing the left side margin without some complicated
OwnerDraw procedure?

TIA
Paul

[Non-text portions of this message have been removed]

 | Replies | Author | Date
500 | Re: Indent | Mike Lischke | Mon 2/12/2001
501 | Re: Indent | Paul Gallagher | Mon 2/12/2001
502 | Re: Indent | Mike Lischke | Mon 2/12/2001
503 | Re: Indent | Paul Gallagher | Mon 2/12/2001
505 | Re: Indent | Mike Lischke | Mon 2/12/2001


re: Indent

From: Mike Lischke [public@l...]
Date: Mon Feb 12, 2001 10:19 am
Subject: RE: [VirtualTreeview] Indent

Paul,

> Is there a way of reducing the left side margin without some
> complicated OwnerDraw procedure?

There is a Margin property in the tree. Try to adjust the horizontal
alignment with this property.

Ciao, Mike


re: Indent

From: "Paul Gallagher" [paul@t...]
Date: Mon Feb 12, 2001 1:40 pm
Subject: Re: [VirtualTreeview] Indent

Margin has a default value of 4. Setting to zero still leaves a fairly large
gap to the left. I think it is starting at the Indent property of 18.

As a recommendation, when the tree lines are not shown, the first column
should not be indented. Or there could be a property, IndentFirstColumn:
Boolean

Its not a real big deal either way. I was just trying to emulate the look of
the Favorites window in Internet Explorer.

Paul

----- Original Message -----
From: "Mike Lischke" [public@l...]
To: <VirtualTreeview@yahoogroups.com>
Sent: Monday, February 12, 2001 4:19 AM
Subject: RE: [VirtualTreeview] Indent

> Paul,
>
> > Is there a way of reducing the left side margin without some
> > complicated OwnerDraw procedure?
>
> There is a Margin property in the tree. Try to adjust the horizontal
> alignment with this property.
>
> Ciao, Mike
>
>
> To unsubscribe from this group, send an email to:
> VirtualTreeview-unsubscribe@egroups.com
>
>
>
>


re: Indent

From: Mike Lischke [public@l...]
Date: Mon Feb 12, 2001 1:54 pm
Subject: RE: [VirtualTreeview] Indent

> Margin has a default value of 4. Setting to zero still leaves
> a fairly large
> gap to the left. I think it is starting at the Indent property of 18.

Aaah, such a large gap. Could it be that you still have set voShowRoot in
the tree options?

Ciao, Mike


re: Indent

From: "Paul Gallagher" [paul@t...]
Date: Mon Feb 12, 2001 3:00 pm
Subject: Re: [VirtualTreeview] Indent

That did it. I thought that option would hide the entire root column.

Paul

----- Original Message -----
From: "Mike Lischke" [public@l...]
To: <VirtualTreeview@yahoogroups.com>
Sent: Monday, February 12, 2001 7:54 AM
Subject: RE: [VirtualTreeview] Indent

> > Margin has a default value of 4. Setting to zero still leaves
> > a fairly large
> > gap to the left. I think it is starting at the Indent property of 18.
>
> Aaah, such a large gap. Could it be that you still have set voShowRoot in
> the tree options?
>
> Ciao, Mike
>
>
> To unsubscribe from this group, send an email to:
> VirtualTreeview-unsubscribe@egroups.com
>
>
>
>


IBTree

From: "Paul Gallagher" [paul@t...]
Date: Mon Feb 12, 2001 3:17 pm
Subject: IBTree

I have been "playing" around with this component. IBO has a very unique system
of BookMarks. It is a simple string field. What I am doing is creating a field
in the VirtualTree Record called, BookMark. This looks like it will work
extremely well for synchronizing the two. I hope to have a somewhat working
version done by the end of the week. It will allow for Editing, Deleting and
Moving the Nodes. At this point I have not thought about moving between
multiple tables, but that should not be much harder to implement if someone
wants to work on it.

It is important to point out that this will work ONLY with the native IBO data
access. This type of Bookmark property is not available in standard TDataset
access components.

Paul

[Non-text portions of this message have been removed]

 | Replies | Author | Date
506 | Re: IBTree | Mike Lischke | Mon 2/12/2001


re: Indent

From: Mike Lischke [public@l...]
Date: Mon Feb 12, 2001 3:39 pm
Subject: RE: [VirtualTreeview] Indent

> That did it. I thought that option would hide the entire root column.

This is exactly the same as TCustomTreeView.ShowRoot (there I got the name
from). So I can claim I have at least *some* compatibility with the old
treeview ;-).

Ciao, Mike


re: IBTree

From: Mike Lischke [public@l...]
Date: Mon Feb 12, 2001 3:40 pm
Subject: RE: [VirtualTreeview] IBTree

> It is important to point out that this will work ONLY with
> the native IBO data access. This type of Bookmark property is
> not available in standard TDataset access components.

Still sounds good. Let me know when I can put it on my homepage (or a link
to another location).

Ciao, Mike


re: Advanced Demo and VT 2.1

From: [info@t...]
Date: Mon Feb 12, 2001 5:41 pm
Subject: Re: Advanced Demo and VT 2.1

> origin of the problem I think. Please stay with version 1.31 for
the time being until I get the next

Thanks Mike,

for the time beeing I'll go back to 1.31.

Thanks for coop

Thomas


Focusing a Node

From: "Paul Gallagher" [paul@t...]
Date: Tue Feb 13, 2001 12:08 am
Subject: Focusing a Node

How do I get a node to focus? I understand the FocusedNode method, but that
does not make the node VISIBLY focused. I want the node to actually display the
gray highlight, or a box around it. I have tried a lot of things, but can't
figure it out.

Paul

[Non-text portions of this message have been removed]

 | Replies | Author | Date
511 | Re: Focusing a Node | Paul Gallagher | Tue 2/13/2001
516 | Re: Focusing a Node | Luis A. Hereira Aguilera | Tue 2/13/2001
526 | Re: Focusing a Node | Mike Lischke | Wed 2/14/2001


re: Installation

From: "Peter Evans" [pgevans@m...]
Date: Tue Feb 13, 2001 12:22 am
Subject: Re: [VirtualTreeview] Installation

> Strange. WM_CONTEXTMENU is already defined in Delphi 4 (Messages.pas, I
searched through the source here, but cannot use D4 because it is not
installed). TWMContextMenu however is not defined and the declaration using
TWMMouse is correct.

You are right. I changed my extra code to only be ::-

{$IFDEF DFS_COMPILER_4}
type
TWMContextMenu = TWMMouse;
{$ENDIF}

The unit now compiles.

I did find a problem with the Delphi 4 compiler. The compiler does not
accept all lines within a conditional
defines to be commented out. The compiler took as comment all subsequent
lines until the next conditional
defines. That was the Resource line. Then I got error unable to find
'VirtualTrees.RES'.

However, when I try to install the unit in my package VirtTrees1 I get the
same 3 errors as before.

Regards, Peter Evans


Finding a node

From: "Paul Gallagher" [paul@t...]
Date: Tue Feb 13, 2001 1:22 am
Subject: Finding a node

I think I asked this a while back, but got no answer.

How can I find (get) a specific node, when I know some of its data, such as the
caption? I created my own FindNode procedure that searches by iterating down
through the tree, but maybe there is a better way?

TIA
Paul

[Non-text portions of this message have been removed]

 | Replies | Author | Date
513 | Re: Finding a node | Mike Lischke | Tue 2/13/2001
520 | Re: Finding a node | David Hooper | Wed 2/14/2001
524 | Re: Finding a node | Werner Lehmann | Wed 2/14/2001
527 | Re: Finding a node | Mike Lischke | Wed 2/14/2001


re: Focusing a Node

From: "Paul Gallagher" [paul@t...]
Date: Tue Feb 13, 2001 1:23 am
Subject: Re: [VirtualTreeview] Focusing a Node

Never mind. Found my own answer.

if assigned(MyNode) then Selected[MyNode] := true;

Paul

----- Original Message -----
From: "Paul Gallagher" [paul@t...]
To: <virtualTreeview@yahoogroups.com>
Sent: Monday, February 12, 2001 6:08 PM
Subject: [VirtualTreeview] Focusing a Node

> How do I get a node to focus? I understand the FocusedNode method, but
that does not make the node VISIBLY focused. I want the node to actually
display the gray highlight, or a box around it. I have tried a lot of
things, but can't figure it out.
>
> Paul
>
>
> [Non-text portions of this message have been removed]
>
>
>
> To unsubscribe from this group, send an email to:
> VirtualTreeview-unsubscribe@egroups.com
>
>
>
>


Inheriting the OnChange event

From: "Paul Gallagher" [paul@t...]
Date: Tue Feb 13, 2001 3:57 am
Subject: Inheriting the OnChange event

I'm really stuck on this one. I'm trying to implement the OnChange event in my
descendant component, but can't get it to work. The DoInitNode event was easy.
I used this in the protected section:

procedure DoInitNode(Parent, Node: PVirtualNode; var InitStates:
TVirtualNodeInitStates); override;

and then just defined my procedure in the implementation section. I am trying
to do something similar with OnChange, but nothing works. Any suggestions would
be appreciated.

TIA
Paul

[Non-text portions of this message have been removed]

 | Replies | Author | Date
514 | Re: Inheriting the OnChange event | Mike Lischke | Tue 2/13/2001


re: Finding a node

From: Mike Lischke [public@l...]
Date: Tue Feb 13, 2001 9:05 am
Subject: RE: [VirtualTreeview] Finding a node

Paul,

> How can I find (get) a specific node, when I know some of its
> data, such as the caption? I created my own FindNode
> procedure that searches by iterating down through the tree,
> but maybe there is a better way?

This way is correct. There is no FindNode routine implemented because the
tree cannot do any comparison to find a certain node (the criterions can be
totally different, not only the caption).

For search, however, I prefer IterateSubtree where you can stop the
iteration in the callback to find a node depending on the data you passed
(and only the application can know how to find a node).

Ciao, Mike

 | Replies | Author | Date
520 | Re: Finding a node | David Hooper | Wed 2/14/2001


re: Inheriting the OnChange event

From: Mike Lischke [public@l...]
Date: Tue Feb 13, 2001 9:08 am
Subject: RE: [VirtualTreeview] Inheriting the OnChange event

> procedure DoInitNode(Parent, Node: PVirtualNode; var
> InitStates: TVirtualNodeInitStates); override;
>
> and then just defined my procedure in the implementation
> section. I am trying to do something similar with OnChange,
> but nothing works. Any suggestions would be appreciated.

You can do the same with OnChange. The method to override is DoChange. Note
however that a change notification can be delayed (if ChangeDelay is > 0).
Additionally, I remember that I have renamed some method regarding the
change and structure change mechanism to be conformal with the rest of the
overridable classes.

I'll upload the latest version to yahoogroups, please try this out.

Ciao, Mike


Header / Visibility / Columns / AutoResize

From: Werner Lehmann [wl@b...]
Date: Tue Feb 13, 2001 1:25 pm
Subject: Header / Visibility / Columns / AutoResize

Isn't this a truly generic subject? :)

Mike,

it seems that the use of columns *requires* a visible header. That is if I did
not overlook an option here. In one of my applications of the
TVirtualStringTree
I want to show two columns only and it is clear what the columns are. Showing
the
header would not fit into the visual appearance of the rest of the app and is
simply unnecessary.

If the header is invisible I always get only a -1 as Column in the OnGetText
event.
I have tried this as a (temporary?) workaround:

function TVTHeader.GetUseColumns: Boolean;

begin
Result := { (hoVisible in FOptions) and } (FColumns.Count > 0);
end;

This helps. The problem with this is that the AutoResize of the leftmost column
does not work anymore. Any chance to...

... get this into the distribution?
... get the AutoResize working under these circumstances?

Are there are other sideeffects that you know of?

Speaking of the AutoResize: This is a much missed feature with the common
controls
(the autoresize of TListview is something different). Unfortunately it is very
confusing to the users (including me) that the AutoSize column cannot be resized
manually. Although this may be correct in theory it is definitely unexpected. A
way to resize the Autosize column (lets assume index 0 for autosizeindex) is to
drag the right side of column 1 to the left which will widen column 0. Figure
this:
you pull column 1 to the left and column 0 goes right.

I would prefer this a lot: the autosizecolumn can be manually resized. The
difference
goes to / is taken from the width of the column right next beside it. Or if
there
is no visible column on the right side, but one on the left, the left border of
the autosizecolumn only can be dragged and the difference is adjusted with the
next-
left column.

Hopefully this was not too confusing. What do you say?

Regards,
Werner

 | Replies | Author | Date
517 | Re: Header / Visibility / Columns / AutoResize | Bender Heri | Tue 2/13/2001
518 | Re: Header / Visibility / Columns / AutoResize | Werner Lehmann | Tue 2/13/2001
525 | Re: Header / Visibility / Columns / AutoResize | Mike Lischke | Wed 2/14/2001
530 | Re: Header / Visibility / Columns / AutoResize | Werner Lehmann | Wed 2/14/2001
532 | Re: Header / Visibility / Columns / AutoResize | Mike Lischke | Wed 2/14/2001
541 | Re: Header / Visibility / Columns / AutoResize | Werner Lehmann | Thu 2/15/2001
544 | Re: Header / Visibility / Columns / AutoResize | Mike Lischke | Thu 2/15/2001
548 | Re: Header / Visibility / Columns / AutoResize | Werner Lehmann | Thu 2/15/2001


re: Focusing a Node

From: "Luis A. Hereira Aguilera" [luison@u...]
Date: Tue Feb 13, 2001 1:26 pm
Subject: Re: [VirtualTreeview] Focusing a Node

Hi Paul

Look what I do is this, I don´t know if it is the correct way, but it works
so far.
Mike, tell me if I am in the correct way.
...
procedure TfrmTest.SelectedNode(Node : PVirtualNode);
begin
with VTV do
begin
if (voMultiSelect in Options)
then Include(Node.States, vsSelected)
else ClearSelection;
FocusedNode := Node;
Selected[Node] := true;
end
end;

Bye, Luison [<>]


re: Header / Visibility / Columns / AutoResize

From: Bender Heri [HBender@E...]
Date: Tue Feb 13, 2001 1:32 pm
Subject: RE: [VirtualTreeview] Header / Visibility / Columns / AutoResize

Werner Lehmann [[wl@b...]] wrote:

> If the header is invisible I always get only a -1 as Column
> in the OnGetText event.
> I have tried this as a (temporary?) workaround:

I had similar problems. To solve it I did not put the header invisible but
set the height := 0;

Heri


re: Header / Visibility / Columns / AutoResize

From: Werner Lehmann [wl@b...]
Date: Tue Feb 13, 2001 2:17 pm
Subject: Re: [VirtualTreeview] Header / Visibility / Columns / AutoResize

Bender Heri wrote:
>
> I had similar problems. To solve it I did not put the header invisible but
> set the height := 0;

Great! Works perfectly. Although it does not seem like the 'right' way to
do it... :)

Regards,
WL


Drag and Drop works?

From: "Paul Gallagher" [paul@t...]
Date: Wed Feb 14, 2001 2:31 am
Subject: Drag and Drop works?

I am having a fair amount of trouble with implementing drag and drop on Virtual
Tree. There is a lot of access violations and erratic behavior. Im far from an
expert with Drag and drop, so it may be my fault.

Does anyone have a good working example of drag and drop with virtual tree?

TIA
Paul

[Non-text portions of this message have been removed]

 | Replies | Author | Date
521 | Re: Drag and Drop works? | Paul Gallagher | Wed 2/14/2001
523 | Re: Drag and Drop works? | Werner Lehmann | Wed 2/14/2001
528 | Re: Drag and Drop works? | Mike Lischke | Wed 2/14/2001
533 | Re: Drag and Drop works? | Paul Gallagher | Wed 2/14/2001
534 | Re: Drag and Drop works? | Bender Heri | Wed 2/14/2001
535 | Re: Drag and Drop works? | Mike Lischke | Wed 2/14/2001
536 | Re: Drag and Drop works? | Mike Lischke | Wed 2/14/2001
537 | Re: Drag and Drop works? | Bender Heri | Wed 2/14/2001
538 | Re: Drag and Drop works? | Paul Gallagher | Wed 2/14/2001


re: Finding a node

From: "David Hooper" [david@i...]
Date: Wed Feb 14, 2001 2:50 am
Subject: RE: [VirtualTreeview] Finding a node

Can you supply me with your "FindNode" function?
would save me a fair bit of time

Regards, David.

- -----Original Message-----
- From: Mike Lischke [mailto:[public@l...]]
- Sent: Tuesday, 13 February 2001 10:05 p.m.
- To: 'VirtualTreeview@yahoogroups.com'
- Subject: RE: [VirtualTreeview] Finding a node
-
- > How can I find (get) a specific node, when I know some of its
- > data, such as the caption? I created my own FindNode
- > procedure that searches by iterating down through the tree,
- > but maybe there is a better way?
-
- This way is correct. There is no FindNode routine implemented because the
- tree cannot do any comparison to find a certain node (the
- criterions can be
- totally different, not only the caption).
-
- For search, however, I prefer IterateSubtree where you can stop the
- iteration in the callback to find a node depending on the data you passed
- (and only the application can know how to find a node).
-


re: Drag and Drop works?

From: "Paul Gallagher" [paul@t...]
Date: Wed Feb 14, 2001 4:00 am
Subject: Re: [VirtualTreeview] Drag and Drop works?

My inherited OnDragDrop in my descendant comonent is giving problems. If I
create the dragdrop event in a form, then it is OK.

The function declaration in the descendant component looks like this:

function TIB_CustomVTree.DoDragDrop(const DataObject: IDataObject; KeyState:
Integer; Pt: TPoint;
var Effect: Integer): HResult;

The one in the form looks like this:

procedure TfmMain.VTDragDrop(Sender: TBaseVirtualTree; Source: TObject;
DataObject: IDataObject; const Formats: array of Word;
Shift: TShiftState; Pt: TPoint; var Effect: Integer; Mode: TDropMode);

Obviously they are a lot different. Since I don't know how to write
components, could someone direct me how to get the method to execute
properly in the descendant component?

Im trying to make this work, but I think Im in way over my head.

TIA
Paul

----- Original Message -----
From: "Paul Gallagher" [paul@t...]
To: <virtualTreeview@yahoogroups.com>
Sent: Tuesday, February 13, 2001 8:31 PM
Subject: [VirtualTreeview] Drag and Drop works?

> I am having a fair amount of trouble with implementing drag and drop on
Virtual Tree. There is a lot of access violations and erratic behavior. Im
far from an expert with Drag and drop, so it may be my fault.
>
> Does anyone have a good working example of drag and drop with virtual
tree?
>
> TIA
> Paul
>
>
> [Non-text portions of this message have been removed]
>
>
>
> To unsubscribe from this group, send an email to:
> VirtualTreeview-unsubscribe@egroups.com
>
>
>
>


Contextmenu on Header?

From: Werner Lehmann [wl@b...]
Date: Wed Feb 14, 2001 9:17 am
Subject: Contextmenu on Header?

Hi,

what is the preferred (any?) way to catch a right button click on
the header? I want to show a contextmenu. OnMouseUp does not fire
for clicks on the header, and OnHeaderClick does not fire for right
mouse button clicks (would not know which button it was anyway since
the TreeStates seem to be empty then already).

Regards,
Werner

 | Replies | Author | Date
529 | Re: Contextmenu on Header? | Mike Lischke | Wed 2/14/2001
531 | Re: Contextmenu on Header? | Werner Lehmann | Wed 2/14/2001
539 | Re: Contextmenu on Header? | Werner Lehmann | Thu 2/15/2001
542 | Re: Contextmenu on Header? | Mike Lischke | Thu 2/15/2001


re: Drag and Drop works?

From: Werner Lehmann [wl@b...]
Date: Wed Feb 14, 2001 9:21 am
Subject: Re: [VirtualTreeview] Drag and Drop works?

Paul, a general advice on drag and drop is difficult. But to learn how the
parameters of both methods that you cited map to each other you have to
examine the DoDragDrop method and see when and how the params are trans-
formed and finally passed to an event handler.

DoDragDrop is not very complex, you can easily see what is done before the
line

FOnDragDrop(Self, DragManager.FDragSource, DataObject, Formats, Shift, Pt,
Effect, FLastDropMode);

is executed which fires the event.

Regards,
Werner


re: Finding a node

From: Werner Lehmann [wl@b...]
Date: Wed Feb 14, 2001 9:27 am
Subject: Re: [VirtualTreeview] Finding a node

David Hooper wrote:
>
> Can you supply me with your "FindNode" function?
> would save me a fair bit of time

David,

this comes from a descendant of TVirtualStringTree that I wrote. It should show
the picture but you have to adjust it unless you are also writing a descendant
component:

procedure TMyTree.FindData(Sender: TBaseVirtualTree; Node: PVirtualNode; Data:
pointer;
var Abort: boolean);
begin
// Set Abort to true if Node is the node that you wanted to find. This is only
// an example which will not work for you since you probably don't have a data
// property.
Abort := (self.Data[Node]=Data);
end;

function TMyTree.FindNodeData(Data: TObject): PVirtualNode;
begin
// DoInit = true: searches only init'ed nodes otherwise
result := IterateSubTree(nil, FindData, Data, false, true);
end;

Regards,
Werner


re: Header / Visibility / Columns / AutoResize

From: Mike Lischke [public@l...]
Date: Wed Feb 14, 2001 9:37 am
Subject: RE: [VirtualTreeview] Header / Visibility / Columns / AutoResize

Hi Werner,

> it seems that the use of columns *requires* a visible header.

This is correct.

> If the header is invisible I always get only a -1 as Column
> in the OnGetText event.

The solution using a header height of 0 is an acceptable workaround. I have
modified the latest tree source to allow to have visible columns without a
visible header. I don't know what made me decide to make one dependant of
the other.

> This helps. The problem with this is that the AutoResize of
> the leftmost column
> does not work anymore.

Yes, it required a bit more work than just to modify the return value of
Header.UseColumns.

>Any chance to...
> ... get this into the distribution?

Yep :o] will be updated in a couple of days.

> ... get the AutoResize working under these circumstances?

Yep :o] it is working again.

> Unfortunately it is very confusing to the users (including me) that the
AutoSize
> column cannot be resized manually. Although this may be correct in theory
it is
> definitely unexpected. A way to resize the Autosize column (lets assume
index 0 for
> autosizeindex) is to drag the right side of column 1 to the left which
will widen
> column 0. Figure this: you pull column 1 to the left and column 0 goes
right.

To put it more general: As long as the column to be resize is visually to
the left of the auto size column everything is fine. Things start to become
complicated if the column being resized is the auto size column or one to
its right. Would it be a solution to make the column right to the column
currently being resized to a temporary auto size column?

Ciao, Mike


re: Focusing a Node

From: Mike Lischke [public@l...]
Date: Wed Feb 14, 2001 9:39 am
Subject: RE: [VirtualTreeview] Focusing a Node

Luis,

> Mike, tell me if I am in the correct way.
> ...
> procedure TfrmTest.SelectedNode(Node : PVirtualNode);
> begin
> with VTV do
> begin
> if (voMultiSelect in Options)
> then Include(Node.States, vsSelected)
> else ClearSelection;
> FocusedNode := Node;
> Selected[Node] := true;
> end
> end;

The explicit inclusion of vsSelected and the call to ClearSelection are not
necessary. This is handled automatically. So the code would look like:

procedure TfrmTest.SelectedNode(Node : PVirtualNode);
begin
with VTV do
begin
FocusedNode := Node;
Selected[Node] := true;
end
end;

Ciao, Mike


re: Finding a node

From: Mike Lischke [public@l...]
Date: Wed Feb 14, 2001 9:44 am
Subject: RE: [VirtualTreeview] Finding a node

> Can you supply me with your "FindNode" function?
> would save me a fair bit of time

Very trivial. Here is one way:

SearchNode := FeatureTree.IterateSubtree(nil, NodeTypeFinder,
Pointer(bnTopFolderAbilities), False);

where method NodeTypeFinder is:

procedure TMultiFlexForm.NodeTypeFinder(Sender: TBaseVirtualTree; Node:
PVirtualNode; Data: Pointer; var Abort: Boolean);
begin
Abort := PFeatureNodeData(Sender.GetNodeData(Node))^.BuilderNodeType =
TBuilderNodeType(Data);
end;

The result of the IterateSubtree call is the node which caused the abortion
in the callback method.

Ciao, Mike


re: Drag and Drop works?

From: Mike Lischke [public@l...]
Date: Wed Feb 14, 2001 9:49 am
Subject: RE: [VirtualTreeview] Drag and Drop works?

Hi Paul,

> function TIB_CustomVTree.DoDragDrop(const DataObject:
> IDataObject; KeyState:
> Integer; Pt: TPoint;
> var Effect: Integer): HResult;
>
> The one in the form looks like this:
>
> procedure TfmMain.VTDragDrop(Sender: TBaseVirtualTree;
> Source: TObject;
> DataObject: IDataObject; const Formats: array of Word;
> Shift: TShiftState; Pt: TPoint; var Effect: Integer; Mode:
> TDropMode);
>
> Obviously they are a lot different. Since I don't know how to write
> components, could someone direct me how to get the method to execute
> properly in the descendant component?

I wonder what prevents you from looking into the VT source. There you have a
good example how to translate between the DoDragDrop call and the event
handler call. The main work to be done is to determine the current shift
state and to create a list of available OLE formats by enumerating the
FormatEtc list of the given data object. Btw: I wonder why you need to
override the DoDragDrop method at all. Nonetheless, if you need it for some
reason then why not do:

TMyTree.DoDragDrop(....);

begin
inherited;
... your work here
end;

Ciao, Mike


re: Contextmenu on Header?

From: Mike Lischke [public@l...]
Date: Wed Feb 14, 2001 9:57 am
Subject: RE: [VirtualTreeview] Contextmenu on Header?

Hi Werner,

> what is the preferred (any?) way to catch a right button click on
> the header?

Currently there is no way to get clicks on the non-client area via an
component event. Would that really be necessary? For derived trees you can
of course catch the WM_NCRBUTTONDOWN etc. messages to get notified about
non-client area mouse events.

>I want to show a contextmenu.

What about assigning a menu to Header.PopupMenu?

> OnMouseUp does not fire for clicks on the header

Because it is a non-client area click.

>, and OnHeaderClick does not fire for right

It does not for left or middle clicks either, because it is triggered when a
header "button" has been clicked.

> mouse button clicks (would not know which button it was anyway since
> the TreeStates seem to be empty then already).

Treestates have nothing to do with actions in the header. You will have to
look into Header.States to learn what's going on there.

Ciao, Mike


re: Header / Visibility / Columns / AutoResize

From: Werner Lehmann [wl@b...]
Date: Wed Feb 14, 2001 11:25 am
Subject: Re: [VirtualTreeview] Header / Visibility / Columns / AutoResize

Mike Lischke wrote:
>
> The solution using a header height of 0 is an acceptable workaround. I have
> modified the latest tree source to allow to have visible columns without a
> visible header. I don't know what made me decide to make one dependant of
> the other.

Heri already pointed that out and it works fine. Of course there still remains
this taste of a 'workaround', but it seems that you want to take care of that
already. Since the workaround does not have any noticable sideeffects and it is
easy to apply I would not make this a high priority :)

> Yes, it required a bit more work than just to modify the return value of
> Header.UseColumns.

I was suspecting this.

> >Any chance to...
> > ... get this into the distribution?
>
> Yep :o] will be updated in a couple of days.
>
> > ... get the AutoResize working under these circumstances?
>
> Yep :o] it is working again.

Good :)

> To put it more general: As long as the column to be resize is visually to
> the left of the auto size column everything is fine. Things start to become
> complicated if the column being resized is the auto size column or one to
> its right. Would it be a solution to make the column right to the column
> currently being resized to a temporary auto size column?

Exactly. Do you talk about a component action or should this temporary column
be assigned on a form level? Anyhow I think this would improve the behaviour
a lot. This unresizable autosize column was starting to stop me from using the
autosize feature... :)

Hm, what if this temporary column has a minimum width? And the MinWidth would
be violated during the resize? Maybe other columns to the right have more space
and can be made smaller then. Or even simpler (and probably sufficient) resizing
stops in this case.

Mike,

I have not said this before and it is about time: these components are really
great. It is fun working with them and my application(s) just look a lot better
now. And we have access to a mostly well documented source code with a superior
OO design. I know what I am speaking about. In the company that I am working at
currently the Express Quantum Grid of Developer Express is in use. In theory the
grid is really mighty but in practice... the source code is a mess, the
footprint
in the EXE is >500K, the OO design is, to say the least, obfuscating. And these
people charge $200+ for it. We can consider us really lucky to get your 17000
LOC
work for free :))

Regards,
Werner


re: Contextmenu on Header?

From: Werner Lehmann [wl@b...]
Date: Wed Feb 14, 2001 11:28 am
Subject: Re: [VirtualTreeview] Contextmenu on Header?

Mike Lischke wrote:
>
> Currently there is no way to get clicks on the non-client area via an
> component event. Would that really be necessary? For derived trees you can
> of course catch the WM_NCRBUTTONDOWN etc. messages to get notified about
> non-client area mouse events.

Hm, I would probably just subclass WndProc but...

> >I want to show a contextmenu.
>
> What about assigning a menu to Header.PopupMenu?

...I have simply overlooked this property. I will check it out this evening.
Sorry.

Regards,
Werner


re: Header / Visibility / Columns / AutoResize

From: Mike Lischke [public@l...]
Date: Wed Feb 14, 2001 1:06 pm
Subject: RE: [VirtualTreeview] Header / Visibility / Columns / AutoResize

> Heri already pointed that out and it works fine. Of course
> there still remains this taste of a 'workaround', but it seems
> that you want to take care of that already.

I have already changed the code.

> Exactly. Do you talk about a component action or should this
> temporary column be assigned on a form level? Anyhow I think this would
> improve the behaviour a lot. This unresizable autosize column was starting
to stop
> me from using the autosize feature... :)

Not quite. I was thinking about using a temporary index in
TVirtualTreeColumns.AdjustAutoSize which is either the predefined index or
one which is dynamically determined. I have implemented this too and it
looks as would it be working quite well. You will, however, still have some
unexpected behavior. This is due to the fact that auto resize is related to
the tree's client width. For instance assume you have 3 columns, the second
one is the auto size column. Now make the first column larger beyond the
minimum width of col 2. This will move the 2. and 3. column to the right and
create a horizontal scrollbar (because the auto size column cannot be made
smaller).

Now use the scroll bar to scroll to the far right and start resizing the
auto size column. What do you expect should happen? I bet you will be wrong.
What happens is that the 3. col will snap immediately to its smalles width
(without changing the second column in size). This is so because the auto
sizing feature tries to make the auto size column (and be it the temporary
auto size column) as small or large as possible to fit into the client area.

> Hm, what if this temporary column has a minimum width? And
> the MinWidth would be violated during the resize? Maybe other columns to
the
> right have more space and can be made smaller then. Or even simpler (and
probably
> sufficient) resizing stops in this case.

This case was always handled so that there appeared a horizontal scroll bar
when the auto size column could not be made smaller.

> I have not said this before and it is about time: these
> components are really great. It is fun working with them and my
application(s) just
> look a lot better now.

Thank you for this praise, Werner. I'm really pleased to read that 8-).

> And we have access to a mostly well documented source
> code with a superior OO design.

To tell you a secret: there is a kind of message I want to spread with VT.
It is not only the design but the way Delphi source code could be/should be
structured. I was involved in several normalization processes which had a
consistent source code layout as goal (among others: the JEDI initiative).
And VT's layout is what came out after many discussions and argument
exchange. Sure, there is no *best* layout, everybody will find valid reasons
to format his/her code differently but I think there should be at least a
common base format and VT could serve as a positive example (further
examples: www.delphi-jedi.org/Jedi:CODELIBJCL).

For world wide exchange of source it is absolutely necessary to find a
common format in my opinion (and be it only the one of the Delphi VCL, which
is a bit too spartan in my eyes, however).

> We can consider us really lucky to get your 17000 LOC work for free :))

... and we are approaching the 20K lines boundary. Let me just finish the
column alignment and directionality stuff ;-)

Ciao, Mike


re: Drag and Drop works?

From: "Paul Gallagher" [paul@t...]
Date: Wed Feb 14, 2001 1:23 pm
Subject: Re: [VirtualTreeview] Drag and Drop works?

I probably didn't make myself clear. I need to "intercept" the dragdrop
event in the descendant component in order to deal with dragging and
dropping of the data. I can get it to work properly if I place the code in
the form that contains the IB_VTree, but I am trying to make it work by
having the same code in the component.

As far as using "inherited" in the procedure as shown, it is not allowed. I
get the error "incompatible types". This is what I have so far:

protected
function DoDragDrop(const DataObject: IDataObject; KeyState: Integer; Pt:
TPoint;
var Effect: Integer): HResult; override;
....
...
implementation
...
...
function TIB_CustomVTree.DoDragDrop(const DataObject: IDataObject; KeyState:
Integer; Pt: TPoint;
var Effect: Integer): HResult;
begin

end;

Like I said earlier, I really am into an area I don't understand, so assume
I am missing something very obvious.

Thanks,
Paul

> FormatEtc list of the given data object. Btw: I wonder why you need to
> override the DoDragDrop method at all. Nonetheless, if you need it for
some
> reason then why not do:
>
> TMyTree.DoDragDrop(....);
>
> begin
> inherited;
> ... your work here
> end;
>
> Ciao, Mike
>
>
> To unsubscribe from this group, send an email to:
> VirtualTreeview-unsubscribe@egroups.com
>
>
>
>


re: Drag and Drop works?

From: Bender Heri [HBender@E...]
Date: Wed Feb 14, 2001 1:33 pm
Subject: RE: [VirtualTreeview] Drag and Drop works?

> -----Original Message-----
> From: Paul Gallagher [mailto:[paul@t...]]

> As far as using "inherited" in the procedure as shown, it is
> not allowed. I
> get the error "incompatible types". This is what I have so far:
>
> protected
> function DoDragDrop(const DataObject: IDataObject;
> KeyState: Integer; Pt:
> TPoint;
> var Effect: Integer): HResult; override;
> ....
> ...
> implementation
> ...
> ...
> function TIB_CustomVTree.DoDragDrop(const DataObject:
> IDataObject; KeyState:
> Integer; Pt: TPoint;
> var Effect: Integer): HResult;
> begin
>
> end;
>

If it is a function you have to write the full call to inherited:

Result := inherited DoDragDrop(DataObject,KeyState,Pt,Effect);

Heri


re: Drag and Drop works?

From: Mike Lischke [public@l...]
Date: Wed Feb 14, 2001 1:34 pm
Subject: RE: [VirtualTreeview] Drag and Drop works?

> I probably didn't make myself clear. I need to "intercept"
> the dragdrop event in the descendant component in order to deal with
dragging and
> dropping of the data. I can get it to work properly if I
> place the code in the form that contains the IB_VTree, but I am trying to
make
> it work by having the same code in the component.

Well, then the best way is probably to copy the code from VirtualTrees.pas
DoDragDrop and start your own code where originally the event call
(FOnDragDrop) is placed (you can still trigger the event, of course). Leave
out any "inherited;" statement since you already have the code executed
which the base tree would do otherwise.

Ciao, Mike


re: Drag and Drop works?

From: Mike Lischke [public@l...]
Date: Wed Feb 14, 2001 1:38 pm
Subject: RE: [VirtualTreeview] Drag and Drop works?

> If it is a function you have to write the full call to inherited:
>
> Result := inherited DoDragDrop(DataObject,KeyState,Pt,Effect);

Usually not. If the parameter lists are identical (and the overriden method
is not abstract) then you don't need to line up the entire parameter list
again in the inherited statement.

Ciao, Mike


re: Drag and Drop works?

From: Bender Heri [HBender@E...]
Date: Wed Feb 14, 2001 2:11 pm
Subject: RE: [VirtualTreeview] Drag and Drop works?

> -----Original Message-----
> From: Mike Lischke [mailto:[public@l...]]
>
>
> > If it is a function you have to write the full call to inherited:
> >
> > Result := inherited DoDragDrop(DataObject,KeyState,Pt,Effect);
>
> Usually not. If the parameter lists are identical (and the
> overriden method
> is not abstract) then you don't need to line up the entire
> parameter list
> again in the inherited statement.
>

You are right if the overridden function is virtual. But if it was dynamic
then indeed the compiler claims "incompatible types"

Heri


re: Drag and Drop works?

From: "Paul Gallagher" [paul@t...]
Date: Wed Feb 14, 2001 2:31 pm
Subject: Re: [VirtualTreeview] Drag and Drop works?

Thanks. That is what I thought I might have to do. I guess thats why they
invented "cut and paste". <g>

Paul

----- Original Message -----
From: "Mike Lischke" [public@l...]
To: <VirtualTreeview@yahoogroups.com>
Sent: Wednesday, February 14, 2001 7:34 AM
Subject: RE: [VirtualTreeview] Drag and Drop works?

> > I probably didn't make myself clear. I need to "intercept"
> > the dragdrop event in the descendant component in order to deal with
> dragging and
> > dropping of the data. I can get it to work properly if I
> > place the code in the form that contains the IB_VTree, but I am trying
to
> make
> > it work by having the same code in the component.
>
> Well, then the best way is probably to copy the code from VirtualTrees.pas
> DoDragDrop and start your own code where originally the event call
> (FOnDragDrop) is placed (you can still trigger the event, of course).
Leave
> out any "inherited;" statement since you already have the code executed
> which the base tree would do otherwise.
>
> Ciao, Mike
>
>
> To unsubscribe from this group, send an email to:
> VirtualTreeview-unsubscribe@egroups.com
>
>
>
>


re: Contextmenu on Header?

From: Werner Lehmann [wl@b...]
Date: Wed Feb 14, 2001 10:15 pm
Subject: Re: [VirtualTreeview] Contextmenu on Header?

Mike Lischke wrote:
>
> What about assigning a menu to Header.PopupMenu?

Does not work. I found out that this is the cause:

function TVTHeader.HandleMessage(var Message: TMessage): Boolean;

...

WM_NCRBUTTONUP:
begin
with TWMNCRButtonUp(Message) do
P := Point(XCursor, YCursor);
// trigger header popup if there's one
if Assigned(FPopupMenu) and InHeader(FOwner.ScreenToClient(P)) then //
<------
begin
FOwner.StopTimer(ScrollTimer);
FOwner.FStates := FOwner.FStates - [tsScrollPending, tsScrolling];
FPopupMenu.Popup(P.x, P.y);
Result := True;
end;
end;

...

As the comment in InHeader correctly states it expects
client coordinates. But it gets only screen coordinates...
So I have added the ScreenToClient. Ok?

You do the same almost everywhere else with the exception of
this line:

procedure TBaseVirtualTree.CMHintShow(var Message: TCMHintShow);

...

if FHeader.UseColumns and (hoShowHint in FHeader.FOptions) and
FHeader.InHeader(CursorPos) then

...

Don't know if CursorPos is in client coordinates already...

Werner


Header.Columns

From: Werner Lehmann [wl@b...]
Date: Wed Feb 14, 2001 11:57 pm
Subject: Header.Columns

Hi,

two more 'issues':

if I resize a column to width 0 I cannot get it back again (with
the mouse). The windows explorer allows for getting that column
back. It would suffice for me if the coVisible flag would be removed
from the options then. What do you think? If you don't like both
possibilities please consider to set the default MinWidth to anything
>0, perhaps 5 or 10.

The other problem is more severe: I am getting OnGetText request
for invisible columns (that is without coVisible set). In this case
the text must be computed first which takes some time. Therefore I
want to give the user the possibility to decide whether he wants to
wait or rather hide that column.

Of course it is possible to check the visibility in the OnGetText
event (which is what I am doing now) but I think it sounds sensible
to suppress GetText for invisible columns.

Regards,
Werner

 | Replies | Author | Date
543 | Re: Header.Columns | Mike Lischke | Thu 2/15/2001


re: Header / Visibility / Columns / AutoResize

From: Werner Lehmann [wl@b...]
Date: Thu Feb 15, 2001 12:09 am
Subject: Re: [VirtualTreeview] Header / Visibility / Columns / AutoResize

Mike Lischke wrote:
>
> Not quite. I was thinking about using a temporary index in
> TVirtualTreeColumns.AdjustAutoSize which is either the predefined index or
> one which is dynamically determined. I have implemented this too and it
> looks as would it be working quite well. You will, however, still have some
> unexpected behavior. This is due to the fact that auto resize is related to
> the tree's client width. For instance assume you have 3 columns, the second
> one is the auto size column. Now make the first column larger beyond the
> minimum width of col 2. This will move the 2. and 3. column to the right and
> create a horizontal scrollbar (because the auto size column cannot be made
> smaller).

Why not just stop the resizing here? No user will complain if he has to adjust
the sizes of the righter moster column(s) first to get some room for a larger
Col #0.

> Now use the scroll bar to scroll to the far right and start resizing the
> auto size column. What do you expect should happen? I bet you will be wrong.
> What happens is that the 3. col will snap immediately to its smalles width
> (without changing the second column in size). This is so because the auto
> sizing feature tries to make the auto size column (and be it the temporary
> auto size column) as small or large as possible to fit into the client area.

Hm, sounds quite logical. If you could prevent the resizing as mentioned above
this problem would not arise in the first place. On the other hand, if this
seems to be a bad idea to you or is too hard to implement I could live with
this behaviour. Only trouble is that Col #2 (the third) could not be made
visible by the user again (see my posting titled 'Header.Columns' for details
about this).

> To tell you a secret: there is a kind of message I want to spread with VT.
> It is not only the design but the way Delphi source code could be/should be
> structured. I was involved in several normalization processes which had a
> consistent source code layout as goal (among others: the JEDI initiative).
> And VT's layout is what came out after many discussions and argument
> exchange. Sure, there is no *best* layout, everybody will find valid reasons
> to format his/her code differently but I think there should be at least a
> common base format and VT could serve as a positive example (further
> examples: www.delphi-jedi.org/Jedi:CODELIBJCL).
>
> For world wide exchange of source it is absolutely necessary to find a
> common format in my opinion (and be it only the one of the Delphi VCL, which
> is a bit too spartan in my eyes, however).

Absolutely. You even convinced me to use more spaces in my code, especially
in comparisions (x <> nil), assignments (x := y) and other terms (x + y + z).
What I still don't like is the 'begin' on a new line after an 'if'. At least
for my own code... And even the smallest function has a top and bottom
separator and a blank line between its header and body, this also too much
for my taste. Although I must admit that your code style is easily readable.
Maybe I just need some more time to get used to it :)

I believe we both have seen more than enough bad formatted code (capitalized
key words, hanging if's and case's with most lines beginning in columns 30
or so, comments in portuguese, indentation only one char etc :)

> ... and we are approaching the 20K lines boundary. Let me just finish the
> column alignment and directionality stuff ;-)

Wow, this takes another 3000 LOC? You should really drop some of these blank
lines (LOL :).

Regards,
Werner


re: Contextmenu on Header?

From: Mike Lischke [public@l...]
Date: Thu Feb 15, 2001 8:52 am
Subject: RE: [VirtualTreeview] Contextmenu on Header?

Hi Werner,

> As the comment in InHeader correctly states it expects
> client coordinates. But it gets only screen coordinates...
> So I have added the ScreenToClient. Ok?

Yes, totally correct. I have already got this as bug but I'm so busy with
other things that I have not yet come to this point in my todo list.

> if FHeader.UseColumns and (hoShowHint in FHeader.FOptions)
> and FHeader.InHeader(CursorPos) then
>
> Don't know if CursorPos is in client coordinates already...

Yes, it is. CM_HINTSHOW is sent by the application object as reaction to a
mouse message.

Ciao, Mike


re: Header.Columns

From: Mike Lischke [public@l...]
Date: Thu Feb 15, 2001 9:39 am
Subject: RE: [VirtualTreeview] Header.Columns

> if I resize a column to width 0 I cannot get it back again (with
> the mouse). The windows explorer allows for getting that column
> back. It would suffice for me if the coVisible flag would be removed
> from the options then. What do you think? If you don't like both
> possibilities please consider to set the default MinWidth to anything
> >0, perhaps 5 or 10.

What I did were two things. Firstly, I set the default min width to 10 and
secondly, I reworked the hit test routine so that it allows now to enlarge a
zero-sized column.

> The other problem is more severe: I am getting OnGetText request
> for invisible columns (that is without coVisible set). In this case
> the text must be computed first which takes some time. Therefore I
> want to give the user the possibility to decide whether he wants to
> wait or rather hide that column.

This behavior resulted from an optimization in the string tree (for the auto
span feature). I have changed it so that the text retrival is omitted for
hidden columns.

Ciao, Mike


re: Header / Visibility / Columns / AutoResize

From: Mike Lischke [public@l...]
Date: Thu Feb 15, 2001 9:58 am
Subject: RE: [VirtualTreeview] Header / Visibility / Columns / AutoResize

> Why not just stop the resizing here? No user will complain if
> he has to adjust the sizes of the righter moster column(s) first to get
some
> room for a larger Col #0.

Yes, this would be an option too, but limitation which is not necessary.
Hence I decided to do it the way I described.

> Absolutely. You even convinced me to use more spaces in my
> code, especially in comparisions (x <> nil), assignments (x := y) and
other
> terms (x + y + z).

Yes, spaces and empty lines are very important. Firstly, they make the
number of lines in a unit much larger and so more impressive ;-) But
seriously: spaces determine directly the way how code can be read. General
rules like punctuation need to be considered (e.g. spaces after comma, but
not before etc.) as well as code grouping by empty lines. To avoid going to
far off topic just one recommendation: "Code complete" by Steve McConnell
ISBN 1-55615-484-4. The styles Steve propagates are a bit different, but he
has often very good reasons for doing something a certain way.

> What I still don't like is the 'begin' on a new line after an
> 'if'. At least for my own code... And even the smallest function has a top
and bottom
> separator and a blank line between its header and body, this
> also too much for my taste. Although I must admit that your code style is
> easily readable. Maybe I just need some more time to get used to it :)

To my surprise people easily adopt the separator line between methods which
I had expected to be a point which would be massively discussed. On the
other there are of course many things which are not much liked by people.
But as I said "my" style is in no way the best at all. It is just the best
compromise I could came up with and I had myself to change the coding style
quite a lot, but now I like it very much.

> I believe we both have seen more than enough bad formatted code
(capitalized
> key words, hanging if's and case's with most lines beginning
> in columns 30 or so, comments in portuguese, indentation only one char etc
:)

Indeed :o] Even such great people like Earl F. Glynn write their source
still as in early TP 4 days.

> Wow, this takes another 3000 LOC? You should really drop some
> of these blank lines (LOL :).

No, there are now ~18.5K lines. Not much until 20K...

Ciao, Mike


Drag 'n Drop Node to VCL Control

From: "Fred Schetterer" [fschetterer@h...]
Date: Thu Feb 15, 2001 5:53 pm
Subject: Drag 'n Drop Node to VCL Control

I am pretty new to VirtualTrees and just updated a project I am working on
to use the VirtualStringTree, all went very smooth except that I am not able
to drag a node to another VCL control.

All setting appear normal DragMode = dmAutomatic, DragImage =
diMainColumnOnly,
Options =
[voAutoDropExpand,voRightClickSelect,voShowButtons,voShowRoot,voShowTreeLine
s,voToggleOnDblClick].
The drag VCL Target controls never receive a OnDragOver event.

Is this a known issue, is there a workaround?

thanks

Fred

 | Replies | Author | Date
546 | Re: Drag 'n Drop Node to VCL Control | Mike Lischke | Thu 2/15/2001
547 | Re: Drag 'n Drop Node to VCL Control | Mike Lischke | Thu 2/15/2001
549 | Re: Drag 'n Drop Node to VCL Control | Werner Lehmann | Thu 2/15/2001


re: Drag 'n Drop Node to VCL Control

From: "Mike Lischke" [public@l...]
Date: Thu Feb 15, 2001 8:07 pm
Subject: RE: [VirtualTreeview] Drag 'n Drop Node to VCL Control

Hi Fred,

> I am pretty new to VirtualTrees and just updated a project I am working on
> to use the VirtualStringTree, all went very smooth except that I am not able
> to drag a node to another VCL control.

This is a known issue. VT version 1.31 and lower cannot use VCL drag'n drop.
You have to wait for
version 2.x. If you feel like testing then subscribe to the VT mailing list and
download the
prerelease of version 2.1 from the file area there. This version supports VCL
and OLE drag'n drop.

Ciao, Mike

 | Replies | Author | Date
547 | Re: Drag 'n Drop Node to VCL Control | Mike Lischke | Thu 2/15/2001


re: Drag 'n Drop Node to VCL Control

From: "Mike Lischke" [public@l...]
Date: Thu Feb 15, 2001 8:10 pm
Subject: RE: [VirtualTreeview] Drag 'n Drop Node to VCL Control

> This is a known issue. VT version 1.31 and lower cannot use VCL drag'n drop.
You have to wait for
> version 2.x. If you feel like testing then subscribe to the VT mailing list
and download the
> prerelease of version 2.1 from the file area there. This version supports VCL
and OLE drag'n drop.

Hehe, thought this were privately :o] Too many eMails to answer...

Fred, you are already subscribed so simply download the prerelease...

Ciao, Mike


re: Header / Visibility / Columns / AutoResize

From: Werner Lehmann [wl@b...]
Date: Thu Feb 15, 2001 7:22 pm
Subject: Re: [VirtualTreeview] Header / Visibility / Columns / AutoResize

Mike Lischke wrote:
>
> Yes, this would be an option too, but limitation which is not necessary.
> Hence I decided to do it the way I described.

Perfectly ok for me.

> not before etc.) as well as code grouping by empty lines. To avoid going to
> far off topic just one recommendation: "Code complete" by Steve McConnell
> ISBN 1-55615-484-4. The styles Steve propagates are a bit different, but he
> has often very good reasons for doing something a certain way.

Just by chance I happened to browse into that book in December and found it
very interesting :)

Werner


re: Drag 'n Drop Node to VCL Control

From: Werner Lehmann [wl@b...]
Date: Thu Feb 15, 2001 7:24 pm
Subject: Re: [VirtualTreeview] Drag 'n Drop Node to VCL Control

Fred Schetterer wrote:
>
> I am pretty new to VirtualTrees and just updated a project I am working on
> to use the VirtualStringTree, all went very smooth except that I am not able
> to drag a node to another VCL control.

There are two flavors of Drag and Drop, and up to v1.31 of VTree it implements
OLE DND which is not compatible with VCL DND. v2.0 and up support VCL DND
although I have never checked that out. You can find a beta of these in the
files area of this mailing list on yahoogroups.

It has a property which lets you decide which taste of DND you prefer.

Werner


Code Change

From: "Paul Gallagher" [paul@t...]
Date: Fri Feb 16, 2001 12:27 am
Subject: Code Change

Mike,
I made this minor change to version 2.1. I was getting an access violation. I'm
not sure if the fix I made to your code was because of my own errors in my code
or not. But I thought I would pass it on. It is in the DoFocusNode event, but I
was not making a call to it. It must be getting called as part of the dragdrop
procedures. At any rate, making this change to your source can't do any harm.
After 18,464 lines, what's another 3 going to hurt? <g>

Paul Gallagher

if Assigned(Run2) then <<<<<<< Add at Line 8367
begin <<<<<<<<<<<<<<Add
while Run1.Parent <> Run2.Parent do
begin
if vsExpanded in Run1.States then
ToggleNode(Run1);
Run1 := Run1.Parent;
Run2 := Run2.Parent;
end;
end; <<<<<<Add

Might be better to check assigned(Node) at the top of the procedure, and exit
out of the entire procedure if it is nil.

[Non-text portions of this message have been removed]

 | Replies | Author | Date
556 | Re: Code Change | Mike Lischke | Fri 2/16/2001


re: Drag 'n Drop Node to VCL Control

From: "Fred Schetterer" [fschetterer@h...]
Date: Fri Feb 16, 2001 12:45 am
Subject: Re: Drag 'n Drop Node to VCL Control

Thanks, this certainly fixes the simple DND problem but multi-select
with DND still does not work. When the mouse comes down on an already
selected the Node it should not toggle it to unselected.

The second issue is that with two or more Nodes selected one can fool
the control by holding the shift key down (this won't unselect the
Node) but this seems to totally disable dragging.

I am assuming this is the correct place to post these pre-release
issues.

thanks

Fred

--- In [VirtualTreeview@y...], "Mike Lischke" [public@l...] wrote:
>> If you feel like testing then subscribe to the VT mailing list and
>> download the
> > prerelease of version 2.1 from the file area there. This version
supports VCL and OLE drag'n drop.

 | Replies | Author | Date
557 | Re: Drag 'n Drop Node to VCL Control | Mike Lischke | Fri 2/16/2001


OnEdited Event

From: "Paul Gallagher" [paul@t...]
Date: Fri Feb 16, 2001 5:22 am
Subject: OnEdited Event

Something does not seem right with the OnEdit event in v2.1

When voEditable is True, the text can be edited, but when the Enter key is
pressed, or editing is ended by moving off the node, then the old data(caption)
is pulled back out of the node. How do I intercept the text that was just
entered?

Paul

[Non-text portions of this message have been removed]

 | Replies | Author | Date
553 | Re: OnEdited Event | Paul Gallagher | Fri 2/16/2001
558 | New to group | Dave Scofield | Fri 2/16/2001
559 | Re: New to group | Geoffrey Pan | Fri 2/16/2001
568 | Re: New to group | Mike Lischke | Sat 2/17/2001
601 | Re: New to group | Dave Scofield | Tue 2/20/2001
554 | Re: OnEdited Event | Mike Lischke | Fri 2/16/2001


re: OnEdited Event

From: "Paul Gallagher" [paul@t...]
Date: Fri Feb 16, 2001 5:46 am
Subject: Re: [VirtualTreeview] OnEdited Event

Never mind. The key is the OnNewText event.

Paul

----- Original Message -----
From: "Paul Gallagher" [paul@t...]
To: <virtualTreeview@yahoogroups.com>
Sent: Thursday, February 15, 2001 11:22 PM
Subject: [VirtualTreeview] OnEdited Event

> Something does not seem right with the OnEdit event in v2.1
>
> When voEditable is True, the text can be edited, but when the Enter key is
pressed, or editing is ended by moving off the node, then the old
data(caption) is pulled back out of the node. How do I intercept the text
that was just entered?
>
> Paul
>
>
> [Non-text portions of this message have been removed]
>
>
>
> To unsubscribe from this group, send an email to:
> VirtualTreeview-unsubscribe@egroups.com
>
>
>
>

 | Replies | Author | Date
558 | New to group | Dave Scofield | Fri 2/16/2001
559 | Re: New to group | Geoffrey Pan | Fri 2/16/2001
568 | Re: New to group | Mike Lischke | Sat 2/17/2001
601 | Re: New to group | Dave Scofield | Tue 2/20/2001


re: OnEdited Event

From: Mike Lischke [public@l...]
Date: Fri Feb 16, 2001 8:25 am
Subject: RE: [VirtualTreeview] OnEdited Event

Paul,

> When voEditable is True, the text can be edited, but when the
> Enter key is pressed, or editing is ended by moving off the
> node, then the old data(caption) is pulled back out of the
> node. How do I intercept the text that was just entered?

Use OnNewText. This is a special event for the string tree which knows
captions are edited (usually). OnEdited is a general event for all VTs.
Because of the virtual nature the tree doesn't know about the content being
edited so it cannot tell the application what actually has changed. The edit
link is responsible to provide that kind of information.

Ciao, Mike


Delphi 4 package

From: Mike Lischke [public@l...]
Date: Fri Feb 16, 2001 8:45 am
Subject: Delphi 4 package

Hi all,

would somebody please be so kind and build a working Delphi 4 package using
the VT Package.zip file on YG as template?

Ciao, Mike


re: Code Change

From: Mike Lischke [public@l...]
Date: Fri Feb 16, 2001 8:55 am
Subject: RE: [VirtualTreeview] Code Change

Hi Paul,

> I made this minor change to version 2.1. I was getting an
> access violation. I'm not sure if the fix I made to your code
> was because of my own errors in my code or not. But I thought
> I would pass it on. It is in the DoFocusNode event, but I was
> not making a call to it. It must be getting called as part of
> the dragdrop procedures. At any rate, making this change to
> your source can't do any harm. After 18,464 lines, what's
> another 3 going to hurt? <g>

Well, you found a hidden bug which appears only in the special circumstance
that auto expanding is enabled and the new focused node is unassigned. This
happens not very often, so it has not been detected until now.

Thank you

Ciao, Mike


re: Re: Drag 'n Drop Node to VCL Control

From: Mike Lischke [public@l...]
Date: Fri Feb 16, 2001 9:00 am
Subject: RE: [VirtualTreeview] Re: Drag 'n Drop Node to VCL Control

Fred,

> Thanks, this certainly fixes the simple DND problem but multi-select
> with DND still does not work. When the mouse comes down on an already
> selected the Node it should not toggle it to unselected.

It does not. When you press a mouse button on an already selected node then
a pending clear action is recorded which is only executed when no dragging
started. But VCL is not fully tested it could well be that there is still
some hidden flaws.

> The second issue is that with two or more Nodes selected one can fool
> the control by holding the shift key down (this won't unselect the
> Node) but this seems to totally disable dragging.

:o] How do you suppose to mark nodes with the mouse and modifier keys? Of
course if you hold down shift or control then dragging is not started but
the selection is modified. You have first to start dragging and modified
then the drop effect using the modifier keys.

> I am assuming this is the correct place to post these pre-release
> issues.

Indeed. This mailing list has been created to help with problems as you
encounter.

Ciao, Mike


New to group

From: "Dave Scofield" [dave@b...]
Date: Fri Feb 16, 2001 5:12 pm
Subject: New to group

Greetings all,

Mike - great work on the treeview control. We'll be using it for sure.

Since I'm just getting started on this mailing list, I thought I should ask
the requisite newbie question ... What's the current version of the treeview
control? The source I've been working with is 1.29, and I just downloaded
1.31 from Mike's site - but I saw someone mention a 2.1?

Also, I have a few small issues, which you'll have to forgive me if they've
already been discussed... (all are in reference to TVirtualDrawTree

1. When ScrollbarOptions has AlwaysVisible=True,ScrollBars=sbBoth,and
ScrollBarStyle=sbmFlat, there is a rectangle that the control does not
paint, and thus has garbage in it. It's located just above the vertical
scrollbar, and just to the right of the header. And ideas?

2. The OnGetNodeWidth event passes Sender as TBaseVirtualTree - which does
not have Canvas as a public property. What should I measure my node against
without the control's canvas?

3. If you change the color of the pen in OnDrawNode, the tree control does
not set it back to what it needs, and the tree lines are drawn incorrectly.
It seems that the line Canvas.Pen.Color := clBtnFace; is required to get
things to work.

Thanks again,
Dave

 | Replies | Author | Date
559 | Re: New to group | Geoffrey Pan | Fri 2/16/2001
568 | Re: New to group | Mike Lischke | Sat 2/17/2001
601 | Re: New to group | Dave Scofield | Tue 2/20/2001


re: New to group

From: "Geoffrey Pan" [gpan@c...]
Date: Fri Feb 16, 2001 5:18 pm
Subject: RE: [VirtualTreeview] New to group

2.1 prerelease snapshot is in the file area of this group.

-----Original Message-----
From: Dave Scofield [mailto:[dave@b...]]
Sent: Friday, February 16, 2001 11:13 AM
To: VirtualTreeview@yahoogroups.com
Subject: [VirtualTreeview] New to group

Greetings all,

Mike - great work on the treeview control. We'll be using it for sure.

Since I'm just getting started on this mailing list, I thought I should ask
the requisite newbie question ... What's the current version of the treeview
control? The source I've been working with is 1.29, and I just downloaded
1.31 from Mike's site - but I saw someone mention a 2.1?

Also, I have a few small issues, which you'll have to forgive me if they've
already been discussed... (all are in reference to TVirtualDrawTree

1. When ScrollbarOptions has AlwaysVisible=True,ScrollBars=sbBoth,and
ScrollBarStyle=sbmFlat, there is a rectangle that the control does not
paint, and thus has garbage in it. It's located just above the vertical
scrollbar, and just to the right of the header. And ideas?

2. The OnGetNodeWidth event passes Sender as TBaseVirtualTree - which does
not have Canvas as a public property. What should I measure my node against
without the control's canvas?

3. If you change the color of the pen in OnDrawNode, the tree control does
not set it back to what it needs, and the tree lines are drawn incorrectly.
It seems that the line Canvas.Pen.Color := clBtnFace; is required to get
things to work.

Thanks again,
Dave

To unsubscribe from this group, send an email to:
VirtualTreeview-unsubscribe@egroups.com


Sort, and more

From: [adembaba@e...]
Date: Sat Feb 17, 2001 4:34 am
Subject: Sort, and more

Hi,

Isn't Sort method supposed to update the Header.SortColumn
and Header.SortDirection?

I am trying to alter the SortDirection whenever the same
column is clicked again, but I do not seem to be able
to get the necessary info from VT (v2.1, BTW). Below is
the snippet I use.

Further, shouldn't the Header property be Public rather
than Protected in the TBaseVirtualTree so that I would
simply use Sender.Header.SortColumn instead of
VTree1.Header.SortColumn?

Best,
Adem

Procedure TMainForm.VTree1HeaderClick(Sender: TBaseVirtualTree;
Column: Integer);
Var
Node1: PVirtualNode;
Begin
Node1 := VTree1.RootNode;
If VTree1.Header.SortColumn = Column Then Begin
Case VTree1.Header.SortDirection Of
sdAscending: VTree1.Sort(Node1, Column, sdDescending);
sdDescending: VTree1.Sort(Node1, Column, sdAscending);
End;
End Else VTree1.Sort(Node1, Column, sdAscending);
End;

 | Replies | Author | Date
562 | Re: Sort, and more | Mike Lischke | Sat 2/17/2001
589 | Re: Sort, and more | [adembaba@e...] | Sun 2/18/2001
595 | Re: Sort, and more | Mike Lischke | Mon 2/19/2001
598 | Re: Sort, and more | [adembaba@e...] | Tue 2/20/2001
607 | Re: Sort, and more | Mike Lischke | Wed 2/21/2001


Header and column hiding and showing...

From: "Robert Palmqvist" [robert.palmqvist@h...]
Date: Sat Feb 17, 2001 8:12 am
Subject: Header and column hiding and showing...

I am replacing a standard listview with a virtual treeview (I am using version
1.31). Most is now working the way I want but I have run in to one problem. I
want to be able to hide and show several columns at a time. The code below
works when the tree is empty (hiding and showing the headers) but it hangs when
the tree is filled with data.

Please tell me if there is a better way to hide and show several columns at a
time and also if there is an equivalent to the standard listviews methods
"BeginUpdate" and EndUpdate". Thanks in advance for any answers / Robert

Below is the code I use to select the columns I want to be visible (e.g.
SelectColumns(VirtualStringTree1, [0, 1, 15, 16, 17, 18]); would show columns
0, 1, 15, 16, 17, 18 and hide the rest of the columns in the tree).

type
TByteSet = set of byte;

procedure TForm1.SelectColumns(Sender: TVirtualStringTree; Selection: TByteSet);
var
Options: TVTColumnOptions;
i: integer;
begin
for i:= 0 to Sender.Header.Columns.Count-1 do
begin
Options:= Sender.Header.Columns[i].Options;
if i in Selection then
Include(Options, coVisible)
else
Exclude(Options, coVisible);
Sender.Header.Columns[i].Options:= Options;
end;
end;

[Non-text portions of this message have been removed]

 | Replies | Author | Date
563 | Re: Header and column hiding and showing... | Mike Lischke | Sat 2/17/2001
565 | Re: Header and column hiding and showing... | Robert Palmqvist | Sat 2/17/2001
570 | Re: VT Package | Mike Lischke | Sat 2/17/2001
566 | Re: Header and column hiding and showing... | Werner Lehmann | Sat 2/17/2001
567 | Re: Header and column hiding and showing... | Robert Palmqvist | Sat 2/17/2001


re: Sort, and more

From: "Mike Lischke" [public@l...]
Date: Sat Feb 17, 2001 9:01 am
Subject: RE: [VirtualTreeview] Sort, and more

> Isn't Sort method supposed to update the Header.SortColumn
> and Header.SortDirection?

No. You can sort for other columns than those which are set in SortColumn etc.
SortColumn and
SortDirection are for auto sort only. If you don't use auto sort then they are
just storage. The
solution for your problem is therefore:

procedure TfrmDrawTree.VDT1HeaderClick(Sender: TBaseVirtualTree;
Column: Integer);
begin
with (Sender as TVirtualDrawTree), Header do
begin
if Column <> MainColumn then
SortColumn := NoColumn
else
begin
if SortColumn = NoColumn then
begin
SortColumn := Column;
SortDirection := sdAscending;
end
else
if SortDirection = sdAscending then
SortDirection := sdDescending
else
SortDirection := sdAscending;
SortTree(SortColumn, SortDirection, False);
end;
end;
end;

as shown in the draw tree demo.

Ciao, Mike

 | Replies | Author | Date
589 | Re: Sort, and more | [adembaba@e...] | Sun 2/18/2001


re: Header and column hiding and showing...

From: "Mike Lischke" [public@l...]
Date: Sat Feb 17, 2001 9:03 am
Subject: RE: [VirtualTreeview] Header and column hiding and showing...

Hi Robert,

> I am replacing a standard listview with a virtual treeview (I am using
version 1.31).
> Most is now working the way I want but I have run in to one problem. I want
to be able to
> hide and show several columns at a time. The code below works when the tree
is empty
> (hiding and showing the headers) but it hangs when the tree is filled with
data.

This is a well known and already fixed bug. If you like you can download
prerelease 2.1 from the YG
(YahooGroups) files area. This one is already stable and lacks currently only
full alignment and
hidden nodes implementation.

Ciao, Mike


"dummy" Image for Checkbox ?

From: [info@t...]
Date: Sat Feb 17, 2001 9:29 am
Subject: "dummy" Image for Checkbox ?

Hi,

I was just wondering wheter Mike could add a dummy image or a
placeholder for the checkbox or button in front of a node.

The problem is, that on a tree with nodes, which have checkboxes, and
others without having a checkbox or a button, the text of the nodes
is not aligned properly.

I would suggest, that an empty image and another type like "ctdummy"
would do it.

Just a suggestion -)

Thomas

 | Replies | Author | Date
569 | Re: "dummy" Image for Checkbox ? | Mike Lischke | Sat 2/17/2001


re: Header and column hiding and showing...

From: "Robert Palmqvist" [robert.palmqvist@h...]
Date: Sat Feb 17, 2001 11:33 am
Subject: Re: [VirtualTreeview] Header and column hiding and showing...

Hi, I installed version 2.1 and rebuilt my package. It then removed my
Virtual Treeview components from the component palette!!! I browsed the
version 2.1 unit (VirtualTrees.pas) source and it looks like it is missing a
"Register" procedure and any "RegisterComponents" call... Am I missing
something?

/ Robert

----- Original Message -----
From: "Mike Lischke" [public@l...]
To: <VirtualTreeview@yahoogroups.com>
Sent: Saturday, February 17, 2001 10:03 AM
Subject: RE: [VirtualTreeview] Header and column hiding and showing...

> Hi Robert,
>
> > I am replacing a standard listview with a virtual treeview (I am using
version 1.31).
> > Most is now working the way I want but I have run in to one problem. I
want to be able to
> > hide and show several columns at a time. The code below works when the
tree is empty
> > (hiding and showing the headers) but it hangs when the tree is filled
with data.
>
> This is a well known and already fixed bug. If you like you can download
prerelease 2.1 from the YG
> (YahooGroups) files area. This one is already stable and lacks currently
only full alignment and
> hidden nodes implementation.
>
> Ciao, Mike
>
>
>
> To unsubscribe from this group, send an email to:
> VirtualTreeview-unsubscribe@egroups.com
>
>
>
>

 | Replies | Author | Date
570 | Re: VT Package | Mike Lischke | Sat 2/17/2001


re: Header and column hiding and showing...

From: Werner Lehmann [wl@b...]
Date: Sat Feb 17, 2001 12:06 pm
Subject: Re: [VirtualTreeview] Header and column hiding and showing...

Robert Palmqvist wrote:
>
> Hi, I installed version 2.1 and rebuilt my package. It then removed my
> Virtual Treeview components from the component palette!!! I browsed the
> version 2.1 unit (VirtualTrees.pas) source and it looks like it is missing a
> "Register" procedure and any "RegisterComponents" call... Am I missing
> something?

Yes. With v2.1 you need to include VirtualTreesReg.pas into your design
time package. It contains the register procedure and one property editor
which opens the columns list if you double click on the VTree.

You must require vclstd50.dcp in your package as well.

WL


re: Header and column hiding and showing...

From: "Robert Palmqvist" [robert.palmqvist@h...]
Date: Sat Feb 17, 2001 2:29 pm
Subject: Re: [VirtualTreeview] Header and column hiding and showing...

Fair enough but the only file that I found in VirtualTrees.zip was
VirtualTrees.pas, now where do I find VirtualTreesReg.pas?

/ Robert

----- Original Message -----
From: "Werner Lehmann" [wl@b...]
To: <VirtualTreeview@yahoogroups.com>
Sent: Saturday, February 17, 2001 1:06 PM
Subject: Re: [VirtualTreeview] Header and column hiding and showing...

> Robert Palmqvist wrote:
> >
> > Hi, I installed version 2.1 and rebuilt my package. It then removed my
> > Virtual Treeview components from the component palette!!! I browsed the
> > version 2.1 unit (VirtualTrees.pas) source and it looks like it is
missing a
> > "Register" procedure and any "RegisterComponents" call... Am I missing
> > something?
>
> Yes. With v2.1 you need to include VirtualTreesReg.pas into your design
> time package. It contains the register procedure and one property editor
> which opens the columns list if you double click on the VTree.
>
> You must require vclstd50.dcp in your package as well.
>
> WL
>
>
> To unsubscribe from this group, send an email to:
> VirtualTreeview-unsubscribe@egroups.com
>
>
>
>


re: New to group

From: "Mike Lischke" [public@l...]
Date: Sat Feb 17, 2001 3:03 pm
Subject: RE: [VirtualTreeview] New to group

Hi Dave,

> What's the current version of the treeview
> control? The source I've been working with is 1.29, and I just downloaded
> 1.31 from Mike's site - but I saw someone mention a 2.1?

Actually, there are two maintained versions. The official one is 1.31 on my
homepage. This one is
also uploaded to Delphi Pages. DSP and Torry's might follow later but I do not
activily update them
because of the long-winded procedure. On Delphi Pages new versions are online
within 1 or 2 minutes.
Delphi City has too low traffic to be considered and Delphi32 has not yet been
considered as target.
Most of the sites however download my stuff automatically, so there is a good
chance they keep up to
date.

The second version is 2.1 and is a prerelease which contains a lot of changes.
I uploaded this
version to the file area of YG (Yahoo Groups) where you can download it. Keep
in mind it is a
prerelease so there are for sure still bugs in it. On the other hand it
contains all recent bug
fixes.

> 1. When ScrollbarOptions has AlwaysVisible=True,ScrollBars=sbBoth,and
> ScrollBarStyle=sbmFlat, there is a rectangle that the control does not
> paint, and thus has garbage in it. It's located just above the vertical
> scrollbar, and just to the right of the header. And ideas?

This was a bug and has been fixed. Please wait for the next prerelease on
sunday.

> 2. The OnGetNodeWidth event passes Sender as TBaseVirtualTree - which does
> not have Canvas as a public property. What should I measure my node against
> without the control's canvas?

I encountered this flaw last week to and changed the OnGetNodeWidth event to
take a Canvas
parameter.

> 3. If you change the color of the pen in OnDrawNode, the tree control does
> not set it back to what it needs, and the tree lines are drawn incorrectly.
> It seems that the line Canvas.Pen.Color := clBtnFace; is required to get
> things to work.

I hesitate to include code which always resets any property which might have
been changed by the
application. My opinion is that the application should restore the previous
values to avoid
redundancies in the tree. Imagine that the app. changes the mapping mode of the
canvas or some other
things which are not wrapped by TCanvas. How can the tree know what to reset?

Ciao, Mike

 | Replies | Author | Date
601 | Re: New to group | Dave Scofield | Tue 2/20/2001


re: "dummy" Image for Checkbox ?

From: "Mike Lischke" [public@l...]
Date: Sat Feb 17, 2001 3:21 pm
Subject: RE: [VirtualTreeview] "dummy" Image for Checkbox ?

> The problem is, that on a tree with nodes, which have checkboxes, and
> others without having a checkbox or a button, the text of the nodes
> is not aligned properly.
>
> I would suggest, that an empty image and another type like "ctdummy"
> would do it.

This is actually extremly easy to solve. In TBaseVirtualTree.GetCheckImage is a
case statement which
returns -1 for check type ctNone. By changing this to ckEmpty you will get the
empty space you want.
The problem, however, is that maybe not everyone does like the unnecessary
space. I think we agree
that the alignment is usefule for nodes only which have mixed check styles
(e.g. some child nodes
have no check mark while others have). Hence a good compromise would be to
enable alignment only for
nodes which do not have a check mark but got sibling nodes which got one. The
problem here is: how
to determine whether there are sibling nodes with a check mark without
iterating every time through
all siblings? Keep in mind an additional flag is no option, because the result
simply does not
justify it.

Ciao, Mike


re: VT Package

From: "Mike Lischke" [public@l...]
Date: Sat Feb 17, 2001 3:25 pm
Subject: RE: [VirtualTreeview] VT Package

Robert,

> Hi, I installed version 2.1 and rebuilt my package. It then removed my
> Virtual Treeview components from the component palette!!! I browsed the
> version 2.1 unit (VirtualTrees.pas) source and it looks like it is missing a
> "Register" procedure and any "RegisterComponents" call... Am I missing
> something?

Werner already answered you, so only a short note from me: there is a VT
Package.zip file on YG
which contains all necessary files as well as the important inclusion Werner
mentioned (actually it
is dclstd50.dcp from $(Delphi)\lib).

While we are it: has anybody on this list managed to get a Delphi 4 package
compiling? Come on guys,
help a bit. It is not for me, believe me.

Ciao, Mike


re: VT Package

From: "Robert Palmqvist" [robert.palmqvist@h...]
Date: Sat Feb 17, 2001 4:26 pm
Subject: Re: [VirtualTreeview] VT Package

Thanks, all, I now got it installed and compiled, just have to figure out
how the "Sort" method is supposed to work in this version. Guess I have to
browse this list some ;)

/ Rob

----- Original Message -----
From: "Mike Lischke" [public@l...]
To: <VirtualTreeview@yahoogroups.com>
Sent: Saturday, February 17, 2001 4:25 PM
Subject: RE: [VirtualTreeview] VT Package

> Robert,
>
> > Hi, I installed version 2.1 and rebuilt my package. It then removed my
> > Virtual Treeview components from the component palette!!! I browsed the
> > version 2.1 unit (VirtualTrees.pas) source and it looks like it is
missing a
> > "Register" procedure and any "RegisterComponents" call... Am I missing
> > something?
>
> Werner already answered you, so only a short note from me: there is a VT
Package.zip file on YG
> which contains all necessary files as well as the important inclusion
Werner mentioned (actually it
> is dclstd50.dcp from $(Delphi)\lib).
>
> While we are it: has anybody on this list managed to get a Delphi 4
package compiling? Come on guys,
> help a bit. It is not for me, believe me.
>
> Ciao, Mike
>
>
>
> To unsubscribe from this group, send an email to:
> VirtualTreeview-unsubscribe@egroups.com
>
>
>
>


IBO VirtualTree

From: "Paul Gallagher" [paul@t...]
Date: Sat Feb 17, 2001 5:35 pm
Subject: IBO VirtualTree

Hi all....

I have a working demo of the IB_VTree functioning with DragDrop, and editable
tree mostly done. If there is interest in it, I will be happy to upload it to
the files area. Otherwise, I will wait till it is more complete. I still need
to work on the Insert routines. I have added a "FolderConstraints" property.
This makes the tree act like Windows Explorer. When FolderConstraints is true,
it will use user identified OpenFolder and CloseFolder Icons, and will not
allow nodes to be dropped or inserted into non-folder nodes. This is actually
something that Mike may want to consider building into the BaseClass.

It is really amazing how fast it is, at least on small tables. The bad news is,
I see no way around needing a "structured" table, with parent field. Otherwise,
how could the tree possibly know how to build itself? Currently, I am using an
integer field for the parent field, and KeyField, but I see no reason why it
could not be converted to variant type, if someone wants to put a little effort
into it.

The demo/test project is a simulation of the InternetExplorer Favorites
sidebar. It's not perfect, but its good.

Paul

[Non-text portions of this message have been removed]


OnChange event not right?

From: "Paul Gallagher" [paul@t...]
Date: Sat Feb 17, 2001 6:48 pm
Subject: OnChange event not right?

Mike,
Something does not seem quite right with the OnChange event. It seems to
retrieve the wrong node when using the up/down arrow keys to navigate the tree.
When the node is clicked with the mouse, all is right. It is only when the tree
is navigated with the arrows that there is a problem. I'm not sure if I am
using it incorrectly, or if this is a bug. Here is the code in my OnChange
event:

procedure TfmMain.VTChange(Sender: TBaseVirtualTree; Node: PVirtualNode);
var
NodeData: PMyRec;
begin
if VT.focused then //only do this if tree is focused. Prevents recursion
begin
NodeData := VT.GetNodeData(VT.FocusedNode); <<<<<FocusedNode or Node has
same affect
if Assigned(NodeData) then IB_Query1.Bookmark := NodeData.BookMark;
end;
end;

TIA
Paul Gallagher

[Non-text portions of this message have been removed]

 | Replies | Author | Date
574 | Re: OnChange event not right? | Mike Lischke | Sat 2/17/2001


re: OnChange event not right?

From: "Mike Lischke" [public@l...]
Date: Sat Feb 17, 2001 7:40 pm
Subject: RE: [VirtualTreeview] OnChange event not right?

Paul,

> Something does not seem quite right with the OnChange event. It seems to
retrieve the
> wrong node when using the up/down arrow keys to navigate the tree. When the
node is
> clicked with the mouse, all is right. It is only when the tree is navigated
with the
> arrows that there is a problem. I'm not sure if I am using it incorrectly, or
if this is
> a bug. Here is the code in my OnChange event:

I verified again that the change code works as intented and it does so. For
instance the demos rely
on the correct node. Do you have hidden nodes in the tree? I ask because
navigation with hidden
nodes does not yet work correctly. Btw: if the focused node is of interest for
you then use the
OnFocusedChanged event. This is however not delayable via a timer so it might
lead to unnecessary DB
accesses.

Ciao, Mike


Q: Header sort arrows

From: "Robert Palmqvist" [robert.palmqvist@h...]
Date: Sun Feb 18, 2001 12:39 am
Subject: Q: Header sort arrows

I am playing with the version 2.1 of Virtual Treeview and I found the option
"hoShowSortGlyphs". I turned it on but I got no sort glyphs in my headers (my
treeview is in auto sort mode). So I poked around in the source and it looks
like the procedure "TVirtualTreeColumns.PaintHeader" should use image index 2
(sdDescending) and 3 (sdAscending) in the image list "UtilityImages" as sort
arrow images. The problem is that the bitmap "VBT_UTILITIES" in my
VirtualTrees.res is only containing two images (index 0 and 1) and that is the
ones used to indicate drag and drop of headers. Where is images 2 and 3?

/ Robert

[Non-text portions of this message have been removed]

 | Replies | Author | Date
579 | Re: Q: Header sort arrows | Mike Lischke | Sun 2/18/2001
599 | Re: Q: Header sort arrows | [adembaba@e...] | Tue 2/20/2001
608 | Re: Q: Header sort arrows | Mike Lischke | Wed 2/21/2001
622 | Re: Q: Header sort arrows | [adembaba@e...] | Fri 2/23/2001
626 | Re: Q: Header sort arrows | Mike Lischke | Fri 2/23/2001
633 | Re: Q: Header sort arrows | [adembaba@e...] | Mon 2/26/2001
652 | Re: Q: Header sort arrows | Mike Lischke | Sat 3/3/2001


New file uploaded to VirtualTreeview

From: [VirtualTreeview@yahoogroups.com>
Date: Sun Feb 18, 2001 3:58 am
Subject: New file uploaded to VirtualTreeview

Hello,

This email message is a notification to let you know that
a file has been uploaded to the Files area of the VirtualTreeview
group.

File : /Demo.zip
Uploaded by : [paul@t...]
Description : Demo of IB_VTree and demo files

You can access this file at the URL

http://groups.yahoo.com/group/VirtualTreeview/files/Demo.zip

To learn more about file sharing for your group, please visit

http://help.yahoo.com/help/us/groups/files

Regards,

paul@t...]


IB_VTree

From: "Paul Gallagher" [paul@t...]
Date: Sun Feb 18, 2001 4:01 am
Subject: IB_VTree

I have uploaded a demo and the project files of the IB descendant Virtual Tree
control. I would appreciate any and all feedback from anyone brave enough to
try it. I have also included the project exe file, in case you don't want to
install the component, but want to see what it looks like. Just copy the the
TESTIBO.GDB file to directory c:\IB_VTree.

Paul Gallagher

[Non-text portions of this message have been removed]

 | Replies | Author | Date
580 | Re: IB_VTree | Mike Lischke | Sun 2/18/2001
2474 | Re: IB_VTree | [markus.ohlenroth@p...] | Mon 6/18/2001


Delphi 4

From: "Louis Kessler" [lkessler@l...]
Date: Sun Feb 18, 2001 8:17 am
Subject: Delphi 4

> From Mike Lischke:
>
> While we are it: has anybody on this list managed to get a Delphi 4
package compiling? Come on guys,
> help a bit. It is not for me, believe me.

I've got Delphi 4. Tell me what's involved to put 2.1 into a Delphi 4
package and I'll try it.

I did take the VirtualTrees.pas 2.1 code, and use the Minimal.dpr,
Minimal.res, Main.pas, Main.dfm, VirtualTree.res, and DFS.inc files from the
Version 1.27 files and Minimal folder. Together they compile and execute
with no errors.

Louis Kessler
Winnipeg, Manitoba, Canada

E-mail: [lkessler@l...]
Website: www.lkessler.com

 | Replies | Author | Date
581 | Re: Delphi 4 | Mike Lischke | Sun 2/18/2001
587 | Re: Delphi 4 | Louis Kessler | Sun 2/18/2001
594 | Re: Delphi 4 | Mike Lischke | Mon 2/19/2001


re: Q: Header sort arrows

From: "Mike Lischke" [public@l...]
Date: Sun Feb 18, 2001 8:46 am
Subject: RE: [VirtualTreeview] Q: Header sort arrows

Hi Robert,

> The problem is that
> the bitmap "VBT_UTILITIES" in my VirtualTrees.res is only containing two
images (index 0
> and 1) and that is the ones used to indicate drag and drop of headers. Where
is images 2 and 3?

Sorry for inconvinience. The res file was in the first 2.1 upload to YG, but
later I have only
uploaded VirtualTrees.pas.

I have just uploaded the res file and hope to get ready today a new prerelease
which will again be
in a nearly full package (no help files).

Ciao, Mike


re: IB_VTree

From: "Mike Lischke" [public@l...]
Date: Sun Feb 18, 2001 8:49 am
Subject: RE: [VirtualTreeview] IB_VTree

Paul,

> I have uploaded a demo and the project files of the IB descendant Virtual
Tree control. I
> would appreciate any and all feedback from anyone brave enough to try it. I
have also
> included the project exe file, in case you don't want to install the
component, but want
> to see what it looks like. Just copy the the TESTIBO.GDB file to directory
c:\IB_VTree.

Currently I cannot try your demo because I don't have the IB client installed
at home. I will try it
tomorrow in my office. One question popped up, however: what is the reason that
you have not used
the Tag property of the columns but instead still the MinWidth property? And
another one: why don't
you use a dynamic array:

PVTreeRec = ^TVTreeRec;
TVTreeRec = record
......
ColumnText: array of string;
end;

? This would remove the column count limitation.

Ciao, Mike


re: Delphi 4

From: "Mike Lischke" [public@l...]
Date: Sun Feb 18, 2001 8:55 am
Subject: RE: [VirtualTreeview] Delphi 4

Hi Louis,

> I've got Delphi 4. Tell me what's involved to put 2.1 into a Delphi 4
> package and I'll try it.

Please download the "VT Package.zip" file from YG and extract it into a private
folder. Copy the
latest VT (2.1.) into the same folder together with the proper res file. Make a
copy of the
VirtualTreesD5.dpk file (the res file is not so important and will be created
automatically). Name
your new dpk VirtualTrees.D4.dpk and open it in Notepad (not Delphi). Change
the requires clause to:

requires
vcl40,
dclstd40;

save the file and close Notepad. Then open the package in Delphi 4. Try to
compile it and tell me
any problems and/or adjustments you had to make to get VT to be installed. I
recommend that you
temporarily uninstall the package which contains VT already (if you have it
installed already) and
use the new package to install VT. Please see also whether the correct
component palette icon
appears.

Ciao, Mike


re: IB_VTree

From: "Paul Gallagher" [paul@t...]
Date: Sun Feb 18, 2001 1:50 pm
Subject: Re: [VirtualTreeview] IB_VTree

I do not see a tag property for the column. Perhaps I am missing something.
And I will use your suggestion of a dynamic array. This is still a work in
process, so Im glad to get some feedback.

Thanks,
Paul

----- Original Message -----
From: "Mike Lischke" [public@l...]
To: <VirtualTreeview@yahoogroups.com>
Sent: Sunday, February 18, 2001 2:49 AM
Subject: RE: [VirtualTreeview] IB_VTree

> Paul,
>
> > I have uploaded a demo and the project files of the IB descendant
Virtual Tree control. I
> > would appreciate any and all feedback from anyone brave enough to try
it. I have also
> > included the project exe file, in case you don't want to install the
component, but want
> > to see what it looks like. Just copy the the TESTIBO.GDB file to
directory c:\IB_VTree.
>
> Currently I cannot try your demo because I don't have the IB client
installed at home. I will try it
> tomorrow in my office. One question popped up, however: what is the reason
that you have not used
> the Tag property of the columns but instead still the MinWidth property?
And another one: why don't
> you use a dynamic array:
>
> PVTreeRec = ^TVTreeRec;
> TVTreeRec = record
> ......
> ColumnText: array of string;
> end;
>
> ? This would remove the column count limitation.
>
> Ciao, Mike
>
>
>
> To unsubscribe from this group, send an email to:
> VirtualTreeview-unsubscribe@egroups.com
>
>
>
>


re: IB_VTree

From: "Paul Gallagher" [paul@t...]
Date: Sun Feb 18, 2001 2:23 pm
Subject: Re: [VirtualTreeview] IB_VTree

Yes, now I see the tag property. It must have been added since the 1.3
release.

Paul

----- Original Message -----
From: "Paul Gallagher" [paul@t...]
To: [VirtualTreeview@yahoogroups.com>
Sent: Sunday, February 18, 2001 7:50 AM
Subject: Re: [VirtualTreeview] IB_VTree

> I do not see a tag property for the column. Perhaps I am missing
something.
> And I will use your suggestion of a dynamic array. This is still a work in
> process, so Im glad to get some feedback.
>
> Thanks,
> Paul
>
> ----- Original Message -----
> From: "Mike Lischke" <public@l...]
> To: <VirtualTreeview@yahoogroups.com>
> Sent: Sunday, February 18, 2001 2:49 AM
> Subject: RE: [VirtualTreeview] IB_VTree
>
>
> > Paul,
> >
> > > I have uploaded a demo and the project files of the IB descendant
> Virtual Tree control. I
> > > would appreciate any and all feedback from anyone brave enough to try
> it. I have also
> > > included the project exe file, in case you don't want to install the
> component, but want
> > > to see what it looks like. Just copy the the TESTIBO.GDB file to
> directory c:\IB_VTree.
> >
> > Currently I cannot try your demo because I don't have the IB client
> installed at home. I will try it
> > tomorrow in my office. One question popped up, however: what is the
reason
> that you have not used
> > the Tag property of the columns but instead still the MinWidth property?
> And another one: why don't
> > you use a dynamic array:
> >
> > PVTreeRec = ^TVTreeRec;
> > TVTreeRec = record
> > ......
> > ColumnText: array of string;
> > end;
> >
> > ? This would remove the column count limitation.
> >
> > Ciao, Mike
> >
> >
> >
> > To unsubscribe from this group, send an email to:
> > VirtualTreeview-unsubscribe@egroups.com
> >
> >
> >
> >
>
>
>
> To unsubscribe from this group, send an email to:
> VirtualTreeview-unsubscribe@egroups.com
>
>
>
>


re: IB_VTree

From: "Paul Gallagher" [paul@t...]
Date: Sun Feb 18, 2001 3:05 pm
Subject: Re: [VirtualTreeview] IB_VTree

The short answer to why I did not use a dynamic array is, I don't know
how...

What I don't understand, is how, and where to call the setlength. Should I
call it in the constuctor, or when I build the tree? And also, how do I
reference the ColumnText array, when it is in a record? If anyone could help
me with this, I would appreciate it.

TIA,
Paul

> the Tag property of the columns but instead still the MinWidth property?
And another one: why don't
> you use a dynamic array:
>
> PVTreeRec = ^TVTreeRec;
> TVTreeRec = record
> ......
> ColumnText: array of string;
> end;
>
> ? This would remove the column count limitation.
>
> Ciao, Mike
>
>
>
> To unsubscribe from this group, send an email to:
> VirtualTreeview-unsubscribe@egroups.com
>
>
>
>

 | Replies | Author | Date
585 | Re: IB_VTree | Mike Lischke | Sun 2/18/2001


re: IB_VTree

From: "Mike Lischke" [public@l...]
Date: Sun Feb 18, 2001 5:11 pm
Subject: RE: [VirtualTreeview] IB_VTree

> What I don't understand, is how, and where to call the setlength. Should I
> call it in the constuctor, or when I build the tree? And also, how do I
> reference the ColumnText array, when it is in a record? If anyone could help
> me with this, I would appreciate it.

When you create the node record then you should also know how many strings to
store (corresponds to
columns in the table, right?). So this is a good place to do the
initialization. Access is the same
as with the static array, just use ColumnText[Column] := 'The column''s text';

Ciao, Mike


Some additions to 2.1

From: "Anthony Mills" [amills@m...]
Date: Sun Feb 18, 2001 11:00 pm
Subject: Some additions to 2.1

Mike,

Here's some stuff I've added to my local copy of 2.1 ...

** Support for Ctrl-A (standard select all shortcut) and the context menu
key:

Add to the end of TBaseVirtualTree.WMKeyDown's second case statement:

VK_APPS:
if Assigned(FFocusedNode) then
begin
Rect := GetDisplayRect(FFocusedNode, -1);
GetHitTestInfoAt(Rect.Left, Rect.Top, HitInfo);
DoPopupMenu(HitInfo, Rect.Left, Rect.Bottom);
end;
Ord('a'), Ord('A'):
if ssCtrl in Shift then
SelectAll(True);

Add TBaseVirtualTree.DoPopupMenu as follows:

procedure TBaseVirtualTree.DoPopupMenu(HitInfo: THitInfo; X, Y: Integer);
var
Run: PVirtualNode;
Menu: TPopupMenu;
AskParent: Boolean;
begin
// support for node dependent popup menus
if Assigned(FOnGetPopupMenu) then
begin
Run := HitInfo.HitNode;
if Assigned(Run) then
begin
FocusedNode := Run;
Menu := nil;
AskParent := True;
repeat
FOnGetPopupMenu(Self, Run, HitInfo.HitColumn, AskParent, Menu);
Run := Run.Parent;
until (Run = FRoot) or Assigned(Menu) or not AskParent;

if Assigned(Menu) then
begin
StopTimer(EditTimer);
Menu.PopupComponent := Self;
with ClientToScreen(Point(X, Y)) do
Menu.Popup(X, Y);
Exit;
end;
end;
end;
end;

Change TBaseVirtualTree.WMRButtonUp as follows:

procedure TBaseVirtualTree.WMRButtonUp(var Message: TWMRButtonUp);

// handle right click selection and node specific popup menu

var
HitInfo: THitInfo;

begin
Exclude(FStates, tsRightButtonDown);

inherited;

// get information about the hit
GetHitTestInfoAt(Message.XPos, Message.YPos, HitInfo);

if voRightClickSelect in FOptions then
HandleMouseUp(Message, HitInfo);

DoPopupMenu(HitInfo, Message.XPos, Message.YPos);
end;

Just basically centralizing the popup menu stuff into DoPopupMenu and
calling it from WMKeyDown and WMRButtonUp.

** Minor issue in TBaseVirtualTree.SetChildCount. When the child count is
less than the current one, SetChildCount uses DoFreeNode to kill the excess
nodes. When some of those are selected and/or focused, the selection list
and FFocusedNode are not modified appropriately.

Changing the call from DoFreeNode(Child) to DeleteNode(Child) seems to have
solved the problem.

** This isn't one I fixed, but there's a graphical error when autoscrolling
and selecting. I didn't like how it would autoscroll when I wasn't
selecting, so I changed

function TBaseVirtualTree.CanAutoScroll: Boolean;

// determines if auto scrolling is currently allowed

begin
// don't scroll the client area if the header is currently doing
tracking or dragging
Result := (voAutoScroll in FOptions) and (FHeader.FStates = []);
end;

to

function TBaseVirtualTree.CanAutoScroll: Boolean;

// determines if auto scrolling is currently allowed

begin
// don't scroll the client area if the header is currently doing
tracking or dragging
Result := (voAutoScroll in FOptions) and (FHeader.FStates = []) and
(tsDrawSelecting in FStates);
end;

Unfortunately, when autoscrolling, the newly-selected captions didn't
display right until I moved my mouse over the control; as long as the mouse
pointer was stationary, it would get the caption length wrong and not select
the entire height, etc.

Oh, by the way, the office email was knocked out for a while, so I never
sent you my reasoning for including initialization on InvalidateNode. My
program uses the treeview as a progress indicator which calculates the
values it needs to display when queried by GetText. The program invalidates
the associated nodes (which may be hidden and/or uninitialized) when the
variables the calculations are based upon change.

Before I added code to initialize nodes in InvalidateNode, I would get an
assertion failure in line 7459 (and another one I can't remember) when
expanding a branch such that the newly-visible child nodes were partially
offscreen. (Line 7459 is TBaseVirtualTree.GetPreviousVisible's assertion
that the node it is fed is initialized.)

Strangely enough, I find myself unable to replicate this bug all the time,
but it has been reported many times by beta testers of the software as well
as our in-house QA section.

Regards,

Tony

 | Replies | Author | Date
593 | Re: Some additions to 2.1 | Mike Lischke | Mon 2/19/2001


re: Delphi 4

From: "Louis Kessler" [lkessler@l...]
Date: Sun Feb 18, 2001 11:00 pm
Subject: Re: [VirtualTreeview] Delphi 4

> From Mike Lischke:
>
> Please download the "VT Package.zip" file from YG and extract it into a
private folder. Copy the
> latest VT (2.1.) into the same folder together with the proper res file.
Make a copy of the
> VirtualTreesD5.dpk file (the res file is not so important and will be
created automatically). Name
> your new dpk VirtualTrees.D4.dpk and open it in Notepad (not Delphi).
Change the requires clause to:
> requires
> vcl40,
> dclstd40;

I also changed the first line of VirtualTreesD4.dpk to read:
package VirtualTreesD4;

> save the file and close Notepad. Then open the package in Delphi 4. Try to
compile it and tell me
> any problems and/or adjustments you had to make to get VT to be installed.
> Please see also whether the correct component palette icon appears.

My first compilation gave a fatal error, that VirtualTrees.dcu was not
found. So I took the VirtualTrees.dcu file that was created when I tested
the VirtualTrees.pas file with the Minimal program, put it in the directory,
and recompiled. The second recompilation had no problems whatsoever.

So then I installed the package. This registered TVirtualDrawTree and
TVirtualStringTree and created the two cute palette icons on the Virtual
Controls tab. The icons seem to correctly add the components to a form. I
cannot see any problems.

If you need any files from me to create the VT Package for D4, let me know.

Louis Kessler
Winnipeg, Manitoba, Canada

E-mail: [lkessler@l...]
Website: www.lkessler.com


New file uploaded to VirtualTreeview

From: [VirtualTreeview@yahoogroups.com>
Date: Sun Feb 18, 2001 11:47 pm
Subject: New file uploaded to VirtualTreeview

Hello,

This email message is a notification to let you know that
a file has been uploaded to the Files area of the VirtualTreeview
group.

File : /ZipUnzipDemo.zip
Uploaded by : [adembaba@e...]
Description : Fully working Zip & Unzip demo with source.

You can access this file at the URL

http://groups.yahoo.com/group/VirtualTreeview/files/ZipUnzipDemo.zip

To learn more about file sharing for your group, please visit

http://help.yahoo.com/help/us/groups/files

Regards,

adembaba@e...]


re: Sort, and more

From: [adembaba@e...]
Date: Sun Feb 18, 2001 11:53 pm
Subject: Re: Sort, and more

Hi Mike,

I have applied your suggestions and it works --sort of.
For some reason, stuff in columns other than the main
column gets sorted in a funny way --i.e. not really sorted.
I dont understand why; I have gone through the code over
and over several times.

If you, or anyone else, would be kind enough to look
into it, I have uploaded the source of the stuff in
the Files area. (BTW, other than this little hitch,
it is a fully working copy; and I feel it is something
that can be useful in its own right)

Cheers,

--- In [VirtualTreeview@y...], "Mike Lischke" [public@l...] wrote:
> > Isn't Sort method supposed to update the Header.SortColumn
> > and Header.SortDirection?
>
> No. You can sort for other columns than those which are set in
SortColumn etc. SortColumn and
> SortDirection are for auto sort only. If you don't use auto sort
then they are just storage. The
> solution for your problem is therefore:
>
> procedure TfrmDrawTree.VDT1HeaderClick(Sender: TBaseVirtualTree;
> Column: Integer);
> begin
> with (Sender as TVirtualDrawTree), Header do
> begin
> if Column <> MainColumn then
> SortColumn := NoColumn
> else
> begin
> if SortColumn = NoColumn then
> begin
> SortColumn := Column;
> SortDirection := sdAscending;
> end
> else
> if SortDirection = sdAscending then
> SortDirection := sdDescending
> else
> SortDirection := sdAscending;
> SortTree(SortColumn, SortDirection, False);
> end;
> end;
> end;
>
> as shown in the draw tree demo.
>
> Ciao, Mike


re: Installation

From: "Peter Evans" [pgevans@m...]
Date: Mon Feb 19, 2001 11:33 am
Subject: Re: [VirtualTreeview] Installation

I followed the method of Louis Kessler, where he has got a Delphi 4 package
working.

When I did this I got the 2 components on the component bar. Unfortunately
they were not the cute icons but Delphi's default ones. Oh well, I don't
mind about that!

If his Delphi 4 package could be made available it may do the trick.

I then tried to compile the 4 demos.

1) Demo/Minimal. Compiles.
2) Demo/Object. Compiles.
3) Demo/OLE. Got the error "Error creating form: Invalid stream format"
4) Demo/Advanced. Got the error "Error reading VST2.GridLineColor: Property
does not exist"

So I have made progress, and half way there (2 out of 4) in compiles!

Regards, Peter Evans


re: Installation

From: Eric de Gooijer [degooijer.em@i...]
Date: Mon Feb 19, 2001 12:15 pm
Subject: RE: [VirtualTreeview] Installation

Hi Peter,

About the errors. Can you check your Library Path and see if the path is
pointing to the right directory. It is possible that you still have the old
VirtualTree and that the path is pointing to that directory and not to the
new one.

Greetings, Eric

-----Original Message-----
From: Peter Evans [mailto:[pgevans@m...]]
Sent: maandag 19 februari 2001 12:33
To: VirtualTreeview@yahoogroups.com
Subject: Re: [VirtualTreeview] Installation

I followed the method of Louis Kessler, where he has got a Delphi 4 package
working.

When I did this I got the 2 components on the component bar. Unfortunately
they were not the cute icons but Delphi's default ones. Oh well, I don't
mind about that!

If his Delphi 4 package could be made available it may do the trick.

I then tried to compile the 4 demos.

1) Demo/Minimal. Compiles.
2) Demo/Object. Compiles.
3) Demo/OLE. Got the error "Error creating form: Invalid stream format"
4) Demo/Advanced. Got the error "Error reading VST2.GridLineColor: Property
does not exist"

So I have made progress, and half way there (2 out of 4) in compiles!

Regards, Peter Evans

To unsubscribe from this group, send an email to:
VirtualTreeview-unsubscribe@egroups.com


re: Installation

From: "Louis Kessler" [lkessler@l...]
Date: Mon Feb 19, 2001 3:27 pm
Subject: Re: [VirtualTreeview] Installation

> From Peter Evans:
>
> I followed the method of Louis Kessler, where he has got a Delphi 4
package
> working.
> When I did this I got the 2 components on the component bar. Unfortunately
> they were not the cute icons but Delphi's default ones. Oh well, I don't
> mind about that!
> If his Delphi 4 package could be made available it may do the trick.

I'm not exactly sure what is required for the package. I can put something
together like the VT Package that Mike had up on Yahoo Groups a short while
ago, but I'd like to hear back from Mike on what is best here. I am not an
expert in packages and cannot really help you.

> I then tried to compile the 4 demos.
> 1) Demo/Minimal. Compiles.
> 2) Demo/Object. Compiles.
> 3) Demo/OLE. Got the error "Error creating form: Invalid stream format"
> 4) Demo/Advanced. Got the error "Error reading VST2.GridLineColor:
Property
> does not exist"
> So I have made progress, and half way there (2 out of 4) in compiles!

With regards to the compilations, I believe the error you get in the
Advanced Demo is because Delphi cannot find your virtualtrees.dcu file. Add
the path where you installed virtualtrees into the Delphi menu item:
Project Options - Directories/Conditional - Search Path. I don't know if
that's the best way, but that's what I do when I have this sort of problem.

However, even after you do this, I think you will get undeclared
identifiers. I think the reason for this is that these demos have not been
updated to work with Version 2.1 yet. Could someone confirm this for us,
please?

Louis Kessler
Winnipeg, Manitoba, Canada

E-mail: [lkessler@l...]
Website: www.lkessler.com


re: Some additions to 2.1

From: "Mike Lischke" [public@l...]
Date: Mon Feb 19, 2001 8:29 pm
Subject: RE: [VirtualTreeview] Some additions to 2.1

Hi Anthony,

> Here's some stuff I've added to my local copy of 2.1 ...

Thank you for your contribution.

> ** Support for Ctrl-A (standard select all shortcut) and the context menu key:

There is a conceptually question still open: is it really wanted by VT users
that the tree handles all those keys itself? I can imagine that many
applications do handle it centralized and get in trouble with too much
"internal intelligence". Introduce yet another option? Btw: the tree options
can only take 4 more members. Then it is "full", which means it will not be
accepted as published property anymore, because sets are stored as 32 bit
integers only. So we have to be careful with additions (additionally to the
compatibility issue).

> ** Minor issue in TBaseVirtualTree.SetChildCount. When the child count is
> less than the current one, SetChildCount uses DoFreeNode to kill the excess
> nodes. When some of those are selected and/or focused, the selection list
> and FFocusedNode are not modified appropriately.

Thank you very much. This is indeed a serious bug! Appearently I confused
DoFreeNode and DeleteNode. There are more side effects with the current
solution, e.g. intialized nodes are never given to the application so it can
free its user data etc. I will changed this immediately.

> ** This isn't one I fixed, but there's a graphical error when autoscrolling
> and selecting.

What do you mean here? I know there is some funny looking effect when doing
mouse selecting and the tree does scroll. The reason is that not every node
which should be is actually invalidated. I'm still not sure if I should fix
this rather unimportant problem.

> Before I added code to initialize nodes in InvalidateNode, I would get an
> assertion failure in line 7459 (and another one I can't remember) when
> expanding a branch such that the newly-visible child nodes were partially
> offscreen. (Line 7459 is TBaseVirtualTree.GetPreviousVisible's assertion
> that the node it is fed is initialized.)

I have meanwhile worked on VT so it could well be that I already fixed that. I
remember that I inserted an InitNode call somewhere.

Ciao, Mike


re: Delphi 4

From: "Mike Lischke" [public@l...]
Date: Mon Feb 19, 2001 8:30 pm
Subject: RE: [VirtualTreeview] Delphi 4

Louis,

> I also changed the first line of VirtualTreesD4.dpk to read:
> package VirtualTreesD4;
>
> So then I installed the package. This registered TVirtualDrawTree and
> TVirtualStringTree and created the two cute palette icons on the Virtual
> Controls tab. The icons seem to correctly add the components to a form. I
> cannot see any problems.
>
> If you need any files from me to create the VT Package for D4, let me know.

Yes, please send them to my private eMail address. I will put those files into
the distributionl.

Ciao, Mike


re: Re: Sort, and more

From: "Mike Lischke" [public@l...]
Date: Mon Feb 19, 2001 8:33 pm
Subject: RE: [VirtualTreeview] Re: Sort, and more

> If you, or anyone else, would be kind enough to look
> into it, I have uploaded the source of the stuff in
> the Files area. (BTW, other than this little hitch,
> it is a fully working copy; and I feel it is something
> that can be useful in its own right)

Unfortunately, there are some components used (particularly TZipMaster) which I
don't have, so I can't compile your project. But from the source code I would
give my right.... err... left hand that it is error free. The only thing I can
imagine is that the internal index value is most often or always -1 in which
case the comparation routine takes another path.

Ciao, Mike

 | Replies | Author | Date
598 | Re: Sort, and more | [adembaba@e...] | Tue 2/20/2001


re: Installation

From: "Mike Lischke" [public@l...]
Date: Mon Feb 19, 2001 9:07 pm
Subject: RE: [VirtualTreeview] Installation

> However, even after you do this, I think you will get undeclared
> identifiers. I think the reason for this is that these demos have not been
> updated to work with Version 2.1 yet. Could someone confirm this for us,
> please?

This is indeed the case. The only publicly available sample which works with
2.1 is the OLE sample on YG.

Ciao, Mike


Addition to context menu key handler

From: "Anthony Mills" [amills@m...]
Date: Tue Feb 20, 2001 2:13 am
Subject: Addition to context menu key handler

Mike,

> Thank you for your contribution.

Glad to help!

> There is a conceptually question still open: is it really wanted by VT
users
> that the tree handles all those keys itself? I can imagine that many
> applications do handle it centralized and get in trouble with too much
> "internal intelligence". Introduce yet another option? Btw: the tree
options
> can only take 4 more members. Then it is "full", which means it will not
be
> accepted as published property anymore, because sets are stored as 32 bit
> integers only. So we have to be careful with additions (additionally to
the
> compatibility issue).

Shrug. It definitely doesn't warrant another option; VT has enough options
as it is ;-). I think supporting the context menu key is definitely a good
idea, though, as it doesn't have any other function. It just provides a
second way to call the application's OnGetPopupMenu. By the way, a more
standard placement of the popup menu origin is in the middle of the focused
caption; I have it originating from the bottom left in the code I posted.
I've changed that in my local copy:

VK_APPS:
if Assigned(FFocusedNode) then
begin
Rect := GetDisplayRect(FFocusedNode, FFocusedColumn);
GetHitTestInfoAt(Rect.Left, Rect.Top, HitInfo);
if FFocusedColumn >= 0 then
begin
ColWidth := DoGetNodeWidth(FFocusedNode, FFocusedColumn);
if ColWidth > FHeader.Columns[FFocusedColumn].Width then
ColWidth := FHeader.Columns[FFocusedColumn].Width;
end
else
begin
ColWidth := DoGetNodeWidth(FFocusedNode, -1);
if ColWidth > ClientWidth then
ColWidth := ClientWidth;
end;
DoPopupMenu(HitInfo, Rect.Left + ColWidth div 2, (Rect.Top +
Rect.Bottom) div 2);
end;

Ctrl-A is another standard Windows shortcut since Windows 95, but it's
possible that people might not want processing being done when a letter key
is pressed, and the implementation is much more trivial than the
implementation of the context menu key.

Of course, disabling that behaviour is even more trivial, should you choose
to include it. ;-)

Regards,

Tony

 | Replies | Author | Date
606 | Re: Addition to context menu key handler | Mike Lischke | Wed 2/21/2001


re: Sort, and more

From: [adembaba@e...]
Date: Tue Feb 20, 2001 3:49 am
Subject: Re: Sort, and more

> Unfortunately, there are some components used (particularly
> TZipMaster) which I don't have, so I can't compile your
> project. But from the source code I would give my right....
> err... left hand that it is error free.

:-))

> The only thing I can imagine is that the internal index
> value is most often or always -1 in which case the
> comparation routine takes another path.

I know, the way I represent the directory structure
is somewhat a way-round; but, how else can I emulate
the Win Explorer given that all you get is the
fullpath of a file or directory. Any, help..


re: Q: Header sort arrows

From: [adembaba@e...]
Date: Tue Feb 20, 2001 3:54 am
Subject: Re: Q: Header sort arrows

You must get the latest package for the sort glyphs.

My question is: Is it possible to Left/RightJustfiy
the glyph only; i.e. independent of the column header's
text I would like to see the glyph at either end of
the column.

--- In [VirtualTreeview@y...], "Robert Palmqvist"
[robert.palmqvist@h...] wrote:
> I am playing with the version 2.1 of Virtual Treeview and I found
the option "hoShowSortGlyphs". I turned it on but I got no sort
glyphs in my headers (my treeview is in auto sort mode). So I poked
around in the source and it looks like the
procedure "TVirtualTreeColumns.PaintHeader" should use image index 2
(sdDescending) and 3 (sdAscending) in the image list "UtilityImages"
as sort arrow images. The problem is that the bitmap "VBT_UTILITIES"
in my VirtualTrees.res is only containing two images (index 0 and 1)
and that is the ones used to indicate drag and drop of headers. Where
is images 2 and 3?


Bug in node selection

From: Bole-Feysot Eric [ebolefeysot@b...]
Date: Tue Feb 20, 2001 7:37 am
Subject: Bug in node selection

Hi

I'm new to this group, and this is my first post :)

I developped a subclass of vtv for my app. It works fine except one thing:

This is easily reproductible and I put a bug.zip project in the file area
(3Ko)

So, simply select a node. It goes selected :)
Now click again on it to select it 'a second time'. It stay selected :)
Now, if you check the node states, it is not selected ! and the selectcount
property is set to 0.

Try it yourself.
I would like to know if you already know that or if I have to dig in the
source code myself.

Great component !
--
Eric Bole-Feysot mailto:[ebolefeysot@b...]
Romcenter Home Page:
web: www.romcenter.com
E-mail : [support@r...]

**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager. [administrator@b...]
**********************************************************************

[Non-text portions of this message have been removed]

 | Replies | Author | Date
609 | Re: Bug in node selection | Mike Lischke | Wed 2/21/2001


re: New to group

From: "Dave Scofield" [dave@b...]
Date: Tue Feb 20, 2001 4:59 pm
Subject: RE: [VirtualTreeview] New to group

> Actually, there are two maintained versions.

Thanks for the info - I'm clear now.

>
> > 3. If you change the color of the pen in OnDrawNode, ...

> I hesitate to include code which always resets any property ...

Mike, forgive me if I sound "authoritative" about this, but I can tell you
exactly what the VCL designers had in mind with these types of events.
Events are designed to be "contractless" - that means two things: a) if you
create an event handler, and don't write any code for it (it's empty), the
object should behave as though you did not create an event handler. and ..
b) objects should be aware that event handlers may change their state, and
should therefore not depend on existing state to be maintained after calling
an event handler. Basically, this means that if you want the canvas to be in
a particular state when you start drawing, then the rule is that you should
explicitly put it in that state. Otherwise, you're creating a "contract"
with the event handler, saying "you must put back anything you change",
which goes against the general principle of VCL events.

Of course, you cannot be expected to set every single GDI parameter in the
world, just to make sure things are as you expect them. However, there are
many cases where it should be the control's responsibility to make sure
things are consistent. Either that, or it should be clearly documented that
the control sets up the canvas, uses it, then calls the event handler, and
then uses the canvas some more - and thus the event handler needs to
preserve any existing state. I realize that docs are slim with your
control - so I'm just talking about pure theory and generalizations.

Anyway - it's obviously a small task for me to restore the pen color, so
that's what I'll do.

Thanks for your time,
Dave


InsertNode and Focus

From: Bender Heri [HBender@E...]
Date: Tue Feb 20, 2001 6:02 pm
Subject: InsertNode and Focus

Hi all

The focus handling when inserting a new node seems to have a bug:

My code reduces to following:

FocusedNode := InsertNode(aNode,amBefore);

Result: The events OnFocusChanging and OnFocusChange arrive, but the last
focused node stays focused (highlighted).

What's wrong here?

Heri

 | Replies | Author | Date
605 | Re: InsertNode and Focus | Mike Lischke | Wed 2/21/2001


[no subject]

From: [harker@k...]
Date: Wed Feb 21, 2001 2:17 am
Subject:

 | Replies | Author | Date
797 | (no subject) | Eric Verstrepen | Fri 3/16/2001
1288 | (no subject) | [colin@p...] | Fri 4/20/2001
1660 | (no subject) | [F.vdwestelaken@c...] | Tue 5/8/2001
1661 | (no subject) | [F.vdwestelaken@c...] | Tue 5/8/2001
1864 | (no subject) | =?iso-8859-1?q?Pascal=20pag=E | Fri 5/18/2001
1969 | (no subject) | Ralph Stoesser | Wed 5/23/2001
2191 | (no subject) | [F.vdwestelaken@c...] | Mon 6/4/2001
2193 | Re: (unknown) | Franc v/d Westelaken | Mon 6/4/2001
2269 | (no subject) | [brinkers@h...] | Fri 6/8/2001


re: New to group

From: Mike Lischke [public@l...]
Date: Wed Feb 21, 2001 11:18 am
Subject: RE: [VirtualTreeview] New to group

Hi Dave,

> Mike, forgive me if I sound "authoritative" about this, but I
> can tell you exactly what the VCL designers had in mind with these types
of events.
> Events are designed to be "contractless" - that means two
> things:

Yes, I know this design theory and agree with most of its implications. But
practical reasons lead me to the decisions I finally make (well, most of the
time :o]).

> a) if you create an event handler, and don't write any code for it
> (it's empty), the object should behave as though you did not create an
event
> handler.

While this is mostly the case (and I do it this way too) I can still imagine
that there are components which use the pure existance of an event handle to
determine further actions. This can of course be changed to use an option.

> b) objects should be aware that event handlers may change their state, and
> should therefore not depend on existing state to be maintained after
calling
> an event handler. Basically, this means that if you want the canvas to be
in
> a particular state when you start drawing, then the rule is that you
should
> explicitly put it in that state. Otherwise, you're creating a "contract"
> with the event handler, saying "you must put back anything you change",
> which goes against the general principle of VCL events.

This is something I see a bit different. Having a contractless event handler
means basically the handler can do whatever it wants whithout that the
component suffers from it. And this is simply impossible. To put it to an
extreme: if the handler decides to restart Windows, what can the component
do to recover gracefully? I know this example is nonsense, but describes the
limitations of the idea about contractless event handlers quite well. On the
other hand it is often used *that* the handler changes states (e.g. for
owner draw, or to switch an option how to save a file and so on). One could
say that even object pascal uses the "contract" way by specifying which
registers in a subroutine may not be changed and that the caller cleans the
stack, not the callee as in C stdcall. Of course this is not about event
handlers, but a practical example.

I agree however with you to say that if a component depends on a particular
state so deeply that it will fail to continue working if it is wrong then it
should take opportunities to make sure the state is set correctly. For
drawing operations, however, this is not the case in my opinion.

> Either that, or it should be clearly documented that
> the control sets up the canvas, uses it, then calls the event
> handler, and then uses the canvas some more - and thus the event handler
needs to
> preserve any existing state. I realize that docs are slim with your
> control - so I'm just talking about pure theory and generalizations.

Agreed too. Documentation is likely the better choice because it allows for
optimizations. Additionally it is wise to remind the old rule to put things
back into order how you found them. This is applicable in Virtual Tree as
well as in real life.

Thank you for this discussion :o]

Ciao, Mike


re: InsertNode and Focus

From: Mike Lischke [public@l...]
Date: Wed Feb 21, 2001 11:21 am
Subject: RE: [VirtualTreeview] InsertNode and Focus

Hi Heri,

> The focus handling when inserting a new node seems to have a bug:
>
> My code reduces to following:
>
> FocusedNode := InsertNode(aNode,amBefore);
>
> Result: The events OnFocusChanging and OnFocusChange arrive,
> but the last
> focused node stays focused (highlighted).
>
> What's wrong here?

You mixed "focused" and "selected" ("highlighted"). Being focused is
indicated by the thin rectangle around a node and is independant of its
selection state. If you want the new node to be selected to then set it
explicitely (Tree.Selected[InsertNode(aNode, amBefore)] := True).

Ciao, Mike


re: Addition to context menu key handler

From: Mike Lischke [public@l...]
Date: Wed Feb 21, 2001 11:25 am
Subject: RE: [VirtualTreeview] Addition to context menu key handler

Hi Anthony,

> Shrug. It definitely doesn't warrant another option; VT has
> enough options as it is ;-).

Well, I have inserted your code. Indeed is disabling a little problem. I
just wait until somebody complains about it :o]

Ciao, Mike


re: Re: Sort, and more

From: Mike Lischke [public@l...]
Date: Wed Feb 21, 2001 11:26 am
Subject: RE: [VirtualTreeview] Re: Sort, and more

> I know, the way I represent the directory structure
> is somewhat a way-round; but, how else can I emulate
> the Win Explorer given that all you get is the
> fullpath of a file or directory. Any, help..

Why don't you use the code in the advanced demo (the draw tree example)? It
shows clearly how to enumerate folders and files and how to sort them.

Ciao, Mike


re: Re: Q: Header sort arrows

From: Mike Lischke [public@l...]
Date: Wed Feb 21, 2001 11:29 am
Subject: RE: [VirtualTreeview] Re: Q: Header sort arrows

> My question is: Is it possible to Left/RightJustfiy
> the glyph only; i.e. independent of the column header's
> text I would like to see the glyph at either end of
> the column.

Mmm, a matter of taste. In Explorer the glyphs follow directly the caption.
And since this is an inherent feature of the underlying listview control
which is used in many programs I vote for using this style too. If you have
good arguments, however, to change it to "your" way then let me know and I
will rethink the design.

Ciao, Mike

 | Replies | Author | Date
622 | Re: Q: Header sort arrows | [adembaba@e...] | Fri 2/23/2001


re: Bug in node selection

From: Mike Lischke [public@l...]
Date: Wed Feb 21, 2001 1:18 pm
Subject: RE: [VirtualTreeview] Bug in node selection

Hi Eric,

> I'm new to this group, and this is my first post :)

Welcome in the VT mailing list :o]

> I developped a subclass of vtv for my app. It works fine
> except one thing:
> Now, if you check the node states, it is not selected ! and
> the selectcount
> property is set to 0.

Actually, the selection count is still 1. The problem you detected was that
you got not correctly notified via the OnChange event handler. When
selecting a node with a click (and dragging is switched off) the entire
selection will be cleared. This gave you one OnChange event. I had already
optimized the case that the previously selected node has been add again to
the selection so you got no OnChange event for this action resulting in the
wrong impression there where no nodes selected anymore.

I have changed this so that OnChange is only triggered if more than one node
was selected otherwise removal and addition is done hiddenly. Please be
patient until the new release is uploaded to YG.

Ciao, Mike


Virtual Treeview and Screen.Cursor:= crHourGlass;

From: "Robert Palmqvist" [robert.palmqvist@h...]
Date: Wed Feb 21, 2001 10:17 pm
Subject: Virtual Treeview and Screen.Cursor:= crHourGlass;

Hi all,

I have run into a problem. I import data to my Virtual Treeview by redirecting
stdout from a DOS program. This can take a while and I therefor set the cursor
to a hourglass during the operation. This was working great with the standard
listview that I was using before but I noticed that the cursor was reset by the
Virtual Treeview right at the beginning of the redirection!?!

I poked around some in the source and started to debug. One problem is that my
machine hangs during debugging but this is where things started to freak out...

The actual reading from stdout is done by a separate thread using anonymous
pipes. The main application is waiting for this thread in a loop calling
Application.ProcessMessages (code below):

while MsgWaitForMultipleObjects(1, fProcessInfo.hProcess, false,
INFINITE, QS_ALLINPUT) = WAIT_OBJECT_0 + 1 do
Application.ProcessMessages;

It looks like this loop is making the Virtual Treeview reset the cursor via the
procedure TBaseVirtualTree.WndProc(var Message: TMessage); or something like
that...

Anyone experienced anything similar? Any known workarounds?

Thanks in advance / Robert

[Non-text portions of this message have been removed]


RightClick also autoexpands

From: "Paul Gallagher" [paul@t...]
Date: Thu Feb 22, 2001 4:26 am
Subject: RightClick also autoexpands

If I have RightClickSelect and AutoExpand option enabled, then right clicking a
node will select AND autoexpand. Is there a way to prevent autoexpanding when I
right click? I just want to select the node, so that a popup menu will appear
that references the node.

Paul

[Non-text portions of this message have been removed]

 | Replies | Author | Date
613 | Re: RightClick also autoexpands | Mike Lischke | Thu 2/22/2001


re: Virtual Treeview and Screen.Cursor:= crHour Glass;

From: Mike Lischke [public@l...]
Date: Thu Feb 22, 2001 8:41 am
Subject: RE: [VirtualTreeview] Virtual Treeview and Screen.Cursor:= crHour Glass;

Hi Robert,

> I have run into a problem. I import data to my Virtual
> Treeview by redirecting stdout from a DOS program. This can
> take a while and I therefor set the cursor to a hourglass
> during the operation. This was working great with the
> standard listview that I was using before but I noticed that
> the cursor was reset by the Virtual Treeview right at the
> beginning of the redirection!?!

Mmmh, VT is very careful in setting the cursor, but it modifies it depending
on the place where the mouse is moved to. Try setting Tree.Cursor :=
crHourGlass instead of Screen.Cursor := crHourGlass. This change will set
the control's cursor and this is used for normal display (i.e. when the
mouse is in the client area).

Ciao, Mike


re: RightClick also autoexpands

From: Mike Lischke [public@l...]
Date: Thu Feb 22, 2001 8:42 am
Subject: RE: [VirtualTreeview] RightClick also autoexpands

Hi Paul,

> If I have RightClickSelect and AutoExpand option enabled,
> then right clicking a node will select AND autoexpand. Is
> there a way to prevent autoexpanding when I right click? I
> just want to select the node, so that a popup menu will
> appear that references the node.

Try OnExpanding and check for tsRightButtonDown in Tree.States to prevent
expanding.

Ciao, Mike


IterateSubTree in reverse order ?

From: Bender Heri [HBender@E...]
Date: Thu Feb 22, 2001 1:51 pm
Subject: IterateSubTree in reverse order ?

Hello all

My tree data are DB based. When deleting a node which has children I must
delete all subnodes too from the DB.

The problem is that the callback of the method IterateSubTree starts with
the top node. This one I cannot delete from the DB because there are still
children in the DB which hold a reference to this node.

Mike, do you see any chance to have a Iterate method in reverse order
(beginning with the leaves of the tree)?

Heri

 | Replies | Author | Date
615 | Re: IterateSubTree in reverse order ? | Mike Lischke | Thu 2/22/2001
616 | Re: IterateSubTree in reverse order ? | Bender Heri | Thu 2/22/2001
617 | Re: IterateSubTree in reverse order ? | Mike Lischke | Thu 2/22/2001
623 | Re: IterateSubTree in reverse order ? | Werner Lehmann | Fri 2/23/2001
628 | Re: IterateSubTree in reverse order ? | Bender Heri | Fri 2/23/2001


re: IterateSubTree in reverse order ?

From: Mike Lischke [public@l...]
Date: Thu Feb 22, 2001 2:28 pm
Subject: RE: [VirtualTreeview] IterateSubTree in reverse order ?

Hi Heri,

> My tree data are DB based. When deleting a node which has
> children I must delete all subnodes too from the DB.
>
> The problem is that the callback of the method IterateSubTree
> starts with the top node. This one I cannot delete from the DB because
> there are still children in the DB which hold a reference to this node.

In the first paragraph you stated that you have to delete all children of a
node if a node must be deleted, but in the second you said you don't one to
delete the top node. What is now true ;-) ?

> Mike, do you see any chance to have a Iterate method in reverse order
> (beginning with the leaves of the tree)?

Actually, this is still an open issue. There is definetly a need to make
inclusion of the passed node for IterateSubtree in the callback loop
optional. Be also careful when using filters. The stop node for the
iteration is not tested currently to conform to the filter so it could
happen that it is skipped later in the loop and the iteration is no stopped
correctly. I will rework this next weekend.

Starting the iteration with the last node is IMO not a good idea because it
will break the expectation that you always go from top to bottom.
Additonally it will likely make the code slower because, for instance, when
you delete a node and its children in IterateSubtree then the child nodes
will not be enumerated (since you have deleted them) and the iteration is
quicker. Going backwards through the tree is also slightly slower depending
on the maximum nesting level. From a structural view I don't like to go
backwards because usually a parent is responsible for its children and is
often more effective to manage certain aspects as would each child node have
to manage it on its own. In the worst case you might be doing same things
several times, e.g. first for a grand child node (and its child nodes), then
for its parent and the node again, then for the parent of the parent and its
child nodes again etc. I think you get the picture.

Of course you always have the way to write a small iteration method on your
own. For special cases it can be held very simple and done using only a
couple of lines.

Ciao, Mike


re: IterateSubTree in reverse order ?

From: Bender Heri [HBender@E...]
Date: Thu Feb 22, 2001 2:48 pm
Subject: RE: [VirtualTreeview] IterateSubTree in reverse order ?

> From: Mike Lischke [mailto:[public@l...]]
>
>
> Hi Heri,
>
> > My tree data are DB based. When deleting a node which has
> > children I must delete all subnodes too from the DB.
> >
> > The problem is that the callback of the method IterateSubTree
> > starts with the top node. This one I cannot delete from the
> DB because
> > there are still children in the DB which hold a reference
> to this node.
>
> In the first paragraph you stated that you have to delete all
> children of a
> node if a node must be deleted, but in the second you said
> you don't one to
> delete the top node. What is now true ;-) ?
>

Both is true. The problem is the right order. In the DB I first have to
delete the children before I can delete the parent (referential integrity).
Therefore I cannot use the IterateSubTree method for deleting nodes.

> > Mike, do you see any chance to have a Iterate method in
> reverse order
> > (beginning with the leaves of the tree)?
>
> Actually, this is still an open issue. There is definetly a
> need to make
> inclusion of the passed node for IterateSubtree in the callback loop
> optional. Be also careful when using filters. The stop node for the
> iteration is not tested currently to conform to the filter so it could
> happen that it is skipped later in the loop and the iteration
> is no stopped
> correctly. I will rework this next weekend.
>
> Starting the iteration with the last node is IMO not a good
> idea because it
> will break the expectation that you always go from top to bottom.
> Additonally it will likely make the code slower because, for
> instance, when
> you delete a node and its children in IterateSubtree then the
> child nodes
> will not be enumerated (since you have deleted them) and the
> iteration is
> quicker. Going backwards through the tree is also slightly
> slower depending
> on the maximum nesting level. From a structural view I don't
> like to go
> backwards because usually a parent is responsible for its
> children and is
> often more effective to manage certain aspects as would each
> child node have
> to manage it on its own. In the worst case you might be doing
> same things
> several times, e.g. first for a grand child node (and its
> child nodes), then
> for its parent and the node again, then for the parent of the
> parent and its
> child nodes again etc. I think you get the picture.
>
> Of course you always have the way to write a small iteration
> method on your
> own. For special cases it can be held very simple and done
> using only a
> couple of lines.
>

OK, no problem. I do it myself.

Heri


re: IterateSubTree in reverse order ?

From: Mike Lischke [public@l...]
Date: Thu Feb 22, 2001 2:55 pm
Subject: RE: [VirtualTreeview] IterateSubTree in reverse order ?

> Both is true. The problem is the right order. In the DB I
> first have to
> delete the children before I can delete the parent
> (referential integrity).
> Therefore I cannot use the IterateSubTree method for deleting nodes.

That is what I meant with the parent being responsible for its children. You
could in the callback function check what type of node you have. Depending
on the outcome you can delete the child nodes with another IterateSubtree
call (nothing prevents you from recursively calling IterateSubtree). After
your data is made consistent you can delete the child nodes and return from
the callback probably continuing with the next sibling of the node you just
have worked on.

Ciao, Mike


Help

From: "Luis A. Hereira Aguilera" [luison@u...]
Date: Thu Feb 22, 2001 3:40 pm
Subject: Help

Hello Mike
I need to know if there is any work already done about the conection of
the Virtual Tree to a data base. I know the IBO work but I would like to
know if there is any other.
In the example you gave me, if the focus is in the combo box ,when you lose
the focus, the kill focus event is shot but must of the time it does not get
the control( e.g if I'm in the combo box and clik another control, the
kill focus event does not get the combo.

Regards, Luison

 | Replies | Author | Date
619 | Re: Help | Mike Lischke | Thu 2/22/2001


re: Help

From: Mike Lischke [public@l...]
Date: Thu Feb 22, 2001 3:46 pm
Subject: RE: [VirtualTreeview] Help

Hi Luis,

> I need to know if there is any work already done about the
> conection of the Virtual Tree to a data base. I know the IBO work but I
> would like to know if there is any other.

Not that I know of anything other. Sometimes it is mentioned here on in
private mail that somebody is working on a database aware solution but this
is usually nothing which can be used generally. The best approach so far is
the IBO treeview.

> In the example you gave me, if the focus is in the combo box
> ,when you lose the focus, the kill focus event is shot but must of the
time
> it does not get the control( e.g if I'm in the combo box and clik
another
> control, the kill focus event does not get the combo.

Sorry, I cannot remember which example this was. What combobox do you mean?

Ciao, Mike


TreeNT to VT?

From: [luc.bosman@v...]
Date: Thu Feb 22, 2001 5:36 pm
Subject: TreeNT to VT?

This maybe a typical beginner's VT question, but is there an easy way
to 'convert' a TreeNT to VT?

Luc.

 | Replies | Author | Date
621 | Re: TreeNT to VT? | Mike Lischke | Thu 2/22/2001


re: TreeNT to VT?

From: "Mike Lischke" [public@l...]
Date: Thu Feb 22, 2001 9:02 pm
Subject: RE: [VirtualTreeview] TreeNT to VT?

Hi Luc,

> This maybe a typical beginner's VT question, but is there an easy way
> to 'convert' a TreeNT to VT?

Unfortunately there is no easy migration path from TreeNT to VT (or from any
other Treeview controls
for that matter). There are some compatibility methods which ease porting, but
generally you have to
change some aspects of your programs (depending on their current structure).
But with the help of
the demo programs and this mailing list it should not become a task for several
weeks :o]

Ciao, Mike


re: Q: Header sort arrows

From: [adembaba@e...]
Date: Fri Feb 23, 2001 12:33 am
Subject: Re: Q: Header sort arrows

Good arguements?...
A tough one to ask --it is after all a matter of taste as
you say. Yet, I'll take a shot:

Since the glyph itself is independent of the header text,
by that I mean, its size etc does not vary with that of the
header text, there are cases where it would look funny when
it insists to be adjacent to the text. In these cases it
would look nicer if it were left justified.

There are cases when the header is long and partially visible,
in these cases it would be more convenient if the glyph
were visible by setting it right justified.

--- In [VirtualTreeview@y...], Mike Lischke [public@l...] wrote:
> > My question is: Is it possible to Left/RightJustfiy
> > the glyph only; i.e. independent of the column header's
> > text I would like to see the glyph at either end of
> > the column.
>
> Mmm, a matter of taste. In Explorer the glyphs follow directly the
caption.
> And since this is an inherent feature of the underlying listview
control
> which is used in many programs I vote for using this style too. If
you have
> good arguments, however, to change it to "your" way then let me
know and I
> will rethink the design.
>
> Ciao, Mike


re: IterateSubTree in reverse order ?

From: Werner Lehmann [wl@b...]
Date: Thu Feb 22, 2001 3:55 pm
Subject: Re: [VirtualTreeview] IterateSubTree in reverse order ?

Bender Heri wrote:
>
> Both is true. The problem is the right order. In the DB I first have to
> delete the children before I can delete the parent (referential integrity).
> Therefore I cannot use the IterateSubTree method for deleting nodes.

This sounds very much like you should use the cascading delete feature
of referential constraints. The DB will take care of deleting the child
records for you.

Regards,
WL


OnHeaderClick

From: Werner Lehmann [wl@b...]
Date: Thu Feb 22, 2001 11:12 pm
Subject: OnHeaderClick

Hi,

Minor issue: The OnHeaderClick event has a TBaseVirtualTree as
Sender. But this class does not publish the Header property so
that the Sender parameter of the event must be casted or is use-
less.

Maybe change the sender to TVirtualStringTree? Or (as with one
event before) include the Header in the event signature?

Regards,
WL

 | Replies | Author | Date
627 | Re: OnHeaderClick | Mike Lischke | Fri 2/23/2001
629 | Dropdown | Geoffrey Pan | Fri 2/23/2001


Off-topic --XMLDataset (available now)

From: [adembaba@e...]
Date: Fri Feb 23, 2001 1:36 am
Subject: Off-topic --XMLDataset (available now)

Hi All,

This might be somewhat off-topic here, but,
I belive there are members that might need
the functionality.

If you wish to save/load/send/receive in XML
format; you might like to try XMLDataset,
available below:

http://groups.yahoo.com/group/xmldataset


re: Re: Q: Header sort arrows

From: Mike Lischke [public@l...]
Date: Fri Feb 23, 2001 8:43 am
Subject: RE: [VirtualTreeview] Re: Q: Header sort arrows

> Since the glyph itself is independent of the header text,
> by that I mean, its size etc does not vary with that of the
> header text, there are cases where it would look funny when
> it insists to be adjacent to the text. In these cases it
> would look nicer if it were left justified.
>
> There are cases when the header is long and partially visible,
> in these cases it would be more convenient if the glyph
> were visible by setting it right justified.

But usually the user will scroll so that he can see the header caption. When
the column is wide enough, however, then the sort glyph will likely go out
of view if it is aligned to one side.

If you can give me a acceptable concept of how to make this alignment
optional then I will consider implementing it. Think, however, about the
things already there which make life already hard:

- column alignment
- column bidi mode
- column button layout
- margin and
- spacing

This is already complex enough to describe how to display the column caption
I think. Except the bidi mode maybe we can throw out some properties and
make it more elegant by another implementation.

Ciao, Mike

 | Replies | Author | Date
633 | Re: Q: Header sort arrows | [adembaba@e...] | Mon 2/26/2001


re: OnHeaderClick

From: Mike Lischke [public@l...]
Date: Fri Feb 23, 2001 8:44 am
Subject: RE: [VirtualTreeview] OnHeaderClick

> Minor issue: The OnHeaderClick event has a TBaseVirtualTree as
> Sender. But this class does not publish the Header property so
> that the Sender parameter of the event must be casted or is use-
> less.
>
> Maybe change the sender to TVirtualStringTree? Or (as with one
> event before) include the Header in the event signature?

Good point, Werner. I think all events related to the header should get the
header as sender from which one can easily go to the owning treeview. I will
change this today.

Ciao, Mike

 | Replies | Author | Date
629 | Dropdown | Geoffrey Pan | Fri 2/23/2001


re: IterateSubTree in reverse order ?

From: Bender Heri [HBender@E...]
Date: Fri Feb 23, 2001 2:24 pm
Subject: RE: [VirtualTreeview] IterateSubTree in reverse order ?

> -----Original Message-----
> From: Werner Lehmann [mailto:[wl@b...]]
>
> Bender Heri wrote:
> >
> > Both is true. The problem is the right order. In the DB I
> first have to
> > delete the children before I can delete the parent
> (referential integrity).
> > Therefore I cannot use the IterateSubTree method for deleting nodes.
>
> This sounds very much like you should use the cascading delete feature
> of referential constraints. The DB will take care of deleting
> the child
> records for you.
>
Yes, with normal DB access I would have chosen this way. But unfortunatly I
access the DB through a very simple COM interface without cascading deleting
features.

I solved the problem with Mike's suggestion to call IterateSubtree recursiv.

Thanks!

Heri


Dropdown

From: "Geoffrey Pan" [gpan@c...]
Date: Fri Feb 23, 2001 5:23 pm
Subject: Dropdown

Anyone have any pointers as to converting VT into using a drop down instead
of a list?.


Problem with DeleteNode

From: Werner Lehmann [wl@b...]
Date: Sun Feb 25, 2001 7:55 pm
Subject: Problem with DeleteNode

Mike, here is another problem that I cannot figure out. But it may
be related to your new visibility (of nodes) code.

It surfaces if I shut down my app and data structures are freed. This
is a recursive process which usually executes just fine (cascaded
.Clear methods with a DeleteNode in Destroy, if no child items are
left).

Under certain circumstances I get the following problem:

DeleteNode(non nil node here, which is the same node as GetFirstNode returns,
it is the first root node);

>From there eventually InvalidateToBottom(Node) is called (Node still
not nil), which comes to this code fragment:

CurrentNode := GetNodeAt(0, 0);
if CompareNodePositions(Node, CurrentNode) < 0 then

GetNodeAt returns nil and an assertion in CompareNodePositions is violated.
In GetNodeAt this code executes:

if Result = nil then
Result := GetFirstVisibleNoInit;

Result is nil thus GetFirstVisibleNoInit is executed. Which returns
exactly the same node which I had passed to DeleteNode in the first
place. In your comment at this method you write

function TBaseVirtualTree.GetFirstVisibleNoInit: PVirtualNode;

// Returns the first visible node in the tree. No initialization is performed.

Well. The tree in question is scrolled half way down. The first root node
is not visible on screen. But it is visible in the tree as it is a root node
which cannot be hidden. Don't know which notion of visibility you use here.

Anyhow, in the while loop after the last fragment that I cited the result
is set to nil eventually and the problem comes in CompareNodePositions.
Any idea what went wrong here? If you need any variable values please let
me know. If you don't have an idea or this is simply too confusing or time
consuming, pleae say so.

Regards,
Werner

PS: I am using v2.1

 | Replies | Author | Date
640 | Re: Problem with DeleteNode | Werner Lehmann | Wed 2/28/2001
643 | Re: Problem with DeleteNode | Werner Lehmann | Thu 3/1/2001
644 | Re: Problem with DeleteNode | Mike Lischke | Thu 3/1/2001
649 | Re: Problem with DeleteNode | Mike Lischke | Sat 3/3/2001
663 | Re: Problem with DeleteNode | Werner Lehmann | Sat 3/3/2001


Problem with GetHitTestInfoAt

From: Werner Lehmann [wl@b...]
Date: Sun Feb 25, 2001 7:36 pm
Subject: Problem with GetHitTestInfoAt

Hi,

Mike, I am having the following problem. It is a little bit hard to
debug and hopefully you or someone else have/has a hint for me.

I am adding a new child node to an already expanded node (AddChild).
While this works ok and also the node text is displayed correctly
(OnGetText), it cannot always be selected by mouse click afterwards.

(This is not a problem with keyboard up/down arrows.)

I found out that somehow the VTree thinks that the width of the node
is still the width of the DefaultText. If I click more than 33 pixels
right of the left node border the click will not focus the node, if
I click within these 33 pixels the node is focused. If I change the
DefaultText to 'x' I need to click further to the left (x is not so
long as 'Node' is).

It appears that WMLButtonDown calls GetHitTestInfoAt and it reports
a position of hiOnItemRight because in TCustomVirtualStringTree.DoGetNodeWidth
the expression PInteger(@Node.Data)^ returns 33 (0 would mean to ask
for the text which it does not so). 33 is probably the width of 'Node'.

Unfortunately the code is hard to isolate. So if you have an idea, at
least for a workaround, please tell me (I hesitate to set the 0 manually
at PInteger(@Node.Data)^ and would not even know exactly when to do this).

Regards,
Werner

 | Replies | Author | Date
637 | Re: Problem with GetHitTestInfoAt | Werner Lehmann | Mon 2/26/2001
650 | Re: Problem with GetHitTestInfoAt | Mike Lischke | Sat 3/3/2001
655 | Re: Problem with GetHitTestInfoAt | Mike Lischke | Sat 3/3/2001
659 | Re: Problem with GetHitTestInfoAt | Werner Lehmann | Sat 3/3/2001
665 | Re: Problem with GetHitTestInfoAt | Mike Lischke | Sat 3/3/2001
670 | Re: Problem with GetHitTestInfoAt | Werner Lehmann | Sat 3/3/2001
672 | Re: Problem with GetHitTestInfoAt | Mike Lischke | Sat 3/3/2001
676 | Re: Problem with GetHitTestInfoAt | [adembaba@e...] | Sun 3/4/2001
673 | Re: Problem with GetHitTestInfoAt | Werner Lehmann | Sat 3/3/2001


When does the selection change?

From: Werner Lehmann [wl@b...]
Date: Sun Feb 25, 2001 10:24 pm
Subject: When does the selection change?

Hi,

is there any chance to know when the selection changes? I believe
that OnChange is triggered then but probably OnChange is also triggered
with a myriad of other changes.

If this is true and there is no other event can I have a dedicated
event? TListview has an OnChange with a State param, which can be
ctState (this is affected by selection changes). It has also an
event OnSelectItem which is even better:

type
TLVSelectItemEvent = procedure(Sender: TObject; Item: TListItem;
Selected: Boolean) of object;

Regards,
Werner

 | Replies | Author | Date
651 | Re: When does the selection change? | Mike Lischke | Sat 3/3/2001
658 | Re: When does the selection change? | Werner Lehmann | Sat 3/3/2001


re: Q: Header sort arrows

From: [adembaba@e...]
Date: Mon Feb 26, 2001 2:59 am
Subject: Re: Q: Header sort arrows

Perhaps the column header should have been an object in its
own right to be able to handle the complexity, but it seems
to late to to ask for it now.

Cheers,

--- In [VirtualTreeview@y...], Mike Lischke [public@l...] wrote:
> > Since the glyph itself is independent of the header text,
> > by that I mean, its size etc does not vary with that of the
> > header text, there are cases where it would look funny when
> > it insists to be adjacent to the text. In these cases it
> > would look nicer if it were left justified.
> >
> > There are cases when the header is long and partially visible,
> > in these cases it would be more convenient if the glyph
> > were visible by setting it right justified.
>
> But usually the user will scroll so that he can see the header
caption. When
> the column is wide enough, however, then the sort glyph will likely
go out
> of view if it is aligned to one side.
>
> If you can give me a acceptable concept of how to make this
alignment
> optional then I will consider implementing it. Think, however,
about the
> things already there which make life already hard:
>
> - column alignment
> - column bidi mode
> - column button layout
> - margin and
> - spacing
>
> This is already complex enough to describe how to display the
column caption
> I think. Except the bidi mode maybe we can throw out some
properties and
> make it more elegant by another implementation.
>
> Ciao, Mike


IB_VTree

From: "Paul Gallagher" [paul@t...]
Date: Mon Feb 26, 2001 6:25 am
Subject: IB_VTree

This component is basically done, except for the 2 year phase of bug fixes and
enhancements. The dataset and the Tree, more or less communicate with each
other, and it supports drag and drop. The column functionality is not 100% done
yet. If anyone is interested, I will send the files. I tried uploading to the
Yahoo group, but it seems to be down. And I kept it under 500 lines of code.<g>

Paul Gallagher

[Non-text portions of this message have been removed]


THitPosition

From: Bender Heri [HBender@E...]
Date: Mon Feb 26, 2001 1:26 pm
Subject: THitPosition

Hello Mike

could you please declare the THitPosition items as normal enumeration (maybe
rename the set into THitPositions).

So I can define subsets of it.

Thanks!

Heri

 | Replies | Author | Date
654 | Re: THitPosition | Mike Lischke | Sat 3/3/2001


New file uploaded to VirtualTreeview

From: [VirtualTreeview@yahoogroups.com>
Date: Mon Feb 26, 2001 5:00 pm
Subject: New file uploaded to VirtualTreeview

Hello,

This email message is a notification to let you know that
a file has been uploaded to the Files area of the VirtualTreeview
group.

File : /IB_VTree226.zip
Uploaded by : [paul@t...]
Description : Port of Virtual Tree to IBO

You can access this file at the URL

http://groups.yahoo.com/group/VirtualTreeview/files/IB_VTree226.zip

To learn more about file sharing for your group, please visit

http://help.yahoo.com/help/us/groups/files

Regards,

paul@t...]


re: Problem with GetHitTestInfoAt

From: Werner Lehmann [wl@b...]
Date: Mon Feb 26, 2001 8:33 pm
Subject: Re: [VirtualTreeview] Problem with GetHitTestInfoAt

I am having the same problem again at another place in my program.
This code is isolated; it is only an options dialog. And it does
not seem to be related to the DefaultText this time.

Symptoms are like this: I add two nodes. Both nodes show up with
correct text and icons. But they cannot be focused (with left mouse
click). Until I found that a click on the icon or the first letter
of the text *can* focus the node. If this happened once the node can
be focused with a click anywhere on the node label.

I am showing you the simple code that deals with the VTree in my
dialog. Maybe you notice something dumb on my side :)

Regards,
Werner

type
TFolderKind = (fkTopLevel, fkInclude, fkExclude);

PFolderInfo = ^TFolderInfo;
TFolderInfo = record
Name: string;
Kind: TFolderKind;
IconIndex: integer;
end;

procedure TOptions.FormCreate(Sender: TObject);
var
Node: PVirtualNode;
Info: PFolderInfo;
begin
FolderIconIndex := GetFolderIconIndex;

vtFolders.NodeDataSize := sizeof(TFolderInfo);

Node := vtFolders.AddChild(nil);
Info := vtFolders.GetNodeData(Node);
Info.Name := 'Incoming Folders';
Info.Kind := fkTopLevel;

Node := vtFolders.AddChild(nil);
Info := vtFolders.GetNodeData(Node);
Info.Name := 'Base Folders';
Info.Kind := fkTopLevel;
end;

procedure TOptions.vtFoldersFreeNode(Sender: TBaseVirtualTree;
Node: PVirtualNode);
var
Info: PFolderInfo;
begin
Info := Sender.GetNodeData(Node);
Finalize(Info^);
end;

procedure TOptions.vtFoldersPaintText(Sender: TBaseVirtualTree;
const Canvas: TCanvas; Node: PVirtualNode; Column: Integer;
TextType: TVSTTextType);
begin
if (Node.Parent = Sender.RootNode) then
Canvas.Font.Style := [fsBold];
end;

procedure TOptions.vtFoldersGetText(Sender: TBaseVirtualTree;
Node: PVirtualNode; Column: Integer; TextType: TVSTTextType;
var Text: WideString);
var
Info: PFolderInfo;
begin
Info := Sender.GetNodeData(Node);
Text := Info.Name;
end;

procedure TOptions.vtFoldersGetImageIndex(Sender: TBaseVirtualTree;
Node: PVirtualNode; Kind: TVTImageKind; Column: Integer;
var Index: Integer);
begin
if (Node.Parent = Sender.RootNode) then
Index := FolderIconIndex;
end;

procedure TOptions.vtFoldersMouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
var
HitInfo: THitInfo;
begin
if (Button <> mbRight) then
exit;

vtFolders.GetHitTestInfoAt(x, y, HitInfo);
if not (hiOnItem in HitInfo.HitPosition) then
exit;

with vtFolders.ClientToScreen(Point(x, y)) do
pmFolders.Popup(x, y);
end;


Overlay images

From: Werner Lehmann [wl@b...]
Date: Mon Feb 26, 2001 9:46 pm
Subject: Overlay images

Hi,

this is the 5th posting with a question, almost in a row only from
me. Sorry if I am bugging :)

It is about overlay images now. I need to display icons from the
system imagelist with optionally an overlay index.

Two problems: it appears that the overlay image comes from the same
list as the ikNormal imageindex. But I should not add my own overlay
image to the global system imagelist. Do I have to copy all icons that
are needed to a private imagelist?

Second, how is ikOverlay supposed to work? I am under the impression
that you (Mike) draw overlay images the same way you draw ikNormal
images. For instance if I test with the 'shared open hand' image which
always seems to have index 0 in the system imagelist, I don't see an
overlay but the image replaces the original ikNormal image.

I do not know very much about imagelists but TImageList at least handles
overlays special. Images need to be 'marked' as overlay, internally
mapped to ImageList_SetOverlayImage, and they are drawn with flag
ILD_OVERLAYMASK, not ILD_FOCUS as you do.

procedure TCustomImageList.DrawOverlay(Canvas: TCanvas; X, Y: Integer;
ImageIndex: Integer; Overlay: TOverlay; Enabled: Boolean);
function TCustomImageList.Overlay(ImageIndex: Integer; Overlay: TOverlay):
Boolean;

What's the deal?

Regards,
Werner

PS: I experimented a little bit and got the overlay (open hand) to work
as following:

procedure TBaseVirtualTree.Paint;
...
// paint eventual overlay image
Image := DoGetImageIndex(Node, ikOverlay, Column);
if Image > -1 then
// FImages.Draw(FOffScreenBitmap.Canvas, TextR.Left,
TextR.Top + ImageVOffset, Image,
// not (vsDisabled in Node.States) and
Enabled);
FImages.DrawOverlay(FOffScreenBitmap.Canvas,
TextR.Left, TextR.Top + ImageVOffset, 3,
0, not (vsDisabled in Node.States) and
Enabled);

ImageIndexes are hardcoded here of course. 3 is the closed folder icon, 0
the share-hand. This worked even if I did not mark image 0 as an overlay,
i.e. the following line in FormCreate did not matter:

vtFolders.Images.Overlay(0, 0);

 | Replies | Author | Date
657 | Re: Overlay images | Mike Lischke | Sat 3/3/2001
662 | Re: Overlay images | Werner Lehmann | Sat 3/3/2001
667 | Re: Overlay images | Mike Lischke | Sat 3/3/2001


Creating a component decended from TVirtualStringTree

From: "Colin Meeks" [colin@p...]
Date: Tue Feb 27, 2001 8:57 pm
Subject: Creating a component decended from TVirtualStringTree

I'm trying to create a component descended from TVirtualStringTree that will
function like a FileListBox. I'm using TVirtualStringTree because it's
exceedingly quick and with over 2000 files in some directories, a
TFileListBox kust doesn;t hack it. Anyway I descend my TVTFileList
component from TVirtualStringTree using

constructor TVTFileBox.Create(AOwner: TComponent);
var
SysIl: HIMAGELIST;
SFI: TSHFileInfo;
begin
inherited create(Aowner);

height:=369;
width:=521;

Images:=TImageList.Create(Self);
SysIL:=ShGetFileInfo('',0,SFI,SizeOf(SFI),SHGFI_SYSICONINDEX or
SHGFI_SmallICON);
if SysIL<>0 then
begin
images.handle:=SysIl;
images.shareimages:=true;
end;
end;

However when I drop the resultant component on the form it gives me an error
of cannot find parent control. I have to admit I'm not really that
experience with component creation so any useful pointers would be much
appreciated.

I also have some code I want to execute in the OnGetText and
OnGetImageIndex. I will not be calling these routines directly. They will
be called as a result of my PopulateVTFileList function. Does anybody know
a simple way I can incorporate these in my component.

I realise this is a little out of scope, but it is relavant to the VT
component. I'm sure others would also like to do similar things. I'll post
the completed component once it's finished.

Regards

Colin


re: Problem with DeleteNode

From: Werner Lehmann [wl@b...]
Date: Wed Feb 28, 2001 12:16 am
Subject: Re: [VirtualTreeview] Problem with DeleteNode

I have done quite some experimenting. While I still don't know exactly
what the problem is it seems to be VTree related. See below:

Werner Lehmann wrote:
>
> Well. The tree in question is scrolled half way down. The first root node

This is the key sentence. My application basically displays a folder hierarchy
in this VTree. The assertion violation occurs exactly when the very first node
is deleted (as I said in my previous mail about this) and the tree is scrolled
down so that this first node is not visible on screen.

If I scroll the tree up so that the first node is visible again no exception
pops up.

Regards,
Werner


re: Creating a component decended from TVirtualStringTree

From: Werner Lehmann [wl@b...]
Date: Wed Feb 28, 2001 12:22 am
Subject: Re: [VirtualTreeview] Creating a component decended from TVirtualStringTree

Colin,

this has been a problem with pre-v2.0 Versions of the VTree. Some property
setter methods did not check if a valid handle was available. If you do not
already use the beta version from the mailing list file space, download it
and try that.

If you already use that version you must try and track down exactly which
line causes the parent-error. And protect the respective setter method with
a statement like

if (not HandleAllocated) then
exit;

Colin Meeks wrote:
>
> I also have some code I want to execute in the OnGetText and
> OnGetImageIndex. I will not be calling these routines directly. They will
> be called as a result of my PopulateVTFileList function. Does anybody know
> a simple way I can incorporate these in my component.

Override the protected methods DoGetImageIndex and DoGetText. Do not forget
to call inherited or the event handlers will not be active. Or do not call
inherited and do not publish these event properties.

Regards,
Werner

 | Replies | Author | Date
645 | Re: Creating a component decended from TVirtualS | Colin Meeks | Thu 3/1/2001
647 | Multiline Hint text | Geoffrey Pan | Thu 3/1/2001
660 | Re: Creating a component decended from TVirtualS | Mike Lischke | Sat 3/3/2001
698 | Re: Creating a component decended from TVirtualS | Colin Meeks | Wed 3/7/2001


re: Creating a component decended from TVirtual StringTree

From: "Almeida, Alain B" [abalmeida@k...]
Date: Wed Feb 28, 2001 4:32 pm
Subject: RE: [VirtualTreeview] Creating a component decended from TVirtual StringTree

Colin try to create TImageList instance in SetParent method and your code to
set the size of control (height and width), redefine it and put your
constructor code (except inherit create) at this place like this

procedure TVTFileBox.SetParent( aParent : TWinControl );
begin
inherited SetParent( aParent );

height:=369;
width:=521;

Images:=TImageList.Create(Self);
SysIL:=ShGetFileInfo('',0,SFI,SizeOf(SFI),SHGFI_SYSICONINDEX or
SHGFI_SmallICON);
if SysIL<>0 then
begin
images.handle:=SysIl;
images.shareimages:=true;
end;

end

if your control havent parent assigned cannot set the size

bye

-----Original Message-----
From: Colin Meeks [mailto:[colin@p...]]
Sent: Tuesday, February 27, 2001 12:57 PM
To: VirtualTreeview@yahoogroups.com
Subject: [VirtualTreeview] Creating a component decended from
TVirtualStringTree

I'm trying to create a component descended from TVirtualStringTree that will
function like a FileListBox. I'm using TVirtualStringTree because it's
exceedingly quick and with over 2000 files in some directories, a
TFileListBox kust doesn;t hack it. Anyway I descend my TVTFileList
component from TVirtualStringTree using

constructor TVTFileBox.Create(AOwner: TComponent);
var
SysIl: HIMAGELIST;
SFI: TSHFileInfo;
begin
inherited create(Aowner);

height:=369;
width:=521;

Images:=TImageList.Create(Self);
SysIL:=ShGetFileInfo('',0,SFI,SizeOf(SFI),SHGFI_SYSICONINDEX or
SHGFI_SmallICON);
if SysIL<>0 then
begin
images.handle:=SysIl;
images.shareimages:=true;
end;
end;

However when I drop the resultant component on the form it gives me an error
of cannot find parent control. I have to admit I'm not really that
experience with component creation so any useful pointers would be much
appreciated.

I also have some code I want to execute in the OnGetText and
OnGetImageIndex. I will not be calling these routines directly. They will
be called as a result of my PopulateVTFileList function. Does anybody know
a simple way I can incorporate these in my component.

I realise this is a little out of scope, but it is relavant to the VT
component. I'm sure others would also like to do similar things. I'll post
the completed component once it's finished.

Regards

Colin

To unsubscribe from this group, send an email to:
VirtualTreeview-unsubscribe@egroups.com

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/

********************************************************************************
The information in this email is confidential and may be legally privileged.
It is intended solely for the addressee. Access to this email by anyone else
is unauthorized.

If you are not the intended recipient, any disclosure, copying, distribution
or any action taken or omitted to be taken in reliance on it, is prohibited
and may be unlawfull. When addressed to our clients any opinions or advice
contained in this email are subject to the term and conditions expressed in
the governing KPMG client engagement letter.
********************************************************************************

 | Replies | Author | Date
646 | Re: Creating a component decended from TVirtual S | Colin Meeks | Thu 3/1/2001
648 | Re: Creating a component decended from TVirtual S | Colin Meeks | Fri 3/2/2001


re: Problem with DeleteNode

From: Werner Lehmann [wl@b...]
Date: Wed Feb 28, 2001 11:09 pm
Subject: Re: [VirtualTreeview] Problem with DeleteNode

Still talking to myself. Anyway if someone cares: (*g*)

Werner Lehmann wrote:
>
> in this VTree. The assertion violation occurs exactly when the very first node
> is deleted (as I said in my previous mail about this) and the tree is scrolled
> down so that this first node is not visible on screen.
>
> If I scroll the tree up so that the first node is visible again no exception
> pops up.

Still an issue. But I worked around it:

with VTree do
if (RootNodeCount > 0) then
ScrollIntoView(GetFirstNode);

The assertion violation which was reproducible before does not occur now
anymore.

Regards,
Werner


re: Problem with DeleteNode

From: Mike Lischke [public@l...]
Date: Thu Mar 1, 2001 12:24 pm
Subject: RE: [VirtualTreeview] Problem with DeleteNode

Hi Werner (and everybody else),

> Still talking to myself. Anyway if someone cares: (*g*)

I'm currently busy with some other stuff but will come back to every
question posted in the passed week. Please keep patience.

Cioa, Mike


re: Creating a component decended from TVirtualStringTree

From: "Colin Meeks" [colin@p...]
Date: Thu Mar 1, 2001 3:40 pm
Subject: Re: [VirtualTreeview] Creating a component decended from TVirtualStringTree

Werner

> this has been a problem with pre-v2.0 Versions of the VTree. Some property
> setter methods did not check if a valid handle was available. If you do
not
> already use the beta version from the mailing list file space, download it
> and try that.
I've downloaded the latest beta but it won't install. I'm using Delphi 4
and it looks like
the beta version is only for Delphi 5, is this correct?

Colin

 | Replies | Author | Date
647 | Multiline Hint text | Geoffrey Pan | Thu 3/1/2001


re: Creating a component decended from TVirtual StringTree

From: "Colin Meeks" [colin@p...]
Date: Thu Mar 1, 2001 4:57 pm
Subject: Re: [VirtualTreeview] Creating a component decended from TVirtual StringTree

Hi Alain

> Colin try to create TImageList instance in SetParent method and your code
to
> set the size of control (height and width), redefine it and put your
> constructor code (except inherit create) at this place like this
I've done as you suggested and the component now get's created and looks
just as I specify. The only problem I have now is that whenever I delete
the component I get an Access Violation. The code I am using to destroy the
component is

Interface:-
destructor TVTFileBox.Destroy; override;

Implementation:-

destructor TVTFileBox.Destroy;
begin
usefilelist.free;
useextlist.free;
inherited;
end;

The two stringlists are created in the Create constructor. Am I doing
something wrong.

Many thanks for your help.

Regards

Colin


Multiline Hint text

From: "Geoffrey Pan" [gpan@c...]
Date: Thu Mar 1, 2001 10:29 pm
Subject: Multiline Hint text

Mike,

This sort of is related to another discussion we had on ExTextOutW, any
chance for any examples on how to implement this in VB, support for #10 in
hint text. Currently the hint is passed directly to ExTextOutW, which
doesn't handle it (as expected).

Thanks in advance.


re: Creating a component decended from TVirtual StringTree

From: "Colin Meeks" [colin@p...]
Date: Fri Mar 2, 2001 7:08 pm
Subject: Re: Creating a component decended from TVirtual StringTree

Thanks to Alain, Werner and Danil, I can now create my component and delete
it from the form without generating an error. The last thing I need to do
is override the DoGetText and DoGetImageIndex procedures. Basically I want
to call my PopulateVT procedure which adds the the nodes (by adding a node
for each file name, which consequently calls my new routines). I've
included the full component below to show what I'm trying to achieve.
Hopefully when this is finished it will be useful to others. All help and
tips gratefully received.

The problem I have at the moment is that the component won't compile unless
I comment out the inherited from the DoGetImageIndex. It gives me the error
"Incompatible Types" and if I do this it doesn't display anything.

Thanks in advance.

Colin

----------------------------------------------------------------------------
---------

unit VTFileBox;

interface

uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
VirtualTrees, shellapi, commctrl;

type
TVTFileBox = class(TVirtualStringTree)
private
function GetIconIndex(const AFile: string; Attrs: DWord): integer;
{ Private declarations }
protected
procedure SetParent( aParent : TWinControl ); override;
function DoGetImageIndex(Node: PVirtualNode; Kind: TVTImageKind; Column:
Integer): Integer; override;
procedure DoGetText(Node: PVirtualNode; Column: Integer; TextType:
TVSTTextType;
var Text: WideString); override;
{ Protected declarations }
public
UseFileList: TStringlist;
UseExtList: TStringlist;
FullName, FileName, FileSize, FileDate, FileExt: string;
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
procedure PopulateVT(UseVTList: TVirtualStringTree;
UseDirectory: string);
{ Public declarations }
published
{ Published declarations }
end;

procedure Register;

implementation

uses pistrutil, pidateutil;

procedure Register;
begin
RegisterComponents('Virtual Controls', [TVTFileBox]);
end;

function TVTFileBox.GetIconIndex(const AFile: string; Attrs: DWord):
integer;
var
SFI: TSHFileInfo;
begin
SHGetFileInfo(PChar(Afile),Attrs, SFI, SizeOf(TSHFileInfo),
SHGFI_SYSICONINDEX or SHGFI_USEFILEATTRIBUTES);
Result:=SFI.iIcon;
end;

function TVTFileBox.DoGetImageIndex(Node: PVirtualNode; Kind: TVTImageKind;
Column: Integer): Integer;
begin
inherited; //compile fails on this line
if (column=1) then
result:=GetIconIndex(filename, FILE_ATTRIBUTE_NORMAL);
end;

procedure TVTFileBox.DoGetText(Node: PVirtualNode; Column: Integer;
TextType: TVSTTextType;
var Text: WideString);
var
UseList: TStringlist;
begin
inherited;
UseList:=TStringlist.create;
try
parsestring(UseList, usefilelist[node.index], '||');
fullname:=UseList[0];
filename:=extractfilename(UseList[0]);
filesize:=UseList[1];
filedate:=UseList[2];
fileext:=UseList[3];
case Column of
1: Text := filename;
2: Text := filesize;
3: Text := filedate;
end;
finally
UseList.free;
end;
end;

Procedure TVTFileBox.PopulateVT(UseVTList: TVirtualStringTree; UseDirectory:
string);
var
SearchRec: TSearchRec;
fileext: string;
begin
try
useVTList.clear;
useextlist.clear;
if not (FindFirst(adddosslash(usedirectory)+'*.*',
faAnyFile-faHidden-faDirectory-faSysFile, SearchRec)=0) then exit;
with usefilelist do
begin
clear;
fileExt:=extractfileext(searchrec.name);

add(adddosslash(usedirectory)+searchrec.name+'||'+inttostr(round(searchrec.s
ize/1024))+'||'+filetimetostring(searchrec.finddata.ftlastwritetime)+'||'+fi
leext);
fullname:=adddosslash(usedirectory)+searchrec.name;
while (FindNext(SearchRec) = 0) do
begin
application.processmessages;
fileExt:=extractfileext(searchrec.name);

add(adddosslash(usedirectory)+searchrec.name+'||'+inttostr(round(searchrec.s
ize/1024))+'||'+filetimetostring(searchrec.finddata.ftlastwritetime)+'||'+fi
leext);
fullname:=adddosslash(usedirectory)+searchrec.name;
end;
sort;
try
RootNodeCount := usefilelist.count;
except
end;
end;
finally
FindClose(SearchRec);
end;
end;

constructor TVTFileBox.Create(AOwner: TComponent);
begin
useFileList:=TStringlist.create;
useExtList:=TStringlist.create;
inherited create(Aowner);
end;

destructor TVTFileBox.Destroy;
begin
inherited;
useFileList:=nil;
useExtList:=nil;
usefilelist.free;
useextlist.free;
end;

procedure TVTFileBox.SetParent( aParent : TWinControl );
var
SysIl: HIMAGELIST;
SFI: TSHFileInfo;
begin
inherited SetParent( aParent );
if Assigned( aParent ) then
begin
height:=369;
width:=521;
header.columns.add;
header.columns.add;
header.columns.add;
header.columns.add;

header.columns[0].position:=0;
header.columns[0].spacing:=0;
header.columns[0].text:='Root';
header.columns[0].width:=50;
header.columns[0].options:=[coAllowClick, coEnabled, coParentBidiMode,
coShowDropMark];

header.columns[1].position:=1;
header.columns[1].spacing:=0;
header.columns[1].text:='Name';
header.columns[1].width:=320;
header.columns[1].options:=[coAllowClick, coEnabled, coParentBidiMode,
coShowDropMark, coVisible];

header.columns[2].position:=2;
header.columns[2].spacing:=0;
header.columns[2].text:='Size(KB)';
header.columns[2].width:=75;
header.columns[2].options:=[coAllowClick, coEnabled, coParentBidiMode,
coShowDropMark, coVisible];

header.columns[3].position:=3;
header.columns[3].spacing:=0;
header.columns[3].text:='Modified';
header.columns[3].width:=120;
header.columns[3].options:=[coAllowClick, coEnabled, coParentBidiMode,
coShowDropMark, coVisible];
header.options:=[hoDrag, hoShowHint, hoVisible];
header.style:=hsFlatButtons;
ScrollBarOptions.AlwaysVisible:=true;
ScrollBarOptions.ScrollBars:=ssVertical;
ScrollBarOptions.ScrollBarStyle:=sbmFlat;

Images:=TImageList.Create(Self);
SysIL:=ShGetFileInfo('',0,SFI,SizeOf(SFI),SHGFI_SYSICONINDEX or
SHGFI_SmallICON);
if SysIL<>0 then
begin
images.handle:=SysIl;
images.shareimages:=true;
end;
end;
end;

end.


re: Problem with DeleteNode

From: "Mike Lischke" [public@l...]
Date: Sat Mar 3, 2001 11:30 am
Subject: RE: [VirtualTreeview] Problem with DeleteNode

Hi Werner and everybody,

finally I have the time to come back to the group. After a couple of vacation
days I had a lot of work (including VT) and was too busy to answer.

> Mike, here is another problem that I cannot figure out. But it may
> be related to your new visibility (of nodes) code.

Keep in mind that the implementation for visible nodes is not yet finished.
Particularly the navigation and painting needs still some improvement.

> DeleteNode(non nil node here, which is the same node as GetFirstNode
> returns, it is the first root node);

I recommend not to use the term "root node". There is only one root node in the
tree (FRoot) which is never shown. What you mean is what I call "top level
nodes".

> >From there eventually InvalidateToBottom(Node) is called (Node still
> not nil), which comes to this code fragment:
>
> CurrentNode := GetNodeAt(0, 0);
> if CompareNodePositions(Node, CurrentNode) < 0 then

I'm not sure if we have the same source ;-) InvalidateToBottom looks so in the
current code:

if (FUpdateCount = 0) and ([vsInitialized, vsVisible] * Node.States =
[vsInitialized, vsVisible]) then
begin
if (Node = nil) or (Node = FRoot) then
Invalidate
else
begin
R := GetDisplayRect(Node, -1, False);
if R.Top < ClientHeight then
begin
R.Bottom := ClientHeight;
InvalidateRect(Handle, @R, False);
end;
end;
end;

and I am sure that I have not changed it for a while (except the third
parameter in GetDisplayRect). This method is called with the parent of the node
which is currently being deleted. Since this node is the very first one its
parent is FRoot. The path taken in InvalidateNode is just calling Invalidate.

> GetNodeAt returns nil and an assertion in CompareNodePositions is violated.
> In GetNodeAt this code executes:
>
> if Result = nil then
> Result := GetFirstVisibleNoInit;

This has recently be changed as a result of my efforts for implementing
directionality in VT (which required a new hit test etc.). Please try the
uploaded version 2.2 and see what happens. You can also try to put
BeginUpdate/EndUpdate around your deletion code.

> Well. The tree in question is scrolled half way down. The first root node
> is not visible on screen. But it is visible in the tree as it is a root node
> which cannot be hidden. Don't know which notion of visibility you use here.

:-) In this case I use "in view". A node is in view if it is visible and at
least partially located in the client area.

Ciao, Mike


re: Problem with GetHitTestInfoAt

From: "Mike Lischke" [public@l...]
Date: Sat Mar 3, 2001 11:43 am
Subject: RE: [VirtualTreeview] Problem with GetHitTestInfoAt

> I am adding a new child node to an already expanded node (AddChild).
> While this works ok and also the node text is displayed correctly
> (OnGetText), it cannot always be selected by mouse click afterwards.

This problem has been reported so often that I seriously think about removing
AddChild/InsertNode. It results from the conflict that the tree works in its
natural way while the application tries to work the old way. When you add a
node using AddChild or InsertNode then this node is not validated immediately
but its width is queried if no columns are defined to determine whether to show
a horizontal scrollbar or not. To get the width the node's caption is queried
which has not been set because the node is not yet initialized. I could
implicitely initialize the node in AddChild etc. but this will not really solve
the problem because AddChild is used to avoid the use of InitNode (that is, the
node's data is set when AddChild returns). Once AddChild has returned the node
is already initialized and got already an initial (and wrong) text width.

A quick solution for you is to put your entire initialization block into a
BeginUpdate/EndUpdate frame which will prevent the tree from asking for a
node's width before it is initialized (you have to init all the new nodes,
however, before EndUpdate is called). Another solution is to use one (hidden)
column which determines then the width of the tree. This will also prevent the
tree from retrieving a node's text width (it does not matter anymore in the
case columns are used).

Ciao, Mike


re: When does the selection change?

From: "Mike Lischke" [public@l...]
Date: Sat Mar 3, 2001 12:34 pm
Subject: RE: [VirtualTreeview] When does the selection change?

> is there any chance to know when the selection changes? I believe
> that OnChange is triggered then but probably OnChange is also triggered
> with a myriad of other changes.

OnChange was used for a lot of changes in the tree but meanwhile there are
three change events. OnChange, which is triggered only for selection changes;
OnFocusChanging/OnFocusedChange: for changes of the focused node;
OnStructureChange: for changes resulting from modifying the tree structure (e.g
add or delete node etc.).

Ciao, Mike


re: Re: Q: Header sort arrows

From: "Mike Lischke" [public@l...]
Date: Sat Mar 3, 2001 12:35 pm
Subject: RE: [VirtualTreeview] Re: Q: Header sort arrows

> Perhaps the column header should have been an object in its
> own right to be able to handle the complexity, but it seems
> to late to to ask for it now.

Well, it would not be too late for an object to every column, but I don't see
the benefit. It would still be a problem to consider every combination of
directionality, alignment, layout, margin and spacing.

Ciao, Mike


re: IB_VTree

From: "Mike Lischke" [public@l...]
Date: Sat Mar 3, 2001 1:21 pm
Subject: RE: [VirtualTreeview] IB_VTree

> This component is basically done, except for the 2 year phase of bug fixes
> and enhancements. The dataset and the Tree, more or less communicate with
each other, and it
> supports drag and drop. The column functionality is not 100% done yet. If
anyone is interested, I will
> send the files. I tried uploading to the Yahoo group, but it seems to be
down. And I kept it under
> 500 lines of code.<g>

This is excellent news, Paul. I will put a copy on my VT page at
www.lischke-online.de/VirtualTreeview.html. It will still take a while however,
because I want to finish the changes in VT first.

Thank you for making VT DB aware!

Ciao, Mike


re: THitPosition

From: "Mike Lischke" [public@l...]
Date: Sat Mar 3, 2001 1:26 pm
Subject: RE: [VirtualTreeview] THitPosition

> could you please declare the THitPosition items as normal enumeration (maybe
> rename the set into THitPositions).

Is done. I have again to upload VT (the change is not in the 2.2 upload I have
done this morning). Let me first finish other stuff too.

Ciao, Mike


re: Problem with GetHitTestInfoAt

From: "Mike Lischke" [public@l...]
Date: Sat Mar 3, 2001 1:51 pm
Subject: RE: [VirtualTreeview] Problem with GetHitTestInfoAt

> I am having the same problem again at another place in my program.
> This code is isolated; it is only an options dialog. And it does
> not seem to be related to the DefaultText this time.
>
> Symptoms are like this: I add two nodes. Both nodes show up with
> correct text and icons. But they cannot be focused (with left mouse
> click). Until I found that a click on the icon or the first letter
> of the text *can* focus the node. If this happened once the node can
> be focused with a click anywhere on the node label.

As I said, BeginUpdate/EndUpdate might help.

Ciao, Mike


re: IB_VTree

From: "Paul Gallagher" [paul@t...]
Date: Sat Mar 3, 2001 2:12 pm
Subject: Re: [VirtualTreeview] IB_VTree

I'm sure there are bugs in it, but I will take care of the problems as I
find them in my own apps. If anyone is interested in improving or modifying
it, they should feel free. The code is actually quite simple, and I would be
more than happy to answer any questions about it.

Paul

----- Original Message -----
From: "Mike Lischke" [public@l...]
To: <VirtualTreeview@yahoogroups.com>
Sent: Saturday, March 03, 2001 7:21 AM
Subject: RE: [VirtualTreeview] IB_VTree

> > This component is basically done, except for the 2 year phase of bug
fixes
> > and enhancements. The dataset and the Tree, more or less communicate
with each other, and it
> > supports drag and drop. The column functionality is not 100% done yet.
If anyone is interested, I will
> > send the files. I tried uploading to the Yahoo group, but it seems to be
down. And I kept it under
> > 500 lines of code.<g>
>
> This is excellent news, Paul. I will put a copy on my VT page at
www.lischke-online.de/VirtualTreeview.html. It will still take a while
however, because I want to finish the changes in VT first.
>
> Thank you for making VT DB aware!
>
> Ciao, Mike
>
>
>
> To unsubscribe from this group, send an email to:
> VirtualTreeview-unsubscribe@egroups.com
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>
>


re: Overlay images

From: "Mike Lischke" [public@l...]
Date: Sat Mar 3, 2001 2:37 pm
Subject: RE: [VirtualTreeview] Overlay images

> Two problems: it appears that the overlay image comes from the same
> list as the ikNormal imageindex. But I should not add my own overlay
> image to the global system imagelist. Do I have to copy all icons that
> are needed to a private imagelist?

The system image list already contains images for overlays. If you want to add
your own I suppose you have to copy the image list.

> Second, how is ikOverlay supposed to work? I am under the impression
> that you (Mike) draw overlay images the same way you draw ikNormal
> images. For instance if I test with the 'shared open hand' image which
> always seems to have index 0 in the system imagelist, I don't see an
> overlay but the image replaces the original ikNormal image.

You are totally right, Werner. I have to admit I never used overlay images. I
did a quite naive approach in VT hence I have to rework the overlay handling a
bit. It seems also that if an overlay is to be drawn you cannot use the focused
etc. states. This is not good news since this would make it impossible to "cut"
a node which has an overlay.

> ImageIndexes are hardcoded here of course. 3 is the closed folder icon, 0
> the share-hand. This worked even if I did not mark image 0 as an overlay,
> i.e. the following line in FormCreate did not matter:
>
> vtFolders.Images.Overlay(0, 0);

In my case (Windows 2000) it does matter to have it in. In my first tests I
used:

// Paint normal and overlay image in the usual way.
OverlayImage := DoGetImageIndex(Node, ikOverlay, Column);
if OverlayImage > -1 then
begin
FImages.Overlay(OverlayImage, 0);
FImages.DrawOverlay(Canvas, XPos, YPos, Image, 0, not (vsDisabled in
Node.States) and Enabled);
end
else
FImages.Draw(Canvas, XPos, YPos, Image, not (vsDisabled in Node.States)
and Enabled);

This works quite well, but I have to adjust the "cut-marked" part. And since
Overlay is always called it could be a serious paint speed decrease if overlay
images are used.

Ciao, Mike


re: When does the selection change?

From: Werner Lehmann [wl@b...]
Date: Sat Mar 3, 2001 2:12 pm
Subject: Re: [VirtualTreeview] When does the selection change?

Mike Lischke wrote:
>
> OnChange was used for a lot of changes in the tree but meanwhile there are
three change events. OnChange, which is triggered only for selection changes;
OnFocusChanging/OnFocusedChange: for changes of the focused node;
OnStructureChange: for changes resulting from modifying the tree structure (e.g
add or delete node etc.).

Ok, thanks for clarifying this.

WL


re: Problem with GetHitTestInfoAt

From: Werner Lehmann [wl@b...]
Date: Sat Mar 3, 2001 2:31 pm
Subject: Re: [VirtualTreeview] Problem with GetHitTestInfoAt

Mike Lischke wrote:
>
> > I am adding a new child node to an already expanded node (AddChild).
> > While this works ok and also the node text is displayed correctly
> > (OnGetText), it cannot always be selected by mouse click afterwards.
>
> This problem has been reported so often that I seriously think about removing
AddChild/InsertNode. It results from the conflict that the tree works in its
natural way while the application tries to work the old way. When you add a
node using AddChild or InsertNode then this node is not validated immediately
but its width is queried if no columns are defined to determine whether to show
a horizontal scrollbar or not. To get the width the node's caption is queried
which has not been set because the node is not yet initialized. I could
implicitely initialize the node in AddChild etc. but this will not really solve
the problem because AddChild is used to avoid the use of InitNode (that is, the
node's data is set when AddChild returns). Once AddChild has returned the node
is already initialized and got already an initial (and wrong) text width.

Hm, I am reading this for the first time on this mailing list.

> A quick solution for you is to put your entire initialization block into a
BeginUpdate/EndUpdate frame which will prevent the tree from asking for a
node's width before it is initialized (you have to init all the new nodes,
however, before EndUpdate is called). Another solution is to use one (hidden)
column which determines then the width of the tree. This will also prevent the
tree from retrieving a node's text width (it does not matter anymore in the
case columns are used).

Yes, Begin/EndUpdate did the trick. I suspected similar problems. Because
OnGetText is called right away before I got a chance to init the node (apart
from OnInitNode). So I had to check if the data in OnGetText was nil and
simply return an empty string there.

It was confusing that the text showed up correctly in spite of that. I guess
the VTree is asking for each column's node text again if the dialog is shown
(the nodes are added in FormCreate or FormShow) but it does not update the
text width then. This would explain the behaviour.

I suppose an explicit InvalidateNode right after my manual init (read: not
in OnInitNode) would achieve the same thing but I did not test it anymore
because Begin/EndUpdate is more efficient and works already.

I must admit that I still have problems with the usage of OnInitNode. Many
times I have node data that is bested accessed in a sequential way, inside
a loop. OnInitNode would break this logic. Furthermore I would not know which
part of the 'sequential' data must go in the current OnInitNode's node data.

The data is not only determined by the parent of the node (I believe this is
the trick that you use in the advanced example). It is also determined by
the child index. The only way that I see with OnInitNode is to each time
query the child index and start a new loop through the data until the element
which is needed now is reached and then break the loop. Not particularly
efficient.

Sorry that I am so ignorant :) Please keep AddChild as my code heavily depends
on it.

Regards,
Werner

 | Replies | Author | Date
665 | Re: Problem with GetHitTestInfoAt | Mike Lischke | Sat 3/3/2001


re: Creating a component decended from TVirtualStringTree

From: "Mike Lischke" [public@l...]
Date: Sat Mar 3, 2001 3:01 pm
Subject: RE: [VirtualTreeview] Creating a component decended from TVirtualStringTree

Hi Colin,

> I've downloaded the latest beta but it won't install. I'm using Delphi 4
> and it looks like
> the beta version is only for Delphi 5, is this correct?

You should be a bit more specific about your problems. Also the prerelease
should compile with Delphi 4. What error do you get?

Ciao, Mike


Memory leaks in Virtualtrees 1.31

From: [r.vonk03@k...]
Date: Sat Mar 3, 2001 3:38 pm
Subject: Memory leaks in Virtualtrees 1.31

Hia all,

I'm buzy creating a new freeware Diskcat with the use of virtual
trees. While debugging with memory sleuth i found out that there are
some meory leaks in version 1.31.

I've added the following line to TBaseVirtualTree.Destroy:

FScrollBarOptions.Free;

Because it's created but never freed..

And memory sleuth is saying that in:

function TBaseVirtualTree.MakeNewNode: PVirtualNode;

memory is allocated here but never freed..

Result := AllocMem(Size + InternalDataSize);

Maybe it's fixed in 2.2 but i'm going to find out that now...

U can use a demo version of memory sleuth to find memory leaks. It
can bedownloaded from this page:

http://www.clexpert.cz/software/turbopower/memorysleuth.asp

And direct link is:

http://www.clexpert.cz/download/sltr.exe

Bye..

Rob Vonk

www.robvonk.com

 | Replies | Author | Date
666 | Re: Memory leaks in Virtualtrees 1.31 | Mike Lischke | Sat 3/3/2001
668 | Re: Memory leaks in Virtualtrees 1.31 | [r.vonk03@k...] | Sat 3/3/2001
669 | Re: Memory leaks in Virtualtrees 1.31 | Mike Lischke | Sat 3/3/2001
671 | Re: Memory leaks in Virtualtrees 1.31 | [r.vonk03@k...] | Sat 3/3/2001


re: Overlay images

From: Werner Lehmann [wl@b...]
Date: Sat Mar 3, 2001 3:50 pm
Subject: Re: [VirtualTreeview] Overlay images

Mike Lischke wrote:
>
> The system image list already contains images for overlays. If you want to
add your own I suppose you have to copy the image list.

Bad news, but as expected.

> > Second, how is ikOverlay supposed to work? I am under the impression
> > that you (Mike) draw overlay images the same way you draw ikNormal
> > images. For instance if I test with the 'shared open hand' image which
> > always seems to have index 0 in the system imagelist, I don't see an
> > overlay but the image replaces the original ikNormal image.
>
> You are totally right, Werner. I have to admit I never used overlay images. I
did a quite naive approach in VT hence I have to rework the overlay handling a
bit. It seems also that if an overlay is to be drawn you cannot use the focused
etc. states. This is not good news since this would make it impossible to "cut"
a node which has an overlay.

A test with explorer reveals: an icon with an overlay (link arrow) can have
a cut state. Looks as usual for cut icons; the overlay is unchanged. So there
should be a way.

> In my case (Windows 2000) it does matter to have it in. In my first tests I
used:

Win2k for me too.

> // Paint normal and overlay image in the usual way.
> OverlayImage := DoGetImageIndex(Node, ikOverlay, Column);
> if OverlayImage > -1 then
> begin
> FImages.Overlay(OverlayImage, 0);
> FImages.DrawOverlay(Canvas, XPos, YPos, Image, 0, not (vsDisabled in
Node.States) and Enabled);
> end
> else
> FImages.Draw(Canvas, XPos, YPos, Image, not (vsDisabled in
Node.States) and Enabled);
>
> This works quite well, but I have to adjust the "cut-marked" part. And since
Overlay is always called it could be a serious paint speed decrease if overlay
images are used.

Couldn't you just query normal (selected) and overlay image and only after
that draw with overlay (DrawOverlay) or without (Draw) depending on the
overlay image index (if it is < 0 use standard Draw otherwise DrawOverlay).

About FImages.Overlay(OverlayImage, 0): this is a responsibility of the
image list. The user should care which images are overlay images and
prepare them as needed.

Regards,
WL

 | Replies | Author | Date
667 | Re: Overlay images | Mike Lischke | Sat 3/3/2001


re: Problem with DeleteNode

From: Werner Lehmann [wl@b...]
Date: Sat Mar 3, 2001 3:54 pm
Subject: Re: [VirtualTreeview] Problem with DeleteNode

Mike Lischke wrote:
>
> finally I have the time to come back to the group. After a couple of vacation
days I had a lot of work (including VT) and was too busy to answer.

no problem I figured this was the case.

> I recommend not to use the term "root node". There is only one root node in
the tree (FRoot) which is never shown. What you mean is what I call "top level
nodes".

Ok.

> I'm not sure if we have the same source ;-) InvalidateToBottom looks so in
the current code:

Hm? :)

I definitely did not rewrite InvalidateToBottom (or any other method). Anyhow I
will try
it again with the new version. Maybe the problem has vanished then...

Until then the odd workaround that I posted (scroll tree up before deleting)
works.

Regards,
WL


re: Multiline Hint text

From: "Mike Lischke" [public@l...]
Date: Sat Mar 3, 2001 3:57 pm
Subject: RE: [VirtualTreeview] Multiline Hint text

> This sort of is related to another discussion we had on ExTextOutW, any
> chance for any examples on how to implement this in VB, support for #10 in
> hint text. Currently the hint is passed directly to ExTextOutW, which
> doesn't handle it (as expected).

Which other discussion, Geoffrey? Just separating lines in a (Unicode) string
is trivial. The more challenging task is to determine size and position of the
text strings. This and other language specific issues have always to be
considered when dealing with Unicode. I have multiline hints as a point in the
todo list now (hints only, not tooltips or node captions).

Ciao, Mike


re: Problem with GetHitTestInfoAt

From: "Mike Lischke" [public@l...]
Date: Sat Mar 3, 2001 4:43 pm
Subject: RE: [VirtualTreeview] Problem with GetHitTestInfoAt

> Hm, I am reading this for the first time on this mailing list.

Aside the unfreed FScrollbarOptions bug, this was mentioned to me more often
than any other problem.

> It was confusing that the text showed up correctly in spite of that. I guess
> the VTree is asking for each column's node text again if the dialog is shown
> (the nodes are added in FormCreate or FormShow) but it does not update the
> text width then. This would explain the behaviour.

The text of a node is queried every time it needs to be painted while the with
of the text is
cached. As we have seen this causes inconsistencies. But since the tree should
not cache the node
captions I think about removing the cached withs. What do you think?

> I suppose an explicit InvalidateNode right after my manual init (read: not
> in OnInitNode) would achieve the same thing but I did not test it anymore
> because Begin/EndUpdate is more efficient and works already.

You are right. InvalidateNode would also do the job.

> I must admit that I still have problems with the usage of OnInitNode. Many
> times I have node data that is bested accessed in a sequential way, inside
> a loop. OnInitNode would break this logic. Furthermore I would not know which
> part of the 'sequential' data must go in the current OnInitNode's node data.

This is a serious problem and not yet finished. Indeed it is often preferable
to have the nodes
initialized where they are created. This approach leads one of the main
advantages of VT ad absurdum
(the ability to query only the data which is needed and only in small bits,
instead of putting it
all into the tree in on big rush), but seems to be unavoidable at times. I have
no better concept
yet as what is currently in the tree (plus using BeginUpdate/EndUpdate). Hence
if you or anybody
else can come up with a better concept I woul love to hear about it.

Ciao, Mike


re: Memory leaks in Virtualtrees 1.31

From: "Mike Lischke" [public@l...]
Date: Sat Mar 3, 2001 4:48 pm
Subject: RE: [VirtualTreeview] Memory leaks in Virtualtrees 1.31

Hi Ron,

> FScrollBarOptions.Free;

This bug has been fixed already.

> memory is allocated here but never freed..
>
> Result := AllocMem(Size + InternalDataSize);

Strange, this would mean no node is freed at all. Try the advanced demo and
create and destroy 1
million nodes several times. Unless you have a gig or more of memory you will
run into serious
trouble very quickly if the nodes are not freed.

It seems rather to be a problem of memory sleuth itself. I had a similar
problem with MemProof. It
reported some leaks which were not reproducable by other means than MemProof
(e.g. memory manager
status tracking, BoundsChecker).

Ciao, Mike

 | Replies | Author | Date
668 | Re: Memory leaks in Virtualtrees 1.31 | [r.vonk03@k...] | Sat 3/3/2001
669 | Re: Memory leaks in Virtualtrees 1.31 | Mike Lischke | Sat 3/3/2001
671 | Re: Memory leaks in Virtualtrees 1.31 | [r.vonk03@k...] | Sat 3/3/2001


re: Overlay images

From: "Mike Lischke" [public@l...]
Date: Sat Mar 3, 2001 4:52 pm
Subject: RE: [VirtualTreeview] Overlay images

> A test with explorer reveals: an icon with an overlay (link arrow) can have
> a cut state. Looks as usual for cut icons; the overlay is unchanged. So there
> should be a way.

Fine. This means I only have to find the correct wires :o]

> Couldn't you just query normal (selected) and overlay image and only after
> that draw with overlay (DrawOverlay) or without (Draw) depending on the
> overlay image index (if it is < 0 use standard Draw otherwise DrawOverlay).

Yes, something like this. I will leave the image list alone and the application
be responsible to
set the correct overlay image.

Thank you for your suggestions, Werner.

Ciao, Mike


re: Memory leaks in Virtualtrees 1.31

From: [r.vonk03@k...]
Date: Sat Mar 3, 2001 6:41 pm
Subject: Re: Memory leaks in Virtualtrees 1.31

> >
> > Result := AllocMem(Size + InternalDataSize);
>
> Strange, this would mean no node is freed at all. Try the advanced
demo and create and destroy 1
> million nodes several times. Unless you have a gig or more of
memory you will run into serious
> trouble very quickly if the nodes are not freed.
>
> It seems rather to be a problem of memory sleuth itself. I had a
similar problem with MemProof. It
> reported some leaks which were not reproducable by other means than
MemProof (e.g. memory manager
> status tracking, BoundsChecker).
>
> Ciao, Mike

Hmm. Guess i made a wrong assumption. It seems that OnFreeNode isn't
called on every deletion of node. Probably only the ones that are
initialized?

It's hard to get all functionality from Diskcat into a new program
with virtual tree. To get things working i use some 'old' methods..

I only want directories to be chown in the tree but if i click on a
diretory it must get all files from that dir. I got it to work with
pointing to my database but at some point i ran into problems. So
that's why i created a tlist in Nodedata with a file list in it. On
creating the node i create the tlist too. On deleting i free the
tlist. But it seems that OnFreeNode isn't called for every node.. The
tlist never gets freed.

Maybe there's another way for this. I don't know if it's possible to
add the files in the tree too in a way that they are not chown. That
way i don't need a tlist.

Rob

 | Replies | Author | Date
669 | Re: Memory leaks in Virtualtrees 1.31 | Mike Lischke | Sat 3/3/2001
671 | Re: Memory leaks in Virtualtrees 1.31 | [r.vonk03@k...] | Sat 3/3/2001


re: Re: Memory leaks in Virtualtrees 1.31

From: "Mike Lischke" [public@l...]
Date: Sat Mar 3, 2001 7:09 pm
Subject: RE: [VirtualTreeview] Re: Memory leaks in Virtualtrees 1.31

> Hmm. Guess i made a wrong assumption. It seems that OnFreeNode isn't
> called on every deletion of node. Probably only the ones that are
> initialized?

This is a different issue. OnFreeNode is indeed only called if the node is
initialized. So you also
used AddChild to build your tree, correct? Only in this case it can happen that
you fill in data
into a node which is not initialized. My tip is to call ValidateNode after
AddChild. This will
ensure the node is initialized and the application gets called when it is freed.

> Maybe there's another way for this. I don't know if it's possible to
> add the files in the tree too in a way that they are not chown. That
> way i don't need a tlist.

Have you had a look at the draw tree demo? In this demo I have shown how to
enumerate files and
folders with Virtual Treeview.

Ciao, Mike

 | Replies | Author | Date
671 | Re: Memory leaks in Virtualtrees 1.31 | [r.vonk03@k...] | Sat 3/3/2001


re: Problem with GetHitTestInfoAt

From: Werner Lehmann [wl@b...]
Date: Sat Mar 3, 2001 6:25 pm
Subject: Re: [VirtualTreeview] Problem with GetHitTestInfoAt

Mike Lischke wrote:
>
> This is a serious problem and not yet finished. Indeed it is often preferable
to have the nodes
> initialized where they are created. This approach leads one of the main
advantages of VT ad absurdum
> (the ability to query only the data which is needed and only in small bits,
instead of putting it
> all into the tree in on big rush), but seems to be unavoidable at times. I
have no better concept
> yet as what is currently in the tree (plus using BeginUpdate/EndUpdate).
Hence if you or anybody
> else can come up with a better concept I woul love to hear about it.

Mike,

I am somewhat glad that this problem not only exists in my head :)
But I am not always filling the trees in one big rush. Especially
if there are many nodes I utilize the OnExpanding event.

I believe that we should not mix the virtual paradigm with a node
init style. Virtual means to me at least that the tree does not
store any client data apart from its structure and node states.

This does not say anything about the time or place when or where
nodes are init'ed.

Regards,
Werner

 | Replies | Author | Date
672 | Re: Problem with GetHitTestInfoAt | Mike Lischke | Sat 3/3/2001
676 | Re: Problem with GetHitTestInfoAt | [adembaba@e...] | Sun 3/4/2001


re: Memory leaks in Virtualtrees 1.31

From: [r.vonk03@k...]
Date: Sat Mar 3, 2001 7:15 pm
Subject: Re: Memory leaks in Virtualtrees 1.31

--- In [VirtualTreeview@y...], "Mike Lischke" [public@l...] wrote:
> way i don't need a tlist.
>
> Have you had a look at the draw tree demo? In this demo I have
shown how to enumerate files and
> folders with Virtual Treeview.
>
> Ciao, Mike

I'll go right at it. I searched through the archives of this group
and found a message from someone with the same problem :-)

http://groups.yahoo.com/group/VirtualTreeview/message/58

Thanks again for you FAST reaction.

Rob


re: Problem with GetHitTestInfoAt

From: "Mike Lischke" [public@l...]
Date: Sat Mar 3, 2001 7:49 pm
Subject: RE: [VirtualTreeview] Problem with GetHitTestInfoAt

> I believe that we should not mix the virtual paradigm with a node
> init style. Virtual means to me at least that the tree does not
> store any client data apart from its structure and node states.

Mmm :-) the core and inherent meaning of "virtual" in this context is closely
related to the node
initialization. Virtual means here that the tree when it is displayed does not
really hold all nodes
and have their data, but "pretends" to have them. The immediate reaction e.g.
when expanding is that
the child nodes of the node being expanded are shown. This involves indeed the
initialization of the
children of that node. *But* the difference to node initialization is that
still not *all* child
nodes are initialized but only those which are visible in the client area.
There is simply no need
to load any data for nodes which aren't touched at that time. This might change
however when an
uninitialized node is scrolled into view or is part of an iteration (search,
whatever).

The key point here is that it is required to initialize nodes asynchronously
which means its data
must be addressable asynchronously. And the latter requirement holds the most
challenging problems.
The theory works fine as long as you can use inherent features of a node to
address its data (e.g.
its parent and its index in the child list) or at least can give a node a kind
of marker which does
not need to be freed (e.g. a GUID or another ID in a kind of preinitialization
step) and which can
then be used in OnInitNode to address the actual data.

This approach does not work well for databases or other cases where the tree
data is loaded in a
block and must be represented by a tree structure or where data retrival costs
too much extra effort
to do it frequently. It does also not work very well in cases where the number
of nodes/children is
not known in advance (directory enumeration, database queries (RecordCount is
bad practice from the
view of database design)). And all these cases are what makes me headaches,
because they are real
world problems, not something theoretical.

The result from these kinds of problems is that nodes are added once-at-a-time
instead of
all-at-a-time. The latter is preferable for many reasons including that the
addition needs to be
done only once and the tree can rely on a "finished" state once the nodes are
added. Additionally,
since only a number is set, this approach is very fast. Often however the data
for a node is not
available when the node is initialized because the nodes must be added once at
a time and the data
is actually where the addition happend not where the node is initialized. This
approach however
requires that all nodes along with their data are loaded into the tree and this
makes the virtual
paradigm useless.

I do not even have a trace of an idea how to solve that dilemma, but perhaps
I'm looking at the
wrong place. Perhaps it *must* be that there are situations where all data is
loaded. The
uncomfortable feeling results from the fact that this applies to about 90% of
all cases and it
should indeed only be 10% ...

Ciao, Mike

 | Replies | Author | Date
676 | Re: Problem with GetHitTestInfoAt | [adembaba@e...] | Sun 3/4/2001


re: Problem with GetHitTestInfoAt

From: Werner Lehmann [wl@b...]
Date: Sat Mar 3, 2001 10:50 pm
Subject: Re: [VirtualTreeview] Problem with GetHitTestInfoAt

Mike Lischke wrote:
>
> > I believe that we should not mix the virtual paradigm with a node
> > init style. Virtual means to me at least that the tree does not
> > store any client data apart from its structure and node states.

Mike,

thanks for this little article :)

Well, my point of view is pragmatic. When I use AddChild I always retrieve
the node data pointer right afterwards and fill it with a reference to my
data object. The problem that arises from this is that VTree does not know
when I am going to init the node, it can not know that I do it right away.
And so it queries OnGetText among others and I am forced to protect these
handlers with "<> nil" checks. And we have the text width cached wrong problem.

Maybe you could feel comfortable with this approach (which would solve at
least my difficulties): give AddChild a second (default) parameter:

function AddChild(Parent: PVirtualNode; Data: Pointer = nil): PVirtualNode;

Of course you can also overload it or provide a new method AddChildData to
be compatible with D4 (has it already default params or overloaded methods?
I don't remember.). AddChildData would also be similar to the VCL methods.

This way VTree knows the node is init'ed right away. We don't need BeginUpdate
/EndUpdate blocks and no InvalidateNode's. OnGetText and others could rely
on always <>nil data (btw, OnGetText almost always requires that the data
pointer is fetched as do many other events, OnGetImageIndex etc. Why not provide
the data in the event signature? Just a thought.)

Did you ever wprk with a Virtual Listview? It is possible to address all the
data elements via a single list index. Which can simply index the client
data. As far as I know Microsoft did not implement a virtual mode for the
treeview. They may have had reasons for that :) It is clear that things are
not so easy or straightforward here anymore.

> This approach does not work well for databases or other cases where the tree
data is loaded in a
> block and must be represented by a tree structure or where data retrival
costs too much extra effort
> to do it frequently. It does also not work very well in cases where the
number of nodes/children is
> not known in advance (directory enumeration, database queries (RecordCount is
bad practice from the
> view of database design)). And all these cases are what makes me headaches,
because they are real
> world problems, not something theoretical.

Ok, but I still say that AddChild is not so evil. You can always use OnExpanding
and only would need to add a full branch but no the whole tree. Of course this
can also be costly but we cannot have it all.

> The result from these kinds of problems is that nodes are added
once-at-a-time instead of
> all-at-a-time. The latter is preferable for many reasons including that the
addition needs to be
> done only once and the tree can rely on a "finished" state once the nodes are
added. Additionally,
> since only a number is set, this approach is very fast. Often however the
data for a node is not
> available when the node is initialized because the nodes must be added once
at a time and the data
> is actually where the addition happend not where the node is initialized.
This approach however
> requires that all nodes along with their data are loaded into the tree and
this makes the virtual
> paradigm useless.

No. Virtual does not mean (IMO!) that the data might not be readily available in
memory. It means the tree always queries for it if it needs it. You don't
duplicate
the data with additional string fields for each node. But that's it.

Lets assume a single database table with a primary key field and a parent field.
This is good enough for a tree with unlimited nesting depth. If we want to
display
this tree structure in VTree we don't have to add *all* records as tree nodes at
once. Only the top level nodes are needed first. If you expand one of these
nodes
you need to retrieve only its child nodes from the DB.

I think you know that already but I wanted to point out that not the whole DB is
read at once. Of course: if you have 10000's of top level nodes you are in
trouble.
But this is the same trouble that you would have with a virtual listview which
only
displayed this branch. Not more, not less.

> I do not even have a trace of an idea how to solve that dilemma, but perhaps
I'm looking at the
> wrong place. Perhaps it *must* be that there are situations where all data is
loaded. The
> uncomfortable feeling results from the fact that this applies to about 90% of
all cases and it
> should indeed only be 10% ...

As I said: only single branches at a time. Or less if the data structure allows
it.

Regards,
Werner

 | Replies | Author | Date
674 | Re: Problem with GetHitTestInfoAt | Wez Furlong | Sun 3/4/2001
675 | Re: Problem with GetHitTestInfoAt | Mike Lischke | Sun 3/4/2001


re: Problem with GetHitTestInfoAt

From: Wez Furlong [wez.egroups@t...]
Date: Sun Mar 4, 2001 11:01 am
Subject: Re: [VirtualTreeview] Problem with GetHitTestInfoAt

Werner wrote:
> Well, my point of view is pragmatic. When I use AddChild I always retrieve
> the node data pointer right afterwards and fill it with a reference to my
> data object. The problem that arises from this is that VTree does not know
> when I am going to init the node, it can not know that I do it right away.
> And so it queries OnGetText among others and I am forced to protect these
> handlers with "<> nil" checks.

I have been using this code:

VT.BeginUpdate;
try
node := VT.AddChild(parent);
data := VT.GetNodeData(node);
{ populate data here }
finally
VT.EndUpdate;
end;

The treeview doesn't seem to need to query the node until it is going to
actually render it on-screen, and the BeginUpdate puts that under your control.

Mike - can we rely on this behaviour? It certainly seems to work quite
nicely for me.

--Wez.

 | Replies | Author | Date
675 | Re: Problem with GetHitTestInfoAt | Mike Lischke | Sun 3/4/2001


re: Problem with GetHitTestInfoAt

From: "Mike Lischke" [public@l...]
Date: Sun Mar 4, 2001 12:02 pm
Subject: RE: [VirtualTreeview] Problem with GetHitTestInfoAt

> The treeview doesn't seem to need to query the node until it is going to
> actually render it on-screen, and the BeginUpdate puts that under your
control.
>
> Mike - can we rely on this behaviour? It certainly seems to work quite
> nicely for me.

Yes, of course, you can rely on it. BeginUpdate/EndUpdate have been designed
for exactly this
behavior.

Ciao, Mike


re: Problem with GetHitTestInfoAt

From: [adembaba@e...]
Date: Sun Mar 4, 2001 8:43 pm
Subject: Re: Problem with GetHitTestInfoAt

Mike,

> This approach does not work well for databases or other cases where
> the tree data is loaded in a block and must be represented by a tree
> structure or where data retrival costs too much extra effort to do
> it frequently.

Why is it so hard to create a small PMT (polymorphic tree; which is
a tree where all nodes are identical) as a shadow and do all the
dirty stuff on that tree? In my experience PMTs are faster and also
more flexible since you can alter them anyway you like --including
tailor-making ecah one.

> It does also not work very well in cases where the number
> of nodes/children is not known in advance (directory enumeration,
> database queries (RecordCount is bad practice from the view of
> database design)). And all these cases are what makes me headaches,
> because they are real world problems, not something theoretical.

Again, it seems we are asking simply too much from a visual
front-end. VT is *not* supposed to solve our storage problems;
it, IMHO, is a very good solution to displaying data in tree
format; and that is all it has to do.

> The result from these kinds of problems is that nodes are added
> once-at-a-time instead of all-at-a-time. The latter is
> preferable for many reasons including that the addition needs
> to be done only once and the tree can rely on a "finished"
> state once the nodes are added. Additionally, since only a number
> is set, this approach is very fast. Often however the data for a
> node is not available when the node is initialized because the
> nodes must be added once at a time and the data is actually where
> the addition happend not where the node is initialized. This
> pproach however requires that all nodes along with their data
> are loaded into the tree and this makes the virtual paradigm
> useless.
>
> I do not even have a trace of an idea how to solve that dilemma,
> but perhaps I'm looking at the wrong place. Perhaps it *must* be
> that there are situations where all data is loaded. The
> ncomfortable feeling results from the fact that this applies to
> about 90% of all cases and it should indeed only be 10% ...

I have done some private stuff where I have solved this issue. Here
is how: I start off with a shadow PMT and I fill it up as much as I
need to. Then, starting from PMT's root I add a node to VT, making
sure that NodeData in VT keeps pointer address of the corresponding
PMT node. And, at the same time I put VT node's address in the
corresponding PMT node.

This way, I can manipulate either in any way I like. I can add,
delete, alter or move a node from PMT and reflect it in VT.
Likewise, I can alter the VT and reflect it in the PMT, naturally.

This works for both one-at-a-time as well as all-at-a-time;
queries etc.

Having said all this, I wonder if you guys have some other
problem that I might be misinterpreting?

Cheers,


OnFocusChanged (VT 2.2)

From: [adembaba@e...]
Date: Sun Mar 4, 2001 10:11 pm
Subject: OnFocusChanged (VT 2.2)

Hi,

It seems that the new v2.2 has introduced a peculiarity
into OnFocusChanged: VT seems to trigger OnFocusChanged
when it is being freed.

I have not checked whether other similar events are
fired, but this one definitely is.

Chhers,

 | Replies | Author | Date
680 | Re: OnFocusChanged (VT 2.2) | Mike Lischke | Mon 3/5/2001
716 | Re: OnFocusChanged (VT 2.2) | [adembaba@e...] | Wed 3/7/2001


re: AddChild (was: Problem with GetHitTestInfoA t)

From: Mike Lischke [public@l...]
Date: Mon Mar 5, 2001 1:16 pm
Subject: RE: [VirtualTreeview] AddChild (was: Problem with GetHitTestInfoA t)

Hi Werner,

> Maybe you could feel comfortable with this approach (which
> would solve at least my difficulties): give AddChild a second (default)
parameter:
>
> function AddChild(Parent: PVirtualNode; Data: Pointer = nil):
PVirtualNode;

I thought about the same approach but don't see the advantage. What is the
Data pointer to say? Of course, one could say that the data pointed to by
Data (if not nil) is to be copied into the node record (size is
NodeDataSize) and the node is to be considered as being initialized.

> Of course you can also overload it or provide a new method
> AddChildData to be compatible with D4 (has it already default params or
> overloaded methods? I don't remember.).

I don't know either. But the default parameter is the way I'd prefer.

> AddChildData would also be similar to the
> VCL methods.

Oh oh, it is dangerous to compared both approaches. The data pointer in the
VCL is taken as it is and stored in the target class while in VT the data
pointed to by Data is stored. This is a small but very important difference.

> (btw, OnGetText almost always requires that the data pointer is fetched as
do many other events, OnGetImageIndex etc. Why not provide the data in the
event signature? Just a thought.)

I also thought about this too. The reason why I still hesitate to insert the
user data pointer is because it would be an additional parameter which might
not be necessary in every case. Admittedly it is not very likely that an
application provides the tree data by other means than the node's user data
area, but is nonetheless possible and would mean, in this case, that the
retrieved data pointer is superfluous. I know this is only marginal extra
CPU cycles, but I do care about speed.

> Did you ever wprk with a Virtual Listview? It is possible to
> address all the data elements via a single list index. Which can simply
index
> the client data.

My first virtual control I ever wrote (about 2 years ago) was a Virtual
Listbox. Compared with VT it is/was a very trivial control, just like a
TLabel compared with a TMemo. The virtual mode of TListView is similar but
both can rely on a kind of overall index, which is not usable in VT.
Additionally, for instance in databases, such an index cannot be used
(unless you use Paradox tables or Table.First/Table.MoveBy which is slow).

> As far as I know Microsoft did not implement a virtual
> mode for the treeview. They may have had reasons for that :) It is clear
> that things are not so easy or straightforward here anymore.

Oh yes. If I take your definition of "virtual" then they have done so. The
system treeview allows to have a socalled text callback. This will cause the
treeview to ask back the parent of the tree window (note: not the tree
window itself, but its window parent!) for every string when it must be
display. Very much like in VT and the VCL does use this feature. But because
the captions are retrieved via messages (and redirected because of the fact
the parent window gets the notification) there is a large overhead.

> Ok, but I still say that AddChild is not so evil. You can
> always use OnExpanding and only would need to add a full branch but no the
whole
> tree. Of course this can also be costly but we cannot have it all.

Yes, of course, but it would be much "cooler" to have only those nodes
initialized/fetched which are shown. This way you can show, say, a 1 million
record table within a couple of seconds (depend on query runtime) because
you only have to catch a couple of records.

> No. Virtual does not mean (IMO!) that the data might not be
> readily available in memory. It means the tree always queries for it if it
needs
> it.

In the pure sense of "virtual" it means something which does not physically
exist (compare also virtual reality etc.). But I think we should not
continue this discussion here as it is off topic and likely nobody else on
this list really cares about it :-]

Ciao, Mike

 | Replies | Author | Date
687 | Re: AddChild (was: Problem with GetHitTestInfoA t | Werner Lehmann | Mon 3/5/2001
702 | Re: AddChild (was: Problem with GetHitTestInfoA t | Bender Heri | Wed 3/7/2001
707 | Re: AddChild (was: Problem with GetHitTestInfoA t | Werner Lehmann | Wed 3/7/2001
711 | Re: AddChild (was: Problem with GetHitTestInfoA t | Bender Heri | Wed 3/7/2001
714 | Re: AddChild (was: Problem with GetHitTestInfoA t | Bender Heri | Wed 3/7/2001
719 | Re: AddChild (was: Problem with GetHitTestInfoA t | Mike Lischke | Wed 3/7/2001
726 | Re: AddChild (was: Problem with GetHitTestInfoA t | Bender Heri | Thu 3/8/2001
730 | Re: AddChild (was: Problem with GetHitTestInfoA t | Mike Lischke | Thu 3/8/2001
733 | Re: AddChild (was: Problem with GetHitTestInfoA t | Bender Heri | Thu 3/8/2001


re: Re: Problem with GetHitTestInfoAt

From: Mike Lischke [public@l...]
Date: Mon Mar 5, 2001 1:28 pm
Subject: RE: [VirtualTreeview] Re: Problem with GetHitTestInfoAt

>
> I have done some private stuff where I have solved this issue. Here
> is how: I start off with a shadow PMT and I fill it up as much as I
> need to. Then, starting from PMT's root I add a node to VT, making
> sure that NodeData in VT keeps pointer address of the corresponding
> PMT node. And, at the same time I put VT node's address in the
> corresponding PMT node.
>
> This way, I can manipulate either in any way I like. I can add,
> delete, alter or move a node from PMT and reflect it in VT.
> Likewise, I can alter the VT and reflect it in the PMT, naturally.

Actually, this is my prefered way. This is the VT paradigm in perfection. VT
only serves as visual front end while the data is stored somewhere else (be
it a memory tree or a simple list or even an online storage). You are
completely right that VT's task is to visualize data not to take care about
its storage.

Unfortunately, if I completely leave that task to the potential user of VT
there wouldn't be as much as there are (with > 20.000 downloads currently).
For most cases it is much more effective to use the tree's internal storage
for application data too (a way I go most of the time). And, as already
noted, it is sometimes difficult to make the virtual paradigm work for real
world problems.

Ciao, Mike

 | Replies | Author | Date
686 | Re: Problem with GetHitTestInfoAt | [adembaba@e...] | Mon 3/5/2001


re: OnFocusChanged (VT 2.2)

From: Mike Lischke [public@l...]
Date: Mon Mar 5, 2001 1:33 pm
Subject: RE: [VirtualTreeview] OnFocusChanged (VT 2.2)

> It seems that the new v2.2 has introduced a peculiarity
> into OnFocusChanged: VT seems to trigger OnFocusChanged
> when it is being freed.

Mmmh, does it harm? It is fired because the focused node looses the focus
when the tree is cleared. On the other hand when the tree is cleared (and
even destroyed) it makes not much sense to have a focus change event. Hence
I have changed the Clear method to:

procedure TBaseVirtualTree.Clear;

begin
BeginUpdate;
try
InterruptValidation;
if (ClipboardStates * FStates) <> [] then
begin
Include(FStates, tsClipboardCancelling);
CancelCutOrCopy;
OleSetClipboard(nil);
FStates := FStates - ClipboardStates - [tsClipboardCancelling];
end;
ClearSelection;
FFocusedNode := nil; <<<<<< this is the new insertion
DeleteChildren(FRoot);
FRoot.FirstChild := nil;
FRoot.LastChild := nil;
FLastSelected := nil;
FFocusedNode := nil;
FCurrentHotNode := nil;
FVisibleCount := 0;
FOffsetX := 0;
FOffsetY := 0;
finally
EndUpdate;
end;
end;

 | Replies | Author | Date
716 | Re: OnFocusChanged (VT 2.2) | [adembaba@e...] | Wed 3/7/2001


re: Select a node in run-time ?

From: [tias@t...]
Date: Mon Mar 5, 2001 2:47 pm
Subject: Re: Select a node in run-time ?

--- In [VirtualTreeview@y...], "Mike Lischke" [public@l...] wrote:
Sorry for the delay of my reply, but I just moved from Sweden to
Chile, so I've been quite busy for a couple of weeks... ;-)

> I'm sorry that I can't help you much with BCB, you know, I use
Delphi :o]

Yep, I know...

> This is strange. This means somewhere between the AddToSelection and
the GetFirstSelected calls the
> selection is cleared for some reason. Please try the following:
<snip>
> whether ClearSelection (or InternalClearSelection, try this out) is
called before GetFirstSelected.
> Watch also that in AddToSelection the node is really added to the
internal selection array.

ClearSelection or InternalClearSelection is not called.
In AddToSelection it seems like everything i ok too...
Here's the calling order as I can see it :

MainTree->Selected[nf] = true; // My code
TBaseVirtualTree.SetSelected()
TBaseVirtualTree.AddToSelection()
TBaseVirtualTree.InternalAddToSelection
TBaseVirtualTree.DoChange()
TBaseVirtualTree.Change()
TCustomVirtualStringTree.InvalidateNode()

<snip>
> Is a dynamic array a class in BCB? In Delphi it is just this, an
array, but deallocated
> automatically. In TBaseVirtualTree.Create there is a call to set the
array's length to 1. So why
> have you had to insert your statement?

Well, the length is somehow automagically set to 0 and I have no clue
whatsoever what's causing this... I'll try to dig deeper int o it
since I think the dynamic array things might be the problem with my
run-time selections also...

> Great! Hope you get all the troublemakers fixed too.

Not yet, but I will never give up !! ;--)

/Mathias T.


Column clicks

From: [rferraz@f...]
Date: Mon Mar 5, 2001 4:15 pm
Subject: Column clicks

Hi,

I'm new to Virtual Treeview and although I've understood a lot about
it in the past days :-), I've not found a way to detect clicks or
double clicks on a specific column. Is that possible?

TIA,

Ronaldo

 | Replies | Author | Date
683 | Re: Column clicks | Mike Lischke | Mon 3/5/2001
684 | Re: Column clicks | Mike Lischke | Mon 3/5/2001
685 | Re: Column clicks | [rferraz@f...] | Mon 3/5/2001
689 | Re: Column clicks | Mike Lischke | Tue 3/6/2001
692 | Re: Column clicks | [rferraz@f...] | Tue 3/6/2001
693 | Re: Column clicks | Mike Lischke | Tue 3/6/2001
695 | Re: Column clicks | [rferraz@f...] | Tue 3/6/2001
722 | Re: Column clicks | [rferraz@f...] | Wed 3/7/2001
723 | Re: Column clicks | Mike Lischke | Wed 3/7/2001


re: Column clicks

From: "Mike Lischke" [public@l...]
Date: Mon Mar 5, 2001 7:19 pm
Subject: RE: [VirtualTreeview] Column clicks

Hi Ronaldo,

> I'm new to Virtual Treeview and although I've understood a lot about
> it in the past days :-), I've not found a way to detect clicks or
> double clicks on a specific column. Is that possible?

Gesterday I wondered why I have not yet included OnHeaderMouseDown,
OnHeaderMouseUp,
OnHeaderDblClick and OnHeaderMouseMove. And since I needed these events in a
demo I have them
implemented. Since I'm stil in the process of reworking the header painting I
cannot upload yet the
new version. But if you only are interested in a normal click then look at
OnHeaderClick.

Ciao, Mike

 | Replies | Author | Date
684 | Re: Column clicks | Mike Lischke | Mon 3/5/2001
685 | Re: Column clicks | [rferraz@f...] | Mon 3/5/2001


re: Column clicks

From: "Mike Lischke" [public@l...]
Date: Mon Mar 5, 2001 7:39 pm
Subject: RE: [VirtualTreeview] Column clicks

> Gesterday I wondered ...

Hehe, this is the perfect symbiosis of the english word "yesterday" and its
german translation
"gestern" ;-))

Ciao, Mike


re: Column clicks

From: [rferraz@f...]
Date: Mon Mar 5, 2001 8:19 pm
Subject: Re: Column clicks

--- In [VirtualTreeview@y...], "Mike Lischke" [public@l...] wrote:
> Gesterday I wondered why I have not yet included OnHeaderMouseDown,
OnHeaderMouseUp,
> OnHeaderDblClick and OnHeaderMouseMove. And since I needed these
events in a demo I have them
> implemented. Since I'm stil in the process of reworking the header
painting I cannot upload yet the
> new version. But if you only are interested in a normal click then
look at OnHeaderClick.

Hi Mike,

Guess I was not very clear (I thought about that just after I posted
the message). I was thinking about clicks on the column itself,
per node. I'm trying to achieve a similar behavior as that of the
check boxes in the main column but in a different column.

Thanks for your reply,

Ronaldo


re: Problem with GetHitTestInfoAt

From: [adembaba@e...]
Date: Mon Mar 5, 2001 8:38 pm
Subject: Re: Problem with GetHitTestInfoAt

--- In [VirtualTreeview@y...], Mike Lischke [public@l...] wrote:
> >
> > I have done some private stuff where I have solved this issue.
Here
> > is how: I start off with a shadow PMT and I fill it up as much as
I
> > need to. Then, starting from PMT's root I add a node to VT,
making
> > sure that NodeData in VT keeps pointer address of the
corresponding
> > PMT node. And, at the same time I put VT node's address in the
> > corresponding PMT node.
> >
> > This way, I can manipulate either in any way I like. I can add,
> > delete, alter or move a node from PMT and reflect it in VT.
> > Likewise, I can alter the VT and reflect it in the PMT, naturally.
>
> Actually, this is my prefered way. This is the VT paradigm in
perfection. VT
> only serves as visual front end while the data is stored somewhere
else (be
> it a memory tree or a simple list or even an online storage). You
are
> completely right that VT's task is to visualize data not to take
care about
> its storage.
>
> Unfortunately, if I completely leave that task to the potential
user of VT
> there wouldn't be as much as there are (with > 20.000 downloads
currently).
> For most cases it is much more effective to use the tree's internal
storage
> for application data too (a way I go most of the time). And, as
already
> noted, it is sometimes difficult to make the virtual paradigm work
for real
> world problems.

How do you know how many downloads there have been?


re: AddChild (was: Problem with GetHitTestInfoA t)

From: Werner Lehmann [wl@b...]
Date: Mon Mar 5, 2001 7:06 pm
Subject: Re: [VirtualTreeview] AddChild (was: Problem with GetHitTestInfoA t)

Mike Lischke wrote:
>
> > function AddChild(Parent: PVirtualNode; Data: Pointer = nil):
> PVirtualNode;
>
> I thought about the same approach but don't see the advantage. What is the
> Data pointer to say? Of course, one could say that the data pointed to by
> Data (if not nil) is to be copied into the node record (size is
> NodeDataSize) and the node is to be considered as being initialized.

Exactly. Simply a shortcut for

AddChild(Node);
GetNodeData(Node)^ := Data;

with an implicit OnInitNode after the data assignment.

Hm, what I did not consider was that the node data is actually allocated
by the tree. So this would require to copy the data, producing two instances
of the same data, and not looking very satisfying or efficient.

The reason why I overlooked that is probably that I almost never store more
than a simple pointer in the node data. And a copy of that pointer does no
harm of course. But since you propose a different usage (discussion records
vs object which we had some time ago) it does not seem to make as much sense
as it did when I was writing that.

It would be ideal when the data is could be already initialized when the
node is actually added to the tree, read: in AddChild. If the data is just
a reference to an object, no problem. If it is more.... I see no easy way
out which would avoid the copying of record members. Which is of course not
desirable.

Obviously I prefer to store only one client data pointer in each node (be it
a pointer to a record or an object) but this 'train is gone' :)

> Oh oh, it is dangerous to compared both approaches. The data pointer in the
> VCL is taken as it is and stored in the target class while in VT the data
> pointed to by Data is stored. This is a small but very important difference.

Which I know of course. I was comparing the method naming conventions only.

> > (btw, OnGetText almost always requires that the data pointer is fetched as
> do many other events, OnGetImageIndex etc. Why not provide the data in the
> event signature? Just a thought.)
>
> I also thought about this too. The reason why I still hesitate to insert the
> user data pointer is because it would be an additional parameter which might
> not be necessary in every case. Admittedly it is not very likely that an
> application provides the tree data by other means than the node's user data
> area, but is nonetheless possible and would mean, in this case, that the
> retrieved data pointer is superfluous. I know this is only marginal extra
> CPU cycles, but I do care about speed.

This is your decision. If you ask me I would vote for that additional parameter.
Each and every of my event handlers look like this:

procedure EventSoandso(Sender: TBaseVirtualTree; Node: PVirtualNode;
...otherstuff);
var
MyNodeClass: TMyNodeClass;
begin
MyNodeClass := TMyNodeClass(GetObject(Sender, Node));
if (MyNodeClass = nil) then
exit;

...do stuff here
end;

This would change to

procedure EventSoandso(Sender: TBaseVirtualTree; Node: PVirtualNode; Data:
pointer; ...otherstuff);
var
MyNodeClass: TMyNodeClass;
begin
MyNodeClass := TMyNodeClass(Data);
if (MyNodeClass = nil) then
exit;

...do stuff here
end;

Admittedly, not a very big change, unless I can spare the nil-check also (which
I cannot currently). Ok, it seems that this suggestion is not worth very much,
too.
This tiny benefit simply is not enough.

> My first virtual control I ever wrote (about 2 years ago) was a Virtual
> Listbox. Compared with VT it is/was a very trivial control, just like a
> TLabel compared with a TMemo. The virtual mode of TListView is similar but
> both can rely on a kind of overall index, which is not usable in VT.
> Additionally, for instance in databases, such an index cannot be used
> (unless you use Paradox tables or Table.First/Table.MoveBy which is slow).

Interesting, I have been implementing a virtual listbox, too :) With table (or
band)
style items. But when I found VTree I decided to use it instead and ceased the
development.

> > As far as I know Microsoft did not implement a virtual
> > mode for the treeview. They may have had reasons for that :) It is clear
> > that things are not so easy or straightforward here anymore.
>
> Oh yes. If I take your definition of "virtual" then they have done so. The
> system treeview allows to have a socalled text callback. This will cause the
> treeview to ask back the parent of the tree window (note: not the tree
> window itself, but its window parent!) for every string when it must be
> display. Very much like in VT and the VCL does use this feature. But because
> the captions are retrieved via messages (and redirected because of the fact
> the parent window gets the notification) there is a large overhead.

Oh this is new to me. I can imagine that this communication overhead (which is
probably the same as with a virtual listview) is far from efficient. I wonder
though why the TTreeview is so slooow when some thousand nodes are inserted.
I have experimented with it a little bit and the speed is acceptable if you
don't set captions for the nodes (sic!):

for i := 0 to 10000 do
Treeview.Items.Add;

This is way faster than

for i := 0 to 10000 do
Treeview.Items.Add.Caption := 'tutu';

Costly string reference counting? Anyhow, this is off topic as well, just wanted
to share this info with you.

> Yes, of course, but it would be much "cooler" to have only those nodes
> initialized/fetched which are shown. This way you can show, say, a 1 million
> record table within a couple of seconds (depend on query runtime) because
> you only have to catch a couple of records.

We agree on that. The problem is only to find out *how* with the data that one
wants to present. To get a 1:1 relationship between nodes and node data and at
the same time do not rely on a child index.

> continue this discussion here as it is off topic and likely nobody else on
> this list really cares about it :-]

Ok.

Regards,
Werner


re: Re: Select a node in run-time ?

From: Mike Lischke [public@l...]
Date: Tue Mar 6, 2001 8:41 am
Subject: RE: [VirtualTreeview] Re: Select a node in run-time ?

Hi Mathias,

> Sorry for the delay of my reply, but I just moved from Sweden to
> Chile, so I've been quite busy for a couple of weeks... ;-)

So you were quite busy one weekend ? (just kidding :o])

> ClearSelection or InternalClearSelection is not called.
> In AddToSelection it seems like everything i ok too...
> Here's the calling order as I can see it :

I'm sorry, but I have forgotten what your problem was. Could you please send
a short description again? Thank you and

Ciao, Mike

 | Replies | Author | Date
694 | Re: Select a node in run-time ? | [tias@m...] | Tue 3/6/2001


re: Re: Column clicks

From: Mike Lischke [public@l...]
Date: Tue Mar 6, 2001 9:01 am
Subject: RE: [VirtualTreeview] Re: Column clicks

> Guess I was not very clear (I thought about that just after I posted
> the message). I was thinking about clicks on the column itself,
> per node. I'm trying to achieve a similar behavior as that of the
> check boxes in the main column but in a different column.

You still can utilize OnMouseDown, which works in VT too, of course.

Ciao, Mike

 | Replies | Author | Date
692 | Re: Column clicks | [rferraz@f...] | Tue 3/6/2001


re: Re: Problem with GetHitTestInfoAt

From: Mike Lischke [public@l...]
Date: Tue Mar 6, 2001 9:17 am
Subject: RE: [VirtualTreeview] Re: Problem with GetHitTestInfoAt

> How do you know how many downloads there have been?

The number I presented is only guessed and is likely higher. For ensured
downloads from my homepage go to
http://www.lischke-online.de/Statistics/Main.html (see chapter: Most Popular
Pages). There are ~15K downloads until mid february. On
http://www.delphipages.com/result.cfm?TD=20 you will find another ~3K. I do
not have download counts from Torry or any other site which offers VT for
download, but alone Torry stands for at least 4-5K downloads.

Ciao, Mike


VT Galerie

From: Mike Lischke [public@l...]
Date: Tue Mar 6, 2001 11:03 am
Subject: VT Galerie

Hi all,

in the past days I thought about what cool things can be made with Virtual
Treeview. While it is often not possible to provide demos (as with the
Virtual Tree Combobox that Ondrej and I wrote) at least a screen shot would
be nice to show what is possible. This includes also a normal VT but filled
with unusual data which could not be shown this way using another treeview.

I would like to invite you to send me screen shots of your components,
applications etc. which I can put into a (yet to create) galerie on my
homepage. Please include a short description (and if you like a link and
your eMail address) which will serve as image description.

Mike Lischke
R&D Senior software engineer

 | Replies | Author | Date
697 | Re: VT Galerie | [teusjdejong@p...] | Tue 3/6/2001
700 | Re: VT Galerie | Mike Lischke | Wed 3/7/2001
703 | Re: VT Galerie | [teusjdejong@p...] | Wed 3/7/2001
705 | Re: VT Galerie | Mike Lischke | Wed 3/7/2001


re: Column clicks

From: [rferraz@f...]
Date: Tue Mar 6, 2001 3:32 pm
Subject: Re: Column clicks

--- In [VirtualTreeview@y...], Mike Lischke [public@l...] wrote:
> You still can utilize OnMouseDown, which works in VT too, of course.

Thanks again for your reply. I managed to simulate it with OnClick
(although it has a little quirk). Do you have any plans to add an
event like OnColumnClick(Sender: TObject; Column: Integer)?

Ronaldo


re: Re: Column clicks

From: Mike Lischke [public@l...]
Date: Tue Mar 6, 2001 3:44 pm
Subject: RE: [VirtualTreeview] Re: Column clicks

> Thanks again for your reply. I managed to simulate it with OnClick
> (although it has a little quirk). Do you have any plans to add an
> event like OnColumnClick(Sender: TObject; Column: Integer)?

No plans. I thought it is so easy that it would not be necessary. I mean,
using Tree.Header.ColumnFromPosition with the coordinates from OnClick or
OnMouseDown is all you'd need to determine the column.

Ciao, Mike

 | Replies | Author | Date
695 | Re: Column clicks | [rferraz@f...] | Tue 3/6/2001


re: Select a node in run-time ?

From: [tias@m...]
Date: Tue Mar 6, 2001 4:33 pm
Subject: Re: Select a node in run-time ?

--- In [VirtualTreeview@y...], Mike Lischke [public@l...] wrote:
> Hi Mathias,

Hello there !

>> Sorry for the delay of my reply, but I just moved from Sweden to
>> Chile, so I've been quite busy for a couple of weeks... ;-)
> So you were quite busy one weekend ? (just kidding :o])

A weekend + some more days.... :-)

> I'm sorry, but I have forgotten what your problem was. Could you
please send
> a short description again? Thank you and

Take a look at msg #485 for the complete description of the problem I
encountered.

However, I've constructed a (ugly) solution to force a node to be
selected in run-time :

PVirtualNode nf = The node I want to select
TVirtualStringTree *MainTree; // My tree...
MainTree->ClearSelection();
nf->States = nf->States << vsSelected;

// To make it visible in the tree :
MainTree->IsVisible[nf] = true;
MainTree->TopNode = nf;

// I had to make FSingletonNodeArray & FSelection public and
// add a "write" to SelectedCount...
MainTree->FSingletonNodeArray[0] = nf;
MainTree->SelectedCount = 1;
MainTree->Selected[nf] = true;
MainTree->FSelection.Length = 1;
MainTree->FSelection[0] = nf;
MainTree->FocusedNode = nf;
MainTree->InvalidateNode(nf);

In another posting to ths group I described a problem where
FSingletonNodeArray.Length becomes Zero when I'm driving from
TBaseVirtualTree. It seems that BCB5 has some strange problem with the
Pascal dynamic array, but I have not seen any posting from other BCB5
users, so it looks like it's on my system(s) only. It's the same on
Win95, WinNT 4.0, SP3,4,5 & 6 and Win2000...

As far as I can see, there's not any obvious code in VT that causes
this, I just hoped that maybe some other BCB5 user might have seen
this behaviour an thus being able to help me out (since I know you're
a pure Delphi-Guru, not BCB... ;-))

Regards
/Mathias


re: Column clicks

From: [rferraz@f...]
Date: Tue Mar 6, 2001 7:00 pm
Subject: Re: Column clicks

> No plans. I thought it is so easy that it would not be necessary. I
mean,
> using Tree.Header.ColumnFromPosition with the coordinates from
OnClick or
> OnMouseDown is all you'd need to determine the column.

I see. I'll take a look at ColumnFromPosition.

Thanks

Ronaldo


New file uploaded to VirtualTreeview

From: [VirtualTreeview@yahoogroups.com>
Date: Tue Mar 6, 2001 9:41 pm
Subject: New file uploaded to VirtualTreeview

Hello,

This email message is a notification to let you know that
a file has been uploaded to the Files area of the VirtualTreeview
group.

File : /fm40.exe
Uploaded by : [teusjdejong@p...]
Description : A filemanager with zip and ftp using VT

You can access this file at the URL

http://groups.yahoo.com/group/VirtualTreeview/files/fm40.exe

To learn more about file sharing for your group, please visit

http://help.yahoo.com/help/us/groups/files

Regards,

teusjdejong@p...]


re: VT Galerie

From: [teusjdejong@p...]
Date: Tue Mar 6, 2001 9:50 pm
Subject: Re: VT Galerie

Hi Mike,

I've been so free to upload my program A filemanager to the files
section of the group. If it cannot stay there, it can be downloaded
from www.planet.nl/~teusjdejong/files/fm40.exe. I've also made two
screendumps. I don't know where to send then, but you can find them
here: www.planet.nl/~teusjdejong/files/fmdumps.exe.

Teus de Jong.

--- In [VirtualTreeview@y...], Mike Lischke [public@l...] wrote:
> Hi all,
>
> in the past days I thought about what cool things can be made with
Virtual
> Treeview. While it is often not possible to provide demos (as with
the
> Virtual Tree Combobox that Ondrej and I wrote) at least a screen
shot would
> be nice to show what is possible. This includes also a normal VT
but filled
> with unusual data which could not be shown this way using another
treeview.
>
> I would like to invite you to send me screen shots of your
components,
> applications etc. which I can put into a (yet to create) galerie on
my
> homepage. Please include a short description (and if you like a
link and
> your eMail address) which will serve as image description.
>
> Mike Lischke
> R&D Senior software engineer


re: Creating a component decended from TVirtualStringTree

From: "Colin Meeks" [colin@p...]
Date: Wed Mar 7, 2001 2:47 am
Subject: Re: [VirtualTreeview] Creating a component decended from TVirtualStringTree

Hi Mike

> You should be a bit more specific about your problems. Also the prerelease
should compile with Delphi 4. What
> error do you get?
I thought I included this, sorry. I've reverted back to the release version
now, but will try to reinstall and let you know the error I got. If I
remember correctly it was in VirtualTreesReg.pas and when compiled it
couldn't find
ColnEdit.

Regards

Colin


re: Creating a component decended from TVirtua lStringTree

From: Mike Lischke [public@l...]
Date: Wed Mar 7, 2001 8:46 am
Subject: RE: [VirtualTreeview] Creating a component decended from TVirtua lStringTree

Hi Colin,

> If I remember correctly it was in VirtualTreesReg.pas and when compiled it
> couldn't find ColnEdit.

Yes, now I do remember. It was the problem to install it under BCB, right?
But this is something I cannot answer at all. Perhaps some of the other C++
guys/gals here can give more inside how they installed VT with ColEdit...

If all fails then take the unit out as well as the simple component editor.
The only feature you will loose is that you can double click the tree in the
IDE to show the column editor.

Ciao, Mike


re: Re: VT Galerie

From: Mike Lischke [public@l...]
Date: Wed Mar 7, 2001 8:49 am
Subject: RE: [VirtualTreeview] Re: VT Galerie

Hi Teus,

> I've been so free to upload my program A filemanager to the files
> section of the group. If it cannot stay there, it can be downloaded
> from www.planet.nl/~teusjdejong/files/fm40.exe. I've also made two
> screendumps. I don't know where to send then, but you can find them
> here: www.planet.nl/~teusjdejong/files/fmdumps.exe.

Yep, uploading to YG is also a good idea. But I need a description of the
application where VT is used (well in your case it is clear) and a
description of the image. For instance not only the tree is a VT but also
the file list, correct?

Ciao, Mike

 | Replies | Author | Date
703 | Re: VT Galerie | [teusjdejong@p...] | Wed 3/7/2001


re: Re: Select a node in run-time ?

From: Mike Lischke [public@l...]
Date: Wed Mar 7, 2001 9:48 am
Subject: RE: [VirtualTreeview] Re: Select a node in run-time ?

Hi Mathias,

> Take a look at msg #485 for the complete description of the problem I
> encountered.

This whole problem looks very strange. I don't see any reason why this does
not work on your machine. You wrote that the selection chain is called
correctly. You did not write whether the new node appears in the selection
array or not, but I assume it does. The node (if it is visible) will also be
invalidated so it should also show up as being selected. But since you seem
to have a serious problem with dynamic arrays you should problably fix this
first, because the tree heavily depends on dynamic arrays.

To test whether all worked fine you can then create a tree with only one
node and set it to being selected. While you are stepping through the
SetSelected method you can set (or enable) another breakpoint in the
PaintTree method and watch what happens there. To be on the safe side you
can additionally add further breakpoints in the ClearSelection and
RemoveFromSelection methods.

Ciao, Mike


re: AddChild (was: Problem with GetHitTestInfoA t)

From: Bender Heri [HBender@E...]
Date: Wed Mar 7, 2001 10:54 am
Subject: RE: [VirtualTreeview] AddChild (was: Problem with GetHitTestInfoA t)

> procedure EventSoandso(Sender: TBaseVirtualTree; Node:
> PVirtualNode; Data: pointer; ...otherstuff);
> var
> MyNodeClass: TMyNodeClass;
> begin
> MyNodeClass := TMyNodeClass(Data);
> if (MyNodeClass = nil) then
> exit;
>
> ...do stuff here
> end;
>

You can even leave away the assignement if you declare

var
MyNodeClass : TMyNodeClass absolute Data;

Heri


re: VT Galerie

From: [teusjdejong@p...]
Date: Wed Mar 7, 2001 1:10 pm
Subject: Re: VT Galerie

Hi Mike,

> Yep, uploading to YG is also a good idea. But I need a description
of the
> application where VT is used (well in your case it is clear) and a
> description of the image. For instance not only the tree is a VT
but also
> the file list, correct?

I have made new dumps with a description. The new dumps emphasize the
strength of VT by giving timings for gathering data and displaying
them (210ms to display data for almost 90.000 folders and files!).
You find the dumps again at:
www.planet.nl/~teusjdejong/files/fmdumps.exe. I hope you like the
results of the use of your component in such a strange way.

Teus de Jong.


Creating a Component from VirtualStringView

From: "Colin Meeks" [colin@p...]
Date: Wed Mar 7, 2001 1:46 pm
Subject: Creating a Component from VirtualStringView

Did anybody see the code that I posted for the component I'm trying to
write. The problem I'm having is that the component won't compile unless I
comment out the inherited from the DoGetImageIndex. It gives me the error
"Incompatible Types" and if I do this it doesn't display anything. I'd also
appreciate any other tips or comments.

Colin

 | Replies | Author | Date
706 | Re: Creating a Component from VirtualStringView | Mike Lischke | Wed 3/7/2001
710 | Re: Creating a Component from VirtualStringView | Colin Meeks | Wed 3/7/2001
712 | Re: Creating a Component from VirtualStringView | Bender Heri | Wed 3/7/2001
718 | Re: Creating a Component from VirtualStringView | Mike Lischke | Wed 3/7/2001
713 | Re: Creating a Component from VirtualStringView | Mike Lischke | Wed 3/7/2001
717 | Re: Creating a Component from VirtualStringView | Colin Meeks | Wed 3/7/2001
721 | Re: Creating a Component from VirtualStringView | Mike Lischke | Wed 3/7/2001


re: Re: VT Galerie

From: Mike Lischke [public@l...]
Date: Wed Mar 7, 2001 1:45 pm
Subject: RE: [VirtualTreeview] Re: VT Galerie

> I have made new dumps with a description. The new dumps emphasize the
> strength of VT by giving timings for gathering data and displaying
> them (210ms to display data for almost 90.000 folders and files!).
> You find the dumps again at:
> www.planet.nl/~teusjdejong/files/fmdumps.exe. I hope you like the
> results of the use of your component in such a strange way.

Thank you Teus. It seems your filemanager could become a good alternative to
the normal Windows Explorer. Have you already considered to work together
with the team of GXExplorer (http://www.gexperts.com/gxexplorer/)? They have
a very similar approach to yours but they don't use VT yet ;-)

Ciao, Mike


re: Creating a Component from VirtualStringView

From: Mike Lischke [public@l...]
Date: Wed Mar 7, 2001 1:48 pm
Subject: RE: [VirtualTreeview] Creating a Component from VirtualStringView

Hi Colin,

> Did anybody see the code that I posted for the component I'm trying to
> write. The problem I'm having is that the component won't
> compile unless I
> comment out the inherited from the DoGetImageIndex. It gives
> me the error
> "Incompatible Types" and if I do this it doesn't display
> anything. I'd also
> appreciate any other tips or comments.

I thought you already have solved this. The solution is terribly simple:

function TVTFileBox.DoGetImageIndex(Node: PVirtualNode; Kind: TVTImageKind;
Column: Integer): Integer;
begin
Result := inherited(Node, Kind, Column);
if (column=1) then
result:=GetIconIndex(filename, FILE_ATTRIBUTE_NORMAL);
end;

Ciao, Mike


re: AddChild (was: Problem with GetHitTestInfoA t)

From: Werner Lehmann [wl@b...]
Date: Wed Mar 7, 2001 1:31 pm
Subject: Re: [VirtualTreeview] AddChild (was: Problem with GetHitTestInfoA t)

Bender Heri wrote:
>
> > procedure EventSoandso(Sender: TBaseVirtualTree; Node:
> > PVirtualNode; Data: pointer; ...otherstuff);
> > var
> > MyNodeClass: TMyNodeClass;
> > begin
> > MyNodeClass := TMyNodeClass(Data);
> > if (MyNodeClass = nil) then
> > exit;
> >
> > ...do stuff here
> > end;
> >
>
> You can even leave away the assignement if you declare
>
> var
> MyNodeClass : TMyNodeClass absolute Data;

Hm, are you sure that absolute works with an address that is specified
by a parameter? But anyway, we don't have the data parameter...

WL


IVTEditLink

From: Werner Lehmann [wl@b...]
Date: Wed Mar 7, 2001 3:35 pm
Subject: IVTEditLink

Hi,

I am creating a node editor now. It is basically a TEdit (descendant)
which displays a TForm (descendant) below it when needed. Similar to
a combobox.

One problems need to be solved still, Hopefully someone can help here:

The dropdown form needs to have the tree as parent. Otherwise it
would overlap the vertical tree scrollbar while the edit is clipped.
And even worse: if the tree is scrolled horz/vert the edit is
scrolled with it but the form stays where it is (not below the edit
anymore). This happens only if the parent is not the tree.

But if the parent is the tree and the user wants to edit the last
visible node the dropdown form is still clipped to the tree's client
area. And since this was the last (visible) node there is not much
to be seen of the dropdown form. And if this was the last node in the
tree the user cannot even scroll down.

I may just show the dropdown above the edit then. But I'd like to
avoid that because the size grip of that form would be right above
the edit. Or I'd have to change the whole contents of the form to
look sensible when shown this way (size grips for the right top corner
are not available and so on).

Regards,
Werner

 | Replies | Author | Date
709 | Re: IVTEditLink | Ondrej Kelle | Wed 3/7/2001
747 | Re: IVTEditLink | Werner Lehmann | Fri 3/9/2001
2327 | IVTEditLink | Werner Lehmann | Sun 6/10/2001
2336 | Re: IVTEditLink | Roland | Mon 6/11/2001
2346 | Re: IVTEditLink | Mike Lischke | Mon 6/11/2001
2342 | Re: IVTEditLink | Werner Lehmann | Mon 6/11/2001
2358 | Re: IVTEditLink | Werner Lehmann | Mon 6/11/2001
5287 | IVTEditLink | this_is_koen | Sat 2/2/2002


re: IVTEditLink

From: Ondrej Kelle [O.Kelle@d...]
Date: Wed Mar 7, 2001 3:58 pm
Subject: RE: [VirtualTreeview] IVTEditLink

Hello Werner,

I think it's common for dropdown windows to have the desktop window as
parent (thus not clipped within any parent control), overlapping any other
controls on the active form and even the form itself. You can see the same
behaviour with for example TComboBox.
It's also common for a dropdown window to be hidden whenever it loses focus
or user switches to another application.
I think that with this behaviour most of your problems are solved (or at
least can be tagged with "By design" ;-).

Cheers,
TOndrej


re: Creating a Component from VirtualStringView

From: "Colin Meeks" [colin@p...]
Date: Wed Mar 7, 2001 4:35 pm
Subject: Re: [VirtualTreeview] Creating a Component from VirtualStringView

Hi Mike

> I thought you already have solved this. The solution is terribly simple:
>
> function TVTFileBox.DoGetImageIndex(Node: PVirtualNode; Kind:
TVTImageKind;
> Column: Integer): Integer;
> begin
> Result := inherited(Node, Kind, Column);
> if (column=1) then
> result:=GetIconIndex(filename, FILE_ATTRIBUTE_NORMAL);
> end;

I tried this and still get Incompatible Types on the inherited line.

Colin


re: AddChild (was: Problem with GetHitTestInfoA t)

From: Bender Heri [HBender@E...]
Date: Wed Mar 7, 2001 4:39 pm
Subject: RE: [VirtualTreeview] AddChild (was: Problem with GetHitTestInfoA t)

>
> > You can even leave away the assignement if you declare
> >
> > var
> > MyNodeClass : TMyNodeClass absolute Data;
>
> Hm, are you sure that absolute works with an address that is specified
> by a parameter? But anyway, we don't have the data parameter...
>

Yes, I do this always when writing polymorphic code (parameter is a abstract
base class).

i.E.:

procedure TCEFileTree.OnDragDropCallback(Sender: TBaseVirtualTree; Source:
TObject; DataObject: IDataObject;
const
Formats: array of Word; Shift: TShiftState; Pt: TPoint; var Effect: Integer;
Mode: TDropMode);
var
oFileTree : TCEFileTree absolute Source;
begin
if Source is TCEFileTree then
pSourceNode := oFileTree.FocusedNode;
...
end;


re: Creating a Component from VirtualStringView

From: Bender Heri [HBender@E...]
Date: Wed Mar 7, 2001 4:45 pm
Subject: RE: [VirtualTreeview] Creating a Component from VirtualStringView

> Did anybody see the code that I posted for the component I'm trying to
> write. The problem I'm having is that the component won't
> compile unless I
> comment out the inherited from the DoGetImageIndex. It gives
> me the error
> "Incompatible Types" and if I do this it doesn't display
> anything. I'd also
> appreciate any other tips or comments.
>
> Colin
>

Here it is again this funny problem. If the compiler reports this problem,
you have to repeat the whole call with all parameters:

Result := inherited DoGetImiageIndex((Node,Kind,Column);

I don't know in which cases this is a must.

Heri

 | Replies | Author | Date
718 | Re: Creating a Component from VirtualStringView | Mike Lischke | Wed 3/7/2001


re: Creating a Component from VirtualStringView

From: Mike Lischke [public@l...]
Date: Wed Mar 7, 2001 4:38 pm
Subject: RE: [VirtualTreeview] Creating a Component from VirtualStringView

> I tried this and still get Incompatible Types on the inherited line.

It should be:
Result := inherited DoGetImageIndex(Node, Kind, Column);

I forgot to copy the method name.

Ciao, Mike


re: AddChild (was: Problem with GetHitTestInfoA t)

From: Bender Heri [HBender@E...]
Date: Wed Mar 7, 2001 5:03 pm
Subject: RE: [VirtualTreeview] AddChild (was: Problem with GetHitTestInfoA t)

> exist (compare also virtual reality etc.). But I think we should not
> continue this discussion here as it is off topic and likely
> nobody else on
> this list really cares about it :-]
>
>

I do. It is very interesting.

I also rely on AddChild and have to initialize the node at once I have added
it.
I would prefer the approach that Werner proposed with this optional
parameter (Data : pointer = nil).
IMO this pointer should be saved as is (DataSize = 4) and not be a pointer
to a annother pointer (class ref or record).

Heri

 | Replies | Author | Date
719 | Re: AddChild (was: Problem with GetHitTestInfoA t | Mike Lischke | Wed 3/7/2001


fm40.exe --why is it here?

From: [adembaba@e...]
Date: Wed Mar 7, 2001 5:00 pm
Subject: fm40.exe --why is it here?

Hi,

Am I the only one who has the impression that the files
area is for uploading sample sources for the members to
exchange ideas and solutions.

If so, I find it a little difficult to understand why
fm40.exe is in there as it does not contain any source
code at all.

Or, am I wrong; can we all add upload compiled apps
simply to show what nifty (or not) stuff we have been
keeping ourselves busy lately ;-)

Cheers,

 | Replies | Author | Date
720 | Re: fm40.exe --why is it here? | Mike Lischke | Wed 3/7/2001
724 | Re: fm40.exe --why is it here? | [teusjdejong@p...] | Wed 3/7/2001
737 | Re: fm40.exe --why is it here? | [adembaba@e...] | Thu 3/8/2001


re: OnFocusChanged (VT 2.2)

From: [adembaba@e...]
Date: Wed Mar 7, 2001 5:04 pm
Subject: Re: OnFocusChanged (VT 2.2)

It does harm, in a way, because, to me, at least, it was not
intuitive --I never thought OnFocusChanged would be fired
when I was closing the app.

Thank you for the alteration.

Cheers,

--- In [VirtualTreeview@y...], Mike Lischke [public@l...] wrote:
> > It seems that the new v2.2 has introduced a peculiarity
> > into OnFocusChanged: VT seems to trigger OnFocusChanged
> > when it is being freed.
>
> Mmmh, does it harm? It is fired because the focused node looses the
focus
> when the tree is cleared. On the other hand when the tree is
cleared (and
> even destroyed) it makes not much sense to have a focus change
event. Hence
> I have changed the Clear method to:
>
> procedure TBaseVirtualTree.Clear;
>
> begin
> BeginUpdate;
> try
> InterruptValidation;
> if (ClipboardStates * FStates) <> [] then
> begin
> Include(FStates, tsClipboardCancelling);
> CancelCutOrCopy;
> OleSetClipboard(nil);
> FStates := FStates - ClipboardStates -
[tsClipboardCancelling];
> end;
> ClearSelection;
> FFocusedNode := nil; <<<<<< this is the new
insertion
> DeleteChildren(FRoot);
> FRoot.FirstChild := nil;
> FRoot.LastChild := nil;
> FLastSelected := nil;
> FFocusedNode := nil;
> FCurrentHotNode := nil;
> FVisibleCount := 0;
> FOffsetX := 0;
> FOffsetY := 0;
> finally
> EndUpdate;
> end;
> end;


re: Creating a Component from VirtualStringView

From: "Colin Meeks" [colin@p...]
Date: Wed Mar 7, 2001 5:46 pm
Subject: Re: [VirtualTreeview] Creating a Component from VirtualStringView

Thanks Mike and Heri, component is now installed and working great......
well except a couple of small points :-)

I have set the Editable property in Options, but can't seem to edit?? Do I
have to fire a method to do this? Also I only get an indication of what line
I am on by setting the FullLineSelect option, otherwise I get no moving
cursor, like you'd expect in a Stringgrid.

Finally is it possible to set the alignment of a column, including the
header, I can't see any obvious way.

Overall I'm learning lots about VT and think it's great. I've got lots more
ideas to put to my VTFileBox and will release the final source soon when
I've ironed out the problems above and tidied my source code a bit, there's
loads of redundant variables being set and called.

Many thanks

Colin

 | Replies | Author | Date
721 | Re: Creating a Component from VirtualStringView | Mike Lischke | Wed 3/7/2001


re: Creating a Component from VirtualStringView

From: "Mike Lischke" [public@l...]
Date: Wed Mar 7, 2001 5:56 pm
Subject: RE: [VirtualTreeview] Creating a Component from VirtualStringView

> Here it is again this funny problem. If the compiler reports this problem,
> you have to repeat the whole call with all parameters:
>
> Result := inherited DoGetImiageIndex((Node,Kind,Column);
>
> I don't know in which cases this is a must.

I'm almost sure it is when the method is a function.

Ciao, Mike


re: AddChild (was: Problem with GetHitTestInfoA t)

From: "Mike Lischke" [public@l...]
Date: Wed Mar 7, 2001 6:03 pm
Subject: RE: [VirtualTreeview] AddChild (was: Problem with GetHitTestInfoA t)

> I also rely on AddChild and have to initialize the node at once I have added
> it.
> I would prefer the approach that Werner proposed with this optional
> parameter (Data : pointer = nil).
> IMO this pointer should be saved as is (DataSize = 4) and not be a pointer
> to a annother pointer (class ref or record).

I think it is dangerous to leave this to the tree at all because it is not sure
what the pointer
really contains or points to. Another idea comes to mind. Why not adding the
data pointer to
AddChild/InsertNode *and* to OnInitNode? The tree simply passes the pointer
along (doing an implicit
InitNode) and you can utilize OnInitNode for both nodes added by the
compatibility methods and by
the native methods. Of course to be useful it is required that the data can be
passed via one
pointer.

Ciao, Mike


re: fm40.exe --why is it here?

From: "Mike Lischke" [public@l...]
Date: Wed Mar 7, 2001 6:13 pm
Subject: RE: [VirtualTreeview] fm40.exe --why is it here?

> Am I the only one who has the impression that the files
> area is for uploading sample sources for the members to
> exchange ideas and solutions.
>
> If so, I find it a little difficult to understand why
> fm40.exe is in there as it does not contain any source
> code at all.

Actually, it is not explicitely defined what files are allowed to be uploaded.
Of course if the file
area is misused then upload must be stopped but in this very case there this is
a bit different
since the application serves for the recent inquiry after images for a VT
gallery. This way I can
use the YG file area as temporary storage to avoid sending the stuff via eMail
from my office
account to my private account.

Ciao, Mike

 | Replies | Author | Date
724 | Re: fm40.exe --why is it here? | [teusjdejong@p...] | Wed 3/7/2001
737 | Re: fm40.exe --why is it here? | [adembaba@e...] | Thu 3/8/2001


re: Creating a Component from VirtualStringView

From: "Mike Lischke" [public@l...]
Date: Wed Mar 7, 2001 6:19 pm
Subject: RE: [VirtualTreeview] Creating a Component from VirtualStringView

> I have set the Editable property in Options, but can't seem to edit?? Do I
> have to fire a method to do this? Also I only get an indication of what line
> I am on by setting the FullLineSelect option, otherwise I get no moving
> cursor, like you'd expect in a Stringgrid.
>
> Finally is it possible to set the alignment of a column, including the
> header, I can't see any obvious way.

You have derived your tree from TBaseVirtualTreeview which does no painting nor
does it provide an
editor. So either you use TCustomVirtualStringTree instead or you have to
implement painting
yourself.

Ciao, Mike


re: Column clicks

From: [rferraz@f...]
Date: Wed Mar 7, 2001 7:16 pm
Subject: Re: Column clicks

--- In [VirtualTreeview@y...], [rferraz@f...] wrote:

BTW, would you consider using donated code to simplify the event
management? I've implemented the events in a few lines of code.

Ronaldo

 | Replies | Author | Date
723 | Re: Column clicks | Mike Lischke | Wed 3/7/2001
728 | Re: Column clicks | [rferraz@f...] | Thu 3/8/2001


re: Re: Column clicks

From: "Mike Lischke" [public@l...]
Date: Wed Mar 7, 2001 7:22 pm
Subject: RE: [VirtualTreeview] Re: Column clicks

> BTW, would you consider using donated code to simplify the event
> management? I've implemented the events in a few lines of code.

Of course would I. That's the reason why I made VT open source after all. I
will, however, take the
feedom to modify donated source to fit into the coding style of VT.

Ciao, Mike

 | Replies | Author | Date
728 | Re: Column clicks | [rferraz@f...] | Thu 3/8/2001


re: fm40.exe --why is it here?

From: [teusjdejong@p...]
Date: Wed Mar 7, 2001 8:52 pm
Subject: Re: fm40.exe --why is it here?

Hi Mike,

If it bothers someone to have the filemanager in the file area it is
allright with me to delete it. It can be freely downloaded from my
home page or directly at www.planet.nl/~teusjdejong/files/fm40.exe.

It was never my attention to annoy anyone with my efforts to create
some free stuff for myself and a group of friends.

Teus de Jong.

--- In [VirtualTreeview@y...], "Mike Lischke" [public@l...] wrote:
> > Am I the only one who has the impression that the files
> > area is for uploading sample sources for the members to
> > exchange ideas and solutions.
> >
> > If so, I find it a little difficult to understand why
> > fm40.exe is in there as it does not contain any source
> > code at all.
>
> Actually, it is not explicitely defined what files are allowed to
be uploaded. Of course if the file
> area is misused then upload must be stopped but in this very case
there this is a bit different
> since the application serves for the recent inquiry after images
for a VT gallery. This way I can
> use the YG file area as temporary storage to avoid sending the
stuff via eMail from my office
> account to my private account.
>
> Ciao, Mike

 | Replies | Author | Date
737 | Re: fm40.exe --why is it here? | [adembaba@e...] | Thu 3/8/2001


Experiences with v2.2

From: Werner Lehmann [wl@b...]
Date: Wed Mar 7, 2001 11:41 pm
Subject: Experiences with v2.2

Mike,

I have downloaded v2.2 tonight. While some changes and additions
appear to be 'mind reading' like the voPopup option (I wonder though
where a text property mentioned in the release notes is) stability is
not as good. I am getting some odd behaviour; especially nil's where
they should not be.

OnFocusChanged fires with nil-nodes frequently now. Forced me to add
appropriate checks when there were none necessary before. But this
is ok. But an old problem haunts me again: GetDisplayRect & CompareNode
Positions.

It appears that FPositionCache can contain values with .Node = nil.
For instance here:

function TBaseVirtualTree.FindInPositionCache(Node: PVirtualNode; var
CurrentPos: Cardinal):
PVirtualNode;

...
if CompareNodePositions(FPositionCache[I].Node, Node) <= 0 then
...

I have set a breakpoint here with condition (FPositionCache[I].Node = nil)
and it has been hit just again. This is a bad thing because
CompareNodePositions does not like nil nodes. Is there anything I could
do wrong here? FPositionCache should be an component internal array.

The error is not right away reproducible. But if I force that a tree
branch is rebuild very often (remove children, collapse, add (other) children,
expand) it happens eventually.

The call stack looks like this:

tree.SetExpanded
tree.ToggleNode
tree.InvalidateToBottom
tree.GetDisplayRect
tree.FindInPositionCache

After that the assertion in CompareNodePositions is violated. The application
is not stopped but if I shut it down I will receive an AV in

function TBaseVirtualTree.GetDisplayRect(Node: PVirtualNode; Column: Integer;
TextOnly: Boolean;

at line

// Here we know the node is visible.
Offset := 0;
if tsUseCache in FStates then
begin
// If we can use the position cache then do a binary search to find a
cached node which is as
close as possible
// to the current node. Iterate then through all following and visible
nodes and sum up their
heights.
Temp := FindInPositionCache(Node, Offset);
while Assigned(Temp) and (Temp <> Node) do
begin
Inc(Offset, Temp.NodeHeight); <------- here (!)
Temp := GetNextVisibleNoInit(Temp);
end;
end

No variable values were available anymore but I assume that the
PositionCache has yet another (or the same) nil-node entry.

I also have had another bug. Unfortunately I don't know anymore exactly
where it happens. But it was an overflow error (!). If I recall correctly
it was at a line where FVisibleCount is decremented, something like

Dec(FVisibleCount (,..?));

The value of the variable was 2^32, obviously low(Cardinal) - 1. I will
report this again if I encounter it again and take a note where it happens.

I am not using the visibility node option that you added recently.

BTW, I have had trouble which may have been related to hints with the
previous version (2.1). This was one of the usual not directly reproducible
errors but I notice in the release notes that you fixed a recursion bug
with hints. Hopefully this was the same :)

Regards (and a little bit frustrated about many AV's again)
Werner

 | Replies | Author | Date
727 | Re: Experiences with v2.2 | Werner Lehmann | Thu 3/8/2001
729 | Re: Experiences with v2.2 | Mike Lischke | Thu 3/8/2001
735 | Re: Experiences with v2.2 | Werner Lehmann | Thu 3/8/2001
740 | Re: Experiences with v2.2 | Mike Lischke | Thu 3/8/2001
736 | Re: Experiences with v2.2 | Werner Lehmann | Thu 3/8/2001
741 | Re: Experiences with v2.2 | Mike Lischke | Thu 3/8/2001


re: AddChild (was: Problem with GetHitTestInfoA t)

From: Bender Heri [HBender@E...]
Date: Thu Mar 8, 2001 9:03 am
Subject: RE: [VirtualTreeview] AddChild (was: Problem with GetHitTestInfoA t)

> > I also rely on AddChild and have to initialize the node at
> once I have added
> > it.
> > I would prefer the approach that Werner proposed with this optional
> > parameter (Data : pointer = nil).
> > IMO this pointer should be saved as is (DataSize = 4) and
> not be a pointer
> > to a annother pointer (class ref or record).
>
> I think it is dangerous to leave this to the tree at all
> because it is not sure what the pointer
> really contains or points to. Another idea comes to mind. Why
> not adding the data pointer to
> AddChild/InsertNode *and* to OnInitNode? The tree simply
> passes the pointer along (doing an implicit
> InitNode) and you can utilize OnInitNode for both nodes added
> by the compatibility methods and by
> the native methods. Of course to be useful it is required
> that the data can be passed via one
> pointer.
>
> Ciao, Mike
>

Passing an uninterpreted pointer with AddChild _and_ InsertNode which is
passed again to OnInitNode sounds also interesting. Where would you store
it?

Heri


re: Experiences with v2.2

From: Werner Lehmann [wl@b...]
Date: Thu Mar 8, 2001 11:21 am
Subject: Re: [VirtualTreeview] Experiences with v2.2

Werner Lehmann wrote:
>
> Temp := FindInPositionCache(Node, Offset);
> while Assigned(Temp) and (Temp <> Node) do
> begin
> Inc(Offset, Temp.NodeHeight); <------- here (!)
> Temp := GetNextVisibleNoInit(Temp);
> end;
> end
>
> No variable values were available anymore but I assume that the
> PositionCache has yet another (or the same) nil-node entry.

Cannot be nil (of course, there is an assigned check, but it was late :)
I am just facing the problem again and Temp is $1. Which is not nil
obviously but nothing which should be dereferenced either...

There must be some serious problem with the position cache. If only
the error was reproducible easily.

Werner

PS: Callstack this time:

TCustomVirtualStringTree.InvalidateNode($C15630)
TBaseVirtualTree.InvalidateNode($C15630)
TBaseVirtualTree.GetDisplayRect($C15630, -1, False, False)


re: Column clicks

From: [rferraz@f...]
Date: Thu Mar 8, 2001 2:08 pm
Subject: Re: Column clicks

--- In [VirtualTreeview@y...], "Mike Lischke" [public@l...] wrote:
> Of course would I. That's the reason why I made VT open source after
all. I will, however, take the
> feedom to modify donated source to fit into the coding style of VT.

Sure. I've implemented OnColumnClick(Sender: TBaseVirtualTree; Column:
Integer) and OnColumnDblClick(Sender: TBaseVirtualTree; Column:
Integer). Where do I send the code too? Of course, you'd like to
review the code to see if it's correctly implemented.

Ronaldo


re: Experiences with v2.2

From: Mike Lischke [public@l...]
Date: Thu Mar 8, 2001 4:18 pm
Subject: RE: [VirtualTreeview] Experiences with v2.2

Hi Werner,

> I have downloaded v2.2 tonight. While some changes and additions
> appear to be 'mind reading' like the voPopup option

I needed this for the Tree Combobox I mentioned in a previous mail.

> (I wonder though where a text property mentioned in the release notes is)

Public section of TCustomVirtualStringTree.

> stability is
> not as good. I am getting some odd behaviour; especially nil's where
> they should not be.

I have investigated this problem and found something which should already
have been a serious problem. So serious that I wonder why my applications
didn't crash all the time. Ok, the error can only appear if there are enough
nodes to start using the cache. The problem in short: the cache was wrongly
filled because the count of visible nodes was wrong. I think the fact that
there were no more crashes proves how solid the tree in most of its parts
actually is.

> OnFocusChanged fires with nil-nodes frequently now. Forced me to add
> appropriate checks when there were none necessary before. But this
> is ok.

A quick test did not show any anomalies. Can you give me some examples where
a nil pointer came in?

>But an old problem haunts me again: GetDisplayRect &
> CompareNode Positions.

This is likely connected with the invalid cache problem. Please try out the
new source I will soon upload and see if this works now.

> I also have had another bug. Unfortunately I don't know
> anymore exactly where it happens. But it was an overflow error (!). If I
> recall correctly it was at a line where FVisibleCount is decremented,
something like

Could also be related to the wrong calculation. It was caused by a wrong
FVisibleCount value.

Ciao, Mike


re: AddChild (was: Problem with GetHitTestInfoA t)

From: Mike Lischke [public@l...]
Date: Thu Mar 8, 2001 4:24 pm
Subject: RE: [VirtualTreeview] AddChild (was: Problem with GetHitTestInfoA t)

Hi Heri,

> Passing an uninterpreted pointer with AddChild _and_
> InsertNode which is
> passed again to OnInitNode sounds also interesting. Where
> would you store
> it?

I would nowhere store this pointer. On AddChild this pointer is passed in by
the application and directly passed through to InitNode which in turn
immedately would passed in on to the application again by calling
OnInitNode. After the event returns the pointer is no longer given any
attention.

To all:
I really would like to hear other opinions too about this matter (and any
other things related to VT). Aside Heri, Werner, Adem and Paul there should
be other people who like to direct the development of VT. Meanwhile there
are more than 220 subscribers on this list. Please don't just listen, but
help :o]

Ciao, Mike


re: Re: Column clicks

From: Mike Lischke [public@l...]
Date: Thu Mar 8, 2001 4:31 pm
Subject: RE: [VirtualTreeview] Re: Column clicks

Hi Ronaldo,

> Sure. I've implemented OnColumnClick(Sender:
> TBaseVirtualTree; Column:
> Integer) and OnColumnDblClick(Sender: TBaseVirtualTree; Column:
> Integer). Where do I send the code too? Of course, you'd like to
> review the code to see if it's correctly implemented.

Aaah, this is bad luck. I have already implemented these events for the
header four days ago. I needed to get the column on a right click (for a
popup menu) and wrote btw. the stuff needed to get mouse down and up as well
as mouse move and double click for the header. OnHeaderClick was already
there for a long time.

Sorry, Mike :-/

 | Replies | Author | Date
742 | Re: Column clicks | [rferraz@f...] | Thu 3/8/2001
743 | Re: Column clicks | Mike Lischke | Thu 3/8/2001
744 | Re: Column clicks | [rferraz@f...] | Thu 3/8/2001
745 | Re: Column clicks | [rferraz@f...] | Thu 3/8/2001


New features

From: Mike Lischke [public@l...]
Date: Thu Mar 8, 2001 4:45 pm
Subject: New features

I just have uploaded a new prerelease of Virtual Treeview. It took much
longer than I thought initially but I wanted to have the one new main
feature finished. The tree is now fully bidi aware and can work in left and
right alignment as well as centered columns. Even multiselection has been
improved to take care of alignment and bidi mode combinations. Other things
changed are:

- tsValidationNeeded
- header drawing
- check event rework
- PrepareGridExtensions
- CM_ENABLEDCHANGED for desgin time
- public header click index
- draw selection improvement for all text alignments and bidi modes
- more header mouse events (OnHeaderDblClick, OnHeaderMouseDown,
OnHeaderMouseMove, OnHeaderMouseUp)
- virtual event trigger methods for those mouse events
- multiline hints
- THitPositions
- and bug fixes, bug fixes, bug fixes

Have fun and

Ciao, Mike

Mike Lischke
R&D Senior software engineer


re: AddChild (was: Problem with GetHitTestInfoA t)

From: Bender Heri [HBender@E...]
Date: Thu Mar 8, 2001 4:49 pm
Subject: RE: [VirtualTreeview] AddChild (was: Problem with GetHitTestInfoA t)

> Hi Heri,
>
> > Passing an uninterpreted pointer with AddChild _and_
> > InsertNode which is
> > passed again to OnInitNode sounds also interesting. Where
> > would you store
> > it?
>
> I would nowhere store this pointer. On AddChild this pointer
> is passed in by
> the application and directly passed through to InitNode which in turn
> immedately would passed in on to the application again by calling
> OnInitNode. After the event returns the pointer is no longer given any
> attention.
>

I assumed you have in mind a way to init the nodes asynchronly with AddChild
like in InsertNode. If you call InitNode directly after AddChild the benefit
is lost. In contrary, there would be more code to write to achieve the same
effect I get when I do the init myself after the AddChild.

Why not leave the node uninitialized and store the pointer in the UserData.
You can distinguish it by the option vsInitialized if there is this raw
pointer or the real user data.

Heri

 | Replies | Author | Date
738 | Re: AddChild | Mike Lischke | Thu 3/8/2001


re: AddChild (was: Problem with GetHitTestInfoA t)

From: "centra" [tradsom@t...]
Date: Thu Mar 8, 2001 12:48 pm
Subject: Re: [VirtualTreeview] AddChild (was: Problem with GetHitTestInfoA t)

Hi there

Just watching the caravan pass for the time being 'cause I've been too short
of time and haven't even had a chance to experiment with your terrific,
fantastic VirtualTree. But as soon as I roll up my sleeves you'll probably
get sick and tired of hearing of me.

Just wait and see.

Good job!

Bob Wilson

> To all:
> I really would like to hear other opinions too about this matter (and any
> other things related to VT). Aside Heri, Werner, Adem and Paul there
should
> be other people who like to direct the development of VT. Meanwhile there
> are more than 220 subscribers on this list. Please don't just listen, but
> help :o]
>
> Ciao, Mike
>
>
> To unsubscribe from this group, send an email to:
> VirtualTreeview-unsubscribe@egroups.com
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>
>

 | Replies | Author | Date
739 | Re: AddChild | Mike Lischke | Thu 3/8/2001


re: Experiences with v2.2

From: Werner Lehmann [wl@b...]
Date: Thu Mar 8, 2001 5:37 pm
Subject: Re: [VirtualTreeview] Experiences with v2.2

Werner Lehmann wrote:
>
> Werner Lehmann wrote:
> >
> > Temp := FindInPositionCache(Node, Offset);
> > while Assigned(Temp) and (Temp <> Node) do
> > begin
> > Inc(Offset, Temp.NodeHeight); <------- here (!)
> > Temp := GetNextVisibleNoInit(Temp);
> > end;
> > end
> >
> > No variable values were available anymore but I assume that the
> > PositionCache has yet another (or the same) nil-node entry.
>
> Cannot be nil (of course, there is an assigned check, but it was late :)
> I am just facing the problem again and Temp is $1. Which is not nil
> obviously but nothing which should be dereferenced either...
>
> There must be some serious problem with the position cache. If only
> the error was reproducible easily.

I got it again. This time with some breakpoint trip wires lying around.
The (one) problem is here:

function TBaseVirtualTree.FindInPositionCache(Node: PVirtualNode; var
CurrentPos: Cardinal):
PVirtualNode;

// Looks through the position cache and returns the node whose top position is
the largest one which
is smaller or equal
// to the position of the given node.

var
L, H, I: Integer;

begin
L := 0;
H := High(FPositionCache);
while L <= H do
begin
I := (L + H) shr 1;
if CompareNodePositions(FPositionCache[I].Node, Node) <= 0 then
L := I + 1
else
H := I - 1;
end;
Result := FPositionCache[L - 1].Node; <----------------
CurrentPos := FPositionCache[L - 1].AbsoluteTop;
end;

In the line marked with an arrow the value of L is 0. FPositionCache[L - 1] is
$1 which leads to the described desaster in GetDisplayRect.

Some variable values at the breakpoint:
Length(FPositionCache) = 2
H = -1
I = 0
CurrentPos = 0

Mike, this looks like a binary search algorithm. As far as I know (knowledge
from Sedgewicks book 'Algorithms') you should not only check (L <= H) but
also if the element which is searched for is already found. I can post the
pascal source which Sedgewick provides if it is of help for you. Furthermore,
he uses the value of I as 'Found' index, not the lower bound minus 1.

I can reproduce the problem at the moment and will keep a copy of my code in
that state for further tests if you confirm the problem and provide a solution.

Regards,
Werner

 | Replies | Author | Date
740 | Re: Experiences with v2.2 | Mike Lischke | Thu 3/8/2001


re: Experiences with v2.2

From: Werner Lehmann [wl@b...]
Date: Thu Mar 8, 2001 6:08 pm
Subject: Re: [VirtualTreeview] Experiences with v2.2

Werner Lehmann wrote:
>
> I got it again. This time with some breakpoint trip wires lying around.
> The (one) problem is here:

Mike,

I just wanted to let you know that this does not crash anymore with your new
version from today. I am still a little bit concerned that L might be 0 and
(0 - 1) is not a good value for an array index. So I am keeping my breakpoint
on that line for some time.

Overall I seem to get no crashes anymore (before every other time I shutdown
my app something went wrong) :)

Regards,
Werner

PS: you forgot to include virtualtrees.res in the ZIP. I am using the old one.
Just in case someone wonders. My D5 brought up a DivByZero exception when I
tried to compile the package without the *.res...

 | Replies | Author | Date
741 | Re: Experiences with v2.2 | Mike Lischke | Thu 3/8/2001


re: fm40.exe --why is it here?

From: [adembaba@e...]
Date: Thu Mar 8, 2001 6:49 pm
Subject: Re: fm40.exe --why is it here?

> If it bothers someone to have the filemanager in the file area it
is
> allright with me to delete it. It can be freely downloaded from my
> home page or directly at www.planet.nl/~teusjdejong/files/fm40.exe.
>
> It was never my attention to annoy anyone with my efforts to create
> some free stuff for myself and a group of friends.

Teus,

I suppose I am the 'someone'; so I must clarify:

It is not your app or the nature of its purpose or functionality
that made me bring up the poit. On the contrary, it seems like
a very good app.

But, it would have been helpful if you wrote a couple of words
in its description line (when you are uploading it) saying
what it does and that it contains compiled exe only.

Regards,

Adem


re: AddChild

From: "Mike Lischke" [public@l...]
Date: Thu Mar 8, 2001 7:32 pm
Subject: RE: [VirtualTreeview] AddChild

> I assumed you have in mind a way to init the nodes asynchronly with AddChild
> like in InsertNode. If you call InitNode directly after AddChild the benefit
> is lost. In contrary, there would be more code to write to achieve the same
> effect I get when I do the init myself after the AddChild.
>
> Why not leave the node uninitialized and store the pointer in the UserData.
> You can distinguish it by the option vsInitialized if there is this raw
> pointer or the real user data.

What I have in mind is to have a the developer use a central place to
initialize the nodes. Since
the tree does use OnInitNode implicitely it is only natural that the
application does use it too.
The problem is still that you cannot pass the data you have when you use
AddChild or InsertNode to
OnInitNode (if you have a handler for this event at all). My idea is to pass a
pointer to data to be
used to init a node along via the AddChild method and make it so possible to use
OnInitNode/OnInitChildren exclusively.

Ciao, Mike


re: AddChild

From: "Mike Lischke" [public@l...]
Date: Thu Mar 8, 2001 7:35 pm
Subject: RE: [VirtualTreeview] AddChild

Hi Bob,

> Just watching the caravan pass for the time being 'cause I've been too short
> of time and haven't even had a chance to experiment with your terrific,
> fantastic VirtualTree. But as soon as I roll up my sleeves you'll probably
> get sick and tired of hearing of me.

Let's see what you can come up with :-) For usual beginners questions (aka
FAQs) you will have my
help as well as those of some very helpful people like Werner. Additionally,
there is the message
archive at YG which just waits to be used for recherche.

If you find a bug, however, then I'm here and listen (and will fix it :o])...

Ciao, Mike


re: Experiences with v2.2

From: "Mike Lischke" [public@l...]
Date: Thu Mar 8, 2001 8:09 pm
Subject: RE: [VirtualTreeview] Experiences with v2.2

Hi Werner,

> Mike, this looks like a binary search algorithm. As far as I know (knowledge
> from Sedgewicks book 'Algorithms') you should not only check (L <= H) but
> also if the element which is searched for is already found. I can post the
> pascal source which Sedgewick provides if it is of help for you. Furthermore,
> he uses the value of I as 'Found' index, not the lower bound minus 1.

Indeed this is not so trivial stuff. The FindInPositionCache method is a
specialized binary search
routine which searches for a node with the highest vertical position which is
still lower than a
given node. The error you got was caused by the fact that I did not store the
very first node of the
tree in the cache. In the older version this was not necessary but in the new
one (where I have
completely removed one of the caches!) it is necessary as low termination
point. Otherwise L can
become < 1 which will cause trouble in the final cache access. This problem has
been fixed however.

Thank you for offering the Sedgewick code but I have the version for C here in
my office. It was the
source which inspired me to the tree sort algorithm :o] I don't know however
why I have not used the
equal case and break the loop in the binary search. I will get to it tomorrow.

Ciao, Mike


re: Experiences with v2.2

From: "Mike Lischke" [public@l...]
Date: Thu Mar 8, 2001 8:11 pm
Subject: RE: [VirtualTreeview] Experiences with v2.2

> I just wanted to let you know that this does not crash anymore with your new
> version from today. I am still a little bit concerned that L might be 0 and
> (0 - 1) is not a good value for an array index. So I am keeping my breakpoint
> on that line for some time.

Great to hear that you get no crash anymore. Even if it looks as would the
control be totally
instable it is usually only one weak point. Stability is one of the major issue
I have to consider.
Remember, we use VT in one of our best selling products (and in more in the
future).

> PS: you forgot to include virtualtrees.res in the ZIP. I am using the old one.

Yep, thank you. I have fixed also this.

Ciao, Mike


re: Column clicks

From: [rferraz@f...]
Date: Thu Mar 8, 2001 8:15 pm
Subject: Re: Column clicks

--- In [VirtualTreeview@y...], Mike Lischke [public@l...] wrote:
> Aaah, this is bad luck. I have already implemented these events for
the
> header four days ago. I needed to get the column on a right click
(for a
> popup menu) and wrote btw. the stuff needed to get mouse down and up
as well
> as mouse move and double click for the header. OnHeaderClick was
already
> there for a long time.

Yes, I know :-) But the events I implemented are not fired for the
header, they're fired for the column themselves (client area). The
events are useful when implementing a behavior like that of checked
boxes in the main column in other columns. For example, my application
implements check boxes in an additional column and I need those events
to implement that behavior.

Ronaldo

 | Replies | Author | Date
743 | Re: Column clicks | Mike Lischke | Thu 3/8/2001
744 | Re: Column clicks | [rferraz@f...] | Thu 3/8/2001
745 | Re: Column clicks | [rferraz@f...] | Thu 3/8/2001


re: Re: Column clicks

From: "Mike Lischke" [public@l...]
Date: Thu Mar 8, 2001 9:00 pm
Subject: RE: [VirtualTreeview] Re: Column clicks

> Yes, I know :-) But the events I implemented are not fired for the
> header, they're fired for the column themselves (client area). The
> events are useful when implementing a behavior like that of checked
> boxes in the main column in other columns. For example, my application
> implements check boxes in an additional column and I need those events
> to implement that behavior.

Mmmh, why not? Yes, send your code to [public@l...] Let me see what
you've done.

Ciao, Mike

 | Replies | Author | Date
744 | Re: Column clicks | [rferraz@f...] | Thu 3/8/2001
745 | Re: Column clicks | [rferraz@f...] | Thu 3/8/2001


re: Column clicks

From: [rferraz@f...]
Date: Thu Mar 8, 2001 9:31 pm
Subject: Re: Column clicks

--- In [VirtualTreeview@y...], "Mike Lischke" [public@l...] wrote:
> Mmmh, why not? Yes, send your code to [public@l...] Let me see what
you've done.

The code in on its way :-)

Ronaldo

 | Replies | Author | Date
745 | Re: Column clicks | [rferraz@f...] | Thu 3/8/2001


re: Column clicks

From: [rferraz@f...]
Date: Thu Mar 8, 2001 9:39 pm
Subject: Re: Column clicks

> The code in on its way :-)
^^
Ops. Typing too fast. The code is on its way :-)

Ronaldo


Text is 'clipped' when a node is focused

From: [zh66w6@h...]
Date: Fri Mar 9, 2001 9:28 am
Subject: Text is 'clipped' when a node is focused

Hi All,

I seem to be having a very strange problem with VitrualTreeView.

I'm using the tree to reflect the data I have stored in a database.
Here's what I do:

To initialise the tree I walk through the database, adding nodes to
the tree. Each time I add a node, I have to immediately iniialise it
in order to associate a Bookmark to the newly created node. To do
this I use the ReinitNode(Node, FALSE) command (is this correct?) and
in the OnInitNode event I create the Bookmark. I have to initialise
the node immediately as otherwise the database will be on the wrong
record.

To display the node text, node style and images I jump to the
bookmark, examine the data in the record and set the appropriate
values. To jump to the correct bookmark I use the OnBeforeItemPaint
event.

The problem occurs when I try to select a node. As soon as the node
get the focus, it is clipped to what seems to be the length of the
DefaultText i.e. If the node should display 'This is a Test Node', it
displays 'Thi...'. As soon as the node loses focus, it is displayed
correctly. Also, text in the other columns (I'm using ExtendedSelect)
cannot be selected unless I click on the extreme left of the text. It
seems that the VirtualTreeView is not calculating the length of the
text correctly.

Before I used the OnBeforeItemPaint event to find the correct record,
I was searching for the bookmark each time I needed data from the
database i.e. OnGetText, OnGetImageIndex etc. Obviously, this was not
a very efficient was of doing things and slowed the application down.
It did however get rid of the focusing problem!

I'm sure I've seen somebody mention this problem in this group
before, but don't remember them getting an answer.

If anybody wants a copy of my source or .exe, let me know and I'll
mail it to you.

Cheers,
Paul Thornton

P.S. I'm also having a problem with the database bookmark lookups
slowing down after I've posted to the database. If anyone has any
ideas about this, they can check out the discussion at Experts
Exchange (http://www.experts-exchange.com/jsp/qManageQuestion.jsp?
qid=20088671)

 | Replies | Author | Date
748 | Re: Text is 'clipped' when a node is focused | Mike Lischke | Fri 3/9/2001
750 | Re: Text is 'clipped' when a node is focused | [zh66w6@h...] | Fri 3/9/2001
749 | Re: Text is 'clipped' when a node is focused | Werner Lehmann | Fri 3/9/2001
752 | Re: Text is 'clipped' when a node is focused | [zh66w6@h...] | Fri 3/9/2001
753 | Re: Text is 'clipped' when a node is focused | [zh66w6@h...] | Fri 3/9/2001
754 | Re: Text is 'clipped' when a node is focused | [zh66w6@h...] | Fri 3/9/2001


re: IVTEditLink

From: Werner Lehmann [wl@b...]
Date: Thu Mar 8, 2001 10:58 pm
Subject: Re: [VirtualTreeview] IVTEditLink

Ondrej,

I noticed that combobox behaviour. But I like somewhat that the dropdown
form can be scrolled with the tree (it is frequently hidden partially).

Well, I cannot have it all. Having implemented the tree parented dropdown
form style I will check out how the desktop window parented style 'feels'.
The possibly difficult thing here is the focus mangement. The dropdown needs
to be hidden if the focus is lost but in my case the focus may change
between the TEdit and the TForm which is used for dropdown. It is not enough
to hide everything if a 'focus lost' signal comes in. I will see if I can
work around this with a flag or something else.

Thanks for your suggestion :)

Werner


re: Text is 'clipped' when a node is focused

From: Mike Lischke [public@l...]
Date: Fri Mar 9, 2001 9:39 am
Subject: RE: [VirtualTreeview] Text is 'clipped' when a node is focused

Hi Paul,

> To initialise the tree I walk through the database, adding nodes to
> the tree. Each time I add a node, I have to immediately iniialise it
> in order to associate a Bookmark to the newly created node. To do
> this I use the ReinitNode(Node, FALSE) command (is this correct?)

ValidateNode would be correct because you don't want to make the node not
being initialized but you want it indeed initialized.

> DefaultText i.e. If the node should display 'This is a Test Node', it
> displays 'Thi...'. As soon as the node loses focus, it is displayed
> correctly. Also, text in the other columns (I'm using ExtendedSelect)
> cannot be selected unless I click on the extreme left of the text. It
> seems that the VirtualTreeView is not calculating the length of the
> text correctly.

Yep. The problem is the tree calculates the lengths before your node gets
initialized. To prevent this you can place BeginUpdate/EndUpdate around your
tree construction code.

Ciao, Mike

 | Replies | Author | Date
750 | Re: Text is 'clipped' when a node is focused | [zh66w6@h...] | Fri 3/9/2001


re: Text is 'clipped' when a node is focused

From: Werner Lehmann [wl@b...]
Date: Fri Mar 9, 2001 9:53 am
Subject: Re: [VirtualTreeview] Text is 'clipped' when a node is focused

Paul,

this is a common problem and you are right that the node width is not
updated (it is held in a cache according to Mike). You can either use
BeginUpdate/EndUpdate. But this may affect the order in which your
OnInitNode events come in. Or you do an explicit InvalidateNode when
your new node has got its data. It will query imageindex, text etc again
and calculate the text width, too.

Apart from that, I don't know how fast your current approach is. But
did you consider to cache DB data? I mean store the values of relevant
DB fields in the node record for instance. You have to fetch them only
once then from the DB. Of course: if your DB changes you need to be aware
of it to invalidate the appropriate node caches. As long as you are the
only user of the DB (no multiuser access) this should be an easy thing
to do. Just a thought.

Regards,
Werner

 | Replies | Author | Date
752 | Re: Text is 'clipped' when a node is focused | [zh66w6@h...] | Fri 3/9/2001
753 | Re: Text is 'clipped' when a node is focused | [zh66w6@h...] | Fri 3/9/2001
754 | Re: Text is 'clipped' when a node is focused | [zh66w6@h...] | Fri 3/9/2001


re: Text is 'clipped' when a node is focused

From: [zh66w6@h...]
Date: Fri Mar 9, 2001 10:00 am
Subject: Re: Text is 'clipped' when a node is focused

--- In [VirtualTreeview@y...], Mike Lischke [public@l...] wrote:
> Hi Paul,
>
> > To initialise the tree I walk through the database, adding nodes
to
> > the tree. Each time I add a node, I have to immediately iniialise
it
> > in order to associate a Bookmark to the newly created node. To do
> > this I use the ReinitNode(Node, FALSE) command (is this correct?)
>
> ValidateNode would be correct because you don't want to make the
node not
> being initialized but you want it indeed initialized.
>

When I Use ValidateNode instead of ReInitNode on the first node of
the tree, the wrong bookmark is assigned to the node :( Using
ValidateNode on all subsequent nodes seems to work fine though!?

> > DefaultText i.e. If the node should display 'This is a Test
Node', it
> > displays 'Thi...'. As soon as the node loses focus, it is
displayed
> > correctly. Also, text in the other columns (I'm using
ExtendedSelect)
> > cannot be selected unless I click on the extreme left of the
text. It
> > seems that the VirtualTreeView is not calculating the length of
the
> > text correctly.
>
> Yep. The problem is the tree calculates the lengths before your
node gets
> initialized. To prevent this you can place BeginUpdate/EndUpdate
around your
> tree construction code.
>

I've added BeginUpdate/EndUpdate around my tree building code, but
the problem is still there. It seems very strange as the tree knows
how long the text is as it trys to display the correct text, it is
just the clipping box which is the wrong size. If I click for a
second time on the focused node, the clipping disappears and the text
is displayed correctly. It may be easier to explain if I send you a
copy of the .exe then you can try it out for yourself.

> Ciao, Mike

Thanks Mike.


re: Re: Text is 'clipped' when a node is focuse d

From: Bender Heri [HBender@E...]
Date: Fri Mar 9, 2001 10:11 am
Subject: RE: [VirtualTreeview] Re: Text is 'clipped' when a node is focuse d

> I've added BeginUpdate/EndUpdate around my tree building code, but
> the problem is still there. It seems very strange as the tree knows
> how long the text is as it trys to display the correct text, it is
> just the clipping box which is the wrong size. If I click for a
> second time on the focused node, the clipping disappears and the text
> is displayed correctly. It may be easier to explain if I send you a
> copy of the .exe then you can try it out for yourself.

I had the same problem but only with with the nodes at the first level.

I solved it with follwing workaround after I built the tree:

// workaround to initialize root nodes completeley (ability to
get focused)
pNode := RootNode.FirstChild;
while pNode <> nil do begin
FocusedNode := pNode;
pNode := pNode.NextSibling;
end;
FocusedNode := nil;

Heri


re: Text is 'clipped' when a node is focused

From: [zh66w6@h...]
Date: Fri Mar 9, 2001 10:13 am
Subject: Re: Text is 'clipped' when a node is focused

Hi Werner,

--- In [VirtualTreeview@y...], Werner Lehmann [wl@b...] wrote:
> Paul,
>
> this is a common problem and you are right that the node width is
not
> updated (it is held in a cache according to Mike). You can either
use
> BeginUpdate/EndUpdate. But this may affect the order in which your
> OnInitNode events come in. Or you do an explicit InvalidateNode when
> your new node has got its data. It will query imageindex, text etc
again
> and calculate the text width, too.
>

I've added an InvalidateNode in the OnBeforeItemPaint event and it
seems to have done the trick :)

> Apart from that, I don't know how fast your current approach is. But
> did you consider to cache DB data? I mean store the values of
relevant
> DB fields in the node record for instance. You have to fetch them
only
> once then from the DB. Of course: if your DB changes you need to be
aware
> of it to invalidate the appropriate node caches. As long as you are
the
> only user of the DB (no multiuser access) this should be an easy
thing
> to do. Just a thought.
>

My DB is likely to get very large, and change quite a bit, so I'm
trying to store as little as possible in the tree data.

Thanks for your help.

Paul

> Regards,
> Werner

 | Replies | Author | Date
753 | Re: Text is 'clipped' when a node is focused | [zh66w6@h...] | Fri 3/9/2001
754 | Re: Text is 'clipped' when a node is focused | [zh66w6@h...] | Fri 3/9/2001


re: Text is 'clipped' when a node is focused

From: [zh66w6@h...]
Date: Fri Mar 9, 2001 10:31 am
Subject: Re: Text is 'clipped' when a node is focused

> > your new node has got its data. It will query imageindex, text
etc
> again
> > and calculate the text width, too.
> >
>
> I've added an InvalidateNode in the OnBeforeItemPaint event and it
> seems to have done the trick :)
>

Oops, spoke too soon :) It does work, but it seems to get called
recusively. None of the other controls get updated! Where would be
the best place to all the InvalidateNode call? I call ValidateNode
right after I've created the node, and the database information never
changes after that. Why are subsequent calls to InvalidateNode
required?

 | Replies | Author | Date
754 | Re: Text is 'clipped' when a node is focused | [zh66w6@h...] | Fri 3/9/2001


re: Text is 'clipped' when a node is focused

From: [zh66w6@h...]
Date: Fri Mar 9, 2001 10:47 am
Subject: Re: Text is 'clipped' when a node is focused

--- In [VirtualTreeview@y...], [zh66w6@h...] wrote:
>
> > > your new node has got its data. It will query imageindex, text
> etc
> > again
> > > and calculate the text width, too.
> > >
> >
> > I've added an InvalidateNode in the OnBeforeItemPaint event and
it
> > seems to have done the trick :)
> >
>
> Oops, spoke too soon :) It does work, but it seems to get called
> recusively. None of the other controls get updated! Where would be
> the best place to all the InvalidateNode call? I call ValidateNode
> right after I've created the node, and the database information
never
> changes after that. Why are subsequent calls to InvalidateNode
> required?

OK, I can answer my own question on this one :) When I put the
InvalidateNode call in the OnFocusChanged event it works great (but
doesn't work when I put it in the OnFocusChanging event which seems a
bit strange).


Occasional error in InternalClearSelection

From: Werner Lehmann [wl@b...]
Date: Fri Mar 9, 2001 3:28 pm
Subject: Occasional error in InternalClearSelection

Mike,

every once in a while I am getting an AV in VTree when I close my
application. Has been happening for quite some time (last two VTree
versions).

This may very well be a problem on my side; I simply don't know the
cause yet. I am posting the details nevertheless in case you notice
something about the problem (now or in future) or if anyone else may
have the problem occasionally and could help.

Regards,
Werner

PS: I can reproduce the error now. Strange enough: It happens when
the VTree is cleared and a branch with some 1000 nodes is expanded
at that time *and* any node below child #13 is selected. I don't see
any specialities which set node #13 apart from #14. Both are visible
and are located about at the vertical center of the tree which is not
scrolled down.

It does not happen if a branch with similar data has much less (a few
100) nodes. So I limited the number of nodes in my test branch to see
what happens and the problem went away. Unfortunately it did not return
after I removed the node number limit; I don't experience the problem
currently anymore. Without a change in the source code. Very strange.

------------------------

The debugger stops at this line (arrow):

procedure TBaseVirtualTree.InternalClearSelection;

begin
while FSelectionCount > 0 do
begin
Dec(FSelectionCount);
Exclude(FSelection[FSelectionCount].States, vsSelected); <--------
end;
FLastSelectionLevel := -1;
FRangeAnchor := nil;
FSelection := nil;
Exclude(FStates, tsClearPending);
end;

FSelectionCount is 0 on that line. Length(FSelection) is 1. I guess
there is a node in FSelection which is already freed since this
happens when I clear my data structures including the trees.

The call stack (why can't I copy and paste it?):

TBaseVirtualTree.SetExpanded($16157C8, False)
TBaseVirtualTree.ToggleNode($16157C8)
TBaseVirtualTree.DoCollapsed($16157C8)

At this point my event handler for OnCollapsed tries to select and focus the
collapsed node; it clear the selection first, here comes the problem (but not
always). See below.

TBaseVirtualTree.ClearSelection
TBaseVirtualTree.InternalClearSelection

The handler for OnCollapse (this tries to ensure that the focused node is
always 'fully visible'):

with Sender do
if (FocusedNode = nil) or not FullyVisible[FocusedNode] then
SelectAndFocus(Sender, Node);

procedure SelectAndFocus(Tree: TVirtualStringTree; Node: PVirtualNode; Column:
integer = -1);
begin
if (Tree = nil) or (Node = nil) then
exit;

Tree.ClearSelection;
if (Column >= 0) and (Column <> Tree.FocusedColumn) then
Tree.FocusedColumn := Column;

Tree.FocusedNode := Node;
if (Tree.FocusedNode <> nil) then
Tree.Selected[Tree.FocusedNode] := true;
end;

 | Replies | Author | Date
758 | Re: Occasional error in InternalClearSelection | Mike Lischke | Sat 3/10/2001
759 | Re: Occasional error in InternalClearSelection | Werner Lehmann | Sat 3/10/2001
763 | Re: Occasional error in InternalClearSelection | Mike Lischke | Sun 3/11/2001


Patch for PopupMenus

From: "Wez Furlong" [wez.egroups@t...]
Date: Fri Mar 9, 2001 5:58 pm
Subject: Patch for PopupMenus

Mike,

This patch slightly alters the behaviour of the context-popup code so that
the behaviour works as the user would expect.

The problem:
When the PopupMenu property is assigned and when using the OnGetPopupMenu
event, the menu specified by the PopupMenu is popped up before the
OnGetPopupMenu event is fired. When the event is subsequently fired, the
returned popup menu is displayed for a fraction of a second before being
cancelled (You can hear the menu begin popped up, but not see it).

The solution:
I've changed the DoPopupMenu call so that it returns a Boolean indicating
that it displayed a popupmenu.
The DoPopupMenu call has been moved from the WMRButtonUp handler and into a
DoContextPopup handler (a new procedure).
DoContextPopup is called as part of the WMRButtonUp code in TControl.

I have included the affected methods in their entirety below, as well as a
"standard" context diff (using GNU diff), and my complete source file as
attachments.

Possible Caveats: I'm not sure if the OnContextPopup event is present prior
to Delphi 5, so maybe a slightly different solution is needed!

--Wez.

procedure TBaseVirtualTree.WMRButtonUp(var Message: TWMRButtonUp);
// handle right click selection and node specific popup menu
var
HitInfo: THitInfo;

begin
Exclude(FStates, tsRightButtonDown);

if FHeader.FStates = [] then
begin
Application.CancelHint;

inherited;

// get information about the hit
GetHitTestInfoAt(Message.XPos, Message.YPos, True, HitInfo);

if voRightClickSelect in FOptions then
HandleMouseUp(Message, HitInfo);
// --> Removed this next line
// DoPopupMenu(HitInfo.HitNode, HitInfo.HitColumn, Point(Message.XPos,
Message.YPos));
end;
end;

// Overrides TControl
procedure TBaseVirtualTree.DoContextPopup(MousePos: TPoint; var Handled:
Boolean);
var
HitInfo: THitInfo;
begin
if Assigned(OnContextPopup) then
OnContextPopup(Self, MousePos, Handled);
if not Handled then begin
// get information about the hit
GetHitTestInfoAt(MousePos.x, MousePos.y, True, HitInfo);

// If Handled is true, the PopupMenu property is NOT used when we return
Handled := DoPopupMenu(HitInfo.HitNode, HitInfo.HitColumn,
Point(MousePos.x, MousePos.y));

end;
end;

function TBaseVirtualTree.DoPopupMenu(Node: PVirtualNode; Column: Integer;
Position: TPoint): Boolean;

// Support for node dependent popup menus.

var
Run: PVirtualNode;
Menu: TPopupMenu;
AskParent: Boolean;

begin
if Assigned(FOnGetPopupMenu) then
begin
Run := Node;
if Assigned(Run) then
begin
FocusedNode := Run;
Menu := nil;
AskParent := True;
repeat
FOnGetPopupMenu(Self, Run, Column, AskParent, Menu);
Run := Run.Parent;
until (Run = FRoot) or Assigned(Menu) or not AskParent;

if Assigned(Menu) then
begin
StopTimer(EditTimer);
Menu.PopupComponent := Self;
with ClientToScreen(Position) do
Menu.Popup(X, Y);
Result := True;
Exit;
end;
end;
end;
Result := False;
end;

[Non-text portions of this message have been removed]

 | Replies | Author | Date
761 | Re: Patch for PopupMenus | Mike Lischke | Sun 3/11/2001
766 | Re: Patch for PopupMenus | Wez Furlong | Mon 3/12/2001
767 | Re: Patch for PopupMenus | Mike Lischke | Mon 3/12/2001


Some suggestions

From: "Cyril VELTER" [cyril.velter@l...]
Date: Sat Mar 10, 2001 3:12 pm
Subject: Some suggestions

hello,

I've two small suggestions :

* Is it possible to remove the inherited call in CMMouseWheel because If
a parent control handle the mouse wheel, the virtual tree won't.

* When the tree have the "GridExtensions", it would be nice to be able
to edit the cell when a wlick occur anywhere on it (now you should click on
the label). Here is a patch against v2.2

13565c13565

< if IsFocused and (hiOnItemLabel in HitInfo.HitPositions) and NodeSelected
and not NewColumn and ShiftEmpty then

---

> if IsFocused and ((hiOnItemLabel in HitInfo.HitPositions) or
(voGridExtensions in Options) and (hiOnItem in HitInfo.HitPositions)))and
NodeSelected and not NewColumn and ShiftEmpty then

cyril

 | Replies | Author | Date
762 | Re: Some suggestions | Mike Lischke | Sun 3/11/2001
764 | Re: Some suggestions | Cyril VELTER | Sun 3/11/2001
765 | Re: Some suggestions | [teusjdejong@p...] | Sun 3/11/2001
771 | Re: Some suggestions | Mike Lischke | Tue 3/13/2001


re: Occasional error in InternalClearSelection

From: "Mike Lischke" [public@l...]
Date: Sat Mar 10, 2001 5:36 pm
Subject: RE: [VirtualTreeview] Occasional error in InternalClearSelection

Hi Werner,

> every once in a while I am getting an AV in VTree when I close my
> application. Has been happening for quite some time (last two VTree
> versions).

This is bad news :-/

> PS: I can reproduce the error now. Strange enough: It happens when
> the VTree is cleared and a branch with some 1000 nodes is expanded
> at that time *and* any node below child #13 is selected. I don't see
> any specialities which set node #13 apart from #14. Both are visible
> and are located about at the vertical center of the tree which is not
> scrolled down.

I guess the only chance for me to actually see what happens is that you send me
a small demo project
which shows the error. I think however, if you can write a demo which
reproduces the problem
reliably then you can also fix it yourself. This is a stupid situation.

> procedure TBaseVirtualTree.InternalClearSelection;
>
> begin
> while FSelectionCount > 0 do
> begin
> Dec(FSelectionCount);
> Exclude(FSelection[FSelectionCount].States, vsSelected); <--------
> end;
> FLastSelectionLevel := -1;
> FRangeAnchor := nil;
> FSelection := nil;
> Exclude(FStates, tsClearPending);
> end;
>
> FSelectionCount is 0 on that line. Length(FSelection) is 1. I guess
> there is a node in FSelection which is already freed since this
> happens when I clear my data structures including the trees.

From your description I can imagine a situation which could result in a
problem. For speed
optimizations does the tree use some tricks which work very well usually. One
of this trick is to
modify the selection array very quickly (e.g. for massive selection changes) by
making the pointers
in the array invalid and pack the array once the massive change is finished.
What actually happens
is that memory addresses in Delphi are always dword aligned (so they are always
even numbers). Now
look at this:

procedure TBaseVirtualTree.InternalRemoveFromSelection(Node: PVirtualNode);

// Special version to mark a node to be no longer in the current selection.
PackArray must
// be used to remove finally those entries.

var
Index: Integer;

begin
// Because pointers are always DWORD aligned we can simply increment all those
// which we want to have removed (see also PackArray) and still have the
// order in the list preserved.
if FindNodeInSelection(Node, Index, -1, -1) then
begin
Exclude(Node.States, vsSelected);
Inc(Cardinal(FSelection[Index]));
end;
end;

The reason why only an increment works (not setting the node to nil) is that
the sort order in the
array must be preserved otherwise you cannot search for other nodes anymore.
InternalRemoveFromSelection is only used when updating of the tree is not
allowed (UpdateCount > 0)
and in draw selection handling (which is not the problem here I think). The
selection array is then
fixed in EndUpdate.

InternalRemoveFromSelection however is called (among others) in DeleteNode. So
when you have called
BeginUpdate before doing a DeleteNode and call ClearSelection before EndUpdate
has been called then
the tree will crash because it tries to reset the selected state of all nodes
in the array (of which
one or more are invalid). As far as I can see this is the only dangerous
situation here and while
writing this text I also have got a solution for it. I will check in
InternalClearSelection for
FUpdateCount > 0 and will explicitely pack the selection array if this is the
case. This way every
invalid node will be removed before the states are reset.

The code looks now so:

procedure TBaseVirtualTree.InternalClearSelection;

var
Count: Integer;

begin
// It is possible that there are invalid node references in the selection
array
// if the tree update is locked and changes in the structure were made.
// Handle this potentially dangerous situation by packing the selection array
explicitely.
if FUpdateCount > 0 then
begin
Count := PackArray(FSelection, FSelectionCount);
if Count > -1 then
begin
FSelectionCount := Count;
SetLength(FSelection, FSelectionCount);
end;
end;

while FSelectionCount > 0 do
begin
Dec(FSelectionCount);
Exclude(FSelection[FSelectionCount].States, vsSelected);
end;
FLastSelectionLevel := -1;
FRangeAnchor := nil;
FSelection := nil;
Exclude(FStates, tsClearPending);
end;

Perhaps this solves your problem.

Ciao, Mike


re: Occasional error in InternalClearSelection

From: Werner Lehmann [wl@b...]
Date: Sat Mar 10, 2001 11:27 pm
Subject: Re: [VirtualTreeview] Occasional error in InternalClearSelection

Mike,

Mike Lischke wrote:
>
> I guess the only chance for me to actually see what happens is that you send
me a small demo project
> which shows the error. I think however, if you can write a demo which
reproduces the problem
> reliably then you can also fix it yourself. This is a stupid situation.

Indeed. But not uncommon. Your expertise with the VTree code is very
welcome; I don't know if I ever would have thought about the situation
you describe below.

> >From your description I can imagine a situation which could result in a
problem. For speed
> optimizations does the tree use some tricks which work very well usually. One
of this trick is to
> modify the selection array very quickly (e.g. for massive selection changes)
by making the pointers
> in the array invalid and pack the array once the massive change is finished.
What actually happens
> is that memory addresses in Delphi are always dword aligned (so they are
always even numbers). Now
> look at this:

I am not sure what you're doing here. If you increment the pointer value
in the array it will point at the next byte after the byte it pointed
before. And its value will be odd (in other words LSB set as you say in
PackArray's comment).

I realize why you do that but I was expecting that you check somewhere
(in FindNodeInSelection) if the pointer value in the array was an odd
value but you don't do that.

> InternalRemoveFromSelection however is called (among others) in DeleteNode.
So when you have called
> BeginUpdate before doing a DeleteNode and call ClearSelection before
EndUpdate has been called then
> the tree will crash because it tries to reset the selected state of all nodes
in the array (of which
> one or more are invalid). As far as I can see this is the only dangerous
situation here and while
> writing this text I also have got a solution for it. I will check in
InternalClearSelection for
> FUpdateCount > 0 and will explicitely pack the selection array if this is the
case. This way every
> invalid node will be removed before the states are reset.

This is exactly the situation. BeginUpdate, then ClearSelection (in
the course of the SelectAndFocus routine which I posted before and
which is a general utility function; ClearSelection is not really
needed in this context).

You say it will crash, this sound very definite. Alas, it does not crash
anymore at this place (I have some other occasional AV which I still
investigate; not directly reproducible, of course). At least not in the
last time. Nevertheless I have modified InternalClearSelection in my copy
of VTree and will see whether it crashes again.

> Perhaps this solves your problem.

Thanks for putting so much thought into it :)

Regards,
Werner

 | Replies | Author | Date
763 | Re: Occasional error in InternalClearSelection | Mike Lischke | Sun 3/11/2001


GetVisiblePath($1)

From: Werner Lehmann [wl@b...]
Date: Sat Mar 10, 2001 11:49 pm
Subject: GetVisiblePath($1)

Hi Mike,

I am afraid here is another problem that you might be able to sort out.
Please don't believe that I want to make you solve my problems but this
looks as if it was VTree only problem. I don't know how to reproduce
it (you guessed it) and it just happened for the third time in the last
days. I am having a PVirtualNode($1)... BTW, this $1 looks like you're
doing that 'dirty' trick you spoke about with a NIL pointer.

The situation is not so easy to describe but the VTree in question is
used as a Listview and its nodes are about to be rebuild with new data
(full clear and a couple of AddChilds again).

The crash is here:

function TBaseVirtualTree.GetVisiblePath(Node: PVirtualNode): Boolean;

// Determines if all parents of the given node are expanded.

begin
Assert(Assigned(Node) and (Node <> FRoot), 'Invalid parameters.');

// FRoot is always expanded
repeat
Node := Node.Parent; <----------
until (Node = FRoot) or not (vsExpanded in Node.States);

Result := Node = FRoot;
end;

Node is $1.

GetVisiblePath is called from InitNode (Callstack comes below):

procedure TBaseVirtualTree.InitNode(Node: PVirtualNode);

...

with Node^ do
begin
InitStates := [ivsVisible];
if Parent = FRoot then
DoInitNode(nil, Node, InitStates) <--- no event handler attached
else
DoInitNode(Parent, Node, InitStates);
Include(States, vsInitialized);
if ivsDisabled in InitStates then
Include(States, vsDisabled);
if ivsHasChildren in InitStates then
Include(States, vsHasChildren);
if ivsSelected in InitStates then
begin
FSingletonNodeArray[0] := Node;
InternalAddToSelection(FSingletonNodeArray, 1, False);
end;

// Adjust total count of visible nodes if the application changed the
visibility
// state of this node.
if (vsVisible in Node.States) xor (ivsVisible in InitStates) then
begin
if ivsVisible in InitStates then
begin
Include(States, vsVisible);
if VisiblePath[Node] then <--- this calls GetVisiblePath
Inc(FVisibleCount);
end
else
...

The strange thing is that InitNode is called with a Node value of $CCF208. But
the
value which is passed to GetVisiblePath is $1 (according to callstack info).
This
means the somewhere before the VisiblePath[Node] line in InitNode the node value
must be messed up. Since I don't have OnInitNode handlers only
InternalAddToSelection
could be blamed here (everything else is set management only). But this function
cannot modify the local Node parameter; it is only passed a copy in
FSingletonArray[0].
Furthermore, at the time of the exception the length of FSingletonArray (which
is
global as you know) is still 1 and element 0 is still $CCF208 (the original
value
of Node). So I am having a hard time to understand what's going on.

The callstack (oh please, I want copy & paste :) :

TBaseVirtualTree.WndProc(...)
TBaseVirtualTree.WMLButtonDown(...)
TBaseVirtualTree.WndProc(...)
TBaseVirtualTree.WMKillFocus(...)
TCustomVirtualStringTree.InvalidateNode($CCF208)
TBaseVirtualTree.InvalidateNode($CCF208)
TBaseVirtualTree.GetDisplayRect($CCF208, -1, False, False)
TBaseVirtualTree.InitNode($CCF208)
TBaseVirtualTree.GetVisiblePath($1)

Regards,
Werner

 | Replies | Author | Date
770 | Re: GetVisiblePath($1) | Mike Lischke | Tue 3/13/2001
773 | Re: GetVisiblePath($1) | Werner Lehmann | Wed 3/14/2001
779 | Re: GetVisiblePath($1) | Mike Lischke | Thu 3/15/2001
781 | Re: GetVisiblePath($1) | Werner Lehmann | Thu 3/15/2001
796 | Re: GetVisiblePath($1) | Mike Lischke | Fri 3/16/2001


re: Patch for PopupMenus

From: "Mike Lischke" [public@l...]
Date: Sun Mar 11, 2001 7:54 pm
Subject: RE: [VirtualTreeview] Patch for PopupMenus

Hi Wez,

thank you for your bug report with a possible solution. The problem is indeed
that the
DoContextPopup method does indeed not exist in Delphi 4. What can we do to make
your solution work
there too?

> This patch slightly alters the behaviour of the context-popup code so that
> the behaviour works as the user would expect.

You mean: the programmers expectations. What sense does it make to assign a
popup menu and have
additionally the OnGetPopupMenu event if the latter is a more general form of
the former?

> I've changed the DoPopupMenu call so that it returns a Boolean indicating
> that it displayed a popupmenu.
> The DoPopupMenu call has been moved from the WMRButtonUp handler and into a
> DoContextPopup handler (a new procedure).
> DoContextPopup is called as part of the WMRButtonUp code in TControl.

This is a clean solution (although it is WMContextMenu where DoContextPopup is
called). If we can
get something which works for Delphi 4 too then I would take it in.

Ciao, Mike

 | Replies | Author | Date
766 | Re: Patch for PopupMenus | Wez Furlong | Mon 3/12/2001


re: Some suggestions

From: "Mike Lischke" [public@l...]
Date: Sun Mar 11, 2001 8:05 pm
Subject: RE: [VirtualTreeview] Some suggestions

Hi Cyril,

> * Is it possible to remove the inherited call in CMMouseWheel because If
> a parent control handle the mouse wheel, the virtual tree won't.

It would be possible but you would unnessarily break the behaviour of VT
compared to every other VCL
control. What's the point with the parent which handles mouse wheel messages?
If you don't want the
parent to handle them then don't let it handle the messages. Or do I miss
something here?

> * When the tree have the "GridExtensions", it would be nice to be able
> to edit the cell when a wlick occur anywhere on it (now you should click on
> the label). Here is a patch against v2.2

This is a good idea. Thank you. I have taken it into the tree.

Ciao, Mike


re: Occasional error in InternalClearSelection

From: "Mike Lischke" [public@l...]
Date: Sun Mar 11, 2001 8:15 pm
Subject: RE: [VirtualTreeview] Occasional error in InternalClearSelection

Hi Werner,

> I am not sure what you're doing here. If you increment the pointer value
> in the array it will point at the next byte after the byte it pointed
> before. And its value will be odd (in other words LSB set as you say in
> PackArray's comment).

Actually, it points to nothing worth to be mentioned. The only purpose of this
(not so dirty) trick
is to mark a pointer as invalid but still keep the sort order of the array.
Before one can do
anything with the array these invalid pointers must be removed of course.

Ciao, Mike


re: Some suggestions

From: "Cyril VELTER" [cyril.velter@l...]
Date: Sun Mar 11, 2001 8:52 pm
Subject: Re: [VirtualTreeview] Some suggestions

> Hi Cyril,
>
> > * Is it possible to remove the inherited call in CMMouseWheel
because If
> > a parent control handle the mouse wheel, the virtual tree won't.
>
> It would be possible but you would unnessarily break the behaviour of VT
compared to every other VCL
> control. What's the point with the parent which handles mouse wheel
messages? If you don't want the
> parent to handle them then don't let it handle the messages. Or do I miss
something here?
>

I just want to implement a kind of focus-follow-mouse for wheel event
(just like outlook express do), all wheel message should go to the
underlying control (not necessaly the one with the focus).

For doing that, I override the MouseWheelHandler of my form to send the
CM_MOUSEWHEEL to the control under the mouse. But VT try to make its parent
handle the message first ...

> > * When the tree have the "GridExtensions", it would be nice to be
able
> > to edit the cell when a wlick occur anywhere on it (now you should click
on
> > the label). Here is a patch against v2.2
>
> This is a good idea. Thank you. I have taken it into the tree.
>
> Ciao, Mike
>

nice

On the editing side, I've made another modification. When you try to
edit the main column of a tree (which is the only column), the size of the
editor is not nice, it takes the entire width of the tree without taking
into accout the node position nor the real visible width. The following
patch resize the editor (if one is prensent) when painting the node, I don't
know if it's the best solution but it works quite well.

to add line 14364 (just after paintnode and before DoAfterCellPaint in the
PaintTree method)

// If the node is being edited in the main column
// set the right rect for the editor
if (Position = -1) or (FPositionToIndex[Position] =
Cardinal(FHeader.MainColumn)) then
begin
if (tsEditing in FStates) and (Node=FFocusedNode) and (FEditColumn
= FHeader.MainColumn) then
begin
// Same topright position as Text
TextRect.Bottom:=TextRect.Bottom+CurrentTop;
TextRect.Top:=TextRect.Top+CurrentTop;
// Clip right to visible part
if TextRect.Right>ClientWidth-Margin then
TextRect.Right:=ClientWidth-Margin;
FEditLink.SetBounds(TextRect);
end;
end;

Now that I can create a custom DragDropManager, could you the SetOLEFormats
of the TVTDragDropManager be virtual ? I really want to be able to add a new
format.

thanks

cyril

 | Replies | Author | Date
765 | Re: Some suggestions | [teusjdejong@p...] | Sun 3/11/2001


re: Some suggestions

From: [teusjdejong@p...]
Date: Sun Mar 11, 2001 9:26 pm
Subject: Re: Some suggestions

--- In [VirtualTreeview@y...], "Cyril VELTER" [cyril.velter@l...] wrote:
> > Hi Cyril,
> Now that I can create a custom DragDropManager, could you the
SetOLEFormats
> of the TVTDragDropManager be virtual ? I really want to be able to
add a new
> format.

Mike,

I would like that too. At the moment I patch VirtualTrees, but that's
not a nice solution.

Teus de Jong.


re: Patch for PopupMenus

From: Wez Furlong [wez.egroups@t...]
Date: Mon Mar 12, 2001 1:37 am
Subject: RE: [VirtualTreeview] Patch for PopupMenus

> On 2001-03-11 19:54:59, "Mike Lischke" [public@l...] wrote:
> thank you for your bug report with a possible solution. The problem is indeed
that the
> DoContextPopup method does indeed not exist in Delphi 4. What can we do to
make your solution work
> there too?
> ...
>You mean: the programmers expectations. What sense does it make to assign a
popup menu and have
>additionally the OnGetPopupMenu event if the latter is a more general form of
the former?

The problem was that I wanted a context menu for the control (ie: not right
clicking on a node), which the OnGetPopupMenu did not fire for.
The alternative then is to fire the OnGetPopupMenu event even if the mouse does
not "hit" a node.
I will come up with the code for this tomorrow, and it will work even under
Delphi4.

--Wez.


re: Patch for PopupMenus

From: Mike Lischke [public@l...]
Date: Mon Mar 12, 2001 8:19 am
Subject: RE: [VirtualTreeview] Patch for PopupMenus

Hi Wez,

> The problem was that I wanted a context menu for the control
> (ie: not right clicking on a node), which the OnGetPopupMenu
> did not fire for.
> The alternative then is to fire the OnGetPopupMenu event even
> if the mouse does not "hit" a node.

This is a good argument. I did not think about this yet.

> I will come up with the code for this tomorrow, and it will
> work even under Delphi4.

Looking forward :-)

Ciao, Mike


Overlay Images

From: [teusjdejong@p...]
Date: Mon Mar 12, 2001 12:53 pm
Subject: Overlay Images

Hi Mike,

I saw that overlay images are already discussed, but the latest
version of VT still contains the lines:

FImages.Overlay(OverlayImage, 0);
FImages.DrawOverlay(Canvas, XPos, YPos, Image, 0, not (vsDisabled in
Node.States) and Enabled);

With systemimages, on Windows 2000 this does not have a drastic
effect, but on Windows 98 the first line (FImages.Overlay
(OverlayImageImage, 0)) changes all Overlay images in the system
(also in Windows explorer). If I comment out this line and change the
second line to:

FImages.DrawOverlay(Canvas, XPos, YPos, Image, OverlayImage, not
(vsDisabled in Node.States) and Enabled);

everything works OK.

Maybe you have already changed this; if not, please look into it.

Teus de Jong.

 | Replies | Author | Date
777 | Re: Overlay Images | Mike Lischke | Thu 3/15/2001
799 | Re: Overlay Images | [teusjdejong@p...] | Fri 3/16/2001
801 | Re: Overlay Images | Mike Lischke | Sat 3/17/2001
820 | Re: Overlay Images | [jimdk@m...] | Wed 3/21/2001
821 | Re: Overlay Images | [jimdk@m...] | Wed 3/21/2001
823 | Re: Overlay Images | Mike Lischke | Wed 3/21/2001
822 | Re: Overlay Images | Mike Lischke | Wed 3/21/2001
824 | Re: Overlay Images | [jimdk@m...] | Wed 3/21/2001
782 | Re: Overlay Images | Werner Lehmann | Thu 3/15/2001


Re-initialize node

From: [ebolefeysot@b...]
Date: Mon Mar 12, 2001 2:43 pm
Subject: Re-initialize node

Hi

Thanks for the new version, it fixes my previous problem :)

Now, I just want to have advices on how to do this:

I have a tree view of a tree structure. All treenode objects are
linked to my structure objects. This works great.

I want to apply a filter to my structure. I re-built my object
structure and I want to update the tree accordingly. I don't want to
use the clear method because I loose all expand and select
information and I want a dynamic visual update of the tree (node
disappearing or appearing).

I tried a lot of methods: reinitnode, reinitchildren, validate,
validate children resetnode, but none of them do what I want.

I want the treeview to re-call all displayed nodes method doinitnode
and doinitchildren so that I can adjust the next childcount and node
object.

Is it possible? Maybe another solution exist to update a tree after a
structure modification?

Thanks for reading.

--
Eric Bole-Feysot

 | Replies | Author | Date
772 | Re: Re-initialize node | Werner Lehmann | Wed 3/14/2001
775 | Re: Re-initialize node | [ebolefeysot@b...] | Thu 3/15/2001
774 | Re: Re-initialize node | [adembaba@e...] | Thu 3/15/2001
776 | Re: Re-initialize node | [ebolefeysot@b...] | Thu 3/15/2001
783 | Re: Re-initialize node | Werner Lehmann | Thu 3/15/2001
787 | Re: Re-initialize node | [ebolefeysot@b...] | Fri 3/16/2001
788 | Re: Re-initialize node | [jascha@c...] | Fri 3/16/2001
789 | Re: Re-initialize node | Werner Lehmann | Fri 3/16/2001
790 | Re: Re-initialize node | Bole-Feysot Eric | Fri 3/16/2001


re: GetVisiblePath($1)

From: Mike Lischke [public@l...]
Date: Tue Mar 13, 2001 2:12 pm
Subject: RE: [VirtualTreeview] GetVisiblePath($1)

Hi Werner,

> I don't know how to reproduce it (you guessed it) and it just happened for
the third time
> in the last days. I am having a PVirtualNode($1)... BTW, this $1 looks
like you're
> doing that 'dirty' trick you spoke about with a NIL pointer.

I'm sorry, but I cannot reproduce this problem by any means. I don't know
how to debug it. Just from the description it should not happen of course,
but obviously it does and bugs which do not appear all the time are usually
related to uninitialized data structurs. But I have taken serious care to
have all initialized and freed properly so I cannot imaging where the
problem could result from.

Ciao, Mike


re: Some suggestions

From: Mike Lischke [public@l...]
Date: Tue Mar 13, 2001 2:40 pm
Subject: RE: [VirtualTreeview] Some suggestions

Hi Cyril,

> I just want to implement a kind of focus-follow-mouse for wheel event
> (just like outlook express do), all wheel message should go to the
> underlying control (not necessaly the one with the focus).

This is difficult and VT will only be one control which needs rework. In one
of our products (Retrospect 2000, www.digitalpublishing.de) I had the same
problem and solved it by deriving all forms/windows from a common base form
which forwarded the mouswheel messages to the window under the mouse (if it
belongs to the application of course).

> On the editing side, I've made another modification. When
> you try to edit the main column of a tree (which is the only column),
> the size of the editor is not nice, it takes the entire width of the tree
> without taking into accout the node position nor the real visible width.
The
> following patch resize the editor (if one is prensent) when painting
> the node, I don't know if it's the best solution but it works quite well.

Mmmh, I understand your concern, but I think there must be a better solution
than doing the resize in the paint event. Let me think about it a while, I
have taken it into the todo list.

> Now that I can create a custom DragDropManager, could you the
> SetOLEFormats of the TVTDragDropManager be virtual ? I really want to be
> able to add a new format.

Ok, this is done.

Ciao, Mike


re: Re-initialize node

From: Werner Lehmann [wl@b...]
Date: Wed Mar 14, 2001 3:57 pm
Subject: Re: [VirtualTreeview] Re-initialize node

[ebolefeysot@b...] wrote:
>
> I have a tree view of a tree structure. All treenode objects are
> linked to my structure objects. This works great.
>
> I want to apply a filter to my structure. I re-built my object
> structure and I want to update the tree accordingly. I don't want to
> use the clear method because I loose all expand and select
> information and I want a dynamic visual update of the tree (node
> disappearing or appearing).

Maybe you can utilize the new node-visibility feature. If I understand
it correctly you can hide or show childs of (expanded) branches without
having to remove them. You could just add all childs and make those
invisible which should be filtered out. This can be combined with the
use of the OnExpanding event: you add childs to a branch only if it gets
expanded. Only that you add all childs and set the filtered as invisible
here.

> Is it possible? Maybe another solution exist to update a tree after a
> structure modification?

If you don't go that visibility-approach you can still just update the
expanded branches (remove all children, add visible children again) and
remove all children from collapsed branches (to add them filtered if a
node is expanded).

Regards,
Werner

 | Replies | Author | Date
775 | Re: Re-initialize node | [ebolefeysot@b...] | Thu 3/15/2001


re: GetVisiblePath($1)

From: Werner Lehmann [wl@b...]
Date: Wed Mar 14, 2001 3:59 pm
Subject: Re: [VirtualTreeview] GetVisiblePath($1)

Mike Lischke wrote:
>
> I'm sorry, but I cannot reproduce this problem by any means. I don't know
> how to debug it. Just from the description it should not happen of course,
> but obviously it does and bugs which do not appear all the time are usually
> related to uninitialized data structurs. But I have taken serious care to
> have all initialized and freed properly so I cannot imaging where the
> problem could result from.

Sorry to hear that but not unexpected. I will continue to investigate the
problem (if it happens which is rare enough).

Werner


re: Re-initialize node

From: [adembaba@e...]
Date: Thu Mar 15, 2001 6:01 am
Subject: Re: Re-initialize node

Hi,

OTOMH, are you keeping pointers to VT nodes in your
private structure? If so, it would seem to to be easy
to notify the relevant node of the alteration.

Thank you for writing ;-)

Cheers,

--- In [VirtualTreeview@y...], [ebolefeysot@b...] wrote:
> Hi
>
> Thanks for the new version, it fixes my previous problem :)
>
> Now, I just want to have advices on how to do this:
>
> I have a tree view of a tree structure. All treenode objects are
> linked to my structure objects. This works great.
>
> I want to apply a filter to my structure. I re-built my object
> structure and I want to update the tree accordingly. I don't want
to
> use the clear method because I loose all expand and select
> information and I want a dynamic visual update of the tree (node
> disappearing or appearing).
>
> I tried a lot of methods: reinitnode, reinitchildren, validate,
> validate children resetnode, but none of them do what I want.
>
> I want the treeview to re-call all displayed nodes method
doinitnode
> and doinitchildren so that I can adjust the next childcount and
node
> object.
>
> Is it possible? Maybe another solution exist to update a tree after
a
> structure modification?
>
> Thanks for reading.
>
> --
> Eric Bole-Feysot

 | Replies | Author | Date
776 | Re: Re-initialize node | [ebolefeysot@b...] | Thu 3/15/2001


re: Re-initialize node

From: [ebolefeysot@b...]
Date: Thu Mar 15, 2001 1:22 pm
Subject: Re: Re-initialize node

--- In [VirtualTreeview@y...], Werner Lehmann [wl@b...] wrote:
> [ebolefeysot@b...] wrote:
> >
> > I have a tree view of a tree structure. All treenode objects are
> > linked to my structure objects. This works great.
> >
> > I want to apply a filter to my structure. I re-built my object
> > structure and I want to update the tree accordingly. I don't want
to
> > use the clear method because I loose all expand and select
> > information and I want a dynamic visual update of the tree (node
> > disappearing or appearing).
>
> Maybe you can utilize the new node-visibility feature. If I
understand
> it correctly you can hide or show childs of (expanded) branches
without
> having to remove them. You could just add all childs and make those
> invisible which should be filtered out. This can be combined with
the
> use of the OnExpanding event: you add childs to a branch only if it
gets
> expanded. Only that you add all childs and set the filtered as
invisible
> here.

Yes, I checked that, but the way it appears on screen doesn't make it
very usefull actually: The node is hidden, but the small line which
attach it from the previous sibling is still there. You can say if a
node is missing just by looking at the treeview.

>
> > Is it possible? Maybe another solution exist to update a tree
after a
> > structure modification?
>
> If you don't go that visibility-approach you can still just update
the
> expanded branches (remove all children, add visible children again)
and
> remove all children from collapsed branches (to add them filtered
if a
> node is expanded).

That's what I prefer, and the more I test, the more I think it should
be trivial, but I always have access violation here and there..

I'm convinced it should work like that:
First load of my structure (without filter)
I set rootnodecount to the number of level 0 nodes
The doinitnode sets the pointer to the data and the haschildren
The doinitchildren sets the childcount

The first load works with that. I think it is enough to display the
structure content.

Now, I reload my structure with a filter.
I want the treeview to behave like in the first case.
I set the new rootnodecount.
I need a procedure to update all known pointers, hschildren and
childcount actually expanded.

I can't find such function.
Actually, I use the clear method and start from an empty tree. I
wrote a proc to recover at least the previous selected node. But bye
bye all other expanded nodes :((

I wrote a procedure whith iteratesubtree which remove the
vsinitialized from all nodes, but I have some illegal access.

Mike, is it really working like that ?`

>
> Regards,
> Werner


re: Re-initialize node

From: [ebolefeysot@b...]
Date: Thu Mar 15, 2001 1:29 pm
Subject: Re: Re-initialize node

--- In [VirtualTreeview@y...], [adembaba@e...] wrote:
> Hi,
>
> OTOMH, are you keeping pointers to VT nodes in your
> private structure? If so, it would seem to to be easy
> to notify the relevant node of the alteration.
>
> Thank you for writing ;-)
>
> Cheers,

No ! I don't. The treeview is only there to display my structure.

In fact, here is my structure:

I have a kind of data base with all objects

From this db, I build another structure wich is a kind of reducted
view of this db (thru filter) and I want to display this one.

Note also that each node pointer points to objects in the full data
base (not in the filtered list). They remain always valid, even
during the build of a new filtered structure.

see also previous post for more infos.

Thanks for your help. I'm continuing investigation...

>
> --- In [VirtualTreeview@y...], [ebolefeysot@b...] wrote:
> > Hi
> >
> > Thanks for the new version, it fixes my previous problem :)
> >
> > Now, I just want to have advices on how to do this:
> >
> > I have a tree view of a tree structure. All treenode objects are
> > linked to my structure objects. This works great.
> >
> > I want to apply a filter to my structure. I re-built my object
> > structure and I want to update the tree accordingly. I don't want
> to
> > use the clear method because I loose all expand and select
> > information and I want a dynamic visual update of the tree (node
> > disappearing or appearing).
> >
> > I tried a lot of methods: reinitnode, reinitchildren, validate,
> > validate children resetnode, but none of them do what I want.
> >
> > I want the treeview to re-call all displayed nodes method
> doinitnode
> > and doinitchildren so that I can adjust the next childcount and
> node
> > object.
> >
> > Is it possible? Maybe another solution exist to update a tree
after
> a
> > structure modification?
> >
> > Thanks for reading.
> >
> > --
> > Eric Bole-Feysot


re: Overlay Images

From: Mike Lischke [public@l...]
Date: Thu Mar 15, 2001 4:29 pm
Subject: RE: [VirtualTreeview] Overlay Images

Hi Teus,

> I saw that overlay images are already discussed, but the latest
> version of VT still contains the lines:
>
> FImages.Overlay(OverlayImage, 0);
> FImages.DrawOverlay(Canvas, XPos, YPos, Image, 0, not (vsDisabled in
> Node.States) and Enabled);
>
> Maybe you have already changed this; if not, please look into it.

I have removed the overlay call and so far it works fine (tried it with the
draw tree demo). One problem remains however.

I want to draw some nodes blended against the background just like the
Explorer does when marking a file as being cut or when showing system files.
The problem is that I can use Brad Stowers system image list and I get
beautifully blended images, but with every "normal" image list the images
are not blended but some random pixels are removed to simulate a blended
look (which looks terrible).

Does anybody know why there is a difference and how I can achieve smoothly
blended images with every image list? The only explanation I have for the
different behaviour is that the system image list takes another path than
every other image list. While I dare Microsoft a lot ugly things I don't
think they made such a special implementation just for one image list.

Ciao, Mike

 | Replies | Author | Date
799 | Re: Overlay Images | [teusjdejong@p...] | Fri 3/16/2001
801 | Re: Overlay Images | Mike Lischke | Sat 3/17/2001
820 | Re: Overlay Images | [jimdk@m...] | Wed 3/21/2001
821 | Re: Overlay Images | [jimdk@m...] | Wed 3/21/2001
823 | Re: Overlay Images | Mike Lischke | Wed 3/21/2001
822 | Re: Overlay Images | Mike Lischke | Wed 3/21/2001
824 | Re: Overlay Images | [jimdk@m...] | Wed 3/21/2001


New file uploaded to VirtualTreeview

From: [VirtualTreeview@yahoogroups.com>
Date: Thu Mar 15, 2001 4:42 pm
Subject: New file uploaded to VirtualTreeview

Hello,

This email message is a notification to let you know that
a file has been uploaded to the Files area of the VirtualTreeview
group.

File : /Blend.zip
Uploaded by : [public@l...]
Description : Image to show wrong blend effect.

You can access this file at the URL

http://groups.yahoo.com/group/VirtualTreeview/files/Blend.zip

To learn more about file sharing for your group, please visit

http://help.yahoo.com/help/us/groups/files

Regards,

public@l...]


re: GetVisiblePath($1)

From: Mike Lischke [public@l...]
Date: Thu Mar 15, 2001 4:39 pm
Subject: RE: [VirtualTreeview] GetVisiblePath($1)

> Sorry to hear that but not unexpected. I will continue to
> investigate the
> problem (if it happens which is rare enough).

Good news Werner. I think I have fixed this problem. It was due to wrong
cache handling in some very special circumstances.

Ciao, Mike


copying/moving nodes

From: "Franz Figl" [frafi@a...]
Date: Thu Mar 15, 2001 9:02 pm
Subject: copying/moving nodes

Hi all,

I am new to this list, and here is my first question:

I want to copy a node with all the children and siblings and move this to
another place in the tree.
This is a flat dtd tree (in text form) which I must expand.

The tree looks like:

a
b
c
d e
f
g
h
i

The b node (and the children) is to be copied over the h node.

a
b
c
d e
f
g
b
c
d e
f
i

The normal way in the TTreeView would be a recursion copy of the b
childnodes and then a moveto.

But I do not know how to do it in VTV.

Could give anybody a short example please?

Franz

 | Replies | Author | Date
784 | Re: copying/moving nodes | Werner Lehmann | Thu 3/15/2001
785 | Re: copying/moving nodes | Franz Figl | Thu 3/15/2001
786 | Re: copying/moving nodes | Werner Lehmann | Fri 3/16/2001
795 | Re: copying/moving nodes | Mike Lischke | Fri 3/16/2001
800 | Re: copying/moving nodes | Franz Figl | Fri 3/16/2001
802 | Re: copying/moving nodes | Mike Lischke | Sat 3/17/2001


re: GetVisiblePath($1)

From: Werner Lehmann [wl@b...]
Date: Thu Mar 15, 2001 8:47 pm
Subject: Re: [VirtualTreeview] GetVisiblePath($1)

Mike Lischke wrote:
>
> > Sorry to hear that but not unexpected. I will continue to
> > investigate the
> > problem (if it happens which is rare enough).
>
> Good news Werner. I think I have fixed this problem. It was due to wrong
> cache handling in some very special circumstances.

Great! This is really good news. I am not keen on seeing that bugster anymore :)

Can you say just a few (!, don't want to steal your time too much) words on
where the $1 came from? With reference to my original posting there was this
riddle why the Node param in InitNode became $1 when passed to VisiblePath.

WL


re: Overlay Images

From: Werner Lehmann [wl@b...]
Date: Thu Mar 15, 2001 9:11 pm
Subject: Re: [VirtualTreeview] Overlay Images

Mike Lischke wrote:
>
> Does anybody know why there is a difference and how I can achieve smoothly
> blended images with every image list? The only explanation I have for the
> different behaviour is that the system image list takes another path than
> every other image list. While I dare Microsoft a lot ugly things I don't
> think they made such a special implementation just for one image list.

I don't think so either. My next step would be to ask the gurus at the
borland forum *.winapi (Peter Below among others).

I have just checked your uploaded bmp. Looks really ugly. Each other pixel
is simply dropped. Did you play with the imagelist properties BkColor and
especially BlendColor? You can also search the groups at www.fulltextsearch.com,
I get 32 postings with 'BlendColor' as search phrase. Some are about dimmed
images, others show a fix to a bug in TImageList with respect to the drawing
of disabled images. You may find something worth to check out here.


re: Re: Re-initialize node

From: Werner Lehmann [wl@b...]
Date: Thu Mar 15, 2001 9:21 pm
Subject: Re: [VirtualTreeview] Re: Re-initialize node

[ebolefeysot@b...] wrote:
>
> Yes, I checked that, but the way it appears on screen doesn't make it
> very usefull actually: The node is hidden, but the small line which
> attach it from the previous sibling is still there. You can say if a
> node is missing just by looking at the treeview.

In that case I suspect a bug. Maybe Mike can say something on this topic,
I never tried the visibility feature myself.

> That's what I prefer, and the more I test, the more I think it should
> be trivial, but I always have access violation here and there..

I would not call that exactly trivial. AV's I had a lot but the VTree
related ones seem to be fixed for the moment (with the latest version plus
a yet unpublished fix).

> I'm convinced it should work like that:
> First load of my structure (without filter)
> I set rootnodecount to the number of level 0 nodes
> The doinitnode sets the pointer to the data and the haschildren
> The doinitchildren sets the childcount

Hm, if even the top level nodes are subject to filtering the approach that
I drafted may not be very satisfactory because it may lead to a full tree
rebuild each time the filter changes. The visibility approach seems to be
more suited. And easier to implement on your side.

Apart from that you have no other chance but track the AV's down as far
as you can. Even if this is often tedious.

Werner

 | Replies | Author | Date
787 | Re: Re-initialize node | [ebolefeysot@b...] | Fri 3/16/2001


re: copying/moving nodes

From: Werner Lehmann [wl@b...]
Date: Thu Mar 15, 2001 9:26 pm
Subject: Re: [VirtualTreeview] copying/moving nodes

Franz Figl wrote:
>
> I am new to this list, and here is my first question:

Welcome.

> I want to copy a node with all the children and siblings and move this to
> another place in the tree.

It appears that the method .MoveTo can do the most work for you. Use it to move
b below g and delete h before or afterwards.

Werner


re: copying/moving nodes

From: "Franz Figl" [frafi@a...]
Date: Thu Mar 15, 2001 11:09 pm
Subject: Re: [VirtualTreeview] copying/moving nodes

Hallo Werner,

I guess moveto is not enough. I need a copy into a temporary object and a
then a moveto.
Do You have an example please?

Franz

>
> > I want to copy a node with all the children and siblings and move this
to
> > another place in the tree.
>
> It appears that the method .MoveTo can do the most work for you. Use it to
move
> b below g and delete h before or afterwards.
>
> Werner
>
>
> To unsubscribe from this group, send an email to:
> VirtualTreeview-unsubscribe@egroups.com
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>
>


re: copying/moving nodes

From: Werner Lehmann [wl@b...]
Date: Fri Mar 16, 2001 12:42 am
Subject: Re: [VirtualTreeview] copying/moving nodes

Franz Figl wrote:
>
> I guess moveto is not enough. I need a copy into a temporary object and a
> then a moveto.
> Do You have an example please?

No, I don't have one. I don't understand why you need a temporary
object, could you elaborate? Maybe we can remove this requirement.

Werner


re: Re-initialize node

From: [ebolefeysot@b...]
Date: Fri Mar 16, 2001 10:04 am
Subject: Re: Re-initialize node

--- In [VirtualTreeview@y...], Werner Lehmann [wl@b...] wrote:
> [ebolefeysot@b...] wrote:
> >
> > Yes, I checked that, but the way it appears on screen doesn't
make it
> > very usefull actually: The node is hidden, but the small line
which
> > attach it from the previous sibling is still there. You can say
if a
> > node is missing just by looking at the treeview.
>
> In that case I suspect a bug. Maybe Mike can say something on this
topic,
> I never tried the visibility feature myself.
>
> > That's what I prefer, and the more I test, the more I think it
should
> > be trivial, but I always have access violation here and there..
>
> I would not call that exactly trivial. AV's I had a lot but the
VTree
> related ones seem to be fixed for the moment (with the latest
version plus
> a yet unpublished fix).
>

I mean in my application, it should be easy to say to the treeview
that the structure changed and it must update also the display. I
think the treeview should take care of that (and that's what it
(almost) did actually ;))

> > I'm convinced it should work like that:
> > First load of my structure (without filter)
> > I set rootnodecount to the number of level 0 nodes
> > The doinitnode sets the pointer to the data and the haschildren
> > The doinitchildren sets the childcount
>
> Hm, if even the top level nodes are subject to filtering the
approach that
> I drafted may not be very satisfactory because it may lead to a
full tree
> rebuild each time the filter changes. The visibility approach seems
to be
> more suited. And easier to implement on your side.

Not the entire tree! Only the displayed nodes need to be re-
initialized.
I made a function called InvalidateAllNode which do what it says.

Node.States := Node.States - [vsInitialized];
in an iteratesubtree from rootnode

I supposed it was enough, but no. The nodes are no more initialized,
but the already displayed nodes are not re-initialized.

I added

Invalidate;

It works! All displayed node are re-initialized. Methode Doinitnode
and DoInitChildren are called for each node in the correct order.
This automatically reflect the structure change without losing any
node status (selected, expanded).

But another problem came: Displayed nodes are re-initialized, but
only displayed node! this mean that if the first displayed node is a
children, its parent is not re-initialized. This ended with a tree
which have leaves initialized, but root not initialized.
My access violation came from there: the data of the level 0 nodes
should have changed (these are list which are completely re-built).
So, when the doinitnode is launched for a child, I get the parent
data info which is no more valid.

The last thing I have to do is to manually 'ReinitNode' of all level
0 nodes to update the data.

This time, it seems ok. No more av, updates correct...

For the end, what would be great is a function which
- de-initialize all nodes of the tree
- re-initialize needed nodes : displayed nodes, begining by their
root, even it is not displayed.

This function will completely synchronise the display with the data
structure.

--
Eric

>
> Apart from that you have no other chance but track the AV's down as
far
> as you can. Even if this is often tedious.
>

I did it!

> Werner


re: Re-initialize node

From: [jascha@c...]
Date: Fri Mar 16, 2001 10:47 am
Subject: Re: Re-initialize node

--- In [VirtualTreeview@y...], [ebolefeysot@b...] wrote:
...
> use the clear method because I loose all expand and select
> information and I want a dynamic visual update of the tree (node
> disappearing or appearing).

I am doing something similar to this. My (possibly short term)
solution was to create a component that saves the expanded state of
the tree and can then restore it after the tree has been rebuilt. It
is a simple component that currently works for TVirtualStringTree as
it uses the node text to identify expanded nodes but it could easily
be altered to use any information that identifies a node from its
siblings.

E-mail me if you would like the source.

Jascha
[jascha@c...]


re: Re: Re-initialize node

From: Werner Lehmann [wl@b...]
Date: Fri Mar 16, 2001 10:34 am
Subject: Re: [VirtualTreeview] Re: Re-initialize node

[ebolefeysot@b...] wrote:
>
> Not the entire tree! Only the displayed nodes need to be re-
> initialized.
> I made a function called InvalidateAllNode which do what it says.

I was under the impression that the number of displayed nodes in all
branches may change if a different filter is applied. This does not
seem to be the case.

> Node.States := Node.States - [vsInitialized];
> in an iteratesubtree from rootnode
>
> I supposed it was enough, but no. The nodes are no more initialized,
> but the already displayed nodes are not re-initialized.
>
> I added
>
> Invalidate;

Node is only a record, and States is not a class property therefore.
Node cannot know when you change States, the VTree cannot know that
either.

I suggest you call InvalidateNode(Node) in your iteration method.
And drop the States and Invalidate calls.

> But another problem came: Displayed nodes are re-initialized, but
> only displayed node! this mean that if the first displayed node is a

Of course. Invalidate does not invalidate the logical client area of
the VTree but only the visible portion which may be less.

> The last thing I have to do is to manually 'ReinitNode' of all level
> 0 nodes to update the data.

This should not be needed anymore with InvalidateNode as said above.

Werner


re: Re-initialize node

From: Bole-Feysot Eric [ebolefeysot@b...]
Date: Fri Mar 16, 2001 1:02 pm
Subject: Re: Re-initialize node

>
> --- In [VirtualTreeview@y...], [ebolefeysot@b...] wrote:
> ..
> > use the clear method because I loose all expand and select
> > information and I want a dynamic visual update of the tree (node
> > disappearing or appearing).
>
> I am doing something similar to this. My (possibly short term)
> solution was to create a component that saves the expanded state of
> the tree and can then restore it after the tree has been rebuilt. It
> is a simple component that currently works for TVirtualStringTree as
> it uses the node text to identify expanded nodes but it could easily
> be altered to use any information that identifies a node from its
> siblings.

Yes, thats what I did at the beginning, but it makes me sick to store all
infos on all nodes, clear all and rebuild all !

>
> E-mail me if you would like the source.

Thanks, but now, I just have to save the selected node before refreshing and
restoring after. Not a big pain!
Thanks a lot anyway!

--
Eric

>
> Jascha
> [jascha@c...]
>
>
> ------------------------ Yahoo! Groups Sponsor
> ---------------------~-~>
> We give away $70,000 a month! Come to iWin.com for
> your chance to win!
> http://us.click.yahoo.com/r_1oCB/BJVCAA/4ihDAA/iObVlB/TM
> --------------------------------------------------------------
> -------_->
>
> To unsubscribe from this group, send an email to:
> [VirtualTreeview-unsubscribe@egroups.com
>
>
>
> Your use of Yahoo! Groups is subject to
> http://docs.yahoo.com/info/terms/
>
>
>

**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager. administrator@b...]
**********************************************************************

[Non-text portions of this message have been removed]


re: Re-initialize node

From: Bole-Feysot Eric [ebolefeysot@b...]
Date: Fri Mar 16, 2001 1:03 pm
Subject: [VirtualTreeview] Re: Re-initialize node

>
> [ebolefeysot@b...] wrote:
> >
> > Not the entire tree! Only the displayed nodes need to be re-
> > initialized.
> > I made a function called InvalidateAllNode which do what it says.
>
> I was under the impression that the number of displayed nodes in all
> branches may change if a different filter is applied. This does not
> seem to be the case.

It is, but as they are not initialized, I don't care. When they will be
displayed, they will be initialized with new nodes.

When I load my new structure, I un initialize all nodes of the tree. Then,
they will automatically be initialized when needed. Except those already
displayed which need to be initialized.

>
> > Node.States := Node.States - [vsInitialized];
> > in an iteratesubtree from rootnode
> >
> > I supposed it was enough, but no. The nodes are no more initialized,
> > but the already displayed nodes are not re-initialized.
> >
> > I added
> >
> > Invalidate;
>
> Node is only a record, and States is not a class property therefore.
> Node cannot know when you change States, the VTree cannot know that
> either.

Of course not, I need something to tell the vt I changed my node. That's my
problem: how to tell vt the object of all nodes have changed ? I simply
remove the vsinitialized from the states of each node. This way, the node
will be initialized when needed, and the data and childcount will be updated
then.

>
> I suggest you call InvalidateNode(Node) in your iteration method.
> And drop the States and Invalidate calls.

I tried it, but the nodes already initialized are not updated. this result
in illegal access is the data is no more valid.

>
> > But another problem came: Displayed nodes are re-initialized, but
> > only displayed node! this mean that if the first displayed node is a
>
> Of course. Invalidate does not invalidate the logical client area of
> the VTree but only the visible portion which may be less.

Yes.

>
> > The last thing I have to do is to manually 'ReinitNode' of all level
> > 0 nodes to update the data.
>
> This should not be needed anymore with InvalidateNode as said above.

InvalidateNode seems to only repaint the node. Is it right? It does not
remove the initialized status of the node.

Anyway, my procedure do that:
- remove all vsinitialized status from all nodes
- re-init all nodes of the path to topnode (begining with level 0...)
- invalidate to repaint the treeview (and by the way re-init all displayed
node).

All other nodes of the tree are initialized when displayed.

Work quite well, I just have some trouble if the previously selected node
disappear in the filter...

>
> Werner
>
>
>
> ------------------------ Yahoo! Groups Sponsor
> ---------------------~-~>
> Make good on the promise you made at graduation to keep
> in touch. Classmates.com has over 14 million registered
> high school alumni--chances are you'll find your friends!
> http://us.click.yahoo.com/l3joGB/DMUCAA/4ihDAA/iObVlB/TM
> --------------------------------------------------------------
> -------_->
>
> To unsubscribe from this group, send an email to:
> [VirtualTreeview-unsubscribe@egroups.com
>
>
>
> Your use of Yahoo! Groups is subject to
http://docs.yahoo.com/info/terms/

**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager. administrator@b...]
**********************************************************************

[Non-text portions of this message have been removed]


re: Re-initialize node

From: Bole-Feysot Eric [ebolefeysot@b...]
Date: Fri Mar 16, 2001 1:03 pm
Subject: [VirtualTreeview] Re: Re-initialize node

> --- In [VirtualTreeview@y...], [ebolefeysot@b...] wrote:
> ..
> > use the clear method because I loose all expand and select
> > information and I want a dynamic visual update of the tree (node
> > disappearing or appearing).
>
> I am doing something similar to this. My (possibly short term)
> solution was to create a component that saves the expanded state of
> the tree and can then restore it after the tree has been rebuilt. It
> is a simple component that currently works for TVirtualStringTree as
> it uses the node text to identify expanded nodes but it could easily
> be altered to use any information that identifies a node from its
> siblings.

Yes, thats what I did at the beginning, but it makes me sick to store all
infos on all nodes, clear all and rebuild all !

>
> E-mail me if you would like the source.

Thanks, but now, I just have to save the selected node before refreshing and
restoring after. Not a big pain!
Thanks a lot anyway!

--
Eric

>
> Jascha
> [jascha@c...]
>
>
> ------------------------ Yahoo! Groups Sponsor
> ---------------------~-~>
> We give away $70,000 a month! Come to iWin.com for
> your chance to win!
> http://us.click.yahoo.com/r_1oCB/BJVCAA/4ihDAA/iObVlB/TM
> --------------------------------------------------------------
> -------_->
>
> To unsubscribe from this group, send an email to:
> [VirtualTreeview-unsubscribe@egroups.com
>
>
>
> Your use of Yahoo! Groups is subject to
> http://docs.yahoo.com/info/terms/
>
>
>

**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager. administrator@b...]
**********************************************************************

[Non-text portions of this message have been removed]


re: Re: Re-initialize node

From: Mike Lischke [public@l...]
Date: Fri Mar 16, 2001 1:30 pm
Subject: RE: [VirtualTreeview] Re: Re-initialize node

I'm sorry for not taking part earlier in this discussion. I thought you can
figure out the problem yourself and I am so short on time.

> Of course not, I need something to tell the vt I changed my
> node. That's my problem: how to tell vt the object of all nodes have
changed
> ? I simply remove the vsinitialized from the states of each node. This
> way, the node will be initialized when needed, and the data and childcount

> will be updated then.

If I understand correctly then you want to change a node's display data as a
result of changing other data for a node. InvalidateNode is only to refresh
the display not to change anything in the node. ReinitNode is the way to go
if you want to remove the initialized style. This method does not remove any
child nodes (ResetNode does this but you don't want to remove the child
nodes).

For reinitializing every node in the tree I would just iterate the top level
nodes and call ReinitNode(Node, True). Nothing more is needed. An
Tree.Invalidate; call will make sure the display is updated.

You can of course also call ReinitNode (without recursion) whenever you have
new data for it. Still you need Tree.Invalidate or InvalidateNode to refresh
the covered display area.

Ciao, Mike


re: Re: Re-initialize node

From: Mike Lischke [public@l...]
Date: Fri Mar 16, 2001 1:36 pm
Subject: RE: [VirtualTreeview] Re: Re-initialize node

> But another problem came: Displayed nodes are re-initialized, but
> only displayed node! this mean that if the first displayed node is a
> children, its parent is not re-initialized. This ended with a tree
> which have leaves initialized, but root not initialized.
> My access violation came from there: the data of the level 0 nodes
> should have changed (these are list which are completely re-built).
> So, when the doinitnode is launched for a child, I get the parent
> data info which is no more valid.

Aha, this problem was not in my mind when I answered the other mail. What
you actually need is to call ValidateNode with the node you want to have
validated regardless wether it is in display or not.

> The last thing I have to do is to manually 'ReinitNode' of all level
> 0 nodes to update the data.

Yep, that's what I told you reduntantly in the other mail.

> For the end, what would be great is a function which
> - de-initialize all nodes of the tree
> - re-initialize needed nodes : displayed nodes, begining by their
> root, even it is not displayed.
>
> This function will completely synchronise the display with the data
> structure.

If you have to change every node in the tree this would be ok, but usually
you have not to invalidate everything. Just load the new data for a node,
call ReinitNode to make it uninitialized and finally call ValidateNode to
make it initialized again. Loop for more nodes, so you have only those nodes
touched which need it.

Ciao, Mike


re: copying/moving nodes

From: Mike Lischke [public@l...]
Date: Fri Mar 16, 2001 1:41 pm
Subject: RE: [VirtualTreeview] copying/moving nodes

Franz,

> I guess moveto is not enough. I need a copy into a temporary
> object and a
> then a moveto.
> Do You have an example please?

What do you really need? Do you want to move a node or do you want to copy
it? If you want to move it then call Tree.MoveTo if you want to copy it then
call Tree.CopyTo. Quite easy, huh?

Btw: when you have user data stored in your nodes then you have to use
OnSaveNode and OnLoadNode to pass the data along. This is however not
necessary when moving a node within one tree.

Ciao, Mike


re: GetVisiblePath($1)

From: Mike Lischke [public@l...]
Date: Fri Mar 16, 2001 1:47 pm
Subject: RE: [VirtualTreeview] GetVisiblePath($1)

> Can you say just a few (!, don't want to steal your time too
> much) words on where the $1 came from? With reference to my original
posting
> there was this riddle why the Node param in InitNode became $1 when passed

> to VisiblePath.

I cannot tell you where the $1 came from because I never got this error.
What I got however was a very strange behaviour when cache validation was
interrupted due to structural changes in the tree. In this case the cache
where left how it was and shorted. I thought this would be a good idea and
save time in subsequent cache validations. Actually it was not a good idea
because you never can predict where new nodes appear or disappear.

The old code had another bug left over from the change in caching (remember
I have removed one cache). One entry too many was left in the cache with nil
node and absolute top = 0. This was what I considered the source of your $1
pointer.

Ciao, Mike


[no subject]

From: "Eric Verstrepen" [everstrepen@f...]
Date: Fri Mar 16, 2001 1:48 pm
Subject:


re: Overlay Images

From: Mike Lischke [public@l...]
Date: Fri Mar 16, 2001 1:53 pm
Subject: RE: [VirtualTreeview] Overlay Images

>
> I don't think so either. My next step would be to ask the gurus at the
> borland forum *.winapi (Peter Below among others).

I have spent two hours yesterday to find any hint on better blending in
image lists. Well, I found nothing and gave up. This morning I have taken
MMX code into VT to blend bitmaps. This will in the future also be used for
hint animation, node blending to indicate the cut (and other styles) as well
as for the drag image.

Ciao, Mike


re: Overlay Images

From: [teusjdejong@p...]
Date: Fri Mar 16, 2001 5:46 pm
Subject: Re: Overlay Images

--- In [VirtualTreeview@y...], Mike Lischke [public@l...] wrote:
Hi Mike,

> I want to draw some nodes blended against the background just like
the
> Explorer does when marking a file as being cut or when showing
system files.
> The problem is that I can use Brad Stowers system image list and I
get
> beautifully blended images, but with every "normal" image list the
images
> are not blended but some random pixels are removed to simulate a
blended
> look (which looks terrible).
>
> Does anybody know why there is a difference and how I can achieve
smoothly
> blended images with every image list? The only explanation I have
for the
> different behaviour is that the system image list takes another
path than
> every other image list. While I dare Microsoft a lot ugly things I
don't
> think they made such a special implementation just for one image
list.

I don't use Brad stowers Image list - just my own (but of course it
is Windows' image list). If I use your code, when blending images,
the normal images don't show; I only see the overlay images. However,
display of the blended images is perfect when I change the following
lines in PaintNormalAndOverlaymages from:

// Paint an eventual overlay image.
Image := DoGetImageIndex(Node, ikOverlay, Column);
if Image > -1 then
ImageList_DrawEx(FImages.Handle, Image, Canvas.Handle, XPos,
YPos, 0, 0, GetRGBColor(FImages.BkColor),
GetRGBColor(FImages.BlendColor), ILD_OVERLAYMASK);

to:

// Paint an eventual overlay image.
Image := DoGetImageIndex(Node, ikOverlay, Column);
if Image > -1 then
ImageList_DrawEx(FImages.Handle, Image, Canvas.Handle, XPos,
YPos, 0, 0, GetRGBColor(FImages.BkColor),
GetRGBColor(FImages.BlendColor), ILD_OVERLAYMASK or
ILD_TRANSPARENT);

The ILD_TRANSPARENT seems to do the trick. Maybe this helps for other
Imagelists as well?

Teus de Jong.

 | Replies | Author | Date
801 | Re: Overlay Images | Mike Lischke | Sat 3/17/2001
820 | Re: Overlay Images | [jimdk@m...] | Wed 3/21/2001
821 | Re: Overlay Images | [jimdk@m...] | Wed 3/21/2001
823 | Re: Overlay Images | Mike Lischke | Wed 3/21/2001
822 | Re: Overlay Images | Mike Lischke | Wed 3/21/2001
824 | Re: Overlay Images | [jimdk@m...] | Wed 3/21/2001


re: copying/moving nodes

From: "Franz Figl" [frafi@a...]
Date: Fri Mar 16, 2001 9:08 pm
Subject: Re: [VirtualTreeview] copying/moving nodes

Hallo Werner/Mike,

it is really quite easy (and the VTV is very fast, too).
Sorry, but I am still in the TreeView thinking...

My last question: What is the best method to bring an existing TreeView into
Virtual TreeView.

Franz

----- Original Message -----
From: Mike Lischke [public@l...]
To: <VirtualTreeview@yahoogroups.com>
Sent: Friday, March 16, 2001 2:41 PM
Subject: RE: [VirtualTreeview] copying/moving nodes

> Franz,
>
> > I guess moveto is not enough. I need a copy into a temporary
> > object and a
> > then a moveto.
> > Do You have an example please?
>
> What do you really need? Do you want to move a node or do you want to copy
> it? If you want to move it then call Tree.MoveTo if you want to copy it
then
> call Tree.CopyTo. Quite easy, huh?
>
> Btw: when you have user data stored in your nodes then you have to use
> OnSaveNode and OnLoadNode to pass the data along. This is however not
> necessary when moving a node within one tree.
>
> Ciao, Mike
>
>
> To unsubscribe from this group, send an email to:
> VirtualTreeview-unsubscribe@egroups.com
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>
>

 | Replies | Author | Date
802 | Re: copying/moving nodes | Mike Lischke | Sat 3/17/2001


re: Re: Overlay Images

From: "Mike Lischke" [public@l...]
Date: Sat Mar 17, 2001 10:23 am
Subject: RE: [VirtualTreeview] Re: Overlay Images

>
> The ILD_TRANSPARENT seems to do the trick. Maybe this helps for other
> Imagelists as well?

I have tried this, but it is not entirely what I want. As I already said I will
use my own MMX
blending for the images because I need it anyway (and the entire blend
implementation in three
different flavours costs only ~150 lines of code). Thank you anyway for the tip.

Ciao, Mike

 | Replies | Author | Date
820 | Re: Overlay Images | [jimdk@m...] | Wed 3/21/2001
821 | Re: Overlay Images | [jimdk@m...] | Wed 3/21/2001
823 | Re: Overlay Images | Mike Lischke | Wed 3/21/2001
822 | Re: Overlay Images | Mike Lischke | Wed 3/21/2001
824 | Re: Overlay Images | [jimdk@m...] | Wed 3/21/2001


re: copying/moving nodes

From: "Mike Lischke" [public@l...]
Date: Sat Mar 17, 2001 10:25 am
Subject: RE: [VirtualTreeview] copying/moving nodes

> My last question: What is the best method to bring an existing TreeView into
> Virtual TreeView.

Migration is not that easy because of the paradigm shift. Some help is there to
use old code (like
the compatibility methods AddChild and InsertNode) but the work is still not
trivial. I recommend
that you play with the demos until you understood the most important things
about VT and then
rewrite the tree parts of your application.

Ciao, Mike


New to Vtree

From: "Kaputnik" [delphi@k...]
Date: Sat Mar 17, 2001 1:09 pm
Subject: New to Vtree

Hi,

I downloaded Vtree a few days ago and am stunned by the features and speed
it has.
I finally managed to work out how to program it, but id did cost me losts of
headaches.

As the Vtree part of my app is working finally (after several long shifts) I
don't need any particular help, but would like to say only, that the
included demos were absolutely of no help for me. There is no documentation
in the files area, and on the homepage (lischke-online.de) wasn't really of
any help for me.

Vtree is really a nice peace of work, but please put up a better
documentation and demos. As I needed the tree badly, I took the headaches,
but I can think of several people simply giving up on it after trying it for
a few minutes.

A demo, which actually shows, how to build a tree not only with random
values (if level is less than 5, then add 5 children....) but how to build a
tree from some already present data-structure, be it only a collection or
so....

These are only suggestions, please be not offended.
CU, Kaputnik
(Nick Josipovic)

[nick@k...]
[kap@k...]
--------------------------------------------------------------
superior Client/Server programming:
www.IBObjects.com
a nice tool for Interbase:
www.InterbaseWorkbench.com

[Non-text portions of this message have been removed]

 | Replies | Author | Date
804 | Re: New to Vtree | Mike Lischke | Sat 3/17/2001
805 | Re: New to Vtree | Kaputnik | Sat 3/17/2001
806 | Re: New to Vtree | LPA | Sat 3/17/2001
807 | Re: New to Vtree | Mike Lischke | Sat 3/17/2001
808 | Re: New to Vtree | LPA | Sat 3/17/2001


re: New to Vtree

From: "Mike Lischke" [public@l...]
Date: Sat Mar 17, 2001 3:02 pm
Subject: RE: [VirtualTreeview] New to Vtree

Hi Nick,

> As the Vtree part of my app is working finally (after several long shifts) I
> don't need any particular help, but would like to say only, that the
> included demos were absolutely of no help for me. There is no documentation
> in the files area, and on the homepage (lischke-online.de) wasn't really of
> any help for me.

Do you mean not even the simplest demo program (Minimal) has helped you to get
started? Actually,
this demo consists of only 155 lines but fills a Virtual Treeview with data. So
I cannot imaging to
make it even simpler to show what to do. What would you suggest?

> Vtree is really a nice peace of work, but please put up a better
> documentation and demos. As I needed the tree badly, I took the headaches,
> but I can think of several people simply giving up on it after trying it for
> a few minutes.

Since you were frank with me I will be so to you too. Actually, Virtual
Treeview is a huge piece of
work which consists currently of nearly 21000 lines of code (other programmers
write entire projects
of that size). It costed me about 2400 hours of my precious life time (this is
likely
underestimated). Half of this time was spend during my spare time (today I
already spent 4,5 hours
working on VT). Although I enjoyed this time because it was fun it was still
work. I know that the
documentation could be better and I also know the demos could be better, but I
honestly think that
people who get such a control for nothing could at least invest the time to
learn how it works. You
will not have a better time with any other control of that complexity, but you
would have to pay
much money for this. Wouldn't you agree?

Because I cannot afford extra time to write a better documentation (aside the
fact that I don't like
to write one), I have set up this mailing list where I give help the best I
can. Additionally I have
about 10 private mails per day which only belong to Virtual Tree, not counted
the other 50-90 mails
on average which ask for help with other stuff from me (and even not from me)
or come from one of
the 15 mailing lists I'm subscribed to to manage open source projects like JEDI
(where I am in the
steering group) or where I talk with the gurus of the scene (e.g. Unicode list).

> A demo, which actually shows, how to build a tree not only with random
> values (if level is less than 5, then add 5 children....) but how to build a
> tree from some already present data-structure, be it only a collection or
> so....

There are several demos of that kind. For instance the Properties demo uses a
constant list of data
(which is hard coded) to fill a tree similar to the property view for Word
documents. The image
viewer tree reads dynamically in a predefined structure (a file structure from
the hard disk) to
present the user with a list of image in a folder subtree.

I agree however that it is necessary to provide another demo which shows how to
use the "old style"
for filling a tree, that is, InsertNode and AddChild, as this requires some
care to work correctly.
Additionally, the Advanced demo as it is on my homepage currently is difficult
to understand because
the different trees are in one unit only. Thomas Bogenrieder has already
provided a nice little
frame work which allows to attach demos as they are build but still have only
one demo in one unit.
I'm sure this will make things much cleaner.

> These are only suggestions, please be not offended.

If you can give me real suggestions (that something must be better is no
suggestion) or even help to
improve the "suboptimal" :o] parts then I will not be offended (quite the
opposite: happy).

> superior Client/Server programming:
> www.IBObjects.com

Btw: Paul Gallagher has written a cool IB aware treeview which you can download
from the file area
of this list. This might help even more to understand the details of Virtual
Treeview.

Ciao, Mike

 | Replies | Author | Date
805 | Re: New to Vtree | Kaputnik | Sat 3/17/2001


re: New to Vtree

From: "Kaputnik" [delphi@k...]
Date: Sat Mar 17, 2001 3:30 pm
Subject: RE: [VirtualTreeview] New to Vtree

Puh, what a long answer :-))

See inline comments for my 2 cents..

CU, Kaputnik
(Nick Josipovic)

> -----Original Message-----
> From: Mike Lischke [mailto:[public@l...]]
>
> Do you mean not even the simplest demo program (Minimal) has
> helped you to get started? Actually,
> this demo consists of only 155 lines but fills a Virtual Treeview
> with data. So I cannot imaging to
> make it even simpler to show what to do. What would you suggest?
>

Well, it helped only a bit in seeing, that i have to use the events on
getnodedatasize, oninitnode and oninitchildren....

> > Vtree is really a nice peace of work, but please put up a better
> > documentation and demos. As I needed the tree badly, I took the
> headaches,
> > but I can think of several people simply giving up on it after
> trying it for
> > a few minutes.
>
> Since you were frank with me I will be so to you too. Actually,
> Virtual Treeview is a huge piece of
> work which consists currently of nearly 21000 lines of code
> (other programmers write entire projects
> of that size). It costed me about 2400 hours of my precious life
> time (this is likely
> underestimated). Half of this time was spend during my spare time
> (today I already spent 4,5 hours
> working on VT). Although I enjoyed this time because it was fun
> it was still work. I know that the
> documentation could be better and I also know the demos could be
> better, but I honestly think that
> people who get such a control for nothing could at least invest
> the time to learn how it works. You
> will not have a better time with any other control of that
> complexity, but you would have to pay
> much money for this. Wouldn't you agree?
>

I won't in any way say that VTree isn't great....and once you get the
paradigm shift done, it is actually very nice to do things in it....and free
is the price I like most.
i appreciate the work you've done very much

It is only, that this shift is not that well described as it should...a
how-to is far better than a description for people like me (weak in theory,
good in practive)

> Because I cannot afford extra time to write a better
> documentation (aside the fact that I don't like
> to write one), I have set up this mailing list where I give help
> the best I can. Additionally I have
> about 10 private mails per day which only belong to Virtual Tree,
> not counted the other 50-90 mails
> on average which ask for help with other stuff from me (and even
> not from me) or come from one of
> the 15 mailing lists I'm subscribed to to manage open source
> projects like JEDI (where I am in the
> steering group) or where I talk with the gurus of the scene (e.g.
> Unicode list).
>
> > A demo, which actually shows, how to build a tree not only with random
> > values (if level is less than 5, then add 5 children....) but
> how to build a
> > tree from some already present data-structure, be it only a
> collection or
> > so....
>
> There are several demos of that kind. For instance the Properties
> demo uses a constant list of data
> (which is hard coded) to fill a tree similar to the property view
> for Word documents. The image
> viewer tree reads dynamically in a predefined structure (a file
> structure from the hard disk) to
> present the user with a list of image in a folder subtree.
>

Well, the advanced demo contains much stuff in it, I agree. the problem is,
that all trees are adressed in one unit, and this unit is only sparsely
commented. Well, don't say there are enough comments in is, as there are
not.
Remember, that many people (including me) have far less programming skills
than you (I could never write such a beast at all).
Actually, commenting WHY you are doing things is better as commenting what
you do there :-)

I would actually be quite happy, if the advanced demo itself were splitted
into several smaller demos would quite help (at least it would help me).

> I agree however that it is necessary to provide another demo
> which shows how to use the "old style"
> for filling a tree, that is, InsertNode and AddChild, as this
> requires some care to work correctly.
> Additionally, the Advanced demo as it is on my homepage currently
> is difficult to understand because
> the different trees are in one unit only. Thomas Bogenrieder has
> already provided a nice little
> frame work which allows to attach demos as they are build but
> still have only one demo in one unit.
> I'm sure this will make things much cleaner.
>

Well, let me explain a bit more.
I have an app containing a fairly large data-structure.
I have an object-list containing several classes which in turn contain
several sub-classes in yet another object-list.
This, the tree is exactly 2 levels deep, and contains several columns
describing the properties of these objects and suboibjects.
Figuring out how to pass the pointers (never needed to work with pointers in
more than 3 years now) and derefrence them, create a node-data-structure and
accessing it were the hard parts. Every tree-node will open a distinct frame
(outlook style app) where the properties of these objects can be changed,
and the tree-grid shows these changes interactively (mainly change of
imageindex)

> If you can give me real suggestions (that something must be
> better is no suggestion) or even help to
> improve the "suboptimal" :o] parts then I will not be offended
> (quite the opposite: happy).
>

I would love that, but I am buried into my own work here.....perhaps, if
things settle down a bit, I could set up a small own demo showing the most
ugly parts of Vtree (ugly means pitfalls in conversion from a normal tree),
but this may take quite a while....

> > superior Client/Server programming:
> > www.IBObjects.com
>
> Btw: Paul Gallagher has written a cool IB aware treeview which
> you can download from the file area
> of this list. This might help even more to understand the details
> of Virtual Treeview.
>

Actually, I came to VTree because of Paul's IBOVtree :-)))


re: New to Vtree

From: "LPA" [lpasseb@w...]
Date: Sat Mar 17, 2001 6:25 pm
Subject: Re: [VirtualTreeview] New to Vtree

Hi everybody,

You don't hear me a lot of because I spend a lot of my time to understand
this fantastic comp. but here is my mind...

These comps are really fantastic and I think, you (Mike) are really cool to
set these comps free.

I think I am like Nick, I'd like to have a better example, a great doc
(printed ;o))) but if I really want this, I shoud go to see some comercials
comps.......

Then if Mike had done this unvaluable treeview comp, 2400 hours to code it,
we can take 1 or 2 hours to try to understand the samples even if this is
not really easy to understand....

And if we don't understand, we can use this ml, where Mike really take time
to answer people.....

That's all.....

No a last word : THANK YOU VERY MUCH for this marvelous comps..... and
continue.

Laurent

> Hi Nick,
>
> > As the Vtree part of my app is working finally (after several long
shifts) I
> > don't need any particular help, but would like to say only, that the
> > included demos were absolutely of no help for me. There is no
documentation
> > in the files area, and on the homepage (lischke-online.de) wasn't really
of
> > any help for me.
>
> Do you mean not even the simplest demo program (Minimal) has helped you to
get started? Actually,
> this demo consists of only 155 lines but fills a Virtual Treeview with
data. So I cannot imaging to
> make it even simpler to show what to do. What would you suggest?
>
> > Vtree is really a nice peace of work, but please put up a better
> > documentation and demos. As I needed the tree badly, I took the
headaches,
> > but I can think of several people simply giving up on it after trying it
for
> > a few minutes.
>
> Since you were frank with me I will be so to you too. Actually, Virtual
Treeview is a huge piece of
> work which consists currently of nearly 21000 lines of code (other
programmers write entire projects
> of that size). It costed me about 2400 hours of my precious life time
(this is likely
> underestimated). Half of this time was spend during my spare time (today I
already spent 4,5 hours
> working on VT). Although I enjoyed this time because it was fun it was
still work. I know that the
> documentation could be better and I also know the demos could be better,
but I honestly think that
> people who get such a control for nothing could at least invest the time
to learn how it works. You
> will not have a better time with any other control of that complexity, but
you would have to pay
> much money for this. Wouldn't you agree?
>
> Because I cannot afford extra time to write a better documentation (aside
the fact that I don't like
> to write one), I have set up this mailing list where I give help the best
I can. Additionally I have
> about 10 private mails per day which only belong to Virtual Tree, not
counted the other 50-90 mails
> on average which ask for help with other stuff from me (and even not from
me) or come from one of
> the 15 mailing lists I'm subscribed to to manage open source projects like
JEDI (where I am in the
> steering group) or where I talk with the gurus of the scene (e.g. Unicode
list).
>
> > A demo, which actually shows, how to build a tree not only with random
> > values (if level is less than 5, then add 5 children....) but how to
build a
> > tree from some already present data-structure, be it only a collection
or
> > so....
>
> There are several demos of that kind. For instance the Properties demo
uses a constant list of data
> (which is hard coded) to fill a tree similar to the property view for Word
documents. The image
> viewer tree reads dynamically in a predefined structure (a file structure
from the hard disk) to
> present the user with a list of image in a folder subtree.
>
> I agree however that it is necessary to provide another demo which shows
how to use the "old style"
> for filling a tree, that is, InsertNode and AddChild, as this requires
some care to work correctly.
> Additionally, the Advanced demo as it is on my homepage currently is
difficult to understand because
> the different trees are in one unit only. Thomas Bogenrieder has already
provided a nice little
> frame work which allows to attach demos as they are build but still have
only one demo in one unit.
> I'm sure this will make things much cleaner.
>
> > These are only suggestions, please be not offended.
>
> If you can give me real suggestions (that something must be better is no
suggestion) or even help to
> improve the "suboptimal" :o] parts then I will not be offended (quite the
opposite: happy).
>
> > superior Client/Server programming:
> > www.IBObjects.com
>
> Btw: Paul Gallagher has written a cool IB aware treeview which you can
download from the file area
> of this list. This might help even more to understand the details of
Virtual Treeview.
>
> Ciao, Mike

 | Replies | Author | Date
807 | Re: New to Vtree | Mike Lischke | Sat 3/17/2001


re: New to Vtree

From: "Mike Lischke" [public@l...]
Date: Sat Mar 17, 2001 6:54 pm
Subject: RE: [VirtualTreeview] New to Vtree

> Then if Mike had done this unvaluable treeview comp, 2400 hours to code it,
> we can take 1 or 2 hours to try to understand the samples even if this is
> not really easy to understand....

Don't think 2400 hours are much too high. Keep in mind in July VT becomes
already two years of age.

Ciao, Mike


re: New to Vtree

From: "LPA" [lpasseb@w...]
Date: Sat Mar 17, 2001 7:20 pm
Subject: Re: [VirtualTreeview] New to Vtree

> Don't think 2400 hours are much too high. Keep in mind in July VT becomes
already two years of age.

Don't be afraid Mike, I believe you.. The only thing I wanted to say (but i
know my english is bad) is if you took 2400 hours to code it, we can take 1
or 2 hours to try to understand.... ;o)))))))))))))))

> Ciao, Mike

CU SOON
Laurent


?Serialization of user data.

From: [garycramblitt@e...]
Date: Mon Mar 19, 2001 12:17 am
Subject: ?Serialization of user data.

I'm just a beginner with VT. I encountered some issues and hope
someone can help me.

I'm building an application using VT. My user data is stored in a
tree that parallels the tree structure of the VT. (The data is
actually stored in the Microsoft XML Dom object, i.e., Microsoft XML
Parser, but the issues I describe here apply to any app where the
user data is stored in a tree structure similar to the same structure
as in VT.)

Because my data tree parallels the VT, anytime a node in the VT is
copied or moved, I must also copy or move the corresponding node in
my user data tree.

At first, I tried hooking the OnNodeCopying/OnNodeCopied and
OnModeMoving/OnNodeMoved events, but immediately ran into a problem.
Although the OnNodeMoving event passes the Source and Target nodes,
the OnNodeCopying event passes only the Target node. Even more of a
problem is that the passed node has already been disconnected from
the VT when OnNodeCopying is called, which gives me problems locating
the corresponding node in my user data tree. (I rely on the Parent
property of the VT node in order to find the corresponding node in my
user data tree.) It seems like OnNodeCopying ought to pass both the
source and target nodes and it should do so before the source is
disconnected. ???

So I abandoned that approach. Next I tried hooking the OnNodeLoad
and OnNodeSave (Serialization) events. However, I ran smack into a
problem with this. It seems that WriteNode/WriteChunks writes all
the VT nodes into the stream from topmost node to leaf nodes, but
then writes the user data in the opposite order -- from leaf nodes up
to topmost node. This is a problem when unserializing because I
cannot create the leaf nodes unless their parents have already been
created.

To solve this, I overrode the ReadChunk and WriteChunks methods, very
much like the TVirtualStringTree does. Here's my code:

procedure TDomTreeView.WriteChunks(Stream: TStream; Node:
PVirtualNode); {override;}
begin
SaveDomNode(Node, Stream);
inherited;
end;

function TDomTreeView.ReadChunk(Stream: TStream; Node: PVirtualNode;
ChunkType, ChunkSize: Integer): Boolean; {override;}
begin
case ChunkType of
ciDomNode: Result := LoadDomNode(Node, Stream, ChunkSize);
else
Result := inherited ReadChunk(Stream, Node, ChunkType,
ChunkSize);
end;
end;

The SaveDomNode routine writes my user data for a node into the
stream as a chunk of type ciDomNode. LoadDomNode reads the node from
the stream and creates the node in my user data tree. Because
WriteChunks saves the node BEFORE calling the inherited method, the
nodes are written into the stream in topmost to leaf order. Problem
solved.

This works great for copying but I next encountered a problem with
moving. It seems that MoveTo has an "optimization" feature that
avoids serializing the data if moving a node(s) within the same tree.

So my questions are:
1. Is there a way to force optimization off?
2. If not, I could patch the VT code to bypass optimization, but
I'd prefer not to mess with the VT code itself.

Maybe I just don't understand?

Thanks for any help,
Gary Cramblitt

 | Replies | Author | Date
810 | Re: ?Serialization of user data. | Mike Lischke | Tue 3/20/2001
811 | Re: ?Serialization of user data. | [garycramblitt@e...] | Tue 3/20/2001
852 | Re: ?Serialization of user data. | Mike Lischke | Sat 3/24/2001


re: ?Serialization of user data.

From: Mike Lischke [public@l...]
Date: Tue Mar 20, 2001 10:56 am
Subject: RE: [VirtualTreeview] ?Serialization of user data.

Hi Gary,

> At first, I tried hooking the OnNodeCopying/OnNodeCopied and
> OnModeMoving/OnNodeMoved events, but immediately ran into a problem.
> Although the OnNodeMoving event passes the Source and Target nodes,
> the OnNodeCopying event passes only the Target node.

Actually, it is not the target node but the new node (one has been added
because of the copy command).

> Even more of a
> problem is that the passed node has already been disconnected from
> the VT when OnNodeCopying is called,

This is untrue. OnNodeCopying is called in exactly two cases:

- in CopyTo after the new node has been inserted
- in ProcessOLEData after the new node has been inserted

In both cases is the node of course already part of the tree.

> It seems like OnNodeCopying ought to pass both the
> source and target nodes and it should do so before the source is
> disconnected. ???

Mmh, it could be discussed why moving a node comes with source and target
node while copying it comes only with the new node. My thoughts behind this
design were that a user is interested in exactly these nodes. The events are
mainly to have a notification for the application when the user modifies the
tree via the clipboard. Since this call might not directly be initiated by
the application it is necessary to know what node has been inserted.
Everything else can be determined from this node. The OnNodeMoving and
OnNodeCopying events are rather decision events, the action should happen in
OnNodeMoved and OnNodeCopied.

> So I abandoned that approach. Next I tried hooking the OnNodeLoad
> and OnNodeSave (Serialization) events. However, I ran smack into a
> problem with this. It seems that WriteNode/WriteChunks writes all
> the VT nodes into the stream from topmost node to leaf nodes, but
> then writes the user data in the opposite order -- from leaf nodes up
> to topmost node. This is a problem when unserializing because I
> cannot create the leaf nodes unless their parents have already been
> created.

You are right. This is the socalled depth-first approach and cannot be
changed due to the chunk mechanism. It is questionable however, whether a
node's data interpretation should depend on its parent node. You could make
your life much easier by inserting a marker in to every node's data chunk
(in OnSaveNode, just write a cardinal into the stream before the actual
data). This marker can clearly identify what data will now arrive.

> To solve this, I overrode the ReadChunk and WriteChunks methods, very
> much like the TVirtualStringTree does. Here's my code:
>
> procedure TDomTreeView.WriteChunks(Stream: TStream; Node:
> PVirtualNode); {override;}
> begin
> SaveDomNode(Node, Stream);
> inherited;
> end;
>
> function TDomTreeView.ReadChunk(Stream: TStream; Node: PVirtualNode;
> ChunkType, ChunkSize: Integer): Boolean; {override;}
> begin
> case ChunkType of
> ciDomNode: Result := LoadDomNode(Node, Stream, ChunkSize);
> else
> Result := inherited ReadChunk(Stream, Node, ChunkType,
> ChunkSize);
> end;
> end;

Although you perhaps don't need this in your case, but I much (!) appreciate
that somebody finally has used this feature too (to modify the chunk
processing), as this is something which can only partially be tested due to
the varying combinations and is not used very often.

> This works great for copying but I next encountered a problem with
> moving. It seems that MoveTo has an "optimization" feature that
> avoids serializing the data if moving a node(s) within the same tree.
>
> So my questions are:
> 1. Is there a way to force optimization off?
> 2. If not, I could patch the VT code to bypass optimization, but

The easiest way to do this is to call CopyTo and remove the old node after
the call returns. This is what essentially happens when copying nodes
between different trees.

Ciao, Mike

 | Replies | Author | Date
811 | Re: ?Serialization of user data. | [garycramblitt@e...] | Tue 3/20/2001


re: ?Serialization of user data.

From: [garycramblitt@e...]
Date: Tue Mar 20, 2001 5:47 pm
Subject: Re: ?Serialization of user data.

Thanks for responding Mike. Wow. Excellent support and free too! My comments
are at the bottom.

--- In [VirtualTreeview@y...], Mike Lischke [public@l...] wrote:
> Hi Gary,
>
> > At first, I tried hooking the OnNodeCopying/OnNodeCopied and
> > OnModeMoving/OnNodeMoved events, but immediately ran into a problem.
> > Although the OnNodeMoving event passes the Source and Target nodes,
> > the OnNodeCopying event passes only the Target node.
>
> Actually, it is not the target node but the new node (one has been added
> because of the copy command).
>
> > Even more of a
> > problem is that the passed node has already been disconnected from
> > the VT when OnNodeCopying is called,
>
> This is untrue. OnNodeCopying is called in exactly two cases:
>
> - in CopyTo after the new node has been inserted
> - in ProcessOLEData after the new node has been inserted
>
> In both cases is the node of course already part of the tree.
>
> > It seems like OnNodeCopying ought to pass both the
> > source and target nodes and it should do so before the source is
> > disconnected. ???
>
> Mmh, it could be discussed why moving a node comes with source and target
> node while copying it comes only with the new node. My thoughts behind this
> design were that a user is interested in exactly these nodes. The events are
> mainly to have a notification for the application when the user modifies the
> tree via the clipboard. Since this call might not directly be initiated by
> the application it is necessary to know what node has been inserted.
> Everything else can be determined from this node. The OnNodeMoving and
> OnNodeCopying events are rather decision events, the action should happen in
> OnNodeMoved and OnNodeCopied.
>
>
> > So I abandoned that approach. Next I tried hooking the OnNodeLoad
> > and OnNodeSave (Serialization) events. However, I ran smack into a
> > problem with this. It seems that WriteNode/WriteChunks writes all
> > the VT nodes into the stream from topmost node to leaf nodes, but
> > then writes the user data in the opposite order -- from leaf nodes up
> > to topmost node. This is a problem when unserializing because I
> > cannot create the leaf nodes unless their parents have already been
> > created.
>
> You are right. This is the socalled depth-first approach and cannot be
> changed due to the chunk mechanism. It is questionable however, whether a
> node's data interpretation should depend on its parent node. You could make
> your life much easier by inserting a marker in to every node's data chunk
> (in OnSaveNode, just write a cardinal into the stream before the actual
> data). This marker can clearly identify what data will now arrive.
>
>
> > To solve this, I overrode the ReadChunk and WriteChunks methods, very
> > much like the TVirtualStringTree does. Here's my code:
> >
> > procedure TDomTreeView.WriteChunks(Stream: TStream; Node:
> > PVirtualNode); {override;}
> > begin
> > SaveDomNode(Node, Stream);
> > inherited;
> > end;
> >
> > function TDomTreeView.ReadChunk(Stream: TStream; Node: PVirtualNode;
> > ChunkType, ChunkSize: Integer): Boolean; {override;}
> > begin
> > case ChunkType of
> > ciDomNode: Result := LoadDomNode(Node, Stream, ChunkSize);
> > else
> > Result := inherited ReadChunk(Stream, Node, ChunkType,
> > ChunkSize);
> > end;
> > end;
>
> Although you perhaps don't need this in your case, but I much (!) appreciate
> that somebody finally has used this feature too (to modify the chunk
> processing), as this is something which can only partially be tested due to
> the varying combinations and is not used very often.
>
>
> > This works great for copying but I next encountered a problem with
> > moving. It seems that MoveTo has an "optimization" feature that
> > avoids serializing the data if moving a node(s) within the same tree.
> >
> > So my questions are:
> > 1. Is there a way to force optimization off?
> > 2. If not, I could patch the VT code to bypass optimization, but
>
> The easiest way to do this is to call CopyTo and remove the old node after
> the call returns. This is what essentially happens when copying nodes
> between different trees.
>
> Ciao, Mike

So if I understand what you are suggesting, I will convert all Move operations
into a Copy and Delete by hooking the OnNodeMoving event. In that event
handler, I will set Allowed to False, then call CopyTo with the Source and
Target nodes, and finally call DeleteNode on the Source node. Right?? If that
is right, then I think my problem is solved. Thank you VERY MUCH!

I want to respond to some of your comments above in a general way because I
think there are some important principles involved. There is an implicit
design assumption in VT that is at the crux of my problem, and that is this:
that the user data associated with every node in the tree can be accessed
either by storing it in each node of the VT, or by storing a persistent pointer
or record ID of some kind in each node of the VT. An important corollary to
this assumption is that each piece of data associated with a node of the tree
"stands alone", independent of its position in the tree. Hence your statement
that "It is questionable however, whether a node's data interpretation should
depend on its parent node."

In my case, this is definitely not the case. Nor do I think I am alone. In
the XML world, with its Document Object Model (DOM), the position a node has
within the DOM has semantic meaning. The DOM is definitely a tree structure,
and the meaning of a node can change drastically if the node is moved within
the tree. This principle is so important that some DOM APIs purposefully do
not offer a means to directly access nodes by ID or pointer; one MUST "walk"
the tree.

I am using the Microsoft XML Parser, which of course implements a DOM. As a
practical programming problem, the Ms DOM does not offer any sort of persistent
ID or pointer to nodes. One can only locate a node in the DOM via its position
within the tree, i.e, one must "walk" the tree. I certainly wish this were
otherwise, but there it is. For whatever reason, Microsoft has chosen not to
offer that capability. (It is true that one can associate an ID attribute with
nodes and that one can locate a node by ID very quickly, but the problem is
that the ORIGINAL XML document must have these IDs, and that is not a practical
alternative in my case.)

So you can see that I very much need to know both the Source AND the Target
nodes in any copy or move operation, and that furthermore, the Source and
Target nodes need to be connected to the VT when they are passed in the
OnMoving/Copying events, since their position in the VT is the only mechanism I
have for locating the corresponding nodes in the DOM.

That said, and assuming your suggestion above works for me, I can live with the
current design of VT.

As to the "depth-first" serialization of user node data. Frankly, I'm
surprised at your position on this. Had VT serialized its own nodes
"depth-first", I doubt you could get the serialization to work at all! Surely
you are not suggesting that VT would never be used to present data that is
itself organized in a tree structure????

However, since it was easy for me to solve this problem by overriding the
OnNodeSave and OnNodeLoad events, again, I can live with the current VT design.
(Given my solution, one can even argue that VT already offers both "depth
first" and "top first" serialization mechanisms.)

I hope you'll take my comments in the spirit they are intended; to offer
comments that might lead to a stronger, more (re)usable product. Thanks again
for your support and this really excellent component.

Gary Cramblitt


MultiSelect OLE Drag Drop

From: [jimdk@m...]
Date: Wed Mar 21, 2001 3:46 am
Subject: MultiSelect OLE Drag Drop

I finally took the time to understand how VT works and agree this is
the way it should have been done to start with!

I have a question on OLE D&D.

Create a 3 level treeview using the basic demo. Set dragmode to
dmAutomatic. Select a node in the second level that is expanded.
Also select a child node of that selected node. Now start the OLE
drag. The selected items are in the drag image but also any subnodes
of the top level node that is being dragged. I sort of understand the
logic behind this since those nodes will be moved along with their
parent(s) but it "feels" like it is doing something wrong since the
nodes are not selected. Is there someway to make the drag image only
be made up of the selected nodes?

Jim Kueneman

 | Replies | Author | Date
814 | Re: MultiSelect OLE Drag Drop | Werner Lehmann | Wed 3/21/2001
816 | Re: MultiSelect OLE Drag Drop | [jimdk@m...] | Wed 3/21/2001
841 | Re: MultiSelect OLE Drag Drop | Mike Lischke | Sat 3/24/2001
843 | Re: MultiSelect OLE Drag Drop | Mike Lischke | Sat 3/24/2001
865 | Re: MultiSelect OLE Drag Drop | [jimdk@m...] | Sat 3/24/2001
870 | Re: MultiSelect OLE Drag Drop | Mike Lischke | Sun 3/25/2001
877 | Image painting (was: MultiSelect OLE Drag Drop) | Mike Lischke | Sun 3/25/2001
879 | Re: Image painting (was: MultiSelect OLE Drag Dro | [jimdk@m...] | Sun 3/25/2001


Deriving from VirtualStringTree

From: [jimdk@m...]
Date: Wed Mar 21, 2001 4:00 am
Subject: Deriving from VirtualStringTree

Lets say you really hate events and think of them as fancy GOTO's and
you try always derive new classes which know how to handle themselves
following good OOP practice <g>. With normal controls derived from
TWinControl I usually head right for a message handler and work from
the messages. If one wanted to create a new component derived from
VirtualStringTree that, say looks like Explorer's treeview, and I want
all its functionality encapsulated within the class where is the best
place to hook into the Virtual Treeview. I have not spent a lot of
time looking over the 22,000 lines of code but it does appear it has a
lot of DoXXXX methods. Is this the best place? Override these
methods for say getting the text, or the image index, or InitNode
since my new class will know how to handle this events by itself?

Thanks again,

Jim Kueneman

 | Replies | Author | Date
815 | Re: Deriving from VirtualStringTree | Werner Lehmann | Wed 3/21/2001
817 | Re: Deriving from VirtualStringTree | [jimdk@m...] | Wed 3/21/2001
842 | Re: Deriving from VirtualStringTree | Mike Lischke | Sat 3/24/2001


re: MultiSelect OLE Drag Drop

From: Werner Lehmann [wl@b...]
Date: Wed Mar 21, 2001 10:18 am
Subject: Re: [VirtualTreeview] MultiSelect OLE Drag Drop

[jimdk@m...] wrote:
>
> of the top level node that is being dragged. I sort of understand the
> logic behind this since those nodes will be moved along with their
> parent(s) but it "feels" like it is doing something wrong since the
> nodes are not selected. Is there someway to make the drag image only
> be made up of the selected nodes?

You are probably right about your 'full branch of top most selected parent
is moved' assumption. But if we agree that this is sensible and should be
kept it makes also a lot of sense to reflect this behaviour already during
the drag. The user can see what he really does before the drop occurs. In
the way that you suggested he would do the drop and afterwards wonder why
the whole branch had moved suddenly when he only wanted two nodes.

Werner

 | Replies | Author | Date
816 | Re: MultiSelect OLE Drag Drop | [jimdk@m...] | Wed 3/21/2001


re: Deriving from VirtualStringTree

From: Werner Lehmann [wl@b...]
Date: Wed Mar 21, 2001 10:14 am
Subject: Re: [VirtualTreeview] Deriving from VirtualStringTree

Hi Jim,

do you plan to exchange the GxExplorerTreeview? *g*

First I don't understand why one could consider events VCL style as
fancy GOTO's. I would rather compare them to optional anonymous sub-
routine calls :)

Overriding the Do* methods is the usual VCL way and I would recommend
it here as well. Of course you can also assign event handlers directly
but must not publish these events then in your descendant component.
In fact it might be necessary to do this at times even if you are
following the Do* approach because some Do* methods contain more code
than "if assigned(event) then event(self)" which must not be omitted.

Werner

 | Replies | Author | Date
817 | Re: Deriving from VirtualStringTree | [jimdk@m...] | Wed 3/21/2001


re: MultiSelect OLE Drag Drop

From: [jimdk@m...]
Date: Wed Mar 21, 2001 12:47 pm
Subject: Re: MultiSelect OLE Drag Drop

--- In [VirtualTreeview@y...], Werner Lehmann [wl@b...] wrote:
> [jimdk@m...] wrote:
> You are probably right about your 'full branch of top most selected
parent
> is moved' assumption. But if we agree that this is sensible and
should be
> kept it makes also a lot of sense to reflect this behaviour already
during
> the drag. The user can see what he really does before the drop
occurs. In
> the way that you suggested he would do the drop and afterwards
wonder why
> the whole branch had moved suddenly when he only wanted two nodes.

It does make sense, after you think about it. To be honest I spent
about an hour tracing the code to see where the "bug" was. Only after
I started to select nodes two at a time to see how to "reproduce the
bug" did it finally click what was happening. I think the reason it
really threw me was because I was added enough children that they went
off the bottom of the control so it appeared the control was just
taking all the nodes from the selected one to the bottom without
noticing I only had one or two selected. If there where only a few
children I may have caught on quicker. Maybe another reason it
confused me way if only 1/2 a node is visible at the bottom the drag
image includes only this half and it looks strange.

I'm sure I will accept it eventually and think it is a good feature,
it was just my first impression (which is very important to good
software IMHO)

Jim Kueneman


re: Deriving from VirtualStringTree

From: [jimdk@m...]
Date: Wed Mar 21, 2001 12:54 pm
Subject: Re: Deriving from VirtualStringTree

--- In [VirtualTreeview@y...], Werner Lehmann [wl@b...] wrote:
> Hi Jim,
>
> do you plan to exchange the GxExplorerTreeview? *g*

Um.... maybe <g>

>
> First I don't understand why one could consider events VCL style as
> fancy GOTO's. I would rather compare them to optional anonymous sub-
> routine calls :)

I thought they were the neatest thing since sliced bread when I
finally moved from TPW to Delphi. After getting involved with larger
projects I find them to be a pain to understand you code a few months
later. I called it a fancy GOTO because that is the way it feels
while trying to understand the program flow sometimes. Suddenly you
hop out of a class into another class that modifies the class you were
just in then hops back to the origional class, or into a third class
then back to the second back to the first when that class could easily
have handled to whole task if it only had a bit more information. It
just feels like the code jumps around all the time hence my GOTO
statement.

Thanks
Jim Kueneman


testmail please ignore

From: "Mike Lischke" [public@l...]
Date: Wed Mar 21, 2001 8:01 pm
Subject: testmail please ignore

testing...

Ciao, Mike

Dipl. Ing. Mike Lischke
Senior software developer
--
Homepage: http://www.lischke-online.de
GraphicEx: http://www.lischke-online.de/Graphics.html
Virtual Treeview: http://www.lischke-online.de/VirtualTreeview.html
Unicode Edit and library: http://www.lischke-online.de/Unicode.html


another test please ignore

From: "Mike Lischke" [public@l...]
Date: Wed Mar 21, 2001 8:07 pm
Subject: another test please ignore

have to test UTF8 emails, please ignore...

å¤§å¸ç« å¥

åç¨‹åæ›°ï¼šã€Œå¤§å¸å”æ°ä¹‹éºæ›¸ã€‚è€Œåˆå¸å…¥å¾·ä¹‹é–€ä¹Ÿã€‚æ–¼ä»Šå¯è¦\
‹å¤äººç‚ºå¸æ¬¡ç¬¬è€…ï¼Œç¨è³´æ¤ç¯‡ä¹‹å˜ï¼Œè€Œè«–åŸæ¬¡ä¹‹ã€‚å¸è€…å¿…ç”±æ˜¯è\
€Œå¸ç„‰ï¼Œå‰‡åº¶ä¹Žå…¶ä¸å·®çŸ£ã€‚ã€

ã€Žï¼‘ã€å¤§å¸ä¹‹é“åœ¨æ˜Žæ˜Žå¾·ï¼Œåœ¨è¦ªæ°‘ï¼Œåœ¨æ¢æ–¼è‡³å–„ã€‚

ã€Žï¼’ã€çŸ¥æ¢è€ŒåŽæœ‰å®šï¼›å®šè€ŒåŽèƒ½éœï¼›éœè€ŒåŽèƒ½å®‰ï¼›å®‰è€ŒåŽèƒ½æ…\
®ï¼›æ…®è€ŒåŽèƒ½å¾—ã€‚

ã€Žï¼“ã€ç‰©æœ‰æœ¬æœ«ï¼›äº‹æœ‰çµ‚å§‹ã€‚çŸ¥æ‰€å…ˆå¾Œå‰‡è¿‘é“çŸ£ã€‚

Ciao, Mike

Dipl. Ing. Mike Lischke
Senior software developer
--
Homepage: http://www.lischke-online.de
GraphicEx: http://www.lischke-online.de/Graphics.html
Virtual Treeview: http://www.lischke-online.de/VirtualTreeview.html
Unicode Edit and library: http://www.lischke-online.de/Unicode.html


re: Overlay Images

From: [jimdk@m...]
Date: Wed Mar 21, 2001 8:10 pm
Subject: Re: Overlay Images

--- In [VirtualTreeview@y...], "Mike Lischke" [public@l...] wrote:
> >
> > The ILD_TRANSPARENT seems to do the trick. Maybe this helps for
other
> > Imagelists as well?
>
> I have tried this, but it is not entirely what I want. As I already
said I will use my own MMX
> blending for the images because I need it anyway (and the entire
blend implementation in three
> different flavours costs only ~150 lines of code). Thank you anyway
for the tip.
>
> Ciao, Mike

Mike,

I don't like the way the VCL implements the draw of the imagelist.
Concider this:

This is a direct drop in for the

// 6) draw image if available
if ShowImages
begin
end;

block, line 8586. It fixes Werners overlay problem is is more
efficent since the icon only needs to be drawn once if it contains and
overlay, it does break the animation code because the code does not
check if the index is an overlay or not. Maybe a better way is to add
a property to enable or disable overlays?

Jim Kueneman

BTW Your treeview and my shell code can open a network neighborhood
with 5000+ computers 14% faster than explorer! The VCL Treeview is
67% slower than explorer!

// 6) draw image if available
if ShowImages then
begin
Flag := ILD_NORMAL ;
ImageVOffset := VAlign - FImages.Height div 2;
if vsSelected in Node.States then
Image := DoGetImageIndex(Node, ikSelected, Column)
else
Image := DoGetImageIndex(Node, ikNormal, Column);
OverlayIndex := DoGetImageIndex(Node, ikOverlay, Column);
if Image > -1 then
begin
if CutPending and (vsCutOrCopy in Node.States) then
begin
ForegroundColor := RGB(240, 240, 240);
Flag := ILD_BLEND50;
end;
if OverlayIndex > -1 then
Flag := Flag or INDEXTOOVERLAYMASK(OverlayIndex);
if ((vsDisabled in Node.States) and Enabled) then
begin
FImages.Draw(FOffScreenBitmap.Canvas, TextR.Left,
TextR.Top + ImageVOffset, Image, False);
end else
ImageList_DrawEx(FImages.Handle, Image, Handle, TextR.Left,
TextR.Top + ImageVOffset, 0, 0, CLR_NONE, ForegroundColor,
Flag);
Inc(TextR.Left, FImages.Width + 2);
end;
end;

// determine remaining text rectangle

 | Replies | Author | Date
821 | Re: Overlay Images | [jimdk@m...] | Wed 3/21/2001
823 | Re: Overlay Images | Mike Lischke | Wed 3/21/2001
822 | Re: Overlay Images | Mike Lischke | Wed 3/21/2001
824 | Re: Overlay Images | [jimdk@m...] | Wed 3/21/2001


re: Overlay Images

From: [jimdk@m...]
Date: Wed Mar 21, 2001 8:31 pm
Subject: Re: Overlay Images

--- In [VirtualTreeview@y...], [jimdk@m...] wrote:
>
> block, line 8586. It fixes Werners overlay problem is is more
> efficent since the icon only needs to be drawn once if it contains
rmine remaining text rectangle

Sorry you have to copy the same block to the PaintTo method to make
the drag images work correctly. Around line 9563

Jim Kueneman

 | Replies | Author | Date
823 | Re: Overlay Images | Mike Lischke | Wed 3/21/2001


re: Re: Overlay Images

From: "Mike Lischke" [public@l...]
Date: Wed Mar 21, 2001 9:05 pm
Subject: RE: [VirtualTreeview] Re: Overlay Images

Hi Jim,

> This is a direct drop in for the
>
> // 6) draw image if available
> if ShowImages
> begin
> end;

Thank you for this contribution. I will have a deeper look tomorrow. However I
have already changed
the paint code a lot and you should stay away from changing your source
currently. I have almost
finished the transparent drag image, only some update problems to fix when the
tree window scrolls
under the drag image. Then you all will get a preprelease version 2.3.

> BTW Your treeview and my shell code can open a network neighborhood
> with 5000+ computers 14% faster than explorer! The VCL Treeview is
> 67% slower than explorer!

:-)) What about donating the enumeration code as demo? I think some people
would be very happy to
see how it works. Basically I would like to see a complete shell enumerator.
Just like Brad Stowers
Systemtreeview but with VT. Any volunteers?

Ciao, Mike

 | Replies | Author | Date
824 | Re: Overlay Images | [jimdk@m...] | Wed 3/21/2001


re: Re: Overlay Images

From: "Mike Lischke" [public@l...]
Date: Wed Mar 21, 2001 9:07 pm
Subject: RE: [VirtualTreeview] Re: Overlay Images

> Sorry you have to copy the same block to the PaintTo method to make
> the drag images work correctly. Around line 9563

As I already said, be careful with changes currently. There is no PaintTo
method anymore. Everything
goes only through one method now (PaintTree).

Ciao, Mike


re: Overlay Images

From: [jimdk@m...]
Date: Wed Mar 21, 2001 9:37 pm
Subject: Re: Overlay Images

--- In [VirtualTreeview@y...], "Mike Lischke" [public@l...] wrote:
>
> Thank you for this contribution. I will have a deeper look tomorrow.
However I have already changed

For some reason the compiler did not give me an uninitialized variable
error. Make this change:

if CutPending and (vsCutOrCopy in Node.States) then
begin
ForegroundColor := RGB(240, 240, 240);
Flag := ILD_BLEND50;
end else
ForegroundColor := RGB(0, 0, 0);

It does not make any difference with the way I am drawing the image
since the only time I am using the color is when blending to create
the "ghosted" image but it is good practice to have a known value in a
variable.

Also have you any thoughts on allowing the selection to highlight the
image like the listview does? I am thinking of using the treeview to
implement the listview functionality as will and to make it look the
same it would need to blend the image with the highlight color (which
BTW takes only a small addition to the code I posted and checking if
the node is selected)

Jim

Jim


Descendant drag and drop?

From: [garycramblitt@e...]
Date: Wed Mar 21, 2001 10:40 pm
Subject: Descendant drag and drop?

What is the recommended way for components descended from VT to
handle Drag and Drop? At first I figured I would just override
DoDragDrop and DoDragOver etc., calling the inherited methods and
adding my own logic after the inherited methods return, but some of
the code I see in these methods makes me wonder, for example, the
following code fragment in TBaseVirtualTree.DoDragDrop

finally
if Assigned(FCurrentTargetNode) then
begin
InvalidateNode(FCurrentTargetNode);
FCurrentTargetNode := nil;
end;
end;

means that if my overriding method first calls the inherited method,
the CurrentTargetNode property will be cleared?

Anybody else attempted to do this? What's the general strategy? My
descendent component needs to do the following things:

1. Allowing drop depends on where in the tree the drop is
attempted, and what is dropped.
2. A variety of other formats need to be supported.
3. When something is dropped on the tree, I need to update my own
data structures as well.

TIA

Gary Cramblitt

 | Replies | Author | Date
831 | Re: Descendant drag and drop? | [jimdk@m...] | Thu 3/22/2001
845 | Re: Descendant drag and drop? | Mike Lischke | Sat 3/24/2001
848 | Re: Descendant drag and drop? | Mike Lischke | Sat 3/24/2001


re: Re: Overlay Images

From: Werner Lehmann [wl@b...]
Date: Wed Mar 21, 2001 10:17 pm
Subject: Re: [VirtualTreeview] Re: Overlay Images

[jimdk@m...] wrote:
>
> image like the listview does? I am thinking of using the treeview to
> implement the listview functionality as will and to make it look the

I am using the VTree as listview, too, but unfortunately you can never
mimic the ViewStyles other than vsReport. You know that of course but
I just wanted to point it out.

Werner

 | Replies | Author | Date
827 | Re: Overlay Images | [jimdk@m...] | Wed 3/21/2001


re: Overlay Images

From: [jimdk@m...]
Date: Wed Mar 21, 2001 11:40 pm
Subject: Re: Overlay Images

--- In [VirtualTreeview@y...], Werner Lehmann [wl@b...] wrote:
> [jimdk@m...] wrote:
>
> I am using the VTree as listview, too, but unfortunately you can
never
> mimic the ViewStyles other than vsReport. You know that of course
but

Why can't you mimic list view and small icon view using columns?

Jim


re: Re: Overlay Images

From: Werner Lehmann [wl@b...]
Date: Thu Mar 22, 2001 12:04 am
Subject: Re: [VirtualTreeview] Re: Overlay Images

[jimdk@m...] wrote:
>
> Why can't you mimic list view and small icon view using columns?

I'd really like to see that implementation from you :)

* You need to adjust the number of columns with each window resizing
for vsList and always make sure that all rows fit in the visible
portion

* For vsSmallIcons similar considerations are needed. But you cannot
precisely simulate this listview style (without owner drawing) since
the items may not be strictly organized in columns (but I never use
the style anyway).

* You will have trouble with mouse selection with and without control
keys

* PVirtualNodes do not map to listitems any longer, you need your
own GetText events

* If this is not enough you can start and think about drag and drop

But seriously, the VTree is not designed for these view styles. I'd
love to have vsList but this would require a whole new paint routine.
And the conflict 'tree structure vs flat list' needs to be resolved.

Werner


Drag Notifer

From: [jimdk@m...]
Date: Thu Mar 22, 2001 4:21 am
Subject: Drag Notifer

Mike,

Can I suggest something. In the DoDragging method you assume that
all nodes are draggable and that if they are moved it is ok to delete
them as soon as the OLE drag returns. I can think of situations (like
mine right now) that neither of these assumptions are true.

Can you add an Event in the DoDragging like:

TInitDragNotify = procedure(Sender: TBaseVirtualTree, var AllowDrag:
Boolean; var DeleteNodesOnMove: Boolean);

Then add a

DoInitDragNotify(var AllowDrag: Boolean; var DeleteNodesOnMove:
Boolean); virtual;

method to trigger the event?

That way you can decide if you want to allow a drag and/or Delete the
selected nodes if they are moved on a per node basis.

A simple addition that would add a lot of flexablity. It is impossible
to derive a new component to add this since a lot of what is in the
method is private so the decendant component can't copy the current
implementation.

Thanks,
Jim Kueneman

 | Replies | Author | Date
844 | Re: Drag Notifer | Mike Lischke | Sat 3/24/2001
855 | Re: Drag Notifer | [jimdk@m...] | Sat 3/24/2001
859 | Re: Drag Notifer | Mike Lischke | Sat 3/24/2001


re: shell tree (was: Overlay Images)

From: Bender Heri [HBender@E...]
Date: Thu Mar 22, 2001 8:21 am
Subject: RE: [VirtualTreeview] shell tree (was: Overlay Images)

> :-)) What about donating the enumeration code as demo? I
> think some people would be very happy to
> see how it works. Basically I would like to see a complete
> shell enumerator. Just like Brad Stowers
> Systemtreeview but with VT. Any volunteers?
>
> Ciao, Mike
>
>

I have the needed routines:

procedure GetNetworkList(sl : TStrings);
procedure GetDomainList(const sNetwork : string; sl : TStrings);
procedure GetServerList(const sDomain,sNetwork : string; sl : TStrings); //
Form: '\\<MachineName> (to insert into GetShareList)
procedure GetMachineList(const sDomain,sNetwork : string; sl : TStrings); //
Form: '<MachineName> (to use as machine name list)
procedure GetShareList(const sServer : string; sl : TStrings);

I donated it to JEDI Code Library but until now they are not part of the
released JCL. If somebody is interested I will send the code.

Heri


re: Descendant drag and drop?

From: [jimdk@m...]
Date: Thu Mar 22, 2001 1:14 pm
Subject: Re: Descendant drag and drop?

--- In [VirtualTreeview@y...], [garycramblitt@e...] wrote:
>
> 1. Allowing drop depends on where in the tree the drop is
> attempted, and what is dropped.
> 2. A variety of other formats need to be supported.
> 3. When something is dropped on the tree, I need to update my own
> data structures as well.

I aggree the drag and drop implementation is rather rigid. I just
made a few suggestions as well, like
1) being able to specify if a node is draggable or not, sort of the
other end of your #1.
2) being able to specify if you want the default behavior of deleting
the nodes after a move operation is made.
Your suggestion #2 is straight forward I have implemented it before in
a VCL treeview and listview decendent that supported OLE Drag Drop.

Mike, are you open to suggestions in the code to allow for a more
general way to hook into the Drag and Drop. I am sure it can keep it
currents functonality but with a few virtual methods that allow
changing of the default behavior?

Jim Kueneman


$1 again

From: Werner Lehmann [wl@b...]
Date: Thu Mar 22, 2001 6:10 pm
Subject: $1 again

Mike,

I am experiencing strange things again and I can imagine that it
might be a VTree problem. I am using the VTree here as a listview
(that is only top level nodes are used). The problem occurs if
the tree is to be sorted on its second column. Autosort option
is turned off and this is the header click event :

procedure TMain.ListHeaderClick(Sender: TVTHeader; Column: Integer);
begin
with Sender do
if (SortColumn = Column) then
// Invert sort direction.
SortDirection := TSortDirection(1 - ord(SortDirection));
else begin
// New sort column, start with ascending sorting.
SortDirection := sdAscending;
SortColumn := Column;
end;

with List do
if not (voAutoSort in Options) then
SortTree(Column, Sender.SortDirection, true);
end;

The problem is hard to describe. After the tree has been sorted
on the second column I see only the first node. The rest of the
client area is blank. The scrollbar indicates that there are more
nodes though. If I scroll down I see nodes again only in the last
quarter (vertically, scrollbar range). Between both parts every-
thing is empty.

Ok, the scrollbar is right above the beginning of the visible bottom
part so that still nothing is visible. Then I scroll down one line.
Two or three lines come into view at the bottom border and the first
of these lines is vertical cut in half, only the bottom half of it
is visible. All lines disappear again immediately and (so it seems)
the scrollbar position is reset. I can repeat these steps and get
the same result. If I hold down the scrollbar down arrow I am able
to see more than only two or three lines but the first is still cut
in half and when I release the scrollbar arrow it jumps back again
and the clientarea is blank.

If I hold the scrollbar long enough so that it scrolled far enough
that all lines fill the whole clientarea it will not jump back. If
I scroll one line up again the old (blank) state is restored (as if
I scrolled one page up).

On another occasion I could scroll some lines (20 or so) up until
the position 'snapped' back down and the clientarea became blank.

OnGetText is never fired in the blank space. It seems that only for
these remaining visible nodes OnGetText is fired. If I click on
any of the visible nodes in the bottom part I am getting an AV here:

function TBaseVirtualTree.GetDisplayRect(Node: PVirtualNode;
Column: Integer; TextOnly: Boolean; Unclipped: Boolean = False): TRect;
...
// Here we know the node is visible.
Offset := 0;
if tsUseCache in FStates then
begin
// If we can use the position cache then do a binary search to find a
cached node which is as
close as possible
// to the current node. Iterate then through all following and visible
nodes and sum up their
heights.
Temp := FindInPositionCache(Node, Offset);
while Assigned(Temp) and (Temp <> Node) do
begin
Inc(Offset, Temp.NodeHeight); <----------------------
Temp := GetNextVisibleNoInit(Temp);
end;
end

Offset is 2, but (you guessed it) Temp is $1. I have added a new
local function to VirtualTrees.pas to check this:

function Assigned(const p): boolean;
begin
result := System.assigned(Pointer(p));
assert(Pointer(p) <> Pointer($1), '$1 problem');
end;

I am getting a better error message this way. The AV complained about
an access at $9, probably the position of NodeHeight within TVirtualNode.
If we had a C style preprocessor we could even get the line number where
the problem happened. A callstack as with Java would be nice, too.

I am suspecting that FindInPositionCache et al. is to be blamed here
again (I hope it since you said that you fixed that error, when do we
get this version?).

Regards,
Werner

 | Replies | Author | Date
833 | Re: $1 again | Robert Palmqvist | Thu 3/22/2001
840 | Re: $1 again | Mike Lischke | Sat 3/24/2001
847 | Re: $1 again | Mike Lischke | Sat 3/24/2001
853 | Re: $1 again | Robert Palmqvist | Sat 3/24/2001
864 | Re: $1 again | Robert Palmqvist | Sat 3/24/2001
869 | Re: $1 again | Mike Lischke | Sun 3/25/2001
918 | Re: $1 again | [zh66w6@h...] | Tue 3/27/2001
907 | Re: $1 again | Mike Lischke | Tue 3/27/2001
923 | Re: $1 again | Werner Lehmann | Tue 3/27/2001


re: $1 again

From: "Robert Palmqvist" [robert.palmqvist@h...]
Date: Fri Mar 23, 2001 10:09 pm
Subject: Re: [VirtualTreeview] $1 again

I have the same (or a similar) problem. I first thought it was my code but I
got so frustrated that I left the code (I haven't looked at it for weeks)
and I was just waiting for some one else to indicate if it was a VT related
problem or not...

I also use VT as a ListView, AutoSort is true and below are my OnGetText,
OnCompareNodes and OnHeaderClick procedures (GetText is a private class
method used to extract text from node data):

procedure TForm1.VirtualStringTree1GetText(Sender: TBaseVirtualTree;
Node: PVirtualNode; Column: Integer; TextType: TVSTTextType;
var Text: WideString);
begin
if TextType = ttNormal then
Text:= GetText(Sender, Node, Column);
end;

procedure TForm1.VirtualStringTree1CompareNodes(Sender: TBaseVirtualTree;
Node1, Node2: PVirtualNode; Column: Integer; var Result: Integer);
begin
Result:= CompareText(GetText(Sender, Node1, Column), GetText(Sender,
Node2, Column));
end;

procedure TForm1.VirtualStringTree1HeaderClick(Sender: TVTHeader;
Column: Integer);
begin
with Sender do
begin
if (SortColumn = Column) and (SortDirection = sdAscending) then
SortDirection:= sdDescending
else
SortDirection:= sdAscending;
SortColumn:= Column;
end;
end;

/ Robert

----- Original Message -----
From: "Werner Lehmann" [wl@b...]
To: "VirtualTreeview" <VirtualTreeview@yahoogroups.com>
Sent: Thursday, March 22, 2001 7:10 PM
Subject: [VirtualTreeview] $1 again

> Mike,
>
> I am experiencing strange things again and I can imagine that it
> might be a VTree problem. I am using the VTree here as a listview
> (that is only top level nodes are used). The problem occurs if
> the tree is to be sorted on its second column. Autosort option
> is turned off and this is the header click event :
>
> procedure TMain.ListHeaderClick(Sender: TVTHeader; Column: Integer);
> begin
> with Sender do
> if (SortColumn = Column) then
> // Invert sort direction.
> SortDirection := TSortDirection(1 - ord(SortDirection));
> else begin
> // New sort column, start with ascending sorting.
> SortDirection := sdAscending;
> SortColumn := Column;
> end;
>
> with List do
> if not (voAutoSort in Options) then
> SortTree(Column, Sender.SortDirection, true);
> end;
>
> The problem is hard to describe. After the tree has been sorted
> on the second column I see only the first node. The rest of the
> client area is blank. The scrollbar indicates that there are more
> nodes though. If I scroll down I see nodes again only in the last
> quarter (vertically, scrollbar range). Between both parts every-
> thing is empty.
>
> Ok, the scrollbar is right above the beginning of the visible bottom
> part so that still nothing is visible. Then I scroll down one line.
> Two or three lines come into view at the bottom border and the first
> of these lines is vertical cut in half, only the bottom half of it
> is visible. All lines disappear again immediately and (so it seems)
> the scrollbar position is reset. I can repeat these steps and get
> the same result. If I hold down the scrollbar down arrow I am able
> to see more than only two or three lines but the first is still cut
> in half and when I release the scrollbar arrow it jumps back again
> and the clientarea is blank.
>
> If I hold the scrollbar long enough so that it scrolled far enough
> that all lines fill the whole clientarea it will not jump back. If
> I scroll one line up again the old (blank) state is restored (as if
> I scrolled one page up).
>
> On another occasion I could scroll some lines (20 or so) up until
> the position 'snapped' back down and the clientarea became blank.
>
> OnGetText is never fired in the blank space. It seems that only for
> these remaining visible nodes OnGetText is fired. If I click on
> any of the visible nodes in the bottom part I am getting an AV here:
>
>
> function TBaseVirtualTree.GetDisplayRect(Node: PVirtualNode;
> Column: Integer; TextOnly: Boolean; Unclipped: Boolean = False): TRect;
> ...
> // Here we know the node is visible.
> Offset := 0;
> if tsUseCache in FStates then
> begin
> // If we can use the position cache then do a binary search to find a
cached node which is as
> close as possible
> // to the current node. Iterate then through all following and visible
nodes and sum up their
> heights.
> Temp := FindInPositionCache(Node, Offset);
> while Assigned(Temp) and (Temp <> Node) do
> begin
> Inc(Offset, Temp.NodeHeight); <----------------------
> Temp := GetNextVisibleNoInit(Temp);
> end;
> end
>
> Offset is 2, but (you guessed it) Temp is $1. I have added a new
> local function to VirtualTrees.pas to check this:
>
> function Assigned(const p): boolean;
> begin
> result := System.assigned(Pointer(p));
> assert(Pointer(p) <> Pointer($1), '$1 problem');
> end;
>
> I am getting a better error message this way. The AV complained about
> an access at $9, probably the position of NodeHeight within TVirtualNode.
> If we had a C style preprocessor we could even get the line number where
> the problem happened. A callstack as with Java would be nice, too.
>
> I am suspecting that FindInPositionCache et al. is to be blamed here
> again (I hope it since you said that you fixed that error, when do we
> get this version?).
>
> Regards,
> Werner
>
>
>
>
> To unsubscribe from this group, send an email to:
> VirtualTreeview-unsubscribe@egroups.com
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>
>


New file uploaded to VirtualTreeview

From: [VirtualTreeview@yahoogroups.com>
Date: Fri Mar 23, 2001 6:30 am
Subject: New file uploaded to VirtualTreeview

Hello,

This email message is a notification to let you know that
a file has been uploaded to the Files area of the VirtualTreeview
group.

File : /ExplorerTreeviewDemo.zip
Uploaded by : [jimdk@m...]
Description : Explorer Style Treeview using the Shell and VirtualTree

You can access this file at the URL

http://groups.yahoo.com/group/VirtualTreeview/files/ExplorerTreeviewDemo.zip

To learn more about file sharing for your group, please visit

http://help.yahoo.com/help/us/groups/files

Regards,

jimdk@m...]


VirtualTree Explorer Treeview using Shell Enumeration

From: [jimdk@m...]
Date: Fri Mar 23, 2001 6:35 am
Subject: VirtualTree Explorer Treeview using Shell Enumeration

Per Mike's request I pulled some of my sacred shell code out of a
project and made a demo of an Explorer style treeview. It appears to
drag and drop but it does not. In order to do it right VT need
some more hooks put in to handle PIDL clipboard objects along with
more hooks in the OLE drag and drop code i.e. it needs to handle
allowing or not allowing a drag start or drag drop on a namespace
object if it does not support the action.

Enjoy.

Jim Kueneman

 | Replies | Author | Date
851 | Re: VirtualTree Explorer Treeview using Shell Enu | Mike Lischke | Sat 3/24/2001
856 | Re: VirtualTree Explorer Treeview using Shell Enu | [jimdk@m...] | Sat 3/24/2001
862 | Re: VirtualTree Explorer --Time to bitch and requ | [adembaba@e...] | Sat 3/24/2001
863 | Re: VirtualTree Explorer --Time to bitch and requ | [jimdk@m...] | Sat 3/24/2001
866 | Re: VirtualTree Explorer --Time to bitch and requ | [jimdk@m...] | Sat 3/24/2001
871 | Re: VirtualTree Explorer --Time to bitch and requ | Mike Lischke | Sun 3/25/2001
875 | Re: VirtualTree Explorer --Time to bitch and requ | [adembaba@e...] | Sun 3/25/2001
876 | Re: VirtualTree Explorer --Time to bitch and requ | [jimdk@m...] | Sun 3/25/2001


re: VirtualTree Explorer Treeview using Shell E numeration

From: Bender Heri [HBender@E...]
Date: Fri Mar 23, 2001 12:33 pm
Subject: RE: [VirtualTreeview] VirtualTree Explorer Treeview using Shell E numeration

Hi Jim

I downloaded your zip and tried to compile. But the following units cannot
be found:

SystemImageList.pas
AdvVirtualStringTree.pas

Where can I find them?

Heri

> -----Original Message-----
> From: [jimdk@m...] [mailto:[jimdk@m...]]
> Sent: Friday, March 23, 2001 7:36 AM
> To: [VirtualTreeview@yahoogroups.com
> Subject: [VirtualTreeview] VirtualTree Explorer Treeview using Shell
> Enumeration
>
>
> Per Mike's request I pulled some of my sacred shell code out of a
> project and made a demo of an Explorer style treeview. It appears to
> drag and drop but it does not. In order to do it right VT need
> some more hooks put in to handle PIDL clipboard objects along with
> more hooks in the OLE drag and drop code i.e. it needs to handle
> allowing or not allowing a drag start or drag drop on a namespace
> object if it does not support the action.
>
> Enjoy.
>
> Jim Kueneman
>

Replies Author Date


FullExpand

From: Tony Cardalda [software@z...]
Date: Fri Mar 23, 2001 2:39 pm
Subject: FullExpand

I found a little bug in the

procedure TBaseVirtualTree.FullExpand(Node: PVirtualNode = nil);

at line 15158 (version 2.2 2-mar);

//////////////////////////////////////

begin
BeginUpdate;
Include(FStates, tsExpanding);
try
if Node = nil then
begin
Node := FRoot.FirstChild;
Stop := nil;
end
else
Stop := Node.NextSibling;

repeat
with Node^ do

////////////////////////////////

when performing an FullExpand on a empty VST then Node becomes
FRoot.FirstChild; which is also nil. Inside the repeat loop, accessing
Node^ results in a AV.

 | Replies | Author | Date
849 | Re: FullExpand | Mike Lischke | Sat 3/24/2001
1006 | FullExpand | Vadim Sedulin | Mon 4/2/2001
1023 | Re: FullExpand | Mike Lischke | Tue 4/3/2001
1032 | Re: FullExpand | Vadim Sedulin | Tue 4/3/2001
1046 | Re: FullExpand | Mike Lischke | Wed 4/4/2001


re: VirtualTree Explorer Treeview using Shell E numeration

From: [jimdk@m...]
Date: Fri Mar 23, 2001 2:57 pm
Subject: Re: VirtualTree Explorer Treeview using Shell E numeration

--- In [VirtualTreeview@y...], Bender Heri [HBender@E...] wrote:
> Hi Jim
>
> I downloaded your zip and tried to compile. But the following units
cannot
> be found:
>
> SystemImageList.pas
> AdvVirtualStringTree.pas
>
> Where can I find them?
>
> Heri

Sorry just delete them. A copy and paste danger. I copied the
uses info from the main project file to the ShellUtilities.pas and
never edited out these units in the ShellUtilities.pas. One is Brad
Stowers Imagelist which is not needed now, the other was an experiment
that I doing. I uploaded a new version without these units included.

Jim Kuenenan


Explorer Tree Demo

From: [jimdk@m...]
Date: Fri Mar 23, 2001 4:40 pm
Subject: Explorer Tree Demo

My first demo zip included a modified version of virtualtrees.pas that
fixed the image overlay problem. I did that early this morning
(4:30am) and now that my head is more clear I realized I really should
not have done that. So I removed that from the zip file. That means
that the images for any shared (the hand) and shortcuts (little arrow)
will be wrong. Hopefully the next revision of Virtual Treeview will
take care of the problem.

Jim Kueneman

 | Replies | Author | Date
850 | Re: Explorer Tree Demo | Mike Lischke | Sat 3/24/2001


re: $1 again

From: "Mike Lischke" [public@l...]
Date: Sat Mar 24, 2001 3:40 pm
Subject: RE: [VirtualTreeview] $1 again

Hi Werner,

> I am experiencing strange things again and I can imagine that it
> might be a VTree problem.
> I am suspecting that FindInPositionCache et al. is to be blamed here
> again (I hope it since you said that you fixed that error, when do we
> get this version?).

Sorry for that long delay but I wanted at least to finish the stuff I have
worked the last week. This took longer than I expected but now I'm back and
ready to answer all questions (not necessarily in the order they appeared in
the mailing list because I have forwarded them from my office to my home
account and Outlook 2000 does not restore the received date and sorts therefore
wrong).

I will soon upload the newest tree version (2.3) which fixes this problem. It
is indeed again related to the forgotten parts in the cache filling method.

Ciao, Mike


re: MultiSelect OLE Drag Drop

From: "Mike Lischke" [public@l...]
Date: Sat Mar 24, 2001 3:40 pm
Subject: RE: [VirtualTreeview] MultiSelect OLE Drag Drop

Hi Jim,

> The selected items are in the drag image but also any subnodes
> of the top level node that is being dragged. I sort of understand the
> logic behind this since those nodes will be moved along with their
> parent(s) but it "feels" like it is doing something wrong since the
> nodes are not selected. Is there someway to make the drag image only
> be made up of the selected nodes?

Although you already got an answer let me confirm this. Yes, the drag image
reflects which nodes are concerned and this does not only include selected
nodes but also their child nodes. Apart from the fact that I don't like to
change the paint method again (after having it completely redesigned four
times) taking out the unselected nodes from the drag image would wrongly
reflect the situation. I know it is a bit difficult to get used to it, but
there was no example before how the drag image should look like and I think the
way how it is is the best one can get.

Ciao, Mike


re: Deriving from VirtualStringTree

From: "Mike Lischke" [public@l...]
Date: Sat Mar 24, 2001 3:40 pm
Subject: RE: [VirtualTreeview] Deriving from VirtualStringTree

> If one wanted to create a new component derived from
> VirtualStringTree that, say looks like Explorer's treeview, and I want
> all its functionality encapsulated within the class where is the best
> place to hook into the Virtual Treeview. I have not spent a lot of
> time looking over the 22,000 lines of code but it does appear it has a
> lot of DoXXXX methods. Is this the best place?

Absolutely correct. All those DoXXX methods have only one reason for their
existance: to be overriden by descentants if needed to modify VT's behaviour.
But don't forget to call the inherited methods because they often call an event
or execute some related code (or both). By deriving from a TCustomXXX tree and
not publishing the events you can hide them from the application.

Ciao, Mie


re: Re: MultiSelect OLE Drag Drop

From: "Mike Lischke" [public@l...]
Date: Sat Mar 24, 2001 3:40 pm
Subject: RE: [VirtualTreeview] Re: MultiSelect OLE Drag Drop

> Maybe another reason it
> confused me way if only 1/2 a node is visible at the bottom the drag
> image includes only this half and it looks strange.

You should download the latest version (2.3) which I will upload in a couple of
minutes. The drag image is now blended and fades to the image borders. I
believe you will like it.

To all: the code for blending uses MMX instructions and depends therefore on an
MMX capable CPU. I have included check code to disable blending if the CPU is
not MMX capable but I would like to have this tested on more than one machine.
In my company I have only found one old Pentium computer which does not support
MMX. Suprisingly I found that the AMD K6 also has MMX support where I thought
it would not.

Btw: the blending code is totally independing of Virtual Treeview, so if you
want to use it for other projects/libraries as well then go ahead and take it.
Keep in mind, thought, that the code works only for 32 bit bitmaps (that is,
RGBA).

Ciao, Mike

 | Replies | Author | Date
865 | Re: MultiSelect OLE Drag Drop | [jimdk@m...] | Sat 3/24/2001
870 | Re: MultiSelect OLE Drag Drop | Mike Lischke | Sun 3/25/2001
877 | Image painting (was: MultiSelect OLE Drag Drop) | Mike Lischke | Sun 3/25/2001
879 | Re: Image painting (was: MultiSelect OLE Drag Dro | [jimdk@m...] | Sun 3/25/2001


re: Drag Notifer

From: "Mike Lischke" [public@l...]
Date: Sat Mar 24, 2001 3:40 pm
Subject: RE: [VirtualTreeview] Drag Notifer

> Can I suggest something. In the DoDragging method you assume that
> all nodes are draggable and that if they are moved it is ok to delete
> them as soon as the OLE drag returns. I can think of situations (like
> mine right now) that neither of these assumptions are true.

As soon as DoDragging is called the decisions about drag start is already made.
If you selectively want to start dragging then set the drag mode of the tree to
dmManual and implement a handler for OnDragAllowed. When doing a move which
required implicitely a copy (because the target was another tree) then it is ok
to delete the old nodes, wouldn't you think? Otherwise you would use a copy not
a move. The action to do when dropping can be determined in OnDragOver.

> That way you can decide if you want to allow a drag and/or Delete the
> selected nodes if they are moved on a per node basis.

Do you want to mix move and copy in one drag operation? If yes then I think
this is a bad idea. You cannot visualize this behaviour properly and the user
will get into serious trouble as (s)he cannot see what's going on.

Ciao, Mike

 | Replies | Author | Date
855 | Re: Drag Notifer | [jimdk@m...] | Sat 3/24/2001
859 | Re: Drag Notifer | Mike Lischke | Sat 3/24/2001


re: Descendant drag and drop?

From: "Mike Lischke" [public@l...]
Date: Sat Mar 24, 2001 3:40 pm
Subject: RE: [VirtualTreeview] Descendant drag and drop?

> What is the recommended way for components descended from VT to
> handle Drag and Drop?

I think Tree.DoDragDrop is indeed the best place for your descentant. In the
original code does not happen very much because most of the work is done in
ProcessDrop and ProcessOLEData. If you want to happen only a part of the stuff
of the original code (e.g. no event) then override the method, copy out what
you need (it will only be a couple of lines) and add your own handling. Don't
call the inherited method and you should be ready.

> Anybody else attempted to do this? What's the general strategy? My
> descendent component needs to do the following things:
>
> 1. Allowing drop depends on where in the tree the drop is
> attempted, and what is dropped.

Here you need to override DoDragOver. Let the inherited handler do whatever is
necessary and act on return. You will not be able to skip calling the
FOnDragOver event, but I don't see any reason why you should want this at all.

> 2. A variety of other formats need to be supported.

Depends of whether the formats shall be supplied by the tree or "only" accepted
by it. Accepting is simply done in DoDragDrop. Enumerate the available
clipboard formats as shown in the original DoDragDrop code and pick the one you
want to support.

For supplying additional formats you have to add them as available formats to
the internal FFormatEtcList of the drag manager and you have to extent the
RenderData method to write the new format into a storage medium.

> 3. When something is dropped on the tree, I need to update my own
> data structures as well.

This can again be done either be an event (if it is the application which needs
the upate) or as part of the DoDragDrop method.

Ciao, Mike


re: Re: Overlay Images

From: "Mike Lischke" [public@l...]
Date: Sat Mar 24, 2001 3:40 pm
Subject: RE: [VirtualTreeview] Re: Overlay Images

> It does not make any difference with the way I am drawing the image
> since the only time I am using the color is when blending to create
> the "ghosted" image but it is good practice to have a known value in a
> variable.

Yes, I also found out that the image looks much nicer when there is a certain
color to use in blending (the forground color). But still, it is not what I am
looking for. As I already said, I will use the blend stuff I have implemented
to make smooth images. This way I can exactly control the outcome. The only
drawback is that this solution is slower because of the paint redirection and
the alpha blending.

> Also have you any thoughts on allowing the selection to highlight the
> image like the listview does?

This is a great idea! I will implement this too when I get to the images.

Ciao, Mike


re: $1 again

From: "Mike Lischke" [public@l...]
Date: Sat Mar 24, 2001 3:40 pm
Subject: RE: [VirtualTreeview] $1 again

Hi Robert,

> I have the same (or a similar) problem. I first thought it was my code but I
> got so frustrated that I left the code (I haven't looked at it for weeks)
> and I was just waiting for some one else to indicate if it was a VT related
> problem or not...

This sad to hear. Sorry for that trouble. Hopefully the new code does not
dissatisfy you again...

Ciao, Mike


re: Re: Descendant drag and drop?

From: "Mike Lischke" [public@l...]
Date: Sat Mar 24, 2001 3:40 pm
Subject: RE: [VirtualTreeview] Re: Descendant drag and drop?

> Mike, are you open to suggestions in the code to allow for a more
> general way to hook into the Drag and Drop. I am sure it can keep it
> currents functonality but with a few virtual methods that allow
> changing of the default behavior?

Yes, of course. If you can convince me that a change is useful for more than
two people, cannot be implemented by using existent code and does not break
the existing behaviour (unless it fixes a bug of course) then I will be happy
to include it. Note, however, I'm very sensible to changes in the interface of
the control, in particular everything which can be saved to a stream (DFM or
application stream).

Ciao, Mike


re: FullExpand

From: "Mike Lischke" [public@l...]
Date: Sat Mar 24, 2001 3:40 pm
Subject: RE: [VirtualTreeview] FullExpand

Hi Tony,

> when performing an FullExpand on a empty VST then Node becomes
> FRoot.FirstChild; which is also nil. Inside the repeat loop, accessing
> Node^ results in a AV.

Thank you for this report. I have fixed this problem.

Ciao, Mike


re: Explorer Tree Demo

From: "Mike Lischke" [public@l...]
Date: Sat Mar 24, 2001 3:41 pm
Subject: RE: [VirtualTreeview] Explorer Tree Demo

> My first demo zip included a modified version of virtualtrees.pas that
> fixed the image overlay problem. I did that early this morning
> (4:30am) and now that my head is more clear I realized I really should
> not have done that. So I removed that from the zip file. That means
> that the images for any shared (the hand) and shortcuts (little arrow)
> will be wrong. Hopefully the next revision of Virtual Treeview will
> take care of the problem.

I had to make some adjustments to compile your demo with the current version of
VT and I also
changed the image indices of link and share overlay. Both work fine now.

Ciao, Mike


re: VirtualTree Explorer Treeview using Shell Enumeration

From: "Mike Lischke" [public@l...]
Date: Sat Mar 24, 2001 3:40 pm
Subject: RE: [VirtualTreeview] VirtualTree Explorer Treeview using Shell Enumeration

> Per Mike's request I pulled some of my sacred shell code out of a
> project and made a demo of an Explorer style treeview. It appears to
> drag and drop but it does not. In order to do it right VT need
> some more hooks put in to handle PIDL clipboard objects along with
> more hooks in the OLE drag and drop code i.e. it needs to handle
> allowing or not allowing a drag start or drag drop on a namespace
> object if it does not support the action.

This code is excellent, Jim. Not such a mess like Brad Stower's system
treeview. I am happy to include it as demo into the next distribution of VT.
Perhaps we can even make it a real component, then we had already two extremely
descentants of VT. Thank you very much.

Ciao, Mike

 | Replies | Author | Date
856 | Re: VirtualTree Explorer Treeview using Shell Enu | [jimdk@m...] | Sat 3/24/2001
862 | Re: VirtualTree Explorer --Time to bitch and requ | [adembaba@e...] | Sat 3/24/2001
863 | Re: VirtualTree Explorer --Time to bitch and requ | [jimdk@m...] | Sat 3/24/2001
866 | Re: VirtualTree Explorer --Time to bitch and requ | [jimdk@m...] | Sat 3/24/2001
871 | Re: VirtualTree Explorer --Time to bitch and requ | Mike Lischke | Sun 3/25/2001
875 | Re: VirtualTree Explorer --Time to bitch and requ | [adembaba@e...] | Sun 3/25/2001
876 | Re: VirtualTree Explorer --Time to bitch and requ | [jimdk@m...] | Sun 3/25/2001


re: Re: ?Serialization of user data.

From: "Mike Lischke" [public@l...]
Date: Sat Mar 24, 2001 3:47 pm
Subject: RE: [VirtualTreeview] Re: ?Serialization of user data.

Hi Gary,

> > So if I understand what you are suggesting, I will convert all Move
> operations into a Copy and Delete by hooking the OnNodeMoving event. In that
event handler,
> I will set Allowed to False, then call CopyTo with the Source and Target
nodes, and
> finally call DeleteNode on the Source node. Right?? If that is right, then
I think my
> problem is solved. Thank you VERY MUCH!

Why do you use MoveTo at all? Just call CopyTo and delete the previously
selected nodes. Keep in mind however, that also the selected style of a node is
copied so after CopyTo you have twice as much selected nodes as before. To
delete the right nodes I recommend that you retrieve a list of all selected
nodes in advance and use this list after CopyTo to delete the unnecessary
nodes. Use GetSortedSelection with set resolve flag. This will remove all nodes
from the returned list which have a parent node which is also selected. This
works well because when a node is deleted then all its child nodes are deleted
as well.

> An important corollary to this assumption is that each piece of data
> associated with a node of the tree "stands alone", independent of its
position in the tree.
> Hence your statement that "It is questionable however, whether a node's data
> interpretation should depend on its parent node."

I understand your concerns and think our both understandings are not so
different as it might seem. Actually, you want to interpret a node's data
depending on its place in the hierarchy and this is a valid wish. My idea
however is that this dependency should be determined once: when the node is
placed. Then it should keep this information in its data so you can work with
the node without having to touch one or more other nodes only to know *how* you
can work with a certain node's data. Every time the structure of the tree is
changed this information must of course be updated, but this is only a one time
shoot instead of frequently determining the dependencies every time the node is
accessed. This will not only simplify streaming a node, but will likely improve
the tree's overall performance.

> In my case, this is definitely not the case. Nor do I think I am alone. In
the XML
> world, with its Document Object Model (DOM), the position a node has
> within the DOM has semantic meaning. The DOM is definitely a tree structure,
and the meaning
> of a node can change drastically if the node is moved within the tree.

I agree totally with you, but as long as the node stays where it is it's
meaning does not change. Hence you can keep this meaning in the node's data
rather than examining the tree structure over and over again.

> I am using the Microsoft XML Parser, which of course implements a DOM. As
> a practical programming problem, the Ms DOM does not offer any sort of
persistent ID
> or pointer to nodes. One can only locate a node in the DOM via its position
within the
> tree, i.e, one must "walk" the tree. I certainly wish this were otherwise,
but there it
> is. For whatever reason, Microsoft has chosen not to offer that capability.
(It
> is true that one can associate an ID attribute with nodes and that one can
locate a node by
> ID very quickly, but the problem is that the ORIGINAL XML document must have
these
> IDs, and that is not a practical alternative in my case.)

Mmmh, my knowledge about XML is very limited so I can only give some general
advice. Would it be possible to build the IDs when parsing the DOM? I mean when
you attach a tree to the DOM and create the nodes then you can also apply a
temporary ID scheme which has then not to be in the original document.

> So you can see that I very much need to know both the Source AND the Target
nodes in any
> copy or move operation, and that furthermore, the Source and Target nodes
need to be
> connected to the VT when they are passed in the OnMoving/Copying events,
since their
> position in the VT is the only mechanism I have for locating the
corresponding nodes in the DOM.

You should not forget here that your application is the initiator of the copy
action. That means you know actually in advance the target node because you
have to pass it to the CopyTo method. Additionally, the parent of the newly
created node is always the target node, so it would be redundant to pass it
along. Nonetheless I have included a NewParent parameter in OnNodeCopying as it
is also in OnNodeMoving, but keep in mind that in opposition to node moves the
new node is already connected to the target when OnNodeCopying is called. The
reason for this is that the tree has to create the node first before it can
call OnNodeCopying (the source node might be located in another tree or even in
another application so there might be no access to the original source node).

> As to the "depth-first" serialization of user node data. Frankly, I'm
> surprised at your position on this. Had VT serialized its own nodes
"depth-first", I doubt
> you could get the serialization to work at all! Surely you are not
suggesting that VT
> would never be used to present data that is itself organized in a tree
structure????

I understand the words but I don't understand its sense. How would you call the
serialization scheme if not depth-first? In fact a node is saved by storing a
header, a child and a user data chunk. The child chunk contains the child nodes
one after another which again are saved by writing a header, a child and a user
data chunk. So if you tranverse the stream from start to end you will find the
data of a node, then the data of its first child, then the data of the first
child of the first child and so on. If there is no child node anymore then the
user data of the deepest level is loaded then the user data of the parent of
this node then the user data of the parent of the parent etc. This is
depth-first in my understanding. Do I see something wrong here?

Ciao, Mike


re: $1 again

From: "Robert Palmqvist" [robert.palmqvist@h...]
Date: Sun Mar 25, 2001 4:17 pm
Subject: Re: [VirtualTreeview] $1 again

Hey Mike, no problem! It's a free time, freeware project so I just put it on
hold. I will continue as soon as your new code is released, no idea to work
with a project when it is just upsetting you ;)

Keep up the good work! / Robert

----- Original Message -----
From: "Mike Lischke" [public@l...]
To: <VirtualTreeview@yahoogroups.com>
Sent: Saturday, March 24, 2001 5:40 PM
Subject: RE: [VirtualTreeview] $1 again

> Hi Robert,
>
> > I have the same (or a similar) problem. I first thought it was my code
but I
> > got so frustrated that I left the code (I haven't looked at it for
weeks)
> > and I was just waiting for some one else to indicate if it was a VT
related
> > problem or not...
>
> This sad to hear. Sorry for that trouble. Hopefully the new code does not
dissatisfy you again...
>
> Ciao, Mike
>
>
>
> To unsubscribe from this group, send an email to:
> VirtualTreeview-unsubscribe@egroups.com
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>
>


New file uploaded to VirtualTreeview

From: [VirtualTreeview@yahoogroups.com>
Date: Sat Mar 24, 2001 4:37 pm
Subject: New file uploaded to VirtualTreeview

Hello,

This email message is a notification to let you know that
a file has been uploaded to the Files area of the VirtualTreeview
group.

File : /VirtualTreeview.zip
Uploaded by : [public@l...]
Description : Version 2.3 beta

You can access this file at the URL

http://groups.yahoo.com/group/VirtualTreeview/files/VirtualTreeview.zip

To learn more about file sharing for your group, please visit

http://help.yahoo.com/help/us/groups/files

Regards,

public@l...]


re: Drag Notifer

From: [jimdk@m...]
Date: Sat Mar 24, 2001 5:20 pm
Subject: Re: Drag Notifer

--- In [VirtualTreeview@y...], "Mike Lischke" [public@l...] wrote:

>
> Do you want to mix move and copy in one drag operation? If yes then
I think this is a bad idea. You cannot visualize this behaviour
properly and the user will get into serious trouble as (s)he cannot
see what's going on.

Mike,

The problem is with OLE and the shell. If I drag a file out of my
Explorer tree view and want to move it. The request is passed to the
Shell to handle the move. I have lost all control of the move. The
DoDragDrop returns right after the drop and I delete the node, per
your code. Now the shell pops a dialog "Are you sure you want to move
this file to the recycle bin?" The user says "oops no I do not" and
cancels the move. Now my treeview is all screwed up. I need to wait
for the shell to tell me "Ok the user accepted the move/copy/shortcut
so go ahead and make the changes".

Jim Kueneman

 | Replies | Author | Date
859 | Re: Drag Notifer | Mike Lischke | Sat 3/24/2001


re: VirtualTree Explorer Treeview using Shell Enumeration

From: [jimdk@m...]
Date: Sat Mar 24, 2001 5:30 pm
Subject: Re: VirtualTree Explorer Treeview using Shell Enumeration

--- In [VirtualTreeview@y...], "Mike Lischke" [public@l...] wrote:

> This code is excellent, Jim. Not such a mess like Brad Stower's
system treeview. I am happy to include it as demo into the next

Thanks,

That was what I thought as I looked through VT. I thought I was
looking at something I wrote. Our styles strikingly similar.

Jim Kueneman


Setting Icons without ImageList

From: [adembaba@e...]
Date: Sat Mar 24, 2001 5:44 pm
Subject: Setting Icons without ImageList

Hi,

I am trying to use icons from a DB, and not storing
them in ImageList. This presents a problem since VT
is used to using icons from ImageList.

Is there an event that I can use to set an icon for a node,

Cheers,

 | Replies | Author | Date
860 | Re: Setting Icons without ImageList | Mike Lischke | Sat 3/24/2001


Migration to VT 2.3

From: [jimdk@m...]
Date: Sat Mar 24, 2001 6:01 pm
Subject: Migration to VT 2.3

Mike,

This has been painful!

So far:

1) Stream error DropMarkColor Property Does not Exist. Had to delete
VT component from form.

2) What happened to Sort? It broke my treeview! The parameters
changed with no callback! I have not had time to figure it out since
I can't get it to compile due to #4.

3) Compiler Hint: Package does not use or export
VirtualTrees.GetRGBColor

4)In ColnEdit.pas it contains ToolWnds.pas which I (or D5) can't find.
Can anyone tell me where it is.

Jim Kueneman

 | Replies | Author | Date
861 | Re: Migration to VT 2.3 | Mike Lischke | Sat 3/24/2001


re: Re: Drag Notifer

From: "Mike Lischke" [public@l...]
Date: Sat Mar 24, 2001 6:11 pm
Subject: RE: [VirtualTreeview] Re: Drag Notifer

> The problem is with OLE and the shell. If I drag a file out of my
> Explorer tree view and want to move it. The request is passed to the
> Shell to handle the move. I have lost all control of the move. The
> DoDragDrop returns right after the drop and I delete the node, per
> your code. Now the shell pops a dialog "Are you sure you want to move
> this file to the recycle bin?" The user says "oops no I do not" and
> cancels the move. Now my treeview is all screwed up. I need to wait
> for the shell to tell me "Ok the user accepted the move/copy/shortcut
> so go ahead and make the changes".

Aside the fact that the ActiveX.DoDragging call should only return when the
operation is finished
(at least it does so with every other OLE dd operation) there is some special
handling to consider.
Straight out of MSDN:

CFSTR_PERFORMEDDROPEFFECT
This format identifier is used by the target to inform the data object through
its
IDataObject::SetData method of the outcome of a data transfer. The data is an
STGMEDIUM structure
that contains a global memory object. The structure's hGlobal member points to
a DWORD set to the
appropriate DROPEFFECT value, normally DROPEFFECT_MOVE or DROPEFFECT_COPY.

This format is normally used when the outcome of an operation can be either
move or copy, such as in
an optimized move or delete-on-paste operation. It provides a reliable way for
the target to tell
the data object what actually happened. It was introduced because the value of
pdwEffect returned by
DoDragDrop did not reliably indicate which operation had taken place. The
CFSTR_PERFORMEDDROPEFFECT
format is the reliable way to indicate that an unoptimized move has taken place.
----- end quote

Mmh, I read this part at least ten times in the past 12 months but only now I
detect one weak point
in VT related to this. VT relies on the returned drop effect parameter and this
works quite well.
But when interacting with the shell it might, according to this paragraph, be
possible that the
value is not reliable and one needs to check CF_PERFORMEDDROPEFFECT. I will
think about this in the
coming days and find a way to implement it into VT if necessary. Could you
please check meanwhile
whether there is really a IDataObject.SetData call when performing an operation
involving the shell?

Ciao, Mike


re: Setting Icons without ImageList

From: "Mike Lischke" [public@l...]
Date: Sat Mar 24, 2001 6:14 pm
Subject: RE: [VirtualTreeview] Setting Icons without ImageList

Hi Adem,

> I am trying to use icons from a DB, and not storing
> them in ImageList. This presents a problem since VT
> is used to using icons from ImageList.

I recommend that you don't use the image list feature of VT in this case but
draw the image
yourself. You can always paint the image plus any text in OnBeforeItemPaint (if
you want to use a
string tree) or OnDrawNode (for a draw tree). For the latter there is a demo in
the distribution
(the draw tree stuff).

Ciao, Mike


re: Migration to VT 2.3

From: "Mike Lischke" [public@l...]
Date: Sat Mar 24, 2001 6:23 pm
Subject: RE: [VirtualTreeview] Migration to VT 2.3

Jim,

> This has been painful!

sorry, but this was necessary. Actually, you will find only very few interface
changes (as I do such
changes extremely careful).

> 1) Stream error DropMarkColor Property Does not Exist. Had to delete
> VT component from form.

This went into the Tree.Colors property which collects now most of colors used
in the tree (the
TWinControl.Color property is however still there).

> 2) What happened to Sort? It broke my treeview! The parameters
> changed with no callback! I have not had time to figure it out since
> I can't get it to compile due to #4.

The callback function has been taken out and implemented as normal event
because of the auto sort
feature of the tree. You have to use OnCompareNodes now, which gets called when
you call Sort and
when auto sort is enabled and you either change the sort column or the sort
direction (e.g. in the
OnHeaderClick event).

> 3) Compiler Hint: Package does not use or export
> VirtualTrees.GetRGBColor

Yep, this is normally used when painting the images and will likely be removed.
But I have not come
to this yet.

> 4)In ColnEdit.pas it contains ToolWnds.pas which I (or D5) can't find.
> Can anyone tell me where it is.

Please use the provided package for installing or use at least the same
requires clause. There is
now a registration unit for VT which also contains a little component editor.
This editor launches
the column editor when double clicking the tree in the IDE.

Ciao, Mike


re: VirtualTree Explorer --Time to bitch and request :-)

From: [adembaba@e...]
Date: Sat Mar 24, 2001 7:22 pm
Subject: Re: VirtualTree Explorer --Time to bitch and request :-)

Hi,

Yes, the code is excellent. But, that does not stop
me bitching about this or the other :-)

Here is one: Behavior of folder icons are the wrong
way; they look 'open' until you select them --when they
look 'closed'.. There is something in the code somewhere
but I could not find it. (I am using VT 2.3)

Secondly, OK now we can emulate left pane of Explorer;
but could someone (the author, please) alter it so that
it combines both the left and right hand panes of Explorer
(i.e. when it is in Details view).

I was going to ask for a fresh cup of coffee too, but I am
running of space here ;-)

Cheers,

 | Replies | Author | Date
863 | Re: VirtualTree Explorer --Time to bitch and requ | [jimdk@m...] | Sat 3/24/2001
866 | Re: VirtualTree Explorer --Time to bitch and requ | [jimdk@m...] | Sat 3/24/2001
871 | Re: VirtualTree Explorer --Time to bitch and requ | Mike Lischke | Sun 3/25/2001
875 | Re: VirtualTree Explorer --Time to bitch and requ | [adembaba@e...] | Sun 3/25/2001
876 | Re: VirtualTree Explorer --Time to bitch and requ | [jimdk@m...] | Sun 3/25/2001


re: VirtualTree Explorer --Time to bitch and request :-)

From: [jimdk@m...]
Date: Sat Mar 24, 2001 9:53 pm
Subject: Re: VirtualTree Explorer --Time to bitch and request :-)

--- In [VirtualTreeview@y...], [adembaba@e...] wrote:
>
> Hi,
>
> Yes, the code is excellent. But, that does not stop
> me bitching about this or the other :-)
>
> Here is one: Behavior of folder icons are the wrong
> way; they look 'open' until you select them --when they
> look 'closed'.. There is something in the code somewhere
> but I could not find it. (I am using VT 2.3)

It appears Mike messed up somewhere. All the nodes seem to
read selected when they are not and not selected when they really are.
The Paint code looks ok so it must be happening as the default state
of a Node or it is getting changed somewhere before the
OnGetImageIndex is called.

>
> Secondly, OK now we can emulate left pane of Explorer;
> but could someone (the author, please) alter it so that
> it combines both the left and right hand panes of Explorer
> (i.e. when it is in Details view).

Do you know how long it took me to understand the Shell and how many
times I rewrote the TNamespace class (this is only a small portion of
it the "real" version implements almost every aspect of a Namespace I
could think of) to be as small and a fast as it is? And now you want
me write an Explorer replacement too? <g> Ok I'll see what I can do.
Lets see it may take... 3-4 minutes of changes to do what you want if
I understand what you want. Look at the VirtualExplorerTreeExpanding
event. Find

Data.Namespace.EnumerateFolder(True, False, False,
EnumerateFolderCallback,
Node);

and change it to
Data.Namespace.EnumerateFolder(True, True, False,
EnumerateFolderCallback,
Node);

and see what happens. Now change it to

Data.Namespace.EnumerateFolder(False, True, False,
EnumerateFolderCallback,
Node);
( assuming you have files or shortcuts on the desktop )

Getting any ideas? <g>

Jim Kueneman

 | Replies | Author | Date
866 | Re: VirtualTree Explorer --Time to bitch and requ | [jimdk@m...] | Sat 3/24/2001
871 | Re: VirtualTree Explorer --Time to bitch and requ | Mike Lischke | Sun 3/25/2001
875 | Re: VirtualTree Explorer --Time to bitch and requ | [adembaba@e...] | Sun 3/25/2001
876 | Re: VirtualTree Explorer --Time to bitch and requ | [jimdk@m...] | Sun 3/25/2001


re: $1 again

From: "Robert Palmqvist" [robert.palmqvist@h...]
Date: Sun Mar 25, 2001 10:16 pm
Subject: Re: [VirtualTreeview] $1 again

Sorry but I just installed version 2.3 and it is still getting out of sync
when I start to sort on different columns and sort orders. It looks just
fine when I initially populate the tree (used as an list view). I scroll it
up and down and all lines are drawn as they should. But it gets quite ugly
when I start to sort on other columns or when I change sort order. The tree
then gets huge sections where no lines are shown at all. Just like the ones
Werner Lehmann described in his earlier post...

/ Robert

----- Original Message -----
From: "Mike Lischke" [public@l...]
To: [VirtualTreeview@yahoogroups.com>
Sent: Saturday, March 24, 2001 5:40 PM
Subject: RE: [VirtualTreeview] $1 again
...
> I will soon upload the newest tree version (2.3) which fixes this problem.
It is indeed again related to the forgotten parts in the cache filling
method.
>
> Ciao, Mike
...

Replies | Author | Date
869 | Re: $1 again | Mike Lischke | Sun 3/25/2001


re: MultiSelect OLE Drag Drop

From: [jimdk@m...]
Date: Sat Mar 24, 2001 10:16 pm
Subject: Re: MultiSelect OLE Drag Drop

--- In [VirtualTreeview@y...], "Mike Lischke" [public@l...] wrote:
> > Maybe another reason it
> > confused me way if only 1/2 a node is visible at the bottom the
drag
> > image includes only this half and it looks strange.
>
> You should download the latest version (2.3) which I will upload in
a couple of minutes. The drag image is now blended and fades to the
image borders. I believe you will like it.

You would know I don't have MMX!!!!! (166 with a HIGHLY overclocked
ASUS TX-97 board!!! I am shopping for a new one now.

>
> To all: the code for blending uses MMX instructions and depends
therefore on an MMX capable CPU. I have included check code to disable
blending if the CPU is not MMX capable but I would like to have this
tested on more than one machine. In my company I have only found one
old Pentium computer which does not support MMX. Suprisingly I found
that the AMD K6 also has MMX support where I thought it would not.

Mike,
The overlays in my Explorer Treeview are NOT working on my non-MMX
machine. I still contend th way TImageList handles overlays is just
plain wrong. The right way is to use INDEXTOOVERLAYMASK is to create
a value to pass in the fStyle parameter (by ANDing) and the main image
is passed in the index parameter. TImageList uses INDEXTOOVERLAYMASK
and passes the value in the index parameter and uses the some mask
that is not used in all versions of the Windows. Look here:

http://support.microsoft.com/support/kb/articles/Q125/6/29.asp

Jim Kueneman

 | Replies | Author | Date
870 | Re: MultiSelect OLE Drag Drop | Mike Lischke | Sun 3/25/2001
877 | Image painting (was: MultiSelect OLE Drag Drop) | Mike Lischke | Sun 3/25/2001
879 | Re: Image painting (was: MultiSelect OLE Drag Dro | [jimdk@m...] | Sun 3/25/2001


re: VirtualTree Explorer --Time to bitch and request :-)

From: [jimdk@m...]
Date: Sat Mar 24, 2001 10:46 pm
Subject: Re: VirtualTree Explorer --Time to bitch and request :-)

--- In [VirtualTreeview@y...], [jimdk@m...] wrote:
> --- In [VirtualTreeview@y...], [adembaba@e...] wrote:
> >
> > Hi,
> >
> > Yes, the code is excellent. But, that does not stop
> > me bitching about this or the other :-)
> >
> > Here is one: Behavior of folder icons are the wrong
> > way; they look 'open' until you select them --when they
> > look 'closed'.. There is something in the code somewhere
> > but I could not find it. (I am using VT 2.3)
>
>
> It appears Mike messed up somewhere. All the nodes seem to

Found it... Line 15338

Change -
ImageKind: array[Boolean] of TVTImageKind = (ikSelected, ikNormal);

To -
ImageKind: array[Boolean] of TVTImageKind = (ikNormal, ikSelected);

See Mike you bypassed Pascal strong type checking and indexed these
directly instead of the identifiers and got burned <g>

Jim Kueneman

 | Replies | Author | Date
871 | Re: VirtualTree Explorer --Time to bitch and requ | Mike Lischke | Sun 3/25/2001


Explorer VT

From: [jimdk@m...]
Date: Sun Mar 25, 2001 5:18 am
Subject: Explorer VT

Mike,

I am trying to make a decendant of TCustomVirtualStringTree that is
TVirtualExplorer. I used the demo and moved all the event code into
the corresponding DoXXXXXX overridden methods (I called all inhertied
methods). Now the Treeview looks like a listview? It has no "+"
symbols and the children are not indented. Any idea what could be the
problem.

Jim Kueneman

 | Replies | Author | Date
868 | Re: Explorer VT | [jimdk@m...] | Sun 3/25/2001
872 | Re: Explorer VT | Mike Lischke | Sun 3/25/2001
873 | Re: Explorer VT | Mike Lischke | Sun 3/25/2001
874 | Re: Explorer VT | [adembaba@e...] | Sun 3/25/2001
878 | Re: Explorer VT | [jimdk@m...] | Sun 3/25/2001
886 | Re: Explorer VT | [jimdk@m...] | Mon 3/26/2001
880 | Re: Explorer VT | [jimdk@m...] | Sun 3/25/2001
882 | Kylix | Geoffrey Pan | Sun 3/25/2001
883 | Re: Explorer VT | Mike Lischke | Sun 3/25/2001


re: Explorer VT

From: [jimdk@m...]
Date: Sun Mar 25, 2001 6:32 am
Subject: Re: Explorer VT

--- In [VirtualTreeview@y...], [jimdk@m...] wrote:
ks like a listview? It has no "+"
> symbols and the children are not indented. Any idea what could be
the
> problem.

I have narrowed it down to being there are no columns being created.
The mouse seems to think the buttons and indentations are there. If I
manually create a column then I can see things working right up to 50
pixels to the right (default width of a column). I tried setting the
width wider but my screwing around killed Delphi and I gave up.

Also if I comment out all of my code in all the other DoXXXX methods
and only call inhertied, even the DoFreeNode it kills Delphi if I
place a component on the form then try to delete it. When it is
deleted I get an Invalid Pointer Operation error and I have to edit
the DFM file by hand to remove the component. I have commented out
ALL other occurances where I use the TNamespace Data. All I do is
create it here and save it in the extra 4 bytes I allocated in the
Create constructor.

constructor TCustomVirtualExplorer.Create(AOwner: TComponent);
begin
inherited;
..........
{ make room for the TNamespace data }
NodeDataSize := SizeOf(TNodeData);
end;

procedure TCustomVirtualExplorer.DoInitNode(Parent, Node:
PVirtualNode; var InitStates: TVirtualNodeInitStates);
var
Data: PNodeData;
begin
inherited;
Data := PNodeData( GetNodeData(Node));
if assigned(Data) then
begin
if not Assigned(Parent) then

{ If I comment out the next 2 line it works ok }

Data.Namespace := CreateSpecialNamespace(CSIDL_DESKTOP);
HasChildren[Node] := Data.Namespace.HasSubFolder

end;
end;

Jim Kueneman

 | Replies | Author | Date
872 | Re: Explorer VT | Mike Lischke | Sun 3/25/2001
873 | Re: Explorer VT | Mike Lischke | Sun 3/25/2001
874 | Re: Explorer VT | [adembaba@e...] | Sun 3/25/2001
878 | Re: Explorer VT | [jimdk@m...] | Sun 3/25/2001
886 | Re: Explorer VT | [jimdk@m...] | Mon 3/26/2001
880 | Re: Explorer VT | [jimdk@m...] | Sun 3/25/2001
882 | Kylix | Geoffrey Pan | Sun 3/25/2001
883 | Re: Explorer VT | Mike Lischke | Sun 3/25/2001
884 | Re: Explorer VT | [jimdk@m...] | Sun 3/25/2001


re: $1 again

From: "Mike Lischke" [public@l...]
Date: Sun Mar 25, 2001 9:19 am
Subject: RE: [VirtualTreeview] $1 again

Hi Robert,

> Sorry but I just installed version 2.3 and it is still getting out of sync
> when I start to sort on different columns and sort orders.

This is more than strange. Are you sure you have rebuild your package and dcu
and also use the
correct version of VT? I need a demo project which shows the problem so I can
debug it. Since I have
fixed the cache code I have never seen this effect in any of the application
which use VT regardless
of what I tried.

Ciao, Mike

 | Replies | Author | Date
918 | Re: $1 again | [zh66w6@h...] | Tue 3/27/2001


re: Re: MultiSelect OLE Drag Drop

From: "Mike Lischke" [public@l...]
Date: Sun Mar 25, 2001 9:24 am
Subject: RE: [VirtualTreeview] Re: MultiSelect OLE Drag Drop

Hi Jim,

> You would know I don't have MMX!!!!! (166 with a HIGHLY overclocked
> ASUS TX-97 board!!! I am shopping for a new one now.

:-) You see, VT is even motivating for buying hardware. I should make a ad
contract with Intel and
AMD :o]

> The overlays in my Explorer Treeview are NOT working on my non-MMX
> machine. I still contend th way TImageList handles overlays is just
> plain wrong.

How often do I have to say this: the image paint stuff is not yet finished. It
is in an intermediate
state where it works most of the time but not always. That's why the version is
called a prerelease.
Please be patient.

Ciao, Mike

 | Replies | Author | Date
877 | Image painting (was: MultiSelect OLE Drag Drop) | Mike Lischke | Sun 3/25/2001
879 | Re: Image painting (was: MultiSelect OLE Drag Dro | [jimdk@m...] | Sun 3/25/2001


re: Re: VirtualTree Explorer --Time to bitch and request :-)

From: "Mike Lischke" [public@l...]
Date: Sun Mar 25, 2001 9:25 am
Subject: RE: [VirtualTreeview] Re: VirtualTree Explorer --Time to bitch and request :-)

> Found it... Line 15338

Oops.


re: Re: Explorer VT

From: "Mike Lischke" [public@l...]
Date: Sun Mar 25, 2001 9:49 am
Subject: RE: [VirtualTreeview] Re: Explorer VT

> I have narrowed it down to being there are no columns being created.
> The mouse seems to think the buttons and indentations are there. If I
> manually create a column then I can see things working right up to 50
> pixels to the right (default width of a column). I tried setting the
> width wider but my screwing around killed Delphi and I gave up.

Wow, it is sometimes very surprising *what* kind of problems can still be
produced with VT. This one
sounds as would the hit testing and the paint code assume different areas as
main column. Of course
this should not happen, but I wonder how this actually can happen at all. The
too small comes again
from nodes which get initialized before they get their real content. How do you
add new nodes?

> All I do is
> create it here and save it in the extra 4 bytes I allocated in the
> Create constructor.
>
> constructor TCustomVirtualExplorer.Create(AOwner: TComponent);
> begin
> inherited;
> ..........
> { make room for the TNamespace data }
> NodeDataSize := SizeOf(TNodeData);
> end;

Do you use the node data area in the application too? Usually a tree should
store its internal data
in an area which is not directly accessible by the application. For this I have
introduced the
InternalNodeDataSize member. But I recognize that this is more subject to mess
up than I thought
initially. I'm thinking already how to make this more fail prove.

Ciao, Mike

 | Replies | Author | Date
873 | Re: Explorer VT | Mike Lischke | Sun 3/25/2001
874 | Re: Explorer VT | [adembaba@e...] | Sun 3/25/2001
878 | Re: Explorer VT | [jimdk@m...] | Sun 3/25/2001
886 | Re: Explorer VT | [jimdk@m...] | Mon 3/26/2001
880 | Re: Explorer VT | [jimdk@m...] | Sun 3/25/2001
882 | Kylix | Geoffrey Pan | Sun 3/25/2001
883 | Re: Explorer VT | Mike Lischke | Sun 3/25/2001
884 | Re: Explorer VT | [jimdk@m...] | Sun 3/25/2001


re: Re: Explorer VT

From: "Mike Lischke" [public@l...]
Date: Sun Mar 25, 2001 9:58 am
Subject: RE: [VirtualTreeview] Re: Explorer VT

> The too small comes again from nodes which get initialized before they get
their
> real content.

I meant: "the too small captions come ..."

Btw: Something is wrong with your shell folder stuff. When I expand an entire
drive with about 20000
file objects and scroll down page by page then I get suddenly (after some
thousand viewed nodes)
something I have *never* seen with Windows 2000. The system states some
resources are consumed
(which resources is not clear from the exception). After this every call to
SaveDC and other APIs
fails with the result that I have to kill the application. Since it is said
that Windows NT/2K does
not have any inherent resource limitations it seems that there is something
terribly wrong in the
shell stuff.

Ciao, Mike

 | Replies | Author | Date
874 | Re: Explorer VT | [adembaba@e...] | Sun 3/25/2001
878 | Re: Explorer VT | [jimdk@m...] | Sun 3/25/2001
886 | Re: Explorer VT | [jimdk@m...] | Mon 3/26/2001


re: Explorer VT

From: [adembaba@e...]
Date: Sun Mar 25, 2001 12:42 pm
Subject: Re: Explorer VT

> Btw: Something is wrong with your shell folder stuff.
> When I expand an entire drive with about 20000
> file objects and scroll down page by page then
> I get suddenly (after some thousand viewed nodes)
> something I have *never* seen with Windows 2000.
> The system states some resources are consumed
> (which resources is not clear from the exception).
> After this every call to SaveDC and other APIs
> fails with the result that I have to kill the
> application. Since it is said that Windows NT/2K does
> not have any inherent resource limitations it seems
> that there is something terribly wrong in the
> shell stuff.

I am not sure what exactly you mean here, but, I
checked if I could repeat anything like that by
opening a folder that contains about 15,000 glyphs
and it worked. I then opened another one (while
keeping the Glyph folder open) with about 2,000
files. I did not get any error messages.

BTW: I am using D5-SP1, Win2K-SP1

Cheers,

 | Replies | Author | Date
878 | Re: Explorer VT | [jimdk@m...] | Sun 3/25/2001


re: VirtualTree Explorer --Time to bitch and request :-)

From: [adembaba@e...]
Date: Sun Mar 25, 2001 12:49 pm
Subject: Re: VirtualTree Explorer --Time to bitch and request :-)

> > Secondly, OK now we can emulate left pane of Explorer;
> > but could someone (the author, please) alter it so that
> > it combines both the left and right hand panes of Explorer
> > (i.e. when it is in Details view).
>
>
> Do you know how long it took me to understand the Shell
> and how many times I rewrote the TNamespace class (this
> is only a small portion of it the "real" version implements
> almost every aspect of a Namespace I could think of) to
> be as small and a fast as it is? And now you want
> me write an Explorer replacement too? <g>

You know, ignorance is bliss; and if my request leads
to an Explorer replacement, let me assure that I am
totally innocent <G>

> Ok I'll see what I can do.
> Lets see it may take... 3-4 minutes of changes to do
> what you want if I understand what you want. Look at
> the VirtualExplorerTreeExpanding event.
[..]
> Getting any ideas? <g>

Wow!

And... To think that I spent at least 10 hours
trying to do what those 2 parameter changes do...

Man, I, for one, hate you !!! <g>

Cheers,

 | Replies | Author | Date
876 | Re: VirtualTree Explorer --Time to bitch and requ | [jimdk@m...] | Sun 3/25/2001


re: VirtualTree Explorer --Time to bitch and request :-)

From: [jimdk@m...]
Date: Sun Mar 25, 2001 2:41 pm
Subject: Re: VirtualTree Explorer --Time to bitch and request :-)

--- In [VirtualTreeview@y...], [adembaba@e...] wrote:

> You know, ignorance is bliss; and if my request leads
> to an Explorer replacement, let me assure that I am
> totally innocent <G>

Acutally I have done a fair amount of work on GXExplorer which is an
open source Delphi Explorer replacement, www.gxexplorer.org

> And... To think that I spent at least 10 hours
> trying to do what those 2 parameter changes do...

Only thing left if Details. That is not so trivial, depending on what
version of Windows and what version of shell32.dll is installed. In
an ideal world it is a simple matter using IShellDetails, but when has
Windows been an ideal operating system.

Jim Kueneman


Image painting (was: MultiSelect OLE Drag Drop)

From: "Mike Lischke" [public@l...]
Date: Sun Mar 25, 2001 2:46 pm
Subject: Image painting (was: MultiSelect OLE Drag Drop)

> How often do I have to say this: the image paint stuff is not yet finished.

Well, the day went away while I implemented the image painting stuff so it is
finally usable and
correctly working. I have extended image retrieval slightly to ask the
application whether an icon
should be displayed ghosted. This is particularly useful for the Explorer
treeview. To use this
feature I recommend that you extend your name space class a bit, Jim. check for
the flag
SFGAO_GHOSTED and returned it as property just as you do with the other flags.
Btw: it would be cool
if you could also implement SFGAO_COMPRESS. This is a flag only useful for NTFS
but allows to show
nodes in different colors/styles if the underlaying folder or drive is
compressed.

Another point which would improve the control is to chache some information
(store it in the
TNameSpace class) instead retrieving it frequently via the IShellFolder
interface. Particularly the
stuff which is needed for painting should be cached as it is often needed and
slows down the tree
while dragging, selecting etc. remarkably (i.e. the node's caption, its
image(s) and its flags for
checking for ghosted, compressed etc.).

Ah yes, while we are at it. I found out what the reason is for the low quality
blending for images
from an image list. The VCL creates all image lists with only 16 colors. Since
the system image list
is created in high color format the blending looks there much better. After I
figured out how to
convert a TImageList to high color format I was able to draw everything smooth
without using MMX
blend.

Ciao, Mike

 | Replies | Author | Date
879 | Re: Image painting (was: MultiSelect OLE Drag Dro | [jimdk@m...] | Sun 3/25/2001


re: Explorer VT

From: [jimdk@m...]
Date: Sun Mar 25, 2001 2:48 pm
Subject: Re: Explorer VT

--- In [VirtualTreeview@y...], [adembaba@e...] wrote:
> > (which resources is not clear from the exception).
> > After this every call to SaveDC and other APIs
> > fails with the result that I have to kill the
> > application. Since it is said that Windows NT/2K does
> > not have any inherent resource limitations it seems
> > that there is something terribly wrong in the
> > shell stuff.
>
> I am not sure what exactly you mean here, but, I
> checked if I could repeat anything like that by
> opening a folder that contains about 15,000 glyphs
> and it worked. I then opened another one (while
> keeping the Glyph folder open) with about 2,000
> files. I did not get any error messages.

Um, I am not sure what could be wrong. It is obvious that the
Enumeration has finished and it has created all the TNamespace
objects and as such all the PIDLs have been allocated successfully.
It gets the IShellFolder interfaces on demand and then holds on to
them but that should not cause a problems. I do not always trust
"Resource Problems" dialogs to be actually Resource Problems. I will
look it over, maybe I am not releasing something.

Jim Kueneman


re: Image painting (was: MultiSelect OLE Drag Drop)

From: [jimdk@m...]
Date: Sun Mar 25, 2001 2:54 pm
Subject: Re: Image painting (was: MultiSelect OLE Drag Drop)

--- In [VirtualTreeview@y...], "Mike Lischke" [public@l...] wrote:
> > How often do I have to say this: the image paint stuff is not yet
finished.
>
> Well, the day went away while I implemented the image painting stuff

>
> Another point which would improve the control is to chache some
information (store it in the

Man are you going to make me give away my "real" TBaseNamespace class?
<g> It is several thousand lines of making a screaming Explorer
Treeview/Listview! Ok I will think about it!

Jim Kueneman


re: Explorer VT

From: [jimdk@m...]
Date: Sun Mar 25, 2001 3:07 pm
Subject: Re: Explorer VT

--- In [VirtualTreeview@y...], "Mike Lischke" [public@l...] wrote:
> Wow, it is sometimes very surprising *what* kind of problems can
still be produced with VT. This one
> sounds as would the hit testing and the paint code assume different
areas as main column. Of course

I uploaded the source to it for you to see if you can find it. Also
Install it as a component and add it to a form then delete it. Delphi
crashes.

Jim Kueneman

 | Replies | Author | Date
882 | Kylix | Geoffrey Pan | Sun 3/25/2001
883 | Re: Explorer VT | Mike Lischke | Sun 3/25/2001
884 | Re: Explorer VT | [jimdk@m...] | Sun 3/25/2001


processDrop problem

From: [koeneijsvogels@h...]
Date: Sun Mar 25, 2001 4:07 pm
Subject: processDrop problem

Hello,

I'm trying to implement drag and drop in the same virtualtreeview to
allow users reordering their data, so I have only one virtualtreeview
in my program and I don't want to drop other things in it, only copy
or move within the treeview.

As a test, I took the "minimal" demo provided with virtualtreeview
and added the procedure VTDragDrop (see below) as stated in the help
file. I also set dragmode to dmAutomatic. When I try to drag and
drop, Sender.ProcessDrop(DataObject, Sender.DropTargetNode, Effect,
AttachMode); returns false and nothing happens. I tried version 1.31
and 2.3b but no success. (I'm using Delphi 5)

Has anyone any idea what might be wrong?

(Besides my current problem, I thing virtualtreeview is a great
component)

Thank you in advance,

Regards,

Koen

---- VTDragDrop procedure as stated in the help file...

procedure TMainForm.VTDragDrop(Sender: TBaseVirtualTree; Source:
TObject; DataObject: IDataObject;
const Formats: array of Word; Shift: TShiftState; Pt: TPoint; var
Effect: Integer; Mode: TDropMode);

var
I: Integer;
AttachMode: TVTNodeAttachMode;

begin
if Length(Formats) > 0 then
begin
// OLE drag'n drop
// If the native tree format is listed then use this and accept
the drop, otherwise recject (ignore) it.
// It is recommend by Microsoft to order available clipboard
formats in decreasing detail richness so
// the first best format which we can accept is usually the best
format we can get at all.
for I := 0 to High(Formats) do
if Formats[I] = CF_VIRTUALTREE then
begin
case Mode of
dmAbove:
AttachMode := amInsertBefore;
dmOnNode:
// nodes are moved in reverse logical order to speed up
reindexing of siblings
// so you need to specify the reverse mode here to that
you actually want
AttachMode := amAddChildLast;
dmBelow:
AttachMode := amInsertAfter;
else
if Assigned(Source) and
(Source is TBaseVirtualTree) and
(Sender <> Source) then AttachMode := amInsertBefore
else AttachMode := amNowhere;
end;
// in the case the drop target does an optimized move Effect
is set to DROPEFFECT_NONE
// to indicate this also to the drag source (so the source
doesn't need to take any further action)
Sender.ProcessDrop(DataObject, Sender.DropTargetNode, Effect,
AttachMode);
Break;
end;
end
else
begin
// VCL drag'n drop, Effects contains by default both move and
copy effect suggestion,
// as usual the application has to find out what operation is
finally to do
Beep;
end;
end;

 | Replies | Author | Date
908 | Re: processDrop problem | Mike Lischke | Tue 3/27/2001
919 | Re: processDrop problem | Wez Furlong | Tue 3/27/2001
928 | Re: processDrop problem | [koeneijsvogels@h...] | Tue 3/27/2001
941 | Re: processDrop problem | Mike Lischke | Thu 3/29/2001
1136 | Re: processDrop problem | [koeneijsvogels@h...] | Wed 4/11/2001
1137 | Re: processDrop problem | [koeneijsvogels@h...] | Wed 4/11/2001
1157 | Re: processDrop problem | Mike Lischke | Thu 4/12/2001


Kylix

From: "Geoffrey Pan" [gpan@c...]
Date: Sun Mar 25, 2001 4:35 pm
Subject: Kylix

Anyone tried porting?. Any suggestions on where the main issues are expected
to be?


re: Re: Explorer VT

From: "Mike Lischke" [public@l...]
Date: Sun Mar 25, 2001 8:11 pm
Subject: RE: [VirtualTreeview] Re: Explorer VT

> I uploaded the source to it for you to see if you can find it. Also
> Install it as a component and add it to a form then delete it. Delphi
> crashes.

Ok, here is what I had to do and found out:

1) Added VirtualExplorer to the VirtualTreeview package
2) Added ShellUtilities
3) Changed DoGetImageIndex to account for the new parameter Ghosted
4) Commented out Data.Namespace.RetrieveDataObject(nil); in DoBeforeDrag (not
defined)
5) Adjusted the inherited call to DoGetImageIndex
6) Changed in TCustomVirtualExplorer.Create the column creation code to:
with Header do
begin
with Columns.Add do
Width := 200;
Options := Options + [hoVisible];
end;
7) Changed the overlay indexes to 1 for links and 0 for shared hand.
8) Changed in WMCreate the line:
Expanded[GetFirstNode] := True; (GetFirstNode initializes the first node)
9) Changed in DoInitNode the line:
HasChildren[Node] := Data.Namespace.HasSubFolder
to
if Data.Namespace.HasSubFolder then
Include(InitStates, ivsHasChildren);
10) And then some voodoo began. Really strange things happend and I had to
restart my IDE at least
50 times (a restart takes on my Athlon 650 fortunately only about 10 seconds).
11) After 3 hours debugging I had the right idea. You are using the offical
NodeDataSize which is
only meant for applications, not descendants. They use InternalNodeDataSize
with some complicated
pointer math to get to their data. This kind of internal node data allocation
was a thorn in my side
for a long time and now I decided to redesign this entirely. This will take a
while because I still
have also other things to do so for the time being you can add 4 bytes in
MakeNewNode as (ugly) work
around. You can see the check for csDesigning, which brought me to the right
idea (at runtime all
was fine). At design time the value for NodeDataSize is ignored so your Virtual
Explorer was
accessing invalid memory all the time (the records have been allocated too
small).

function TBaseVirtualTree.MakeNewNode: PVirtualNode;

var
Size: Cardinal;

begin
if csDesigning in ComponentState then
Size := SizeOf(TVirtualNode) + 4
else
begin
// make sure FNodeDataSize is valid
if FNodeDataSize = -1 then
ValidateNodeDataSize(FNodeDataSize);

// take record alignment into account
Size := (SizeOf (TVirtualNode) + 3) and not 3 + FNodeDataSize;
end;

// AllocMem clears the new memory, in opposition to New
Result := AllocMem(Size + InternalDataSize);

// fill in some default values
with Result^ do
begin
TotalCount := 1;
TotalHeight := FDefaultNodeHeight;
NodeHeight := FDefaultNodeHeight;
States := [vsVisible];
Align := 50;
end;
end;

Ciao, Mike

 | Replies | Author | Date
884 | Re: Explorer VT | [jimdk@m...] | Sun 3/25/2001


re: Explorer VT

From: [jimdk@m...]
Date: Sun Mar 25, 2001 11:40 pm
Subject: Re: Explorer VT

--- In [VirtualTreeview@y...], "Mike Lischke" [public@l...] wrote:

> 4) Commented out Data.Namespace.RetrieveDataObject(nil); in
DoBeforeDrag (not defined)

Sorry about that I'm working on the Drag and Drop.

> 6) Changed in TCustomVirtualExplorer.Create the column creation code
to:
> with Header do
> begin
> with Columns.Add do
> Width := 200;
> Options := Options + [hoVisible];
> end;

I am assuming that this is a workaround until you figure out why it
displays as a list view unless this is done?

> 7) Changed the overlay indexes to 1 for links and 0 for shared hand.

That is nice but it is incorrect. Links are 2 and Shared is 1 in the
system image list (the only two that MS recommends to be hardcoded for
backward compatiblity)

http://support.microsoft.com/support/kb/articles/Q192/0/55.ASP

> 8) Changed in WMCreate the line:
> Expanded[GetFirstNode] := True; (GetFirstNode initializes the
first node)
> 9) Changed in DoInitNode the line:
> HasChildren[Node] := Data.Namespace.HasSubFolder
> to
> if Data.Namespace.HasSubFolder then
> Include(InitStates, ivsHasChildren);

Are there a lot of places where things need to be done differently if
you are doing it "internally" as a decendant? If so I will be
bothering you a lot. <g>

> 11) After 3 hours debugging I had the right idea. You are using the

I am sure you had nothing better to do. <g>

> was fine). At design time the value for NodeDataSize is ignored so
your Virtual Explorer was
> accessing invalid memory all the time (the records have been
allocated too small).

Are you suggesting this hack because the Internal Data Size won't work
in my case or because you are going to eliminate it?

Thanks for looking at this.

Jim Kueneman


Simple Question

From: [d.lindsey@d...]
Date: Sun Mar 25, 2001 11:56 pm
Subject: Simple Question

I have VTree in left-hand pane reflecting a hierarchical SQL database
and when a node is selected the right-hand pane shows all the
details. Pretty standard stuff. In the old days of TreeNT the onclick
event would used the selected node to look-up the database to display
the details. For Vtree is this still the case? In the database
example this look-up is done onGetText but this may necessitate too
many unnecessary table reads when constructing the node (esp. the
child nodes). I am I correct in this or is there a more efficient way?
Regards
David

 | Replies | Author | Date
888 | Re: Simple Question | Mike Lischke | Mon 3/26/2001
904 | Re: Simple Question | [d.lindsey@d...] | Mon 3/26/2001
930 | Re: Simple Question | Mike Lischke | Wed 3/28/2001


re: Explorer VT

From: [jimdk@m...]
Date: Mon Mar 26, 2001 2:32 am
Subject: Re: Explorer VT

--- In [VirtualTreeview@y...], "Mike Lischke" [public@l...] wrote:
> fails with the result that I have to kill the application. Since it
is said that Windows NT/2K does
> not have any inherent resource limitations it seems that there is
something terribly wrong in the shell stuff.

Found it!

In ShellUtilites go to

function StrRetToStr(StrRet: TStrRet; APIDL: PItemIDList): string;
var
P: PChar;
begin
case StrRet.uType of
STRRET_CSTR:
.....
STRRET_OFFSET:
....
STRRET_WSTR:
begin
Result := WideCharToString(StrRet.pOleStr);

{ ADD THIS TO FREE THE SHELL STRING }

if Assigned(StrRet.pOleStr) then
CoTaskMemFree(StrRet.pOLEStr);
end;
end;
end;

It must be the shell does have a memory limit in Win2k

Jim Kueneman


re: Re: Explorer VT

From: Mike Lischke [public@l...]
Date: Mon Mar 26, 2001 7:43 am
Subject: RE: [VirtualTreeview] Re: Explorer VT

> > 6) Changed in TCustomVirtualExplorer.Create the column
> creation code
> to:
> > with Header do
> > begin
> > with Columns.Add do
> > Width := 200;
> > Options := Options + [hoVisible];
> > end;
>
> I am assuming that this is a workaround until you figure out why it
> displays as a list view unless this is done?

No, I do not consider this as work around. If you want columns then this is
the way to create them. Otherwise leave the header alone.

> > 7) Changed the overlay indexes to 1 for links and 0 for shared hand.
>
> That is nice but it is incorrect. Links are 2 and Shared is 1 in the
> system image list (the only two that MS recommends to be
> hardcoded for
> backward compatiblity)
>
> http://support.microsoft.com/support/kb/articles/Q192/0/55.ASP

They are crazy, really creazy! Creating temporary files etc. to get the
correct overlay indices is crazy, don't you think so. So far, however, I
have never used this code and have written code using these overlay images
which works on every 32 bit Windows (9x, ME, NT, 2K) without this hack. Btw:
you forgot that overlay indices are one-based. The VCL adds 1 to each
overlay index (see TCustomImageList.DrawOverlay) and therefore you have to
use 0 and 1.

> Are there a lot of places where things need to be done differently if
> you are doing it "internally" as a decendant? If so I will be
> bothering you a lot. <g>

There are some differences, yes (as with any component) but in your case
this does not apply. You have simply used the wrong functions/properties.
E.g. TopNode is the node at the top of the window which is not necessarily
the first node in the tree. GetFirstNode is the correct function.
Additionally you have accessed data at initialization time which depends on
initialized nodes (e.g. HasChildren). It is essential that you work as far
as possible only with the data which is available in OnInitNode and
OnInitChildren (that is, the parent node, the node itself, the InitStates
and global data of the sender tree).

> Are you suggesting this hack because the Internal Data Size
> won't work
> in my case or because you are going to eliminate it?

Oh, InternalDataSize works also in your case (if applied correctly) but it
is too dangerous if not used correctly and not comfortable enough. I have
already a base idea how to make this part better. So use the hack for the
time being, the InternalDataSize will be reworked (it will become a virtual
function and some more pointer math will be added).

Ciao, Mike

 | Replies | Author | Date
892 | Re: Explorer VT | [jimdk@m...] | Mon 3/26/2001


re: Simple Question

From: Mike Lischke [public@l...]
Date: Mon Mar 26, 2001 7:47 am
Subject: RE: [VirtualTreeview] Simple Question

Hi David,

> I have VTree in left-hand pane reflecting a hierarchical SQL database
> and when a node is selected the right-hand pane shows all the
> details. Pretty standard stuff. In the old days of TreeNT the onclick
> event would used the selected node to look-up the database to display
> the details. For Vtree is this still the case? In the database
> example this look-up is done onGetText but this may necessitate too
> many unnecessary table reads when constructing the node (esp. the
> child nodes). I am I correct in this or is there a more efficient way?

You are correct. I have not looked through the database example (I think you
are referring to IB_VTree, aren't you?) so I don't know how the lookup is
done there. But it can definetly be said that OnGetText and OnGetImageIndex
etc. should be as fast as possible because these events are fired very
often.

For a database tree this could become difficult however, as the dataset
cursor must be moved for retrieving display data. I recommend to implement a
simple buffering scheme there and keep at least the display data for nodes
which are currently shown in the client area.

Ciao, Mike

 | Replies | Author | Date
904 | Re: Simple Question | [d.lindsey@d...] | Mon 3/26/2001


re: Re: Explorer VT

From: Mike Lischke [public@l...]
Date: Mon Mar 26, 2001 7:54 am
Subject: RE: [VirtualTreeview] Re: Explorer VT

> { ADD THIS TO FREE THE SHELL STRING }
>
> if Assigned(StrRet.pOleStr) then
> CoTaskMemFree(StrRet.pOLEStr);

Aaah, great to know :-) A tip: I suppose the code is faster when you pass
your IMalloc interface to it and use this to free the data.

> It must be the shell does have a memory limit in Win2k

Mm, difficult to say. The system stays rock solid, regardless of what
happend with Delphi or the shell stuff. The limitation seems to be based on
a per process basis. After closing the buggy app everything goes fine as
would there never be anything wrong (even the shell itself is totally
unimpressed and I have not enabled to open a new process for each browser
window). I'm really happy with my Win2000 stations (after I got not so buggy
display drivers for my GeForce).

Ciao, Mike


BCB translation

From: Mike Lischke [public@l...]
Date: Mon Mar 26, 2001 9:53 am
Subject: BCB translation

Hi all,

could somebody please upload the hpp file which BCB 4/5 creates from
VirtualTrees.pas to YG? This would be very kind. Thank you in advance.

Ciao, Mike


Shell Explorer Tree

From: [kyan@s...]
Date: Mon Mar 26, 2001 10:12 am
Subject: Shell Explorer Tree

Hello everybody.

My name is Constantine Yannakopoulos, i come from Greece and i am new
to this group.

Let me congratulate Mike for his excellent component, i've been using
it for about 2 weeks now and it has solved my hands in many cases.

Some observations:

I would like to see a unit that would contain some reusable standard
in-place editor implementations (combobox, checkbox, memo, even VTree
popup). It is not very easy to write one, i've tried...

In a case where i used VTree to present the file system of a remote
machine i needed to implement OLE drag/drop from/to an Explorer
window. I managed to get the drop from Explorer to VTree to work, but
i couldn't get the other way round to work. The reason for this is
that explorer seems to expect a clipboard format other than
Text/Unicode Text, i think it's CF_HDROP. Also, i think that
TVTDragDropManager class cannot be subclassed in such a way that it
can support other clipboard formats.
If someone has managed to implement what i'm trying to do, please
help me out.
Mike, your OnCreateDragManager event handler *could* return a
IUnknown interface pointer instead of a TVTDragDropManager class.
This way one could write his/her own drag/drop manager, not derived
from yours and have the control use it instead. I know you are
sensitive about interface changes, but you could introduce a new
event handler, say "OnCreateDragManagerUnk".

Now, about shell explorer:

I once wrote a TCustomTreeView descendant that behaved exactly like
an explorer tree (it supports context menus and automatically updates
itself when something happens in the shell, only drag/drop is
missing). It comes along with an interfaced wrapper object for Shell
IDLists (i found the interfaced implementation much more convenient)
and a translation of some of the new shell interfaces not found in
ShlObj.pas (like IShellFolder2, IContextMenu3 etc).

If you want, i could upload it so that someone can use it as a guide
(or even modify it) for a TVirtualExplorerTree component.

What do you say?

 | Replies | Author | Date
894 | Re: Shell Explorer Tree | Mike Lischke | Mon 3/26/2001
971 | Re: Shell Explorer Tree | [jimdk@m...] | Sat 3/31/2001


re: Explorer VT

From: [jimdk@m...]
Date: Mon Mar 26, 2001 2:20 pm
Subject: Re: Explorer VT

--- In [VirtualTreeview@y...], Mike Lischke [public@l...] wrote:

> No, I do not consider this as work around. If you want columns then
this is
> the way to create them. Otherwise leave the header alone.

But if I don't create a header column the Treeview does not
Paint indented (no + buttons either) but the mouse responds to the
correct indented areas

> you forgot that overlay indices are one-based. The VCL adds 1 to

Oops, I stand correct.

I was thinking about the delay getting icons. The way Explorer does
it is display the default (index 0) and then starts a thread to gather
icon indices. I there a way in VT to tell it "hey I have the right
image index please only redraw the image." I think if the whole
window is redraw as each image is realized it will be too slow. I
guess custom draw is an option but... I think your paint method does
not check the invalidated rectangle and only paint what is
uncovered/requested correct? It paints everything but clips the it to
the requested region. Do you feel this is faster than checking for an
intersection of rectangles (like the image rect, the test rect, etc)
and the requested drawing area? I have alway thought the latter much
faster (derived from old slow computer and non-windows opimized video
card days)

Jim Kueneman

BTW if I am getting on your nerves and spending too much of your time
please let me know <g>


Subscriptions

From: Mike Lischke [public@l...]
Date: Mon Mar 26, 2001 2:56 pm
Subject: Subscriptions

Hi all,

having crossed the 250 members border today I want to remind everyone that
it is not necessary to subscribe with several mail addresses unless you
don't have an account which you can read everywhere. If it is only to post
using different mail accounts then just add every possible mail address to
your alternate addresses at Yahoo Groups (see "My Preferences", "Email
Addresses"). This way you can subscribe with only one address but still post
from different accounts. And it prevents you from getting a message several
times.

Mike Lischke
R&D Senior software engineer


re: Shell Explorer Tree

From: Mike Lischke [public@l...]
Date: Mon Mar 26, 2001 3:13 pm
Subject: RE: [VirtualTreeview] Shell Explorer Tree

Hi Constantine,

> My name is Constantine Yannakopoulos, i come from Greece and i am new
> to this group.

Welcome in the club :o]

> Let me congratulate Mike for his excellent component, i've been using
> it for about 2 weeks now and it has solved my hands in many cases.

Thank you. I hope you not too much trouble getting it to work...

> I would like to see a unit that would contain some reusable standard
> in-place editor implementations (combobox, checkbox, memo, even VTree
> popup). It is not very easy to write one, i've tried...

I have discussed this with some people privately already but so far nobody
volunteers for this task. In the new demo package which will come with the
next official release there is an editor unit (written by Thomas
Bogenrieder) which contains only the editor classes of the current demo.
This unit could be extended if necessary.

> In a case where i used VTree to present the file system of a remote
> machine i needed to implement OLE drag/drop from/to an Explorer
> window. I managed to get the drop from Explorer to VTree to work, but
> i couldn't get the other way round to work.

You should perhaps wait a bit. There is currently a demo implementation
under work which make VT being a Virtual Explorer tree. It could well be
that this tree supports also drag'n drop to the file system. You can
download the first release (not yet as a component) from Yahoo Groups (YG).

> Mike, your OnCreateDragManager event handler *could* return a
> IUnknown interface pointer instead of a TVTDragDropManager class.
> This way one could write his/her own drag/drop manager, not derived
> from yours and have the control use it instead.

I'm afraid this would not work. The problem is the tree relies on the fact
that OnCreateDragManager returns a TBaseDragDropManager instance because it
uses its methods and properties. An IUnknown does not expose the needed
interface. The tree could check whether the given interface is actually a
TBaseDragDropManager but then it would not make any sense to anonymize
OnCreateDragManager.

> missing). It comes along with an interfaced wrapper object for Shell
> IDLists (i found the interfaced implementation much more convenient)
> and a translation of some of the new shell interfaces not found in
> ShlObj.pas (like IShellFolder2, IContextMenu3 etc).
>
> If you want, i could upload it so that someone can use it as a guide
> (or even modify it) for a TVirtualExplorerTree component.

This would be great. It would even be greater if you could work together
with Jim Kueneman who is currently building the Virtual Explorer Tree class.
Wait until he responses here or get his eMail address from YG.

Ciao, Mike


re: Re: Explorer VT

From: Mike Lischke [public@l...]
Date: Mon Mar 26, 2001 3:26 pm
Subject: RE: [VirtualTreeview] Re: Explorer VT

> But if I don't create a header column the Treeview does not
> Paint indented (no + buttons either) but the mouse responds to the
> correct indented areas

This is new to me. There are several demos which do not use any column and
they work fine. In the unit on YG you still have the

with Header.Add do

command in the constructor of the tree which adds one small column but does
not make the header visible. Perhaps this is the reason for your problem?

> I was thinking about the delay getting icons. The way Explorer does
> it is display the default (index 0) and then starts a thread
> to gather icon indices.

I have implemented a similar feature in my Database Image Browser project.
There is a query to get available images from a database and everytime a
node gets initialized it adds itself (in form of an ID) to a waiting thread
which in turn retrieves important information about the file (size, icon,
image size etc.). This is a very funny effect when you scroll down. Some of
you may know this when opening a folder on a Mac (this is System 7/8, don't
know about newer ones). There you can see the same roll effect.

> I there a way in VT to tell it "hey I have the right
> image index please only redraw the image." I think if the whole
> window is redraw as each image is realized it will be too slow.

Yes, there is. Use RepaintNode.

> I think your paint method does
> not check the invalidated rectangle and only paint what is
> uncovered/requested correct?

Oh, indeed does it check. Cells are drawn as a whole without check but there
is an optimization to skip columns which are completely hidden and also for
nodes which are not in the current paint window (which is derived from the
clipping region of the target canvas).

> BTW if I am getting on your nerves and spending too much of your time
> please let me know <g>

Well, I get used to it :o/ On last saturday I only answered eMails, the
whole day. The only problem is that the time I need to answer is lost for
development. I guess I should get a secretary :o]

Ciao, Mike

 | Replies | Author | Date
896 | Re: Explorer VT | [jimdk@m...] | Mon 3/26/2001


re: Explorer VT

From: [jimdk@m...]
Date: Mon Mar 26, 2001 5:00 pm
Subject: Re: Explorer VT

--- In [VirtualTreeview@y...], Mike Lischke [public@l...] wrote:
> > But if I don't create a header column the Treeview does not
> > Paint indented (no + buttons either) but the mouse responds to the
> > correct indented areas
>
> This is new to me. There are several demos which do not use any
column and
> they work fine. In the unit on YG you still have the
>
> with Header.Add do

Right, strip that line out and run it you will see what I mean. This
only happened AFTER I converted the Event driven demo into a decentant
of VT.

Jim Kueneman


re: Re: Explorer VT

From: "Cyril VELTER" [cyril.velter@l...]
Date: Mon Mar 26, 2001 5:04 pm
Subject: Re: [VirtualTreeview] Re: Explorer VT

Hello,

I've had the same problem when using v2.3 : evrything looks like a list
view (using a component derived from VirtualTree). It seems to come from a
bad initialisation of Header.MainColumn (which is 0 instead of -1). Just
add Header.MainColumn:=-1; and everything is fine again.

cyril

> > > 6) Changed in TCustomVirtualExplorer.Create the column
> > creation code
> > to:
> > > with Header do
> > > begin
> > > with Columns.Add do
> > > Width := 200;
> > > Options := Options + [hoVisible];
> > > end;
> >
> > I am assuming that this is a workaround until you figure out why it
> > displays as a list view unless this is done?
>
> No, I do not consider this as work around. If you want columns then this
is
> the way to create them. Otherwise leave the header alone.
>

 | Replies | Author | Date
898 | Re: Explorer VT | Mike Lischke | Mon 3/26/2001
902 | Re: Explorer VT | [jimdk@m...] | Mon 3/26/2001


re: Re: Explorer VT

From: "Mike Lischke" [public@l...]
Date: Mon Mar 26, 2001 6:35 pm
Subject: RE: [VirtualTreeview] Re: Explorer VT

> I've had the same problem when using v2.3 : evrything looks like a list
> view (using a component derived from VirtualTree). It seems to come from a
> bad initialisation of Header.MainColumn (which is 0 instead of -1). Just
> add Header.MainColumn:=-1; and everything is fine again.

Oh how stupid! If I only would know what I had in mind when I set the default
value for MainColumn
to 0 instead NoColumn...

Btw: The freeing of the OLE string seems to improve the speed of the tree alot,
but I still get
after a while an access violation in PSICON.DLL.

Ciao, Mike

 | Replies | Author | Date
902 | Re: Explorer VT | [jimdk@m...] | Mon 3/26/2001


2 questions

From: "Dave Scofield" [dave@b...]
Date: Mon Mar 26, 2001 7:09 pm
Subject: 2 questions

Help!

I would like to use the hot-tracking feature, but there are certain node
types which I do not want to be hot tracked (i.e. no cursor change).
Specifically, I'm displaying folders, and documents within folders. I don't
want a folder to be hot tracked - only documents.

In examining OnHotChange, there doesn't seem to be a way for me to indicate
that the new node should not be made hot (based on my internal detection of
what node type it is). How can I stop a node from ever becoming hot?

Thanks,
Dave

 | Replies | Author | Date
900 | Re: 2 questions | [dave@b...] | Mon 3/26/2001
910 | Re: 2 questions | Mike Lischke | Tue 3/27/2001
925 | Re: 2 questions | [dave@b...] | Tue 3/27/2001
927 | Re: 2 questions | Mike Lischke | Tue 3/27/2001


re: 2 questions

From: [dave@b...]
Date: Mon Mar 26, 2001 7:12 pm
Subject: Re: 2 questions

OK, so it was only 1 question - but I have another one coming! :)


OnClick/OnChange confusions...

From: [dave@b...]
Date: Mon Mar 26, 2001 7:57 pm
Subject: OnClick/OnChange confusions...

I'm confused about the ideas behind OnClick and OnChange, and I'm
hoping someone can clear this up for me...

OnClick is fired whenever the user clicks the mouse anywhere in the
control. If you look at how VCL uses OnClick, it is usually only
fired when the user clicks on something having to do with the
control's purpose. For example, a TListBox doesn't fire OnClick
unless you click on an item.

Here's the problem this creates for me: I'm trying to detect clicks
on a specific node type. (In my case, I'm displaying Folders and
Documents, and I want to do something when a Document is clicked). So
I write an OnClick handler like this:

Node := Tree.FocusedNode;
if [Node is Document] then
DoSomething;

Here's the problem - the user clicks on a Document node, and I do my
thing. Then the user clicks on a +/- button, or somewhere in the
empty space of the control, and I do my thing again, because that
node is still selected - but they didn't click on that node, so I've
done the wrong thing.

The other problem I have with OnClick is this. I'm trying to
eliminate the need for any double-clicks in our app. So, I'd like to
make single-click on a Folder node expand/contract that folder.
Sounds simple enough to handle in OnClick:

Node := Tree.FocusedNode;
if [Node is Folder] then
Tree.ToggleNode(Node);

But once again I'm bitten by the fact that clicking on the +/- button
of a parent node will call OnClick. What happens with this code is
that you click on the node text and it works fine, but if you click
on the +/-, the Tree internally expands/contracts the node, then
calls OnClick. Then my code calls ToggleNode, resulting in the node
going back to it's original state before you clicked. In other words,
it flops open then closes again, or vice-versa - depending on it's
state when you click it.

I've looked at OnChange to try and solve some of these problems, but
this just creates some new problems. For example...

I can fix the OnClick opening nodes multiple times (after clicking
somewhere else other than on the node itself) with this OnChange
handler:

if (Node = Sender.FocusedNode) and [Node is Document] then
DoSomething;

But now I've broken keyboard navigation through the tree, since
OnChange gets called all the time as each new node gets selected (and
probably unselected too?), but I can't tell if it was because of a
click or an up/down arrow key. That's why I really should be using a
combination of OnClick, and OnKeyPress.

Any ideas on how to handle these issues would be greatly appreciated!!

Thanks,
Dave

 | Replies | Author | Date
903 | Re: OnClick/OnChange confusions... | Paul Istrate | Mon 3/26/2001
905 | Re: OnClick/OnChange confusions... | [dave@b...] | Tue 3/27/2001
913 | Re: OnClick/OnChange confusions... | Mike Lischke | Tue 3/27/2001


re: Explorer VT

From: [jimdk@m...]
Date: Mon Mar 26, 2001 8:57 pm
Subject: Re: Explorer VT

--- In [VirtualTreeview@y...], "Mike Lischke" [public@l...] wrote:
>
> Btw: The freeing of the OLE string seems to improve the speed of the
tree alot, but I still get
> after a while an access violation in PSICON.DLL.

Can you elaborate more. Is it when it is enumerating the folder,
getting images and text or ??? By after a while do you mean it has
successfully displayed the image or text a number of times before it
fails?

Also I finally used the D&D image code on a MMX machine. Looks nice.
I have found a auto scroll bug that I can't reproduce every time. Use
the Explorer treeview and set to autodrag. Expand enough to need to
scroll. Now grab a folder and scroll to the top and bottom. Once in
a while it won't scroll all the way to the top or bottom. The
scrollbar lacks one position of going all the way. Now when you drag
back over the treeview the images are drawn offset just enough as to
make the nodes paint act like the scrollbar is at 0 or Max. Does that
make sense?

Like I said it won't do it every time.

Jim Kuenemanke


re: OnClick/OnChange confusions...

From: "Paul Istrate" [istech@c...]
Date: Mon Mar 26, 2001 9:32 pm
Subject: Re: [VirtualTreeview] OnClick/OnChange confusions...

Hi Dave,

Why don't you use OnMouseDown Event (eventualy coupled with OnMouseUp to
avoid MouseDown in an area and MouseUp in another area).

These events provides you more informations than 'Sender'.

Pass X and Y to 'GetHitTestInfoAt' function and I think your problems will
be solved (You will have Node and HitInfo informations in your hands).

I recommend you to store Node and HitInfo when resolve OnMouseDown and then,
in OnMouseUp to compare with new Node and HitInfo. If is the same then (in
OnMouseUp):

if [MDown(Node,HitInfo)=MUp(Node,HitInfo)] and [Node is Document] then
DoSomething;

I hope this will help you.

Paul

 | Replies | Author | Date
905 | Re: OnClick/OnChange confusions... | [dave@b...] | Tue 3/27/2001


re: Simple Question

From: [d.lindsey@d...]
Date: Mon Mar 26, 2001 9:41 pm
Subject: Re: Simple Question

Hi Mike,
Actually I'm using VTree directly with IBX components (I haven't
bought and don't plan to buy IBO) in my program. I looked at the
examples supplied and one used OnGetText to perform the look-up.
The problem is, and it is your fault <g>, I have a hell of a lot of
programs that use TreeNT as a selector for records of databases.
TreeNT offerred so much benefit to my programs I could not resist it,
so thanks for your past efforts. Now I'm going from Paradox to
Interbase and, at the same time, decided to convert TreeNT to VTree
(seeing VTree does more of what I like to find in a tree component).
But I do need to minimise memory and execution time, so I rather try
and link VTree to the database within the program and use whatever I
come up with a standard way of doing things for all the other
programs I'm converting.

> I recommend to implement a
> simple buffering scheme there and keep at least the display data
for nodes
> which are currently shown in the client area.
>
The buffering may be a problem with a large database, especially as
nearly all data will be made available for editing.
One consistency though is the images. They can't be static to a
program because a table has types which are user defined and each
type (around 20) has its own image to show on the tree. Once the type
and its associated image has been defined it is relatively static and
maybe only changed every now and then by the user. Is there a way to
store these images in the VTree. My thinking is this: as the display
of the Vtree is used much more frequently than changes to the
database, I was goining to savetofile the VTree after each update to
the database, then for those frequent programs that just offer the
VTree as a reference to the database record can simply LoadFromFile
to save always reading the database at program startup (also this
VTree file would be offered from the server by a TCP/IP program I
have written). Having the images as well rather than building the
TImageList each time would be a great help...any way of doing this?
Also I have done some timings on LoadFromFile and it is pretty
impressive but this is not on live data...am I right in assuming that
SaveToFile and LoadFromFile are very efficient and the right way to
go?
Sorry for taking your time
Regards
David


re: OnClick/OnChange confusions...

From: [dave@b...]
Date: Tue Mar 27, 2001 1:21 am
Subject: Re: OnClick/OnChange confusions...

> Why don't you use OnMouseDown Event (eventualy coupled with
> OnMouseUp

Thanks. This works well.

Dave


IDataObject and DoDragDrop

From: [jimdk@m...]
Date: Tue Mar 27, 2001 5:19 am
Subject: IDataObject and DoDragDrop

Yea, it's me again.

I don't see a way to take an IDataObject that I have recieved from a
shell namespace and pass it in the ActiveX.DoDragDrop() in DoDragging.
It appears the IDataObject is wrapped up in a TVTDragDropManager class
and it is using the class as the COM object. Anyone have a suggestion
how to do this?

Jim Kueneman

 | Replies | Author | Date
912 | Re: IDataObject and DoDragDrop | GIANNAKOPOULOS KOSTAS | Tue 3/27/2001
920 | Re: IDataObject and DoDragDrop | [jimdk@m...] | Tue 3/27/2001
962 | Re: IDataObject and DoDragDrop | [jimdk@m...] | Sat 3/31/2001
966 | Re: IDataObject and DoDragDrop | [jimdk@m...] | Sat 3/31/2001
932 | Re: IDataObject and DoDragDrop | Mike Lischke | Wed 3/28/2001
935 | Re: IDataObject and DoDragDrop | [jimdk@m...] | Wed 3/28/2001


re: $1 again

From: Mike Lischke [public@l...]
Date: Tue Mar 27, 2001 8:12 am
Subject: RE: [VirtualTreeview] $1 again

Hi Werner,

> I am experiencing strange things again and I can imagine that it
> might be a VTree problem. I am using the VTree here as a listview
> (that is only top level nodes are used). The problem occurs if
> the tree is to be sorted on its second column. Autosort option
> is turned off and this is the header click event :
>
> I am suspecting that FindInPositionCache et al. is to be blamed here
> again (I hope it since you said that you fixed that error, when do we
> get this version?).

Have you already downloaded version 2.3? Did it solve your problem here?

Ciao, Mike


re: processDrop problem

From: Mike Lischke [public@l...]
Date: Tue Mar 27, 2001 8:14 am
Subject: RE: [VirtualTreeview] processDrop problem

Hi Koen,

> I'm trying to implement drag and drop in the same virtualtreeview to
> allow users reordering their data, so I have only one virtualtreeview
> in my program and I don't want to drop other things in it, only copy
> or move within the treeview.
>
> As a test, I took the "minimal" demo provided with virtualtreeview
> and added the procedure VTDragDrop (see below) as stated in the help
> file. I also set dragmode to dmAutomatic. When I try to drag and
> drop, Sender.ProcessDrop(DataObject, Sender.DropTargetNode, Effect,
> AttachMode); returns false and nothing happens. I tried version 1.31
> and 2.3b but no success. (I'm using Delphi 5)

Mmh, the code looks fine so far. Please download the OLE demo from YG. This
little program shows dd and cut/copy/paste in action. So you might find
there what's wrong. Please let me know once you have figured out the
culprit.

Ciao, Mike

 | Replies | Author | Date
919 | Re: processDrop problem | Wez Furlong | Tue 3/27/2001
928 | Re: processDrop problem | [koeneijsvogels@h...] | Tue 3/27/2001


re: Kylix

From: Mike Lischke [public@l...]
Date: Tue Mar 27, 2001 8:24 am
Subject: RE: [VirtualTreeview] Kylix

Hi Geoffrey,

> Anyone tried porting?. Any suggestions on where the main
> issues are expected to be?

Porting will be difficult. It could even be it becomes a major rewrite.
Firstly, however, I have not yet installed my Linux system and am still
waiting for a Kylix copy (it is promised to me for the beginning of April,
though). Once the installation is done I have to get used to Linux, I guess.
And I don't know how long this may take until I can be productive there.
Currently I don't feel very much motivation to try it out as I'm very
satisfied with Windows 2000. Basically, I don't want to figure out which
driver I have to compile in my kernel or similar strange things, if you know
what I mean :o]

Currently, I'm an eager listener in the Kylix newsgroups and what I read so
far is not very encouraging. VT, as so many window controls, depends heavily
on messages. But messages are not available under Linux. Perhaps Qt provides
a wrapper for events but I don't know exactly. Another point is that OLE is
not available with Linux and I have not investigated what equivalent there
is.

Probably it is easier to port VT to Delphi 6 first to have all the changes
in CLX under consideration. Moving the result to Kylix later on should then
not be so adventurous as it seems currently.

To sum up: expect several months to elapse until there is a first Kylix
version of VT.

Ciao, Mike

 | Replies | Author | Date
1062 | Re: Kylix | [rob@f...] | Thu 4/5/2001
1064 | Re: Kylix | Geoffrey Pan | Thu 4/5/2001
1066 | Re: Kylix | GIANNAKOPOULOS KOSTAS | Fri 4/6/2001
1067 | Re: Kylix | Mike Lischke | Fri 4/6/2001
1069 | Re: Kylix | Mike Lischke | Fri 4/6/2001
1070 | Re: Kylix | GIANNAKOPOULOS KOSTAS | Fri 4/6/2001
4401 | Kylix | [M@r...] | Fri 11/2/2001
4405 | Re: Kylix | Helge Jung (ECO-Logic) | Fri 11/2/2001
4404 | Re: Kylix | Werner Lehmann | Fri 11/2/2001


re: 2 questions

From: Mike Lischke [public@l...]
Date: Tue Mar 27, 2001 8:41 am
Subject: RE: [VirtualTreeview] 2 questions

Hi Dave,

> I would like to use the hot-tracking feature, but there are
> certain node
> types which I do not want to be hot tracked (i.e. no cursor change).
> Specifically, I'm displaying folders, and documents within
> folders. I don't
> want a folder to be hot tracked - only documents.

For avoiding the underline of a hot node use OnPaintText and remove the
fsUnderline style of the canvas' font. For the cursor I think OnHotChange is
sufficient, where you can set the hot cursor according to the current node.

Ciao, Mike

 | Replies | Author | Date
925 | Re: 2 questions | [dave@b...] | Tue 3/27/2001
927 | Re: 2 questions | Mike Lischke | Tue 3/27/2001


Download problems

From: Joachim Rupik [JRupik@a...]
Date: Tue Mar 27, 2001 8:43 am
Subject: Download problems

Hello Mike,

Could you update VirtualTreeview files on your home page also?
I have problems with file download from Yahoo Groups.

Greetings,
Joachim Rupik
[jrupik@a...]

 | Replies | Author | Date
914 | Re: Download problems | Malcolm Smith | Tue 3/27/2001
915 | Re: Download problems | Mike Lischke | Tue 3/27/2001
916 | Re: Download problems | Malcolm Smith | Tue 3/27/2001
917 | Re: Download problems | Joachim Rupik | Tue 3/27/2001
922 | Re: Download problems | Werner Lehmann | Tue 3/27/2001


re: IDataObject and DoDragDrop

From: GIANNAKOPOULOS KOSTAS [kyan@s...]
Date: Tue Mar 27, 2001 8:46 am
Subject: RE: [VirtualTreeview] IDataObject and DoDragDrop

One way to do this is a kind of "aggregation".
You could override the QueryInterface method of the TVTDragDropManager so
that it returns the interface pointers of the ShellFolder object instead of
the ones implemented in TVTDragDropManager. An easier way to do this is to
use the implements keyword like this:

type
TShellDragDropManager = class(TVTDragDropManager, IDataObject, IDropTarget)
private
FShellFolder: IShellFolder;
FDataObject: IDataObject;
FDropTarget: IDropTarget;
FID: PItemIDList;
protected
property DataObject: IDataObject read FDataObject implements IDataObject;
property DropTarget: IDropTarget read FDropTarget implements IDropTarget;
public
constructor Create(AOwner: TBaseVirtualTree); override;
end;

constructor TShellDragDropManager.Create(AOwner: TBaseVirtualTree);
begin
inherited;

{ Fill FSHellFolder and FID form the tree's selection }

OleCheck(FShellFolder.GetUIObjectOf(0, 1, FID, IDataObject, nil,
FDataObject));
OleCheck(FShellFolder.GetUIObjectOf(0, 1, FID, IDropTarget, nil,
FDropTarget));
end;

This (dirty) trick will make TShellDragDropManager behave like the
underlying dataobject & droptarget of the shell item. However, since the
inner object is unaware of the fact that it is being "aggregated", the trick
might fail.
A cleaner way to do it is to statically override all methods of IDataObject
and IDropTarget and have them delegate to the shell item's interfaces like
this:

function TShellDragDropManager.GetData(const FormatEtcIn: TFormatEtc; out
Medium: TStgMedium): HResult;
begin
Result := FDataObject.GetData(FormatEtcIn, Medium);
end;

I would try the 1st (easier to type) and if it failed i would do the 2nd
(which can't fail).

> -----Original Message-----
> From: [jimdk@m...] [mailto:[jimdk@m...]]
> Sent: Tuesday, March 27, 2001 8:20 AM
> To: [VirtualTreeview@yahoogroups.com
> Subject: [VirtualTreeview] IDataObject and DoDragDrop
>
>
>
> Yea, it's me again.
>
> I don't see a way to take an IDataObject that I have recieved from a
> shell namespace and pass it in the ActiveX.DoDragDrop() in
> DoDragging.
> It appears the IDataObject is wrapped up in a
> TVTDragDropManager class
> and it is using the class as the COM object. Anyone have a
> suggestion
> how to do this?
>
> Jim Kueneman
>
>
> ------------------------ Yahoo! Groups Sponsor
> ---------------------~-~>
> Do you have 128-bit SSL encryption server security?
> Get VeriSign's FREE Guide, "Securing Your
> Web Site for Business." Get it now!
> http://us.click.yahoo.com/2cW4jC/c.WCAA/bT0EAA/iObVlB/TM
> --------------------------------------------------------------
> -------_->
>
> To unsubscribe from this group, send an email to:
> [VirtualTreeview-unsubscribe@egroups.com
>
>
>
> Your use of Yahoo! Groups is subject to
> http://docs.yahoo.com/info/terms/
>
>

Replies | Author | Date
920 | Re: IDataObject and DoDragDrop | [jimdk@m...] | Tue 3/27/2001


re: OnClick/OnChange confusions...

From: Mike Lischke [public@l...]
Date: Tue Mar 27, 2001 8:46 am
Subject: RE: [VirtualTreeview] OnClick/OnChange confusions...

> The other problem I have with OnClick is this. I'm trying to
> eliminate the need for any double-clicks in our app. So, I'd like to
> make single-click on a Folder node expand/contract that folder.
> Sounds simple enough to handle in OnClick:
>
> Node := Tree.FocusedNode;
> if [Node is Folder] then
> Tree.ToggleNode(Node);
>
> But once again I'm bitten by the fact that clicking on the +/- button
> of a parent node will call OnClick. What happens with this code is
> that you click on the node text and it works fine, but if you click
> on the +/-, the Tree internally expands/contracts the node, then
> calls OnClick. Then my code calls ToggleNode, resulting in the node
> going back to it's original state before you clicked. In other words,
> it flops open then closes again, or vice-versa - depending on it's
> state when you click it.

Avoid explicitely setting the expand state in your application. Let the tree
do the work for you:

1) remove the voToggleOnDblClick option
2) add voAutoExpand option, this will cause a node to expand when it gets
the focus (on click or key navigation) and close when it looses the focus
3) use OnExpanding/OnCollapsing to determine which node can actually expand
or collapse

Ciao, Mike


re: Download problems

From: "Malcolm Smith" [mjfreelancing@o...]
Date: Tue Mar 27, 2001 8:57 am
Subject: RE: [VirtualTreeview] Download problems

I also have trouble downloading the files.

Mal

MJ Freelancing
http://www.mjfreelancing.com
ABN: 30 671 763 146

CORintel
ABN: 30 336 110 329

-----Original Message-----
From: Joachim Rupik [mailto:[JRupik@a...]]
Sent: Tuesday, 27 March 2001 18:44
To: [VirtualTreeview@yahoogroups.com
Subject: [VirtualTreeview] Download problems

Hello Mike,

Could you update VirtualTreeview files on your home page also?
I have problems with file download from Yahoo Groups.

Greetings,
Joachim Rupik
jrupik@a...]

To unsubscribe from this group, send an email to:
VirtualTreeview-unsubscribe@egroups.com

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/


re: Download problems

From: Mike Lischke [public@l...]
Date: Tue Mar 27, 2001 8:55 am
Subject: RE: [VirtualTreeview] Download problems

> I also have trouble downloading the files.
>
> Mal
>
> Could you update VirtualTreeview files on your home page also?
> I have problems with file download from Yahoo Groups.

You have an empty zip file when clicking VirtualTreeview.zip on
http://groups.yahoo.com/group/VirtualTreeview/files/, right? Try a right
click on the link (Internet Explorer) and "Save target as...".

And no, I cannot update my homepage. The version on YG is a prerelease
(beta). Before I can update the homepage I have to upate the demos, the help
files (two versions plus online copy) and the www page should also reflect
what has changed. Additionally I want to introduce a VT gallery. More than
enough work, I think :-)

Ciao, Mike

 | Replies | Author | Date
916 | Re: Download problems | Malcolm Smith | Tue 3/27/2001


re: Download problems

From: "Malcolm Smith" [mjfreelancing@o...]
Date: Tue Mar 27, 2001 9:09 am
Subject: RE: [VirtualTreeview] Download problems

I have an application installed called ZipMagic that has a Download
assistant and for some reason it always reports it cannot download the page
because it thinks it is a HTML page. Weird.

I tried disabling it but it seems to come back to life again ;-)

Mal

MJ Freelancing
http://www.mjfreelancing.com
ABN: 30 671 763 146

CORintel
ABN: 30 336 110 329

-----Original Message-----
From: Mike Lischke [mailto:[public@l...]]
Sent: Tuesday, 27 March 2001 18:55
To: 'VirtualTreeview@yahoogroups.com'
Subject: RE: [VirtualTreeview] Download problems

> I also have trouble downloading the files.
>
> Mal
>
> Could you update VirtualTreeview files on your home page also?
> I have problems with file download from Yahoo Groups.

You have an empty zip file when clicking VirtualTreeview.zip on
http://groups.yahoo.com/group/VirtualTreeview/files/, right? Try a right
click on the link (Internet Explorer) and "Save target as...".

And no, I cannot update my homepage. The version on YG is a prerelease
(beta). Before I can update the homepage I have to upate the demos, the help
files (two versions plus online copy) and the www page should also reflect
what has changed. Additionally I want to introduce a VT gallery. More than
enough work, I think :-)

Ciao, Mike

To unsubscribe from this group, send an email to:
VirtualTreeview-unsubscribe@egroups.com

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/


re: Download problems

From: Joachim Rupik [JRupik@a...]
Date: Tue Mar 27, 2001 9:38 am
Subject: Re: [VirtualTreeview] Download problems

Hello,

> You have an empty zip file when clicking VirtualTreeview.zip on
> http://groups.yahoo.com/group/VirtualTreeview/files/, right? Try a right
> click on the link (Internet Explorer) and "Save target as...".

No, no. I know "browser click philosophy" ;-).
I have very unstable transfer speed, so I try to use GetRight to do it,
but to download files from yahoo you must be logged in and it is performed
not by the usual way (like http or ftp authorization). So, even GetRight gives
up.

Greetings,
Joachim Rupik
[jrupik@a...]


re: $1 again

From: [zh66w6@h...]
Date: Tue Mar 27, 2001 10:30 am
Subject: Re: $1 again

--- In [VirtualTreeview@y...], "Mike Lischke" [public@l...] wrote:
> Hi Robert,
>
> > Sorry but I just installed version 2.3 and it is still getting
out of sync
> > when I start to sort on different columns and sort orders.
>
> This is more than strange. Are you sure you have rebuild your
package and dcu and also use the
> correct version of VT? I need a demo project which shows the
problem so I can debug it. Since I have
> fixed the cache code I have never seen this effect in any of the
application which use VT regardless
> of what I tried.
>
> Ciao, Mike

Hi Mike,

I think I'm experiencing the same problem. I have written a simple
program to load all the filenames from a directory (and it's
children) into a simple treeview (viewed as a listview). When I sort
by column with many nodes (>10000) I end up with a big gap in the
tree. Also, if I make some of the nodes invisible (e.g. only show
certain file types) they disappear, but the position they were in
remains i.e if no nodes are visible, you can still scroll a blank
treeview. Hope this makes sense. I will upload the source to the
files section so you can have an example of what I'm talking about.

Cheers,
Paul T.


re: processDrop problem

From: Wez Furlong [wez.egroups@t...]
Date: Tue Mar 27, 2001 10:13 am
Subject: RE: [VirtualTreeview] processDrop problem

On 2001-03-27 09:14:33, "Mike Lischke" wrote:
> > I'm trying to implement drag and drop in the same virtualtreeview to
> > allow users reordering their data, so I have only one virtualtreeview
> > in my program and I don't want to drop other things in it, only copy
> > or move within the treeview.
> >
> > As a test, I took the "minimal" demo provided with virtualtreeview
> > and added the procedure VTDragDrop (see below) as stated in the help
> > file. I also set dragmode to dmAutomatic. When I try to drag and
> > drop, Sender.ProcessDrop(DataObject, Sender.DropTargetNode, Effect,
> > AttachMode); returns false and nothing happens. I tried version 1.31
> > and 2.3b but no success. (I'm using Delphi 5)
>
> Mmh, the code looks fine so far. Please download the OLE demo from YG. This
> little program shows dd and cut/copy/paste in action. So you might find
> there what's wrong. Please let me know once you have figured out the
> culprit.

I think I also found this problem and solved it by forcing the AttachMode not
to be amNowhere.
Now, I'm not 100% sure if that will fix it, but that is what I recall doing...

procedure TWorkSpaceForm.VSTDragDrop(Sender: TBaseVirtualTree;
Source: TObject; DataObject: IDataObject; const Formats: array of Word;
Shift: TShiftState; Pt: TPoint; var Effect: Integer; Mode: TDropMode);
var
i: Integer;
AttachMode: TVTNodeAttachMode;
begin
if Length(Formats) > 0 then begin
// OLE drag and drop
for i := 0 to High(Formats) do if Formats[i] = CF_VIRTUALTREE then begin
case Mode of
dmAbove: AttachMode := amInsertBefore;
dmOnNode: AttachMode := amAddChildLast;
dmBelow: AttachMode := amInsertAfter;
else
if Assigned(Source) and (Source is TBaseVirtualTree) and (Sender <>
Source)
then
AttachMode := amInsertBefore
else
AttachMode := amNowhere;
end;
Effect := DROPEFFECT_MOVE;
{ The next 2 lines might do the trick }
if Sender.DropTargetNode = nil then
AttachMode := amInsertBefore;
Sender.ProcessDrop(DataObject, Sender.DropTargetNode, Effect, AttachMode);
Break;
end;
end;
end;

--Wez.

 | Replies | Author | Date
928 | Re: processDrop problem | [koeneijsvogels@h...] | Tue 3/27/2001


re: IDataObject and DoDragDrop

From: [jimdk@m...]
Date: Tue Mar 27, 2001 12:31 pm
Subject: Re: IDataObject and DoDragDrop

--- In [VirtualTreeview@y...], GIANNAKOPOULOS KOSTAS [kyan@s...] wrote:
> One way to do this is a kind of "aggregation".
> You could override the QueryInterface method of the
TVTDragDropManager so

> A cleaner way to do it is to statically override all methods of
IDataObject
> and IDropTarget and have them delegate to the shell item's
interfaces like

I knew it would be like squashing a fly with a sledghammer with the
IDataObjet <g>. There were enough hooks in VT to splice in the
IDropTarget interface fairly cleanly.

I'll give it a go.

Thanks,
Jim Kueneman


Explorer VT and shell functions

From: [ebolefeysot@b...]
Date: Tue Mar 27, 2001 3:33 pm
Subject: Explorer VT and shell functions

Hi all

I'm actually experiencing problem with my component, and I thing the
same could happen to the explorer VT if someone add the delete shell
function.

I would like to know the correct way to do that , Mike.

Imagine:
the vtv is displayed with files. I select on file and click delete
file. The file will be deleted.
between the moment when I click and the moment the file is deleted,
what happen to the treeview?
If the file is big and It takes 10 sec to delete it. I have time to
overlap the treeview with another window. When the treeview will
display again, some event will be fired: ongettext. Now what happens
for the ongettext on this deleted file ? access vilation because the
file does not exist anymore ?
I can't remove the node before deleting the file because I don't know
if the deletion will succeed.
What is the right method ? beginupdate? or something else?

Thanks

--
Eric

 | Replies | Author | Date
934 | Re: Explorer VT and shell functions | Mike Lischke | Wed 3/28/2001
938 | Re: Explorer VT and shell functions | [ebolefeysot@b...] | Wed 3/28/2001


re: Download problems

From: Werner Lehmann [wl@b...]
Date: Tue Mar 27, 2001 4:52 pm
Subject: Re: [VirtualTreeview] Download problems

Malcolm Smith wrote:
>
> I have an application installed called ZipMagic that has a Download
> assistant and for some reason it always reports it cannot download the page
> because it thinks it is a HTML page. Weird.
>
> I tried disabling it but it seems to come back to life again ;-)

The reason why your download managers do not work is probably that
YG uses either cookies and your DM does not support them or you get
a session ID after you manually log in (which may be shown in the
URL but can also be passed on hidden via HTTP POST). In the latter
case your download manager 'fails' to fill out the login form.

Pain in the... you know where. Not much to do against it.

Werner


re: Re: $1 again

From: Werner Lehmann [wl@b...]
Date: Tue Mar 27, 2001 5:44 pm
Subject: Re: [VirtualTreeview] Re: $1 again

Paul,

[zh66w6@h...] wrote:
>
> I think I'm experiencing the same problem. I have written a simple
> program to load all the filenames from a directory (and it's
> children) into a simple treeview (viewed as a listview). When I sort
> by column with many nodes (>10000) I end up with a big gap in the
> tree. Also, if I make some of the nodes invisible (e.g. only show
> certain file types) they disappear, but the position they were in
> remains i.e if no nodes are visible, you can still scroll a blank
> treeview. Hope this makes sense. I will upload the source to the
> files section so you can have an example of what I'm talking about.

if I understood you correctly the problems occurs even if you don't
change the visibility state of nodes. Is it really dependant on the
number of nodes? My test case contains not more than 2300 nodes.

Please upload your demo as my code can not be isolated easily.

Regards,
Werner


re: $1 again

From: Werner Lehmann [wl@b...]
Date: Tue Mar 27, 2001 5:41 pm
Subject: Re: [VirtualTreeview] $1 again

Hi Mike,

Mike Lischke wrote:
>
> > I am suspecting that FindInPositionCache et al. is to be blamed here
> > again (I hope it since you said that you fixed that error, when do we
> > get this version?).
>
> Have you already downloaded version 2.3? Did it solve your problem here?

Sorry, but I was away for some days. I just checked out 2.3 and no,
the problem stayed. I will continue to investigate it but this may
take a while since I have not much ideas where to start in the first
place.

I am not fully convinced that really the VTree must be responsible because
the effect seems to be dependent on the column which is sorted (but at least
there are 2 other ppl with the same problem).

In my case mainly column 2 and 3 (starting with column 1 as MainColumn) are
affected. If I sort col #2 the first time I get only one visible node, then
a gap and at the bottom some 10 nodes again. On second sort I see some more
nodes at the top before the gap comes. Curiously, the first node never
changes although it should.

I have not tried to isolate some problem code as this would be a major
undertaking. I also have not tried to make a small demo program since
I am pretty sure that the problem would have been noticed by you already
if it surfaced there.

My hopes lie on Paul T. who offered to upload a demo of the problem.

Regards,
Werner

 | Replies | Author | Date
926 | Re: $1 again | Mike Lischke | Tue 3/27/2001


re: 2 questions

From: [dave@b...]
Date: Tue Mar 27, 2001 6:15 pm
Subject: Re: 2 questions

> For the cursor I think OnHotChange is
> sufficient, where you can set the hot cursor according
> to the current node.

Hmmm - I don't see how that's possible. In OnHotChange, you pass a
copy of the pointer to the node, and there's no way in that event to
tell the tree that the node shouldn't be hot. And, since the cursor
is set during the WM_SETCURSOR code in the treeview, it always checks
the node itself.

So I'm not sure what you mean by "you can set the hot cursor".

Thanks,
Dave

 | Replies | Author | Date
927 | Re: 2 questions | Mike Lischke | Tue 3/27/2001


re: $1 again

From: "Mike Lischke" [public@l...]
Date: Tue Mar 27, 2001 7:21 pm
Subject: RE: [VirtualTreeview] $1 again

Hi Werner,

> Sorry, but I was away for some days. I just checked out 2.3 and no,
> the problem stayed. I will continue to investigate it but this may
> take a while since I have not much ideas where to start in the first
> place.
>
> My hopes lie on Paul T. who offered to upload a demo of the problem.

I found the bug today and it is my fault. The reason is quite simple and I
really wonder why I
haven't found it earlier. Paul's demo was what helped me to find the problem
(he send me a private
copy).

It is simply that the cache is not rebuild after a column is sorted. A node
which was previously the
first/top node might now be the last one while it is still mentioned as the
first one in the cache.
GetNodeAt finds this node still as top node but there is no further sibling
anymore which led to the
empty tree. This was a bug which has been always there since the sort was
implemented, but I don't
use this feature very much (it is counter productive because it requires every
visible node to be
initialized), so I never came across... I doubt, however, that this has
something to do with the $1
problem, only with the partially empty tree. It looks as if I still have to
knock down this annoying
issue. I need a simple project however, which shows it reproducible.

Sorry for the trouble.

Ciao, Mike


re: Re: 2 questions

From: "Mike Lischke" [public@l...]
Date: Tue Mar 27, 2001 7:23 pm
Subject: RE: [VirtualTreeview] Re: 2 questions

> Hmmm - I don't see how that's possible. In OnHotChange, you pass a
> copy of the pointer to the node, and there's no way in that event to
> tell the tree that the node shouldn't be hot. And, since the cursor
> is set during the WM_SETCURSOR code in the treeview, it always checks
> the node itself.
>
> So I'm not sure what you mean by "you can set the hot cursor".

My idea is to pretend there is no hot node buy resetting the "hot" properties
selectively.
Underlining can be reset in OnPaintText and the cursor can be changed in
OnHotChange (there is a
property Tree.HotCursor which is used in WM_SETCURSOR).

Ciao, Mike


re: processDrop problem

From: [koeneijsvogels@h...]
Date: Tue Mar 27, 2001 8:07 pm
Subject: Re: processDrop problem

Hi,

I tried the OLE demo. A very strange thing happened: the EXE demo in
the zip worked fine. If I compile the source, then the dragging and
dropping won't work (copy/past does work but dragging not). Again I
tried version 1.31 and 2.3b of VirtualTreeView.

I use delphi 5.0, enterprise edition, service update 1. Compiling
does not give errors or warnings.

With version 1.31 I can drag
and drop, the "drag'n drop operation log" shows the right stuff (as
if every thing goes right) but the new node/item does not appear in
the target nor does if disappear from the source.

With version 2.3b, I can not even drop. The icon changes to
crDropNoIcon....

Bottom line: the executable in the zip does work -> not Windows fault
the executable after compiling doesn't work -> error in
compiler/other unit, wrong settings, error in unit VirtualTreeView?

I really don't know what th problem is. I hope someone can help me.

Thanks...

Koen

--- In [VirtualTreeview@y...], Wez Furlong [wez.egroups@t...] wrote:
>
> On 2001-03-27 09:14:33, "Mike Lischke" wrote:
> > > I'm trying to implement drag and drop in the same
virtualtreeview to
> > > allow users reordering their data, so I have only one
virtualtreeview
> > > in my program and I don't want to drop other things in it, only
copy
> > > or move within the treeview.
> > >
> > > As a test, I took the "minimal" demo provided with
virtualtreeview
> > > and added the procedure VTDragDrop (see below) as stated in the
help
> > > file. I also set dragmode to dmAutomatic. When I try to drag
and
> > > drop, Sender.ProcessDrop(DataObject, Sender.DropTargetNode,
Effect,
> > > AttachMode); returns false and nothing happens. I tried version
1.31
> > > and 2.3b but no success. (I'm using Delphi 5)
> >
> > Mmh, the code looks fine so far. Please download the OLE demo
from YG. This
> > little program shows dd and cut/copy/paste in action. So you
might find
> > there what's wrong. Please let me know once you have figured out
the
> > culprit.
>
> I think I also found this problem and solved it by forcing the
AttachMode not to be amNowhere.
> Now, I'm not 100% sure if that will fix it, but that is what I
recall doing...
>
> procedure TWorkSpaceForm.VSTDragDrop(Sender: TBaseVirtualTree;
> Source: TObject; DataObject: IDataObject; const Formats: array of
Word;
> Shift: TShiftState; Pt: TPoint; var Effect: Integer; Mode:
TDropMode);
> var
> i: Integer;
> AttachMode: TVTNodeAttachMode;
> begin
> if Length(Formats) > 0 then begin
> // OLE drag and drop
> for i := 0 to High(Formats) do if Formats[i] = CF_VIRTUALTREE
then begin
> case Mode of
> dmAbove: AttachMode := amInsertBefore;
> dmOnNode: AttachMode := amAddChildLast;
> dmBelow: AttachMode := amInsertAfter;
> else
> if Assigned(Source) and (Source is TBaseVirtualTree)
and (Sender <> Source)
> then
> AttachMode := amInsertBefore
> else
> AttachMode := amNowhere;
> end;
> Effect := DROPEFFECT_MOVE;
> { The next 2 lines might do the trick }
> if Sender.DropTargetNode = nil then
> AttachMode := amInsertBefore;
> Sender.ProcessDrop(DataObject, Sender.DropTargetNode, Effect,
AttachMode);
> Break;
> end;
> end;
> end;
>
> --Wez.


re: Re: Explorer VT

From: Mike Lischke [public@l...]
Date: Wed Mar 28, 2001 9:31 am
Subject: RE: [VirtualTreeview] Re: Explorer VT

Hi Jim,

> Can you elaborate more. Is it when it is enumerating the folder,
> getting images and text or ??? By after a while do you mean it has
> successfully displayed the image or text a number of times before it
> fails?

Initializing goes actually fine, but when scrolling through the tree and
viewing a couple of thousands of nodes then suddenly the PSICON.dll error
message appears. Since you retrieve everything on the fly (icons, text) it
cannot be a resource problem because you have stored to many entries. It
seems rather not everything which should is freed correctly.

> Also I finally used the D&D image code on a MMX machine.
> Looks nice. I have found a auto scroll bug that I can't reproduce every
> time.

This bug is easily reproducible but unfortunately not as easy to fix. I will
keep that in mind but can't currently work on it.

Ciao, Mike


re: Re: Simple Question

From: Mike Lischke [public@l...]
Date: Wed Mar 28, 2001 9:42 am
Subject: RE: [VirtualTreeview] Re: Simple Question

Hi David,

> type (around 20) has its own image to show on the tree. Once the type
> and its associated image has been defined it is relatively static and
> maybe only changed every now and then by the user. Is there a way to
> store these images in the VTree. My thinking is this: as the display
> of the Vtree is used much more frequently than changes to the
> database, I was goining to savetofile the VTree after each update to
> the database, ...

Why saving to a file? I would do the same way as the Explorer does (at least
it looks as would it go this way). Every node contains an ID for the image
of the associated data/table. When it needs to be displayed then a cache is
queried whether this image is available in the tree's image list. If yes
then the corresponding index is returned which can be given to the tree (and
is stored in the node's data record). If not then the image is retrieved
from somewhere (the database as well?) and added to the image list.

If somebody changes an image then it is simply replaced in the image list.
Perhaps the cache must be updated as well to reflect a changed image ID (if
there was one).

Ciao, Mike


re: $1 again

From: Werner Lehmann [wl@b...]
Date: Wed Mar 28, 2001 8:53 am
Subject: Re: [VirtualTreeview] $1 again

Mike Lischke wrote:
>
> I found the bug today and it is my fault. The reason is quite simple and I
really wonder why I
> haven't found it earlier. Paul's demo was what helped me to find the problem
(he send me a private
> copy).

Very good.

> It is simply that the cache is not rebuild after a column is sorted. A node
which was previously the
> first/top node might now be the last one while it is still mentioned as the
first one in the cache.
> GetNodeAt finds this node still as top node but there is no further sibling
anymore which led to the
> empty tree. This was a bug which has been always there since the sort was
implemented, but I don't
> use this feature very much (it is counter productive because it requires
every visible node to be
> initialized), so I never came across... I doubt, however, that this has
something to do with the $1
> problem, only with the partially empty tree. It looks as if I still have to
knock down this annoying
> issue. I need a simple project however, which shows it reproducible.

I understand your concerns about virtual vs sort of course. But users want to
sort with
a click on the header as a matter of fact. And even with some 15,000 nodes I
notice only
a delay of 1 or 2 seconds, usually it is not even noticeable.

> Sorry for the trouble.

Never mind, I am glad that this one is fixed. BTW, do you really think that the
$1 issue
is unaffected by this fix? I get that problem only after I click on some (all?)
of the
nodes when that sort problem occurred.

Regards,
Werner


re: IDataObject and DoDragDrop

From: Mike Lischke [public@l...]
Date: Wed Mar 28, 2001 9:48 am
Subject: RE: [VirtualTreeview] IDataObject and DoDragDrop

Hi Jim,

> I don't see a way to take an IDataObject that I have recieved from a
> shell namespace and pass it in the ActiveX.DoDragDrop() in
> DoDragging.
> It appears the IDataObject is wrapped up in a TVTDragDropManager class
> and it is using the class as the COM object. Anyone have a
> suggestion how to do this?

I'm not sure you really want that. The IDataObject is passed to the tree by
the OLE subsystem via IDropTarget.DragEnter and Drop. TVTDragDropManager as
the responsible part for this stuff passes the data object to the tree where
you then can do everything you need, like getting the availabel data
formats. This is so simple and does not require much extra work on your
side. With the given data object you can also set the drop effect as I
already described earlier.

Ciao, Mike

 | Replies | Author | Date
935 | Re: IDataObject and DoDragDrop | [jimdk@m...] | Wed 3/28/2001


re: $1 again

From: Mike Lischke [public@l...]
Date: Wed Mar 28, 2001 10:10 am
Subject: RE: [VirtualTreeview] $1 again

> Never mind, I am glad that this one is fixed. BTW, do you
> really think that the $1 issue
> is unaffected by this fix? I get that problem only after I
> click on some (all?) of the
> nodes when that sort problem occurred.

Difficult to say, try it out. But even if the problem does not appear
anymore I can never say it is really fixed until I find the place where it
results from (remember, I did not get this error until now).

Ciao, Mike


re: Explorer VT and shell functions

From: Mike Lischke [public@l...]
Date: Wed Mar 28, 2001 10:25 am
Subject: RE: [VirtualTreeview] Explorer VT and shell functions

Hi Eric,

> the vtv is displayed with files. I select on file and click delete
> file. The file will be deleted.
> between the moment when I click and the moment the file is deleted,
> what happen to the treeview?
> If the file is big and It takes 10 sec to delete it. I have time to
> overlap the treeview with another window. When the treeview will
> display again, some event will be fired: ongettext. Now what happens
> for the ongettext on this deleted file ? access vilation because the
> file does not exist anymore ?
> I can't remove the node before deleting the file because I don't know
> if the deletion will succeed.
> What is the right method ? beginupdate? or something else?

There are actually two problems here. Firstly, you implicitly assumes that
OnGetText will access the physical file. While this is quite memory saving
it is also slow. I would always cache the name and image index of the
file/folder in the node's data record. This will also solve the problem that
a file is not accessible, be it because it is being deleted or it is on
remote storage (ftp, www etc.).

The second problem is that obviously DeleteFile (or the shell equivalent,
don't know what you are using) does not block the application but works
asynchroniously. Although I expected the operation to be synchron (in which
case you would not have a problem) it isn't all that serious. In order to
keep synchronized with the file system you will have installed some shell
notifications anyway, right? So I would not care about the outcome of the
delete operation (except errors) and just rely on the shell notification
which is triggered by the file deletion operation. This requires, however,
that your nodes operate independently of physical files.

Ciao, Mike

 | Replies | Author | Date
938 | Re: Explorer VT and shell functions | [ebolefeysot@b...] | Wed 3/28/2001


re: IDataObject and DoDragDrop

From: [jimdk@m...]
Date: Wed Mar 28, 2001 1:37 pm
Subject: Re: IDataObject and DoDragDrop

--- In [VirtualTreeview@y...], Mike Lischke [public@l...] wrote:
> I'm not sure you really want that. The IDataObject is passed to the
tree by
> the OLE subsystem via IDropTarget.DragEnter and Drop.
TVTDragDropManager as

Agreed, I have easily hooked into the DragEnter, and Drop for each
node and pass the IDataObject that I recieved from the namespace and
all works fine within the tree. Where the problem lies is when I drag
out side of a VT. I can't drop a file in explorer, the desktop or
any other application, unless the IDropTarget has the ShellIDList
clipboard format (or hDrop). The IDataObject is already set up
correctly when when I recieve it from the namespace (expecially from
the recycle bin that one contain the info to remap the file names) and
it is silly (or impossible as in the case of the recycle bin) to try
to duplicate the effort already done by the namespace. So all I
really need to do is pass the IDataObject in the ActiveX.DoDragDrop
and all work perfectly. The Shell Treeview really only needs to be a
conduit to retrive initialized IDataObjects and pass them to the
correct place, it really does not need to deal with the inner workings
of at all.

Jim Kueneman


ReFresh Error while dragging?

From: Jack Foley [trivialriot@y...]
Date: Wed Mar 28, 2001 2:04 pm
Subject: ReFresh Error while dragging?

Hi everybody,

We discovered the following Drag'n'Drop behavior of
VirtualTree:

Dragging from one VT to another VT in another Window
(lying below) causes ReDraw Errors in the VT you drag
from (when the MouseCursor is over the second VT) -
Phuuu, quite difficult to explain, please take a look
at the attached Pic.

Is there a workaround by calling the refresh manually,
or can this be fixed?
Using VT 2.3ß.

Thanks,
Mike (Zinner)

__________________________________________________
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail.
http://personal.mail.yahoo.com/?.refer=text

[Non-text portions of this message have been removed]

 | Replies | Author | Date
942 | Re: ReFresh Error while dragging? | Mike Lischke | Thu 3/29/2001
946 | Re: ReFresh Error while dragging? | Werner Lehmann | Thu 3/29/2001
948 | Re: ReFresh Error while dragging? | Mike Lischke | Thu 3/29/2001


#2 ReFresh Error while dragging?

From: Jack Foley [trivialriot@y...]
Date: Wed Mar 28, 2001 2:09 pm
Subject: #2 ReFresh Error while dragging?

Hi again,

sorry, no attachments in Yahoogroups...

http://m2xp.com/various/DrawOverTopWindow.gif

regards from Vienna,
Mike

__________________________________________________
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail.
http://personal.mail.yahoo.com/?.refer=text


re: Explorer VT and shell functions

From: [ebolefeysot@b...]
Date: Wed Mar 28, 2001 2:40 pm
Subject: Re: Explorer VT and shell functions

Thanks Mike :)

--- In [VirtualTreeview@y...], Mike Lischke [public@l...] wrote:
> Hi Eric,
>
> > the vtv is displayed with files. I select on file and click
delete
> > file. The file will be deleted.
> > between the moment when I click and the moment the file is
deleted,
> > what happen to the treeview?
> > If the file is big and It takes 10 sec to delete it. I have time
to
> > overlap the treeview with another window. When the treeview will
> > display again, some event will be fired: ongettext. Now what
happens
> > for the ongettext on this deleted file ? access vilation because
the
> > file does not exist anymore ?
> > I can't remove the node before deleting the file because I don't
know
> > if the deletion will succeed.
> > What is the right method ? beginupdate? or something else?
>
> There are actually two problems here. Firstly, you implicitly
assumes that
> OnGetText will access the physical file. While this is quite memory
saving
> it is also slow. I would always cache the name and image index of
the
> file/folder in the node's data record. This will also solve the
problem that
> a file is not accessible, be it because it is being deleted or it
is on
> remote storage (ftp, www etc.).
>
> The second problem is that obviously DeleteFile (or the shell
equivalent,
> don't know what you are using) does not block the application but
works
> asynchroniously. Although I expected the operation to be synchron
(in which
> case you would not have a problem) it isn't all that serious. In
order to
> keep synchronized with the file system you will have installed some
shell
> notifications anyway, right? So I would not care about the outcome
of the
> delete operation (except errors) and just rely on the shell
notification
> which is triggered by the file deletion operation. This requires,
however,
> that your nodes operate independently of physical files.
>
> Ciao, Mike


Buttons disappeared.

From: [garycramblitt@e...]
Date: Thu Mar 29, 2001 2:51 am
Subject: Buttons disappeared.

When I upgraded to VT 2.3 beta, the buttons (plus/minus signs)
disappeared in my tree. So did the tree lines, so it no longer
appears as a tree at all, just a list. In
TBaseVirtualTree.PaintTree, I changed the line that reads

IsMainColumn := PaintInfo.Column = FHeader.FMainColumn;

to

IsMainColumn := (PaintInfo.Column = FHeader.FMainColumn) or
(PaintInfo.Column = -1);

This fixed the problem. Or was I doing something wrong that this
version unveiled? My tree does not have columns.

Gary

 | Replies | Author | Date
940 | Re: Buttons disappeared. | Mike Lischke | Thu 3/29/2001
949 | Re: Buttons disappeared. | [garycramblitt@e...] | Thu 3/29/2001
969 | Re: Buttons disappeared. | [garycramblitt@e...] | Sat 3/31/2001


re: Buttons disappeared.

From: Mike Lischke [public@l...]
Date: Thu Mar 29, 2001 7:28 am
Subject: RE: [VirtualTreeview] Buttons disappeared.

Hi Gary,

> IsMainColumn := (PaintInfo.Column = FHeader.FMainColumn) or
> (PaintInfo.Column = -1);
>
> This fixed the problem. Or was I doing something wrong that this
> version unveiled? My tree does not have columns.

Mmmh, strange. There was an omission in pre 2.3 where I forgot to initialize
the main column of the tree to -1 (NoColumn). But as this has been fixed it
should no longer be a problem. I wonder by what your problem could be
caused. Please check the value FHeader.FMainColumn in the code and check
also what value it has at design time.

Ciao, Mike

 | Replies | Author | Date
949 | Re: Buttons disappeared. | [garycramblitt@e...] | Thu 3/29/2001
969 | Re: Buttons disappeared. | [garycramblitt@e...] | Sat 3/31/2001


re: Re: processDrop problem

From: Mike Lischke [public@l...]
Date: Thu Mar 29, 2001 8:05 am
Subject: RE: [VirtualTreeview] Re: processDrop problem

Hi Koen,

> I tried the OLE demo. A very strange thing happened: the EXE demo in
> the zip worked fine. If I compile the source, then the dragging and
> dropping won't work (copy/past does work but dragging not). Again I
> tried version 1.31 and 2.3b of VirtualTreeView.

Sorry, but all the demos need restructuring. Provided I can some day manage
to finish bug removal I will focus on updating all the packages. But since I
want to lower the time I work on VT once the new version is officially out I
want to have it in a stable and bug free state as far as possible.

Ciao, Mike


re: ReFresh Error while dragging?

From: Mike Lischke [public@l...]
Date: Thu Mar 29, 2001 10:53 am
Subject: RE: [VirtualTreeview] ReFresh Error while dragging?

Hi Mike (Jack? What's your prefered name?),

> Dragging from one VT to another VT in another Window
> (lying below) causes ReDraw Errors in the VT you drag
> from (when the MouseCursor is over the second VT) -
> Phuuu, quite difficult to explain, please take a look
> at the attached Pic.

I'm investigating this problem. Looks quite difficult at the moment.

To all:
Does any of you know how to retrieve the visible part of a window on screen
(i.e., GetWindowRect exluding overlapping windows)? MSDN does not give any
useful answer so I asked this question in the news groups too. I don't know
yet what I should do if I don't get an answer or have to use some window
enumeration...

Ciao, Mike


NodeCopied

From: Tony Cardalda [software@z...]
Date: Thu Mar 29, 2001 1:17 pm
Subject: NodeCopied

When I trap the NodeCopied event then the new copied Node is passed as a
parameter.
But I cannot see which node has been copied.
The user NodeData is excluded from the copy )-:

How do I now what nodes have been copied in a Drag and Drop event
(DragType=dtOLE)?

Saludos,
Tony.

 | Replies | Author | Date
944 | Re: NodeCopied | Mike Lischke | Thu 3/29/2001
945 | Re: NodeCopied | Tony Cardalda | Thu 3/29/2001
947 | Re: NodeCopied | Mike Lischke | Thu 3/29/2001


re: NodeCopied

From: Mike Lischke [public@l...]
Date: Thu Mar 29, 2001 1:38 pm
Subject: RE: [VirtualTreeview] NodeCopied

Tony,

> When I trap the NodeCopied event then the new copied Node is
> passed as a parameter.
> But I cannot see which node has been copied.
> The user NodeData is excluded from the copy )-:
> How do I now what nodes have been copied in a Drag and Drop event
> (DragType=dtOLE)?

The tree does not tell you the old node in the event since this is redundant
information. If you have started the copy then you know the source because
you need it in CopyTo. If another application triggered the event then there
is no source node reachable from the target application.

Why do you need this info?

Ciao, Mike


re: NodeCopied

From: Tony Cardalda [software@z...]
Date: Thu Mar 29, 2001 2:11 pm
Subject: RE: [VirtualTreeview] NodeCopied

> The tree does not tell you the old node in the event since
> this is redundant
> information. If you have started the copy then you know the
> source because
> you need it in CopyTo. If another application triggered the
> event then there
> is no source node reachable from the target application.
>

I'm using a VST to visualize a kind of a TForm with components. Some
components can act as a container (like TPanel).
Each Node represents a TCompontent. If I want to duplicate some
components, I can drag and drop them to the desired node/component. The
tree will be built just fine; only the attached components are not
copied. I have to know what Component was bound to the node.
Is it possible to copy the user NodeData along with the Node?

Saludos,
Tony.


re: ReFresh Error while dragging?

From: Werner Lehmann [wl@b...]
Date: Thu Mar 29, 2001 2:31 pm
Subject: Re: [VirtualTreeview] ReFresh Error while dragging?

Mike Lischke wrote:
>
> To all:
> Does any of you know how to retrieve the visible part of a window on screen
> (i.e., GetWindowRect exluding overlapping windows)? MSDN does not give any
> useful answer so I asked this question in the news groups too. I don't know
> yet what I should do if I don't get an answer or have to use some window
> enumeration...

The resulting area may not be a rect but a region. I don't have the win32.hlp
file on this PC but I would look into the region functions. Probably there is
no function which does exactly what you want and the enumeration might be the
only solution (but not difficult, a (window)rect can be transformed to a region
and regions can be added and subtracted from each other).

Why do you need that? I believe it should be avoided to refresh only parts of
the screen in this way and to ignore the paint cliprect. Maybe you could just
store the latest cliprect on WM_PAINT in a private var and use that? Depends
on what you want to do.

Werner


re: NodeCopied

From: Mike Lischke [public@l...]
Date: Thu Mar 29, 2001 2:55 pm
Subject: RE: [VirtualTreeview] NodeCopied

> I have to know what Component was bound to the node.
> Is it possible to copy the user NodeData along with the Node?

Of course it is. Use OnSaveNode and OnLoadNode. These events are used to
create a stream which can be passed in drag'n drop as well as clipboard
operations. Use the name of the component to identify it, not its memory
location, unless you are always sure to work within one application and
components can never be freed during drag (sounds obvious, but I want have
to say it explictly).

Ciao, Mike


re: ReFresh Error while dragging?

From: Mike Lischke [public@l...]
Date: Thu Mar 29, 2001 3:04 pm
Subject: RE: [VirtualTreeview] ReFresh Error while dragging?

Hi Werner,

> Why do you need that? I believe it should be avoided to
> refresh only parts of the screen in this way and to ignore the paint
cliprect.
> Maybe you could just store the latest cliprect on WM_PAINT in a private
var and
> use that? Depends on what you want to do.

When you look into the drag code of VT then you will see that I do quite
complex region math to avoid changing parts of the screen which shouldn't be
changed. This works all fine and well as long as no other window overlapse
the client area of the tree window which shows currently a drag image. In
this case the drag image will restore what it "thinks" is the client area of
its tree window. Since this is covered by the other window the result is
desastrous.

The solution for this problem is to avoid destroying the drag image content
for parts covered by other windows. Hence I need the clip region of the tree
window which is really visible on screen.

I have btw. got a first idea by someone in the news groups. GetDCEx can be
used to return a device context for a window with the correct clip region.
Perhaps I have to invalidate the tree window first (without repainting),
retrieve the DC and validate it again (to avoid repaints by Windows).
Perhaps this isn't even needed, but it is faster than any enumeration. From
the DC I can get the current clip region which can then be combined with the
paint region in the drag image. I have to test this of course yet...

Ciao, Mike


re: Buttons disappeared.

From: [garycramblitt@e...]
Date: Thu Mar 29, 2001 10:22 pm
Subject: Re: Buttons disappeared.

--- In [VirtualTreeview@y...], Mike Lischke [public@l...] wrote:
> Hi Gary,
>
> > IsMainColumn := (PaintInfo.Column = FHeader.FMainColumn) or
> > (PaintInfo.Column = -1);
> >
> > This fixed the problem. Or was I doing something wrong that this
> > version unveiled? My tree does not have columns.
>
> Mmmh, strange. There was an omission in pre 2.3 where I forgot to initialize
> the main column of the tree to -1 (NoColumn). But as this has been fixed it
> should no longer be a problem. I wonder by what your problem could be
> caused. Please check the value FHeader.FMainColumn in the code and check
> also what value it has at design time.
>
> Ciao, Mike

At the statement I gave above, FHeader.FMainColumn is 0 and PaintInfo.Column is
-1. I am not using VT at design time. I have a descendent component created
at runtime. Hope that helps.

If I understand what you're saying, FHeader.FMainColumn should be initialized
to -1. I'll see if I can figure out why that is not happening.

Gary

 | Replies | Author | Date
969 | Re: Buttons disappeared. | [garycramblitt@e...] | Sat 3/31/2001


System imagelist with additional app icons

From: Werner Lehmann [wl@b...]
Date: Thu Mar 29, 2001 11:51 pm
Subject: System imagelist with additional app icons

Hi,

a while ago I was having the problem that an imagelist
property (be it VTree or a different component) can only
be the system imagelist or another one with application
supplied icons.

In VTree I could work around this with state images. But
only to a certain point. So I made a little TImageList
descendant which copies the system images on the fly when
they are requested. It can contain others images which
must be added before the first system image is requested
(design or runtime). No big deal but useful. If someone
wants to have the component just ask.

Regards,
Werner

 | Replies | Author | Date
953 | Re: System imagelist with additional app icons | [adembaba@e...] | Fri 3/30/2001
956 | Re: System imagelist with additional app icons | GIANNAKOPOULOS KOSTAS | Fri 3/30/2001
960 | Re: System imagelist with additional app icons | [adembaba@e...] | Fri 3/30/2001
957 | Re: System imagelist with additional app icons | Werner Lehmann | Fri 3/30/2001
958 | Re: System imagelist with additional app icons | Wez Furlong | Fri 3/30/2001
959 | Re: System imagelist with additional app icons | GIANNAKOPOULOS KOSTAS | Fri 3/30/2001
961 | Re: System imagelist with additional app icons | Werner Lehmann | Fri 3/30/2001


Background

From: Werner Lehmann [wl@b...]
Date: Thu Mar 29, 2001 11:54 pm
Subject: Background

Hi,

I am experimenting with background images. I noticed that
the background does not scroll with the tree. Although
this is a feature it is somehow a little bit irritating.
Any chance to make this switchable without too much head-
aches?

To be honest I can't decide which possibility would be
better. If it takes too much time (>5-10 min) please ignore
this question...

Werner


Newbie question

From: [guido.klapperich@t...]
Date: Fri Mar 30, 2001 2:10 am
Subject: Newbie question

I'm new to VirtualTreeView and I have a general understanding question.
In my app, I have a hierarchical datastructure.
Rootclass is TIPForms, which contains several objects of TIPForm and
each TIPForm contains several TIPScreens. What will be the best way, to
display this structure in a VirtualTreeView ?

Guido

 | Replies | Author | Date
954 | Re: Newbie question | [adembaba@e...] | Fri 3/30/2001


re: System imagelist with additional app icons

From: [adembaba@e...]
Date: Fri Mar 30, 2001 2:17 am
Subject: Re: System imagelist with additional app icons

In a thingy I was writing, I did a similar thing, but when the
file count is large, the things gets slower and consumes
memory. Does yours store the file name stuff so that only
one image per filename is stored in the inagelist.

If so, yes please, I would like one, That will save me
some gray matter --of the few left. eMail: adembaba(a)excite.com

Cheers,

--- In [VirtualTreeview@y...], Werner Lehmann [wl@b...] wrote:
> Hi,
>
> a while ago I was having the problem that an imagelist
> property (be it VTree or a different component) can only
> be the system imagelist or another one with application
> supplied icons.
>
> In VTree I could work around this with state images. But
> only to a certain point. So I made a little TImageList
> descendant which copies the system images on the fly when
> they are requested. It can contain others images which
> must be added before the first system image is requested
> (design or runtime). No big deal but useful. If someone
> wants to have the component just ask.
>
> Regards,
> Werner


re: Newbie question

From: [adembaba@e...]
Date: Fri Mar 30, 2001 2:20 am
Subject: Re: Newbie question

I'd say make a root called 'Application' and then add the
forms (units) under it with the classes etc as grandchildren.

--- In [VirtualTreeview@y...], [guido.klapperich@t...] wrote:
> I'm new to VirtualTreeView and I have a general understanding
question.
> In my app, I have a hierarchical datastructure.
> Rootclass is TIPForms, which contains several objects of TIPForm and
> each TIPForm contains several TIPScreens. What will be the best
way, to
> display this structure in a VirtualTreeView ?
>
>
> Guido


Additional ReFresh Error while dragging

From: [expertiza@i...]
Date: Fri Mar 30, 2001 6:22 am
Subject: [VirtualTreeview] Additional ReFresh Error while dragging

Hi Mike,

(Sorry for lang. mistakes, I from Russia)

I tested VirtualExplorer

1. I have placed the parameter
VirtualExplorerTree.ScrollBarOptions.VerticalIncrement := 1 and have
not detected any effect

.......
procedure TBaseVirtualTree.WMSize(var Message: TWMSize);
.......
if FDefaultNodeHeight < Cardinal(ClientHeight) then
FScrollBarOptions.FIncrementY := FDefaultNodeHeight
else
FScrollBarOptions.FIncrementY := ClientHeight;
.......

These lines block parameter
TBaseVirtualTree.ScrollBarOptions.VerticalIncrement

2. When I them have commented out and have tried Dragging Scroll
could see ReFresh Error

 | Replies | Author | Date
1005 | Re: Additional ReFresh Error while dragging | Mike Lischke | Mon 4/2/2001


re: System imagelist with additional app icons

From: GIANNAKOPOULOS KOSTAS [kyan@s...]
Date: Fri Mar 30, 2001 7:07 am
Subject: RE: [VirtualTreeview] System imagelist with additional app icons

You don't have to copy the icons. You can use the ShellAPI to get a handle
to the system imagelist. This is the way to do it:

function GetSystemImageList(Large: Boolean = False): THandle;
var
Flags: Cardinal;
FileInfo: TSHFileInfo;
P: PItemIDList;
Alloc: IMalloc;
begin
OleCheck(SHGetMalloc(Alloc));
OleCheck(SHGetSpecialFolderLocation(0, CSIDL_DESKTOP, P));
try
Flags := SHGFI_PIDL or SHGFI_SYSICONINDEX;
if not Large then Flags := Flags or SHGFI_SMALLICON;
Result := SHGetFileInfo(PChar(P), 0, FileInfo, SizeOf(FileInfo), Flags);
finally
Alloc.Free(P);
end;
end;

Then you put the handle in an existing TImageList component like this:

SmallImages.Handle := GetSystemImageList(False);
SmallImages.HandleShared := True;

LargeImages.Handle := GetSystemImageList(True);
LargeImages.HandleShared := True;

You set the HandleShared property to true so that the TImageList component
does not delete the imagelist handle when it is destroyed (the handle is
maintained by the shell libraries).

Now, if you use the Shell API to obtain imageIndexes for your files
(SHGetFileInfo or IShellIcon.GetIconOf) instea of loading them yourself
images are automatically added in your imagelist upon request and you do not
have to do anything about it.

> -----Original Message-----
> From: Werner Lehmann [mailto:[wl@b...]]
> Sent: Friday, March 30, 2001 2:52 AM
> To: VirtualTreeview
> Subject: [VirtualTreeview] System imagelist with additional app icons
>
>
> Hi,
>
> a while ago I was having the problem that an imagelist
> property (be it VTree or a different component) can only
> be the system imagelist or another one with application
> supplied icons.
>
> In VTree I could work around this with state images. But
> only to a certain point. So I made a little TImageList
> descendant which copies the system images on the fly when
> they are requested. It can contain others images which
> must be added before the first system image is requested
> (design or runtime). No big deal but useful. If someone
> wants to have the component just ask.
>
> Regards,
> Werner
>
>
>
> ------------------------ Yahoo! Groups Sponsor
> ---------------------~-~>
> Secure your servers with 128-bit SSL encryption!
> Grab your copy of VeriSign's FREE Guide,
> "Securing Your Web site for Business." Get it now!
> http://us.click.yahoo.com/4cW4jC/e.WCAA/bT0EAA/iObVlB/TM
> --------------------------------------------------------------
> -------_->
>
> To unsubscribe from this group, send an email to:
> [VirtualTreeview-unsubscribe@egroups.com
>
>
>
> Your use of Yahoo! Groups is subject to
> http://docs.yahoo.com/info/terms/
>
>

Replies Author Date


re: System imagelist with additional app icons

From: Werner Lehmann [wl@b...]
Date: Fri Mar 30, 2001 11:20 am
Subject: Re: [VirtualTreeview] System imagelist with additional app icons

GIANNAKOPOULOS KOSTAS wrote:
>
> You don't have to copy the icons. You can use the ShellAPI to get a handle
> to the system imagelist. This is the way to do it:
>
> function GetSystemImageList(Large: Boolean = False): THandle;
> var
> Flags: Cardinal;
> FileInfo: TSHFileInfo;
> P: PItemIDList;
> Alloc: IMalloc;
> begin
> OleCheck(SHGetMalloc(Alloc));
> OleCheck(SHGetSpecialFolderLocation(0, CSIDL_DESKTOP, P));
> try
> Flags := SHGFI_PIDL or SHGFI_SYSICONINDEX;
> if not Large then Flags := Flags or SHGFI_SMALLICON;
> Result := SHGetFileInfo(PChar(P), 0, FileInfo, SizeOf(FileInfo), Flags);
> finally
> Alloc.Free(P);
> end;
> end;
>
> Then you put the handle in an existing TImageList component like this:
>
> SmallImages.Handle := GetSystemImageList(False);
> SmallImages.HandleShared := True;
>
> LargeImages.Handle := GetSystemImageList(True);
> LargeImages.HandleShared := True;
>
> You set the HandleShared property to true so that the TImageList component
> does not delete the imagelist handle when it is destroyed (the handle is
> maintained by the shell libraries).

This is the way I do it:

procedure TurnIntoSystemImageList(ImageList: TImageList; SmallImages: boolean =
true);
const
IconSizes: array[boolean] of UINT = (SHGFI_LARGEICON, SHGFI_SMALLICON);
var
SFI: TSHFileInfo;
begin
ImageList.Handle := SHGetFileInfo('', 0, SFI, SizeOf(SFI), SHGFI_SYSICONINDEX
or
IconSizes[SmallImages]);
ImageList.ShareImages := true;
end;

> Now, if you use the Shell API to obtain imageIndexes for your files
> (SHGetFileInfo or IShellIcon.GetIconOf) instea of loading them yourself
> images are automatically added in your imagelist upon request and you do not
> have to do anything about it.

Ok, but the problem was that I needed additional icons in the same imagelist.
AFAIK
the previous icons are lost if the handle is reassigned.

Werner


re: System imagelist with additional app icons

From: "Wez Furlong" [wez.egroups@t...]
Date: Fri Mar 30, 2001 11:52 am
Subject: Re: [VirtualTreeview] System imagelist with additional app icons

Werner,

Please email me a copy of this code.
It's the kind of thing that should be included with Delphi, IMHO.

Thanks!

--Wez.

On 2001-03-30 00:51:45, "Werner Lehmann" wrote:

> a while ago I was having the problem that an imagelist
> property (be it VTree or a different component) can only
> be the system imagelist or another one with application
> supplied icons.
>
> In VTree I could work around this with state images. But
> only to a certain point. So I made a little TImageList
> descendant which copies the system images on the fly when
> they are requested. It can contain others images which
> must be added before the first system image is requested
> (design or runtime). No big deal but useful. If someone
> wants to have the component just ask.

[Non-text portions of this message have been removed]


re: System imagelist with additional app icons

From: GIANNAKOPOULOS KOSTAS [kyan@s...]
Date: Fri Mar 30, 2001 1:03 pm
Subject: RE: [VirtualTreeview] System imagelist with additional app icons

Oh, i'm very sorry, Werner. I seem to have answered the wrong e-mail...

The reply was meant for [adembaba@e...]:

> In a thingy I was writing, I did a similar thing, but when the
> file count is large, the things gets slower and consumes
> memory. Does yours store the file name stuff so that only
> one image per filename is stored in the inagelist.

I have a lot on my mind at this time (threading issues in an application
server i'm working on, you understand...).
I hope i didn't offend you in some way....

> -----Original Message-----
> From: Werner Lehmann [mailto:[wl@b...]]
> Sent: Friday, March 30, 2001 2:20 PM
> To: VirtualTreeview@yahoogroups.com
> Subject: Re: [VirtualTreeview] System imagelist with additional app
> icons
>
>
> GIANNAKOPOULOS KOSTAS wrote:
> >
> > You don't have to copy the icons. You can use the ShellAPI
> to get a handle
> > to the system imagelist. This is the way to do it:
> >
> > function GetSystemImageList(Large: Boolean = False): THandle;
> > var
> > Flags: Cardinal;
> > FileInfo: TSHFileInfo;
> > P: PItemIDList;
> > Alloc: IMalloc;
> > begin
> > OleCheck(SHGetMalloc(Alloc));
> > OleCheck(SHGetSpecialFolderLocation(0, CSIDL_DESKTOP, P));
> > try
> > Flags := SHGFI_PIDL or SHGFI_SYSICONINDEX;
> > if not Large then Flags := Flags or SHGFI_SMALLICON;
> > Result := SHGetFileInfo(PChar(P), 0, FileInfo,
> SizeOf(FileInfo), Flags);
> > finally
> > Alloc.Free(P);
> > end;
> > end;
> >
> > Then you put the handle in an existing TImageList component
> like this:
> >
> > SmallImages.Handle := GetSystemImageList(False);
> > SmallImages.HandleShared := True;
> >
> > LargeImages.Handle := GetSystemImageList(True);
> > LargeImages.HandleShared := True;
> >
> > You set the HandleShared property to true so that the
> TImageList component
> > does not delete the imagelist handle when it is destroyed
> (the handle is
> > maintained by the shell libraries).
>
> This is the way I do it:
>
> procedure TurnIntoSystemImageList(ImageList: TImageList;
> SmallImages: boolean = true);
> const
> IconSizes: array[boolean] of UINT = (SHGFI_LARGEICON,
> SHGFI_SMALLICON);
> var
> SFI: TSHFileInfo;
> begin
> ImageList.Handle := SHGetFileInfo('', 0, SFI, SizeOf(SFI),
> SHGFI_SYSICONINDEX or
> IconSizes[SmallImages]);
> ImageList.ShareImages := true;
> end;
>
> > Now, if you use the Shell API to obtain imageIndexes for your files
> > (SHGetFileInfo or IShellIcon.GetIconOf) instea of loading
> them yourself
> > images are automatically added in your imagelist upon
> request and you do not
> > have to do anything about it.
>
> Ok, but the problem was that I needed additional icons in the
> same imagelist. AFAIK
> the previous icons are lost if the handle is reassigned.
>
> Werner
>
>
> ------------------------ Yahoo! Groups Sponsor
> ---------------------~-~>
> Secure your servers with 128-bit SSL encryption!
> Grab your copy of VeriSign's FREE Guide,
> "Securing Your Web site for Business." Get it now!
> http://us.click.yahoo.com/4cW4jC/e.WCAA/bT0EAA/iObVlB/TM
> --------------------------------------------------------------
> -------_->
>
> To unsubscribe from this group, send an email to:
> VirtualTreeview-unsubscribe@egroups.com
>
>
>
> Your use of Yahoo! Groups is subject to
http://docs.yahoo.com/info/terms/


re: System imagelist with additional app icons

From: [adembaba@e...]
Date: Fri Mar 30, 2001 1:34 pm
Subject: Re: System imagelist with additional app icons

Kostas,

It seems this was meant to answer my problem.

If that is so, I dont see how it does; I was not asking
how I would display Systemimages in VT. Rather, how would
you go by *mixing* icons from SystemImageList with those
that you wish displayed --and all this without having to
duplicate them in a separate ImageList.

Apparently, my question was not clear enough.

Cheers,

--- In [VirtualTreeview@y...], GIANNAKOPOULOS KOSTAS [kyan@s...] wrote:
> You don't have to copy the icons. You can use the ShellAPI to get a
handle
> to the system imagelist. This is the way to do it:
>
> function GetSystemImageList(Large: Boolean = False): THandle;
> var
> Flags: Cardinal;
> FileInfo: TSHFileInfo;
> P: PItemIDList;
> Alloc: IMalloc;
> begin
> OleCheck(SHGetMalloc(Alloc));
> OleCheck(SHGetSpecialFolderLocation(0, CSIDL_DESKTOP, P));
> try
> Flags := SHGFI_PIDL or SHGFI_SYSICONINDEX;
> if not Large then Flags := Flags or SHGFI_SMALLICON;
> Result := SHGetFileInfo(PChar(P), 0, FileInfo, SizeOf
(FileInfo), Flags);
> finally
> Alloc.Free(P);
> end;
> end;
>
> Then you put the handle in an existing TImageList component like
this:
>
> SmallImages.Handle := GetSystemImageList(False);
> SmallImages.HandleShared := True;
>
> LargeImages.Handle := GetSystemImageList(True);
> LargeImages.HandleShared := True;
>
>
> You set the HandleShared property to true so that the TImageList
component
> does not delete the imagelist handle when it is destroyed (the
handle is
> maintained by the shell libraries).
>
> Now, if you use the Shell API to obtain imageIndexes for your files
> (SHGetFileInfo or IShellIcon.GetIconOf) instea of loading them
yourself
> images are automatically added in your imagelist upon request and
you do not
> have to do anything about it.
>
> > -----Original Message-----
> > From: Werner Lehmann [mailto:[wl@b...]]
> > Sent: Friday, March 30, 2001 2:52 AM
> > To: VirtualTreeview
> > Subject: [VirtualTreeview] System imagelist with additional app
icons
> >
> >
> > Hi,
> >
> > a while ago I was having the problem that an imagelist
> > property (be it VTree or a different component) can only
> > be the system imagelist or another one with application
> > supplied icons.
> >
> > In VTree I could work around this with state images. But
> > only to a certain point. So I made a little TImageList
> > descendant which copies the system images on the fly when
> > they are requested. It can contain others images which
> > must be added before the first system image is requested
> > (design or runtime). No big deal but useful. If someone
> > wants to have the component just ask.
> >
> > Regards,
> > Werner
> >
> >
> >
> > ------------------------ Yahoo! Groups Sponsor
> > ---------------------~-~>
> > Secure your servers with 128-bit SSL encryption!
> > Grab your copy of VeriSign's FREE Guide,
> > "Securing Your Web site for Business." Get it now!
> > http://us.click.yahoo.com/4cW4jC/e.WCAA/bT0EAA/iObVlB/TM
> > --------------------------------------------------------------
> > -------_->
> >
> > To unsubscribe from this group, send an email to:
> > VirtualTreeview-unsubscribe@egroups.com
> >
> >
> >
> > Your use of Yahoo! Groups is subject to
> > http://docs.yahoo.com/info/terms/
> >
> >


re: Re: System imagelist with additional app icons

From: Werner Lehmann [wl@b...]
Date: Fri Mar 30, 2001 7:21 pm
Subject: Re: [VirtualTreeview] Re: System imagelist with additional app icons

[adembaba@e...] wrote:
>
> In a thingy I was writing, I did a similar thing, but when the
> file count is large, the things gets slower and consumes
> memory. Does yours store the file name stuff so that only
> one image per filename is stored in the inagelist.

Each system image is only copied once to this imagelist descendant.

> If so, yes please, I would like one, That will save me
> some gray matter --of the few left. eMail: adembaba(a)excite.com

You got separate mail with the component.

Regards,
Werner


re: IDataObject and DoDragDrop

From: [jimdk@m...]
Date: Sat Mar 31, 2001 4:09 am
Subject: Re: IDataObject and DoDragDrop

--- In [VirtualTreeview@y...], GIANNAKOPOULOS KOSTAS [kyan@s...] wrote:

> function TShellDragDropManager.GetData(const FormatEtcIn:
TFormatEtc; out
> Medium: TStgMedium): HResult;
> begin
> Result := FDataObject.GetData(FormatEtcIn, Medium);
> end;

I tried what you suggested but I can't get the shell to call my
reimplemented functions. It still calls the methods in
TBaseDragDropManager. I have spent a lot of time reading up on
interfaces and reimplementing and it should work. I added IUnknown
and added _AddRef and _Release and those DID call my reimplemented
methods????? Why won't the IDataObject????? Any ideas.

type
TNamespaceDragDropManager = class(TVTDragDropManager, IDataObject)
private
FDataObject: IDataObject;
protected
.... All of IDAtaObject functions
public
constructor Create(AOwner: TBaseVirtualTree); override;
destructor Destroy; override;
property DataObject: IDataObject read FDataObject write
FDataObject;
end;

function TCustomVirtualExplorer.DoCreateDragManager:
TVTDragDropManager;
begin
Result := NamespaceDragDropManager
end;

constructor TCustomVirtualExplorer.Create(AOwner: TComponent);
begin
inherited;
NamespaceDragDropManager := TNamespaceDragDropManager.Create(Self);
......
end;

 | Replies | Author | Date
966 | Re: IDataObject and DoDragDrop | [jimdk@m...] | Sat 3/31/2001


Help File ?

From: [okhua@y...]
Date: Sat Mar 31, 2001 4:14 am
Subject: Help File ?

Any help files for Ver2.x like the one included in Ver1.x ?

 | Replies | Author | Date
964 | Re: Help File ? | [guido.klapperich@t...] | Sat 3/31/2001
965 | Re: Help File ? | [jimdk@m...] | Sat 3/31/2001
970 | Re: Help File ? | Mike Lischke | Sat 3/31/2001


re: Help File ?

From: [guido.klapperich@t...]
Date: Sat Mar 31, 2001 6:45 am
Subject: Re: [VirtualTreeview] Help File ?

Where can I get Version 2.x ?

Guido

[okhua@y...] wrote:

> Any help files for Ver2.x like the one included in Ver1.x ?
>
>
> To unsubscribe from this group, send an email to:
> [VirtualTreeview-unsubscribe@egroups.com
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/

 | Replies | Author | Date
965 | Re: Help File ? | jimdk@m...] | Sat 3/31/2001
970 | Re: Help File ? | Mike Lischke | Sat 3/31/2001


re: Help File ?

From: [jimdk@m...]
Date: Sat Mar 31, 2001 2:00 pm
Subject: Re: Help File ?

--- In [VirtualTreeview@y...], [guido.klapperich@t...] wrote:
> Where can I get Version 2.x ?

The Beta version is in the files section on groups.yahoo.com.

Jim Kueneman

 | Replies | Author | Date
970 | Re: Help File ? | Mike Lischke | Sat 3/31/2001


re: IDataObject and DoDragDrop

From: [jimdk@m...]
Date: Sat Mar 31, 2001 2:34 pm
Subject: Re: IDataObject and DoDragDrop

--- In [VirtualTreeview@y...], [jimdk@m...] wrote:
> I tried what you suggested but I can't get the shell to call my
> reimplemented functions. It still calls the methods in
> TBaseDragDropManager. I have spent a lot of time reading up on

Never mind I undertand now. I can't do this. The problem is that the
COM interface is "sort of" virtual, i.e. it has a VMT table so its
rules are a bit different. When the DragManager gets called within VT
it is always calls TBaseDragDropManager.XXXX and it will always use
the COM method defined in TBaseDragDropManager unless it explititly
tells it not to such as:

(BaseDragDropManager as TNewDragDropManager).DragDrop(...)

Then it will call the newly defined COM methods. Rudy Velthuis on the
newsgroups explained it too me and now that I understand what I am
looking at the OP help tells the same story. It is exactly this case
as in the help, but in my case the COM method is implicitly "virtual".
And no you can't use "override" since the compiler sees it as a static
method. Look at the "Overriding versus hiding" help example and the
"Changing inherited implementations" example to create a test case to
prove it to yourself, I did and now believe.

Back to how to handle an Explorer Virtual Treeview. It appears I am
going to have to bow to Mikes wishes <g> and when I get the
IDataObject from the namespace enumerate its formats and then fill the
DragDropManager with these formats through SetOLEFormats. Then render
the data through RenderData which now that I look at it is simple. My
apologes Mike your implementation of IDataObject is pretty easy to use
now that I stop trying to do it my way <g>, sorry!.

Jim Kueneman


Column problems

From: Werner Lehmann [wl@b...]
Date: Sat Mar 31, 2001 4:15 pm
Subject: Column problems

If hoAutoResize is set in Header.Options and Header.Style is
hsFlatButtons the right border of the right most column is
missing. At least in my test case where the AutoSize column
is this right most (out of two) columns). And in one case I
even get a horz scrollbar at design time with no apparent
reason.

Second, voAutoSpanColumn does not work anymore.

Regards,
Werner

 | Replies | Author | Date
976 | Re: Column problems | Mike Lischke | Sun 4/1/2001
979 | Re: Column problems | Werner Lehmann | Sun 4/1/2001
988 | Re: Column problems | Mike Lischke | Sun 4/1/2001
996 | Re: Column problems | Werner Lehmann | Mon 4/2/2001


Overlays in 2.3

From: Werner Lehmann [wl@b...]
Date: Sat Mar 31, 2001 3:14 pm
Subject: Overlays in 2.3

Mike,

overlays do not work anymore in v2.3. In my application overlays do not
show anymore and in one case not the image with index 5 is used as overlay
but index 0 which is not designed as overlay and replaces the original image.

I checked that this does not happen with the previous 2.2 version.

And there is another thing: some time ago I made a node editor with a dropdown
VTree. The problem is that it only works on two machines here. A different
tester who has probably not installed Delphi (if that matters) only sees a
simple
editor and not the dropdown form with the VTree (he tried on two Win98
machines).

Do you have any idea what might be wrong here?

Regards,
Werner

 | Replies | Author | Date
975 | Re: Overlays in 2.3 | Mike Lischke | Sun 4/1/2001
980 | Re: Overlays in 2.3 | Werner Lehmann | Sun 4/1/2001
989 | Re: Overlays in 2.3 | Mike Lischke | Sun 4/1/2001
998 | Re: Overlays in 2.3 | Werner Lehmann | Mon 4/2/2001


re: Buttons disappeared.

From: [garycramblitt@e...]
Date: Sat Mar 31, 2001 7:32 pm
Subject: Re: Buttons disappeared.

--- In [VirtualTreeview@y...], [garycramblitt@e...] wrote:
> --- In [VirtualTreeview@y...], Mike Lischke [public@l...] wrote:
> > Hi Gary,
> >
> > > IsMainColumn := (PaintInfo.Column = FHeader.FMainColumn) or
> > > (PaintInfo.Column = -1);
> > >
> > > This fixed the problem. Or was I doing something wrong that
this
> > > version unveiled? My tree does not have columns.
> >
> > Mmmh, strange. There was an omission in pre 2.3 where I forgot to
initialize
> > the main column of the tree to -1 (NoColumn). But as this has
been fixed it
> > should no longer be a problem. I wonder by what your problem
could be
> > caused. Please check the value FHeader.FMainColumn in the code
and check
> > also what value it has at design time.
> >
> > Ciao, Mike
>
> At the statement I gave above, FHeader.FMainColumn is 0 and
PaintInfo.Column is -1. I am not using VT at design time. I have a
descendent component created at runtime. Hope that helps.
>
> If I understand what you're saying, FHeader.FMainColumn should be
initialized to -1. I'll see if I can figure out why that is not
happening.
>
> Gary

I was also able to fix the problem by adding the following statement
to TVTHeader.Create method (after removing my other fix):

FMainColumn := NoColumn;

Gary


re: Re: Help File ?

From: "Mike Lischke" [public@l...]
Date: Sat Mar 31, 2001 4:02 pm
Subject: RE: [VirtualTreeview] Re: Help File ?

> The Beta version is in the files section on groups.yahoo.com.

But there is not much description in it for the new features.

Ciao, Mike


re: Shell Explorer Tree

From: [jimdk@m...]
Date: Sat Mar 31, 2001 9:48 pm
Subject: Re: Shell Explorer Tree

IDLists (i found the interfaced implementation much more convenient)
> and a translation of some of the new shell interfaces not found in
> ShlObj.pas (like IShellFolder2, IContextMenu3 etc).
>
> If you want, i could upload it so that someone can use it as a guide
> (or even modify it) for a TVirtualExplorerTree component.
>
> What do you say?

Sorry it took so long to reply. I already have 100% functional
TTreeview implementation of an Explorer Treeview but I would like to
see how you did it. I have been *struggling* with trying to get VT to
do what I want as far as the drag and drop so it should help you out
as well.

Jim Kueneman


New clipboard formats

From: [jimdk@m...]
Date: Sat Mar 31, 2001 9:56 pm
Subject: New clipboard formats

I have been looking at old posts an it appears that the SetOLEFormats
method of TBaseDragDropManager has become dynamic. That is greate but
how the do you add new CF_xxx formats when

FFormatEtcList: TFormatEtcList;

is private then the base class?

How about making that a protected property Mike?

Jim Kueneman

 | Replies | Author | Date
977 | Re: New clipboard formats | Mike Lischke | Sun 4/1/2001


Virtual Explorer with D&D

From: [jimdk@m...]
Date: Sun Apr 1, 2001 4:10 am
Subject: Virtual Explorer with D&D

I finally have the Drag and Drop figured out.... sort of. I had to
make one change to the VT source which is nothing more than taking a
defined variable in the TBaseDragDropManager and create a proteced
property for it so I could access this variable in the decendant
class. I hope Mike will make this change or someone can tell me how
to add new clipboard formats to the class without this. It is
outlined in the demo, just run it and read. It is in the files
section.

It is in working order except I commented out a line in DragDrop so
that no files will actually be moved, copied or shortcuts made. It
will do the operation if that line is added back in.

I also uploaded the exe because this is a component and I would like
some feedback on a few things and not everyone will want to install
it. I think they are Win2k bugs but I would like to verify that fact.

1) Drag a movable folder to another folder. Press CTRL to cause a
copy. Now press SHIFT to cause a shortcut... it does not work on my
machine. Let go of the keys. It goes back to move. Now press SHIFT
then CTRL, the shortcut does work. It depends on the order you press
the keys if you can get a shortcut. Explorer does not care which way
you press the keys.

2) Start to drag a folder. The cursor shows you can move the folder
into itself, correct? Explorer shows a "no drop" cursor when the
folder is over itself (easy to implement but I would expect the
namespace IDropSource to handle this).

3) Drag a folder and press CTRL to copy. Let go of the mouse button.
The cursor stays in the drag copy state and you have to click again to
make the copy happen. This only happens occationally. This happens
in Explorer so I am sure this is a Win2k issue, has anyone else seen
that?

Lastly the code is UGLY. It is a bunch of random variables and things
commented out that did not work. If it seems to work ok I will clean
it up and put a new version up soon.

Jim Kueneman

 | Replies | Author | Date
974 | Re: Virtual Explorer with D&D | [jimdk@m...] | Sun 4/1/2001
982 | Re: Virtual Explorer with D&D | Mike Lischke | Sun 4/1/2001
985 | Re: Virtual Explorer with D&D | [jimdk@m...] | Sun 4/1/2001
993 | Re: Virtual Explorer with D&D | Mike Lischke | Sun 4/1/2001
999 | Re: Virtual Explorer with D&D | [jimdk@m...] | Mon 4/2/2001
986 | Re: Virtual Explorer with D&D | Werner Lehmann | Sun 4/1/2001
1003 | Re: Virtual Explorer with D&D | Mike Lischke | Mon 4/2/2001


re: Virtual Explorer with D&D

From: [jimdk@m...]
Date: Sun Apr 1, 2001 4:17 am
Subject: Re: Virtual Explorer with D&D

--- In [VirtualTreeview@y...], [jimdk@m...] wrote:
> It is in working order except I commented out a line in DragDrop so
> that no files will actually be moved, copied or shortcuts made. It
> will do the operation if that line is added back in.
>

Sorry let me clarify that... It won't do the operation if you drop in
the VT. It WILL do the operation if you drop in Explorer, the
Desktop, etc.. and no the VT does not refresh itself yet.

Jim Kueneman


re: Overlays in 2.3

From: "Mike Lischke" [public@l...]
Date: Sun Apr 1, 2001 9:13 am
Subject: RE: [VirtualTreeview] Overlays in 2.3

> overlays do not work anymore in v2.3. In my application overlays do not
> show anymore and in one case not the image with index 5 is used as overlay
> but index 0 which is not designed as overlay and replaces the original image.

Mmmh, try the new source. In my Explorer demo overlays work well. So I wonder
whether there still
was some code relikt remaining...

> And there is another thing: some time ago I made a node editor with a dropdown
> VTree. The problem is that it only works on two machines here. A different
> tester who has probably not installed Delphi (if that matters) only sees a
simple
> editor and not the dropdown form with the VTree (he tried on two Win98
machines).

Huh? I have no idea what this could be. VT should not depend on an installed
Delphi unless you are
using runtime packages.

Ciao, Mike


re: Column problems

From: "Mike Lischke" [public@l...]
Date: Sun Apr 1, 2001 9:13 am
Subject: RE: [VirtualTreeview] Column problems

Hi Werner,

> If hoAutoResize is set in Header.Options and Header.Style is
> hsFlatButtons the right border of the right most column is
> missing.

This is by design. I have explicitely implemented it this way because otherwise
there would be a
strange looking double line on the right hand border. Note: only in this
special case the right
border is not painted, that is, for auto resizing and flat buttons.

> And in one case I even get a horz scrollbar at design time with no apparent
reason.

This should not happen. I have changed the scroll bar handling a bit because
the flat scroll bar API
does sometimes strange things (in particular when dragging). What I have done
is to uninitialize
flat scroll bars if standard scroll bars are used (instead of using the
standard scroll bar
emulation of the flat scrollbar API). Please watch this problem a while and
tell me if it persists.

> Second, voAutoSpanColumn does not work anymore.

Only some code I forgot to remove :o]

Ciao, Mike


re: New clipboard formats

From: "Mike Lischke" [public@l...]
Date: Sun Apr 1, 2001 9:13 am
Subject: RE: [VirtualTreeview] New clipboard formats

> I have been looking at old posts an it appears that the SetOLEFormats
> method of TBaseDragDropManager has become dynamic. That is greate but
> how the do you add new CF_xxx formats when
>
> FFormatEtcList: TFormatEtcList;
> is private then the base class?
> How about making that a protected property Mike?

Good idea, Jim. Done.

Ciao, Mike


New file uploaded to VirtualTreeview

From: [VirtualTreeview@yahoogroups.com>
Date: Sun Apr 1, 2001 9:14 am
Subject: New file uploaded to VirtualTreeview

Hello,

This email message is a notification to let you know that
a file has been uploaded to the Files area of the VirtualTreeview
group.

File : /VirtualTreeview.zip
Uploaded by : [public@l...]
Description : Version 2.3 beta

You can access this file at the URL

http://groups.yahoo.com/group/VirtualTreeview/files/VirtualTreeview.zip

To learn more about file sharing for your group, please visit

http://help.yahoo.com/help/us/groups/files

Regards,

public@l...]


re: Column problems

From: Werner Lehmann [wl@b...]
Date: Sun Apr 1, 2001 10:44 am
Subject: Re: [VirtualTreeview] Column problems

Mike Lischke wrote:
>
> Hi Werner,
>
> > If hoAutoResize is set in Header.Options and Header.Style is
> > hsFlatButtons the right border of the right most column is
> > missing.
>
> This is by design. I have explicitely implemented it this way because
otherwise there would be a
> strange looking double line on the right hand border. Note: only in this
special case the right
> border is not painted, that is, for auto resizing and flat buttons.

This horz scrollbar is still there and unfortunately this time only at runtime
(before only at designtime). BTW, I have BevelEdges set to [] so there would
not
be a double border. Could you consider to draw the right border if BevelEdges
does
not contain beRight (and maybe BorderStyle is bsNone)? The header looks now
'open' to the right.

The scrollbar is not only visible but it has not even a function. The thumb
track fills the whole size of its width, it cannot be moved to the left or
right. And it does not 'raise 3D' if the mouse if hovering over it (the arrows
still do that).

> > Second, voAutoSpanColumn does not work anymore.
>
> Only some code I forgot to remove :o]

Yep, works now. Thanks.

Regards,
Werner

 | Replies | Author | Date
988 | Re: Column problems | Mike Lischke | Sun 4/1/2001


re: Overlays in 2.3

From: Werner Lehmann [wl@b...]
Date: Sun Apr 1, 2001 11:59 am
Subject: Re: [VirtualTreeview] Overlays in 2.3

Mike Lischke wrote:
>
> > overlays do not work anymore in v2.3. In my application overlays do not
> > show anymore and in one case not the image with index 5 is used as overlay
> > but index 0 which is not designed as overlay and replaces the original
image.
>
> Mmmh, try the new source. In my Explorer demo overlays work well. So I wonder
whether there still
> was some code relikt remaining...

Unfortunately no change, I still don't see any overlays. At least not with the
code that used to work with pre 2.3 versions. Since it works for your explorer
demo (or Jims?) I try to debug it and find information which helps to fix it.
I rely on these overlays as a means to distinguish different folder kinds who
look all the same now...

Addendum: see PS below, I fixed it.

> > And there is another thing: some time ago I made a node editor with a
dropdown
> > VTree. The problem is that it only works on two machines here. A different
> > tester who has probably not installed Delphi (if that matters) only sees a
simple
> > editor and not the dropdown form with the VTree (he tried on two Win98
machines).
>
> Huh? I have no idea what this could be. VT should not depend on an installed
Delphi unless you are
> using runtime packages.

Ok, never mind. It was worth the question before I do what I must do now:
writing
debug output to a text file. And the tester will have to send that file back to
me.

Regards,
Werner

PS:

Here are the changes needed to make overlays work again. BTW, overlays worked
indeed
with the system imagelist, at least for the shared hand icon with index 0, but
not
for other imagelists. You can get a small test project if you want to see the
difference.

procedure TBaseVirtualTree.PaintImage(const PaintInfo: TVTPaintInfo;
ImageInfoIndex: TVTImageInfoIndex; Images: TImageList; DoOverlay: Boolean);
...
if (vsDisabled in Node.States) or not Enabled then
begin
// If the tree or the current node is disabled then let the VCL draw the
image as it alread
// contains code to convert the image to the system colors.
if OverlayImage > -1 then
begin
Overlay(OverlayImage, 0); <-----------------
Images.DrawOverlay(Canvas, XPos, YPos, Index, OverlayImage, False)
end else
Images.Draw(Canvas, XPos, YPos, Index, False);
end
else
begin
if OverlayImage > -1 then
begin
OverlayStyle := ILD_OVERLAYMASK and IndexToOverlayMask(0{OverlayImage}
+ 1); <------
Overlay(OverlayImage, 0); <-----------
end else
OverlayStyle := 0;
if Ghosted or ((vsCutOrCopy in Node.States) and (tsCutPending in
FStates)) then
OverlayStyle := OverlayStyle or ILD_BLEND50;
ImageList_DrawEx(Handle, Index, Canvas.Handle, XPos, YPos, 0, 0,
GetRGBColor(BkColor), GetRGBColor(BlendColor), Style[ImageType] or
OverlayStyle);
end;
...

This was the problem: you were passing the OverlayImage to IndexToOverlayMask
but
this 'macro' wants to see the overlayindex (1..4). And the call to .Overlay was
missing. I am uncertain when this is really needed, I recall that it was not
needed
in some of my tests weeks ago. And someone pointed out that it slows things
down on
Win9x, but neither I nor my tester could notice this slowdown.

It is clear though that this solution is flexible (allows for unlimited number
of
overlays) but not quite satisfactory as it requires potential redundant calls to
.Overlay. But as long as this works ok I am fine with it.

 | Replies | Author | Date
989 | Re: Overlays in 2.3 | Mike Lischke | Sun 4/1/2001


Sort Gap (Was: Re: $1 again)

From: Werner Lehmann [wl@b...]
Date: Sun Apr 1, 2001 12:19 pm
Subject: Sort Gap (Was: Re: [VirtualTreeview] $1 again)

Mike,

Mike Lischke wrote:
>
> I found the bug today and it is my fault. The reason is quite simple and I
really wonder why I
> haven't found it earlier. Paul's demo was what helped me to find the problem
(he send me a private
> copy).

Sadly the bug is not fixed for me. Not much more to say, everything is still as
described previously. With your new version from today.

The behaviour is totally strange. It happens (at least now) with sorting on
every
column. Subsequent clicks on the header to reverse the sort direction produce
completely different results with no obvious pattern. The list can be sorted
after
a click and would look ok (but I did not scroll down to see if there is also
every-
thing ok) but it can also be (50% probability) that only the first item is shown
and the rest is blank until some items come again at the bottom. Sometimes this
order can be reversed and the blank part is at the bottom but without a last
visible
item. Once I sorted the list while it was scrolled down to the bottom and it
sorted
ok but a gap of about 20 nodes was produced at the bottom. I scrolled up one
line
and the gap was removed completely and (so it seems) the list moved down 20
lines
instead of 1. :(

Regards,
Werner

 | Replies | Author | Date
983 | Re: Sort Gap (Was: Re: [VirtualTreeview] $1 again | Werner Lehmann | Sun 4/1/2001
991 | Re: Sort Gap (Was: Re: [VirtualTreeview] $1 again | Mike Lischke | Sun 4/1/2001
990 | Re: Sort Gap (Was: Re: [VirtualTreeview] $1 again | Mike Lischke | Sun 4/1/2001
997 | Re: Sort Gap (Was: Re: [VirtualTreeview] $1 again | Werner Lehmann | Mon 4/2/2001
1002 | Re: Sort Gap (Was: Re: [VirtualTreeview] $1 again | Mike Lischke | Mon 4/2/2001
1008 | Re: Sort Gap (Was: Re: [VirtualTreeview] $1 again | Werner Lehmann | Mon 4/2/2001
1036 | Re: Sort Gap (Was: Re: [VirtualTreeview] $1 again | Robert Palmqvist | Tue 4/3/2001
1039 | Re: Sort Gap (Was: Re: [VirtualTreeview] $1 again | Mike Lischke | Wed 4/4/2001


re: Virtual Explorer with D&D

From: "Mike Lischke" [public@l...]
Date: Sun Apr 1, 2001 1:14 pm
Subject: RE: [VirtualTreeview] Virtual Explorer with D&D

Hi Jim,

I have played a bit with your Explorer tree. Very nice stuff, indeed. See below
my comments.

> I finally have the Drag and Drop figured out.... sort of. I had to
> make one change to the VT source

As I already wrote, I have made a protected property of the internal
FomratEtcList class.

> 1) Drag a movable folder to another folder. Press CTRL to cause a
> copy. Now press SHIFT to cause a shortcut... it does not work on my
> machine. Let go of the keys. It goes back to move. Now press SHIFT
> then CTRL, the shortcut does work. It depends on the order you press
> the keys if you can get a shortcut. Explorer does not care which way
> you press the keys.

Very strange behaviour which I cannot reproduce on my W2K machine. Everything
works as expected.

> 2) Start to drag a folder. The cursor shows you can move the folder
> into itself, correct? Explorer shows a "no drop" cursor when the
> folder is over itself (easy to implement but I would expect the
> namespace IDropSource to handle this).

I wouldn't. You could have some special action in mind when dropping a file
system object on itself.
So how should IDropSource know?

> 3) Drag a folder and press CTRL to copy. Let go of the mouse button.
> The cursor stays in the drag copy state and you have to click again to
> make the copy happen. This only happens occationally. This happens
> in Explorer so I am sure this is a Win2k issue, has anyone else seen
> that?

Your machine must be very special. On my machine everthing is ok (in Windows
Explorer as well as
Virtual Explorer).

> Lastly the code is UGLY. It is a bunch of random variables and things
> commented out that did not work. If it seems to work ok I will clean
> it up and put a new version up soon.

I have changed some things in the Virtual Explorer class as well as the
TNameSpace. Currently
display is very slow due to the way how the information is retrieved. Nearly
nothing is cached which
should basically. I have adjusted Virtual Explorer Tree (short: VET) so that
it conforms to the
latest VT source (CreateWnd and Loaded issue is gone, for example and there is
the Ghosted parameter
in DoGetImageIndex). I have also extended the name space to return some more
information (e.g. if a
file is ghosted, a folder, a file system object and some file attributes). This
information went
into a Virtual Explorer Tree Listview control :o]. I have uploaded the source
and the compiled
executable so you can play a bit with it.

Note: the control is an interesting application for VT but needs some
improvements (e.g.
consideration of compressed file objects, speed improvements, perhaps more
options). If you could
make the necessary changes then I would love to include VET(L) as regular
component into the main
distribution package.

Have fun and

Ciao, Mike

 | Replies | Author | Date
985 | Re: Virtual Explorer with D&D | [jimdk@m...] | Sun 4/1/2001
993 | Re: Virtual Explorer with D&D | Mike Lischke | Sun 4/1/2001
999 | Re: Virtual Explorer with D&D | [jimdk@m...] | Mon 4/2/2001


re: Sort Gap (Was: Re: $1 again)

From: Werner Lehmann [wl@b...]
Date: Sun Apr 1, 2001 1:14 pm
Subject: Re: Sort Gap (Was: Re: [VirtualTreeview] $1 again)

Here is one important thing that I found out: if the list is messed up with
the gap I can remove that gap by minimizing and restoring the application.
Everything looks ok then.

Therefore I tried to force a repaint after sort like this:

procedure TMain.ListHeaderClick(Sender: TVTHeader; Column: Integer);
...
SortTree(Column, Sender.SortDirection, true);
InvalidateRect(Sender.Owner.Handle, nil, true);
...

But that did not work. No change, gap stays. One more thing: It appears that
the original $1 error that I reported is gone. If I click on the VTree inside
the gap (often with a single and wrong (sorted) node at the top) the VTree
is refreshed completely and looks ok then as well.

Hopefully you can find the problem now that we know that minimize/restore
would work around it. BTW, could you make the Owner of TVTHeader a public
read-only property? The point with all these Sender params in events is to
reuse the handlers. But currently there is no simple way to get the VTree
whose header Sender is.

TVTHeader = class(TPersistent)
...
public
...
property Owner: TBaseVirtualTree read FOwner;
...

Regards,
Werner

 | Replies | Author | Date
991 | Re: Sort Gap (Was: Re: [VirtualTreeview] $1 again | Mike Lischke | Sun 4/1/2001


New file uploaded to VirtualTreeview

From: [VirtualTreeview@yahoogroups.com>
Date: Sun Apr 1, 2001 1:19 pm
Subject: New file uploaded to VirtualTreeview

Hello,

This email message is a notification to let you know that
a file has been uploaded to the Files area of the VirtualTreeview
group.

File : /Explorer Tree.zip
Uploaded by : [public@l...]
Description : Listview enhanced Explorer Tree

You can access this file at the URL

http://groups.yahoo.com/group/VirtualTreeview/files/Explorer%20Tree.zip

To learn more about file sharing for your group, please visit

http://help.yahoo.com/help/us/groups/files

Regards,

public@l...]


re: Virtual Explorer with D&D

From: [jimdk@m...]
Date: Sun Apr 1, 2001 1:58 pm
Subject: Re: Virtual Explorer with D&D

--- In [VirtualTreeview@y...], "Mike Lischke" [public@l...] wrote:
> Hi Jim,

> > 1) Drag a movable folder to another folder. Press CTRL to cause a
> > copy. Now press SHIFT to cause a shortcut... it does not work on

> Very strange behaviour which I cannot reproduce on my W2K machine.
Everything works as expected.

My version of 2k is prerelease so it could have a few bugs in it. I
should get the latest version

> Your machine must be very special. On my machine everthing is ok (in
Windows Explorer as well as Virtual Explorer).

Again problably my prerelease 2k

> into a Virtual Explorer Tree Listview control :o]. I have uploaded
the source and the compiled
> executable so you can play a bit with it.

Damn! Could you do it again :^) I just deleted it and replace it with
a version compiled with the lastest VT and a new comments. Sorry.

As for what it needs, be patient :^) I am basicly learing about VT at
the moment. I will eventually port over most of what I have for a
TTreeview decendant which includes everything you mentioned and more.

Also a suggestion I saw you use E_UNEXPECTED as a result in some of
your Drag/Drop code. I would suggest you not do that. It will be
only on a one and in million problem but the network we have at work
is that 1 millionth case. Our network has over 5000 computers on it.
If you open Network Neighborhood you are presented with 5000 items in
the treeview. During a drag and drop operation their namespaces do
not always handle the DragOver through the IDropTarget and the default
result could be returned. If that result is E_UNEXPECTED then NT 4
goes into some kind of la-la land trying to decide what is wrong I
guess. The drag becomes REAL sluggish and almost acts like the
machine is locked up. It took me weeks to figure this out.
Explorer and GXExplorer did not have the problem and I was basicily
doing exactly what Gerald was doing. Finally one day I realized I was
returning E_UNEXPECTED instead of S_OK. I changed it to S_OK and ..
well it was OK. It worked perfectly.

Just a suggestion.

Jim Kueneman

 | Replies | Author | Date
993 | Re: Virtual Explorer with D&D | Mike Lischke | Sun 4/1/2001
999 | Re: Virtual Explorer with D&D | [jimdk@m...] | Mon 4/2/2001


re: Virtual Explorer with D&D

From: Werner Lehmann [wl@b...]
Date: Sun Apr 1, 2001 1:18 pm
Subject: Re: [VirtualTreeview] Virtual Explorer with D&D

[jimdk@m...] wrote:
>
> 3) Drag a folder and press CTRL to copy. Let go of the mouse button.
> The cursor stays in the drag copy state and you have to click again to
> make the copy happen. This only happens occationally. This happens
> in Explorer so I am sure this is a Win2k issue, has anyone else seen
> that?

I noticed that in explorer a few times. Took it as a convenience feature
to help people who cannot hold down the left mouse button for a relatively
long time. Don't know how to reproduce that anymore though.

Regards,
Werner


re: Sort Gap (Was: Re: $1 again) ~ You are not alone...

From: "Robert Palmqvist" [robert.palmqvist@h...]
Date: Mon Apr 2, 2001 5:39 pm
Subject: Re: Sort Gap (Was: Re: [VirtualTreeview] $1 again) ~ You are not alone...

I second that, I am experiencing exactly the same thing...

/ Rob

----- Original Message -----
From: "Werner Lehmann" [wl@b...]
To: <VirtualTreeview@yahoogroups.com>
Sent: Sunday, April 01, 2001 2:19 PM
Subject: Sort Gap (Was: Re: [VirtualTreeview] $1 again)

> Mike,
>
> Mike Lischke wrote:
> >
> > I found the bug today and it is my fault. The reason is quite simple and
I really wonder why I
> > haven't found it earlier. Paul's demo was what helped me to find the
problem (he send me a private
> > copy).
>
> Sadly the bug is not fixed for me. Not much more to say, everything is
still as
> described previously. With your new version from today.
>
> The behaviour is totally strange. It happens (at least now) with sorting
on every
> column. Subsequent clicks on the header to reverse the sort direction
produce
> completely different results with no obvious pattern. The list can be
sorted after
> a click and would look ok (but I did not scroll down to see if there is
also every-
> thing ok) but it can also be (50% probability) that only the first item is
shown
> and the rest is blank until some items come again at the bottom. Sometimes
this
> order can be reversed and the blank part is at the bottom but without a
last visible
> item. Once I sorted the list while it was scrolled down to the bottom and
it sorted
> ok but a gap of about 20 nodes was produced at the bottom. I scrolled up
one line
> and the gap was removed completely and (so it seems) the list moved down
20 lines
> instead of 1. :(
>
> Regards,
> Werner
>
>
>
> To unsubscribe from this group, send an email to:
> VirtualTreeview-unsubscribe@egroups.com
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>
>


re: Column problems

From: "Mike Lischke" [public@l...]
Date: Sun Apr 1, 2001 6:48 pm
Subject: RE: [VirtualTreeview] Column problems

> This horz scrollbar is still there and unfortunately this time only at runtime
> (before only at designtime). BTW, I have BevelEdges set to [] so there would
not
> be a double border. Could you consider to draw the right border if BevelEdges
does
> not contain beRight (and maybe BorderStyle is bsNone)? The header looks now
> 'open' to the right.

It seems there is still a problem with the scroll bars. Unfortunately, the
scroll bar APIs behave
differently depending on how scroll bars are created and set up. I have to
investigate this further.

For the right border: ok, I have built in another test so the right border is
drawn if the bevel is
bkNone.

Ciao, Mike


re: Overlays in 2.3

From: "Mike Lischke" [public@l...]
Date: Sun Apr 1, 2001 6:52 pm
Subject: RE: [VirtualTreeview] Overlays in 2.3

> Here are the changes needed to make overlays work again. BTW, overlays worked
indeed
> with the system imagelist, at least for the shared hand icon with index 0,
but not
> for other imagelists. You can get a small test project if you want to see the
difference.

Aaah, this is the important difference. You should not forget that the
application is responsbile
for setting the overlay indices, not VT. I already had Overlay(OverlayImage,
0); etc. in the code
but somebody made me aware that this will prevent an application from setting
its own overlay
images.

The solution for your problem is therefore to set the overlay images once in
your application and
then all should be fine.

Ciao, Mike


re: Sort Gap (Was: Re: $1 again)

From: "Mike Lischke" [public@l...]
Date: Sun Apr 1, 2001 6:57 pm
Subject: RE: Sort Gap (Was: Re: [VirtualTreeview] $1 again)

> Sadly the bug is not fixed for me. Not much more to say, everything is still
as
> described previously. With your new version from today.

Ooooooh, this is not an april joke, is it? I don't want to see this error
anymore....

> The behaviour is totally strange. It happens (at least now) with sorting on
every
> column.

I'm totally perplex that this error is still there. Can you send me a small
demo....?

Ciao, Mike


re: Sort Gap (Was: Re: $1 again)

From: "Mike Lischke" [public@l...]
Date: Sun Apr 1, 2001 7:03 pm
Subject: RE: Sort Gap (Was: Re: [VirtualTreeview] $1 again)

> Here is one important thing that I found out: if the list is messed up with
> the gap I can remove that gap by minimizing and restoring the application.
> Everything looks ok then.

Sounds interesting. The only effect it can have on VT, I think, is the WM_SIZE
message. But this is
not enough information to find out whats wrong. Werner, if you cannot provide a
sample application
then it should be easy to find out what happens by scrolling the tree so that
it is showing the gap
and then set a break point in PaintTree where DoPaintNode is called. Is this
method really called
and what does the string tree try to paint then?

> BTW, could you make the Owner of TVTHeader a public
> read-only property?

There is a property TVTHeader.Treeview.

Ciao, Mike


New file uploaded to VirtualTreeview

From: [VirtualTreeview@yahoogroups.com>
Date: Sun Apr 1, 2001 7:14 pm
Subject: New file uploaded to VirtualTreeview

Hello,

This email message is a notification to let you know that
a file has been uploaded to the Files area of the VirtualTreeview
group.

File : /VirtualTreeview.zip
Uploaded by : [public@l...]
Description : Version 2.3 beta with new internal data handling

You can access this file at the URL

http://groups.yahoo.com/group/VirtualTreeview/files/VirtualTreeview.zip

To learn more about file sharing for your group, please visit

http://help.yahoo.com/help/us/groups/files

Regards,

public@l...]


re: Re: Virtual Explorer with D&D

From: "Mike Lischke" [public@l...]
Date: Sun Apr 1, 2001 7:18 pm
Subject: RE: [VirtualTreeview] Re: Virtual Explorer with D&D

Jim,

> Also a suggestion I saw you use E_UNEXPECTED as a result in some of
> your Drag/Drop code. I would suggest you not do that. It will be
> only on a one and in million problem but the network we have at work
> is that 1 millionth case.

Well, E_UNEXPECTED is only returned if there was an exception. I don't think
there should be S_OK as
result. I already swalled the exception because I saw that the Explorer crashes
if an exception
breaks its operations. Do you really think returning S_OK is a good idea? It
leads the entire return
value idea ad absurdum.

Ciao, Mike

 | Replies | Author | Date
999 | Re: Virtual Explorer with D&D | [jimdk@m...] | Mon 4/2/2001


New file uploaded to VirtualTreeview

From: [VirtualTreeview@yahoogroups.com>
Date: Sun Apr 1, 2001 7:27 pm
Subject: New file uploaded to VirtualTreeview

Hello,

This email message is a notification to let you know that
a file has been uploaded to the Files area of the VirtualTreeview
group.

File : /Explorer Tree.zip
Uploaded by : [public@l...]
Description : Virtual explorer treeview with new internal data handling

You can access this file at the URL

http://groups.yahoo.com/group/VirtualTreeview/files/Explorer%20Tree.zip

To learn more about file sharing for your group, please visit

http://help.yahoo.com/help/us/groups/files

Regards,

public@l...]


Pointer from VT to my structur

From: [guido.klapperich@t...]
Date: Sun Apr 1, 2001 8:48 pm
Subject: Pointer from VT to my structur

I'm new to VT and I have some problems with the communication between VT
and my internal datastructur. In my app, I have a tree, which contains
only of Objects of TVNode. TVNode is a class, that I have written and
which has the properties CAption and Visible. When I walk through my
internal tree, I can create a tree in VT with AddChild, that's no
problem. But when do I have to create the pointers between TVNode and a
Node in VT and in which direction ? Points the VT:Node to TVNode or have
I to implement a pointer from TVNode to VT.Node ?

Guido.

 | Replies | Author | Date
1001 | Re: Pointer from VT to my structur | Mike Lischke | Mon 4/2/2001
1009 | Re: Pointer from VT to my structur | [guido.klapperich@t...] | Mon 4/2/2001


re: Column problems

From: Werner Lehmann [wl@b...]
Date: Sun Apr 1, 2001 10:58 pm
Subject: Re: [VirtualTreeview] Column problems

Mike Lischke wrote:
>
> It seems there is still a problem with the scroll bars. Unfortunately, the
scroll bar APIs behave
> differently depending on how scroll bars are created and set up. I have to
investigate this further.

Ok. The VTree in question is used in an options dialog. Which is of fixed size
so
I hardcoded the col #2 width and am not using hoAutosize at the time being. This
works as well, without HorzScrollbar, and I have set the scrollbar options so
that
the HorzSB is hidden. What I am trying to say is I have a work around and am
not in
a hurry :) for a fix currently.

> For the right border: ok, I have built in another test so the right border is
drawn if the bevel is
> bkNone.

Thank you.

Regards,
Werner


re: Sort Gap (Was: Re: $1 again)

From: Werner Lehmann [wl@b...]
Date: Mon Apr 2, 2001 12:27 am
Subject: Re: Sort Gap (Was: Re: [VirtualTreeview] $1 again)

Mike Lischke wrote:
>
> > Here is one important thing that I found out: if the list is messed up with
> > the gap I can remove that gap by minimizing and restoring the application.
> > Everything looks ok then.
>
> Sounds interesting. The only effect it can have on VT, I think, is the
WM_SIZE message. But this is
> not enough information to find out whats wrong. Werner, if you cannot provide
a sample application
> then it should be easy to find out what happens by scrolling the tree so that
it is showing the gap
> and then set a break point in PaintTree where DoPaintNode is called. Is this
method really called
> and what does the string tree try to paint then?

You mean 'if I can' probably. I would prefer if you could help me to find that
bug
by myself. I believe that this will be easier than trying to isolate it in a
demo; remember that it is not very common and is likely to vanish if I try that
with
quite some work (maybe hours). Since Robert Palmquist is experiencing the same
problem: what turned out with his little demo? Can't we use that one? I have
tried
to create a little test with two columns and the sorting and the display work as
expected (no problem except a superfluous horz scrollbar even if both columns
fill
only two thirds of the client width).

I have set a breakpoint to DoPaintNode (setting the breakpoint makes my
application
loose focus and I have to press F9 VisibleColCount * VisibleRowCount times
before
I can move on). I do this only if I am quite sure that the problem occurs after
the
next sort process.

It turns out that DoPaintNode reflects what I see in the VTree: the first node
which
is the old first node before the sort (which is wrong) is painted first. And it
is
PaintInfo.Column <> -1 so the line

Text := FColumnData[PaintInfo.Position].Text;

executes. This is were the wrong text comes from which was valid before the
sort.
All further nodes are not painted (or to be more precise: only the clientarea is
cleared). That means DoPaintNode is not called for any other nodes but the first
one.

It is now interesting to step through after the last (partially) visible column
of this first node has been painted. Eventually this code executes:

procedure TBaseVirtualTree.PaintTree(TargetCanvas: TCanvas; Window: TRect;
Target: TPoint; PaintOptions: TPaintOptions);
...
// advance to next visible node
Temp := GetNextVisible(PaintInfo.Node);
if Assigned(Temp) then
...

GetNextVisible returns nil now. The remaining execution sequence is then clear
and
explains what happens: the rest of the VTree is cleared, no nodes are painted.

I am stepping through GetNextVisible and find this:

function TBaseVirtualTree.GetNextVisible(Node: PVirtualNode): PVirtualNode;
...
repeat
// Is there a next sibling?
if Assigned(Result.NextSibling) then <---- false
...
else
begin
// No sibling anymore, so use the parent's next sibling.
if Result.Parent <> FRoot then <---- false
Result := Result.Parent
else
begin
// There are no further nodes to examine, hence there is no further
visible node.
Result := nil; <---- this is the nil that the method returns
Break;

Result (which is the first node) has nil .NextSibling member. This is probably
not ok although I am not sure. Remember that I (and Robert as well) use the
VTree
as a listview here (=all nodes are top level nodes and direct root childs).

It is getting late now and I stop the search here. I hope that you have any idea
on how to proceed now.

> > BTW, could you make the Owner of TVTHeader a public
> > read-only property?
>
> There is a property TVTHeader.Treeview.

Blind as I am I have to say sorry. Mea culpa...

Regards,
Werner


re: Overlays in 2.3

From: Werner Lehmann [wl@b...]
Date: Sun Apr 1, 2001 10:55 pm
Subject: Re: [VirtualTreeview] Overlays in 2.3

Mike Lischke wrote:
>
> > Here are the changes needed to make overlays work again. BTW, overlays
worked indeed
> > with the system imagelist, at least for the shared hand icon with index 0,
but not
> > for other imagelists. You can get a small test project if you want to see
the difference.
>
> Aaah, this is the important difference. You should not forget that the
application is responsbile
> for setting the overlay indices, not VT. I already had Overlay(OverlayImage,
0); etc. in the code
> but somebody made me aware that this will prevent an application from setting
its own overlay
> images.
>
> The solution for your problem is therefore to set the overlay images once in
your application and
> then all should be fine.

Ok. How should I put it? I liked the previous procedure better. But this is a
good reason for the change. But it should be pointed out that existing code
will be broken (as was the case with mine). Because the Index which is returned
for ikOverlay must now be of type TOverlay 0..3, when it was the real image
index
to the list before. And as you said additionally TImageList.Overlay() is needed
on application side. I have to redesign some code now... Since I have 5 overlay
images I have to do Overlay(., 0) anyway. All this overlay stuff looks as if it
was a 'hack' by Microsoft. Only 4 overlay images is not enough and this or-ing
into the flags of Imagelist_DrawEx is odd. But there is nothing I could do about
it, of course.

Regards,
Werner


re: Virtual Explorer with D&D

From: [jimdk@m...]
Date: Mon Apr 2, 2001 3:04 am
Subject: Re: Virtual Explorer with D&D

--- In [VirtualTreeview@y...], "Mike Lischke" [public@l...] wrote:
> Jim,
>
> Well, E_UNEXPECTED is only returned if there was an exception. I

I went back and looked at what I had done. It appears that what I did
was return E_UNEXPECTED if the DragOver was not over any node, which
could happen during a toggle from one node to another in my Treeview.
Obviously I was not returning what I really should have been.
Operator error.

I looked at the VET component. Looks slick. I did do one thing that
will screw everyone up. I renamed the file to VirtualExplorerTree.pas
and the class to TVirtualExplorerTree. I changed the resource file to
reflect this in my version of the component so it reflects its new
offical name VET.

In the latest pas file it states the drag image stuff is done. Have
you decided not to support non-MMX machines? Just curious since it
does not work on mine.

Jim Kueneman


When do you think VitualTree will be stable for applications?

From: [d.lindsey@d...]
Date: Mon Apr 2, 2001 4:35 am
Subject: When do you think VitualTree will be stable for applications?

Hi Mike,
I've been trying to keep up with the latest versions of VirtualTree.
I must admit I'm trying to use the component in a serious application
and as such curious to know when the component will be stable enough
for this approach. As far as I am concerned the component does
everthing I need, but newer versions have changes to events which
requires some reprogramming (e.g. getfirstnode, ongetimageindex).
BTW, that is, of course, your perogative.
Also, are you trying to answer all questions by yourself? It seems a
tall order given how many subscriptions there are. It may be a good
idea to delegate like at the Indy site.
Regards
David Lindsey

 | Replies | Author | Date
1004 | Re: When do you think VitualTree will be stable f | Mike Lischke | Mon 4/2/2001


re: Pointer from VT to my structur

From: Mike Lischke [public@l...]
Date: Mon Apr 2, 2001 8:07 am
Subject: RE: [VirtualTreeview] Pointer from VT to my structur

Hi Guido,

> When I walk through my
> internal tree, I can create a tree in VT with AddChild, that's no
> problem. But when do I have to create the pointers between
> TVNode and a Node in VT and in which direction ?

After the call to AddChild returned you can use GetNodeData and create your
node class for the new node. Don't forget to explicitely call ValidateNode.
This is necessary to mark the node as being initialized which in turn is
necessary so that OnFreeNode gets called. An this event is your only chance
to free the attached node class.

Ciao, Mike


re: Sort Gap (Was: Re: $1 again)

From: Mike Lischke [public@l...]
Date: Mon Apr 2, 2001 8:16 am
Subject: RE: Sort Gap (Was: Re: [VirtualTreeview] $1 again)

Hi Werner,

> It turns out that DoPaintNode reflects what I see in the
> VTree: the first node which is the old first node before the sort (which
is wrong) is
> painted first.
> It is now interesting to step through after the last
> (partially) visible column of this first node has been painted.
> GetNextVisible returns nil now.

This is exactly what happend with the old code. The reason is that the last
node which is really drawn is already wrong. The node to start painting with
is determined using the cache. The cache however does not reflect the true
state of the tree because it is not updated (at least this was the case
previously). I was quite sure that I have fixed this annoying problem, but
obviously I overlooked something. So let us try some more tricks. Firstly,
in Sort and SortTree replace the statements:

Include(FStates, tsValidationNeeded);

by:

InvalidateCache;

Then set a break point into DoValidateCache and trigger a resort of your
tree. Does DoValidateCache get called?

Ciao, Mike


re: Re: Virtual Explorer with D&D

From: Mike Lischke [public@l...]
Date: Mon Apr 2, 2001 8:29 am
Subject: RE: [VirtualTreeview] Re: Virtual Explorer with D&D

> I looked at the VET component. Looks slick. I did do one thing that
> will screw everyone up. I renamed the file to
> VirtualExplorerTree.pas and the class to TVirtualExplorerTree. I changed
the
> resource file to reflect this in my version of the component so it
reflects its new
> offical name VET.

Ok, no problem with me.

> In the latest pas file it states the drag image stuff is done. Have
> you decided not to support non-MMX machines? Just curious since it
> does not work on mine.

If there is no MMX available then some fall backs apply. The drag image is
disabled for such processors and if the hint animation is set to hatFade
then instead sliding will be used.

Ciao, Mike


re: When do you think VitualTree will be stable for applications?

From: Mike Lischke [public@l...]
Date: Mon Apr 2, 2001 8:38 am
Subject: RE: [VirtualTreeview] When do you think VitualTree will be stable for applications?

Hi David,

> I must admit I'm trying to use the component in a serious application

So do I. I'm sorry if the recent changes caused too much trouble.

> and as such curious to know when the component will be stable enough
> for this approach.

If there wouldn't be this resort/cache bug I thought I had resolved already
then I would consider VT as very stable indeed.

>As far as I am concerned the component does
> everthing I need, but newer versions have changes to events which
> requires some reprogramming (e.g. getfirstnode, ongetimageindex).

Unfortunately, although I am very careful with interface changes it is
sometimes unavoidable. I apologize again if this causes too much trouble to
anyone. But I believe that I can publish version 2.x very soon and then I
plan to retire from VT's development for a while because a handfull other
projects are waiting since months. I will of course still be here to answer
questions and help to improve VT and/or new descentants.

> Also, are you trying to answer all questions by yourself? It seems a
> tall order given how many subscriptions there are. It may be a good
> idea to delegate like at the Indy site.

Currently I have no other choice. All I can do is to wait a day if somebody
else can come up with a good answer (and sometimes e.g. Werner Lehmann did
indeed), but generally: I'm the author, hence I'm responsible.

Ciao, Mike


re: Additional ReFresh Error while dragging

From: Mike Lischke [public@l...]
Date: Mon Apr 2, 2001 8:55 am
Subject: RE: [VirtualTreeview] Additional ReFresh Error while dragging

Hi Expertiza,

> 1. I have placed the parameter
> VirtualExplorerTree.ScrollBarOptions.VerticalIncrement := 1 and have
> not detected any effect

Thank you for you small bug report. I have changed the code so that it now
does not modifiy the vertical increment automatically anymore.

Ciao, Mike


FullExpand

From: "Vadim Sedulin" [wsntrl@o...]
Date: Mon Apr 2, 2001 2:25 pm
Subject: FullExpand

Hello!

Mike, can you include new option to prevent full expansion by '*'?

Bye.

Vadim Sedulin
E-Mail: [wsntrl@o...]


Drag Image problems

From: [jimdk@m...]
Date: Mon Apr 2, 2001 4:10 pm
Subject: Drag Image problems

Mike,

There are still a few issues with drag images.

1) Run the VET demo you created. Make it fill screen and open enough
to fill the screen vertically. Set the Taskbar so it Auto Hides
itself. Grab a few folders and drag to the bottom. Wait for the
taskbar to pop up. Now drag back into the VET, allowing the drag
image to remain in the area of the Taskbar. Wait for the Taskbar to
hide itself. One or two things or both may happen.

a) VET won't repaint itself where the Taskbar was
b) an image of the Taskbar where it was under the drag image is drawn.

2) Next open a single window program. Position the bottom of it so
there is a small gap between it and the top of the Taskbar when it is
popped up. Now minimize this window. Grab a few folders and drag
down to the bottom to again allow the Taskbar to popup. Hold the
cursor over the program previously minimized. When the app starts to
pop up (this is the tricky part you need to get an app that is a bit
lazy about popping up) move the cursor into the space between the
Taskbar and where the application will popup. When the application
pops up the contents of the VET under the cursor will be drawn onto
application that just poped up! This could be related to (1)?

3) Also drag some folders and allow the VET to auto scroll to it
limits. It may take some playing around with the window height but
you can make it do what I explained last week. The display does not
actually scroll to the limit but the VT thinks it does. If you then
drag back into the control the newly redrawn nodes are drawn a few
pixels off set from the current display, which is in the incorrect
postion. If it helps the scrollbar is incorrect as well. VT stops
scrolling with the scrollbar a few pixels from the end. If you force
it to redraw, like make the taskbar popup over it then rehide itself,
it is redrawn in the fully scrolled position.

Jim Kueneman

 | Replies | Author | Date
1038 | Re: Drag Image problems | Mike Lischke | Wed 4/4/2001


re: Sort Gap (Was: Re: $1 again)

From: Werner Lehmann [wl@b...]
Date: Mon Apr 2, 2001 6:28 pm
Subject: Re: Sort Gap (Was: Re: [VirtualTreeview] $1 again)

Mike Lischke wrote:
>
> This is exactly what happend with the old code. The reason is that the last
> node which is really drawn is already wrong. The node to start painting with
> is determined using the cache. The cache however does not reflect the true
> state of the tree because it is not updated (at least this was the case

Ok, that explains it.

> previously). I was quite sure that I have fixed this annoying problem, but
> obviously I overlooked something. So let us try some more tricks. Firstly,
> in Sort and SortTree replace the statements:
>
> Include(FStates, tsValidationNeeded);
>
> by:
>
> InvalidateCache;
>
> Then set a break point into DoValidateCache and trigger a resort of your
> tree. Does DoValidateCache get called?

Yes, DoValidateCache is called once per 'header sort click'. What's more, the
problem is gone :) No gap anymore. I am not sure if this may be clear to you
in the first place but I could live with a cache flush on each resort. At
least if the whole tree is sorted (SortTree). Flushing the cache for each
childnode sort (.Sort) may not be appropriate but if it is the only way to fix
the problem I am fine with it.

Should I try anything else?

Regards,
Werner


re: Pointer from VT to my structur

From: [guido.klapperich@t...]
Date: Mon Apr 2, 2001 6:59 pm
Subject: Re: [VirtualTreeview] Pointer from VT to my structur

I have seen, that data has the type record, but I need a pointer.

Guido

Mike Lischke wrote:

> Hi Guido,
>
> > When I walk through my
> > internal tree, I can create a tree in VT with AddChild, that's no
> > problem. But when do I have to create the pointers between
> > TVNode and a Node in VT and in which direction ?
>
> After the call to AddChild returned you can use GetNodeData and create your
> node class for the new node. Don't forget to explicitely call ValidateNode.
> This is necessary to mark the node as being initialized which in turn is
> necessary so that OnFreeNode gets called. An this event is your only chance
> to free the attached node class.
>
> Ciao, Mike
>
>
> To unsubscribe from this group, send an email to:
> VirtualTreeview-unsubscribe@egroups.com
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/


OlesetClipboard(nil) in Clear

From: [teusjdejong@p...]
Date: Mon Apr 2, 2001 8:32 pm
Subject: OlesetClipboard(nil) in Clear

Mike,

First: thank you for making the dragmanager accessable. It works
great. But, you changed the code in TBaseVirtualTree.Clear. It now
says unconditionally SetOleClipboard(nil). In my application it means
that everytime I change a directory, files copied to the clipboard
are gone. (This was not the case in the old version). Could you
revert this possibly?

Teus de Jong

 | Replies | Author | Date
1024 | Re: OlesetClipboard(nil) in Clear | Mike Lischke | Tue 4/3/2001


CheckState

From: [guido.klapperich@t...]
Date: Mon Apr 2, 2001 9:34 pm
Subject: CheckState

Every Node in my VT point with his data-property to an TVNode-object.
TVNode has the property visible, which should be in the VT represented
with a checkbox. Now I change the visible-property of a TVNode and I
want, that the VT realizes this and change the State of the checkbox as
well. How can I do this ?

Guido

 | Replies | Author | Date
1012 | Re: CheckState | Werner Lehmann | Mon 4/2/2001
1014 | Re: CheckState | [guido.klapperich@t...] | Mon 4/2/2001
1015 | Re: CheckState | Werner Lehmann | Mon 4/2/2001


re: CheckState

From: Werner Lehmann [wl@b...]
Date: Mon Apr 2, 2001 10:24 pm
Subject: Re: [VirtualTreeview] CheckState

[guido.klapperich@t...] wrote:
>
> Every Node in my VT point with his data-property to an TVNode-object.
> TVNode has the property visible, which should be in the VT represented
> with a checkbox. Now I change the visible-property of a TVNode and I
> want, that the VT realizes this and change the State of the checkbox as
> well. How can I do this ?

Change the CheckState of the node record and call InvalidateNode.

Regards,
Werner


GetNodeData

From: [guido.klapperich@t...]
Date: Mon Apr 2, 2001 10:33 pm
Subject: GetNodeData

I have the problem, that I can't set the Node.Data-Pointer to nil.

Root:=VT.AddChild(nil);
VT.GetNodeData(Root);
Data:=nil;
.....
Data:=VT.GetNodeData(Root)
if Assigned(Data) then
....

The problem is, that Assigned(Data) is always true. What am I doing
wrong ?

Guido.

 | Replies | Author | Date
1016 | Re: GetNodeData | Werner Lehmann | Mon 4/2/2001
1017 | Re: GetNodeData | [guido.klapperich@t...] | Mon 4/2/2001
1018 | Re: GetNodeData | [guido.klapperich@t...] | Mon 4/2/2001
1020 | Re: GetNodeData | [tradsom@t...] | Mon 4/2/2001
1019 | Re: GetNodeData | [guido.klapperich@t...] | Mon 4/2/2001
1021 | Re: GetNodeData | Werner Lehmann | Tue 4/3/2001
1022 | Re: GetNodeData | Werner Lehmann | Tue 4/3/2001
1028 | Re: GetNodeData | Bender Heri | Tue 4/3/2001
1030 | Re: GetNodeData | Tony Cardaldaxx | Tue 4/3/2001


re: CheckState

From: [guido.klapperich@t...]
Date: Mon Apr 2, 2001 10:35 pm
Subject: Re: [VirtualTreeview] CheckState

> Change the CheckState of the node record and call InvalidateNode.
>

But then I need a reference from my TVNode to the Node in the VT.

Guido


re: CheckState

From: Werner Lehmann [wl@b...]
Date: Mon Apr 2, 2001 10:39 pm
Subject: Re: [VirtualTreeview] CheckState

[guido.klapperich@t...] wrote:
>
> > Change the CheckState of the node record and call InvalidateNode.
> >
>
> But then I need a reference from my TVNode to the Node in the VT.

Exactly.

Werner


re: GetNodeData

From: Werner Lehmann [wl@b...]
Date: Mon Apr 2, 2001 10:44 pm
Subject: Re: [VirtualTreeview] GetNodeData

[guido.klapperich@t...] wrote:
>
> I have the problem, that I can't set the Node.Data-Pointer to nil.
>
> Root:=VT.AddChild(nil);
> VT.GetNodeData(Root);

^^ unnecessary?

> Data:=nil;
> .....
> Data:=VT.GetNodeData(Root)
> if Assigned(Data) then
> ....
>
> The problem is, that Assigned(Data) is always true. What am I doing
> wrong ?

Use Data^ instead.

If you store pointers (references) to objects in the node data only you
may find these routines useful:

procedure SetObject(Tree: TBaseVirtualTree; Node: PVirtualNode; Obj: TObject);
var
Data: pointer;
begin
assert(Node <> nil);
Data := Tree.GetNodeData(Node);
assert(Data <> nil);
TObject(Data^) := Obj;
end;

function GetObject(Tree: TBaseVirtualTree; Node: PVirtualNode): TObject;
var
Data: pointer;
begin
assert(Node <> nil);
Data := Tree.GetNodeData(Node);
if Data = nil then
result := nil
else
result := TObject(Data^);
end;


re: GetNodeData

From: [guido.klapperich@t...]
Date: Mon Apr 2, 2001 10:56 pm
Subject: Re: [VirtualTreeview] GetNodeData

Moin Werner

Hast Du diese Routinen geschrieben oder sind das Standardroutinen von VT?
Nochmal zu meiner vorherigen Frage mit den Checkboxen. So etwas wie
OnGetCheckState (ähnlich wie OnGetText) gibt es nicht ?

Guido

>
> Use Data^ instead.
>
> If you store pointers (references) to objects in the node data only you
> may find these routines useful:
>
> procedure SetObject(Tree: TBaseVirtualTree; Node: PVirtualNode; Obj: TObject);
> var
> Data: pointer;
> begin
> assert(Node <> nil);
> Data := Tree.GetNodeData(Node);
> assert(Data <> nil);
> TObject(Data^) := Obj;
> end;
>
> function GetObject(Tree: TBaseVirtualTree; Node: PVirtualNode): TObject;
> var
> Data: pointer;
> begin
> assert(Node <> nil);
> Data := Tree.GetNodeData(Node);
> if Data = nil then
> result := nil
> else
> result := TObject(Data^);
> end;
>
>
> To unsubscribe from this group, send an email to:
> VirtualTreeview-unsubscribe@egroups.com
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/


re: GetNodeData

From: [guido.klapperich@t...]
Date: Mon Apr 2, 2001 10:59 pm
Subject: Re: [VirtualTreeview] GetNodeData

Mist, zu schnell auf Senden geklickt. Eins noch, was eigentlich Assert genau ?

Guido

 | Replies | Author | Date
1020 | Re: GetNodeData | [tradsom@t...] | Mon 4/2/2001


re: GetNodeData

From: [guido.klapperich@t...]
Date: Mon Apr 2, 2001 11:03 pm
Subject: Re: [VirtualTreeview] GetNodeData

Sorry, for my messages in german, I took the wrong address :-)

Guido

[guido.klapperich@t...] wrote:

> Moin Werner
>
> Hast Du diese Routinen geschrieben oder sind das Standardroutinen von VT?
> Nochmal zu meiner vorherigen Frage mit den Checkboxen. So etwas wie
> OnGetCheckState (ähnlich wie OnGetText) gibt es nicht ?
>
> Guido
>
> >
> > Use Data^ instead.
> >
> > If you store pointers (references) to objects in the node data only you
> > may find these routines useful:
> >
> > procedure SetObject(Tree: TBaseVirtualTree; Node: PVirtualNode; Obj:
TObject);
> > var
> > Data: pointer;
> > begin
> > assert(Node <> nil);
> > Data := Tree.GetNodeData(Node);
> > assert(Data <> nil);
> > TObject(Data^) := Obj;
> > end;
> >
> > function GetObject(Tree: TBaseVirtualTree; Node: PVirtualNode): TObject;
> > var
> > Data: pointer;
> > begin
> > assert(Node <> nil);
> > Data := Tree.GetNodeData(Node);
> > if Data = nil then
> > result := nil
> > else
> > result := TObject(Data^);
> > end;
> >
> >
> > To unsubscribe from this group, send an email to:
> > VirtualTreeview-unsubscribe@egroups.com
> >
> >
> >
> > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>
> To unsubscribe from this group, send an email to:
> VirtualTreeview-unsubscribe@egroups.com
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/


re: GetNodeData

From: [tradsom@t...]
Date: Mon Apr 2, 2001 11:05 pm
Subject: Re: GetNodeData

vãpará cueçe troço de escrevinhá eças gororoba aí! escrev en lengua
de gente sô!

--- In [VirtualTreeview@y...], [guido.klapperich@t...] wrote:
> Mist, zu schnell auf Senden geklickt. Eins noch, was eigentlich
Assert genau ?
>
>
> Guido


re: GetNodeData

From: Werner Lehmann [wl@b...]
Date: Mon Apr 2, 2001 11:08 pm
Subject: Re: [VirtualTreeview] GetNodeData

[guido.klapperich@t...] wrote:
>
> Moin Werner
>
> Hast Du diese Routinen geschrieben oder sind das Standardroutinen von VT?
> Nochmal zu meiner vorherigen Frage mit den Checkboxen. So etwas wie
> OnGetCheckState (ähnlich wie OnGetText) gibt es nicht ?

I am answering in english so others can participate. These routines are
not standard VT routines. I have built them to ease my life with object
references in node datas.

OnGetCheckState does not exist AFAIK. Maybe you can 'misuse' :) OnChecking.
BTW, I store a pointer to the virtual node in my private data structures.
Only 4 bytes. Saves you some trouble.

Werner


re: GetNodeData

From: Werner Lehmann [wl@b...]
Date: Mon Apr 2, 2001 11:09 pm
Subject: Re: [VirtualTreeview] GetNodeData

[guido.klapperich@t...] wrote:
>
> Mist, zu schnell auf Senden geklickt. Eins noch, was eigentlich Assert genau ?

See online help at assert. If the condition is evaluated to false it will
raise an exception with the exact position in the source code (file, line
number). If your application is in final state you can compile without
assertions (see compiler options) and avoid these checks.

Werner


re: FullExpand

From: Mike Lischke [public@l...]
Date: Tue Apr 3, 2001 7:43 am
Subject: RE: [VirtualTreeview] FullExpand

Hi Vadim,

> Mike, can you include new option to prevent full expansion by '*'?

Mmh, this is a valid request, but shouldn't this be a bit more consistent?
Say, there should be a switch for all key handling. Can you provide me at
least an idea how to implement this elegantly?

Ciao, Mike


re: OlesetClipboard(nil) in Clear

From: Mike Lischke [public@l...]
Date: Tue Apr 3, 2001 7:44 am
Subject: RE: [VirtualTreeview] OlesetClipboard(nil) in Clear

Hi Teus,

> First: thank you for making the dragmanager accessable. It works
> great. But, you changed the code in TBaseVirtualTree.Clear. It now
> says unconditionally SetOleClipboard(nil). In my application it means
> that everytime I change a directory, files copied to the clipboard
> are gone. (This was not the case in the old version). Could you
> revert this possibly?

Oops, I simply forgot the check for a pending clipboard operation in
SetClipboard. Included.

Ciao, Mike


Demo Source Can't Compile

From: cn [cn@m...]
Date: Tue Apr 3, 2001 8:12 am
Subject: Demo Source Can't Compile

Hi!

I need entry-level examples for VT as my self-learning tutorial
material. The demo I got from

http://www.lischke-online.de/VirtualTreeview.html

can't compile for project "Advanced.exe" with errors like
"VST2.GridLineColor Property does not exist".

Can any guru fix this demo? Or, what else entry-level examples should I
download and learn?

Regards,

CN

 | Replies | Author | Date
1026 | Re: Demo Source Can't Compile | Mike Lischke | Tue 4/3/2001
1027 | Re: Demo Source Can't Compile | cn | Tue 4/3/2001
1029 | Re: Demo Source Can't Compile | Steffen Binas | Tue 4/3/2001
1043 | Re: Demo Source Can't Compile | Mike Lischke | Wed 4/4/2001


re: Demo Source Can't Compile

From: Mike Lischke [public@l...]
Date: Tue Apr 3, 2001 8:20 am
Subject: RE: [VirtualTreeview] Demo Source Can't Compile

Hi CN,

> I need entry-level examples for VT as my self-learning tutorial
> material. The demo I got from
>
> http://www.lischke-online.de/VirtualTreeview.html
>
> can't compile for project "Advanced.exe" with errors like
> "VST2.GridLineColor Property does not exist".

I wonder which version of VT you are using currently. The demos can only be
compiled with version 1.31.

Ciao, Mike


re: Demo Source Can't Compile

From: cn [cn@m...]
Date: Tue Apr 3, 2001 9:47 am
Subject: Re: [VirtualTreeview] Demo Source Can't Compile

> > http://www.lischke-online.de/VirtualTreeview.html
> >
> > can't compile for project "Advanced.exe" with errors like
> > "VST2.GridLineColor Property does not exist".
>
> I wonder which version of VT you are using currently. The demos can only be
> compiled with version 1.31.
>
Thanks! Ciao,

I have downgrade to version 1.31 and got:

[Error] Main.pas(1317): Undeclared identifier:
'IncludeTrailingBackslash'

for line:

if FindFirst(IncludeTrailingBackslash(Data.FullPath) +} '*.*',
faAnyFile, SR) = 0 then

What did I do wrong?

Regards,

CN


re: GetNodeData

From: Bender Heri [HBender@E...]
Date: Tue Apr 3, 2001 10:02 am
Subject: RE: [VirtualTreeview] GetNodeData

> -----Original Message-----
> From: Werner Lehmann [mailto:[wl@b...]]
> Sent: Tuesday, April 03, 2001 1:08 AM
> To: VirtualTreeview@yahoogroups.com
> Subject: Re: [VirtualTreeview] GetNodeData
>
>
> BTW, I store a pointer to the virtual node in my private data
> structures.
> Only 4 bytes. Saves you some trouble.
>

So do I.

Heri


re: Demo Source Can't Compile

From: Steffen Binas [steffen.binas@a...]
Date: Tue Apr 3, 2001 9:59 am
Subject: Re: [VirtualTreeview] Demo Source Can't Compile

>if FindFirst(IncludeTrailingBackslash(Data.FullPath) +} '*.*',
-------------------------------------------------------^
You have forgotten to remove the }

MfG Steffen

eMail: [Steffen.Binas@a...]
Homepage: http://www.aquasoftware.de


re: GetNodeData

From: Tony Cardaldaxx [software@z...]
Date: Tue Apr 3, 2001 10:04 am
Subject: RE: [VirtualTreeview] GetNodeData

Heheh, I did too...

TagPtr: Pointer;

May be something to include in the next release???

> -----Original Message-----
> From: Bender Heri [mailto:[HBender@E...]]
> Sent: Tuesday, April 03, 2001 12:02
> To: '[VirtualTreeview@yahoogroups.com'
> Subject: RE: [VirtualTreeview] GetNodeData
>
>
> > -----Original Message-----
> > From: Werner Lehmann [mailto:wl@b...]]
> > Sent: Tuesday, April 03, 2001 1:08 AM
> > To: VirtualTreeview@yahoogroups.com
> > Subject: Re: [VirtualTreeview] GetNodeData
> >
> >
> > BTW, I store a pointer to the virtual node in my private data
> > structures.
> > Only 4 bytes. Saves you some trouble.
> >
>
> So do I.
>
> Heri


Checkboxes

From: [guido.klapperich@t...]
Date: Tue Apr 3, 2001 2:01 pm
Subject: Checkboxes

When I click on a Checkbox, it first becomes gray and in the
OnButtonUp-Event it changes its state. It is possible, to turn this
gray-flickering off, I don't want any gray state.
Is it possible to change the space between the checkbox, the image and
the text ?

Guido.

 | Replies | Author | Date
1033 | Re: Checkboxes | Werner Lehmann | Tue 4/3/2001
1035 | Re: Checkboxes | [guido.klapperich@t...] | Tue 4/3/2001
1041 | Re: Checkboxes | Mike Lischke | Wed 4/4/2001


re: FullExpand

From: "Vadim Sedulin" [wsntrl@o...]
Date: Tue Apr 3, 2001 3:23 pm
Subject: Re: [VirtualTreeview] FullExpand

Hello!

> > Mike, can you include new option to prevent full expansion by '*'?
>
> Mmh, this is a valid request, but shouldn't this be a bit more consistent?
> Say, there should be a switch for all key handling. Can you provide me at
> least an idea how to implement this elegantly?

Maybe new event? Something like

TKeyAction = (kaIgnore, kaEdit, kaFullExpand, kaFullCollapse, ...);
TVTKeyHandler = procedure (Sender: TBaseVirtualTree; Key: Word; Shift:
TShiftState;
var Action: TKeyAction) of object;

But anyway, FullExpand is so critical to db and other complex trees and
needed so often that it must be configurable at design time.

btw: sorry for my english.

Bye.

Vadim Sedulin
E-Mail: [wsntrl@o...]


re: Checkboxes

From: Werner Lehmann [wl@b...]
Date: Tue Apr 3, 2001 3:36 pm
Subject: Re: [VirtualTreeview] Checkboxes

[guido.klapperich@t...] wrote:
>
> When I click on a Checkbox, it first becomes gray and in the
> OnButtonUp-Event it changes its state. It is possible, to turn this
> gray-flickering off, I don't want any gray state.

I like the gray interim look. If I disallow the check for some nodes
the user still gets some visual feedback that he really clicked on the
checkbox. Furthermore, I like it as a sort of 'toggle animation'.

> Is it possible to change the space between the checkbox, the image and
> the text ?

There is a property which sets some space values, maybe Margin or Spacing,
I don't recall it at the moment and have no delphi installed on this
machine.

Werner


OLE DnD, some questions.

From: [tias@m...]
Date: Tue Apr 3, 2001 3:47 pm
Subject: OLE DnD, some questions.

Hi !

Since the VCL-DnD doesn't work with multiselect, I'm forced to use the
OLE instead, thus, I have a couple of questions :

1: If I press the left MB and start to drag (that is, select & drag at
the same time) the node is selected but it is not dragged. I have to
first click the node (LMB down and up) then I have to click&drag it
and then it works. Why this behaviour ?

2: When multiselecting nodes (with CTRL and/or SHIFT) it behaves
similar to the issue above, if CTRL and/or SHIFT is pressed when I
start to drag, no drag operation occurs. Why is that ?

3: Can I force the beautiful dragimage to be drawn when the
mouspointer is outside the Tree ? I want to display it dureng the
whole Drag'n'Drop operation, not just withing the Tree. I'm dragging
from a CustomVirtualStringTree descendant to other VirtualStringTrees
and about 10 different VCL-classes or descendants of VCL-classes ?

That's it for this time !

TIA,
Mathias Thorell

 | Replies | Author | Date
1040 | Re: OLE DnD, some questions. | Mike Lischke | Wed 4/4/2001
1047 | Re: OLE DnD, some questions. | [tias@m...] | Wed 4/4/2001
1051 | Re: OLE DnD, some questions. | Mike Lischke | Wed 4/4/2001
1054 | Re: OLE DnD, some questions. | [tias@m...] | Wed 4/4/2001
1050 | Re: OLE DnD, some questions. | Vadim Sedulin | Wed 4/4/2001
1053 | Re: OLE DnD, some questions. | Mike Lischke | Wed 4/4/2001
1055 | Re: OLE DnD, some questions. | Vadim Sedulin | Wed 4/4/2001
1057 | Re: OLE DnD, some questions. | Mike Lischke | Thu 4/5/2001
1058 | Re: OLE DnD, some questions. | Mike Lischke | Thu 4/5/2001


re: Checkboxes

From: [guido.klapperich@t...]
Date: Tue Apr 3, 2001 6:04 pm
Subject: Re: [VirtualTreeview] Checkboxes

> I like the gray interim look. If I disallow the check for some nodes
> the user still gets some visual feedback that he really clicked on the
> checkbox. Furthermore, I like it as a sort of 'toggle animation'.
>

Fine :-) But can I disable the gray-state or not ?

> There is a property which sets some space values, maybe Margin or Spacing,
> I don't recall it at the moment and have no delphi installed on this
> machine.

It's margin, but this only affects the space between TreeLine and the
Checkbox. Exists a way to change the space between the image and the text ?

Guido


re: Sort Gap (Was: Re: $1 again)

From: "Robert Palmqvist" [robert.palmqvist@h...]
Date: Wed Apr 4, 2001 9:15 pm
Subject: Re: Sort Gap (Was: Re: [VirtualTreeview] $1 again)

About the demo I started to build, sad to say but I have been away for a
while and I am quite busy at my job right now so I haven't had any time to
work on the demo lately. It was not possible to repeat the bug in my initial
code with version 2.3 of VT but it only contained 2000 rows and two columns.
My real application, where I experience the bug all the time, has a lot of
columns and around 2400 rows. I tried to implement dynamic columns but I
then run in to some troubles, the Column argument in OnGetText is then
turned in to -1 all the time! That was more or less how far I got before I
had to concentrate on my regular job. I hope I can be of some help when I
finally get some spare time...

/ Rob

----- Original Message -----
From: "Werner Lehmann" [wl@b...]
To: <VirtualTreeview@yahoogroups.com>
Sent: Monday, April 02, 2001 2:27 AM
Subject: Re: Sort Gap (Was: Re: [VirtualTreeview] $1 again)

> Mike Lischke wrote:
> >
> > > Here is one important thing that I found out: if the list is messed up
with
> > > the gap I can remove that gap by minimizing and restoring the
application.
> > > Everything looks ok then.
> >
> > Sounds interesting. The only effect it can have on VT, I think, is the
WM_SIZE message. But this is
> > not enough information to find out whats wrong. Werner, if you cannot
provide a sample application
> > then it should be easy to find out what happens by scrolling the tree so
that it is showing the gap
> > and then set a break point in PaintTree where DoPaintNode is called. Is
this method really called
> > and what does the string tree try to paint then?
>
> You mean 'if I can' probably. I would prefer if you could help me to find
that bug
> by myself. I believe that this will be easier than trying to isolate it in
a
> demo; remember that it is not very common and is likely to vanish if I try
that with
> quite some work (maybe hours). Since Robert Palmquist is experiencing the
same
> problem: what turned out with his little demo? Can't we use that one? I
have tried
> to create a little test with two columns and the sorting and the display
work as
> expected (no problem except a superfluous horz scrollbar even if both
columns fill
> only two thirds of the client width).
>
> I have set a breakpoint to DoPaintNode (setting the breakpoint makes my
application
> loose focus and I have to press F9 VisibleColCount * VisibleRowCount times
before
> I can move on). I do this only if I am quite sure that the problem occurs
after the
> next sort process.
>
> It turns out that DoPaintNode reflects what I see in the VTree: the first
node which
> is the old first node before the sort (which is wrong) is painted first.
And it is
> PaintInfo.Column <> -1 so the line
>
> Text := FColumnData[PaintInfo.Position].Text;
>
> executes. This is were the wrong text comes from which was valid before
the sort.
> All further nodes are not painted (or to be more precise: only the
clientarea is
> cleared). That means DoPaintNode is not called for any other nodes but the
first
> one.
>
> It is now interesting to step through after the last (partially) visible
column
> of this first node has been painted. Eventually this code executes:
>
> procedure TBaseVirtualTree.PaintTree(TargetCanvas: TCanvas; Window: TRect;
> Target: TPoint; PaintOptions: TPaintOptions);
> ...
> // advance to next visible node
> Temp := GetNextVisible(PaintInfo.Node);
> if Assigned(Temp) then
> ...
>
> GetNextVisible returns nil now. The remaining execution sequence is then
clear and
> explains what happens: the rest of the VTree is cleared, no nodes are
painted.
>
> I am stepping through GetNextVisible and find this:
>
> function TBaseVirtualTree.GetNextVisible(Node: PVirtualNode):
PVirtualNode;
> ...
> repeat
> // Is there a next sibling?
> if Assigned(Result.NextSibling) then <---- false
> ...
> else
> begin
> // No sibling anymore, so use the parent's next sibling.
> if Result.Parent <> FRoot then <---- false
> Result := Result.Parent
> else
> begin
> // There are no further nodes to examine, hence there is no
further visible node.
> Result := nil; <---- this is the nil that the method returns
> Break;
>
> Result (which is the first node) has nil .NextSibling member. This is
probably
> not ok although I am not sure. Remember that I (and Robert as well) use
the VTree
> as a listview here (=all nodes are top level nodes and direct root
childs).
>
> It is getting late now and I stop the search here. I hope that you have
any idea
> on how to proceed now.
>
> > > BTW, could you make the Owner of TVTHeader a public
> > > read-only property?
> >
> > There is a property TVTHeader.Treeview.
>
> Blind as I am I have to say sorry. Mea culpa...
>
> Regards,
> Werner
>
>
>
> To unsubscribe from this group, send an email to:
> VirtualTreeview-unsubscribe@egroups.com
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>
>


Hidden columns

From: "Anthony Mills" [amills@m...]
Date: Tue Apr 3, 2001 11:14 pm
Subject: Hidden columns

Mike,

I just upgraded from 2.1 to 2.3, and everything works except for one thing:
hidden columns. They still hide, but the program acts as if they're still
around sometimes.

For example, the width doesn't take the hidden columns into consideration,
and the non-client hit testing that changes the cursor to the splitter and
allows you to resize columns acts as if the hidden column was present ...
but instead of resizing the hidden column, you're resizing a non-hidden
column.

It's a little hard to explain, but perhaps TVirtualTreeColumns.TotalWidth
needs to be hidden-column-aware.

Thanks for including the double-click autoresizing of columns!

Regards,

Tony

 | Replies | Author | Date
1044 | Re: Hidden columns | Mike Lischke | Wed 4/4/2001


re: Drag Image problems

From: Mike Lischke [public@l...]
Date: Wed Apr 4, 2001 12:31 pm
Subject: RE: [VirtualTreeview] Drag Image problems

Hi Jim,

> 1) Run the VET demo you created. Make it fill screen and open enough
> to fill the screen vertically. Set the Taskbar so it Auto Hides
> itself. Grab a few folders and drag to the bottom. Wait for the
> taskbar to pop up. Now drag back into the VET, allowing the drag
> image to remain in the area of the Taskbar.

Well, unfortunately I don't have total control over the system. This would
be the only way to make it working in such cases too. Because VT does not
use layered windows (they are only available on W2K, Whistler and up) we
have to live with the unfortunate fact that changing the screen in an area
which currently covered by the drag image destroys the otherwise perfect
illusion it would really be transparent.

> 2) Next open a single window program.

This is the very same problem as in 1). To make the transparent drag image
work there must be no changes in the part of the screen which is currently
covered by the drag image. This is usually the case but there are some
seldom exceptions. One is the animated task bar. Another one is switching
applications using the task manager (via Alt+Tab).

> 3) Also drag some folders and allow the VET to auto scroll to it
> limits. It may take some playing around with the window height but
> you can make it do what I explained last week. The display does not
> actually scroll to the limit but the VT thinks it does.

This is a very mysterious problem. I can reliably create this effect and I
also know meanwhile that the tree indeed scrolls to its limits as far as
possible. Only the image is not updated and I don't know why. So far I have
not found anything which could cause this problem and since this is a very
dynamic process it is extremely difficult to debug.

Ciao, Mike


re: Sort Gap (Was: Re: $1 again)

From: Mike Lischke [public@l...]
Date: Wed Apr 4, 2001 12:33 pm
Subject: RE: Sort Gap (Was: Re: [VirtualTreeview] $1 again)

Hi Werner,

> Yes, DoValidateCache is called once per 'header sort click'.
> What's more, the problem is gone :) No gap anymore.

Excellent. Hopefully this is final now :o]

> Should I try anything else?

No. Why?

Ciao, Mike


re: OLE DnD, some questions.

From: Mike Lischke [public@l...]
Date: Wed Apr 4, 2001 12:49 pm
Subject: RE: [VirtualTreeview] OLE DnD, some questions.

Hi Mathias,

> Since the VCL-DnD doesn't work with multiselect, I'm forced
> to use the OLE instead,

This was a simple bug. Meanwhile also VCL drag'n drop does work with
multiselect.

> 1: If I press the left MB and start to drag (that is, select
> & drag at the same time) the node is selected but it is not dragged. I
have to
> first click the node (LMB down and up) then I have to click&drag it
> and then it works. Why this behaviour ?

I don't know. I can't even reproduce this behaviour. Perhaps it was also a
bug, but I never heard about that, nor have I encountered it myself. OLE
drag'n drop has worked all the time.

> 2: When multiselecting nodes (with CTRL and/or SHIFT) it behaves
> similar to the issue above, if CTRL and/or SHIFT is pressed when I
> start to drag, no drag operation occurs. Why is that ?

This is by design. Multiselection and dragging should strictly set apart. If
you want to modify the outcome of the drag operation (move, copy, link) then
first start dragging and then press Ctrl, Shift and/or Alt.

> 3: Can I force the beautiful dragimage to be drawn when the
> mouspointer is outside the Tree ?

Unfortunately not. And this image is only available for OLE drag'n drop. The
VCL implementation is only patch work, particularly when you compare
pre-docking code with the current code. This is not one of the most famous
parts of the VCL, so to speak.

>I want to display it dureng the whole Drag'n'Drop operation, not just
withing the Tree. I'm dragging
> from a CustomVirtualStringTree descendant to other VirtualStringTrees
> and about 10 different VCL-classes or descendants of VCL-classes ?

Basically, you could leave the drag image enabled (it is switched off in
TBaseDragDropManager.DragLeave). The only but most serious reason for this
is that the tree does not get notfied about changes in the window(s) which
are currently under the drag image. If it is a VT then drag source and
target can communicate with each other (and are very often even the same
tree). For other windows, however, this is not possible.

Ciao, Mike

 | Replies | Author | Date
1047 | Re: OLE DnD, some questions. | [tias@m...] | Wed 4/4/2001
1051 | Re: OLE DnD, some questions. | Mike Lischke | Wed 4/4/2001
1054 | Re: OLE DnD, some questions. | [tias@m...] | Wed 4/4/2001


re: Checkboxes

From: Mike Lischke [public@l...]
Date: Wed Apr 4, 2001 12:56 pm
Subject: RE: [VirtualTreeview] Checkboxes

Hi Guido,

> Fine :-) But can I disable the gray-state or not ?

Only if you modify the source code. In GetCheckImage there is the
expression:

Result := CheckStateToCheckImage[Node.CheckType, Node.CheckState,
(vsDisabled in Node.States) or
(Node = FCheckNode) or not Enabled];

Remove "or (Node = FCheckNode)" to get rid of the intermediate image.

Ciao, Mike


Expand a Node

From: [guido.klapperich@t...]
Date: Wed Apr 4, 2001 1:05 pm
Subject: Expand a Node

Exists a way to expand only one specific Node, all I have found, is
FullExpand ?

Guido.

 | Replies | Author | Date
1045 | Re: Expand a Node | Mike Lischke | Wed 4/4/2001
1048 | Re: Expand a Node | [guido.klapperich@t...] | Wed 4/4/2001
1052 | Re: Expand a Node | Mike Lischke | Wed 4/4/2001
1049 | Re: Expand a Node | [guido.klapperich@t...] | Wed 4/4/2001


re: Demo Source Can't Compile

From: Mike Lischke [public@l...]
Date: Wed Apr 4, 2001 1:18 pm
Subject: RE: [VirtualTreeview] Demo Source Can't Compile

Hi cn,

> Thanks! Ciao,

"Ciao" must be a common name in China, Taiwan etc. You are the second one
who uses a greeting phrase as name. No, my real name is Mike and in italian
"ciao" is used to say "hello" as well as "good bye" (no, I'm not an italian,
but in my company we have lots of foreigners and one gets influenced by them
:o])

> [Error] Main.pas(1317): Undeclared identifier:
> 'IncludeTrailingBackslash'

IncludeTrailingBackslash is a new utility function in Delphi 5 which adds a
trailing backslash to a string if there is not yet one. Simple to rewrite
for Delphi 4.

Ciao, Mike


re: Hidden columns

From: Mike Lischke [public@l...]
Date: Wed Apr 4, 2001 1:21 pm
Subject: RE: [VirtualTreeview] Hidden columns

Hi Anthony,

> I just upgraded from 2.1 to 2.3, and everything works except
> for one thing:
> hidden columns. They still hide, but the program acts as if
> they're still around sometimes.

Sorry, this was some forgotten stuff. Thank you for reminding me.

Ciao, Mike


re: Expand a Node

From: Mike Lischke [public@l...]
Date: Wed Apr 4, 2001 1:29 pm
Subject: RE: [VirtualTreeview] Expand a Node

> Exists a way to expand only one specific Node, all I have found, is
> FullExpand ?

Would

property Expanded

be of help?

Ciao, Mike


re: FullExpand

From: Mike Lischke [public@l...]
Date: Wed Apr 4, 2001 1:49 pm
Subject: RE: [VirtualTreeview] FullExpand

Hi Vadim,

> Maybe new event? Something like

Ok, I have used your idea. Basically, there is no need to distinguish
between all those different key events (and it could also become a
maintenance problem when adding new events). I have just introduced an
OnKeyAction event which has a parameter DoDefault which is True by default
(for backward compatibility). An application can check the provided char
code and shift state and set DoDefault to False if required.

I think this should do the job.

Ciao, Mike


re: OLE DnD, some questions.

From: [tias@m...]
Date: Wed Apr 4, 2001 4:49 pm
Subject: Re: OLE DnD, some questions.

--- In [VirtualTreeview@y...], Mike Lischke [public@l...] wrote:
> Hi Mathias,
>
> > Since the VCL-DnD doesn't work with multiselect, I'm forced
> > to use the OLE instead,
>
> This was a simple bug. Meanwhile also VCL drag'n drop does work with
> multiselect.

How ? I've seen some postings about this (dtVCL & MultiSelect) and I
got the impression that it wasn't working (and it's not, at least not
for me, v2.3, setting DragType = dtVCL and adding Multiselect in the
options doesn't work; All nodes that are selected except the one I'm
clicking on when I start the DnD are unselected).
Or am I doing something completly wrong here (most likely ;---) ?

> I don't know. I can't even reproduce this behaviour. Perhaps it was
also a
> bug, but I never heard about that, nor have I encountered it myself.
OLE
> drag'n drop has worked all the time.

Ok, I'll try to dig a little bit deeper to see what's happening...

> > 2: When multiselecting nodes (with CTRL and/or SHIFT) it behaves
> > similar to the issue above, if CTRL and/or SHIFT is pressed when I
> > start to drag, no drag operation occurs. Why is that ?
> This is by design. Multiselection and dragging should strictly set
apart. If
> you want to modify the outcome of the drag operation (move, copy,
link) then
> first start dragging and then press Ctrl, Shift and/or Alt.

But I'm not working with a internal DnD here, it's from the VT to
other VCL-objects...
Just curious; Why select a different design from, for example, a
normal listview ?

<snip>

Best regards...

/Mathias Thorell

 | Replies | Author | Date
1051 | Re: OLE DnD, some questions. | Mike Lischke | Wed 4/4/2001
1054 | Re: OLE DnD, some questions. | [tias@m...] | Wed 4/4/2001


re: Expand a Node

From: [guido.klapperich@t...]
Date: Wed Apr 4, 2001 4:59 pm
Subject: Re: [VirtualTreeview] Expand a Node

From which class is this property. TvirtualNode have no such property.
In the FullExpand-Method I can set a parameter Node, for what is he needed ?

Guido.

Mike Lischke wrote:

> > Exists a way to expand only one specific Node, all I have found, is
> > FullExpand ?
>
> Would
>
> property Expanded
>
> be of help?
>
> Ciao, Mike
>
>
> To unsubscribe from this group, send an email to:
> VirtualTreeview-unsubscribe@egroups.com
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/

 | Replies | Author | Date
1052 | Re: Expand a Node | Mike Lischke | Wed 4/4/2001


re: Expand a Node

From: [guido.klapperich@t...]
Date: Wed Apr 4, 2001 5:10 pm
Subject: Re: [VirtualTreeview] Expand a Node

I got it, ToggleNode is what I have been looking for.

Guido

[guido.klapperich@t...] wrote:

> >From which class is this property. TvirtualNode have no such property.
> In the FullExpand-Method I can set a parameter Node, for what is he needed ?
>
> Guido.
>
> Mike Lischke wrote:
>
> > > Exists a way to expand only one specific Node, all I have found, is
> > > FullExpand ?
> >
> > Would
> >
> > property Expanded
> >
> > be of help?
> >
> > Ciao, Mike
> >
> >
> > To unsubscribe from this group, send an email to:
> > VirtualTreeview-unsubscribe@egroups.com
> >
> >
> >
> > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>
> To unsubscribe from this group, send an email to:
> VirtualTreeview-unsubscribe@egroups.com
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/


re: OLE DnD, some questions.

From: "Vadim Sedulin" [wsntrl@o...]
Date: Wed Apr 4, 2001 6:15 pm
Subject: Re: [VirtualTreeview] OLE DnD, some questions.

Hello Mike!

>Basically, you could leave the drag image enabled (it is switched off in
>TBaseDragDropManager.DragLeave). The only but most serious reason for this
>is that the tree does not get notfied about changes in the window(s) which
>are currently under the drag image. If it is a VT then drag source and
>target can communicate with each other (and are very often even the same
>tree). For other windows, however, this is not possible.

What kind of notifications? Maybe SetWindowsHookEx can help you?

One more question about D&D:
Can you implement D&D by right mouse button (without voRightClickSelect)?

Bye.

Vadim Sedulin
E-Mail: [wsntrl@o...]

 | Replies | Author | Date
1053 | Re: OLE DnD, some questions. | Mike Lischke | Wed 4/4/2001


re: Re: OLE DnD, some questions.

From: "Mike Lischke" [public@l...]
Date: Wed Apr 4, 2001 7:03 pm
Subject: RE: [VirtualTreeview] Re: OLE DnD, some questions.

> How ? I've seen some postings about this (dtVCL & MultiSelect) and I
> got the impression that it wasn't working
> Or am I doing something completly wrong here (most likely ;---) ?

No, you simply don't have the latest source ;-) The bug I mentioned has only
recently been removed
and was related to the fact that VCL dd requires to send a mouse up message
(where it still is in
the mouse down message). This mouse up message then cleared the selection. I
have included a new
internal state for VCL multi select dd to work. I need to fix some other minor
stuff, however,
before I'll upload a new build. Usually there is every weekend at least one
upload.

> But I'm not working with a internal DnD here, it's from the VT to
> other VCL-objects...
> Just curious; Why select a different design from, for example, a
> normal listview ?

Well, it makes sense and is easier to implement. Do you think changing this
behaviour justifies the
effort?

Ciao, Mike

 | Replies | Author | Date
1054 | Re: OLE DnD, some questions. | [tias@m...] | Wed 4/4/2001


re: Expand a Node

From: "Mike Lischke" [public@l...]
Date: Wed Apr 4, 2001 7:08 pm
Subject: RE: [VirtualTreeview] Expand a Node

Guido,

> From which class is this property. TvirtualNode have no such property.
> In the FullExpand-Method I can set a parameter Node, for what is he needed ?

You should utilize your IDE search facility a bit more. Press Ctrl+F, copy &
paste "property
Expanded" into the edit and let it search. You will be at the right place
within 5 seconds (depends
on your copy'n paste speed). The first hit is also the correct one :-)

TVirtualNode is not a class and can therefor not have any property. The
difficult task to learn
using VT will be much easier when you accept that (with exception of a few
header related things)
everything regarding a tree node is handled by the tree itself.

Ciao, Mike


re: OLE DnD, some questions.

From: "Mike Lischke" [public@l...]
Date: Wed Apr 4, 2001 7:11 pm
Subject: RE: [VirtualTreeview] OLE DnD, some questions.

> What kind of notifications? Maybe SetWindowsHookEx can help you?

For instance when the content of the current drop target changes due to
scrolling. However, in my
eyes it is a sin to set a system hook for a single control. I have worked with
system hooks long
before they became so popular by some Delphi programmers and think they are
mostly misused. No
offense intended!

> One more question about D&D:
> Can you implement D&D by right mouse button (without voRightClickSelect)?

It is already implemented (also for the middle mouse button). Just enable right
click select and
middle click select.

Ciao, Mike


re: OLE DnD, some questions.

From: [tias@m...]
Date: Wed Apr 4, 2001 7:43 pm
Subject: Re: OLE DnD, some questions.

--- In [VirtualTreeview@y...], "Mike Lischke" [public@l...] wrote:
> No, you simply don't have the latest source ;-) The bug I mentioned
has only recently been removed
> and was related to the fact that VCL dd requires to send a mouse up
message (where it still is in
> the mouse down message). This mouse up message then cleared the
selection. I have included a new
> internal state for VCL multi select dd to work. I need to fix some
other minor stuff, however,
> before I'll upload a new build. Usually there is every weekend at
least one upload.

Perfect ! (BTW: How many hours does a day have for you & VT ? 120 ?
Seems to me that you're spending both day & night with VT... :--).

> > But I'm not working with a internal DnD here, it's from the VT to
> > other VCL-objects...
> > Just curious; Why select a different design from, for example, a
> > normal listview ?

> Well, it makes sense and is easier to implement.

I don't agree completly with that (from a programmers view: Yes, as a
user: Nope). I find myself from time to time "emulating" odd Windows
behaviour in my components, just to keep my users happy & singing...
;-> They always start to disturb me when I'm "improving" some
"well-known-and-annoying-behaviour-that-I'm-so-used-to-anyway"....

> Do you think changing this behaviour justifies the
> effort?

Not at all, it's just very confusing for the users... ;-)

/Mathias Thorell


re: OLE DnD, some questions.

From: "Vadim Sedulin" [wsntrl@o...]
Date: Wed Apr 4, 2001 8:48 pm
Subject: Re: [VirtualTreeview] OLE DnD, some questions.

Hello Mike!

>> What kind of notifications? Maybe SetWindowsHookEx can help you?

> For instance when the content of the current drop target changes due to
scrolling. However, in my
> eyes it is a sin to set a system hook for a single control. I have worked
with system hooks long
> before they became so popular by some Delphi programmers and think they
are mostly misused. No
> offense intended!

Yes, I know. But my UI designer told me: "Looks splendid! But if you cannot
make it look like this all time, then take it away, because users will be
disappointed". And he's right!
Well, forget it. I'll try to realize it by myself.

> One more question about D&D:
> Can you implement D&D by right mouse button (without voRightClickSelect)?

> It is already implemented (also for the middle mouse button). Just enable
right click select and
> middle click select.

No-no-no! WITHOUT right/middle click SELECT. Just drag.

Bye.

Vadim Sedulin
E-Mail: [wsntrl@o...]


Scrolling slow & memory problem?

From: [d.lindsey@d...]
Date: Thu Apr 5, 2001 12:53 am
Subject: Scrolling slow & memory problem?

Hi Mike,
I always feel guilty asking you questions given the number of
questions you get hourly! But here goes. As I mentioned earlier I
have been using VTree for an Interbase display (not the IBO one
already written) just a simple SQL read and load into the VTree.
Anyway, I retrieve 8000 records and have a node data record with 4
strings, 3 boolean, & 5 integers. For this the scrolling appears
really slow and jaggered and when scrolled about halfway down the
rest of the node display blanks as if the data record has null values.
There is only two level of nodes, top one is just to indicate which
table is being displayed, next level of nodes represents each record
returned from the SQL statement.
There is no special paint node events and the OnGetText just moves in
the data record fields (nothing fancy). If the number of records
returned by the SQL is only a few things go ok, but at this number I
have the problems.
Now I have cut down the length of text insert in the string fields of
the node's data and had some improvement so my thinking is that there
is a relationship to memory management. But I have tested the VTree
Explorer and that works fine even with the large number of files I
have on my machine (e.g. Windows system directory). So my money is on
the fact that I am doing something wrong, rather than the component.
Is there anyway to instruct VTree on allocating the memory required?
I do precount the database records to set the childcount and
haschildren indicators so I dont think that the problem.
The reason why I am concerned is that I believe I could use VTree as
a replacment for all the datagrids I currenly use in apps.
Thanks in advance
David

 | Replies | Author | Date
1059 | Re: Scrolling slow & memory problem? | Mike Lischke | Thu 4/5/2001


re: OLE DnD, some questions.

From: Mike Lischke [public@l...]
Date: Thu Apr 5, 2001 7:48 am
Subject: RE: [VirtualTreeview] OLE DnD, some questions.

Hi Vadim,

> Yes, I know. But my UI designer told me: "Looks splendid! But
> if you cannot make it look like this all time, then take it away, because
> users will be disappointed". And he's right!

Mmmh, while I understand your UI designer I think it is a but too much like
either black or white, no grays. If for some reason you can make a feature
only work in a particular context but not in another then I think the
reaction should not be "all or nothing", but "great at least here it works"
:-)

> Well, forget it. I'll try to realize it by myself.

Try your luck and tell me if you found out something different than I did.

> No-no-no! WITHOUT right/middle click SELECT. Just drag.

Huh? To drag something you have to react to a mouse click. You can enable
right and middle mouse button to behave very much like the left mouse
button.

Ciao, Mike


re: Re: OLE DnD, some questions.

From: Mike Lischke [public@l...]
Date: Thu Apr 5, 2001 8:06 am
Subject: RE: [VirtualTreeview] Re: OLE DnD, some questions.

Hi Mathias,

> Perfect ! (BTW: How many hours does a day have for you & VT ? 120 ?
> Seems to me that you're spending both day & night with VT... :--).

Oooh, not that much anymore. Whenever I have an hour (or need it in that
very moment) then I fix a bug or build in a new feature during my regular
work time. Things which need a bit longer because for some conceptual
preparation are solved when I relax in the shower or while driving home :-)

> > Do you think changing this behaviour justifies the
> > effort?
> Not at all, it's just very confusing for the users... ;-)

Well, I don't feel like implementing it but I take it in my todo list.
Perhaps I can find another hour to implement it.

Ciao, Mike


re: Scrolling slow & memory problem?

From: Mike Lischke [public@l...]
Date: Thu Apr 5, 2001 8:15 am
Subject: RE: [VirtualTreeview] Scrolling slow & memory problem?

Hi David,

> As I mentioned earlier I
> have been using VTree for an Interbase display (not the IBO one
> already written) just a simple SQL read and load into the VTree.
> For this the scrolling appears
> really slow and jaggered and when scrolled about halfway down the
> rest of the node display blanks as if the data record has null values.

I'm not sure I really understand. Firstly, I assume that the display value
is retrieved on the fly from the database, right? This of course will make
the tree slow when scrolling and your database connection is not very quick.

For the blank display however I have no explanation. Are you sure it is not
related to the gap/sort problem we recently discussed here?

> Now I have cut down the length of text insert in the string fields of
> the node's data and had some improvement so my thinking is that there
> is a relationship to memory management.

Oh, I don't think there is something related. The string data must be huge
(several mega bytes) if it should have an impact on the tree.

> Is there anyway to instruct VTree on allocating the memory required?

Depends. If it is the memory for each node then you can set the size of
additional memory to be allocated via NodeDataSize. For application defined
data however, this is not under control of VT (e.g. how strings are
managed).

> The reason why I am concerned is that I believe I could use VTree as
> a replacment for all the datagrids I currenly use in apps.

As I already said in another thread, using a database as backend for VT one
will not come around to cache some values to keep response time low. The
most challenging task here is to find a good cache mechanism to keep a good
ratio between memory usage and speed.

Ciao, Mike


Sophisticated ShortenString

From: Bender Heri [HBender@E...]
Date: Thu Apr 5, 2001 9:16 am
Subject: Sophisticated ShortenString

Hi Mike

In my tree I have to display file names (with full path).

I want to let the user choose from the following kinds of display:

1: ...OSS\Testdaten\Test Daten\TestTerminalErgo\98000024.eco
2: Z:\Data\...stdaten\Test Daten\TestTerminalErgo\98000024.eco
3: Z:\Data\Cash\VELOBOSS\Testdaten\Test Daten\TestTermi...

How about a new event OnShortenString?

Line 18513: (PaintNormalText)
-----------------------------
instead of
Text := ShortenString(Canvas.Handle, Text, NodeRect.Right - NodeRect.Left
- 2, UseRightToLeftReading);
new:
Text := DoShortenString(Canvas.Handle, Text, NodeRect.Right -
NodeRect.Left - 2, UseRightToLeftReading);

function TCustomVirtualStringTree.DoShortenString(DC: HDC; const S:
WideString; Width: Integer; RightToLeft: Boolean): WideString;
var
Done : Boolean;
begin
Done := False;
if Assigned(FOnShortenString) then
FOnShortenString(DC,S,Width,RightToLeft,Result,Done);
if not done then
Result := ShortenString(DC,S,Width,RightToLeft);
end;

Heri Bender

 | Replies | Author | Date
1065 | Re: Sophisticated ShortenString | Mike Lischke | Fri 4/6/2001


re: OLE DnD, some questions.

From: "Vadim Sedulin" [wsntrl@o...]
Date: Thu Apr 5, 2001 2:51 pm
Subject: Re: [VirtualTreeview] OLE DnD, some questions.

Hello Mike!

>> Yes, I know. But my UI designer told me: "Looks splendid! But
>> if you cannot make it look like this all time, then take it away, because
>> users will be disappointed". And he's right!

> Mmmh, while I understand your UI designer I think it is a but too much
like
> either black or white, no grays. If for some reason you can make a feature
> only work in a particular context but not in another then I think the
> reaction should not be "all or nothing", but "great at least here it
works"
> :-)

"All or nothing" is our national trait. Don't you ever see EXE with about
100K code and 19M AVI, huh?

>> Well, forget it. I'll try to realize it by myself.

> Try your luck and tell me if you found out something different than I did.

Ok. (transparent/moveable window, maybe?)

>> No-no-no! WITHOUT right/middle click SELECT. Just drag.

> Huh? To drag something you have to react to a mouse click. You can enable
> right and middle mouse button to behave very much like the left mouse
> button.

No. Let me explain: all I want as reaction on right-click is DoBeforeDrag
and BeginDrag (if currently selected nodes can be dragged). Without any
changes to focus/selection, without shift/control checks. Just drag, and no
more "press shift AFTER blah-blah-blah".

Bye.

Vadim Sedulin
E-Mail: [wsntrl@o...]


re: Kylix

From: [rob@f...]
Date: Thu Apr 5, 2001 7:53 pm
Subject: Re: Kylix

Mike, I had the same feelings holding me back about Linux etc.., but
I tried VMWare and (after a bit of fiddling) it works "as
advertised".

I recommend you try it, it's pretty neat, believe it or not, I have
1280*960 res & sound & modem in Linux (within Windows), without the
hassle of hunting down patches/drivers on the net!!! You need wads of
RAM though.

RF

 | Replies | Author | Date
1064 | Re: Kylix | Geoffrey Pan | Thu 4/5/2001


Saving and loading to/from binary file

From: Sigitas Galinis [sigitas.galinis@e...]
Date: Thu Apr 5, 2001 10:04 pm
Subject: Saving and loading to/from binary file

Hello,
I'm new using using virtual string tree and I have a problem loading tree
structure and data from binary file. When I save it to a binary file I can see
that it contains all my data inside but when i load it using LoadFromFile I can
not see data in the tree such as text, hint and so on. I do not want to reiint
it because I should parse my tree structure first. I use Bcb 5 Pro.

Thank You.

Sigitas Galinis

 | Replies | Author | Date
1068 | Re: Saving and loading to/from binary file | Mike Lischke | Fri 4/6/2001


re: Re: Kylix

From: "Geoffrey Pan" [gpan@c...]
Date: Thu Apr 5, 2001 11:53 pm
Subject: RE: [VirtualTreeview] Re: Kylix

I would try to port it but need to get app finished on win32 side first :)

-----Original Message-----
From: [rob@f...] [mailto:[rob@f...]]
Sent: Thursday, April 05, 2001 2:54 PM
To: VirtualTreeview@yahoogroups.com
Subject: [VirtualTreeview] Re: Kylix

Mike, I had the same feelings holding me back about Linux etc.., but
I tried VMWare and (after a bit of fiddling) it works "as
advertised".

I recommend you try it, it's pretty neat, believe it or not, I have
1280*960 res & sound & modem in Linux (within Windows), without the
hassle of hunting down patches/drivers on the net!!! You need wads of
RAM though.

RF

To unsubscribe from this group, send an email to:
VirtualTreeview-unsubscribe@egroups.com

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/


re: Sophisticated ShortenString

From: Mike Lischke [public@l...]
Date: Fri Apr 6, 2001 7:53 am
Subject: RE: [VirtualTreeview] Sophisticated ShortenString

Hi Heri,

> How about a new event OnShortenString?

I think this is a good idea. I can imagine that someone does not want to
shorten a string with ellipsisis or wants to display alternatives instead of
the shortend string. Going to build it in...

Ciao, Mike


re: Re: Kylix

From: GIANNAKOPOULOS KOSTAS [kyan@s...]
Date: Fri Apr 6, 2001 8:16 am
Subject: RE: [VirtualTreeview] Re: Kylix

Oh, yes, VMWare is GREAT!!!

I've been working with it playing with a Linux Virtual Machine on Win2000.
Also for testing applications i write in "pure" installations of Windows 9x.

You have access to all devices (CD, floppy, printer, even network). It even
has its own BIOS. You can choose if the VM "sees" only the host machine as
its network, or the whole LAN which the host macine belongs to. You can even
have internet!

Great for playing with Linux without having to buy disks or make partitions.
Also great for testing your code on different versions of Windows that you
keep free from extra installations that mess with the windows dlls (and the
way your code behaves).

Very good performance too!

Of course you will need disk space and RAM (i have 384MB, so i'm ok)

<KY>

> -----Original Message-----
> From: [rob@f...] [mailto:[rob@f...]]
> Sent: Thursday, April 05, 2001 10:54 PM
> To: VirtualTreeview@yahoogroups.com
> Subject: [VirtualTreeview] Re: Kylix
>
>
>
> Mike, I had the same feelings holding me back about Linux etc.., but
> I tried VMWare and (after a bit of fiddling) it works "as
> advertised".
>
> I recommend you try it, it's pretty neat, believe it or not, I have
> 1280*960 res & sound & modem in Linux (within Windows), without the
> hassle of hunting down patches/drivers on the net!!! You need wads of
> RAM though.
>
> RF


re: Re: Kylix

From: Mike Lischke [public@l...]
Date: Fri Apr 6, 2001 8:59 am
Subject: RE: [VirtualTreeview] Re: Kylix

Hi Rob,

> Mike, I had the same feelings holding me back about Linux etc.., but
> I tried VMWare and (after a bit of fiddling) it works "as
> advertised".

Mmh, seems to be a reasonable alternative. But I still would have to install
Linux, isn't it? Anyway, it will take a long time until I can provide a
port, so if anyone else can come up with one then I'd be happy.

Ciao, Mike


re: Saving and loading to/from binary file

From: Mike Lischke [public@l...]
Date: Fri Apr 6, 2001 9:00 am
Subject: RE: [VirtualTreeview] Saving and loading to/from binary file

Hi Sigitas,

> I'm new using using virtual string tree and I have a problem
> loading tree structure and data from binary file. When I save
> it to a binary file I can see that it contains all my data
> inside but when i load it using LoadFromFile I can not see
> data in the tree such as text, hint and so on. I do not want
> to reiint it because I should parse my tree structure first.

Have you assigned OnLoadNode and OnSave node event handlers?

Ciao, Mike


re: Re: Kylix

From: Mike Lischke [public@l...]
Date: Fri Apr 6, 2001 9:01 am
Subject: RE: [VirtualTreeview] Re: Kylix

> Oh, yes, VMWare is GREAT!!!

Kostas, may I contact you privately to check a couple of greek strings for
me?

Ciao, Mike


re: Re: Kylix

From: GIANNAKOPOULOS KOSTAS [kyan@s...]
Date: Fri Apr 6, 2001 9:07 am
Subject: RE: [VirtualTreeview] Re: Kylix

Sure.

use [kyan@s...]

> -----Original Message-----
> From: Mike Lischke [mailto:[public@l...]]
> Sent: Friday, April 06, 2001 12:01 PM
> To: 'VirtualTreeview@yahoogroups.com'
> Subject: RE: [VirtualTreeview] Re: Kylix
>
>
> > Oh, yes, VMWare is GREAT!!!
>
> Kostas, may I contact you privately to check a couple of
> greek strings for
> me?
>
> Ciao, Mike
>
> ------------------------ Yahoo! Groups Sponsor
> ---------------------~-~>
> Secure your servers with 128-bit SSL encryption!
> Grab your copy of VeriSign's FREE Guide,
> "Securing Your Web site for Business." Get it now!
> http://us.click.yahoo.com/KVNB7A/e.WCAA/bT0EAA/iObVlB/TM
> --------------------------------------------------------------
> -------_->
>
> To unsubscribe from this group, send an email to:
> VirtualTreeview-unsubscribe@egroups.com
>
>
>
> Your use of Yahoo! Groups is subject to
> http://docs.yahoo.com/info/terms/
>
>


re[2]: Saving and loading to/from binary file

From: Sigitas Galinis [sigitas.galinis@e...]
Date: Fri Apr 6, 2001 4:22 pm
Subject: re[2]: [VirtualTreeview] Saving and loading to/from binary file

> > I'm new using using virtual string tree and I have a problem
> > loading tree structure and data from binary file. When I save
> > it to a binary file I can see that it contains all my data
> > inside but when i load it using LoadFromFile I can not see
> > data in the tree such as text, hint and so on. I do not want
> > to reiint it because I should parse my tree structure first.

> Have you assigned OnLoadNode and OnSave node event handlers?

> Ciao, Mike

Hi,

No, I haven't. Should I assign them? I haven't found any example for that.
Could you give me a small example how to do that?

Thank you.

Sigitas Galinis

 | Replies | Author | Date
1072 | Re: re[2]: [VirtualTreeview] Saving and loading t | Mike Lischke | Fri 4/6/2001


re: re[2]: Saving and loading to/from binary file

From: "Mike Lischke" [public@l...]
Date: Fri Apr 6, 2001 4:39 pm
Subject: RE: re[2]: [VirtualTreeview] Saving and loading to/from binary file

Hi Sigitas,

> No, I haven't. Should I assign them? I haven't found any example for that.
Could you give
> me a small example how to do that?

This is very easy. A typical event handler could look like:

procedure TMainForm.Tree1SaveNode(Sender: TBaseVirtualTree;
Node: PVirtualNode; Stream: TStream);
var
Data: PNodeData;
begin
Data := Sender.GetNodeData(Node);
with Stream do
begin
...
end;
end;

where Data is the data of your node you want to save to the given stream. If
you have the caption of
the node also in the data and want to save it together with the other node data
then switch of the
soSaveCaption option of the string tree to avoid storing the caption twice
(otherwise the tree will
save the caption too).

Ciao, Mike


Access violations in TBaseVirtualTree.GetNextVisible

From: "Anthony Mills" [amills@m...]
Date: Fri Apr 6, 2001 11:37 pm
Subject: Access violations in TBaseVirtualTree.GetNextVisible

Mike,

A few of our users have been reporting access violations at this line in
TBaseVirtualTree.GetNextVisible:

if ForceSearch or not (vsVisible in Result.States) then
begin
repeat
// Is there a next sibling?
if Assigned(Result.NextSibling) then <-- THIS LINE
begin
Result := Result.NextSibling;

As a temporary measure I've added a couple 'if not Assigned(Result) then
Break;' lines to GetNextVisible ...

Regards,

Tony

 | Replies | Author | Date
1074 | Re: Access violations in TBaseVirtualTree.GetNext | Mike Lischke | Sat 4/7/2001


re: Access violations in TBaseVirtualTree.GetNextVisible

From: "Mike Lischke" [public@l...]
Date: Sat Apr 7, 2001 11:43 am
Subject: RE: [VirtualTreeview] Access violations in TBaseVirtualTree.GetNextVisible

Hi Tony,

> A few of our users have been reporting access violations at this line in
> TBaseVirtualTree.GetNextVisible:

You have not told me what version of VT you use currently. The code as I have
it now cannot produce
the error you described:

// If there are no children or the first child is not visible then search
the sibling nodes or
traverse parents.
if ForceSearch or not (vsVisible in Result.States) then
begin
repeat
// Is there a next sibling?
if Assigned(Result.NextSibling) then
begin
Result := Result.NextSibling;
// The visible state can be removed during initialization so init the
node first.
if not (vsInitialized in Result.States) then
InitNode(Result);
if vsVisible in Result.States then
Break;
end
else
begin
// No sibling anymore, so use the parent's next sibling.
if Result.Parent <> FRoot then
Result := Result.Parent
else
begin
// There are no further nodes to examine, hence there is no further
visible node.
Result := nil;
Break;
end;
end;
until False;
end;

If Result would be nil already on enter of this code part then there would
already have been an AV
in the first if statement. Hence the nil Value must come from the code in the
loop. Parent can never
be nil unless Result were already FRoot in which the following tests may result
in an unassigned
parent. This case however is catched by the assertion. The only other branch is
where Result is
explicitely set to nil but this assignement is followed by a Break which ends
the loop.

So either you have different code or the only other case (I can imagine)
applies here: you have
switched off assertions and FRoot is passed into the method.

Ciao, Mike


Preparation for official release

From: "Mike Lischke" [public@l...]
Date: Sat Apr 7, 2001 3:03 pm
Subject: Preparation for official release

Hi all,

Over the past couple of weeks I have implemented nearly all suggestions and
fixed loads of larger and smaller bugs. VT is now nearly in a state to be
published officially. What remains however is the documentation and the demos.
I'd like to make available for download the following packages/files:

- Virtual Treeview main distribution with D4/5 package and VirtualExplorerTree
control
- VT Demos (Minimal, Objects, OLE, VirtualExplorer, Advanced, ZipUnzip), both
in source and compiled
- IBO database VT
- compiled HTML help
- plain HTML, both packed for download and online
- FAQs

A few questions are open currently, though.

Adem:
Do you want to change something in ZipUnzipDemo? Could you please make your
package complete (Zip and Unzip DLLs)? Do you mind adjusting the code to my
coding style? I would do that, you don't need to do it yourself!

Jim:
Do you want to change something in VET? If you don't mind then I would make the
control a regular part of the main distribution. I would unite your shell
utilities with the VET unit. A code style change is also required then to fit
into the package. And while I'm at it I would also optimize the control so its
display becomes much faster.

Paul:
Do you want to change something in IB_VTree226? With the recent changes in VT
it could be necessary to change here and there a parameter.

John (Knipper):
Are there any news about the FAQs?

All:
Are there still open issues, omissions or other things which need to be fixed
and which I forgot so far? Are there more offers for demo applications to be
included? What about the VT gallery? More screen shots from anybody?

I will soon upload the latest source so you can check again for unsolved
problems.

Ciao, Mike

Dipl. Ing. Mike Lischke
Senior software developer
--
Homepage: http://www.lischke-online.de
GraphicEx: http://www.lischke-online.de/Graphics.html
Virtual Treeview: http://www.lischke-online.de/VirtualTreeview.html
Unicode Edit and library: http://www.lischke-online.de/Unicode.html

 | Replies | Author | Date
1078 | Re: Preparation for official release | [adembaba@e...] | Sun 4/8/2001
1080 | Re: Preparation for official release | Mike Lischke | Sun 4/8/2001
1088 | Re: Preparation for official release | [adembaba@e...] | Mon 4/9/2001
1084 | Re: Preparation for official release | Jim Kueneman | Sun 4/8/2001
1086 | Re: Preparation for official release | [adembaba@e...] | Mon 4/9/2001
1091 | Re: Preparation for official release | Mike Lischke | Mon 4/9/2001
1093 | Re: Preparation for official release | Mike Lischke | Mon 4/9/2001
1187 | Re: Preparation for official release | Jonx | Fri 4/13/2001
1193 | Re: Preparation for official release | Mike Lischke | Fri 4/13/2001


New file uploaded to VirtualTreeview

From: [VirtualTreeview@yahoogroups.com>
Date: Sat Apr 7, 2001 3:09 pm
Subject: New file uploaded to VirtualTreeview

Hello,

This email message is a notification to let you know that
a file has been uploaded to the Files area of the VirtualTreeview
group.

File : /VirtualTreeview.zip
Uploaded by : [public@l...]
Description : Version 2.3 beta

You can access this file at the URL

http://groups.yahoo.com/group/VirtualTreeview/files/VirtualTreeview.zip

To learn more about file sharing for your group, please visit

http://help.yahoo.com/help/us/groups/files

Regards,

public@l...]

 | Replies | Author | Date
1077 | Re: New file uploaded to VirtualTreeview | Malcolm Smith | Sat 4/7/2001
1079 | Re: New file uploaded to VirtualTreeview | Mike Lischke | Sun 4/8/2001
1082 | Re: New file uploaded to VirtualTreeview | Malcolm Smith | Sun 4/8/2001


re: New file uploaded to VirtualTreeview

From: "Malcolm Smith" [mjfreelancing@o...]
Date: Sat Apr 7, 2001 9:51 pm
Subject: RE: [VirtualTreeview] New file uploaded to VirtualTreeview

I have no idea how I got the first download, but I can't get anymore. Is
there any other way I can get the update.

Malcolm

MJ Freelancing
http://www.mjfreelancing.com
ABN: 30 671 763 146

CORintel
ABN: 30 336 110 329

-----Original Message-----
From: [VirtualTreeview@yahoogroups.com
[mailto:[VirtualTreeview@yahoogroups.com]
Sent: Sunday, 8 April 2001 01:09
To: VirtualTreeview@yahoogroups.com
Subject: [VirtualTreeview] New file uploaded to VirtualTreeview

Hello,

This email message is a notification to let you know that
a file has been uploaded to the Files area of the VirtualTreeview
group.

File : /VirtualTreeview.zip
Uploaded by : public@l...]
Description : Version 2.3 beta

You can access this file at the URL

http://groups.yahoo.com/group/VirtualTreeview/files/VirtualTreeview.zip

To learn more about file sharing for your group, please visit

http://help.yahoo.com/help/us/groups/files

Regards,

public@l...]

To unsubscribe from this group, send an email to:
VirtualTreeview-unsubscribe@egroups.com

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/

 | Replies | Author | Date
1079 | Re: New file uploaded to VirtualTreeview | Mike Lischke | Sun 4/8/2001
1082 | Re: New file uploaded to VirtualTreeview | Malcolm Smith | Sun 4/8/2001


re: Preparation for official release

From: [adembaba@e...]
Date: Sun Apr 8, 2001 8:37 am
Subject: Re: Preparation for official release

Hi Mike,

Thank you for the good news. :-)

One request: Could you divide your Advanced Demo
into separate apps and put each in a separate
directory. As it is, the whole app is somewhat
confusing --not just to me, to the others too
judging by messages to this forum.

> Adem:
> Do you want to change something in ZipUnzipDemo? Could you
> please make your package complete (Zip and Unzip DLLs)? Do
> you mind adjusting the code to my coding style? I would do
> that, you don't need to do it yourself!

Just one hitch: I was planning to be away for about 3-5 days.
Do I have enough time?

BTW, I do not have anycode changes, but obviously I have
to repackage the thing to have the missing VCLs.

Regarding coding style: you would not have an XSL on that,
by any chance :-)))

Cheers,

 | Replies | Author | Date
1080 | Re: Preparation for official release | Mike Lischke | Sun 4/8/2001
1088 | Re: Preparation for official release | [adembaba@e...] | Mon 4/9/2001


re: New file uploaded to VirtualTreeview

From: "Mike Lischke" [public@l...]
Date: Sun Apr 8, 2001 9:43 am
Subject: RE: [VirtualTreeview] New file uploaded to VirtualTreeview

Malcolm,

> I have no idea how I got the first download, but I can't get anymore. Is
> there any other way I can get the update.

If can't get it directly then try
http://groups.yahoo.com/group/VirtualTreeview/files/ and do a
right-click/Target save as... (IE) on the link to save the zip. Can you
download any other file from
there (via save as...)?

Ciao, Mike

 | Replies | Author | Date
1082 | Re: New file uploaded to VirtualTreeview | Malcolm Smith | Sun 4/8/2001


re: Re: Preparation for official release

From: "Mike Lischke" [public@l...]
Date: Sun Apr 8, 2001 9:51 am
Subject: RE: [VirtualTreeview] Re: Preparation for official release

Hi Adem,

> One request: Could you divide your Advanced Demo
> into separate apps and put each in a separate
> directory. As it is, the whole app is somewhat
> confusing --not just to me, to the others too
> judging by messages to this forum.

Thomas Bogenrieder provided me a totally reworked demo frame work which splits
every "sub" demo into
an unit on its own. I think this will greatly improve readability.

> Just one hitch: I was planning to be away for about 3-5 days.
> Do I have enough time?

Of course. If all goes well then I plan to have VT out at the end of April, but
I don't really
believe this will be the case.

> BTW, I do not have anycode changes, but obviously I have
> to repackage the thing to have the missing VCLs.

DLLs, it's DLLs :o]

> Regarding coding style: you would not have an XSL on that,
> by any chance :-)))

No, I haven't even an idea what xsl has to do with coding styles. Btw: I have
no problem if you want
to keep your own style, I just want to make the contribution consistent as much
as possible.

Ciao, Mike

 | Replies | Author | Date
1088 | Re: Preparation for official release | [adembaba@e...] | Mon 4/9/2001


Data in nodes

From: [m.d.w.vanoudheusden@s...]
Date: Sun Apr 8, 2001 4:44 pm
Subject: Data in nodes

Hello,

Is it possible to use different types of records for the data
property of the various nodes? In the root nodes I have the TTreeRoot
and in another childnode I want to use a different data record. I can
assign this types of records to the data property, however I get
an 'Access violation at address...' error. Can somebody tell me if it
is possible?

Thanks in advance

Michiel

 | Replies | Author | Date
1083 | Re: Data in nodes | Werner Lehmann | Sun 4/8/2001
1097 | Re: Data in nodes | [m.d.w.vanoudheusden@s...] | Mon 4/9/2001
1098 | Re: Data in nodes | Bender Heri | Mon 4/9/2001
1102 | Re: Data in nodes | [m.d.w.vanoudheusden@s...] | Mon 4/9/2001
1103 | Re: Data in nodes | Bender Heri | Mon 4/9/2001
1104 | Re: Data in nodes | [m.d.w.vanoudheusden@s...] | Mon 4/9/2001
1105 | Re: Data in nodes | Bender Heri | Mon 4/9/2001
1108 | Re: Data in nodes | [m.d.w.vanoudheusden@s...] | Mon 4/9/2001
1106 | Re: Data in nodes | Paul Istrate | Mon 4/9/2001


re: New file uploaded to VirtualTreeview

From: "Malcolm Smith" [mjfreelancing@o...]
Date: Sun Apr 8, 2001 8:51 pm
Subject: RE: [VirtualTreeview] New file uploaded to VirtualTreeview

Tried that, I have the same problem.

Mal

MJ Freelancing
http://www.mjfreelancing.com
ABN: 30 671 763 146

CORintel
ABN: 30 336 110 329

-----Original Message-----
From: Mike Lischke [mailto:[public@l...]]
Sent: Sunday, 8 April 2001 19:43
To: VirtualTreeview@yahoogroups.com
Subject: RE: [VirtualTreeview] New file uploaded to VirtualTreeview

Malcolm,

> I have no idea how I got the first download, but I can't get anymore. Is
> there any other way I can get the update.

If can't get it directly then try
http://groups.yahoo.com/group/VirtualTreeview/files/ and do a
right-click/Target save as... (IE) on the link to save the zip. Can you
download any other file from
there (via save as...)?

Ciao, Mike

To unsubscribe from this group, send an email to:
VirtualTreeview-unsubscribe@egroups.com

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/


re: Data in nodes

From: Werner Lehmann [wl@b...]
Date: Sun Apr 8, 2001 7:21 pm
Subject: Re: [VirtualTreeview] Data in nodes

[m.d.w.vanoudheusden@s...] wrote:
>
> Hello,
>
> Is it possible to use different types of records for the data
> property of the various nodes? In the root nodes I have the TTreeRoot
> and in another childnode I want to use a different data record. I can
> assign this types of records to the data property, however I get
> an 'Access violation at address...' error. Can somebody tell me if it
> is possible?

Yes. If your different records are of roughly the same size I recommend
you use variant records (see online help at 'Variant parts in records').
Of course you would still need to know when to access which variant. You
can use the 'case variable' here to store an enumeration var for all of
your record types.

If your records differ in size too much you would waste memory with this
approach. You'll probably need a second indirection then: store only records
with a type tag and a pointer to the real record data.

Regards,
Werner

 | Replies | Author | Date
1097 | Re: Data in nodes | [m.d.w.vanoudheusden@s...] | Mon 4/9/2001


re: Preparation for official release

From: "Jim Kueneman" [jimdk@m...]
Date: Sun Apr 8, 2001 10:44 pm
Subject: Re: Preparation for official release

--- In [VirtualTreeview@y...], "Mike Lischke" [public@l...] wrote:
> Hi all,
>
> Jim:
> Do you want to change something in VET? If you don't mind then I
would make the control a regular part of the main distribution. I
would unite your shell utilities with the VET unit. A code style
change is also required then to fit into the package. And while I'm at
it I would also optimize the control so its display becomes much
faster.
>

Can you hold on a week? I have almost completly intergrated my "real
TNamespace class" in to VET. It caches the things that will be called
during every paint cycle (plus a few more). The real question is it
is ok that TNamespace grew by an order of magnitude? It basiclly
encapsulates everything that can be done with a shell namespace in the
class. Most of it is useful to VET and some will only be useful to
the few who want to do something more elaborate.

Jim

 | Replies | Author | Date
1086 | Re: Preparation for official release | [adembaba@e...] | Mon 4/9/2001


TotalWidth

From: Werner Lehmann [wl@b...]
Date: Sun Apr 8, 2001 11:43 pm
Subject: TotalWidth

Hi,

I have found a problem with

function TVirtualTreeColumns.TotalWidth: Integer;

To be exact I found two. But after I wasted one hour with
finding the first I found out that it was already fixed
with v2.3b (the latest 2.3 only): if the last column was
invisible TotalWidth was incorrect with some unpleasant
consequences.

The new problem is now that the 2.3b version of that
method crashes if *no* column is visible. Needs an additional
check:

...
if (LastColumn < 0) then
Result := 0
else
with Items[LastColumn] do
Result := FLeft + FWidth;
...

You may ask why this would ever be the case. Well I am
saving the order and widths of the visible columns to a
string (app shutdown) and restoring them later (app start).
To get the ordering right I hide all columns first and
show the 'visible' ones in the correct order (see below).

Regards,
Werner

procedure StringToColumns(Tree: TVirtualStringTree; Info: PTypeInfo; Cols:
string);
var
i, j: integer;
col: string;
begin
with Tree.Header do
begin
// Hide all cols if any cols are specified; otherwise show all cols.
for i := 0 to Columns.Count - 1 do
with Columns[i] do
if (Cols = '') then
Options := Options + [coVisible]
else
Options := Options - [coVisible];

// Show specified cols.
j := 0;
while (Cols <> '') do
begin
col := CutFirst(Cols);
i := pos(' ', col);
with Columns[StringToOrd(Info, copy(col, 1, i - 1))] do
begin
Options := Options + [coVisible];
Width := StrToInt(copy(col, i + 1, MAXINT));
Position := j;
inc(j);
end;
end;
end;
end;

 | Replies | Author | Date
1092 | Re: TotalWidth | Mike Lischke | Mon 4/9/2001
1113 | Re: TotalWidth | Jim Kueneman | Tue 4/10/2001
1120 | Re: TotalWidth | Mike Lischke | Wed 4/11/2001


re: Preparation for official release

From: [adembaba@e...]
Date: Mon Apr 9, 2001 1:08 am
Subject: Re: Preparation for official release

Hi Jim,

> Can you hold on a week? I have almost completly intergrated
> my "real TNamespace class" in to VET. It caches the things
> that will be called during every paint cycle (plus a few more).
> The real question is it is ok that TNamespace grew by an order
> of magnitude? It basiclly encapsulates everything that can be
> done with a shell namespace in the class. Most of it is useful
> to VET and some will only be useful to the few who want to do
> something more elaborate.

This might not be the correct point/place to emphasize
the importance of the larger common good; but, I think
your work is quite important to the Delphi community
at large --even though this mortal soul finds himself at a
complete loss when confronted with TNamespace stuff ;-).

So, frankly, it should not be a worry even if the code
grows 2 orders of magnitude. Maybe you should think of
setting up a Group for that --where you might even
provide further demos and docs too, who knows :-)

Cheers,


New file uploaded to VirtualTreeview

From: [VirtualTreeview@yahoogroups.com>
Date: Mon Apr 9, 2001 1:24 am
Subject: New file uploaded to VirtualTreeview

Hello,

This email message is a notification to let you know that
a file has been uploaded to the Files area of the VirtualTreeview
group.

File : /ZipUnzipDemoDLLs.zip
Uploaded by : [adembaba@e...]
Description : DLLs for ZipUnzipDemo (Mike, please delete this once you've got
a copy)

You can access this file at the URL

http://groups.yahoo.com/group/VirtualTreeview/files/ZipUnzipDemoDLLs.zip

To learn more about file sharing for your group, please visit

http://help.yahoo.com/help/us/groups/files

Regards,

adembaba@e...]


re: Preparation for official release

From: [adembaba@e...]
Date: Mon Apr 9, 2001 1:32 am
Subject: Re: Preparation for official release

--- In [VirtualTreeview@y...], "Mike Lischke" [public@l...] wrote:
> Hi Adem,
>
> > One request: Could you divide your Advanced Demo
> > into separate apps and put each in a separate
> > directory. As it is, the whole app is somewhat
> > confusing --not just to me, to the others too
> > judging by messages to this forum.
>
> Thomas Bogenrieder provided me a totally reworked demo
> frame work which splits every "sub" demo into
> an unit on its own. I think this will greatly
> improve readability.

Good news again.

> > BTW, I do not have anycode changes, but obviously I have
> > to repackage the thing to have the missing VCLs.
>
> DLLs, it's DLLs :o]

I have uploaded the DLLs to the Files area.

But, I cant see why anyone would need just the
DLLs (other than to run the compiled demo).

> > Regarding coding style: you would not have an XSL on that,
> > by any chance :-)))
>
> No, I haven't even an idea what xsl has to do with coding
> styles.

Nor do I. Except that I have lately been immmersed into XML
a little too much. To the point that, the momemt I hear
styles I reach out for an XSL :-)

> Btw: I have no problem if you want to keep your own style,
> I just want to make the contribution consistent as much as
> possible.

Similarly, I have no problem with you or anyone altering
the style. Further, I'd be delighted if you could also
alter the code to run better too.

Cheers,


New file uploaded to VirtualTreeview

From: [VirtualTreeview@yahoogroups.com>
Date: Mon Apr 9, 2001 5:26 am
Subject: New file uploaded to VirtualTreeview

Hello,

This email message is a notification to let you know that
a file has been uploaded to the Files area of the VirtualTreeview
group.

File : /ZipUnzipDemo.zip
Uploaded by : [adembaba@e...]
Description : Fully working Zip & Unzip demo with source. (Includes Zip&Unzip
DLLs; compiles with VT 2.3 beta)

You can access this file at the URL

http://groups.yahoo.com/group/VirtualTreeview/files/ZipUnzipDemo.zip

To learn more about file sharing for your group, please visit

http://help.yahoo.com/help/us/groups/files

Regards,

adembaba@e...]


re: New file uploaded to VirtualTreeview

From: Mike Lischke [public@l...]
Date: Mon Apr 9, 2001 7:42 am
Subject: RE: [VirtualTreeview] New file uploaded to VirtualTreeview

Mal,

> Tried that, I have the same problem.

What do you use to download the files? When I left-click a link in the file
area on YG I sometimes get empty archives. In such cases I try the
right-click "trick" I already mentioned. If nothing works then I can send
you the file directly, but I would at least find out what's wrong there with
YG.

Ciao, Mike

 | Replies | Author | Date
1101 | Re: New file uploaded to VirtualTreeview | Malcolm Smith | Mon 4/9/2001


re: Re: Preparation for official release

From: Mike Lischke [public@l...]
Date: Mon Apr 9, 2001 7:51 am
Subject: RE: [VirtualTreeview] Re: Preparation for official release

Hi Jim,

> Can you hold on a week? I have almost completly intergrated my "real
> TNamespace class" in to VET.

Of course I can. It will still take a couple of weeks until I have
everything together (not counted the case that someone finds a major bug
:-)). I'm happy that you worked out the TNameSpace class so far. I will be
very proud to include it into the distribution (if you allow to do so). Btw:
I have already created a component icon for the explorer tree. Have a look
into VirtualTrees.dcr.

>It caches the things that will be called during every paint cycle (plus a
few more). The real question is it
> is ok that TNamespace grew by an order of magnitude?

Well, everything has its price. If somebody wants the comfort in his/her
application then (s)he must pay that price I believe. Unless there is no
useless waste of resources I have no problem with a larger implementation
(how, VT is huge :-P ).

>It basiclly encapsulates everything that can be done with a shell
> namespace in the
> class. Most of it is useful to VET and some will only be useful to
> the few who want to do something more elaborate.

I wonder if you would agree to donate VET to the JEDI project
(www.delphi-jedi.org)? VT is already donated and I believe many developers
would appreciate such a sophisticated control as VET too.

Ciao, Mike


re: TotalWidth

From: Mike Lischke [public@l...]
Date: Mon Apr 9, 2001 7:53 am
Subject: RE: [VirtualTreeview] TotalWidth

Hi Werner,

> I have found a problem with

Thank you for pointing that out.

> The new problem is now that the 2.3b version of that
> method crashes if *no* column is visible. Needs an additional
> check:
>
> ...
> if (LastColumn < 0) then
> Result := 0
> else
> with Items[LastColumn] do
> Result := FLeft + FWidth;

Ok, I will include this into VT. Have to wait 'til tonight, however. I
forgot to check-in the file into the company's version control system
yesterday and so I cannot check-out it here currently.

Ciao, Mike


re: Re: Preparation for official release

From: Mike Lischke [public@l...]
Date: Mon Apr 9, 2001 7:57 am
Subject: RE: [VirtualTreeview] Re: Preparation for official release

> > Thomas Bogenrieder provided me a totally reworked demo
> > frame work which splits every "sub" demo into
> > an unit on its own. I think this will greatly
> > improve readability.
>
> Good news again.

Once I have prepared the demos I will upload them to the YG file area and
you all can have a look. Perhpas somebody has even better ideas to improve
the demos.

> Similarly, I have no problem with you or anyone altering
> the style. Further, I'd be delighted if you could also
> alter the code to run better too.

Well, I doubt I will find the time to do so. I rely on your programming
skills and have not had any reason not to trust them.

Ciao, Mike


Border around treeview

From: "Franc v/d Westelaken" [F.vdwestelaken@c...]
Date: Mon Apr 9, 2001 7:56 am
Subject: Border around treeview

Hi,

I'm just starting using VTreeview (version 1.31), not using the 2.x beta
version, and noticed a small cosmetic thing. When you put 2 controls side by
side and one of these is VTreeView and you set the alignment of each to
alClient, you see that the VirtualTree control is has 1 pixel more spacing
around its sides. Thus the VTreeview control looks a bit smaller than the
other control.

I know this is a very small thing but is the border around the treeview
adjustable ?

Franc.

 | Replies | Author | Date
1095 | Re: Border around treeview | Mike Lischke | Mon 4/9/2001


re: Border around treeview

From: Mike Lischke [public@l...]
Date: Mon Apr 9, 2001 8:21 am
Subject: RE: [VirtualTreeview] Border around treeview

Hi Franc,

> I'm just starting using VTreeview (version 1.31), not using
> the 2.x beta version, and noticed a small cosmetic thing. When you put 2
> controls side by side and one of these is VTreeView and you set the
alignment
> of each to alClient, you see that the VirtualTree control is has 1 pixel
> more spacing around its sides.

Mmh, this behaviour is still there in 2.3ß. Everything is the same as for
other controls only there is an additional, one pixel, clBtnFace colored
border around the control. I have no clue yet what causes this color. The
own NC paint handler does it not, I have verified that. Also changing the
various border related properties (bevel, border width etc.) does not help
to solve the problem. I have to investigate this, but I don't know whether I
can fix this before the next release comes out...

Ciao, Mike


DoShortenString

From: Bender Heri [HBender@E...]
Date: Mon Apr 9, 2001 9:23 am
Subject: DoShortenString

Hi Mike

Thanks for implementing this new event.

You forgot the virtual directive in the declaration of DoShortenString.

Heri Bender

 | Replies | Author | Date
1100 | Re: DoShortenString | Mike Lischke | Mon 4/9/2001
1121 | Re: DoShortenString | Mike Lischke | Wed 4/11/2001
1135 | Re: DoShortenString | Vadim Sedulin | Wed 4/11/2001
1178 | Re: DoShortenString | Mike Lischke | Thu 4/12/2001
1186 | Re: DoShortenString | Vadim Sedulin | Fri 4/13/2001


re: Data in nodes

From: [m.d.w.vanoudheusden@s...]
Date: Mon Apr 9, 2001 9:46 am
Subject: Re: Data in nodes

> > Is it possible to use different types of records for the data
> > property of the various nodes? In the root nodes I have the
TTreeRoot
> > and in another childnode I want to use a different data record. I
can
> > assign this types of records to the data property, however I get
> > an 'Access violation at address...' error. Can somebody tell me
if it
> > is possible?
>
> Yes. If your different records are of roughly the same size I
recommend
> you use variant records (see online help at 'Variant parts in
records').
> Of course you would still need to know when to access which
variant. You
> can use the 'case variable' here to store an enumeration var for
all of
> your record types.
>
> If your records differ in size too much you would waste memory with
this
> approach. You'll probably need a second indirection then: store
only records
> with a type tag and a pointer to the real record data.

Thanks for your reply. I changed the data record to a very simple
record now, however I still get access violations. I found out that
this error occurs when I try to add a child to a root node. I have
created 2 PVirtualNode variables and set those in the form create
event. In another function I want to add a node to one of the
rootnodes. When I call the addchild routine with as parameter the
PVirtualNode I assigned before I get a Access violation and when I
use nil it works fine. So how do I place a child under a certain root
node?


re: Re: Data in nodes

From: Bender Heri [HBender@E...]
Date: Mon Apr 9, 2001 9:55 am
Subject: RE: [VirtualTreeview] Re: Data in nodes

Did you set the NodeDataSize correctly?

Heri

> -----Original Message-----
> From: [m.d.w.vanoudheusden@s...]
> [mailto:[m.d.w.vanoudheusden@s...]]
> Sent: Monday, April 09, 2001 11:46 AM
> To: [VirtualTreeview@yahoogroups.com
> Subject: [VirtualTreeview] Re: Data in nodes
>
>
> Thanks for your reply. I changed the data record to a very simple
> record now, however I still get access violations. I found out that
> this error occurs when I try to add a child to a root node. I have
> created 2 PVirtualNode variables and set those in the form create
> event. In another function I want to add a node to one of the
> rootnodes. When I call the addchild routine with as parameter the
> PVirtualNode I assigned before I get a Access violation and when I
> use nil it works fine. So how do I place a child under a certain root
> node?
>
>

Replies Author Date


More on ShortenString

From: Bender Heri [HBender@E...]
Date: Mon Apr 9, 2001 9:56 am
Subject: More on ShortenString

Hi Mike

When I suggested the new event I did not think enough.

First, there should be any information on what node and what column the
operation occurs. Maybe the PaintInfo record could be passed to the event or
at least the node and the column.

Second, for improvement it would be nice to have the member
FTriplePointWidth declared as protected instead as private. So I could
access this value also in a tree derivation.

The comment in PaintNormalText seems to need a look. You refer there the
identifier TextSpace which is neither a parameter nor a local declaration:

<snip>
Note: TextSpace is the actual width of the text to be printed. This does
not necessarily correspond to the width of
the node rectangle. The clipping rectangle comprises the entire node
(including tree lines, buttons etc.).
<endsnip>

Heri

 | Replies | Author | Date
1128 | Re: More on ShortenString | Mike Lischke | Wed 4/11/2001


re: DoShortenString

From: Mike Lischke [public@l...]
Date: Mon Apr 9, 2001 9:54 am
Subject: RE: [VirtualTreeview] DoShortenString

Hello Heri,

> You forgot the virtual directive in the declaration of
> DoShortenString.

So'n Mist :o] Will be done...

Ciao, Mike


re: New file uploaded to VirtualTreeview

From: "Malcolm Smith" [mjfreelancing@o...]
Date: Mon Apr 9, 2001 10:00 am
Subject: RE: [VirtualTreeview] New file uploaded to VirtualTreeview

My problem is my stupid "Download Magic" which I can't seem to turn off at a
keypress.

Mal

MJ Freelancing
http://www.mjfreelancing.com
ABN: 30 671 763 146

CORintel
ABN: 30 336 110 329

-----Original Message-----
From: Mike Lischke [mailto:[public@l...]]
Sent: Monday, 9 April 2001 17:43
To: 'VirtualTreeview@yahoogroups.com'
Subject: RE: [VirtualTreeview] New file uploaded to VirtualTreeview

Mal,

> Tried that, I have the same problem.

What do you use to download the files? When I left-click a link in the file
area on YG I sometimes get empty archives. In such cases I try the
right-click "trick" I already mentioned. If nothing works then I can send
you the file directly, but I would at least find out what's wrong there with
YG.

Ciao, Mike

To unsubscribe from this group, send an email to:
VirtualTreeview-unsubscribe@egroups.com

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/


re: Data in nodes

From: [m.d.w.vanoudheusden@s...]
Date: Mon Apr 9, 2001 10:38 am
Subject: Re: Data in nodes

--- In [VirtualTreeview@y...], Bender Heri [HBender@E...] wrote:
> Did you set the NodeDataSize correctly?
>
>
> > Thanks for your reply. I changed the data record to a very simple
> > record now, however I still get access violations. I found out
that
> > this error occurs when I try to add a child to a root node. I
have
> > created 2 PVirtualNode variables and set those in the form create
> > event. In another function I want to add a node to one of the
> > rootnodes. When I call the addchild routine with as parameter the
> > PVirtualNode I assigned before I get a Access violation and when
I
> > use nil it works fine. So how do I place a child under a certain
root
> > node?

Yes, in the formcreate event I have VST.NodeDataSize := SizeOf
(TTreeType);

And with nil as parameter it works, but I can not place a node as a
child under a root node.


re: Re: Data in nodes

From: Bender Heri [HBender@E...]
Date: Mon Apr 9, 2001 11:19 am
Subject: RE: [VirtualTreeview] Re: Data in nodes

> -----Original Message-----
> From: [m.d.w.vanoudheusden@s...]
> [mailto:[m.d.w.vanoudheusden@s...]]
> Sent: Monday, April 09, 2001 12:38 PM
> To: [VirtualTreeview@yahoogroups.com
> Subject: [VirtualTreeview] Re: Data in nodes
>
>
> --- In [VirtualTreeview@y...], Bender Heri [HBender@E...] wrote:
> > Did you set the NodeDataSize correctly?
> >
> >
> > > Thanks for your reply. I changed the data record to a very simple
> > > record now, however I still get access violations. I found out
> that
> > > this error occurs when I try to add a child to a root node. I
> have
> > > created 2 PVirtualNode variables and set those in the form create
> > > event. In another function I want to add a node to one of the
> > > rootnodes. When I call the addchild routine with as parameter the
> > > PVirtualNode I assigned before I get a Access violation and when
> I
> > > use nil it works fine. So how do I place a child under a certain
> root
> > > node?
>
> Yes, in the formcreate event I have VST.NodeDataSize := SizeOf
> (TTreeType);
>
> And with nil as parameter it works, but I can not place a node as a
> child under a root node.
>
>
So I don't know what's going wrong. You should step down to look where
exactly the code crashes.

Heri

Replies Author Date


re: Data in nodes

From: [m.d.w.vanoudheusden@s...]
Date: Mon Apr 9, 2001 11:56 am
Subject: Re: Data in nodes

> > > Did you set the NodeDataSize correctly?
> > >
> > >
> > > > Thanks for your reply. I changed the data record to a very
simple
> > > > record now, however I still get access violations. I found
out
> > that
> > > > this error occurs when I try to add a child to a root node. I
> > have
> > > > created 2 PVirtualNode variables and set those in the form
create
> > > > event. In another function I want to add a node to one of the
> > > > rootnodes. When I call the addchild routine with as parameter
the
> > > > PVirtualNode I assigned before I get a Access violation and
when
> > I
> > > > use nil it works fine. So how do I place a child under a
certain
> > root
> > > > node?
> >
> > Yes, in the formcreate event I have VST.NodeDataSize := SizeOf
> > (TTreeType);
> >
> > And with nil as parameter it works, but I can not place a node as
a
> > child under a root node.
> >
> >
> So I don't know what's going wrong. You should step down to look
where
> exactly the code crashes.
>
> Heri

The program crashs when trying to add a child to a node in the root.
I am completly new to this control so I dont know what is the best
way to add nodes. In the fromcreate I declare 2 root nodes and in
another routine I add child nodes to this nodes. I have a nroster and
a ntransport declared as a PVirtualNode. In the event where I add the
child nodes I use VST.AddChild(nroster). If I use VST.AddChild(nil)
it works fine. If I use nroster I get an error. Do I have to use
another way to acces root nodes?


re: Re: Data in nodes

From: Bender Heri [HBender@E...]
Date: Mon Apr 9, 2001 12:09 pm
Subject: RE: [VirtualTreeview] Re: Data in nodes

> -----Original Message-----
> From: [m.d.w.vanoudheusden@s...]
> [mailto:[m.d.w.vanoudheusden@s...]]
> Sent: Monday, April 09, 2001 1:56 PM
> To: [VirtualTreeview@yahoogroups.com
> Subject: [VirtualTreeview] Re: Data in nodes
>
>
> The program crashs when trying to add a child to a node in the root.
> I am completly new to this control so I dont know what is the best
> way to add nodes. In the fromcreate I declare 2 root nodes and in
> another routine I add child nodes to this nodes. I have a nroster and
> a ntransport declared as a PVirtualNode. In the event where I add the
> child nodes I use VST.AddChild(nroster). If I use VST.AddChild(nil)
> it works fine. If I use nroster I get an error. Do I have to use
> another way to acces root nodes?
>
>
Do I understand you right: nroster and ntransport are declared locally in
FormCreate? Then no wonder it crashes in annother methode. You should
declare it as members of the Form or somewhere else where they stay
persistent while the app is running.
If I understood you false and you have declared it like above, check the
pointer value first in the formcreate and compare it to the value you pass
then to addChild in the other routine. The pointer value should be the same.

If this does not help then step into the source code of VTree and try to
locate the exact crash point. (The source should be in the zip you have
downloaded. Just ensure the compiler can find this file in project options).

Heri

Replies Author Date


re: Re: Data in nodes

From: "Paul Istrate" [istech@c...]
Date: Mon Apr 9, 2001 12:48 pm
Subject: Re: [VirtualTreeview] Re: Data in nodes

----- Original Message -----
From: [m.d.w.vanoudheusden@s...]
To: <VirtualTreeview@yahoogroups.com>
Sent: Monday, April 09, 2001 2:56 PM
Subject: [VirtualTreeview] Re: Data in nodes
...

> The program crashs when trying to add a child to a node in the root.
> I am completly new to this control so I dont know what is the best
> way to add nodes. In the fromcreate I declare 2 root nodes and in
> another routine I add child nodes to this nodes. I have a nroster and
> a ntransport declared as a PVirtualNode. In the event where I add the
> child nodes I use VST.AddChild(nroster). If I use VST.AddChild(nil)
> it works fine. If I use nroster I get an error. Do I have to use
> another way to acces root nodes?
>

How you declare 2 root nodes? Only in 'var' section in FormCreate.

You can add nodes to root by calling VST.AddChild(nil).

First, You should have this 2 lines:

NRoster:=VST.AddChild(Nil);
NTransport:=VST.AddChild(Nil);

Only in this case you have 2 nodes added to root. And these 2 nodes have
valid values.

Then, you can write this:

AnotherNode1:=VST.AddChild(NRoster); {to add a child to NRoster}
AnotherNode2:=VST.AddChild(NTransport); {to add a child to NTransport}

In other words, adding to NIL is adding to ROOT.

Regards,
Paul Istrate


re: Re: Data in nodes

From: Mike Lischke [public@l...]
Date: Mon Apr 9, 2001 12:58 pm
Subject: RE: [VirtualTreeview] Re: Data in nodes

Yes, Paul is right. Additionally, never use the tree to work with nodes
which are not created by the tree. VT relies on some node members which it
sets internally (e.g. Parent) so you will have to set them explicitely or
manage all nodes entirely in your code (what you not really want unless you
know what you are doing).

Ciao, Mike

> You can add nodes to root by calling VST.AddChild(nil).
>
> First, You should have this 2 lines:
>
> NRoster:=VST.AddChild(Nil);
> NTransport:=VST.AddChild(Nil);
>
> Only in this case you have 2 nodes added to root. And these 2
> nodes have valid values.
...


re: Data in nodes

From: [m.d.w.vanoudheusden@s...]
Date: Mon Apr 9, 2001 1:04 pm
Subject: Re: Data in nodes

After a lot of debugging and removing code I found the problem. I
placed a clear command somewhere and this also removed the nroster.
Stupid, stupid, stupid me.

Thanks for all the help!

regards, Michiel


re: Data in nodes

From: "Roland" [Beduerftig@S...]
Date: Mon Apr 9, 2001 1:18 pm
Subject: Re: Data in nodes

Hallo,

I use the VT to show different data in some binary structure. I
declare a short "NodeInfo" for save the pointer or the index to the
binary. Now when I need data I have a two-way interface I can find
the node when look at the binary or I find the binary when I get a
NotifyEvent.

for example:

type
PData0 = ^TData0;
TData0 = record
Dummy0: array[0..128] of char;
Text: WideString;
end;
PData1 = ^TData1;
TData1 = record
Text: WideString;
Dummy1: array[0..10] of char;
end;
PNodeInfo = ^TNodeInfo;
TNodeInfo = record
Node: PVirtualNode;
DataIndex: integer;
{ or a pointer union for direkt access with a data^
case integer of
0: (DataPtr0 : PData0);
1: (DataPtr1 : PData1);
}
end;

var
Data0: array[0..10] of TData0;
Data1: array[0..10] of TData1;

procedure TFormX.TreeGetText(Sender: TBaseVirtualTree; ....
var Data: PNodeInfo;
begin
Data := PNodeInfo(Sender.GetNodeData(Node));
case Column of
0: Text := Data0[Data.DataIndex].Text;
1: Text := Data1[Data.DataIndex].Text;
end;
end;

function TFormX.AddString( BasisNode: PVirtualNode;
Index: integer) : PVirtualNode;
Var Data : PNodeInfo;
begin
Result := Tree.AddChild(BasisNode);
Data := PNodeInfo(Tree.GetNodeData(Result));
Data.Node := Result;
Data.DataIndex := Index;
end;

procedure TFormX.FormShow(Sender: TObject);
var Node : PVirtualNode;
begin
{ Data0 and Data1 binary must be read
here before you init the VT }
Tree.BeginUpdate;
Node := AddString(NIL, 0);
AddString(Node, 1);
AddString(Node, 2);
Node := AddString(NIL, 3);
AddString(Node, 4);
Tree.EndUpdate;
end;

procedure TFormX.FormCreate(Sender: TObject);
begin
Tree.NodeDataSize := sizeof(TNodeInfo);
end;

The little program will show a VT with 2 column and you can add to
the Root and add a Child.

In my main programs use the same construction, only the TDataX
definitions are different, and so I can also use ImageIndex to show
bitmaps in the root or in the columns.

with best wishes
Roland


IterateSubtree / GetNextNoInit

From: Bender Heri [HBender@E...]
Date: Mon Apr 9, 2001 4:38 pm
Subject: IterateSubtree / GetNextNoInit

Hello Mike

Did you change something in the IterateSubtree (stop) or the GetNextNoInit?

The fact is, until I downloaded your last 2.3 Beta, my deletion routine
worked, and now it crashes.

My Routine:

procedure TCWTree.CWNodeDeletionCallback(Sender: TBaseVirtualTree; Node:
PVirtualNode; Data: Pointer; var Abort: Boolean);
// iteration callback when deleting a node and all it's children.
RECURSIVLY!!!
var
oNode : TCWNode;
pNode : PVirtualNode;
begin
// we must delete first the children (referential integrity in DB):
pNode := Node.FirstChild;
while pNode <> nil do begin
IterateSubTree(pNode,CWNodeDeletionCallback,nil);
pNode := pNode.NextSibling;
end;

oNode := CWNode[Node]; // retrieves my object stored in Node
assert(oNode <> nil);
DataMod.DeleteCWNode(oNode); // deletes it from DB
assert(Node.ChildCount = 0);
DeleteNode(Node); // DeleteNode invokes DoFreeNode where the class is
freed.
Update;
end;

After all children of the given node were deleted (recursive iteration), the
node itself is deleted. When I step trough your code, the GetNextNode
function refers to the delete node which is nomore here. Before the line
"DeleteNode(Node)" Node.Childcount = 0 and Node.FirstChild = nil. After this
line this values show something else (not 0 and not nil). In the
GetNextNoInit you refer this node again and ask the nodes FirstChild which
is nomore nil. -> crash.
If this is what you have changed, what would you suggest to delete a node?

Thanks

Heri

---------------------------------------------------------------------
Heri Bender
ERGONOMICS AG
Schaffhauserstrasse 210
CH-8057 Zuerich
Switzerland
Phone: ++41 (0)1 315 51 64
Fax: ++41 (0)1 315 51 15
mailto:[hbender@e...]
---------------------------------------------------------------------
Aktuell:
www.CultureGate.Ch der neue, gesamtschweizerische Event-Guide auf WAP für
Ausgehfreudige! Powered by ERGONOMICS.

 | Replies | Author | Date
1122 | Re: IterateSubtree / GetNextNoInit | Mike Lischke | Wed 4/11/2001
1123 | Re: IterateSubtree / GetNextNoInit | Mike Lischke | Wed 4/11/2001
1124 | Re: IterateSubtree / GetNextNoInit | Bender Heri | Wed 4/11/2001


re: New file uploaded to VirtualTreeview

From: "Thomas Schoessow" [info@t...]
Date: Mon Apr 9, 2001 4:37 pm
Subject: Re: [VirtualTreeview] New file uploaded to VirtualTreeview

I do have the same probs. Sometimes I get 10 KB, 13 KB but not the whole file -(

Thomas
--------------------------------------------------------------
Softwareentwicklung Thomas Schoessow
http://www.tschoessow.de
http://www.schoessow.de
EMail: [feedback@t...]
--------------------------------------------------------------

-----Ursprüngliche Nachricht-----
Von: "Malcolm Smith" [mjfreelancing@o...]
An: [VirtualTreeview@yahoogroups.com>
Gesendet: Sonntag, 8. April 2001 22:51
Betreff: RE: [VirtualTreeview] New file uploaded to VirtualTreeview

> Tried that, I have the same problem.
>
> Mal
>
> MJ Freelancing
> http://www.mjfreelancing.com
> ABN: 30 671 763 146
>
> CORintel
> ABN: 30 336 110 329
>
> -----Original Message-----
> From: Mike Lischke [mailto:public@l...]]
> Sent: Sunday, 8 April 2001 19:43
> To: VirtualTreeview@yahoogroups.com
> Subject: RE: [VirtualTreeview] New file uploaded to VirtualTreeview
>
>
> Malcolm,
>
> > I have no idea how I got the first download, but I can't get anymore. Is
> > there any other way I can get the update.
>
> If can't get it directly then try
> http://groups.yahoo.com/group/VirtualTreeview/files/ and do a
> right-click/Target save as... (IE) on the link to save the zip. Can you
> download any other file from
> there (via save as...)?
>
> Ciao, Mike
>
>
>
> To unsubscribe from this group, send an email to:
> VirtualTreeview-unsubscribe@egroups.com
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>
>
>
> To unsubscribe from this group, send an email to:
> VirtualTreeview-unsubscribe@egroups.com
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>
>


re: Re: Data in nodes

From: "Vadim Sedulin" [wsntrl@o...]
Date: Mon Apr 9, 2001 9:49 pm
Subject: Re: [VirtualTreeview] Re: Data in nodes

Hello Mike!

> Yes, Paul is right. Additionally, never use the tree to work with nodes
> which are not created by the tree. VT relies on some node members which it
> sets internally (e.g. Parent) so you will have to set them explicitely or
> manage all nodes entirely in your code (what you not really want unless
you
> know what you are doing).

Is node pointer static between OnInitNode and OnFreeNode? I.e. can I store
PVirtualNode outside VT?

Bye.

Vadim Sedulin
E-Mail: [wsntrl@o...]


re: TotalWidth

From: "Jim Kueneman" [jimdk@m...]
Date: Tue Apr 10, 2001 4:47 am
Subject: Re: TotalWidth

--- In [VirtualTreeview@y...], Werner Lehmann [wl@b...] wrote:
> Hi,
> ...
> if (LastColumn < 0) then
> Result := 0
> else
> with Items[LastColumn] do
> Result := FLeft + FWidth;
> ...
>
> You may ask why this would ever be the case. Well I am

Actually this broke Mike's additions to the Virtual Explorer Tree for
the details too :^)

Your fix took care of that as well.

Jim


re: Re: Data in nodes

From: Mike Lischke [public@l...]
Date: Tue Apr 10, 2001 7:19 am
Subject: RE: [VirtualTreeview] Re: Data in nodes

> Is node pointer static between OnInitNode and OnFreeNode?
> I.e. can I store
> PVirtualNode outside VT?

Yes, the node pointer is static for the entire lifetime of a node. Take care
of situations where nodes are implicitely freed (setting a new node data
size for example). Still, OnFreeNode is also called in those cases provided
the node was initialized.

Ciao, Mike


Header, Columns

From: GIANNAKOPOULOS KOSTAS [kyan@s...]
Date: Tue Apr 10, 2001 8:14 am
Subject: Header, Columns

Good morning Mike.

If someone ever decided to make a data-aware descendant of your component (a
data-aware VTree or a DBGrid alternative) there is an obstacle very
difficult to overcome: It is impossible to have VTree create a descendant of
TVirtualTreeColumn (that would have, say, a DataField property).

I suggest that you introduce 2 virtual methods a
TBaseVirtualTree.CreateHeader and a TVTHeader.CreateColumns. Something
similar has been done for TTreeNode and TListItem in ComCtrls (unfortunately
not for TListColumn).

PS: Actually it *is* possible to replace TVTHeader/TVirtualTreeColumn using
a rather nasty crack:

constructor TMyVTHeader.Create(AOwner: TBaseVirtualTree);
var
P: Pointer;
begin
inherited Create(AOwner);
P := @Columns; // P now points to the data member FColumns
TObject(P^).Free;
TObject(P^) := TMyVirtualTreeColumns.Create(Self);
end;

I've used it to replace TDBGrid's datalink but i would not encourage the use
of such cracks.
Of course this would not work for a property that has a Get function.

<KY>

 | Replies | Author | Date
1129 | Re: Header, Columns | Mike Lischke | Wed 4/11/2001
1131 | Re: Header, Columns | GIANNAKOPOULOS KOSTAS | Wed 4/11/2001


New file uploaded to VirtualTreeview

From: [VirtualTreeview@yahoogroups.com>
Date: Tue Apr 10, 2001 2:27 pm
Subject: New file uploaded to VirtualTreeview

Hello,

This email message is a notification to let you know that
a file has been uploaded to the Files area of the VirtualTreeview
group.

File : /VET.zip
Uploaded by : [jimdk@m...]
Description : Virtual Explorer Tree (VET) latest beta (4.10.01)

You can access this file at the URL

http://groups.yahoo.com/group/VirtualTreeview/files/VET.zip

To learn more about file sharing for your group, please visit

http://help.yahoo.com/help/us/groups/files

Regards,

jimdk@m...]


New VET Demo

From: "Jim Kueneman" [jimdk@m...]
Date: Tue Apr 10, 2001 2:39 pm
Subject: New VET Demo

I uploaded the latest version of the virtual explorer tree (VET).
There is not a lot new with the treeview component but a lot of work
has been done with the TNamespace class to speed it up and add Delphi
type access to much the information that a COM namespace offers. I
added a form to show most of this information for the selected node.
This causes selection of the node very slow since it is retrieving a
lot of information. It can be turned on/off.

One issue I have is IExtractImage, if anyone has gotten this to work I
would like some help :^) It will show a path for the image on some
files (DOC and TXT especially) but it will never extract the thumbnail
image.

In the IShellFolder tab only Win2k user will see anything interesting
with all the different ways the name of the namespace can be
retrieved. Win2k returns the class ID for the name of a lot of the
special folder unless the FORADDRESSBAR is included.

Note what is returned in the info form is highly dependant of what
version of the common control dll is installed (which is what makes
shell programming *interesting*)

Have fun and let me know if there are any issues.

Note I had to implement Werner's latest bug fix to make the columns
work without giving a invalid TList index exception so wait for the
next release of Mike's VT before trying to compile the source or
installing the component. The exe is included for your enjoyment.

Jim Kueneman

 | Replies | Author | Date
1130 | Re: New VET Demo | Mike Lischke | Wed 4/11/2001
1153 | Re: New VET Demo | Jim Kueneman | Thu 4/12/2001
1154 | Re: New VET Demo | [adembaba@e...] | Thu 4/12/2001
1162 | Re: New VET Demo | GUCLU ONGUN | Thu 4/12/2001
1164 | Re: New VET Demo | Mike Lischke | Thu 4/12/2001
1166 | Re: New VET Demo | Mike Lischke | Thu 4/12/2001
1168 | Re: New VET Demo | Mike Lischke | Thu 4/12/2001
1173 | Re: New VET Demo | Jim Kueneman | Thu 4/12/2001
1170 | Re: New VET Demo | Cyril VELTER | Thu 4/12/2001


BUG?

From: "Vadim Sedulin" [wsntrl@o...]
Date: Wed Apr 11, 2001 8:32 am
Subject: BUG?

Hello Mike!

Sample code:
====
unit Unit1;

interface

uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
VirtualTrees;

type
TForm1 = class(TForm)
Tree: TVirtualStringTree;
procedure TreeExpanding(Sender: TBaseVirtualTree; Node: PVirtualNode;
var Allowed: Boolean);
procedure TreeCollapsed(Sender: TBaseVirtualTree; Node: PVirtualNode);
procedure TreeGetText(Sender: TBaseVirtualTree; Node: PVirtualNode;
Column: Integer; TextType: TVSTTextType; var Text: WideString);
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;

var
Form1: TForm1;

implementation

{$R *.DFM}

procedure TForm1.TreeExpanding(Sender: TBaseVirtualTree; Node: PVirtualNode;
var Allowed: Boolean);
begin
Node := Node^.FirstChild;
while Node <> nil do begin
Tree.AddChild (Node);
Tree.AddChild (Node);
Tree.AddChild (Node);
Node := Node^.NextSibling;
end;
Allowed := True;
end;

procedure TForm1.TreeCollapsed(Sender: TBaseVirtualTree; Node:
PVirtualNode);
begin
Node := Node^.FirstChild;
while Node <> nil do begin
Tree.DeleteChildren (Node);
Node := Node^.NextSibling;
end;
end;

procedure TForm1.TreeGetText(Sender: TBaseVirtualTree; Node: PVirtualNode;
Column: Integer; TextType: TVSTTextType; var Text: WideString);
var
I: Integer;
begin
Text := '';
repeat
I := 1;
while Node^.PrevSibling <> nil do begin
Inc (I);
Node := Node^.PrevSibling;
end;
Text := ' ' + IntToStr(I) + Text;
Node := Node^.Parent;
until Node = Tree.RootNode;
Text := 'Node' + Text;
end;

procedure TForm1.FormCreate(Sender: TObject);
var
Node: PVirtualNode;
begin
Node := Tree.AddChild (nil);
Tree.AddChild(Node);
Tree.AddChild(Node);
Tree.AddChild(Node);
end;

end.
====

1. Expand "Node 1"
2. Expand "Node 1 2"
3. Collapse "Node 1"
4. Expand "Node 1"
Now, click or D-click on "Node 1 2 1"...

Bye.

Vadim Sedulin
E-Mail: [wsntrl@o...]

 | Replies | Author | Date
1132 | Re: BUG? | Mike Lischke | Wed 4/11/2001


Column drag bug

From: Werner Lehmann [wl@b...]
Date: Wed Apr 11, 2001 9:36 am
Subject: Column drag bug

Hi,

here's another bug: if a column is moved (I only tried it with
hoRestrictDrag) a transparent column drag image is shown. The
position of the drag image does not take the position of the
horizontal scrollbar into account: if the tree is scrolled some-
what to the right the drag image will be made out of whatever
is x pixels right to the dragged column, with x pixels being the
scrollbar position.

I may be able to look into this tonight (if noone else fixes it
until then :)

Regards,
Werner

 | Replies | Author | Date
1133 | Re: Column drag bug | Mike Lischke | Wed 4/11/2001


re: TotalWidth

From: Mike Lischke [public@l...]
Date: Wed Apr 11, 2001 10:59 am
Subject: RE: [VirtualTreeview] TotalWidth

Hi Werner,

> The new problem is now that the 2.3b version of that
> method crashes if *no* column is visible. Needs an additional
> check:

Thank you for the little report. I have fixed this (and a related) bug.

Ciao, Mike


re: DoShortenString

From: Mike Lischke [public@l...]
Date: Wed Apr 11, 2001 11:00 am
Subject: RE: [VirtualTreeview] DoShortenString

Hi Heri,

> You forgot the virtual directive in the declaration of
> DoShortenString.

Oops. Have made it dynamic (I assume it will not be override so often).

Ciao, Mike


re: IterateSubtree / GetNextNoInit

From: Mike Lischke [public@l...]
Date: Wed Apr 11, 2001 11:12 am
Subject: RE: [VirtualTreeview] IterateSubtree / GetNextNoInit

> procedure TCWTree.CWNodeDeletionCallback(Sender: TBaseVirtualTree; Node:
> PVirtualNode; Data: Pointer; var Abort: Boolean);
> var
> oNode : TCWNode;
> pNode : PVirtualNode;
> begin
> // we must delete first the children (referential integrity in DB):
> pNode := Node.FirstChild;
> while pNode <> nil do begin
> IterateSubTree(pNode,CWNodeDeletionCallback,nil);
> pNode := pNode.NextSibling;
> end;
>
> oNode := CWNode[Node]; // retrieves my object stored in Node
> assert(oNode <> nil);
> DataMod.DeleteCWNode(oNode); // deletes it from DB
> assert(Node.ChildCount = 0);
> DeleteNode(Node); // DeleteNode invokes DoFreeNode where
> the class is
> freed.
> Update;
> end;

Mmmh, IterateSubTree has some default parameters and one is ChildNodesOnly
which is by default False. What you do in your code (first loop) is to
delete every child node plus the given node (pNode). After the recursive
IterateSubTree call returns pNode is no longer valid but you still access
its NextSibling member.

Another point however is that you delete the node which is later used to
iterate through the next node in IterateSubtree. This is a situation which I
have not considered (and which is very much like the one you produced
yourself). So what we both need to do is to determine the next node in
advance before calling the callback/IterateSubtree. I think this will solve
the problem. Please check the new version as soon as I have it uploaded.

Ciao, Mike


re: IterateSubtree / GetNextNoInit

From: Mike Lischke [public@l...]
Date: Wed Apr 11, 2001 11:21 am
Subject: RE: [VirtualTreeview] IterateSubtree / GetNextNoInit

Heri,

> The fact is, until I downloaded your last 2.3 Beta, my
> deletion routine
> worked, and now it crashes.

I thought again about it and found that you are doing something very
dangerous and now that IterateSubtree works correctly it shows also up. The
problem is that you delete nodes in the callback which might still be needed
in the IterateSubtree method. If I determine the next node in advance then I
might find the first child node of the current node which gets deleted in
the callback and is therefor no longer valid afterwards. If determine the
next node after calling the callback (as it is now) then this situation is
not dangerous (because the following to GetNext or GetNextNoInit will
correctly consider there are no children anymore. But if you delete the
current node in the callback then it is likely that GetNext etc. will not
access valid memory anymore to determine the next node.

Hence, deleting nodes in the iteration callback from IterateSubtree is a
very bad idea and must be avoided! (John, do you listen? -> FAQ)

What you rather should do is to call DeleteChildren for a node and delete it
then manually (DeleteNode). Do this in a method which calls itself
recursively and where you can take care for your database.

Ciao, Mike


re: IterateSubtree / GetNextNoInit

From: Bender Heri [HBender@E...]
Date: Wed Apr 11, 2001 11:26 am
Subject: RE: [VirtualTreeview] IterateSubtree / GetNextNoInit

> -----Original Message-----
> From: Mike Lischke [mailto:[public@l...]]
> Sent: Wednesday, April 11, 2001 1:12 PM
> To: 'VirtualTreeview@yahoogroups.com'
> Subject: RE: [VirtualTreeview] IterateSubtree / GetNextNoInit
>
>
> > procedure TCWTree.CWNodeDeletionCallback(Sender:
> TBaseVirtualTree; Node:
> > PVirtualNode; Data: Pointer; var Abort: Boolean);
> > var
> > oNode : TCWNode;
> > pNode : PVirtualNode;
> > begin
> > // we must delete first the children (referential
> integrity in DB):
> > pNode := Node.FirstChild;
> > while pNode <> nil do begin
> > IterateSubTree(pNode,CWNodeDeletionCallback,nil);
> > pNode := pNode.NextSibling;
> > end;
> >
> > oNode := CWNode[Node]; // retrieves my object stored in Node
> > assert(oNode <> nil);
> > DataMod.DeleteCWNode(oNode); // deletes it from DB
> > assert(Node.ChildCount = 0);
> > DeleteNode(Node); // DeleteNode invokes DoFreeNode where
> > the class is
> > freed.
> > Update;
> > end;
>
> Mmmh, IterateSubTree has some default parameters and one is
> ChildNodesOnly
> which is by default False. What you do in your code (first loop) is to
> delete every child node plus the given node (pNode). After
> the recursive
> IterateSubTree call returns pNode is no longer valid but you
> still access
> its NextSibling member.
>
> Another point however is that you delete the node which is
> later used to
> iterate through the next node in IterateSubtree. This is a
> situation which I
> have not considered (and which is very much like the one you produced
> yourself). So what we both need to do is to determine the next node in
> advance before calling the callback/IterateSubtree. I think
> this will solve
> the problem. Please check the new version as soon as I have
> it uploaded.
>
> Ciao, Mike
>

Hi Mike

Meanwhile I have solved the problem by not deleting the tree node, only the
corresponding DB entry. The tree node and all its children is then deleted
by the first caller of this iterate methode after it comes back. First I did
hesitate to do so because during the iteration the tree and the DB is not
consistent (node deleted from DB but not yet from tree).


SetoleClipboard(nil)

From: [teusjdejong@p...]
Date: Wed Apr 11, 2001 11:25 am
Subject: SetoleClipboard(nil)

Mike,

1. In the latest version of the Clear procedure of TBaseVirtualTree
it still states unconditionally SetOleClipBoard(nil).

2. If you are still interested in examples, I could prepare an
example with three components (including source and demo), all
working with your component. The three components (TVTFolderTree,
TFilelist and TVTNetFoldertree) together give a simplified version of
my file manager.

Teus de Jong.

 | Replies | Author | Date
1156 | Re: SetoleClipboard(nil) | Mike Lischke | Thu 4/12/2001


re: New file uploaded to VirtualTreeview

From: Mike Lischke [public@l...]
Date: Wed Apr 11, 2001 11:27 am
Subject: RE: [VirtualTreeview] New file uploaded to VirtualTreeview

Thomas,

> I do have the same probs. Sometimes I get 10 KB, 13 KB but
> not the whole file -(

Do you use ZipMagic?

Ciao, Mike


re: New file uploaded to VirtualTreeview

From: "Thomas Schoessow" [info@t...]
Date: Wed Apr 11, 2001 12:25 pm
Subject: Re: [VirtualTreeview] New file uploaded to VirtualTreeview

No, should I ? -)

Regards

Thomas

--------------------------------------------------------------
Softwareentwicklung Thomas Schoessow
http://www.tschoessow.de
http://www.schoessow.de
EMail: [feedback@t...]
--------------------------------------------------------------

-----Ursprüngliche Nachricht-----
Von: "Mike Lischke" [public@l...]
An: <VirtualTreeview@yahoogroups.com>
Gesendet: Mittwoch, 11. April 2001 13:27
Betreff: RE: [VirtualTreeview] New file uploaded to VirtualTreeview

> Thomas,
>
> > I do have the same probs. Sometimes I get 10 KB, 13 KB but
> > not the whole file -(
>
> Do you use ZipMagic?
>
> Ciao, Mike
>
>
> To unsubscribe from this group, send an email to:
> VirtualTreeview-unsubscribe@egroups.com
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>
>

 | Replies | Author | Date
1138 | Re: New file uploaded to VirtualTreeview | Malcolm Smith | Wed 4/11/2001


re: More on ShortenString

From: Mike Lischke [public@l...]
Date: Wed Apr 11, 2001 12:30 pm
Subject: RE: [VirtualTreeview] More on ShortenString

> First, there should be any information on what node and what
> column the operation occurs. Maybe the PaintInfo record could be passed
> to the event or at least the node and the column.

Mmmh, this makes the (already special) event even more ugly. The info in the
PaintInfo structure is not directly usable. There are some calculation done.
I have now extended the event to carry also node and column information but
I think the better choice would be to override PaintNormalText. I doubt that
more than one out of 1000 people will ever use this event.

> Second, for improvement it would be nice to have the member
> FTriplePointWidth declared as protected instead as private. So I could
> access this value also in a tree derivation.

Done.

> The comment in PaintNormalText seems to need a look. You
> refer there the identifier TextSpace which is neither a parameter nor a
local
> declaration:

Yup, you are right. I have changed that.

Ciao, Mike


re: Header, Columns

From: Mike Lischke [public@l...]
Date: Wed Apr 11, 2001 1:39 pm
Subject: RE: [VirtualTreeview] Header, Columns

Hi Kostas,

> I suggest that you introduce 2 virtual methods a
> TBaseVirtualTree.CreateHeader and a TVTHeader.CreateColumns.

I hesitate to include those methods. The header and the columns are created
at design time too and are a fixed part of the tree. I agree that it would
be nice to be able to create application defined columns. But I want finally
to get out the next official version and customizable column classes are of
too low importance, sorry.

Ciao, Mike


re: New VET Demo

From: Mike Lischke [public@l...]
Date: Wed Apr 11, 2001 1:45 pm
Subject: RE: [VirtualTreeview] New VET Demo

Hi Jim,

> I uploaded the latest version of the virtual explorer tree (VET).
> There is not a lot new with the treeview component but a lot of work
> has been done with the TNamespace class to speed it up and add Delphi
> type access to much the information that a COM namespace offers. I
> added a form to show most of this information for the selected node.
> This causes selection of the node very slow since it is retrieving a
> lot of information. It can be turned on/off.

VET was already a cool control but now it has reached a stage where I will
include it not only into the VT distribution but also into our inhouse
library to replace other variants (mainly Brad Stowers system treeview).
Excellent work Jim!

The only little glitch I found so far is that if all files are shown and a
folder has no subfolders but only files then it does not get the
vsHasChildren style. By double-clicking the node I can expand it however. I
guess you need to check for at least one file separately.
SFGAO_HASSUBFOLDERS is not enough in this situation.

Ciao, Mike

 | Replies | Author | Date
1153 | Re: New VET Demo | Jim Kueneman | Thu 4/12/2001


re: Header, Columns

From: GIANNAKOPOULOS KOSTAS [kyan@s...]
Date: Wed Apr 11, 2001 2:02 pm
Subject: RE: [VirtualTreeview] Header, Columns

> I hesitate to include those methods. The header and the
> columns are created
> at design time too and are a fixed part of the tree. I agree
> that it would
> be nice to be able to create application defined columns.

I didn't mean event handlers (OnCreateColumns), just protected virtual
methods.
This way one could override the header/columns ONLY by subclassing the
VTree.
I suppose that if someone decides to subclass a control they must know what
they are doing and handle design-time as well.

Just for the record, in one of my components (a TDBGrid descendant) i have
subclassed TDBGrid's Columns to include properties like "Enabled" (if False
the column doesn't get focus at all) "EditorClass" (much like your inplace
editor feature) and event handlers like "OnEditBtnClick" (per column).

> I want finally
> to get out the next official version and customizable column
> classes are of
> too low importance, sorry.

Sure, it was just a suggestion. I'm not actually writing a TVirtualDBGrid or
a TDBVirtualTree (yet).

<KY>


re: BUG?

From: Mike Lischke [public@l...]
Date: Wed Apr 11, 2001 3:37 pm
Subject: RE: [VirtualTreeview] BUG?

Hi Vadim,

> 1. Expand "Node 1"
> 2. Expand "Node 1 2"
> 3. Collapse "Node 1"
> 4. Expand "Node 1"
> Now, click or D-click on "Node 1 2 1"...

Thank you for your report. Yes indeed this was a bug. Please note the past
form :o]

Ciao, Mike


re: Column drag bug

From: Mike Lischke [public@l...]
Date: Wed Apr 11, 2001 3:38 pm
Subject: RE: [VirtualTreeview] Column drag bug

> here's another bug: if a column is moved (I only tried it with
> hoRestrictDrag) a transparent column drag image is shown.
>
> I may be able to look into this tonight (if noone else fixes it
> until then :)

Don't waste time on that, Werner. I have already fixed this :o]

Ciao, Mike


New file uploaded to VirtualTreeview

From: [VirtualTreeview@yahoogroups.com>
Date: Wed Apr 11, 2001 3:47 pm
Subject: New file uploaded to VirtualTreeview

Hello,

This email message is a notification to let you know that
a file has been uploaded to the Files area of the VirtualTreeview
group.

File : /VirtualTreeview.zip
Uploaded by : [public@l...]
Description : Version 2.3ß

You can access this file at the URL

http://groups.yahoo.com/group/VirtualTreeview/files/VirtualTreeview.zip

To learn more about file sharing for your group, please visit

http://help.yahoo.com/help/us/groups/files

Regards,

public@l...]

 | Replies | Author | Date
1142 | Re: New file uploaded to VirtualTreeview | Malcolm Smith | Wed 4/11/2001
1146 | Missing dcu | Malcolm Smith | Wed 4/11/2001


re: DoShortenString

From: "Vadim Sedulin" [wsntrl@o...]
Date: Wed Apr 11, 2001 7:12 pm
Subject: Re: [VirtualTreeview] DoShortenString

Hello Mike!

>> You forgot the virtual directive in the declaration of
>> DoShortenString.

> Oops. Have made it dynamic (I assume it will not be override so often).

Please, do not use "dynamic" on methods that called very often. Dynamic
calls are too slow :(

Bye.

Vadim Sedulin
E-Mail: [wsntrl@o...]

 | Replies | Author | Date
1178 | Re: DoShortenString | Mike Lischke | Thu 4/12/2001


re: processDrop problem

From: [koeneijsvogels@h...]
Date: Wed Apr 11, 2001 7:58 pm
Subject: Re: processDrop problem

Hello again,

i had this problem with processdrop (see below). After some debugging
I found out that the Node state wasn't set to vsCutOrCopy. Because of
this, nothing happened when I tried to move node within the tree. Is
this normal? Must the user set vsCutOrCopy himself?

My new code is now (before processDrop, all selected noed get the
state vsCutOrCopy, afterwards, this state is deleted again). is this
the right way?

// using version 1.31 of VT

procedure TMainForm.VSTDragDrop(Sender: TBaseVirtualTree; Source:
TObject;
DataObject: IDataObject; const Formats: array of Word;
Shift: TShiftState; Pt: TPoint; var Effect: Integer; Mode:
TDropMode);
var
Nodes: TNodeArray;
J: Integer;
I: Integer;
AttachMode: TVTNodeAttachMode;
begin
if Length(Formats) > 0 then
begin
// OLE drag'n drop
// If the native tree format is listed then use this and accept
the drop, otherwise recject (ignore) it.
// It is recommend by Microsoft to order available clipboard
formats in decreasing detail richness so
// the first best format which we can accept is usually the best
format we can get at all.

for I := 0 to High(Formats) do
if Formats[I] = CF_VIRTUALTREE then
begin
case Mode of
dmAbove:
AttachMode := amInsertBefore;
dmOnNode:
// nodes are moved in reverse logical order to speed up
reindexing of siblings
// so you need to specify the reverse mode here to that
you actually want
AttachMode := amAddChildLast;
dmBelow:
AttachMode := amInsertAfter;
else
if Assigned(Source) and
(Source is TBaseVirtualTree) and
(Sender <> Source) then AttachMode := amInsertBefore
else AttachMode := amNowhere;
end;

Nodes := nil;
if TBaseVirtualTree(Source).SelectedCount > 0 then
begin
// need the current selection sorted to exclude selected
nodes which are children, grandchildren etc. of
// already selected nodes
Nodes := TBaseVirtualTree(Source).GetSortedSelection(False);
for J := 0 to High(Nodes) do
with Nodes[J]^ do
if not (vsDisabled in States) then
Include(States, vsCutOrCopy);
end;

Effect:=DROPEFFECT_MOVE;
// in the case the drop target does an optimized move Effect
is set to DROPEFFECT_NONE
// to indicate this also to the drag source (so the source
doesn't need to take any further action)
Sender.ProcessDrop(DataObject, Sender.DropTargetNode, Effect,
AttachMode);

if TBaseVirtualTree(Source).SelectedCount > 0 then
begin
// need the current selection sorted to exclude selected
nodes which are children, grandchildren etc. of
// already selected nodes
Nodes := TBaseVirtualTree(Source).GetSortedSelection(False);
for J := 0 to High(Nodes) do
with Nodes[J]^ do
if not (vsDisabled in States) then
Exclude(States, vsCutOrCopy);
end;

Break;
end;
end else

begin
// VCL drag'n drop, Effects contains by default both move and
copy effect suggestion,
// as usual the application has to find out what operation is
finally to do
Beep;
end;
end;

--- In [VirtualTreeview@y...], [koeneijsvogels@h...] wrote:
> Hello,
>
> I'm trying to implement drag and drop in the same virtualtreeview
to
> allow users reordering their data, so I have only one
virtualtreeview
> in my program and I don't want to drop other things in it, only
copy
> or move within the treeview.
>
> As a test, I took the "minimal" demo provided with virtualtreeview
> and added the procedure VTDragDrop (see below) as stated in the
help
> file. I also set dragmode to dmAutomatic. When I try to drag and
> drop, Sender.ProcessDrop(DataObject, Sender.DropTargetNode, Effect,
> AttachMode); returns false and nothing happens. I tried version
1.31
> and 2.3b but no success. (I'm using Delphi 5)
>
> Has anyone any idea what might be wrong?
>
> (Besides my current problem, I thing virtualtreeview is a great
> component)
>
> Thank you in advance,
>
> Regards,
>
> Koen
>
>
>
> ---- VTDragDrop procedure as stated in the help file...
>
> procedure TMainForm.VTDragDrop(Sender: TBaseVirtualTree; Source:
> TObject; DataObject: IDataObject;
> const Formats: array of Word; Shift: TShiftState; Pt: TPoint; var
> Effect: Integer; Mode: TDropMode);
>
> var
> I: Integer;
> AttachMode: TVTNodeAttachMode;
>
> begin
> if Length(Formats) > 0 then
> begin
> // OLE drag'n drop
> // If the native tree format is listed then use this and accept
> the drop, otherwise recject (ignore) it.
> // It is recommend by Microsoft to order available clipboard
> formats in decreasing detail richness so
> // the first best format which we can accept is usually the
best
> format we can get at all.
> for I := 0 to High(Formats) do
> if Formats[I] = CF_VIRTUALTREE then
> begin
> case Mode of
> dmAbove:
> AttachMode := amInsertBefore;
> dmOnNode:
> // nodes are moved in reverse logical order to speed up
> reindexing of siblings
> // so you need to specify the reverse mode here to that
> you actually want
> AttachMode := amAddChildLast;
> dmBelow:
> AttachMode := amInsertAfter;
> else
> if Assigned(Source) and
> (Source is TBaseVirtualTree) and
> (Sender <> Source) then AttachMode := amInsertBefore
> else AttachMode := amNowhere;
> end;
> // in the case the drop target does an optimized move
Effect
> is set to DROPEFFECT_NONE
> // to indicate this also to the drag source (so the source
> doesn't need to take any further action)
> Sender.ProcessDrop(DataObject, Sender.DropTargetNode,
Effect,
> AttachMode);
> Break;
> end;
> end
> else
> begin
> // VCL drag'n drop, Effects contains by default both move and
> copy effect suggestion,
> // as usual the application has to find out what operation is
> finally to do
> Beep;
> end;
> end;


re: processDrop problem

From: [koeneijsvogels@h...]
Date: Wed Apr 11, 2001 7:58 pm
Subject: Re: processDrop problem

--- In [VirtualTreeview@y...], [koeneijsvogels@h...] wrote:
> Hello,
>
> I'm trying to implement drag and drop in the same virtualtreeview
to
> allow users reordering their data, so I have only one
virtualtreeview
> in my program and I don't want to drop other things in it, only
copy
> or move within the treeview.
>
> As a test, I took the "minimal" demo provided with virtualtreeview
> and added the procedure VTDragDrop (see below) as stated in the
help
> file. I also set dragmode to dmAutomatic. When I try to drag and
> drop, Sender.ProcessDrop(DataObject, Sender.DropTargetNode, Effect,
> AttachMode); returns false and nothing happens. I tried version
1.31
> and 2.3b but no success. (I'm using Delphi 5)
>
> Has anyone any idea what might be wrong?
>
> (Besides my current problem, I thing virtualtreeview is a great
> component)
>
> Thank you in advance,
>
> Regards,
>
> Koen
>
>
>
> ---- VTDragDrop procedure as stated in the help file...
>
> procedure TMainForm.VTDragDrop(Sender: TBaseVirtualTree; Source:
> TObject; DataObject: IDataObject;
> const Formats: array of Word; Shift: TShiftState; Pt: TPoint; var
> Effect: Integer; Mode: TDropMode);
>
> var
> I: Integer;
> AttachMode: TVTNodeAttachMode;
>
> begin
> if Length(Formats) > 0 then
> begin
> // OLE drag'n drop
> // If the native tree format is listed then use this and accept
> the drop, otherwise recject (ignore) it.
> // It is recommend by Microsoft to order available clipboard
> formats in decreasing detail richness so
> // the first best format which we can accept is usually the
best
> format we can get at all.
> for I := 0 to High(Formats) do
> if Formats[I] = CF_VIRTUALTREE then
> begin
> case Mode of
> dmAbove:
> AttachMode := amInsertBefore;
> dmOnNode:
> // nodes are moved in reverse logical order to speed up
> reindexing of siblings
> // so you need to specify the reverse mode here to that
> you actually want
> AttachMode := amAddChildLast;
> dmBelow:
> AttachMode := amInsertAfter;
> else
> if Assigned(Source) and
> (Source is TBaseVirtualTree) and
> (Sender <> Source) then AttachMode := amInsertBefore
> else AttachMode := amNowhere;
> end;
> // in the case the drop target does an optimized move
Effect
> is set to DROPEFFECT_NONE
> // to indicate this also to the drag source (so the source
> doesn't need to take any further action)
> Sender.ProcessDrop(DataObject, Sender.DropTargetNode,
Effect,
> AttachMode);
> Break;
> end;
> end
> else
> begin
> // VCL drag'n drop, Effects contains by default both move and
> copy effect suggestion,
> // as usual the application has to find out what operation is
> finally to do
> Beep;
> end;
> end;


re: New file uploaded to VirtualTreeview

From: "Malcolm Smith" [mjfreelancing@o...]
Date: Wed Apr 11, 2001 8:42 pm
Subject: RE: [VirtualTreeview] New file uploaded to VirtualTreeview

ZipMagic is good except its download manager won't let you get at the files
;-)

Mal

MJ Freelancing
http://www.mjfreelancing.com
ABN: 30 671 763 146

CORintel
ABN: 30 336 110 329

-----Original Message-----
From: Thomas Schoessow [mailto:[info@t...]]
Sent: Wednesday, 11 April 2001 22:25
To: [VirtualTreeview@yahoogroups.com
Subject: Re: [VirtualTreeview] New file uploaded to VirtualTreeview

No, should I ? -)

Regards

Thomas

--------------------------------------------------------------
Softwareentwicklung Thomas Schoessow
http://www.tschoessow.de
http://www.schoessow.de
EMail: [feedback@t...]
--------------------------------------------------------------

-----Ursprüngliche Nachricht-----
Von: "Mike Lischke" <public@l...]
An: <VirtualTreeview@yahoogroups.com>
Gesendet: Mittwoch, 11. April 2001 13:27
Betreff: RE: [VirtualTreeview] New file uploaded to VirtualTreeview

> Thomas,
>
> > I do have the same probs. Sometimes I get 10 KB, 13 KB but
> > not the whole file -(
>
> Do you use ZipMagic?
>
> Ciao, Mike
>
>
> To unsubscribe from this group, send an email to:
> VirtualTreeview-unsubscribe@egroups.com
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>
>

To unsubscribe from this group, send an email to:
VirtualTreeview-unsubscribe@egroups.com

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/


Editor resizing

From: "Cyril VELTER" [cyril.velter@l...]
Date: Wed Apr 11, 2001 9:01 pm
Subject: Editor resizing

Hi mike,

There is still an editor resizing problem in the last VT. If you edit a
node when the tree gave no column, the editor take the whole width ( and
doesn't resizze at all if the tree width is changed during editing), which
is not very nice. I attached a patch of a modification I made to handle the
resize properly.

cyril

15656a15656

> EditRect,

15911a15912,15923

> // If the node is being edited in the main column

> // set the right rect for the editor

> if (tsEditing in FStates) and (PaintInfo.Node=FFocusedNode) and

> (FEditColumn = FHeader.MainColumn) and (FEditColumn=PaintInfo.Position )
then

> begin

> EditRect:=PaintInfo.ContentRect;

> EditRect.Top:=EditRect.Top+FEditLink.GetBounds.Top;

> EditRect.Bottom:=EditRect.Bottom+FEditLink.GetBounds.Bottom;

> // Clip right to visible part

> if EditRect.Right>ClientWidth-Margin then
EditRect.Right:=ClientWidth-Margin;

> FEditLink.SetBounds(EditRect);

> end;

 | Replies | Author | Date
1158 | Re: Editor resizing | Mike Lischke | Thu 4/12/2001
1165 | Re: Editor resizing | Cyril VELTER | Thu 4/12/2001
1169 | Re: Editor resizing | Mike Lischke | Thu 4/12/2001
1171 | Re: Editor resizing | Cyril VELTER | Thu 4/12/2001
1191 | Re: Editor resizing | Mike Lischke | Fri 4/13/2001


2 minor bugs

From: "Vadim Sedulin" [wsntrl@o...]
Date: Wed Apr 11, 2001 9:23 pm
Subject: 2 minor bugs

Hello Mike!

1. "soHideFocusRect" in options (maybe "voXXX"?).
2. voMultiSelect+voXxxxSelectConstraint: node did not deselected when moved
(MoveTo) outside of constraint.

Bye.

Vadim Sedulin
E-Mail: [wsntrl@o...]

 | Replies | Author | Date
1143 | Re: 2 minor bugs | Werner Lehmann | Wed 4/11/2001
1152 | Re: 2 minor bugs | Vadim Sedulin | Thu 4/12/2001
1159 | Re: 2 minor bugs | Mike Lischke | Thu 4/12/2001


Problem when changing root node

From: "Cyril VELTER" [cyril.velter@l...]
Date: Wed Apr 11, 2001 10:11 pm
Subject: Problem when changing root node

I've a problem with the latest sources :

I've a tree where the root node change. The first time I set
rootnodecount, my DoInitNode is called. When I want to change the root node,
I call Clear and set rootnodecount again but now DoInitNode is not called
and the tree is empty.

Am I doing something I should not ?

This used to worked fine in the previous beta.

cyril

 | Replies | Author | Date
1145 | Re: Problem when changing root node | Werner Lehmann | Wed 4/11/2001
1160 | Re: Problem when changing root node | Mike Lischke | Thu 4/12/2001


re: New file uploaded to VirtualTreeview

From: "Malcolm Smith" [mjfreelancing@o...]
Date: Wed Apr 11, 2001 11:26 pm
Subject: RE: [VirtualTreeview] New file uploaded to VirtualTreeview

I fixed my DownloadMagic problem. Even after I told it not operate under IE
it still did. I therefore removed .zip from its list and now I go to the
files folder and right-click and choose "Save As". This is the only way to
get my downloads.

At least I can get the updates now.

Mal

MJ Freelancing
http://www.mjfreelancing.com
ABN: 30 671 763 146

CORintel
ABN: 30 336 110 329

-----Original Message-----
From: [VirtualTreeview@yahoogroups.com
[mailto:[VirtualTreeview@yahoogroups.com]
Sent: Thursday, 12 April 2001 01:47
To: VirtualTreeview@yahoogroups.com
Subject: [VirtualTreeview] New file uploaded to VirtualTreeview

Hello,

This email message is a notification to let you know that
a file has been uploaded to the Files area of the VirtualTreeview
group.

File : /VirtualTreeview.zip
Uploaded by : public@l...]
Description : Version 2.3ß

You can access this file at the URL

http://groups.yahoo.com/group/VirtualTreeview/files/VirtualTreeview.zip

To learn more about file sharing for your group, please visit

http://help.yahoo.com/help/us/groups/files

Regards,

public@l...]

To unsubscribe from this group, send an email to:
VirtualTreeview-unsubscribe@egroups.com

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/


re: 2 minor bugs

From: Werner Lehmann [wl@b...]
Date: Wed Apr 11, 2001 10:06 pm
Subject: Re: [VirtualTreeview] 2 minor bugs

Vadim Sedulin wrote:
>
> 2. voMultiSelect+voXxxxSelectConstraint: node did not deselected when moved
> (MoveTo) outside of constraint.

I am responsible for voSiblingSelectConstraint (I bugged Mike so long until
he gave up and made that option available :) So I should say a word to this
point: as far as I understand it this is mereley a user selection constraint.
I mean you are restricted to certain nodes if you select by click and drag.
Or by keyboard. If your application moves nodes on its own behalf it should
know what to do with the selection. It may well be that you move (program-
matically) half of the childs of a node (which are all selected) to another
node. Now which half should stay selected? Your program must decide that.
And it can do so easily. The original problem (the cause for these options)
was to restrict a selection by the user with no event.

Regards,
Werner


New bug introduced in latest version

From: Werner Lehmann [wl@b...]
Date: Wed Apr 11, 2001 11:18 pm
Subject: New bug introduced in latest version

Mike,

we have another bug *sigh*. This one is new over the previous
2.3 version (2.3b vs 2.3c). I am investigating it now. The
situation is this: two VTree form an explorer similar inter-
face: a tree and a list. The new problem symptoms: if a new
node in the tree is selected the list must be updated. Instead,
the list appears empty. If I select another node to force another
list update I am getting an EIntOverflow Exception here:

procedure TBaseVirtualTree.DeleteChildren(Node: PVirtualNode; ResetHasChildren:
Boolean = False);
...
Run := Node.LastChild;
while Assigned(Run) do
begin
if NodeVisible and (vsVisible in Run.States) then
Dec(FVisibleCount); <------------
...

FVisibleCount is 2^32-1 in the debugger tooltip. Obviously it
was 0 before the dec.

45 minutes later: I have found the problem. :)

In .Clear you call .DeleteChildren with FRoot as parameter. And in
.DeleteChildren you added this line:

Exclude(Node.States, vsExpanded);

Node has not been changed and is still FRoot. FRoot is thus not
vsExpanded anymore. In PaintTree you get the first node to be painted
with GetNodeAt which relies on GetFirstNodeNoInit which in turn has
a problem with a not expanded root node and returns nil. The first
visible node is nil so no nodes are painted.

Was a little bit tedious to find this by 'backward debugging'...
My fix is currently this (in .DeleteChildren):

if Node <> FRoot then
Exclude(Node.States, vsExpanded);

Please tell me if this is not appropriate for any reason.

Regards,
Werner

 | Replies | Author | Date
1161 | Re: New bug introduced in latest version | Mike Lischke | Thu 4/12/2001


re: Problem when changing root node

From: Werner Lehmann [wl@b...]
Date: Wed Apr 11, 2001 11:24 pm
Subject: Re: [VirtualTreeview] Problem when changing root node

Cyril VELTER wrote:
>
> This used to worked fine in the previous beta.

Sounds like you stumbled over the same problem as I did. You
may try the fix that I have posted 2 min ago.

Werner


Missing dcu

From: "Malcolm Smith" [mjfreelancing@o...]
Date: Wed Apr 11, 2001 11:36 pm
Subject: Missing dcu

I am building VirtualTreeView for C++Builder but it complains about not
being able to find ColnEdit.dcu

I found a hpp file but cannot find the .pas file.

Mal

MJ Freelancing
http://www.mjfreelancing.com
ABN: 30 671 763 146

CORintel
ABN: 30 336 110 329

-----Original Message-----
From: [VirtualTreeview@yahoogroups.com
[mailto:[VirtualTreeview@yahoogroups.com]
Sent: Thursday, 12 April 2001 01:47
To: VirtualTreeview@yahoogroups.com
Subject: [VirtualTreeview] New file uploaded to VirtualTreeview

Hello,

This email message is a notification to let you know that
a file has been uploaded to the Files area of the VirtualTreeview
group.

File : /VirtualTreeview.zip
Uploaded by : public@l...]
Description : Version 2.3ß

You can access this file at the URL

http://groups.yahoo.com/group/VirtualTreeview/files/VirtualTreeview.zip

To learn more about file sharing for your group, please visit

http://help.yahoo.com/help/us/groups/files

Regards,

public@l...]

To unsubscribe from this group, send an email to:
VirtualTreeview-unsubscribe@egroups.com

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/


re: Missing dcu

From: Ondrej Kelle [O.Kelle@d...]
Date: Wed Apr 11, 2001 11:30 pm
Subject: RE: [VirtualTreeview] Missing dcu

> I am building VirtualTreeView for C++Builder but it complains
> about not being able to find ColnEdit.dcu

Add dsnide50.dcp to the requires clause of your designtime package.
HTH,
TOndrej

 | Replies | Author | Date
1148 | Re: Missing dcu | Malcolm Smith | Wed 4/11/2001
1149 | Re: Missing dcu | Ondrej Kelle | Thu 4/12/2001
1151 | Re: Missing dcu | Malcolm Smith | Thu 4/12/2001
1155 | Re: Missing dcu | Roland | Thu 4/12/2001
1184 | Re: Missing dcu | Malcolm Smith | Thu 4/12/2001
1167 | Re: Missing dcu | Mike Lischke | Thu 4/12/2001
1185 | Re: Missing dcu | Malcolm Smith | Thu 4/12/2001
1194 | Re: Missing dcu | Mike Lischke | Fri 4/13/2001
1203 | Re: Missing dcu | Malcolm Smith | Fri 4/13/2001


re: Missing dcu

From: "Malcolm Smith" [mjfreelancing@o...]
Date: Wed Apr 11, 2001 11:46 pm
Subject: RE: [VirtualTreeview] Missing dcu

I added dsnide50.bpi (don't have a dcp) but I still get the error.

Mal

MJ Freelancing
http://www.mjfreelancing.com
ABN: 30 671 763 146

CORintel
ABN: 30 336 110 329

-----Original Message-----
From: Ondrej Kelle [mailto:[O.Kelle@d...]]
Sent: Thursday, 12 April 2001 09:31
To: 'VirtualTreeview@yahoogroups.com'
Subject: RE: [VirtualTreeview] Missing dcu

> I am building VirtualTreeView for C++Builder but it complains
> about not being able to find ColnEdit.dcu

Add dsnide50.dcp to the requires clause of your designtime package.
HTH,
TOndrej

To unsubscribe from this group, send an email to:
VirtualTreeview-unsubscribe@egroups.com

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/


re: Missing dcu

From: Ondrej Kelle [O.Kelle@d...]
Date: Thu Apr 12, 2001 12:04 am
Subject: RE: [VirtualTreeview] Missing dcu

> I added dsnide50.bpi (don't have a dcp) but I still get the error.

Sorry I don't have BCB at hand. In Delphi, .dcp stands for Delphi Compiled
Package. These files are what you put into the "requires" clause of packages
in Delphi. I don't know the BCB filename convention.

Basically I think the problem is the following:
One of your units uses ColnEdit unit but ColnEdit unit cannot be found by
BCB. You have neither the source file nor the compiled unit because it's
internal Delphi/BCB unit which is not shipped with the product.
It is however compiled into dsnide50.bpl. The target package (.bpl, in \Bin
directory) and compiled package (.dcp, in \Lib) files are shipped with
Delphi/BCB. You need to add dsnide50.xxx (whatever the BCB extension for a
compiled package) to the requires clause of your package. That should fix
the problem. The compiler will look up ColnEdit unit in the compiled package
file.
HTH,
TOndrej

P.S. I believe that the compiled package file extension is still .dcp even
in BCB, isn't it?

 | Replies | Author | Date
1151 | Re: Missing dcu | Malcolm Smith | Thu 4/12/2001


Minor bug

From: "Vadim Sedulin" [wsntrl@o...]
Date: Thu Apr 12, 2001 12:11 am
Subject: Minor bug

Hello Mike!

procedure TBaseVirtualTree.WMKeyDown(var Message: TWMKeyDown);

VK_MULTIPLY:
if Assigned(FFocusedNode) and not (vsExpanded in FFocusedNode.States) then
FullExpand(FFocusedNode);

replace with:

VK_MULTIPLY:
if Assigned(FFocusedNode) then
FullExpand(FFocusedNode);

Bye.

Vadim Sedulin
E-Mail: [wsntrl@o...]

 | Replies | Author | Date
1163 | Re: Minor bug | Mike Lischke | Thu 4/12/2001


re: Missing dcu

From: "Malcolm Smith" [mjfreelancing@o...]
Date: Thu Apr 12, 2001 12:47 am
Subject: RE: [VirtualTreeview] Missing dcu

I have added dsnide50 to the requires clause but I get the error still. A
similar problem generally occurs with DsgnIntf but BCB has the .pas file
supplied so we can compile it using the Delphi compiler (supplied with BCB).
There is no .pas file for ColnEdit.

Mal

MJ Freelancing
http://www.mjfreelancing.com
ABN: 30 671 763 146

CORintel
ABN: 30 336 110 329

-----Original Message-----
From: Ondrej Kelle [mailto:[O.Kelle@d...]]
Sent: Thursday, 12 April 2001 10:05
To: 'VirtualTreeview@yahoogroups.com'
Subject: RE: [VirtualTreeview] Missing dcu

> I added dsnide50.bpi (don't have a dcp) but I still get the error.

Sorry I don't have BCB at hand. In Delphi, .dcp stands for Delphi Compiled
Package. These files are what you put into the "requires" clause of packages
in Delphi. I don't know the BCB filename convention.

Basically I think the problem is the following:
One of your units uses ColnEdit unit but ColnEdit unit cannot be found by
BCB. You have neither the source file nor the compiled unit because it's
internal Delphi/BCB unit which is not shipped with the product.
It is however compiled into dsnide50.bpl. The target package (.bpl, in \Bin
directory) and compiled package (.dcp, in \Lib) files are shipped with
Delphi/BCB. You need to add dsnide50.xxx (whatever the BCB extension for a
compiled package) to the requires clause of your package. That should fix
the problem. The compiler will look up ColnEdit unit in the compiled package
file.
HTH,
TOndrej

P.S. I believe that the compiled package file extension is still .dcp even
in BCB, isn't it?

To unsubscribe from this group, send an email to:
VirtualTreeview-unsubscribe@egroups.com

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/


re: 2 minor bugs

From: "Vadim Sedulin" [wsntrl@o...]
Date: Thu Apr 12, 2001 1:32 am
Subject: Re: [VirtualTreeview] 2 minor bugs

Hello Werner!

> I am responsible for voSiblingSelectConstraint (I bugged Mike so long
until
> he gave up and made that option available :) So I should say a word to
this
> point: as far as I understand it this is mereley a user selection
constraint.
> I mean you are restricted to certain nodes if you select by click and
drag.
> Or by keyboard. If your application moves nodes on its own behalf it
should
> know what to do with the selection. It may well be that you move (program-
> matically) half of the childs of a node (which are all selected) to
another
> node. Now which half should stay selected? Your program must decide that.
> And it can do so easily. The original problem (the cause for these
options)
> was to restrict a selection by the user with no event.

Maybe you right. If so it must be figured in help...

Bye.

Vadim Sedulin
E-Mail: [wsntrl@o...]


re: New VET Demo

From: "Jim Kueneman" [jimdk@m...]
Date: Thu Apr 12, 2001 5:19 am
Subject: Re: New VET Demo

--- In [VirtualTreeview@y...], Mike Lischke [public@l...] wrote:
>
> library to replace other variants (mainly Brad Stowers system
treeview).
> Excellent work Jim!

I am humbled :^)

> The only little glitch I found so far is that if all files are shown
and a
> folder has no subfolders but only files then it does not get the
> vsHasChildren style. By double-clicking the node I can expand it
however. I
> guess you need to check for at least one file separately.
> SFGAO_HASSUBFOLDERS is not enough in this situation.

I noticed this too. MS did not really design the shell to work like
this, all in one control. Is this the way you are envisioning VET?
Or should it be converted into a treeview and a "reportview only"
listview created with VT? Is it possible to not show the root node
and make it look like a listview, like the Treeview MS control instead
of having to go through the effort of making numerous root nodes? I
have several issues with leaving it as one control, such as not being
able to display column titles correctly as there may be a various
types of nodes displayed at once. I hesitate to force it to enumerate
one file per folder for performance reasons, especially on networked
systems.

Have you ever thought of other ways to display the Explorer
information?

Jim

BTW
Is the speed up to your satisfaction? Even with the info cached I
still find the listview in Explorer to be faster than VET with my old
166Mhz in both scrolling and sizing columns. The scrolling is
actually ugly when done fast, it leave lots of "pixel droppings"
behind as the display trys to keep up as you scroll.


re: New VET Demo

From: [adembaba@e...]
Date: Thu Apr 12, 2001 6:57 am
Subject: Re: New VET Demo

Hi,

I wrote to group earlier with more detail, but somehow it
seems to have been lost, I am re-writing a shorter version
again.

First: VET is excellent. On a win2KPro I saw no speed
degredation. Everything looked great.

Just one thing: When I double click any file on the demo,
I am told that it can not find the file; directory invalid.

It does not seem to be coming from Jim's source (I went
through it as much as I could, and could not find any
place where it emits such message on double click).

Does anyone know why it displays this message.

BTW, I did not compile it --as per advised.

Cheers,

--- In [VirtualTreeview@y...], "Jim Kueneman" [jimdk@m...] wrote:
> I uploaded the latest version of the virtual explorer tree (VET).
> There is not a lot new with the treeview component but a lot of
work
> has been done with the TNamespace class to speed it up and add
Delphi
> type access to much the information that a COM namespace offers. I
> added a form to show most of this information for the selected
node.
> This causes selection of the node very slow since it is retrieving
a
> lot of information. It can be turned on/off.
>
> One issue I have is IExtractImage, if anyone has gotten this to
work I
> would like some help :^) It will show a path for the image on some
> files (DOC and TXT especially) but it will never extract the
thumbnail
> image.
>
> In the IShellFolder tab only Win2k user will see anything
interesting
> with all the different ways the name of the namespace can be
> retrieved. Win2k returns the class ID for the name of a lot of the
> special folder unless the FORADDRESSBAR is included.
>
> Note what is returned in the info form is highly dependant of what
> version of the common control dll is installed (which is what makes
> shell programming *interesting*)
>
> Have fun and let me know if there are any issues.
>
> Note I had to implement Werner's latest bug fix to make the columns
> work without giving a invalid TList index exception so wait for the
> next release of Mike's VT before trying to compile the source or
> installing the component. The exe is included for your enjoyment.
>
> Jim Kueneman

 | Replies | Author | Date
1162 | Re: New VET Demo | GUCLU ONGUN | Thu 4/12/2001


re: Missing dcu

From: "Roland" [Beduerftig@S...]
Date: Thu Apr 12, 2001 8:44 am
Subject: Re: Missing dcu

--- In [VirtualTreeview@y...], Ondrej Kelle [O.Kelle@d...] wrote:
> > I am building VirtualTreeView for C++Builder but it complains
> > about not being able to find ColnEdit.dcu
>
> Add dsnide50.dcp to the requires clause of your designtime package.
> HTH,
> TOndrej

I use also BCB5 and this problem happens by using the
VirtualTreesReg.pas, I modify the unit as following:

unit VirtualTreesReg;

interface

uses
Windows, Classes,
DsgnIntf,
{$ifndef BCB}
ColnEdit,
{$endif}
VirtualTrees;

{$ifndef BCB}
type
TVirtualTreeEditor = class (TDefaultEditor)
public
procedure Edit; override;
end;
{$endif}

procedure Register;

//----------------------------------------------

implementation

uses
Dialogs;

type
TVirtualTreeCast = class(TBaseVirtualTree);

//----------------------------------------------

{$ifndef BCB}
procedure TVirtualTreeEditor.Edit;
begin
ShowCollectionEditor(Designer, Component, TVirtualTreeCast
(Component).Header.Columns, 'Columns');
end;
{$endif}

//----------------------------------------------

procedure Register;

begin
RegisterComponents('Win32', [TVirtualStringTree, TVirtualDrawTree]);
{$ifndef BCB}
RegisterComponentEditor(TVirtualStringTree, TVirtualTreeEditor);
RegisterComponentEditor(TVirtualDrawTree, TVirtualTreeEditor);
{$endif}
end;

//----------------------------------------------

end.

With this {$ifdef BCB} the unit works under Delphi5 and BCB5, I can
edit the columns at designtime with the normal editors buildin BCB.

Roland

 | Replies | Author | Date
1184 | Re: Missing dcu | Malcolm Smith | Thu 4/12/2001


re: SetoleClipboard(nil)

From: Mike Lischke [public@l...]
Date: Thu Apr 12, 2001 9:00 am
Subject: RE: [VirtualTreeview] SetoleClipboard(nil)

Hi Teus,

> 1. In the latest version of the Clear procedure of TBaseVirtualTree
> it still states unconditionally SetOleClipBoard(nil).

In the version I have uploaded yesterday this is fixed.

> 2. If you are still interested in examples, I could prepare an
> example with three components (including source and demo), all
> working with your component. The three components (TVTFolderTree,
> TFilelist and TVTNetFoldertree) together give a simplified version of
> my file manager.

Yes of course! The more examples there are in the package the more people
will find help for their specific problems. Please bind a read-to-install
package along with your demo. I'd be glad to include it into the
distribution. Please don't forget to leave a copyright notice and a contact
address somewhere, so people can get directly to you if there are questions.
And I'd be happy if I could get your stuff in at most a week or so.

Ciao, Mike


re: Re: processDrop problem

From: Mike Lischke [public@l...]
Date: Thu Apr 12, 2001 9:21 am
Subject: RE: [VirtualTreeview] Re: processDrop problem

Hi Koen,

> i had this problem with processdrop (see below). After some debugging
> I found out that the Node state wasn't set to vsCutOrCopy. Because of
> this, nothing happened when I tried to move node within the tree. Is
> this normal? Must the user set vsCutOrCopy himself?
>
> My new code is now (before processDrop, all selected noed get the
> state vsCutOrCopy, afterwards, this state is deleted again). is this
> the right way?

Well, there were some problems with the clipboard handling in previous
versions. I hope to have fixed them in the latest release. I have checked
every situation I can think of, but you know, you can never proof there is
no error, only *that* there is an error and the absence of any error message
during tests does not mean there is no error at all.

Your application is not required to touch any internal state of the tree or
the nodes. You can do so but the tree works of course also without
intervention of the application.

Ciao, Mike

PS: Please don't quote too much from older mails. It is very difficult to
find what is actually interesting. Thank you.


re: Editor resizing

From: Mike Lischke [public@l...]
Date: Thu Apr 12, 2001 9:25 am
Subject: RE: [VirtualTreeview] Editor resizing

Hi Cyril,

> There is still an editor resizing problem in the last VT.
> If you edit a node when the tree gave no column, the editor take the whole

> width ( and doesn't resizze at all if the tree width is changed during
> editing), which is not very nice. I attached a patch of a modification I
made
> to handle the resize properly.

Which version are you talking about? I have already fixed this a while ago
and checked it again with the Minimal demo. In this demo there is no column
defined so the editor is as small as possible to fit the node's text.

Ciao, Mike


re: 2 minor bugs

From: Mike Lischke [public@l...]
Date: Thu Apr 12, 2001 9:29 am
Subject: RE: [VirtualTreeview] 2 minor bugs

Hi Vadim

> 1. "soHideFocusRect" in options (maybe "voXXX"?).

I must have been under drugs when I moved this option, so I forgot to rename
it.

> 2. voMultiSelect+voXxxxSelectConstraint: node did not
> deselected when moved (MoveTo) outside of constraint.

Werner already answered this. Indeed, those constrains are merely a visual
aspect for the user. I could include code to check if new/moved nodes fit in
the current constrain but there could well be situations where the tree
cannot decide, so I think it is better to leave that to the application.

Ciao, Mike


re: Problem when changing root node

From: Mike Lischke [public@l...]
Date: Thu Apr 12, 2001 9:31 am
Subject: RE: [VirtualTreeview] Problem when changing root node

> I've a tree where the root node change. The first time I set
> rootnodecount, my DoInitNode is called. When I want to change
> the root node,
> I call Clear and set rootnodecount again but now DoInitNode
> is not called and the tree is empty.

This was a little bug I have introduced when I worked out the problem when
adding/deleting nodes on expand/collapse. I have reset the expanded state of
a node if its children are deleted. But this should of course not happen for
the root node. I have now included an appropriated check.

Ciao, Mike


re: New bug introduced in latest version

From: Mike Lischke [public@l...]
Date: Thu Apr 12, 2001 9:37 am
Subject: RE: [VirtualTreeview] New bug introduced in latest version

Hi Werner

> we have another bug *sigh*. This one is new over the previous
> 2.3 version (2.3b vs 2.3c). I am investigating it now.

> In .Clear you call .DeleteChildren with FRoot as parameter. And in
> .DeleteChildren you added this line:
>
> Exclude(Node.States, vsExpanded);

Hehe, this is exactly what I just wrote to Cyril. I have fixed this problem
too and want to express my respect that you found this bug. I believe after
me you are the one with the best knowledge about the internals of VT I know
of. Should I ever not be available anymore then you are a worthy successor!
Hut ab.

Ciao, Mike


re: Re: New VET Demo

From: "GUCLU ONGUN" [guclu.ongun@i...]
Date: Thu Apr 12, 2001 9:33 am
Subject: RE: [VirtualTreeview] Re: New VET Demo

>Just one thing: When I double click any file on the demo,
>I am told that it can not find the file; directory invalid.

>It does not seem to be coming from Jim's source (I went
>through it as much as I could, and could not find any
>place where it emits such message on double click).

I think this is a message raised by ShellExecute. It indicates
that the registery 'open' definition of that extension cannot handle
long file names due to missing double quote (") around definition.
(or may be shellexecute call is inappropriate, but i do not have the
demo yet).

regards,
guclu


re: Minor bug

From: Mike Lischke [public@l...]
Date: Thu Apr 12, 2001 9:43 am
Subject: RE: [VirtualTreeview] Minor bug

Vadim,

> replace with:
>
> VK_MULTIPLY:
> if Assigned(FFocusedNode) then
> FullExpand(FFocusedNode);

It seems you are quickly finding all my little odd things I have hidden in
VT. I promise this is not because Easter is due, but just because I had
probably a bad moment or something like this when I wrote that :o]

Ciao, Mike


re: Re: New VET Demo

From: Mike Lischke [public@l...]
Date: Thu Apr 12, 2001 10:01 am
Subject: RE: [VirtualTreeview] Re: New VET Demo

Hi Jim,

> I noticed this too. MS did not really design the shell to work like
> this, all in one control. Is this the way you are envisioning VET?

Yes, I think this would be the "natural" way after all that what is now
there.

> Or should it be converted into a treeview and a "reportview only"
> listview created with VT? Is it possible to not show the root node
> and make it look like a listview, like the Treeview MS
> control instead of having to go through the effort of making numerous root
nodes?

No, I think this is not the problem The only thing I see is that if file
enumeration is enabled then the name space should do a FindFirst when asked
for sub items. Remember, any file fits, so only one is need (exclude the
folder flag from the FindFirst attributes so '.' and '..' will not be
returned and one single call is sufficient).

> Is the speed up to your satisfaction? Even with the info cached I
> still find the listview in Explorer to be faster than VET with my old
> 166Mhz in both scrolling and sizing columns. The scrolling is
> actually ugly when done fast, it leave lots of "pixel droppings"
> behind as the display trys to keep up as you scroll.

There shouldn't be any paint artifacts, this sounds rather like a display
driver problem. I am quite satisfied with the speed of VET, yes. Of course
it could still be faster but I believe most of the time is now spent
painting the nodes, not retrieving the information. On my 350Mhz PII VET is
nearly as fast as the Explorer Listview if I keep the window size in a
reasonable range. I already encountered that painting of the tree is quite
time consuming but I cannot really figure out the bottlenecks. A profile on
sub method level would be good here...

Ciao, Mike


re: Editor resizing

From: "Cyril VELTER" [cyril.velter@l...]
Date: Thu Apr 12, 2001 10:05 am
Subject: Re: [VirtualTreeview] Editor resizing

It's with your last upload (yesterday). I've a custom editor class,
which works nicely in grid mode.

cyril

----- Original Message -----
From: "Mike Lischke" [public@l...]
To: <VirtualTreeview@yahoogroups.com>
Sent: Thursday, April 12, 2001 11:25 AM
Subject: RE: [VirtualTreeview] Editor resizing

> Hi Cyril,
>
> > There is still an editor resizing problem in the last VT.
> > If you edit a node when the tree gave no column, the editor take the
whole
>
> > width ( and doesn't resizze at all if the tree width is changed during
> > editing), which is not very nice. I attached a patch of a modification I
> made
> > to handle the resize properly.
>
> Which version are you talking about? I have already fixed this a while ago
> and checked it again with the Minimal demo. In this demo there is no
column
> defined so the editor is as small as possible to fit the node's text.
>
> Ciao, Mike
>
>
> To unsubscribe from this group, send an email to:
> VirtualTreeview-unsubscribe@egroups.com
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>


re: Re: New VET Demo

From: Mike Lischke [public@l...]
Date: Thu Apr 12, 2001 10:09 am
Subject: RE: [VirtualTreeview] Re: New VET Demo

> A profile on sub method level would be good here...

I meant a profiler.


re: Re: Missing dcu

From: Mike Lischke [public@l...]
Date: Thu Apr 12, 2001 10:38 am
Subject: RE: [VirtualTreeview] Re: Missing dcu

Roland,

> I use also BCB5 and this problem happens by using the
> VirtualTreesReg.pas, I modify the unit as following:

Yes, but this modification will disable the ability to double click the tree
to open the collection editor. This is the only reason why there is a
separate registration file at all.

Ciao, Mike

 | Replies | Author | Date
1185 | Re: Missing dcu | Malcolm Smith | Thu 4/12/2001
1194 | Re: Missing dcu | Mike Lischke | Fri 4/13/2001
1203 | Re: Missing dcu | Malcolm Smith | Fri 4/13/2001
1205 | Re: Missing dcu | Mike Lischke | Sat 4/14/2001
1207 | Re: Missing dcu | Malcolm Smith | Sat 4/14/2001
1208 | Re: Missing dcu | Alexander Egorushkin | Sat 4/14/2001
1209 | Re: Missing dcu | Mike Lischke | Sat 4/14/2001
1212 | Re: Missing dcu | Alexander Egorushkin | Sat 4/14/2001
1226 | Re: Missing dcu | Alexander Egorushkin | Sun 4/15/2001


re: Re: New VET Demo

From: Mike Lischke [public@l...]
Date: Thu Apr 12, 2001 10:48 am
Subject: RE: [VirtualTreeview] Re: New VET Demo

Hi Guclu,

> I think this is a message raised by ShellExecute. It indicates
> that the registery 'open' definition of that extension cannot handle
> long file names due to missing double quote (") around definition.
> (or may be shellexecute call is inappropriate, but i do not have the
> demo yet).

I rather think this is because the double click will be interpreted as the
desire to expand a node which is not a folder. This non-folder is then bound
to an IShellFolder which fails with the given error message. I could be
wrong however....

Ciao, Mike

 | Replies | Author | Date
1173 | Re: New VET Demo | Jim Kueneman | Thu 4/12/2001


re: Editor resizing

From: Mike Lischke [public@l...]
Date: Thu Apr 12, 2001 10:53 am
Subject: RE: [VirtualTreeview] Editor resizing

> It's with your last upload (yesterday). I've a custom
> editor class, which works nicely in grid mode.

Mmmh, then you should perhaps check the SetBounds method of your editor
class. The built-in class does some work to fit correctly and your own class
should do similar things.

Ciao, Mike


re: Re: New VET Demo

From: "Cyril VELTER" [cyril.velter@l...]
Date: Thu Apr 12, 2001 11:17 am
Subject: Re: [VirtualTreeview] Re: New VET Demo

I just ran a line profiler on The virtual explorer demo with the
following test procedure. If you want me do time some specific routines,
I'll be happy to do these tests.

cyril

Routines timed :

PaintTree,
PaintTreeLines,
PaintNodeButton,
PaintImage,
Paint, (1156 calls)
DoPaintText,
DoPaintNode, (9727 calls)
DoPaintDropMark

Open the virtual explorer in full screen (1024*1536)

Open winnt/system32 folder

Scroll several times over the tree

The "top 10" lines are:

in PaintTree :
Line Time (mS) % hits Source
15848 6917,977344 27% 114906 ImageInfo[iiNormal].Index :=
DoGetImageIndex(Node, ImageKind[vsSelected in Node.States], Column,
15983 3164,800455 12% 12853 BitBlt(TargetCanvas.Handle, Left, Top,
Width, Height, Canvas.Handle, Window.Left, 0, SRCCOPY);
15765 3161,837088 12% 12853 ClearNodeBackground(PaintInfo.Canvas,
PaintInfo.Node, UseBackground, True,
15861 2480,744571 9,74% 114906 LimitPaintingToArea(Canvas, CellRect);

in DoPaintNode
21210 2018,171652 7,9% 114906 DoGetText(PaintInfo.Node,
PaintInfo.Column, ttNormal, Text);

in PaintTree :
15936 1236,452227 4,9% 114906 SelectClipRgn(PaintInfo.Canvas.Handle,
0);

in PaintImage
9861 921,962060 3,6% 12849 ImageList_DrawEx(Handle, Index,
Canvas.Handle, XPos, YPos, 0, 0,

in PaintTreeLines
9890 674,553274 2,6% 69651 DrawLineImage(Canvas, XPos, R.Top,
Node.NodeHeight, Alignment, LineImage[I], BidiMod

in PaintNodeButton
9806 566,769282 2,2% 2059 Canvas.Draw(XPos, R.Top + ButtonY,
Bitmap);

in PaintImage
9834 455,396500 1,8% 12849 OverlayImage :=
DoGetImageIndex(PaintInfo.Node, ikOverlay, PaintInfo.Column, OverlayGhosted)

> > A profile on sub method level would be good here...
>
> I meant a profiler.

 | Replies | Author | Date
1172 | Re: New VET Demo | Jim Kueneman | Thu 4/12/2001


re: Editor resizing

From: "Cyril VELTER" [cyril.velter@l...]
Date: Thu Apr 12, 2001 11:48 am
Subject: Re: [VirtualTreeview] Editor resizing

OK, I missed the GetTextInfo method. But I still can't make it behave as
I would like it to.
I want the editor to resize if the tree is resized (imagine, you begin
an edit with a small tree and then enlarge the tree : the SetBounds methods
is not called as when a column is resized, the editor keep the same size).

Adding the following in TBaseVirtualTree.WMSizewill solve the problem :

// If the tree is currently in edit state then notify edit link.
if tsEditing in FStates then
FEditLink.SetBounds(GetDisplayRect(FFocusedNode, FEditColumn, False));

Thanks,

cyril

> > It's with your last upload (yesterday). I've a custom
> > editor class, which works nicely in grid mode.
>
> Mmmh, then you should perhaps check the SetBounds method of your editor
> class. The built-in class does some work to fit correctly and your own
class
> should do similar things.
>


re: New VET Demo

From: "Jim Kueneman" [jimdk@m...]
Date: Thu Apr 12, 2001 1:21 pm
Subject: Re: New VET Demo

--- In [VirtualTreeview@y...], "Cyril VELTER" [cyril.velter@l...] wrote:
>
> in PaintTree :
> Line Time (mS) % hits Source
> 15848 6917,977344 27% 114906 ImageInfo[iiNormal].Index :=
> DoGetImageIndex(Node, ImageKind[vsSelected in Node.States], Column,

No suprise here. After nodes have been displayed once and the index
is cached this should be a non issue.

> 15983 3164,800455 12% 12853 BitBlt(TargetCanvas.Handle,
Left, Top,
> Width, Height, Canvas.Handle, Window.Left, 0, SRCCOPY);

Does VT draw to a memory bitmap then blast the whole window thing to
the screen? That is why my 166Mhz is so slow it does not have a video
card with all the latest accelerator features. BitBlt are rather slow
on it. Why did you not ScrollWindow and only paint what was
uncovered?

Jim


re: New VET Demo

From: "Jim Kueneman" [jimdk@m...]
Date: Thu Apr 12, 2001 1:30 pm
Subject: Re: New VET Demo

--- In [VirtualTreeview@y...], Mike Lischke [public@l...] wrote:
>
> I rather think this is because the double click will be interpreted
as the
> desire to expand a node which is not a folder. This non-folder is
then bound
> to an IShellFolder which fails with the given error message. I could
be
> wrong however....

Nope, correct and fixed. On line 318 of VirtualExplorerTree.pas change

if ValidateNamespace(Node, NS) then
NS.EnumerateFolder(foFolders in FFileObjects, foNonFolders .....

To:

if ValidateNamespace(Node, NS) and NS.Folder then
NS.EnumerateFolder(foFolders in FFileObjects, foNonFolders .....

The new version of VT should be ok to compile VET.

Jim


Advise on an Image thread for VET

From: "Jim Kueneman" [jimdk@m...]
Date: Thu Apr 12, 2001 1:51 pm
Subject: Advise on an Image thread for VET

Since I see by the profiler that getting the image is a biggest hit on
the first time scrolling I am thinking about the best way to get the
images is by using a separate thread. Does anyone have a suggestion
as the the best way to implemement this? Explorer does it and it
apprears to only retrieve the icons in the currenly displayed window
(maybe the next screen as well). It gets, and displays, them one at a
time as opposed to getting them all then displaying them.

The tricky part is the syncronization without block the execution of
the VET window and allowing the order the images are retrieved to be
easily changed as the window is scrolled (or maybe the list is
scrapped and a new one is created after each scroll?)

Any suggestions are welcomed.

Jim Kueneman

 | Replies | Author | Date
1175 | Re: Advise on an Image thread for VET | Mike Lischke | Thu 4/12/2001
1188 | Re: Advise on an Image thread for VET | [teusjdejong@p...] | Fri 4/13/2001
1190 | Re: Advise on an Image thread for VET | Jim Kueneman | Fri 4/13/2001
1192 | Re: Advise on an Image thread for VET | Jim Kueneman | Fri 4/13/2001
1199 | Re: Advise on an Image thread for VET | [teusjdejong@p...] | Fri 4/13/2001
1195 | Re: Advise on an Image thread for VET | Mike Lischke | Fri 4/13/2001
1196 | Re: Advise on an Image thread for VET | Jim Kueneman | Fri 4/13/2001
1197 | Re: Advise on an Image thread for VET | Mike Lischke | Fri 4/13/2001


re: Advise on an Image thread for VET

From: Mike Lischke [public@l...]
Date: Thu Apr 12, 2001 3:09 pm
Subject: RE: [VirtualTreeview] Advise on an Image thread for VET

Hi Jim,

> Since I see by the profiler that getting the image is a biggest hit on
> the first time scrolling I am thinking about the best way to get the
> images is by using a separate thread. Does anyone have a suggestion
> as the the best way to implemement this?

Just today I opened an older project (Database Image Browser) to check if it
still works with all the changes in VT and found it does. I had to change
only 4 events (two non existing anymore and the others with change parameter
list). This application is an interface for a database which contains a
hierarchical structure of images. The actual files are stored on a big RAID.

One of the tasks of this application is to retrieve image dimensions and
other properties from the images (which can change, so I cannot store them
in the database). Since this is all going via a network I have used a thread
to get that information (looks funny when the nodes are filled while
scrolling around).

What I did was to create this thread:

TPropertyThread = class(TThread)
private
FTree: TBaseVirtualTree;
FNodeList: TThreadList;
protected
procedure Execute; override;
public
constructor Create(CreateSuspended: Boolean; Tree: TBaseVirtualTree);
destructor Destroy; override;
end;

//----------------- TPropertyThread
----------------------------------------------------------------------------
--------

constructor TPropertyThread.Create(CreateSuspended: Boolean; Tree:
TBaseVirtualTree);

begin
inherited Create(CreateSuspended);

FTree := Tree;
FNodeList := TThreadList.Create;
end;

//--------------------------------------------------------------------------
--------------------------------------------

destructor TPropertyThread.Destroy;

begin
FNodeList.Free;
inherited;
end;

//--------------------------------------------------------------------------
--------------------------------------------

procedure TPropertyThread.Execute;

// does some background tasks, like validating image data

var
Node: PVirtualNode;
Data: PEntryData;
LastCount: Integer;

begin
while not Terminated do
begin
Sleep(500);
LastCount := -99;
repeat
// get the next waiting node
with FNodeList.LockList do
begin
if LastCount = -99 then
LastCount := Count;
if Count > 0 then
begin
Node := Items[0];
Delete(0);
end
else
Node := nil;
FNodeList.UnlockList;
end;

if Assigned(Node) then
try
Data := FTree.GetNodeData(Node);
Data.ImageData := ImageInterface.GetImageData(Data.ID,
[vidFileProperties, vidImageProperties]);
FTree.InvalidateNode(Node);
except // no exceptions within the thread please, stop loop instead
LastCount := 1;
end;
Dec(LastCount);
until (Node = nil) or (LastCount <= 0) or Terminated;
end;
end;

And every time a node is initialized (for instance because it is scrolled
into view) I add it to the thread's local list:

procedure TMainForm.NeedValidation(Node: PVirtualNode);

// Adds the given node to our property thread.

begin
FPropertyThread.FNodeList.Add(Node);
end;

This looks terribly simple and it is indeed, but extremely effective. The
only thing you have to adjust in this code is th GetImageData call in the
thread to retrieve the image index from the name space class.

Ciao, Mike


re: Re: New VET Demo

From: Mike Lischke [public@l...]
Date: Thu Apr 12, 2001 3:39 pm
Subject: RE: [VirtualTreeview] Re: New VET Demo

> Does VT draw to a memory bitmap then blast the whole window thing to
> the screen? That is why my 166Mhz is so slow it does not
> have a video card with all the latest accelerator features. BitBlt are
> rather slow on it. Why did you not ScrollWindow and only paint what was
> uncovered?

The version 1.31 (and before) used a large single bitmap that way, but I
found it too resource hungry. Now I have small stripe which is as large as
the update region but as high as a single node (height is adjusted during
paint). But I found another draw back which I only detected because of the
profiling. It is that NodeBitmap (the background bitmap) is set to pf32Bit
in PaintTree. This is a relict from my tests with blending. The entire
assignment should be removed so the bitmap remains pfDevice (which is then a
DDB and the speediest format to blit because no translation has to be done).
On my 350Mhz in the office I could "feel" that the tree became faster after
I removed that line.

Ciao, Mike


New Bug

From: "Jim Kueneman" [jimdk@m...]
Date: Thu Apr 12, 2001 5:26 pm
Subject: New Bug

Help! I just installed the latest VT and now when I call
LoadFromFile(FileName) it no longer works! It does not matter if it is
a file that I saved with the last version or created with the new. It
seems to load the data from the stream with no errors but the nodes
are not displayed.

Jim Kueneman

 | Replies | Author | Date
1179 | Re: New Bug | Mike Lischke | Thu 4/12/2001


re: DoShortenString

From: "Mike Lischke" [public@l...]
Date: Thu Apr 12, 2001 6:29 pm
Subject: RE: [VirtualTreeview] DoShortenString

Vadim,

> Please, do not use "dynamic" on methods that called very often. Dynamic
> calls are too slow :(

You are right, I mixed something there. I thought it was so that dynamic is the
faster method if you
don't override very often. This was wrong. The help clearly states:

Virtual versus dynamic

Virtual and dynamic methods are semantically equivalent. They differ only in
the implementation of
method-call dispatching at runtime. Virtual methods optimize for speed, while
dynamic methods
optimize for code size.
In general, virtual methods are the most efficient way to implement polymorphic
behavior. Dynamic
methods are useful when a base class declares many overridable methods which
are inherited by many
descendant classes in an application, but only occasionally overridden.

--- end quote

Hence I'll change all dynamic method to virtual.

Ciao, Mike


re: New Bug

From: "Mike Lischke" [public@l...]
Date: Thu Apr 12, 2001 6:40 pm
Subject: RE: [VirtualTreeview] New Bug

> Help! I just installed the latest VT and now when I call
> LoadFromFile(FileName) it no longer works! It does not matter if it is
> a file that I saved with the last version or created with the new. It
> seems to load the data from the stream with no errors but the nodes
> are not displayed.

No errors? Well then it seems the vsVisible flag is not set. This should happen
automatically during
load but who knows. Check if there are nodes in the tree and what states they
have. Send me the file
if you can't find what's wrong.

Ciao, Mike


No redraw

From: [teusjdejong@p...]
Date: Thu Apr 12, 2001 7:05 pm
Subject: No redraw

Mike,

Before installing the last update, all worked fine, But after
installing this update, items in filelists are only drawn the first
time. If I change directory, or refresh the current content, nothing
is drawn. I searched VirtualTrees, but until now I can't find any
clue on what's going on.

After getting my data, the tree is initialized as follows:

procedure TCustomFileViewer.Init;
begin
if Rootnodecount>0 then Clear;
if not (csdesigning in componentstate) and (tsUpdating in
TreeStates) then EndUpdate;
RootNodeCount:=FFileList.Items.Count;
if not (csdesigning in Componentstate) then begin
ValidateNode(nil, true);
end;

The first time, after running through this routine, DOinitNode,
DogetImageindex, DogetText, etc. are called. But the second time,
this routine is passed, only DoInitnode is called for all Nodes,
DoGetImageIndex, Dogettext, etc. are not called. Again, until now I
can't find what's going wrong. Often, but not always, I get an error
in DeleteChildren, where Dec(FVisiblecount) has an out of range value
(ridiculously high).

Any idea? Looks a bit like the Jim mentioned after loading the tree.

Teus de Jong.

 | Replies | Author | Date
1181 | Re: No redraw | Werner Lehmann | Thu 4/12/2001
1182 | Re: No redraw | Jim Kueneman | Thu 4/12/2001
1183 | Re: No redraw | [teusjdejong@p...] | Thu 4/12/2001


re: No redraw

From: Werner Lehmann [wl@b...]
Date: Thu Apr 12, 2001 7:43 pm
Subject: Re: [VirtualTreeview] No redraw

[teusjdejong@p...] wrote:
>
> Any idea? Looks a bit like the Jim mentioned after loading the tree.

This is the same problem that I described and fixed in

[VirtualTreeview] New bug introduced in latest version

Regards,
Werner

 | Replies | Author | Date
1182 | Re: No redraw | Jim Kueneman | Thu 4/12/2001
1183 | Re: No redraw | [teusjdejong@p...] | Thu 4/12/2001


re: No redraw

From: "Jim Kueneman" [jimdk@m...]
Date: Thu Apr 12, 2001 7:56 pm
Subject: Re: No redraw

--- In [VirtualTreeview@y...], Werner Lehmann [wl@b...] wrote:
> [teusjdejong@p...] wrote:
> >
> > Any idea? Looks a bit like the Jim mentioned after loading the
tree.
>
> This is the same problem that I described and fixed in
>
> [VirtualTreeview] New bug introduced in latest version

Yes it is and it fixed my stream loading problems. Thanks Werner.

Jim Kueneman


re: No redraw

From: [teusjdejong@p...]
Date: Thu Apr 12, 2001 9:19 pm
Subject: Re: No redraw

Werner,

> This is the same problem that I described and fixed in
>
> [VirtualTreeview] New bug introduced in latest version

Sorry, I overlooked your message. It is indeed the same problem and
your suggested solution works for me. Thanks a lot.

Teus de Jong.


re: Re: Missing dcu

From: "Malcolm Smith" [mjfreelancing@o...]
Date: Thu Apr 12, 2001 9:52 pm
Subject: RE: [VirtualTreeview] Re: Missing dcu

Thanks for the info.

Mal

MJ Freelancing
http://www.mjfreelancing.com
ABN: 30 671 763 146

CORintel
ABN: 30 336 110 329

-----Original Message-----
From: Roland [mailto:[Beduerftig@S...]]
Sent: Thursday, 12 April 2001 18:44
To: [VirtualTreeview@yahoogroups.com
Subject: [VirtualTreeview] Re: Missing dcu

--- In [VirtualTreeview@y...], Ondrej Kelle <O.Kelle@d...] wrote:
> > I am building VirtualTreeView for C++Builder but it complains
> > about not being able to find ColnEdit.dcu
>
> Add dsnide50.dcp to the requires clause of your designtime package.
> HTH,
> TOndrej

I use also BCB5 and this problem happens by using the
VirtualTreesReg.pas, I modify the unit as following:

unit VirtualTreesReg;

interface

uses
Windows, Classes,
DsgnIntf,
{$ifndef BCB}
ColnEdit,
{$endif}
VirtualTrees;

{$ifndef BCB}
type
TVirtualTreeEditor = class (TDefaultEditor)
public
procedure Edit; override;
end;
{$endif}

procedure Register;

//----------------------------------------------

implementation

uses
Dialogs;

type
TVirtualTreeCast = class(TBaseVirtualTree);

//----------------------------------------------

{$ifndef BCB}
procedure TVirtualTreeEditor.Edit;
begin
ShowCollectionEditor(Designer, Component, TVirtualTreeCast
(Component).Header.Columns, 'Columns');
end;
{$endif}

//----------------------------------------------

procedure Register;

begin
RegisterComponents('Win32', [TVirtualStringTree, TVirtualDrawTree]);
{$ifndef BCB}
RegisterComponentEditor(TVirtualStringTree, TVirtualTreeEditor);
RegisterComponentEditor(TVirtualDrawTree, TVirtualTreeEditor);
{$endif}
end;

//----------------------------------------------

end.

With this {$ifdef BCB} the unit works under Delphi5 and BCB5, I can
edit the columns at designtime with the normal editors buildin BCB.

Roland

To unsubscribe from this group, send an email to:
VirtualTreeview-unsubscribe@egroups.com

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/


re: Re: Missing dcu

From: "Malcolm Smith" [mjfreelancing@o...]
Date: Thu Apr 12, 2001 9:55 pm
Subject: RE: [VirtualTreeview] Re: Missing dcu

Mike,

So can you provide the .dcu file as part of the BCB installations.

Mal

MJ Freelancing
http://www.mjfreelancing.com
ABN: 30 671 763 146

CORintel
ABN: 30 336 110 329

-----Original Message-----
From: Mike Lischke [mailto:[public@l...]]
Sent: Thursday, 12 April 2001 20:39
To: 'VirtualTreeview@yahoogroups.com'
Subject: RE: [VirtualTreeview] Re: Missing dcu

Roland,

> I use also BCB5 and this problem happens by using the
> VirtualTreesReg.pas, I modify the unit as following:

Yes, but this modification will disable the ability to double click the tree
to open the collection editor. This is the only reason why there is a
separate registration file at all.

Ciao, Mike

To unsubscribe from this group, send an email to:
VirtualTreeview-unsubscribe@egroups.com

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/

 | Replies | Author | Date
1194 | Re: Missing dcu | Mike Lischke | Fri 4/13/2001
1203 | Re: Missing dcu | Malcolm Smith | Fri 4/13/2001
1205 | Re: Missing dcu | Mike Lischke | Sat 4/14/2001
1207 | Re: Missing dcu | Malcolm Smith | Sat 4/14/2001
1208 | Re: Missing dcu | Alexander Egorushkin | Sat 4/14/2001
1209 | Re: Missing dcu | Mike Lischke | Sat 4/14/2001
1212 | Re: Missing dcu | Alexander Egorushkin | Sat 4/14/2001
1226 | Re: Missing dcu | Alexander Egorushkin | Sun 4/15/2001
1227 | Re: Missing dcu | Mike Lischke | Mon 4/16/2001


re: DoShortenString

From: "Vadim Sedulin" [wsntrl@o...]
Date: Fri Apr 13, 2001 12:56 am
Subject: Re: [VirtualTreeview] DoShortenString

Hello Mike!

> You are right, I mixed something there. I thought it was so that dynamic
is the faster method if you
> don't override very often. This was wrong. The help clearly states:

I understood that when I browsed system.pas
(_CallDynaClass/_CallDynaInst/GetDynaMethod)

--- cut ---

> Hence I'll change all dynamic method to virtual.

Great! Thank you!

Bye.

Vadim Sedulin
E-Mail: [wsntrl@o...]


re: Preparation for official release

From: "Jonx" [knipjo@h...]
Date: Fri Apr 13, 2001 10:00 am
Subject: Re: Preparation for official release

> John (Knipper):
> Are there any news about the FAQs?
You mean NEW news ;)
I think that I may have a working version early next week (really ;)
I need to get ride of my girlfriend and I need the latest version of
your help file. The first containt of the FAQ will be what you have
in your help file. After that, someone... probably I ;) will have to
go trough all the messages here and stuff up the FAQ with all the
knowledge we have here...

> to be fixed and which I forgot so far?
Maybe it's ie6, but your web site has problems with ie6 beta...
When I click on a navigation link I don't get frames like I used to
get.
So maybe you removed it, but I can no longer browse to the
virtualtree page.

> Are there more offers for demo applications to be included?
I can come up with a demo that shows how to save/load the tree nodes
from a file. Not using a record, but a TPersistent. Anyone interessed
in that ?

> What about the VT gallery?
Sorry did you gave out the link ?

> More screen shots from anybody?
Yep, my unfinished tool to handle a bookmark:
http://www.happytocode.com/delphi/projects/current/vbook/history/Www8.
1.JPG
http://www.happytocode.com/delphi/projects/current/vbook/history/Www8.
JPG

I stopped working on it because D&D support was not working that good
(1.3)
I have to update it one again and start the dev again so I can at
last sort out the 400 links I have in my ie bookmark. Especially
since ie6b is taking ages to load the bookmark...

 | Replies | Author | Date
1193 | Re: Preparation for official release | Mike Lischke | Fri 4/13/2001


re: Advise on an Image thread for VET

From: [teusjdejong@p...]
Date: Fri Apr 13, 2001 10:32 am
Subject: Re: Advise on an Image thread for VET

Jim,

--- In [VirtualTreeview@y...], "Jim Kueneman" [jimdk@m...] wrote:
> Since I see by the profiler that getting the image is a biggest hit
on
> the first time scrolling I am thinking about the best way to get
the
> images is by using a separate thread. Does anyone have a
suggestion
> as the the best way to implemement this

This is the way I do it. The situation is different, but maybe you
can use some of it.

TIconThread=class(TTHread)
private
Viewer: TFileViewer;
FStop: Boolean;
aDir: string;
protected
procedure Execute; override;
public
constructor Create(V: TFileViewer; s: string);
end;

constructor TIconThread.Create(V: TFileviewer; s: string);
begin
Viewer:=V;
aDir:=AppendSlash(s);
FStop:=false;
FreeOnTerminate:=true;
inherited Create(false);
end;

procedure TIconThread.Execute;
var
P: PVirtualNode;
Data: PAFileData;
sfi: TSHFileinfo;
begin
try
P:=Viewer.GetFirst;
while assigned(P) and (not FStop) do begin
Data:=PAFileData(Viewer.GetNodeData(P)^);
if assigned(Data) and (Data.ViewNode=P) then begin
// for some reason I don't get the right icons
// for fonts outside the main thread;
//do those in DoGetImageIndex
if (lowercase(extractFileExt(Data.Name))<>'.ttf')
and (lowercase(extractFileext(Data.name))<>'.otf')
then begin
//default values in case shgetfileinfo fails
if Pos('d', Data.attr)>0 then sfi.iIcon:=DefaultDirIcon
else sfi.iIcon:=DefaultFileIcon;
Data.Overlay:=-1;
shgetfileinfo(PChar(aDir+Data.name),
SFGAO_SHARE or SFGAO_LINK, sfi, SizeOf(TSHFileInfo),
shgfi_sysiconindex or shgfi_smallicon
or shgfi_Attributes);
Data.Icon:=sfi.iIcon;
if sfi.dwAttributes and SFGAO_SHARE=SFGAO_SHARE then
Data.Overlay:=0
else
if sfi.dwAttributes and SFGAO_LINK=SFGAO_LINK then
Data.Overlay:=1;
Viewer.InvalidateNode(P);
end;
end else exit;
P:=P.NextSibling;
end;
except
exit;
end;
end;

procedure TFileList.IconThreadDone;
begin
FInIconThread:=false;
FIconThread:=nil;
end;

procedure TFileList.GetWinIcons;
begin
//don't start when there's no stable handle
if csloading in componentstate then exit;
FIconThread:=TIconThread.Create(TFileviewer(Self.Fileviewer),
Fdirectory);
FInIconThread:=true;
FIconThread.OnTerminate:=IconThreadDone;
FIconThread.Resume;
end;

Teus de Jong.

 | Replies | Author | Date
1190 | Re: Advise on an Image thread for VET | Jim Kueneman | Fri 4/13/2001
1192 | Re: Advise on an Image thread for VET | Jim Kueneman | Fri 4/13/2001
1199 | Re: Advise on an Image thread for VET | [teusjdejong@p...] | Fri 4/13/2001
1195 | Re: Advise on an Image thread for VET | Mike Lischke | Fri 4/13/2001
1196 | Re: Advise on an Image thread for VET | Jim Kueneman | Fri 4/13/2001
1197 | Re: Advise on an Image thread for VET | Mike Lischke | Fri 4/13/2001


re: Re: New VET Demo

From: "Mike Lischke" [public@l...]
Date: Fri Apr 13, 2001 12:56 pm
Subject: RE: [VirtualTreeview] Re: New VET Demo

Hi Cyril,

thanks a lot for timing the paint method.

> Line Time (mS) % hits Source
> 15848 6917,977344 27% 114906 ImageInfo[iiNormal].Index :=
> DoGetImageIndex(Node, ImageKind[vsSelected in Node.States], Column,

Ok, this has Jim already mentioned. It has to do with retrieving the image.

> 15983 3164,800455 12% 12853 BitBlt(TargetCanvas.Handle, Left, Top,
> Width, Height, Canvas.Handle, Window.Left, 0, SRCCOPY);

This one is unavoidable unless I give up the double buffer approach. But this
would lead to heavy flicker.

> 15765 3161,837088 12% 12853 ClearNodeBackground(PaintInfo.Canvas,
> PaintInfo.Node, UseBackground, True,

Basically a simple FillRect (plus event). I don't know how to speed this up.

> 15861 2480,744571 9,74% 114906 LimitPaintingToArea(Canvas, CellRect);

This one could be avoided for the price that some things aren't clipped
internally (e.g. tree lines, images) if a column is too small to fit them and
in the events the application has also to take care where to draw. If there
would only be a faster way to set a clipregion.

> in DoPaintNode
> 21210 2018,171652 7,9% 114906 DoGetText(PaintInfo.Node,
> PaintInfo.Column, ttNormal, Text);

Well, similar to the image retrieval. Text seems to be more easy accessible
than icons however...

> in PaintTree :
> 15936 1236,452227 4,9% 114906 SelectClipRgn(PaintInfo.Canvas.Handle,
> 0);

Necessary to allow to erase the background bitmap again after a node has been
drawn. No idea how to avoid that.

The other entries are simply necessary and seem to be negligible compared with
the top time consumers. Still, I don't know how to save time while painting. As
far as I see there is no waste of time.

Ciao, Mike


re: Advise on an Image thread for VET

From: "Jim Kueneman" [jimdk@m...]
Date: Fri Apr 13, 2001 1:33 pm
Subject: Re: Advise on an Image thread for VET

--- In [VirtualTreeview@y...], [teusjdejong@p...] wrote:
>
> TIconThread=class(TTHread)
> private

Thanks for the thread. What is interesting is that you also have
problems getting the right icon outside the main thread. Using Mike's
thread idea I get the wrong / no icon for some of the special folders
in the Win98 Windows folder? It has been driving me crazy stepping
through the code trying to see why SHGetFileInfo is failing to
retrieve the icon index. The PIDL is right since is it retrieves
other information correctly from the main thread. Any ideas?

Jim Kueneman

 | Replies | Author | Date
1192 | Re: Advise on an Image thread for VET | Jim Kueneman | Fri 4/13/2001
1199 | Re: Advise on an Image thread for VET | [teusjdejong@p...] | Fri 4/13/2001
1195 | Re: Advise on an Image thread for VET | Mike Lischke | Fri 4/13/2001
1196 | Re: Advise on an Image thread for VET | Jim Kueneman | Fri 4/13/2001
1197 | Re: Advise on an Image thread for VET | Mike Lischke | Fri 4/13/2001


re: Editor resizing

From: "Mike Lischke" [public@l...]
Date: Fri Apr 13, 2001 1:40 pm
Subject: RE: [VirtualTreeview] Editor resizing

Hi Cyril,

> Adding the following in TBaseVirtualTree.WMSizewill solve the problem :
>
> // If the tree is currently in edit state then notify edit link.
> if tsEditing in FStates then
> FEditLink.SetBounds(GetDisplayRect(FFocusedNode, FEditColumn, False));

Ok, thank you. I will include that code.

Ciao, Mike


re: Advise on an Image thread for VET

From: "Jim Kueneman" [jimdk@m...]
Date: Fri Apr 13, 2001 2:25 pm
Subject: Re: Advise on an Image thread for VET

--- In [VirtualTreeview@y...], "Jim Kueneman" [jimdk@m...] wrote:
> --- In [VirtualTreeview@y...], [teusjdejong@p...] wrote:

> retrieve the icon index. The PIDL is right since is it retrieves
> other information correctly from the main thread. Any ideas?

Figured it out. Simple really :^) (The MSDN help on shell stuff is
getting MUCH better). Since SHGetFileInfo deals with COM you must
CoInitialize and CoUninitialize on a per thread basis. Put these in
your Execute method and SHGetFileInfo will work correctly when calling
it in the context thread. I fould it was actually corrupting the the
internals of SHGetFileInfo in the main thread as well. The FileType
info would return null if I tried to get the icons from the thread.

Jim Kueneman

 | Replies | Author | Date
1199 | Re: Advise on an Image thread for VET | [teusjdejong@p...] | Fri 4/13/2001


re: Re: Preparation for official release

From: "Mike Lischke" [public@l...]
Date: Fri Apr 13, 2001 3:57 pm
Subject: RE: [VirtualTreeview] Re: Preparation for official release

Hi John,

> I think that I may have a working version early next week (really ;)
> The first containt of the FAQ will be what you have
> in your help file.

Well, there is currently no newer help file than that what is in the official
distribution. I think
the help file will be last part I do when everything else is ready.

> Maybe it's ie6, but your web site has problems with ie6 beta...
> When I click on a navigation link I don't get frames like I used to
> get. So maybe you removed it, but I can no longer browse to the
> virtualtree page.

IE6 is said to be the most compliant implementation of a browser from
Microsoft. So likely my
limited knowledge about HTML is the reason for this behaviour. Going to install
Dreamweaver
finally...

> I can come up with a demo that shows how to save/load the tree nodes
> from a file. Not using a record, but a TPersistent. Anyone interessed
> in that ?

Yes, sure. Send it to me (or upload to YG). There is no sample yet for
streaming a tree.

> Sorry did you gave out the link ?

No link yet. I'm still in the process to find a cool new layout for my
homepage. I was thinking
about a Mac aqua UI lookalike clone, but Photoshop does not produce well
looking glass bodies (or I
am too thumb to find the right knob).

> http://www.happytocode.com/delphi/projects/current/vbook/history/Www8.1.JPG

Looks good so far. Can I have a couple of sentences which describe what is on
the screen shots?

> I have to update it one again and start the dev again so I can at
> last sort out the 400 links I have in my ie bookmark. Especially
> since ie6b is taking ages to load the bookmark...

Just a hint, my older control TreeNT has been used in a similar tool from
Outertech called LinkMan.
Perhaps this is somehow interesting for you (I have no link handy, but a simple
search should yield
one)?

Ciao, Mike


re: Re: Missing dcu

From: "Mike Lischke" [public@l...]
Date: Fri Apr 13, 2001 3:57 pm
Subject: RE: [VirtualTreeview] Re: Missing dcu

Hi Malcolm,

> So can you provide the .dcu file as part of the BCB installations.

Not sure if I should. Can BCB 4 also work with D5 dcus? D4 cannot use them, but
perhaps an obj file
would fit better. I'm open to your suggestions. Roland, can you shed a light on
this as well?

Ciao, Mike

 | Replies | Author | Date
1203 | Re: Missing dcu | Malcolm Smith | Fri 4/13/2001
1205 | Re: Missing dcu | Mike Lischke | Sat 4/14/2001
1207 | Re: Missing dcu | Malcolm Smith | Sat 4/14/2001
1208 | Re: Missing dcu | Alexander Egorushkin | Sat 4/14/2001
1209 | Re: Missing dcu | Mike Lischke | Sat 4/14/2001
1212 | Re: Missing dcu | Alexander Egorushkin | Sat 4/14/2001
1226 | Re: Missing dcu | Alexander Egorushkin | Sun 4/15/2001
1227 | Re: Missing dcu | Mike Lischke | Mon 4/16/2001
1231 | Re: Missing dcu | Alexander Egorushkin | Mon 4/16/2001


re: Re: Advise on an Image thread for VET

From: "Mike Lischke" [public@l...]
Date: Fri Apr 13, 2001 3:57 pm
Subject: RE: [VirtualTreeview] Re: Advise on an Image thread for VET

Jim,

> Thanks for the thread. What is interesting is that you also have
> problems getting the right icon outside the main thread. Using Mike's
> thread idea I get the wrong / no icon for some of the special folders
> in the Win98 Windows folder? It has been driving me crazy stepping
> through the code trying to see why SHGetFileInfo is failing to
> retrieve the icon index. The PIDL is right since is it retrieves
> other information correctly from the main thread. Any ideas?

Here is what I found on my MSDN DVD. It is not much but it mentions at least
retrieving an icon in a
background thread:

IExtractIcon
This interface allows a client to retrieve the icon that is associated with one
of the objects in a
folder.

There are two ways to get an object's icon. The simplest way is to call
SHGetFileInfo. However, this
approach is inflexible and may be rather slow. A more flexible and efficient
way to get an item's
icon is to use IExtractIcon. The shell uses IExtractIcon to retrieve icons when
it displays the
contents of a folder. To use IExtractIcon to get an object's icon:

Get a pointer to the IShellFolder interface of the folder that contains the
object.
Call IShellFolder::GetUIObjectOf with the PIDL of the object and the interface
ID of IExtractIcon
(IID_IExtractIcon). The folder creates an object to handle the icon extraction,
and returns the
object's IExtractIcon interface pointer.
Call IExtractIcon::GetIconLocation to get the icon's location.
Call IExtractIcon::Extract to get the icon's handle.

It may also be possible to extract icons asynchronously on a background thread.
This approach is
useful when extraction is time-consuming operation. See
IExtractIcon::GetIconLocation for details.

When to Implement
Namespace extensions implement IExtractIcon to provide icons for their objects.
A client obtains an
IExtractIcon interface pointer for an object in a folder by calling the folder's
IShellFolder::GetUIObjectOf method. The GetUIObjectOf implementation must
create an object to handle
the icon extraction, and return a pointer to the object's IExtractIcon
interface.

Icon handlers also implement IExtractIcon. An icon handler is a type of shell
extension handler that
allows you to dynamically assign icons to the members of a file class.

When to Use
Call this interface if your application needs a more flexible way to retrieve
an object's icon than
SHGetFileInfo.

Methods

Extract Extracts an icon from the specified location.
GetIconLocation Retrieves the icon location for an object.

Requirements
Version 4.00 and later of Shell32.dll

Windows NT/2000: Requires Windows NT 4.0 or later.
Windows 95/98: Requires Windows 95 or later.
Header: Declared in shlobj.h.

Ciao, Mike

 | Replies | Author | Date
1196 | Re: Advise on an Image thread for VET | Jim Kueneman | Fri 4/13/2001
1197 | Re: Advise on an Image thread for VET | Mike Lischke | Fri 4/13/2001


re: Advise on an Image thread for VET

From: "Jim Kueneman" [jimdk@m...]
Date: Fri Apr 13, 2001 4:04 pm
Subject: Re: Advise on an Image thread for VET

--- In [VirtualTreeview@y...], "Mike Lischke" [public@l...] wrote:

> Here is what I found on my MSDN DVD. It is not much but it mentions
at least retrieving an icon in a
> background thread:

Mike,

Thanks but I figured it out, the thread needs to call CoInitialize.
Also the latest version uses several better and faster methods to try
to get the icon before resorting to SHGetfileInfo, including
IExtractIcon.

Jim


re: Re: Advise on an Image thread for VET

From: "Mike Lischke" [public@l...]
Date: Fri Apr 13, 2001 4:03 pm
Subject: RE: [VirtualTreeview] Re: Advise on an Image thread for VET

> Here is what I found on my MSDN DVD. It is not much but it mentions at least
retrieving
> an icon in a
> background thread:

Sent too late, just ignore it :o]

Ciao, Mike


Hello

From: [luis@b...]
Date: Fri Apr 13, 2001 6:21 pm
Subject: Hello

Hi, I'm new to virtualTree and I was wondering:
Is it possoble to do a king of family tree dispay with the items?

Like this

|-4
|
|-2|
| | |-6
| |-5|
| | |-7
|
|
|
1|
|
|
|-3

Thank you

Luis Filipe

 | Replies | Author | Date
1201 | Re: Hello | Mike Lischke | Fri 4/13/2001


re: Advise on an Image thread for VET

From: [teusjdejong@p...]
Date: Fri Apr 13, 2001 6:35 pm
Subject: Re: Advise on an Image thread for VET

Jim,

> Figured it out. Simple really :^)

Yes, simple, if you come up with the idea. But it works great. Thanks.

Teus de Jong.


Demo project

From: [teusjdejong@p...]
Date: Fri Apr 13, 2001 6:37 pm
Subject: Demo project

Mike,

I nearly finished the demo. Should I send it to you first?

Teus de Jong

 | Replies | Author | Date
1202 | Re: Demo project | Mike Lischke | Fri 4/13/2001


re: Hello

From: "Mike Lischke" [public@l...]
Date: Fri Apr 13, 2001 7:34 pm
Subject: RE: [VirtualTreeview] Hello

Hi Luis,

> Hi, I'm new to virtualTree and I was wondering:
> Is it possoble to do a king of family tree dispay with the items?

No, this is not possible with VT. This is a speciality of chart controls like
TeeChart (or was it
TeeTree?) from Teemach.

Ciao, Mike


re: Demo project

From: "Mike Lischke" [public@l...]
Date: Fri Apr 13, 2001 7:35 pm
Subject: RE: [VirtualTreeview] Demo project

> I nearly finished the demo. Should I send it to you first?

Yep, do this ([public@l...])

Ciao, Mike


re: Re: Missing dcu

From: "Malcolm Smith" [mjfreelancing@o...]
Date: Fri Apr 13, 2001 10:47 pm
Subject: RE: [VirtualTreeview] Re: Missing dcu

Hmmm, I think the only real way to handle this is supply the .pas file but I
doubt that is allowed.

Mal

MJ Freelancing
http://www.mjfreelancing.com
ABN: 30 671 763 146

CORintel
ABN: 30 336 110 329

-----Original Message-----
From: Mike Lischke [mailto:[public@l...]]
Sent: Saturday, 14 April 2001 01:57
To: VirtualTreeview@yahoogroups.com
Subject: RE: [VirtualTreeview] Re: Missing dcu

Hi Malcolm,

> So can you provide the .dcu file as part of the BCB installations.

Not sure if I should. Can BCB 4 also work with D5 dcus? D4 cannot use them,
but perhaps an obj file
would fit better. I'm open to your suggestions. Roland, can you shed a light
on this as well?

Ciao, Mike

To unsubscribe from this group, send an email to:
VirtualTreeview-unsubscribe@egroups.com

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/

 | Replies | Author | Date
1205 | Re: Missing dcu | Mike Lischke | Sat 4/14/2001
1207 | Re: Missing dcu | Malcolm Smith | Sat 4/14/2001
1208 | Re: Missing dcu | Alexander Egorushkin | Sat 4/14/2001
1209 | Re: Missing dcu | Mike Lischke | Sat 4/14/2001
1212 | Re: Missing dcu | Alexander Egorushkin | Sat 4/14/2001
1226 | Re: Missing dcu | Alexander Egorushkin | Sun 4/15/2001
1227 | Re: Missing dcu | Mike Lischke | Mon 4/16/2001
1231 | Re: Missing dcu | Alexander Egorushkin | Mon 4/16/2001


VET Demo Updated

From: "Jim Kueneman" [jimdk@m...]
Date: Sat Apr 14, 2001 7:13 am
Subject: VET Demo Updated

Mike,

I uploaded what I want to call the release version for VT. It lacks
a few things that I am not going to get to this time around such as
being aware that a change has occurred in the file system to update
itself and being able to edit the namespace name (easy to implement).
Tell me what you think.

A couple things.

1) Update the *.dcr file to TVIRTUALEXPLORERTREE, the demo has this
change made so you could just use it.

2) It is necessary to implement Werner's last fix in the
DeleteChildren method of VT to exclude the Root node from the expanded
flag.

Jim Kueneman

 | Replies | Author | Date
1206 | Re: VET Demo Updated | Mike Lischke | Sat 4/14/2001


re: Re: Missing dcu

From: "Mike Lischke" [public@l...]
Date: Sat Apr 14, 2001 8:14 am
Subject: RE: [VirtualTreeview] Re: Missing dcu

> Hmmm, I think the only real way to handle this is supply the .pas file but I
> doubt that is allowed.

I was under the impression he talked about VirtualTrees.pas. Do you think he
meant the ColEdit file?

Ciao, Mike

 | Replies | Author | Date
1207 | Re: Missing dcu | Malcolm Smith | Sat 4/14/2001
1208 | Re: Missing dcu | Alexander Egorushkin | Sat 4/14/2001
1209 | Re: Missing dcu | Mike Lischke | Sat 4/14/2001
1212 | Re: Missing dcu | Alexander Egorushkin | Sat 4/14/2001
1226 | Re: Missing dcu | Alexander Egorushkin | Sun 4/15/2001
1227 | Re: Missing dcu | Mike Lischke | Mon 4/16/2001
1231 | Re: Missing dcu | Alexander Egorushkin | Mon 4/16/2001


re: VET Demo Updated

From: "Mike Lischke" [public@l...]
Date: Sat Apr 14, 2001 8:37 am
Subject: RE: [VirtualTreeview] VET Demo Updated

Jim,

> I uploaded what I want to call the release version for VT. It lacks
> a few things that I am not going to get to this time around such as
> being aware that a change has occurred in the file system to update
> itself and being able to edit the namespace name (easy to implement).
> Tell me what you think.

The result is nearly a full explorer replacement with context menu and all
that stuff. Well done
Jim. The only issue I found so far is that I cannot focus the tree again after
I have clicked one of
the check boxes in the demo. The icon update is a neat effect and works great.
The default image
however is the share hand on my W2K box. Is it possible to change this to the
default document icon?

Ciao, Mike


re: Re: Missing dcu

From: "Malcolm Smith" [mjfreelancing@o...]
Date: Sat Apr 14, 2001 12:04 pm
Subject: RE: [VirtualTreeview] Re: Missing dcu

It's the missing ColEdit.pas file that is the problem (as far as I can work
out).

Mal

MJ Freelancing
http://www.mjfreelancing.com
ABN: 30 671 763 146

CORintel
ABN: 30 336 110 329

-----Original Message-----
From: Mike Lischke [mailto:[public@l...]]
Sent: Saturday, 14 April 2001 18:15
To: VirtualTreeview@yahoogroups.com
Subject: RE: [VirtualTreeview] Re: Missing dcu

> Hmmm, I think the only real way to handle this is supply the .pas file but
I
> doubt that is allowed.

I was under the impression he talked about VirtualTrees.pas. Do you think he
meant the ColEdit file?

Ciao, Mike

To unsubscribe from this group, send an email to:
VirtualTreeview-unsubscribe@egroups.com

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/


re: Re: Missing dcu

From: "Alexander Egorushkin" [egorushkin@m...]
Date: Sat Apr 14, 2001 12:21 pm
Subject: RE: [VirtualTreeview] Re: Missing dcu

Hello!
I could find the only way out: rewrite registration unit in C++. Here it is

VTReg.hpp
---------------
//--------------------------------------------------------------------------
-

#ifndef VTRegH
#define VTRegH
//--------------------------------------------------------------------------
-
// This unit is an addendum to VirtualTrees.pas and contains code to for
design time editors as well as
// for their and the tree's registration.
#include <Windows.hpp>
#include <Classes.hpp>
#include <DsgnIntf.hpp>
#include <ColnEdit.hpp>
#include "VirtualTrees.hpp"

class PACKAGE TVirtualTreeEditor : public TDefaultEditor
{
public:
virtual void __fastcall Edit();
};

//--------------------------------------------------------------------------
--------------------------------------------
#endif

VTReg.cpp
----------------
//--------------------------------------------------------------------------
-

#include <vcl.h>
#include <Windows.hpp>
#include <Classes.hpp>
#include <DsgnIntf.hpp>
#include <ColnEdit.hpp>
#include <Dialogs.hpp>
#include "VirtualTrees.hpp"

#pragma hdrstop

#include "VTReg.h"

//--------------------------------------------------------------------------
-

#pragma package(smart_init)

class TVirtualTreeCast : public TBaseVirtualTree
{
friend class TVirtualTreeEditor;
};

void __fastcall TVirtualTreeEditor::Edit()
{
ShowCollectionEditor(Designer, Component,
((TVirtualTreeCast* )Component)->Header->Columns, "Columns");
}

//--------------------------------------------------------------------------
--------------------------------------------

namespace Vtreg
{
void __fastcall PACKAGE Register()
{
TComponentClass classes[2] = {__classid(TVirtualStringTree),
__classid(TVirtualDrawTree)};
RegisterComponents("Virtual Controls", classes, 1);
RegisterComponentEditor(__classid(TVirtualStringTree),
__classid(TVirtualTreeEditor));
RegisterComponentEditor(__classid(TVirtualDrawTree),
__classid(TVirtualTreeEditor));
}
}

//end of file

To use this unit one must add to the package this file: "dsnide50.bpi".

Another one issue for C++ Builder users. I had to add to machine generated
header for "VirtualTrees.pas" this line:
#include <oleidl.h>
(where IDropTarget, IDropSource and other interfaces are defined).

Alex.

PS I use C++ Builder 5.0

> -----Original Message-----
> From: Mike Lischke [mailto:[public@l...]]
> Sent: Saturday, April 14, 2001 12:15 PM
> To: VirtualTreeview@yahoogroups.com
> Subject: RE: [VirtualTreeview] Re: Missing dcu
>
>
> > Hmmm, I think the only real way to handle this is supply the
> .pas file but I
> > doubt that is allowed.
>
> I was under the impression he talked about VirtualTrees.pas. Do
> you think he meant the ColEdit file?
>
> Ciao, Mike
>
>
>
> To unsubscribe from this group, send an email to:
> VirtualTreeview-unsubscribe@egroups.com
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>
>

 | Replies | Author | Date
1209 | Re: Missing dcu | Mike Lischke | Sat 4/14/2001
1212 | Re: Missing dcu | Alexander Egorushkin | Sat 4/14/2001
1226 | Re: Missing dcu | Alexander Egorushkin | Sun 4/15/2001
1227 | Re: Missing dcu | Mike Lischke | Mon 4/16/2001
1231 | Re: Missing dcu | Alexander Egorushkin | Mon 4/16/2001


re: Re: Missing dcu

From: "Mike Lischke" [public@l...]
Date: Sat Apr 14, 2001 1:14 pm
Subject: RE: [VirtualTreeview] Re: Missing dcu

Hi Alexander,

> I could find the only way out: rewrite registration unit in C++. Here it is

This looks very promising. Thank you for working out this stuff. Can you send
me the hpp file
([public@l...])? I'm not sure from the line breaks how all belongs
together :o].

>
> VTReg.hpp
> ---------------
> //--------------------------------------------------------------------------
> -
>
> Another one issue for C++ Builder users. I had to add to machine generated
> header for "VirtualTrees.pas" this line:
> #include <oleidl.h>
> (where IDropTarget, IDropSource and other interfaces are defined).

Also this was unknown to me. Roland have you seen that before? Could you please
include this into
the BCB help package? It seems this way it is not necessary to comment out the
3 lines containing
the declarations using IDropTarget etc. Perhaps we finally get also a nice
package for BCB users
together. Would be cool :o]

Ciao, Mike

 | Replies | Author | Date
1212 | Re: Missing dcu | Alexander Egorushkin | Sat 4/14/2001


VET improvements

From: "Mike Lischke" [public@l...]
Date: Sat Apr 14, 2001 1:45 pm
Subject: VET improvements

Jim,

here is what I had to change in VET:

- the index of the default document icon is 4, changed in
TNamespace.GetIconIndex
- double check if the icon thread is terminated, otherwise the IDE will crash
badly when closing the demo and the thread is still active

if not Terminated and Assigned(Node) then
try
if FTree.ValidateNamespace(Node, Data) then
Data.InitIconIndexThread(False, icSmall, True);

if not Terminated then
FTree.InvalidateNode(Node);
except // no exceptions within the thread please, stop loop instead
LastCount := 1;
end;

- the thread can be ended so:

procedure TCustomVirtualExplorerTree.DestroyImageThread;
begin
if Assigned(ImageThread) then
begin
ImageThread.Terminate;
ImageThread.NodeList.Clear;
ImageThread.Free; // will call WaitFor implicitely
FImageThread := nil
end;
end;

so you don't have to loop in while..do sleep

- all strings in TCacheData changed to WideString to avoid frequent conversion,
perhaps everything in TNameSpace should exclusively work with wide strings

There is another issue but with low importance. The icons (when using the
background thread) are not retrieved in display order but in the order the
associated file system objects are read from disk. The reason is that the nodes
must be initialized to sort them (and the icons are read when nodes are
initialized). The result is that you don't get immediately the correct icons
when you scroll through the tree and with large directories it can take several
seconds until the thread has retrieved the icon indices. Another side effect of
the sorting is that the thread is not as advantageous as it could be. Since all
nodes are initialized when sorting also all icon indices are retrieved
regardless of whether the nodes are viewed or not. The disadvantage can fully
be seen in cases where you accidentally open a folder with, say, many icon
files in it and quickly want to browse through another folder. The icons in the
second folder will only updated after the one from the first folder are through
(although the folder is not browsed at all). However I have no idea how to
circumvent this unless you do not sort the nodes (which is also not desirable).

Otherwise however VET looks really nice and outperforms the Explorer totally. I
love it :o]

Ciao, Mike

Dipl. Ing. Mike Lischke
Senior software developer
--
Homepage: http://www.lischke-online.de
GraphicEx: http://www.lischke-online.de/Graphics.html
Virtual Treeview: http://www.lischke-online.de/VirtualTreeview.html
Unicode Edit and library: http://www.lischke-online.de/Unicode.html
Joint Endeavor of Delphi Innovators (JEDI): http://www.delphi-jedi.org

 | Replies | Author | Date
1211 | Re: VET improvements | Jim Kueneman | Sat 4/14/2001
1222 | Re: VET improvements | Mike Lischke | Sun 4/15/2001
1224 | Re: VET improvements | Jim Kueneman | Sun 4/15/2001
1228 | Re: VET improvements | Mike Lischke | Mon 4/16/2001
1230 | Re: VET improvements | Jim Kueneman | Mon 4/16/2001
1233 | Re: VET improvements | Geoffrey Pan | Mon 4/16/2001
1234 | Re: VET improvements | [tias@m...] | Tue 4/17/2001
1236 | Re: VET improvements | Jim Kueneman | Tue 4/17/2001
1243 | Re: VET improvements | [tias@m...] | Tue 4/17/2001


re: VET improvements

From: "Jim Kueneman" [jimdk@m...]
Date: Sat Apr 14, 2001 2:30 pm
Subject: Re: VET improvements

--- In [VirtualTreeview@y...], "Mike Lischke" [public@l...] wrote:

Mike,

> here is what I had to change in VET:
>
> - the index of the default document icon is 4, changed in
>TNamespace.GetIconIndex

Don't do this as it will not be gauranteed this will be right 100%
of the time (I bet is is wrong on Win9x) I understand the problem and
it is fixed in the new version. It *should* be 0 and it *is* now ;^)

> - double check if the icon thread is terminated, otherwise the IDE
>will crash badly when closing the demo and the thread is still active

Thanks for the help. It work ok at my end.

>
> - all strings in TCacheData changed to WideString to avoid frequent
>conversion, perhaps everything in TNameSpace should exclusively work
>with wide strings

I have never worked with Widestrings before. How does this work on
9x? Does Delphi handle the differences? If I made everything
WideStrings in TNamespace would it still work under 9x?

>
>updated after the one from the first folder are through (although the
>folder is not browsed at all). However I have no idea how to
>ircumvent this unless you do not sort the nodes (which is also not
>desirable).

I noticed this too and could not come up with an easy answer. Is
there a way in VT to include a "FirstTimeDrawn" event with relative
ease? I could then populate the ThreadList from there.

>Otherwise however VET looks really nice and outperforms the Explorer
>totally. I love it :o]

Great, from your last post I got the impression it was getting *too
much* like explorer for your tastes! :^) Adding the "extras" was
trivial since like I mentioned earlier I had this class already
working with a Treeview and Listview. I am just takeing this
oppertunity to update it and try to simplify it and implement the new
shell knowledge I have gained over the last year.

On the to do list is:

MultiSelect, right now it is not possible to change the Option flag.
This is going to be a challange with the MulitSelect treeview since
Multi PIDL IDataObjects only work on single IDLists direcly under
a parent folder. Internal D&D will be not too bad the hard part is
what to do when dragging outside of the application. No other COM D&D
program will be able to understand what is going on.

Notification of changes in the File system/Namespace. I have my
attempt plus a few other examples to try to come up with the most
reliable way to do this.

Lots of little details like executing a context menu command in
code, again I have it implemented but just need to look it over and
make it work in TNamespace.

Jim Kueneman

 | Replies | Author | Date
1222 | Re: VET improvements | Mike Lischke | Sun 4/15/2001
1224 | Re: VET improvements | Jim Kueneman | Sun 4/15/2001
1228 | Re: VET improvements | Mike Lischke | Mon 4/16/2001
1230 | Re: VET improvements | Jim Kueneman | Mon 4/16/2001
1233 | Re: VET improvements | Geoffrey Pan | Mon 4/16/2001
1234 | Re: VET improvements | [tias@m...] | Tue 4/17/2001
1236 | Re: VET improvements | Jim Kueneman | Tue 4/17/2001
1243 | Re: VET improvements | [tias@m...] | Tue 4/17/2001
1247 | Re: VET improvements | Jim Kueneman | Tue 4/17/2001


re: Re: Missing dcu

From: "Alexander Egorushkin" [egorushkin@m...]
Date: Sat Apr 14, 2001 2:46 pm
Subject: RE: [VirtualTreeview] Re: Missing dcu

> Perhaps we finally get
> also a nice package for BCB users
> together. Would be cool :o]
>
I believe we'll do it!

Alex.


re: VET improvements - Update

From: "Jim Kueneman" [jimdk@m...]
Date: Sat Apr 14, 2001 6:13 pm
Subject: Re: VET improvements - Update

--- In [VirtualTreeview@y...], "Mike Lischke" [public@l...] wrote:
> Jim,
>
> here is what I had to change in VET:
>
> - the index of the default document icon is 4, changed in
TNamespace.GetIconIndex
> - double check if the icon thread is terminated, otherwise the IDE
will crash badly when closing the demo and the thread is still active
>

This was not the underlying problem. Your fix made my system crash
when closing VET in a standalone EXE.

The problem is here.

destructor TImageThread.Destroy;
begin
FNodeList.Free;
inherited;
end;

Think about this.. The thread is in the delay(xxx) waiting.

The main thread calls

ImageThread.Free;

and the FNodeList is freed then the inherited calls Waitfor and
WaitforSingleObject is waiting as in the Destroy destructor above.

Then Sleep returns...

if TempCount = 0 then
Sleep(100);
LastCount := -99;
repeat
// get the next waiting node
with FNodeList.LockList do <<< FNodeList is Freed!!!!
begin

FNodeList is Freed and invalid which is not in a try except block. The
Execute method returns from the exception and CoUninitialize is not
called. This makes for nasty results apparently.

My fix was to

destructor TImageThread.Destroy;
begin
inherited;
FNodeList.Free;
end;

So FNodeList is still valid.

Jim

 | Replies | Author | Date
1215 | Re: VET improvements - Update | Jim Kueneman | Sun 4/15/2001
1216 | Re: VET improvements - Update | [prog-fr@n...] | Sun 4/15/2001
1221 | Re: VET improvements - Update | Mike Lischke | Sun 4/15/2001
1220 | Re: VET improvements - Update | Mike Lischke | Sun 4/15/2001
1225 | Re: VET improvements - Update | Jim Kueneman | Sun 4/15/2001


New file uploaded to VirtualTreeview

From: [VirtualTreeview@yahoogroups.com>
Date: Sun Apr 15, 2001 12:43 am
Subject: New file uploaded to VirtualTreeview

Hello,

This email message is a notification to let you know that
a file has been uploaded to the Files area of the VirtualTreeview
group.

File : /VET.zip
Uploaded by : [jimdk@m...]
Description : Virtual Explorer Tree Demo - Updated 4.14.01

You can access this file at the URL

http://groups.yahoo.com/group/VirtualTreeview/files/VET.zip

To learn more about file sharing for your group, please visit

http://help.yahoo.com/help/us/groups/files

Regards,

jimdk@m...]


re: VET improvements - Update

From: "Jim Kueneman" [jimdk@m...]
Date: Sun Apr 15, 2001 1:02 am
Subject: Re: VET improvements - Update

--- In [VirtualTreeview@y...], "Jim Kueneman" [jimdk@m...] wrote:
> --- In [VirtualTreeview@y...], "Mike Lischke" [public@l...] wrote:
> > Jim,
> >
> > here is what I had to change in VET:

I made some major changes to the icon thread implementation and I
think it is MUCH better. Also took care of your other issues as well
as a few of mine. Is it good enough for this release now?

Jim

 | Replies | Author | Date
1216 | Re: VET improvements - Update | [prog-fr@n...] | Sun 4/15/2001
1221 | Re: VET improvements - Update | Mike Lischke | Sun 4/15/2001


re: VET improvements - Update

From: [prog-fr@n...]
Date: Sun Apr 15, 2001 6:08 am
Subject: Re: VET improvements - Update

--- In [VirtualTreeview@y...], "Jim Kueneman" [jimdk@m...] wrote:
> --- In [VirtualTreeview@y...], "Jim Kueneman" [jimdk@m...] wrote:
> > --- In [VirtualTreeview@y...], "Mike Lischke" [public@l...] wrote:
> > > Jim,
> > >
> > > here is what I had to change in VET:
>
>
> I made some major changes to the icon thread implementation and I
> think it is MUCH better. Also took care of your other issues as
well
> as a few of mine. Is it good enough for this release now?
>
> Jim

Yes This last Realease work fine in my W2000


Problem with WindowState form property

From: Alexey Karak [karak@h...]
Date: Sun Apr 15, 2001 6:59 am
Subject: Problem with WindowState form property

Hello.

VirtualTreeview 2.3 beta:
If you switch 'WindowState' form property to then 'wsMinimized' while
running program and restoring/maximizing VT control doesn't appear.

Alexey Karak
[karak@h...]

 | Replies | Author | Date
1223 | Re: Problem with WindowState form property | Mike Lischke | Sun 4/15/2001


bug

From: "Vadim Sedulin" [wsntrl@o...]
Date: Sun Apr 15, 2001 9:26 am
Subject: bug

Hello Mike!

Some times GPF at 00000000:000xxxxx happen when another control (TToolButton
in my case) shows hint above VT. It happens irregular (~once per few days),
and D5 debugger does not stop on exception.
Also it may be not a hint, but mouse movement problem (I'm not sure).

Bye.

Vadim Sedulin
E-Mail: [wsntrl@o...]

 | Replies | Author | Date
1219 | Re: bug | Vadim Sedulin | Sun 4/15/2001
1229 | Re: bug | Mike Lischke | Mon 4/16/2001


re: bug

From: "Vadim Sedulin" [wsntrl@o...]
Date: Sun Apr 15, 2001 10:18 am
Subject: Re: [VirtualTreeview] bug

Hello Mike!

I found source of this problem (thanks to TD32):

TVirtualTreeHintWindow.ActivateHint -> IsWindowVisible(Handle)
+- TWinControl.GetHandle -> HandleNeeded
+- TWinControl.HandleNeeded -> Parent.HandleNeeded
+- TWinControl.HandleNeeded -> Parent.HandleNeeded -- Parent is
invalid
+- TWinControl.HandleNeeded -> if FHandle = 0 then -- Self is
invalid: GPF.

When exception happened mouse was above TToolButton and TToolButton's hint
was visible :[?!]

Bye.

Vadim Sedulin
E-Mail: [wsntrl@o...]

 | Replies | Author | Date
1229 | Re: bug | Mike Lischke | Mon 4/16/2001


re: Re: VET improvements - Update

From: "Mike Lischke" [public@l...]
Date: Sun Apr 15, 2001 10:43 am
Subject: RE: [VirtualTreeview] Re: VET improvements - Update

Jim,

> This was not the underlying problem. Your fix made my system crash
> when closing VET in a standalone EXE.
> with FNodeList.LockList do <<< FNodeList is Freed!!!!
>
> FNodeList is Freed and invalid which is not in a try except block. The
> Execute method returns from the exception and CoUninitialize is not
> called. This makes for nasty results apparently.

One reason more to put a try finally block in the Execute method (by the way:
you should change the
except keyword to finally, otherwise CoUnitialize in *only* called when there
was an exception).
Actually my fix was not what made your system crash. It showed only one weak
point. But using an
event as you do now is even better anyway (I do this too in VT) and freeing
some still needed
resources after the inherited destroy call is a valid way of doing such things.
I would however
check after the WaitForSingleObject call if the thread has been terminated
before continue
processing.

Ciao, Mike

 | Replies | Author | Date
1225 | Re: VET improvements - Update | Jim Kueneman | Sun 4/15/2001


re: Re: VET improvements - Update

From: "Mike Lischke" [public@l...]
Date: Sun Apr 15, 2001 10:43 am
Subject: RE: [VirtualTreeview] Re: VET improvements - Update

> I made some major changes to the icon thread implementation and I
> think it is MUCH better. Also took care of your other issues as well
> as a few of mine. Is it good enough for this release now?

As I already said: it outperforms Explorer and is an excellent example for the
use of VT (not to
mention the knowledge behind the TNameSpace class). So, yes, it is good enough
for release :o]

Ciao, Mike


re: Re: VET improvements

From: "Mike Lischke" [public@l...]
Date: Sun Apr 15, 2001 10:43 am
Subject: RE: [VirtualTreeview] Re: VET improvements

Jim,

> Don't do this as it will not be gauranteed this will be right 100%
> of the time (I bet is is wrong on Win9x) I understand the problem and
> it is fixed in the new version. It *should* be 0 and it *is* now ;^)

Excellent. But don't blame me for including fixed indices, you have used them
too :-) I only have
changed one of your fixed constants. But anyway, in your latest version you
have fixed this and it
works fine now.

> I have never worked with Widestrings before. How does this work on
> 9x? Does Delphi handle the differences? If I made everything
> WideStrings in TNamespace would it still work under 9x?

In the case of VET it is mainly a speed difference when storing ANSI strings in
the name space
classes. This will require a frequent conversion to wide strings when they are
queried for display
(because VT uses wide strings exclusively). The trouble comes with non-Latin
systems (cyrillic,
chinese etc.) . It could well be that the system locale ensures that also file
names in those
lanugages are properly converted to ANSI when querying them. But this is not
relyable and fails
entirely on multilanguage systems like mine. I have an english W2K
multilanguage installation where
I can switch UIs on the fly (japanese, german, russian and more). So the system
locale is not always
correct for particular file names.

To make a long story short: there is no harm when using wide strings even on
Windows 95 (because
they are used in OLE, therefore Borland made wide strings available primarily).
I assume on
non-asian/middle east Win9x systems ANSI strings are returned by IShellFolder
but this depends on
the actual system and requires then only a one time conversion.

> MultiSelect, right now it is not possible to change the Option flag.
> This is going to be a challange with the MulitSelect treeview since
> Multi PIDL IDataObjects only work on single IDLists direcly under
> a parent folder.

Really? CFSTR_SHELLIDLIST should do the job I believe. According to MSDN this
format can be used to
transfer multiple PIDLs.

> Notification of changes in the File system/Namespace. I have my
> attempt plus a few other examples to try to come up with the most
> reliable way to do this.

Well, this would be very useful.

Ciao, Mike

 | Replies | Author | Date
1224 | Re: VET improvements | Jim Kueneman | Sun 4/15/2001
1228 | Re: VET improvements | Mike Lischke | Mon 4/16/2001
1230 | Re: VET improvements | Jim Kueneman | Mon 4/16/2001
1233 | Re: VET improvements | Geoffrey Pan | Mon 4/16/2001
1234 | Re: VET improvements | [tias@m...] | Tue 4/17/2001
1236 | Re: VET improvements | Jim Kueneman | Tue 4/17/2001
1243 | Re: VET improvements | [tias@m...] | Tue 4/17/2001
1247 | Re: VET improvements | Jim Kueneman | Tue 4/17/2001


re: Problem with WindowState form property

From: "Mike Lischke" [public@l...]
Date: Sun Apr 15, 2001 10:43 am
Subject: RE: [VirtualTreeview] Problem with WindowState form property

Hi Alexey,

> VirtualTreeview 2.3 beta:
> If you switch 'WindowState' form property to then 'wsMinimized' while
> running program and restoring/maximizing VT control doesn't appear.

I used the Minimal demo and placed a button on the form. In the OnClick handler
I wrote:

procedure TMainForm.Button2Click(Sender: TObject);
begin
//WindowState := wsMinimized;
Application.Minimize;
Sleep(1000);
//WindowState := wsNormal;
Application.Restore;
end;

I can't neither by using the application class nor by assigning directly to the
window state of the
form reproduce this problem. Could you make me please a small demo showing this
effect? I will then
quickly find out what's wrong.

Ciao, Mike


re: VET improvements

From: "Jim Kueneman" [jimdk@m...]
Date: Sun Apr 15, 2001 1:37 pm
Subject: Re: VET improvements

--- In [VirtualTreeview@y...], "Mike Lischke" [public@l...] wrote:
> Jim,
>
> > Don't do this as it will not be gauranteed this will be right
100%
> > of the time (I bet is is wrong on Win9x) I understand the problem
and
> > it is fixed in the new version. It *should* be 0 and it *is* now
;^)
>
> Excellent. But don't blame me for including fixed indices, you have
used them too :-) I only have
> changed one of your fixed constants. But anyway, in your latest
version you have fixed this and it
> works fine now.

Well sort of :^) The overlays are documented to be fixed for the hand
and link. The default icon will "almost" surely be 0 IF the image
list is completely initialized, i.e. if you use the undocumented
function to load the entire imagelist in NT. That was the problem, I
added some startup code that requred NT to load a few images before
the function was call and since the imagelist had already commited
some indexes it could not change and the function failed.

> In the case of VET it is mainly a speed difference when storing ANSI
strings in the name space
> classes. This will require a frequent conversion to wide strings
when they are queried for display

OK, done. I did not see a noticable difference.

> > MultiSelect, right now it is not possible to change the Option
flag.
> > This is going to be a challange with the MulitSelect treeview
since
> > Multi PIDL IDataObjects only work on single IDLists direcly under
> > a parent folder.
>
> Really? CFSTR_SHELLIDLIST should do the job I believe. According to
MSDN this format can be used to
> transfer multiple PIDLs.

Yes, but with only one parent like I stated:

typedef struct _IDA {
UINT cidl; // number array elements
UINT aoffset[1]; // see below
} CIDA, * LPIDA;

Member

aoffset

Array of offsets relative to the beginning of the CIDA structure. The
first element is the offset of the ITEMIDLIST structure for a folder
(absolute from the root). Subsequent elements are offsets of
ITEMIDLIST structures for file objects (relative from the parent
folder).

One fully qualified PIDL and a family of single PILDs relative to the
parent. A multiselect treeview can have any number parents selected.

Jim

 | Replies | Author | Date
1228 | Re: VET improvements | Mike Lischke | Mon 4/16/2001
1230 | Re: VET improvements | Jim Kueneman | Mon 4/16/2001
1233 | Re: VET improvements | Geoffrey Pan | Mon 4/16/2001
1234 | Re: VET improvements | [tias@m...] | Tue 4/17/2001
1236 | Re: VET improvements | Jim Kueneman | Tue 4/17/2001
1243 | Re: VET improvements | [tias@m...] | Tue 4/17/2001
1247 | Re: VET improvements | Jim Kueneman | Tue 4/17/2001


re: VET improvements - Update

From: "Jim Kueneman" [jimdk@m...]
Date: Sun Apr 15, 2001 1:41 pm
Subject: Re: VET improvements - Update

--- In [VirtualTreeview@y...], "Mike Lischke" [public@l...] wrote:
> Jim,
>
> One reason more to put a try finally block in the Execute method (by
the way: you should change the
> except keyword to finally, otherwise CoUnitialize in *only* called
when there was an exception).

Oops :-)

> check after the WaitForSingleObject call if the thread has been
terminated before continue
> processing.

Agreed and Done.

Jim


re: Re: Missing dcu

From: "Alexander Egorushkin" [egorushkin@m...]
Date: Sun Apr 15, 2001 11:46 pm
Subject: RE: [VirtualTreeview] Re: Missing dcu

Hi, Mike!
> Another one issue for C++ Builder users. I had to add to machine
> generated
> header for "VirtualTrees.pas" this line:
> #include <oleidl.h>
> (where IDropTarget, IDropSource and other interfaces are defined).
>
> PS I use C++ Builder 5.0

Could you add this line to VirtualTrees.pas:
{$HPPEMIT '#include <oleidl.h>' }
This will cause C++Builder delphi compiler to include <oleidl.h> in the
machine generated header.

Alex.

 | Replies | Author | Date
1227 | Re: Missing dcu | Mike Lischke | Mon 4/16/2001
1231 | Re: Missing dcu | Alexander Egorushkin | Mon 4/16/2001


re: Re: Missing dcu

From: "Mike Lischke" [public@l...]
Date: Mon Apr 16, 2001 10:08 am
Subject: RE: [VirtualTreeview] Re: Missing dcu

Hi Alexander,

> Could you add this line to VirtualTrees.pas:
> {$HPPEMIT '#include <oleidl.h>' }
> This will cause C++Builder delphi compiler to include <oleidl.h> in the
> machine generated header.

Done. I have included it right after {$I DFS.inc}. If there is a better place
then tell me. Btw: is
any $EXTERNALSYMBOL statement necessary?

Ciao, Mike

 | Replies | Author | Date
1231 | Re: Missing dcu | Alexander Egorushkin | Mon 4/16/2001


re: Re: VET improvements

From: "Mike Lischke" [public@l...]
Date: Mon Apr 16, 2001 10:08 am
Subject: RE: [VirtualTreeview] Re: VET improvements

Jim,

> typedef struct _IDA {
> UINT cidl; // number array elements
> UINT aoffset[1]; // see below
> } CIDA, * LPIDA;
>
> One fully qualified PIDL and a family of single PILDs relative to the
> parent. A multiselect treeview can have any number parents selected.

Mmmh, you could force a level select constraint and take the common parent of
the selected nodes for
the fully qualified PIDL. The subitems (folder or files) are then relative to
that parent.

Ciao, Mike

 | Replies | Author | Date
1230 | Re: VET improvements | Jim Kueneman | Mon 4/16/2001
1233 | Re: VET improvements | Geoffrey Pan | Mon 4/16/2001
1234 | Re: VET improvements | [tias@m...] | Tue 4/17/2001
1236 | Re: VET improvements | Jim Kueneman | Tue 4/17/2001
1243 | Re: VET improvements | [tias@m...] | Tue 4/17/2001
1247 | Re: VET improvements | Jim Kueneman | Tue 4/17/2001


re: bug

From: "Mike Lischke" [public@l...]
Date: Mon Apr 16, 2001 10:08 am
Subject: RE: [VirtualTreeview] bug

Hi Vadim,

> TVirtualTreeHintWindow.ActivateHint -> IsWindowVisible(Handle)
> +- TWinControl.GetHandle -> HandleNeeded
> +- TWinControl.HandleNeeded -> Parent.HandleNeeded
> +- TWinControl.HandleNeeded -> Parent.HandleNeeded -- Parent is
> invalid
> +- TWinControl.HandleNeeded -> if FHandle = 0 then -- Self is
> invalid: GPF.

This is very, very strange. The test IsWindowVisible is called after many other
functions have
worked with the hint window's handle, including SetWindowPos and
InvalidateRect. Hence the handle
should be valid and the line

TWinControl.HandleNeeded -> Parent.HandleNeeded

and following calls should never be executed. Additionally, if the parent
window is invalid how can

if Parent <> nil then Parent.HandleNeeded;

ever succeed?

10 minutes later: oh yes, I found it. The problem is that the entire hint
window gets destroyed by
the hint window handling of TApplication when the hint of another control is
about to be shown. And
this might even happen when the window is in the animation loop. Unfortunately
the tree hint window
has to let go through certain messages during its animation loop which causes
the entire trouble.
Since the internal data is no longer valid (so the tree hint can't even check
its reference to the
tree it belongs to) I have introduced a global flag which is set when the hint
window is being
destroyed and which can be checked during the animation loop. Since we have
always only one hint
window active this solution is acceptable and reliable.

Thank you for bringing this bug to my attention. It is not easy to reproduce
and even harder to find
the reason.

Ciao, Mike


re: VET improvements

From: "Jim Kueneman" [jimdk@m...]
Date: Mon Apr 16, 2001 12:37 pm
Subject: Re: VET improvements

--- In [VirtualTreeview@y...], "Mike Lischke" [public@l...] wrote:

> Mmmh, you could force a level select constraint and take the common
parent of the selected nodes for
> the fully qualified PIDL. The subitems (folder or files) are then
relative to that parent.

That kind if ruins the benifit if having a multi select treeview :^)
I need to look into to it further.

Jim


re: Re: Missing dcu

From: "Alexander Egorushkin" [egorushkin@m...]
Date: Mon Apr 16, 2001 6:03 pm
Subject: RE: [VirtualTreeview] Re: Missing dcu

Hi, Mike!
> > Could you add this line to VirtualTrees.pas:
> > {$HPPEMIT '#include <oleidl.h>' }
> > This will cause C++Builder delphi compiler to include <oleidl.h> in the
> > machine generated header.
>
> Done. I have included it right after {$I DFS.inc}. If there is a
> better place then tell me. Btw: is
> any $EXTERNALSYMBOL statement necessary?
Thank you. The place in the pas-file does not matter. I think no
$EXTERNALSYM are necessary. Another one issue for BCB users: some problems
may occur when one try to create a VT editor and pass it in OnCreateEditor
event to the tree using C++ Builder. I'll test it at this week-end and write
about results.

Does anybody know how to implement Delphi interfaces in BCB? Must I write
the code for QureryInterface, AddRef and Release myself (or use ATL) or I
can inherit my class from TInterfacedObject (as in Delphi)?

Alex.


Problem after LoadFromFile (Ver 1.31)

From: "Thomas Schoessow" [info@t...]
Date: Mon Apr 16, 2001 6:18 pm
Subject: Problem after LoadFromFile (Ver 1.31)

Hi,

After loadfromfile(...) the content of the Tree is nearly invisible. Only the
root node is visible.
The other nodes are there, I can click on them, but I can't see them.

Do I have to use some repainting ? Or should I use the new 2.1 version to avoid
that problem ?

I'm using D5 pro (Update 1) on Win2000 pro.

Regards

Thomas

 | Replies | Author | Date
1250 | Re: Problem after LoadFromFile (Ver 1.31) | Mike Lischke | Tue 4/17/2001


re: Re: VET improvements

From: "Geoffrey Pan" [gpan@c...]
Date: Mon Apr 16, 2001 8:44 pm
Subject: RE: [VirtualTreeview] Re: VET improvements

There seems to be a issue when VT is on a hidden panel?. Says parameter is
incorrect. Will test further and provide a demo.

 | Replies | Author | Date
1234 | Re: VET improvements | [tias@m...] | Tue 4/17/2001
1236 | Re: VET improvements | Jim Kueneman | Tue 4/17/2001
1243 | Re: VET improvements | [tias@m...] | Tue 4/17/2001
1247 | Re: VET improvements | Jim Kueneman | Tue 4/17/2001


re: VET improvements

From: [tias@m...]
Date: Tue Apr 17, 2001 1:35 am
Subject: Re: VET improvements

--- In [VirtualTreeview@y...], "Geoffrey Pan" [gpan@c...] wrote:

More... :

Is there anyway to specify the Path for the VET ? I want to open a
specific Path (all folder-nodes) in run-time, for example
"C:\Program Files\Netscape\" ?

Mathias Thorell

 | Replies | Author | Date
1236 | Re: VET improvements | Jim Kueneman | Tue 4/17/2001
1243 | Re: VET improvements | [tias@m...] | Tue 4/17/2001
1247 | Re: VET improvements | Jim Kueneman | Tue 4/17/2001


DeleteNode vs DoFreeNode

From: "Anthony Mills" [amills@m...]
Date: Tue Apr 17, 2001 3:09 am
Subject: DeleteNode vs DoFreeNode

Mike,

TBaseVirtualTree.DeleteChildren is giving me errors when closing my app.
Basically, I have a TVirtualStringTree (with data) within a hidden TFrame.
When closing my app (TApplication calling Destroy), it tells me I have an
EIntOverflow in the Dec(FVisibleCount); line.

Here's the affected code:

Run := Node.LastChild;
while Assigned(Run) do
begin
if NodeVisible and (vsVisible in Run.States) then
Dec(FVisibleCount); <-- This causes an EIntOverflow

Include(Run.States, vsDeleting);
Mark := Run;
Run := Run.PrevSibling;
// important, to avoid exchange of invalid pointers while
disconnecting the node
if Assigned(Run) then
Run.NextSibling := nil;
// Need to execute the whole chain only if the node has already been
initialized
// otherwise it can neither be in the selection nor focused nor have
got children.
// Hence just delete it.
if vsInitialized in Mark.States then \
DeleteNode(Mark) \
else > Lines affected by temp fix
DoFreeNode(Mark); /
end; /

Now, if I force it to always call DeleteNode, no EIntOverflow.

Regards,

Tony

 | Replies | Author | Date
1238 | Re: DeleteNode vs DoFreeNode | Mike Lischke | Tue 4/17/2001
1265 | Re: DeleteNode vs DoFreeNode | Mike Lischke | Thu 4/19/2001


re: VET improvements

From: "Jim Kueneman" [jimdk@m...]
Date: Tue Apr 17, 2001 5:38 am
Subject: Re: VET improvements

--- In [VirtualTreeview@y...], [tias@m...] wrote:
> --- In [VirtualTreeview@y...], "Geoffrey Pan" [gpan@c...] wrote:
>
> More... :
>
> Is there anyway to specify the Path for the VET ? I want to open a
> specific Path (all folder-nodes) in run-time, for example
> "C:\Program Files\Netscape\" ?

You are not actually using VET are you? :^) It is still missing a
fair amount to be truely done, with that being one thing to do. I am
uploading a new version as I type with that function added in with an
updated Demo.

Jim

BTW

Mike, it is still necessary to implement Werners fix in message 1144
or if you change between using columns to not using columns while
designing in the IDE the control goes white and no nodes are drawn.

Also during run time I went to drag the Demo window and the control
vansished with out a trace. No scrollbars, no white background
nothing, only the panel behind VET was visible???? I can't get it to
do it again. Related problems?

 | Replies | Author | Date
1243 | Re: VET improvements | [tias@m...] | Tue 4/17/2001
1247 | Re: VET improvements | Jim Kueneman | Tue 4/17/2001


Images and RowSelect

From: GIANNAKOPOULOS KOSTAS [kyan@s...]
Date: Tue Apr 17, 2001 10:07 am
Subject: Images and RowSelect

Hello Mike.

A small bug: In the latest version images are not drawn transparenty, so if
you have voFullRowSelect checked all images are drawn with a white
background even if the node is highlighted (ugly).

Here's a fix, not tested for all cases:

procedure TBaseVirtualTree.PaintImage(const PaintInfo: TVTPaintInfo;
ImageInfoIndex: TVTImageInfoIndex;
Images: TImageList; DoOverlay: Boolean);

const
Style: array[TImageType] of Cardinal = (0, ILD_MASK);

var
OverlayImage: Integer;
OverlayGhosted: Boolean;
ExtraStyle: Cardinal;
ForegroundColor: COLORREF;

begin
with PaintInfo, ImageInfo[ImageInfoIndex], Images do
begin
if vsSelected in Node.States then
ForegroundColor := ColorToRGB(FColors.FocusedSelectionColor)
else
ForegroundColor := GetRGBColor(BlendColor);

// Since the overlay image must be specified together with the image to
draw
// it is meaningfull to retrieve it in advance.
if DoOverlay then
OverlayImage := DoGetImageIndex(PaintInfo.Node, ikOverlay,
PaintInfo.Column, OverlayGhosted)
else
OverlayImage := -1;
if (vsDisabled in Node.States) or not Enabled then
begin
// If the tree or the current node is disabled then let the VCL draw
the image as it alread
// contains code to convert the image to the system colors.
if OverlayImage > -1 then
Images.DrawOverlay(Canvas, XPos, YPos, Index, OverlayImage, False)
else
Images.Draw(Canvas, XPos, YPos, Index, False);
end
else
begin
ExtraStyle := ILD_TRANSPARENT; // This is the fix
if OverlayImage > -1 then
ExtraStyle := ExtraStyle or ILD_OVERLAYMASK and
Cardinal(IndexToOverlayMask(OverlayImage + 1)); // Compiler hint fixed

// Blend image if it is ghosted...
if Ghosted or
// ... or it is not the check image and the node is selected...
((vsSelected in Node.States) and (ImageInfoIndex <> iiCheck)) or
// ... or if cut is pending and the node is in the cut set.
((vsCutOrCopy in Node.States) and (tsCutPending in FStates)) then
ExtraStyle := ExtraStyle or ILD_BLEND50;

ImageList_DrawEx(Handle, Index, Canvas.Handle, XPos, YPos, 0, 0,
GetRGBColor(BkColor), ForegroundColor, Style[ImageType] or
ExtraStyle);
end;
end;
end;

Maybe it needs more thought, if a node is highlighted and voFullRowSelect is
True then maybe you should not use ILD_BLEND50 because the image looks very
dark...

<KY>

 | Replies | Author | Date
1266 | Re: Images and RowSelect | Mike Lischke | Thu 4/19/2001


re: DeleteNode vs DoFreeNode

From: Mike Lischke [public@l...]
Date: Tue Apr 17, 2001 11:38 am
Subject: RE: [VirtualTreeview] DeleteNode vs DoFreeNode

Hi Anthony,

> if NodeVisible and (vsVisible in Run.States) then
> Dec(FVisibleCount); <-- This causes an EIntOverflow

Sorry, this is my fault. I just found out that the visible count is
sometimes decreased twice for one node (in the loop in DeleteChildren and in
InternalDisconnectNode called from DeleteNode which is repeatedly called by
DeleteChildren). I will change the code so that InternalDisconnectNode will
be called also for unitialized nodes and will remove the extra visible count
decrease. This should fix the problem.

Unfortunately, I have not the correct version of VT here and can therefore
not change it currently. The fix must wait until tomorrow, sorry.

Ciao, Mike


re: Re: VET improvements

From: Mike Lischke [public@l...]
Date: Tue Apr 17, 2001 11:47 am
Subject: RE: [VirtualTreeview] Re: VET improvements

Jim,

> Mike, it is still necessary to implement Werners fix in message 1144
> or if you change between using columns to not using columns while
> designing in the IDE the control goes white and no nodes are drawn.

I have just uploaded what I have here. This includes the fix from Werner.

> Also during run time I went to drag the Demo window and the control
> vansished with out a trace. No scrollbars, no white background
> nothing, only the panel behind VET was visible???? I can't get it to
> do it again. Related problems?

I have no idea. I have never seen this problem.

Ciao, Mike


Hint Animations

From: "Jim Kueneman" [jimdk@m...]
Date: Tue Apr 17, 2001 1:09 pm
Subject: Hint Animations

Mike,

Is it just me or has the animations for the hint boxes disappeared in
the latest version of VT?

Jim

 | Replies | Author | Date
1245 | Re: Hint Animations | Mike Lischke | Tue 4/17/2001
1246 | Re: Hint Animations | Jim Kueneman | Tue 4/17/2001
1257 | Re: Hint Animations | Jim Kueneman | Wed 4/18/2001
1248 | Re: Hint Animations | Werner Lehmann | Tue 4/17/2001
1251 | Re: Hint Animations | Mike Lischke | Tue 4/17/2001
1258 | Re: Hint Animations | Bender Heri | Wed 4/18/2001
1259 | Re: Hint Animations | Jim Kueneman | Wed 4/18/2001
1268 | Re: Hint Animations | Mike Lischke | Thu 4/19/2001
1271 | Re: Hint Animations | Mike Lischke | Thu 4/19/2001


NotifyEvent OnCreateEditor under BCB5

From: "Roland" [Beduerftig@S...]
Date: Tue Apr 17, 2001 1:41 pm
Subject: NotifyEvent OnCreateEditor under BCB5

I discusted this problem with Mike and I wrote many emails to
technical bookwriter, to borland newsgroup and so on .....

I try to translate here the main question as basis for my email and
then the answers I received:

==============================================================

generell information to understand what I would like to do (snip
because we are here on VT newsgroup) ......
VT is a tree and the interface will be used as a jumptable for the
own editor and VT will get only the reference to the editor ....

the declaration is:

IEditLink = interface
function BeginEdit: Boolean; stdcall;
function EndEdit: ....
....
end;

in Delphi we write:

TOwnEditor = class(TInterfacedObject, IEditLink)
function BeginEdit: Boolean; stdcall;
function EndEdit: ....
....
end;

and now with a doubleclick on then NotifyEvent Delphi will create
this frame:

procedureTMainForm::CreateEditor(....., out EditLink: IEditLink);
begin
EditLink := TOwnEditor.Create;
end;

then we write one line in this frame and the internal call will
create a correct VTable for the jumplist.

Ok that fine .... and now the same in BCB5

class OwnEditor : public TInterfacedObject, public IEditLink {
bool _stdcall BeginEdit();
......
}

an error will happened => error E2278 VCL-Classe must not have
several basic classes

next step look into Borland source

void __fastcall TBufferList::BufferListProc(.... TKeyBindingResult
&BindingResult)
{
_di_IInterfaceList InterfaceList;
_di_IOTAEditBuffer Temp;
TBufferListFrm *Form = new TBufferListFrm(Application);
HRESULT hr;
__try
{
InterfaceList = *(new TInterfaceList());
.......
if (Form->ShowModal() == mrOk)
{
hr =
InterfaceList->Items[Form->BufferListBox->ItemIndex]->QueryInterface
(__uuido
f(IOTAEditBuffer), (void **) &Temp);
if (SUCCEEDED(hr))
Temp->Show();
}

it looks like the same as BCB5 autocreated from VT in the *.hpp

__interface IEditLink;
typedef System::DelphiInterface<IEditLink> _di_IEditLink;
__interface IEditLink : public IUnknown
{
.....
}

I think the next step should be:

void TMainForm::CreateEditor(....., out EditLink: IEditLink)
{
_di_IEditLink MyLink;
EditLink = *(new TOwnEditor);
EditLink->QueryInterface(__uuidof(IEditLink), (void**)&MyLink);
}

Mike had added a GUID in Beta 2.3x, Ok but the VTable will not build
correct for the use with Delphi, VT cannot jump over this table to
the methods in the OwnEditor.

==============================================================

this main problem is

in Delphi we write
xxx = class(TInterfacedObject, IEditLink)

and in BCB an error happened => error E2278 .........
class xxx : public TInterfacedObject, public IEditLink

==============================================================

the basic answer:

the main problem is that interface use the COM-mechanism and internal
direct the TInterfacesObject will be used. It is typical a Dual
Interface + Type Library and it is normally not important which
language we use Delphi or BCB, but Delphi is standalone and BCB
should be compatible with the other compilers for example VC++, and
this is the reason why Borland can not implemented the direct use of
the interface like as in Delphi.

I hope I get in the next weeks more information how is the correkt
way to implement the problem with the interface.

Now I use I modified version of VT without using the inferface with
IEditLink, I build in NotifyEvents for the jumps to my OwnEditor and
this modification will work fine.

with best regards
Roland

 | Replies | Author | Date
1242 | Re: NotifyEvent OnCreateEditor under BCB5 | Mike Lischke | Tue 4/17/2001
1249 | Re: NotifyEvent OnCreateEditor under BCB5 | Alexander Egorushkin | Tue 4/17/2001
1255 | Re: NotifyEvent OnCreateEditor under BCB5 | Roland | Wed 4/18/2001
1260 | Re: NotifyEvent OnCreateEditor under BCB5 | Alexander Egorushkin | Wed 4/18/2001
1264 | Re: NotifyEvent OnCreateEditor under BCB5 | Mike Lischke | Thu 4/19/2001
1274 | Re: NotifyEvent OnCreateEditor under BCB5 | Roland | Thu 4/19/2001
1280 | Re: NotifyEvent OnCreateEditor under BCB5 | Alexander Egorushkin | Thu 4/19/2001
1282 | Re: NotifyEvent OnCreateEditor under BCB5 | [tias@m...] | Thu 4/19/2001
1284 | Re: NotifyEvent OnCreateEditor under BCB5 | Alexander Egorushkin | Thu 4/19/2001


re: NotifyEvent OnCreateEditor under BCB5

From: Mike Lischke [public@l...]
Date: Tue Apr 17, 2001 1:47 pm
Subject: RE: [VirtualTreeview] NotifyEvent OnCreateEditor under BCB5

> Now I use I modified version of VT without using the inferface with
> IEditLink, I build in NotifyEvents for the jumps to my OwnEditor and
> this modification will work fine.

Yes, Roland spent a lot of time trying to figure out what's going on behind
the scene. It seems, however, there is no way to use the editor class the
same way in BCB as we do in Delphi. The funny thing about this all is that I
have introduced the interface for the sole reason to make it easy to create
an editor descentant with BCB. This obviously failed "terribly" so I'm
thinking about cancelling the whole interface approach and just use a normal
Delphi class which can then easily be translated to BCB.

Any other opinions?

Ciao, Mike


re: VET improvements

From: [tias@m...]
Date: Tue Apr 17, 2001 2:03 pm
Subject: Re: VET improvements

--- In [VirtualTreeview@y...], "Jim Kueneman" [jimdk@m...] wrote:
> You are not actually using VET are you? :^) It is still missing a
> fair amount to be truely done,

Actually I'm taking a serious look to into it since it's going to
replace my own FolderTreeView (based on TTreeNT). The only thing
(except for the Path stuff) I had to add to make it complete (for me)
was an OnAddItem event in .EnumerateFolderCallback() (All unindente
rows added by me ;-) :

var
NewNodeData: PNodeData;
ShowIt: Boolean;
ns: TNamespace;
begin
ns := TNamespace.Create(APIDL,AParent);
ShowIt := true;
if Assigned(FOnAddItem)
then
FOnAddItem(Self,ns,ShowIt);
if ShowIt = true then
begin
Inc(FLastEnumCount);
NewNodeData := InternalData(AddChild(Data));
if Assigned(NewNodeData) then
NewNodeData.Namespace := ns;//TNamespace.Create(APIDL, AParent);
end
else
ns.Destroy();
end;

This gives me the opportunity to display just specific files, for
example .txt-files containing some specific text, date filtered
files/folders and so on. Of course it will slow down the tree, but not
too much for my purpouses anyway.

> with that being one thing to do. I am
> uploading a new version as I type with that function added in with
an
> updated Demo.
> Jim
> BTW

Perfect ! I can't wait ! ;--)

<snip>

/Mathias Thorell

 | Replies | Author | Date
1247 | Re: VET improvements | Jim Kueneman | Tue 4/17/2001


OLEFormats and OnCreateDragManager

From: GIANNAKOPOULOS KOSTAS [kyan@s...]
Date: Tue Apr 17, 2001 2:27 pm
Subject: OLEFormats and OnCreateDragManager

Good evening Mike.

A small bug report:

If you specify a value for OLEFormats different than the default, then
OnCreateDragManager will not work correctly.

The reason is that because of the order in which properties/event handlers
are read from a dfm stream (first OLEFormats then OnCreateDragManager)
method TBaseVirtualTree.GetDragManger will be called form SetOLEFormats
BEFORE the value of OnCreateDragManager is read from the stream, creating a
standard TVTDragDropManager instead of the class specified by the event
handler.

A suggested fix is:

procedure TBaseVirtualTree.SetOLEFormats(Value: TOLEFormats);

begin
if FOLEFormats <> Value then
begin
FOLEFormats := Value;
// Remove the current clipboard data if it is set by the tree
SetClipboard(nil);
if Assigned(FDragManager) then FDragManager.SetOLEFormats(FOLEFormats);
end;
end;

so that SetOLEFormats does not necessarily create the drop manager, but sets
its OLEFormats only if it *has* been created.

<KY>

 | Replies | Author | Date
1267 | Re: OLEFormats and OnCreateDragManager | Mike Lischke | Thu 4/19/2001


re: Hint Animations

From: Mike Lischke [public@l...]
Date: Tue Apr 17, 2001 2:36 pm
Subject: RE: [VirtualTreeview] Hint Animations

> Is it just me or has the animations for the hint boxes disappeared in
> the latest version of VT?

Jim, what happens? On my side here everything is still fine. If you don't
mind to try out a pure executable then download the object inspector clone
I'll upload in a minute to YG. Every node in the second (Value) column shows
its value via a hint too. There is not a hint for every node in the
'Properties' column, so don't get confused. Do the hints actually show?

Ciao, Mike

 | Replies | Author | Date
1246 | Re: Hint Animations | Jim Kueneman | Tue 4/17/2001
1257 | Re: Hint Animations | Jim Kueneman | Wed 4/18/2001


re: Hint Animations

From: "Jim Kueneman" [jimdk@m...]
Date: Tue Apr 17, 2001 3:21 pm
Subject: Re: Hint Animations

--- In [VirtualTreeview@y...], Mike Lischke [public@l...] wrote:
> I'll upload in a minute to YG. Every node in the second (Value)
column shows
> its value via a hint too. There is not a hint for every node in the
> 'Properties' column, so don't get confused. Do the hints actually
show?

Sorry I did not state that very well. They show but in my VET demo
you can select slide, fade, none for animation. This last demo I
uploaded the hints seem to just 'pop' on the screen. Can you tell me
if the latest demo works right for you?

BTW at my work machine the OI demo fades in ok.

Jim


re: VET improvements

From: "Jim Kueneman" [jimdk@m...]
Date: Tue Apr 17, 2001 3:30 pm
Subject: Re: VET improvements

--- In [VirtualTreeview@y...], [tias@m...] wrote:
> --- In [VirtualTreeview@y...], "Jim Kueneman" [jimdk@m...] wrote:

> This gives me the opportunity to display just specific files, for
> example .txt-files containing some specific text, date filtered
> files/folders and so on. Of course it will slow down the tree, but
not

Excellent idea. I will add something like that (or exactly that <g>).

BTW I found the mystery blanking of the VET I mentioned to Mike, the
new version works fine until you enter an invalid directory. The
BeginUpdate get called without an EndUpdate.

Replace BrowseTo in VirtualExplorerTree with this:

function TCustomVirtualExplorerTree.BrowseTo(APath: string;
ExpandTarget, SelectTarget, SetFocusToVET, CollapseAllFirst: Boolean):
Boolean;
var
TargetNode: PVirtualNode;
PIDL: PItemIdList;
begin
Result := False;
TargetNode := nil;
PIDL := PathToPIDL(APath);
if Assigned(PIDL) then
begin
BeginUpdate;
try
TargetNode := WalkPIDLToNode(PIDL, False);
if Assigned(TargetNode) then
begin
if CollapseAllFirst then
FullCollapse;
Expanded[TargetNode] := ExpandTarget;
if SelectTarget then
begin
ClearSelection;
Selected[TargetNode] := True;
FocusedNode := TargetNode
end;
if SetFocusToVET then
SetFocus;
Result := True
end
finally
EndUpdate;
{ TopNode does not work between BeginUpdate and EndUpdate for
some reason }
if Assigned(TargetNode) then
TopNode := TargetNode;
PIDLMgr.FreePIDL(PIDL);
end;
end
end;

Jim


re: Hint Animations

From: Werner Lehmann [wl@b...]
Date: Tue Apr 17, 2001 4:04 pm
Subject: Re: [VirtualTreeview] Hint Animations

Mike Lischke wrote:
>
> Jim, what happens? On my side here everything is still fine. If you don't
> mind to try out a pure executable then download the object inspector clone
> I'll upload in a minute to YG. Every node in the second (Value) column shows
> its value via a hint too. There is not a hint for every node in the
> 'Properties' column, so don't get confused. Do the hints actually show?

Mike,

I have looked at your OI clone (hints fade ok on my Win2k). I noticed one
thing in the dropdown tree at the top though: if a row with child nodes is
selected, the plus/minus sign is hardly visible. This is because the white
part around the symbol is drawn in clHighlight. Could you remove the trans-
parent color from the inner parts of plus and minus? (I am not needing this
currently as I don't use Rowselect. Just a thought.)

Secondly, if I click on some 'properties' (right now it works reliably with
StringOptions.*) a transparent rectangle with thick white border is drawn at
the top left corner of my desktop. It just flashes a moment and is gone.
Don't know what that is but thought you might want to know.

Regards,
Werner

 | Replies | Author | Date
1251 | Re: Hint Animations | Mike Lischke | Tue 4/17/2001


re: NotifyEvent OnCreateEditor under BCB5

From: "Alexander Egorushkin" [egorushkin@m...]
Date: Tue Apr 17, 2001 5:06 pm
Subject: RE: [VirtualTreeview] NotifyEvent OnCreateEditor under BCB5

Hello,

The main problem is that:
in the header for VirtualTrees.pas OnCreateEditorEvent is defined as

typedef void __fastcall (__closure *TVTCreateEditorEvent)
(TBaseVirtualTree* Sender, PVirtualNode Node, int Column, /* out */
_di_IVTEditLink &EditLink);

but Borland IDE interprets it as

void __fastcall TForm2::VirtualStringTree1CreateEditor(
TBaseVirtualTree *Sender, PVirtualNode Node, int Column,
IVTEditLink *EditLink)

In the header
_di_IVTEditLink &EditLink
but IDE understands it as
IVTEditLink *EditLink

If one write something like that
EditLink = (IVTEditLink*)new TStringEditLink;
Nil will be passed to the VirtualTree (because interface is a pointer and
hence interface passed as an out parameter is a poiter to pointer).

This solves the problem:
1. Change the declaration for the event handler as follows (both in HPP and
CPP files)
...IVTEditLink ** EditLink
IDE will not notice this change.
2. Write code like this:
{
// Create "CoClass"
TStringEditLink* Link = new TStringEditLink;

// Call AddRef to the interface
// We should not call QueryInterface because Delphi coclass has
//redefined operator IVTEditLink* (void). For details see VirtualTrees.hpp

_di_IVTEditLink Temp((IVTEditLink* )(*Link));

// Call AddRef again because destructor of DelphiInterface calls Release
Temp->AddRef();
// Pass the interface to the Tree
*EditLink = (IVTEditLink* )Temp;
// Here Temp will be destroyed and Release() will be called. But we've
//called AddRef twice hence EditLink is still valid
}

Sorry, I have to go out now, so I'll be able to illustrate how to create
your own EditLink in C++Builder only at the week-end.

Alex.

 | Replies | Author | Date
1255 | Re: NotifyEvent OnCreateEditor under BCB5 | Roland | Wed 4/18/2001
1260 | Re: NotifyEvent OnCreateEditor under BCB5 | Alexander Egorushkin | Wed 4/18/2001


re: Problem after LoadFromFile (Ver 1.31)

From: "Mike Lischke" [public@l...]
Date: Tue Apr 17, 2001 8:14 pm
Subject: RE: [VirtualTreeview] Problem after LoadFromFile (Ver 1.31)

Thomas,

> After loadfromfile(...) the content of the Tree is nearly invisible. Only the
root node
> is visible.
> The other nodes are there, I can click on them, but I can't see them.
>
> Do I have to use some repainting ? Or should I use the new 2.1 version to
avoid that problem ?

Ware es moglich, dass du mir mal eine solche Datei sendest? Eigentlich durfte
es keine Ladeprobleme
geben, aber man wei? ja nie.

Schonen Abend noch und

Ciao, Mike


re: Hint Animations

From: "Mike Lischke" [public@l...]
Date: Tue Apr 17, 2001 8:21 pm
Subject: RE: [VirtualTreeview] Hint Animations

> Secondly, if I click on some 'properties' (right now it works reliably with
> StringOptions.*) a transparent rectangle with thick white border is drawn at
> the top left corner of my desktop. It just flashes a moment and is gone.
> Don't know what that is but thought you might want to know.

Mmmh, I did not notice this on my office machine (which is much slower than
what I have at home).
Here I saw this effect too and I'm quite sure that this is the hidden drop down
window (the tree
popup) of the tree combo boxes which flashes for a nanosecond. I'll investigate
this tomorrow.

Ciao, Mike


Provocative Property Inspector

From: [adembaba@e...]
Date: Tue Apr 17, 2001 10:29 pm
Subject: Provocative Property Inspector

Mike,

I have no idea whether you will release the source for
PI demo, but it sure is great --no. more than that provocative.

The question I have has nothing to do with VT, but I will ask
it all the same, is it possible display the bitmap that
Delphi displays in its component palette?

Cheers,

 | Replies | Author | Date
1256 | Re: Provocative Property Inspector | Mike Lischke | Wed 4/18/2001
1261 | Re: Provocative Property Inspector | [adembaba@e...] | Wed 4/18/2001
1263 | Re: Provocative Property Inspector | Bender Heri | Thu 4/19/2001
1276 | Re: Provocative Property Inspector | Jonx | Thu 4/19/2001


VTExplorer --small quirk?

From: [adembaba@e...]
Date: Tue Apr 17, 2001 11:13 pm
Subject: VTExplorer --small quirk?

Hi,

I have been playing around vith VTE and I simply love it.

I have, however, noticed that when I click on 'Shecuded Tasks'
under Control Panel, I get a '??????|?x8?????' string for
name row in IShellDetails tab in the Demo that accompanies
VTE. I get a similar gibberish for 'creator' for the same
thing.

I have not seen anything odd other than 'Shecuded Tasks'
thing.

BTW, I am using Win2KPro(SP1) + D5.01

Cheers,

 | Replies | Author | Date
1254 | Re: VTExplorer --small quirk? | Jim Kueneman | Wed 4/18/2001


re: VTExplorer --small quirk?

From: "Jim Kueneman" [jimdk@m...]
Date: Wed Apr 18, 2001 3:30 am
Subject: Re: VTExplorer --small quirk?

--- In [VirtualTreeview@y...], [adembaba@e...] wrote:
> I have, however, noticed that when I click on 'Shecuded Tasks'
> under Control Panel, I get a '??????|?x8?????' string for
> name row in IShellDetails tab in the Demo that accompanies
> VTE. I get a similar gibberish for 'creator' for the same
> thing.

I have seen that too. I have done some work on TNamespace (changed to
widestrings among a few other things) and it appears to be working
now. I will upload a new version in a day or two.

Jim


re: NotifyEvent OnCreateEditor under BCB5

From: "Roland" [Beduerftig@S...]
Date: Wed Apr 18, 2001 7:04 am
Subject: Re: NotifyEvent OnCreateEditor under BCB5

Hi,

> The main problem is that:
> ......
> ......
>
> This solves the problem:
> 1. Change the declaration for the event handler as follows
> (both in HPP and CPP files)
> ...IVTEditLink ** EditLink
> IDE will not notice this change.
> 2. Write code like this:
> .....

We cannot modify the HPP and CPP files because they will autocreated
when we compile VT, that was the reason why I have try to find a way
to do this in Delphi. In the other way we have 2 source-codes one for
Delphi and a smaller one addional for BCB.

I think the last message from Mike is the better way, VT is the basic
source and when we need an other construction for OwnEditor it is
better to build in to Delphi code.

with best regards
Roland

 | Replies | Author | Date
1260 | Re: NotifyEvent OnCreateEditor under BCB5 | Alexander Egorushkin | Wed 4/18/2001


re: Provocative Property Inspector

From: Mike Lischke [public@l...]
Date: Wed Apr 18, 2001 10:45 am
Subject: RE: [VirtualTreeview] Provocative Property Inspector

Adem,

> I have no idea whether you will release the source for
> PI demo, but it sure is great --no. more than that provocative.

Sorry, I cannot publish the source for the simple reason that PI uses a lot
of our inhouse stuff (taken everything together it is now a 80K lines
project of which the main form only uses ~200 to fill the tree).
Additionally I don't have the right to publish it since it is not mine, I
only wrote it.

> The question I have has nothing to do with VT, but I will ask
> it all the same, is it possible display the bitmap that
> Delphi displays in its component palette?

I don't understand. Do you mean how to extract the component images from a
*.dcr file and display them somewhere?

Ciao, Mike

 | Replies | Author | Date
1261 | Re: Provocative Property Inspector | [adembaba@e...] | Wed 4/18/2001


re: Hint Animations

From: "Jim Kueneman" [jimdk@m...]
Date: Wed Apr 18, 2001 1:18 pm
Subject: Re: Hint Animations

--- In [VirtualTreeview@y...], Mike Lischke [public@l...] wrote:

> Jim, what happens? On my side here everything is still fine. If you
don't
> mind to try out a pure executable then download the object inspector

I figured it out Mike. My new machine is too fast for your
animations. I noticed while doing a lot of background processing that
the animations were clearly working so I went into
TVirtualTreeHintWindow.ActivateHint and set the Sleep(1) to Sleep(10)
and now they clearly work!

I guess time is variable to Windows <g>. I am not sure how to handle
this except to make the time a property and make it user configurable
in the final program?

Jim


re: Re: Hint Animations

From: Bender Heri [HBender@E...]
Date: Wed Apr 18, 2001 1:32 pm
Subject: RE: [VirtualTreeview] Re: Hint Animations

> -----Original Message-----
> From: Jim Kueneman [mailto:[jimdk@m...]]
> Sent: Wednesday, April 18, 2001 3:18 PM
> To: VirtualTreeview@yahoogroups.com
> Subject: [VirtualTreeview] Re: Hint Animations
>
> TVirtualTreeHintWindow.ActivateHint and set the Sleep(1) to Sleep(10)
> and now they clearly work!
>
> I guess time is variable to Windows <g>.

This is strange. In annother project I did a lot of finetuning in a listener
thread (listening to sockets). There I watched no difference if I call
sleep(1) or sleep(10). Windows always returned only after about 10 mSecs.
My system: NT 4.0 SP6, Intel 500 PIII.
Maybe it has to do with the fact if other threads are working or not?

Heri

 | Replies | Author | Date
1259 | Re: Hint Animations | Jim Kueneman | Wed 4/18/2001


re: Hint Animations

From: "Jim Kueneman" [jimdk@m...]
Date: Wed Apr 18, 2001 2:03 pm
Subject: Re: Hint Animations

--- In [VirtualTreeview@y...], Bender Heri [HBender@E...] wrote:

>
> This is strange. In annother project I did a lot of finetuning in a
listener
> thread (listening to sockets). There I watched no difference if I
call
> sleep(1) or sleep(10). Windows always returned only after about 10
mSecs.
> My system: NT 4.0 SP6, Intel 500 PIII.
> Maybe it has to do with the fact if other threads are working or
not?

I know. I never thought you would get anything any less than about
50ms so it should not matter. My new machine is not the latest and
greatest, PIII 733 with Win2k 256Meg P133 Ram, but it is obviously too
fast for 1ms delays to be visible. My guess is that it is the video
speed that is the difference. You eye could not detect 1ms or 10ms so
the real delay is getting the image outputted to the screen. My new
machine is an ASUS CUSL2 with the on board Intel AGP video card. It
is fast. In VET with the images threaded if there are less than 20
files in a folder I can not see the the default images shown then the
correct images replacing them. It just appear as though they were the
correct images from the start. My 300Mhz at work you can clearly see
the image is being replaced even for a couple of files.

Jim


re: Re: NotifyEvent OnCreateEditor under BCB5

From: "Alexander Egorushkin" [egorushkin@m...]
Date: Wed Apr 18, 2001 5:57 pm
Subject: RE: [VirtualTreeview] Re: NotifyEvent OnCreateEditor under BCB5

Hello,

> > The main problem is that:
> > ......
> > ......
> >
> > This solves the problem:
> > 1. Change the declaration for the event handler as follows
> > (both in HPP and CPP files)
> > ...IVTEditLink ** EditLink
> > IDE will not notice this change.
> > 2. Write code like this:
Sorry, it was too ambiguous. Do not change the header for VT, but change
the code in YOUR form, from IVTEditLink* EditLink to IVTEditLink**
EditLink.IDE will not notice the change. Make this change in YOUR unit if
you want to use your own EditLink. To implement delphi interfaces is as easy
as implement other COM interfaces (may be more easier because it is not
necessary to deal with TLB). An example will be at the week-end.
So, I think Mike shouldn't rewrite the code.

Alex

> > .....
>
> We cannot modify the HPP and CPP files because they will autocreated
> when we compile VT, that was the reason why I have try to find a way
> to do this in Delphi. In the other way we have 2 source-codes one for
> Delphi and a smaller one addional for BCB.
>
> I think the last message from Mike is the better way, VT is the basic
> source and when we need an other construction for OwnEditor it is
> better to build in to Delphi code.
>
> with best regards
> Roland
>
>
>
> To unsubscribe from this group, send an email to:
> VirtualTreeview-unsubscribe@egroups.com
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>
>


re: Provocative Property Inspector

From: [adembaba@e...]
Date: Wed Apr 18, 2001 9:49 pm
Subject: Re: Provocative Property Inspector

Mike,

> > I have no idea whether you will release the source for
> > PI demo, but it sure is great --no. more than that provocative.
>
> Sorry, I cannot publish the source for the simple reason that
> PI uses a lot of our inhouse stuff (taken everything together
> it is now a 80K lines project of which the main form only
> uses ~200 to fill the tree). Additionally I don't have the
> right to publish it since it is not mine, I only wrote it.

Fully respected.

> > The question I have has nothing to do with VT, but I will ask
> > it all the same, is it possible display the bitmap that
> > Delphi displays in its component palette?
>
> I don't understand. Do you mean how to extract the component
> images from a *.dcr file and display them somewhere?

Yes to both. I.e. how do I extract images from a *.dcr file;
and it would be nice for your PI to display them in the
Combo/List/TreeBox at its top.

Cheers,


FAQ: Show Hint only when ShortenString

From: "Roland" [Beduerftig@S...]
Date: Thu Apr 19, 2001 7:47 am
Subject: FAQ: Show Hint only when ShortenString

Hi,

I have a question for the FAQ sites, it not a bug in VT.

The problem is:

I have a database for products and I want show the settings of the
products in a property sheet like as the object inspector in the IDE.
With VT is this no problem, in the Column_0 will shown the
description and in the Column_1 with an OwnEditor the values but the
screen is to small for both columns to show complet, and the user
must resize the columns.

Now the question:

Nice to have is an option like "ShowHintOnlyOnShorten", it means the
Hint on Column_0 will be shown only when the string in this column is
shorten.
With this feature the user can resize Column_0 small, and how he see
Column_1 complet and with the Hint he can see the complet description
from Column_0, when he needed.
How can I implement this feature (ShowHintOnlyOnShorten) with VT ?

with best regards
Roland

 | Replies | Author | Date
1272 | Re: FAQ: Show Hint only when ShortenString | Mike Lischke | Thu 4/19/2001
1275 | Re: FAQ: Show Hint only when ShortenString | Roland | Thu 4/19/2001


re: Re: Provocative Property Inspector

From: Bender Heri [HBender@E...]
Date: Thu Apr 19, 2001 8:21 am
Subject: RE: [VirtualTreeview] Re: Provocative Property Inspector

> -----Original Message-----
> From: [adembaba@e...] [mailto:[adembaba@e...]]
> Sent: Wednesday, April 18, 2001 11:50 PM
> To: VirtualTreeview@yahoogroups.com
> Subject: [VirtualTreeview] Re: Provocative Property Inspector

> Yes to both. I.e. how do I extract images from a *.dcr file;
> and it would be nice for your PI to display them in the
> Combo/List/TreeBox at its top.

I suspect a *.dcr is a normal *.res file. If you change the extension to
*.res you can still open it in borlands image editor.
But I don't know how to extract the images programmatically.

Heri

 | Replies | Author | Date
1276 | Re: Provocative Property Inspector | Jonx | Thu 4/19/2001


re: Re: NotifyEvent OnCreateEditor under BCB5

From: Mike Lischke [public@l...]
Date: Thu Apr 19, 2001 8:23 am
Subject: RE: [VirtualTreeview] Re: NotifyEvent OnCreateEditor under BCB5

Alexander,

> Sorry, it was too ambiguous. Do not change the header for
> VT, but change
> the code in YOUR form, from IVTEditLink* EditLink to IVTEditLink**
> EditLink.IDE will not notice the change. Make this change in
> YOUR unit if
> you want to use your own EditLink. To implement delphi
> interfaces is as easy
> as implement other COM interfaces (may be more easier because
> it is not
> necessary to deal with TLB). An example will be at the week-end.
> So, I think Mike shouldn't rewrite the code.

What advantage would we have when keeping the current approach? Can you give
me a good reason not to change the interface to a normal class? I'm going to
change this today but I will wait for your answer (or one from other members
here if somebody is able to come up with a good argument).

Ciao, Mike

 | Replies | Author | Date
1274 | Re: NotifyEvent OnCreateEditor under BCB5 | Roland | Thu 4/19/2001
1280 | Re: NotifyEvent OnCreateEditor under BCB5 | Alexander Egorushkin | Thu 4/19/2001
1282 | Re: NotifyEvent OnCreateEditor under BCB5 | [tias@m...] | Thu 4/19/2001
1284 | Re: NotifyEvent OnCreateEditor under BCB5 | Alexander Egorushkin | Thu 4/19/2001
1286 | Re: NotifyEvent OnCreateEditor under BCB5 | [tias@m...] | Fri 4/20/2001


re: DeleteNode vs DoFreeNode

From: Mike Lischke [public@l...]
Date: Thu Apr 19, 2001 9:21 am
Subject: RE: [VirtualTreeview] DeleteNode vs DoFreeNode

Hi Tony,

> if vsInitialized in Mark.States then \
> DeleteNode(Mark) \
> else > Lines
> affected by temp fix
> DoFreeNode(Mark); /
> end; /
>
> Now, if I force it to always call DeleteNode, no EIntOverflow.

I have again looked through the code to find out what could be wrong there.
Although I cannot see how your fix does influence the visible count I have
changed it to what you did as fix because it is more consistent so and there
might be a multi selection problem under some circumstances otherwise.
Additionally, it does not seem to have any significant influence on the
deletion time.

The problem I posted when I answered this question the first was not a real
problem. This is all meanwhile very sophisticated interlocked and there are
checks already not to do any superfluous actions. I confused myself :o]

Ciao, Mike


re: Images and RowSelect

From: Mike Lischke [public@l...]
Date: Thu Apr 19, 2001 9:45 am
Subject: RE: [VirtualTreeview] Images and RowSelect

Kostas,

> Maybe it needs more thought, if a node is highlighted and
> voFullRowSelect is
> True then maybe you should not use ILD_BLEND50 because the
> image looks very
> dark...

Changed. Including the check for full row select. Indeed the images are
nearly invisible depending on their content and the selection color.

Ciao, Mike


re: OLEFormats and OnCreateDragManager

From: Mike Lischke [public@l...]
Date: Thu Apr 19, 2001 9:49 am
Subject: RE: [VirtualTreeview] OLEFormats and OnCreateDragManager

Kostas,

> so that SetOLEFormats does not necessarily create the drop
> manager, but sets
> its OLEFormats only if it *has* been created.

Thank you for this hint too. Indeed there should be a check not only about
whether there is a drag manager but also whether the component is currently
being loaded. When the drag manager is created then it will also set the
currently enabled OLE formats so everything will work fine.

Ciao, Mike


re: Re: Hint Animations

From: Mike Lischke [public@l...]
Date: Thu Apr 19, 2001 10:37 am
Subject: RE: [VirtualTreeview] Re: Hint Animations

> I figured it out Mike. My new machine is too fast for your
> animations. I noticed while doing a lot of background
> processing that the animations were clearly working so I went into
> TVirtualTreeHintWindow.ActivateHint and set the Sleep(1) to Sleep(10)
> and now they clearly work!
>
> I guess time is variable to Windows <g>. I am not sure how to handle
> this except to make the time a property and make it user configurable
> in the final program?

Well, I will change the implemenation. Since there are requests to including
time limits for animations I have to check this anyway, so I can synchronize
the hint animation as well.

Ciao, Mike


New poll for VirtualTreeview

From: [VirtualTreeview@yahoogroups.com
Date: Thu Apr 19, 2001 10:56 am
Subject: New poll for VirtualTreeview

Enter your vote today! A new poll has been created for the
VirtualTreeview group:

Due to discussions in other mailing
lists I want to know what you think
about the mailing list subject tag.

o Keep [Virtual Treeview]
o Use [VT]
o Use another one (mail me your suggestion)
o Omit the tag completely

To vote, please visit the following web page:

http://groups.yahoo.com/group/VirtualTreeview/polls

Note: Please do not reply to this message. Poll votes are
not collected via email. To vote, you must go to the Yahoo! Groups
web site listed above.

Thanks!

 | Replies | Author | Date
1909 | New poll for VirtualTreeview | [VirtualTreeview@y...] | Mon 5/21/2001
2808 | New poll for VirtualTreeview | VirtualTreeview@y...] | Sun 7/1/2001
2810 | Re: New poll for VirtualTreeview | Mike Lischke | Sun 7/1/2001


Drag & Drop

From: GIANNAKOPOULOS KOSTAS [kyan@s...]
Date: Thu Apr 19, 2001 10:59 am
Subject: Drag & Drop

Good afternoon Mike.

A hint for drag&drop images:

In Windows 2000 it is possible to use a special Shell object named
"drag-image manager" and have it draw the drag images for you.

This object (with classid CLSID_DragDropHelper) exposes 2 interfaces:
IDragSourceHelper and IDropTargetHelper.
You use IDragSourceHelper when you want to specify the image that will be
displayed during a shell drag-drop operation and IDropTargetHelper to have
the drag-image manager display the drag image for you while the image is
over your window.

I haven't tested these but i suspect that if you call
IDragSourceHelper.InitializeFromWindow on your DataObject then any "shell
aware" window (e.g. the explorer) that uses IDropTargetHelper will display
the contents of your VT (like explorer does). And by using
IDropTargetHelper's methods in your IDataObject's corresponding methods you
can automatically have images drawn for you.

Here are the declarations of the interfaces from platform SDK's ShlGUID.h
and ShlObj.h. If you do not have a recent version of MSDN i could send you
the relative pages.

// {4657278A-411B-11d2-839A-00C04FD918D0}
DEFINE_GUID(CLSID_DragDropHelper, 0x4657278a, 0x411b, 0x11d2, 0x83, 0x9a,
0x0, 0xc0, 0x4f, 0xd9, 0x18, 0xd0);

// {DE5BF786-477A-11d2-839D-00C04FD918D0}
DEFINE_GUID(IID_IDragSourceHelper, 0xde5bf786, 0x477a, 0x11d2, 0x83, 0x9d,
0x0, 0xc0, 0x4f, 0xd9, 0x18, 0xd0);

DECLARE_INTERFACE_( IDragSourceHelper, IUnknown )
{
// IUnknown methods
STDMETHOD (QueryInterface)(THIS_ REFIID riid, void **ppv) PURE;
STDMETHOD_(ULONG, AddRef) ( THIS ) PURE;
STDMETHOD_(ULONG, Release) ( THIS ) PURE;

// IDragSourceHelper
STDMETHOD (InitializeFromBitmap)(THIS_ LPSHDRAGIMAGE pshdi,
IDataObject* pDataObject) PURE;
STDMETHOD (InitializeFromWindow)(THIS_ HWND hwnd, POINT* ppt,
IDataObject* pDataObject) PURE;
};

// {4657278B-411B-11d2-839A-00C04FD918D0}
DEFINE_GUID(IID_IDropTargetHelper, 0x4657278b, 0x411b, 0x11d2, 0x83, 0x9a,
0x0, 0xc0, 0x4f, 0xd9, 0x18, 0xd0);

DECLARE_INTERFACE_( IDropTargetHelper, IUnknown )
{
// IUnknown methods
STDMETHOD (QueryInterface)(THIS_ REFIID riid, void **ppv) PURE;
STDMETHOD_(ULONG, AddRef) ( THIS ) PURE;
STDMETHOD_(ULONG, Release) ( THIS ) PURE;

// IDropTargetHelper
STDMETHOD (DragEnter)(THIS_ HWND hwndTarget, IDataObject* pDataObject,
POINT* ppt, DWORD dwEffect) PURE;
STDMETHOD (DragLeave)(THIS) PURE;
STDMETHOD (DragOver)(THIS_ POINT* ppt, DWORD dwEffect) PURE;
STDMETHOD (Drop)(THIS_ IDataObject* pDataObject, POINT* ppt,
DWORD dwEffect) PURE;
STDMETHOD (Show)(THIS_ BOOL fShow) PURE;

};

<KY>

 | Replies | Author | Date
1291 | Re: Drag & Drop | Mike Lischke | Fri 4/20/2001
1294 | Re: Drag & Drop | GIANNAKOPOULOS KOSTAS | Fri 4/20/2001
1311 | Re: Drag & Drop | Mike Lischke | Fri 4/20/2001
1312 | Re: Drag & Drop | GIANNAKOPOULOS KOSTAS | Fri 4/20/2001
1313 | Re: Drag & Drop | Jim Kueneman | Fri 4/20/2001
1325 | Re: Drag & Drop | Mike Lischke | Sat 4/21/2001
1330 | Re: Drag & Drop | Werner Lehmann | Sat 4/21/2001
1332 | Re: Drag & Drop | Mike Lischke | Sat 4/21/2001
1334 | Re: Drag & Drop | Vadim Sedulin | Sat 4/21/2001


re: Re: Hint Animations

From: Mike Lischke [public@l...]
Date: Thu Apr 19, 2001 11:09 am
Subject: RE: [VirtualTreeview] Re: Hint Animations

Heri,

> This is strange. In annother project I did a lot of
> finetuning in a listener
> thread (listening to sockets). There I watched no difference if I call
> sleep(1) or sleep(10). Windows always returned only after
> about 10 mSecs.
> My system: NT 4.0 SP6, Intel 500 PIII.
> Maybe it has to do with the fact if other threads are working or not?

AFAIK there are differences in the implementation and time resolution of NT
and 9x. The systems minimum resolution is about 55ms (1/18th second) but
with NT you can set is as low as 1ms. But as I already wrote, allowing to
set an upper limit for tree animations is an important feature and should
give me also the opportunity to control the hint animation speed.

Ciao, Mike


re: FAQ: Show Hint only when ShortenString

From: Mike Lischke [public@l...]
Date: Thu Apr 19, 2001 11:31 am
Subject: RE: [VirtualTreeview] FAQ: Show Hint only when ShortenString

Hi Roland,

> Nice to have is an option like "ShowHintOnlyOnShorten", it means the
> Hint on Column_0 will be shown only when the string in this column is
> shorten.
> With this feature the user can resize Column_0 small, and how he see
> Column_1 complet and with the Hint he can see the complet description
> from Column_0, when he needed.
> How can I implement this feature (ShowHintOnlyOnShorten) with VT ?

Well, the hint is only displayed if there is actually something to display.
The text for the hint is retrieved from the application to allow node
specific hints. Hence you can use OnGetHint and return an empty string for
those node for which you don't want a hint. The other problem however is to
determine if a node's text fits into the available space. I recommend to
retrieve the display rectangle for the node containing only the text and set
the usually not externally used default parameter Unclipped to True. This
will return a rectangle whose right border you can check against the
column's right border and if it is greater than a hint should be shown. A
column's bounds can be retrieved using GetColumnAndBounds if you only have a
point in the tree or GetColumnBounds if you have a column index. The latter
is likely the one you can use in this case here.

Btw: this is the way how VT determines when to show a tooltip.

Ciao, Mike

 | Replies | Author | Date
1275 | Re: FAQ: Show Hint only when ShortenString | Roland | Thu 4/19/2001


Multi-column treeview

From: "David E. Reksten" [der@d...]
Date: Thu Apr 19, 2001 11:46 am
Subject: Multi-column treeview

In my first application using VirtualTreeview, some questions arised:

1. Is it possible to left or right align the heading text in a multi-column
treeview?

2. Is it possible to right align og center the contents of a specific
column in the same treeview?

3. Is there a simple way of specifying text color for a specific column
heading?

Also, in a multi-column treeview with a vertical scrollbar there seems to
be a redrawing issue with the empty area to the right of the header, above
the scrollbar (in other words, the upper right of the component). I
frequently find artifacts there from other forms that have been either on
top of, or below the form containing the treeview.

None the less, my compliments on a fantastic component!

Btw, I'm using Delphi 5.1 Enterprise and the version of VirtualTreeview
currently available from your web page.

Best regards,
.david

 | Replies | Author | Date
1300 | Re: Multi-column treeview | Mike Lischke | Fri 4/20/2001


re: NotifyEvent OnCreateEditor under BCB5

From: "Roland" [Beduerftig@S...]
Date: Thu Apr 19, 2001 12:11 pm
Subject: Re: NotifyEvent OnCreateEditor under BCB5

Hi Mike and Alexander,

> change this today but I will wait for your answer
> (or one from other members
> here if somebody is able to come up with a good argument).

last week I have discus with about the interface, and I think the
interface is not the best way to implement the feature to use an own
editor with VT, a "normal" class seems easier to use.

In the last replies explain Alexander something how to use the
interface, with change the pointer "*" to "**" and then call AddRef()
double and so on ..... this is very interest for highest level
programming, but I think this is for the "normal" user a little bit
to high !!??

When Alexander show a demoprogram is this the best way to learn to
use interface under BCB, I ask many author from technical magazine
and nobody can't explain the use of an interface, but this show us
that also very difficult to use it.

with best regards
Roland


re: FAQ: Show Hint only when ShortenString

From: "Roland" [Beduerftig@S...]
Date: Thu Apr 19, 2001 12:25 pm
Subject: Re: FAQ: Show Hint only when ShortenString

Hi Mike,

> Btw: this is the way how VT determines when to show a tooltip.

Sorry it was my mistake ... I should answer by myself in the same
posting ... it wasn't a question, I think this example is good for
the FAQ site, because a new or other user of VT will also spend a lot
of time to find out what options must set, that this example will
work.

1. Create Event OnGetHint
2. fill in:
if (Column = 0) then Text := ... else Text := '';
3. Property ShowHint := true;
4. Property HintMode := hmToolTip;

this will work like as "ShowHintOnlyOnShorten" and only for the
description on the left side of the property sheet ( on the rigth
side is the own editor ! )

with best regards
Roland


re: Provocative Property Inspector

From: "Jonx" [knipjo@h...]
Date: Thu Apr 19, 2001 1:09 pm
Subject: Re: Provocative Property Inspector

Hi,

> I suspect a *.dcr is a normal *.res file. If you change the
extension to
> *.res you can still open it in borlands image editor.
Even without changing it.

> But I don't know how to extract the images programmatically.
Here is an expert that shows how to do it:
http://www.happytocode.com/delphi/samples/Expert,%20Get%20IDE%
20palette%20icons.zip

But I agree that this is only working inside of delphi...


VET Under Delphi

From: "Colin Meeks" [colin@p...]
Date: Thu Apr 19, 2001 3:44 pm
Subject: VET Under Delphi

I've just downloaded the new version of VT and all installs fine. I've also
tried to install VET, but I get the following errors:

[Error] Shell Utilities.pas Types of actual and formal var parameters must
be identical

The lines it appears on are 690, 695, 1256, 1261, 1567, 1572, 1590, 1595,
1611, 1616, 1632, 1637, 1671, 1676, 1710, 1715

I'm trying to compile this under Delphi 4, does anybody have any ideas.
I've looked at the VET demo and it is exactly what I was trying to achieve,
only a lot grander.

Regards

Colin

Programmed Integration
http://www.programmedintegration.com
Systems by Design

 | Replies | Author | Date
1278 | VET Under Delphi | Colin Meeks | Thu 4/19/2001
1279 | Re: VET Under Delphi | Jim Kueneman | Thu 4/19/2001
1283 | Re: VET Under Delphi | Colin Meeks | Thu 4/19/2001
1287 | Re: VET Under Delphi | Jim Kueneman | Fri 4/20/2001


VET Under Delphi

From: "Colin Meeks" [colin@p...]
Date: Thu Apr 19, 2001 3:44 pm
Subject: [VirtualTreeview] VET Under Delphi

I've just downloaded the new version of VT and all installs fine. I've also
tried to install VET, but I get the following errors:

[Error] Shell Utilities.pas Types of actual and formal var parameters must
be identical

The lines it appears on are 690, 695, 1256, 1261, 1567, 1572, 1590, 1595,
1611, 1616, 1632, 1637, 1671, 1676, 1710, 1715

I'm trying to compile this under Delphi 4, does anybody have any ideas.
I've looked at the VET demo and it is exactly what I was trying to achieve,
only a lot grander.

Regards

Colin

Programmed Integration
http://www.programmedintegration.com
Systems by Design

To unsubscribe from this group, send an email to:
VirtualTreeview-unsubscribe@egroups.com

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/

 | Replies | Author | Date
1279 | Re: VET Under Delphi | Jim Kueneman | Thu 4/19/2001


re: VET Under Delphi

From: "Jim Kueneman" [jimdk@m...]
Date: Thu Apr 19, 2001 5:02 pm
Subject: Re: VET Under Delphi

--- In [VirtualTreeview@y...], "Colin Meeks" [colin@p...] wrote:

> The lines it appears on are 690, 695, 1256, 1261, 1567, 1572, 1590,
1595,
> 1611, 1616, 1632, 1637, 1671, 1676, 1710, 1715

Opps, sorry.

Just go to those lines and you will see something like:

ParentShellFolder.GetUIObjectOf(Application.Handle, 1, FRelativePIDL,
IDropTarget, nil, FDropTargetInterface) = NOERROR;

Take the last parameter and typecast it to a pointer:

pointer(FDropTargetInterface)

It then should compile. D4 did not declare the COM interfaces
correctly

Jim


re: Re: NotifyEvent OnCreateEditor under BCB5

From: "Alexander Egorushkin" [egorushkin@m...]
Date: Thu Apr 19, 2001 5:38 pm
Subject: RE: [VirtualTreeview] Re: NotifyEvent OnCreateEditor under BCB5

Hi, Mike!
>
> What advantage would we have when keeping the current approach?
> Can you give
> me a good reason not to change the interface to a normal class?
> I'm going to
> change this today but I will wait for your answer (or one from
> other members
> here if somebody is able to come up with a good argument).

Arguments PRO:
You have already written the perfect code that allows Delphi users to
create and provide their own editors. Lots of Delphi users (it's the
majority of the group) use code which is based on the assumption that
IVTEditLink is an interface. But only two C++ Builder users (Ronald and me)
have some problems when creating editors. Now I know how to deal with Delphi
interfaces, so I can provide an example and Ronald may just copy it.
There is no such thing as abstract base class in Delphi. But there is a
built in support for interfaces instead it. It's true that C++ is a bit
harder to use then Delphi, in C++ one must use 'new' operator for VCL
classes. But nobody complains about it. C++ hasn't got built in support for
interfaces, so one must provide implementation of IUnknown - it is not more
difficult than to use 'new'.
So, Mike, your word is the final one.

Ronald: > I ask many author from technical magazine
> and nobody can't explain the use of an interface, but this show us
> that also very difficult to use it.
It's the blame of Borland Inprise. They provide no help on how to use ATL
and implement interfaces in BCB. Microsoft Visual Studio has the perfect
help system on the subject, so unfortunately when I deal with COM I have to
use VC++.

Alex.

 | Replies | Author | Date
1282 | Re: NotifyEvent OnCreateEditor under BCB5 | [tias@m...] | Thu 4/19/2001
1284 | Re: NotifyEvent OnCreateEditor under BCB5 | Alexander Egorushkin | Thu 4/19/2001
1286 | Re: NotifyEvent OnCreateEditor under BCB5 | [tias@m...] | Fri 4/20/2001


VET & BCB5

From: [tias@m...]
Date: Thu Apr 19, 2001 6:15 pm
Subject: VET & BCB5

Hi !

When I'm (re)compiling ShellUtilities.pas (included with the VET
source) under BCB5 (+ the patch), I get errors (E2303 Type name
expected) in the autogenerated ShellUtilities.hpp in the declaration
of the TNamespace class :
_di_IDropTarget FDropTargetInterface;
_di_IContextMenu3 FContextMenu3Interface;
_di_IQueryInfo FQueryInfoInterface;
and all references to these (eg Get-routines).
The only way for me to get rid of the errors is to comment these out
(total of 9 lines).
Obviously BCB5 doesn't find any declarations of these names in any
header file :-(

Also, the lines
static const Shortint IEIFLAG_ASYNC = 0x1;
static const Shortint IEIFLAG_CACHE = 0x2;
static const Shortint IEIFLAG_ASPECT = 0x4;
static const Shortint IEIFLAG_OFFLINE = 0x8;
static const Shortint IEIFLAG_GLEAM = 0x10;
static const Shortint IEIFLAG_SCREEN = 0x20;
static const Shortint IEIFLAG_ORIGSIZE = 0x40;

Gives me the error "E2040 Declaration terminated incorrectly."
My fix is to comment these lines out as well...
I've seen this a long time ago (also in a autogenerated .hpp-file)
where the identifers where declared in some other hpp file as well.
Then I managed to change the .pas file so those identifiers were not
made visible in the hpp-file, but this was more than a year ago, so I
do not remember how I did it. I'm getting old... :)

Has anyone else seen this in BCB5 and if so, found a better solution
to fix it ?

TIA
Mathias Thorell

 | Replies | Author | Date
1290 | Re: VET & BCB5 | Mike Lischke | Fri 4/20/2001
1308 | Re: VET & BCB5 | [tias@m...] | Fri 4/20/2001


re: NotifyEvent OnCreateEditor under BCB5

From: [tias@m...]
Date: Thu Apr 19, 2001 6:19 pm
Subject: Re: NotifyEvent OnCreateEditor under BCB5

--- In [VirtualTreeview@y...], "Alexander Egorushkin" [egorushkin@m...]
wrote:
<snip>

> IVTEditLink is an interface. But only two C++ Builder users (Ronald
and me)

<snip>

Make that three of us, but I had to give up about two months ago...

/Mathias Thorell

 | Replies | Author | Date
1284 | Re: NotifyEvent OnCreateEditor under BCB5 | Alexander Egorushkin | Thu 4/19/2001
1286 | Re: NotifyEvent OnCreateEditor under BCB5 | [tias@m...] | Fri 4/20/2001


re: Re: VET Under Delphi

From: "Colin Meeks" [colin@p...]
Date: Thu Apr 19, 2001 7:11 pm
Subject: Re: [VirtualTreeview] Re: VET Under Delphi

Thanks Jim, worked a treat. I also had to replace FreeAndNil and do it the
long way as it doesn;t seem to be part of Delphi 4, but it works great. I
have just a couple of suggestions though.

1. Is it possible to view just files in a given directory without the other
threads. I want to have a pane with just file names in it and nothing else,
giving the user no opportunity to see foldsers or the thread lines.

2. How do I set the widths of the Colums??

3. How can I filter on an extentions, i.e. mp3

4. When you right click on a file, you don't have an option to rename it, is
it possible to do??

Many thanks in advance.

Colin

----- Original Message -----
From: "Jim Kueneman" [jimdk@m...]
To: [VirtualTreeview@yahoogroups.com>
Sent: Thursday, April 19, 2001 1:02 PM
Subject: [VirtualTreeview] Re: VET Under Delphi

> --- In [VirtualTreeview@y...], "Colin Meeks" <colin@p...] wrote:
>
> > The lines it appears on are 690, 695, 1256, 1261, 1567, 1572, 1590,
> 1595,
> > 1611, 1616, 1632, 1637, 1671, 1676, 1710, 1715
>
> Opps, sorry.
>
> Just go to those lines and you will see something like:
>
> ParentShellFolder.GetUIObjectOf(Application.Handle, 1, FRelativePIDL,
> IDropTarget, nil, FDropTargetInterface) = NOERROR;
>
> Take the last parameter and typecast it to a pointer:
>
> pointer(FDropTargetInterface)
>
> It then should compile. D4 did not declare the COM interfaces
> correctly
>
> Jim
>
>
>
>
>
> To unsubscribe from this group, send an email to:
> VirtualTreeview-unsubscribe@egroups.com
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>
>

 | Replies | Author | Date
1287 | Re: VET Under Delphi | Jim Kueneman | Fri 4/20/2001


re: Re: NotifyEvent OnCreateEditor under BCB5

From: "Alexander Egorushkin" [egorushkin@m...]
Date: Thu Apr 19, 2001 7:43 pm
Subject: RE: [VirtualTreeview] Re: NotifyEvent OnCreateEditor under BCB5

Sorry, Mathias,
three men - it's team :)
What do you think about Delphi interfaces in BCB?

Alex.

> -----Original Message-----
> From: [tias@m...] [mailto:[tias@m...]]
> Sent: Thursday, April 19, 2001 10:20 PM
> To: [VirtualTreeview@yahoogroups.com
> Subject: [VirtualTreeview] Re: NotifyEvent OnCreateEditor under BCB5
>
>
> --- In [VirtualTreeview@y...], "Alexander Egorushkin" [egorushkin@m...]
> wrote:
> <snip>
>
> > IVTEditLink is an interface. But only two C++ Builder users (Ronald
> and me)
>
> <snip>
>
> Make that three of us, but I had to give up about two months ago...
>
> /Mathias Thorell
>
>
>
>
> To unsubscribe from this group, send an email to:
> VirtualTreeview-unsubscribe@egroups.com
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>
>

Replies Author Date


Quick bug

From: "Anthony Mills" [amills@m...]
Date: Fri Apr 20, 2001 3:56 am
Subject: Quick bug

Mike,

If you have images shown, then select stuff, then focus elsewhere, the
text's selection is gone (good) but the graphic is still 'selected'.

Tony

 | Replies | Author | Date
1305 | Re: Quick bug | Mike Lischke | Fri 4/20/2001


re: NotifyEvent OnCreateEditor under BCB5

From: [tias@m...]
Date: Thu Apr 19, 2001 9:24 pm
Subject: Re: NotifyEvent OnCreateEditor under BCB5

--- In [VirtualTreeview@y...], "Alexander Egorushkin" [egorushkin@m...]
wrote:
> Sorry, Mathias,

Don't worry ! ;-)

> three men - it's team :)

Heh, and maybe still counting.. (?)

> What do you think about Delphi interfaces in BCB?

Not much to say. I tried it with VirtualTreeView, screamed a few
times, scratched my head and forgot all about it since I couldn't
find any suitable documentation & the hpp-files didn't help me either.
I had to choose a completly different design in a project, but now
that is working, so I don't want to get involved with the COM stuff
again, whatsoever... ;-)

Otherwise I think that Delphi interfaces (with that I reffer to
components written in Delphi Pascal) is working surprisingly good.

/Mathias


re: VET Under Delphi

From: "Jim Kueneman" [jimdk@m...]
Date: Fri Apr 20, 2001 5:29 am
Subject: Re: VET Under Delphi

--- In [VirtualTreeview@y...], "Colin Meeks" [colin@p...] wrote:
> Thanks Jim, worked a treat. I also had to replace FreeAndNil and do
>
> 1. Is it possible to view just files in a given directory without
the other
> threads. I want to have a pane with just file names in it and
nothing else,
> giving the user no opportunity to see foldsers or the thread lines.

Not right now. It is in the plans for the future. I have not
decided the best way to do it.

>
> 2. How do I set the widths of the Colums??

For now go to the TCustomVirtualExplorerTree and add this:

public
property Header;

an recompile the package

Now you can use

VirtualExplorerTree1.Header.Columns[0].Width := 300;

Again eventually it will be done in the Object Inspector.

>
> 3. How can I filter on an extentions, i.e. mp3

Again in VirtualExplorerTree.pas add this

TVETOnEnumFolder = procedure(Sender: TCustomVirtualExplorerTree;
Namespace: TNamespace; var AllowAsChild: Boolean) of object;

TCustomVirtualExplorerTree = class(TCustomVirtualStringTree)
private
...
FOnEnumFilter: TVETOnEnumfolder;
...
published
...
property OnEnumFolder: TVETOnEnumFolder read FOnEnumFilter write
FOnEnumFilter;
...
end;

TVirtualExplorerTree = class(TCustomVirtualExplorerTree)
published
...
property OnEnumFolder;
...
end;

Replace the EnumerateFolderCallBack with this:

procedure TCustomVirtualExplorerTree.EnumerateFolderCallback(
APIDL: PItemIDList; AParent: TNamespace; Data: pointer);
{ This is what the TNamespace objects callback when they are
enumerating a folder. }
var
NewNodeData: PNodeData;
Allow: Boolean;
NS: TNamespace;
begin
if Assigned(OnEnumFolder) then
begin
NS := TNamespace.Create(APIDL, AParent);
Allow := True;
OnEnumFolder(Self, NS, Allow);
if Allow then
begin
NewNodeData := InternalData(AddChild(Data));
if Assigned(NewNodeData) then
NewNodeData.Namespace := NS;
end else
NS.Free
end else
begin
NewNodeData := InternalData(AddChild(Data));
if Assigned(NewNodeData) then
NewNodeData.Namespace := TNamespace.Create(APIDL, AParent);
end;
end;

Now in the event you can use any of the TNamespace properties or
functions to decide if you want to include it in the childlist. (
thanks to Mathias Thorell for the idea, I changed it slightly so if
the event is not defined then the performance hit is only a jump, this
approach may have an advantage over Mathias's code from a few days
ago, but not much)

>
> 4. When you right click on a file, you don't have an option to
rename it, is
> it possible to do??

I think Explorer uses a hack to do this. I know how to do it, and I
have, but there are other more pressing basic things to work on right
now for VET. (Translation, I don't remember where I did it and don't
think I can find it easily <g>)

I was afraid VET that it would become a snowball rolling down a hill
<g> Displaying the namespace is great but VET did not have much
implemented to interact with it and now a few want to actually use it
for something useful and not just a demo to showoff Mikes VT. Be
patient I will keep try to keep working on it and porting over my
TTreeview / TListview Explorer components as I get time and energy.

Comments and suggestions are welcome though.

Jim


[no subject]

From: [colin@p...]
Date: Fri Apr 20, 2001 7:00 am
Subject:

1 12:11:40 -0700
Message-ID: [001501c0c904$8b09a090$42d32a18@c...]
To: [VirtualTreeview@yahoogroups.com>
References: [9bn5mi+lq59@e...]
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 5.50.4133.2400
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400
From: "Colin Meeks" [colin@p...]
MIME-Version: 1.0
Mailing-List: list [VirtualTreeview@yahoogroups.com; contact
[VirtualTreeview-owner@yahoogroups.com
Delivered-To: mailing list VirtualTreeview@yahoogroups.com
Precedence: bulk
List-Unsubscribe: <mailto:VirtualTreeview-unsubscribe@yahoogroups.com>
Date: Thu, 19 Apr 2001 15:11:30 -0400
Reply-To: VirtualTreeview@yahoogroups.com
Subject: Re: [VirtualTreeview] Re: VET Under Delphi
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
X-UIDL: 464
Status: U

Thanks Jim, worked a treat. I also had to replace FreeAndNil and do it the
long way as it doesn;t seem to be part of Delphi 4, but it works great. I
have just a couple of suggestions though.

1. Is it possible to view just files in a given directory without the other
threads. I want to have a pane with just file names in it and nothing else,
giving the user no opportunity to see foldsers or the thread lines.

2. How do I set the widths of the Colums??

3. How can I filter on an extentions, i.e. mp3

4. When you right click on a file, you don't have an option to rename it, is
it possible to do??

Many thanks in advance.

Colin

----- Original Message -----
From: "Jim Kueneman" <jimdk@m...]
To: <VirtualTreeview@yahoogroups.com>
Sent: Thursday, April 19, 2001 1:02 PM
Subject: [VirtualTreeview] Re: VET Under Delphi

> --- In VirtualTreeview@y...], "Colin Meeks" <colin@p...] wrote:
>
> > The lines it appears on are 690, 695, 1256, 1261, 1567, 1572, 1590,
> 1595,
> > 1611, 1616, 1632, 1637, 1671, 1676, 1710, 1715
>
> Opps, sorry.
>
> Just go to those lines and you will see something like:
>
> ParentShellFolder.GetUIObjectOf(Application.Handle, 1, FRelativePIDL,
> IDropTarget, nil, FDropTargetInterface) = NOERROR;
>
> Take the last parameter and typecast it to a pointer:
>
> pointer(FDropTargetInterface)
>
> It then should compile. D4 did not declare the COM interfaces
> correctly
>
> Jim
>
>
>
>
>
> To unsubscribe from this group, send an email to:
> VirtualTreeview-unsubscribe@egroups.com
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>
>

To unsubscribe from this group, send an email to:
VirtualTreeview-unsubscribe@egroups.com

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/


re: Re: NotifyEvent OnCreateEditor under BCB5

From: Mike Lischke [public@l...]
Date: Fri Apr 20, 2001 7:41 am
Subject: RE: [VirtualTreeview] Re: NotifyEvent OnCreateEditor under BCB5

Hi Alex,

> Lots of Delphi users (it's the majority of the group) use code which is
based on the assumption that
> IVTEditLink is an interface. But only two C++ Builder users (Ronald and
me)
> have some problems when creating editors. Now I know how to
> deal with Delphi interfaces, so I can provide an example and Ronald may
just copy it.

Well, this is a good argument. Another one is that keeping the current
approach produces less work and (most important) less interface changes. So
I tend now to keep it. If anyone has arguments against the current solution
then speak now or be silent forever :o] (Hey, this is the new kind of
programming, let's call it: democratic programming ;-))

Ciao, Mike

 | Replies | Author | Date
1293 | Re: NotifyEvent OnCreateEditor under BCB5 | Roland | Fri 4/20/2001


re: VET & BCB5

From: Mike Lischke [public@l...]
Date: Fri Apr 20, 2001 7:42 am
Subject: RE: [VirtualTreeview] VET & BCB5

Mathias,

> When I'm (re)compiling ShellUtilities.pas (included with the VET
> source) under BCB5 (+ the patch), I get errors (E2303 Type name
> expected) in the autogenerated ShellUtilities.hpp in the declaration
> of the TNamespace class :
> _di_IDropTarget FDropTargetInterface;
> _di_IContextMenu3 FContextMenu3Interface;
> _di_IQueryInfo FQueryInfoInterface;

Try including #include <oleidl.h> for the standard interfaces.

Ciao, Mike

 | Replies | Author | Date
1308 | Re: VET & BCB5 | [tias@m...] | Fri 4/20/2001


re: Drag & Drop

From: Mike Lischke [public@l...]
Date: Fri Apr 20, 2001 7:49 am
Subject: RE: [VirtualTreeview] Drag & Drop

Good morning Kostas,

> In Windows 2000 it is possible to use a special Shell object named
> "drag-image manager" and have it draw the drag images for you.

Thank you for pointing this out. For the moment I will not include such an
(likely expensive) implementation, but I keep it for the case I find the
time. Unfortunately it only works with W2K, so I bet I would receive similar
comments as there were already that if a feature does not work under all
circumstances then it is useless.

Ciao, Mike


Tree.IsVisible[Node] in FormShow()

From: "Roland" [Beduerftig@S...]
Date: Fri Apr 20, 2001 7:55 am
Subject: Tree.IsVisible[Node] in FormShow()

Hi,

I write a property sheet like as the object inspector in the IDE to
use with a device database for the device settings.
VT has a the description in column 0 and an own editor in column 1.
The customer want that only the node are visible currently used, for
example:

property for an IO-device:

number of channel: 1 to 8
channel 1: IN or OUT
channel 2: IN or OUT
.....

1. the own editor show comboboxes
2. when the user change number of channel to 3 then should
channel 4 to 8 be hide, because the settings of the channels are
not important now.

I make visible with an own method:

Update_Tree() {
.....
code for control memory and hidden flag for the device
.....
for (iK = 0; iK < PND.product[iP]->channels; iK++) {
if (TreeData.Channel[iK].Hidden)
Tree->IsVisible[TreeData.Channel[iK].Node] = false;
else
Tree->IsVisible[TreeData.Channel[iK].Node] = true;
Tree->InvalidateNode(TreeData.Channel[iK].Node);
}
}

I init the tree in FormShow():

Tree->BeginUpdate();
for (iK = 0; iK < PND.product[iP]->channels; iK++) {
TreeData.Channel[iK].Node = Tree->AddChild(NULL);
NodeInfo = (int*)Tree->GetNodeData(TreeData.Channel[iK].Node);
*NodeInfo = iK;
}
Tree->EndUpdate();
Update_Tree();
Update_Tree();

when any ComboBox change I will call Update_Tree()

Now the question:

While init the Tree in FormShow() I must call Update_Tree() twice to
show the hidden state correct, and with the OnChangeEvent of a
combobox is one call of Update_Tree() enough to show the correct
state.

Have anyone an idea why I must call Tree->IsVisible .... in init
twice to show the state correct ?

with best regards
Roland

 | Replies | Author | Date
1310 | Re: Tree.IsVisible[Node] in FormShow() | Mike Lischke | Fri 4/20/2001


re: NotifyEvent OnCreateEditor under BCB5

From: "Roland" [Beduerftig@S...]
Date: Fri Apr 20, 2001 8:08 am
Subject: Re: NotifyEvent OnCreateEditor under BCB5

Hi Mike, Alexander and Mathias,

> then speak now or be silent forever :o]
> (Hey, this is the new kind of
> programming, let's call it: democratic programming ;-))

Ok !!! ... it is a good argument, and Alexander said he will send a
demo for use the interface, I think that is enough.

The point is the technical magazines and also borland get no
information about to use interface in BCB, Alexander said it correct
in the last posting.

regards
Roland


re: Drag & Drop

From: GIANNAKOPOULOS KOSTAS [kyan@s...]
Date: Fri Apr 20, 2001 8:08 am
Subject: RE: [VirtualTreeview] Drag & Drop

> Thank you for pointing this out. For the moment I will not
> include such an
> (likely expensive) implementation, but I keep it for the case
> I find the
> time.

Of course, it was merely a suggestion.

> Unfortunately it only works with W2K, so I bet I would
> receive similar
> comments as there were already that if a feature does not
> work under all
> circumstances then it is useless.

I STRONGLY disagree with such a statement. If that is true then Delphi is
useless because it cannot work in Unix or Mac.

I didn't suggest that you should remove your excellent handling of drag
images, just do it only if supported by the OS (which can easily be
determined by the result of CoCreateInstance(CLSID_DragDropHelper)) and if
the user wants it (by setting a property, maybe somethong like
"UseOLEDragImages: Boolean".

The 1st step would be calling IDragSourceHelper.InitializeFromWindow() (if
DragDropHelper is supported by the OS) before your call to
ActiveX.DoDragDrop(), just in case there are any DragDropHelper-aware
windows out there (like the explorer). I bet this would make Jim extremely
happy (of course Jim could decide to implement it in VET). This shouldn't
take much of your (precious) time.

<KY>


Bug in VTree 1.31

From: "Radoslaw Klocek" [radekk@p...]
Date: Fri Apr 20, 2001 9:55 am
Subject: Bug in VTree 1.31

I've found the serious bug in vtree 1.31.
When I drag a window over the other window containing TVirtualStringTree the
system crashes. This happens when option "Show window contents while
dragging" in Display Properties is checked.
Are there any patches correcting this bug?

--
Radoslaw Klocek

 | Replies | Author | Date
1296 | Re: Bug in VTree 1.31 | Danil Galimov | Fri 4/20/2001
1297 | Re: Bug in VTree 1.31 | Radoslaw Klocek | Fri 4/20/2001
1298 | Re: Bug in VTree 1.31 | Danil Galimov | Fri 4/20/2001
1299 | Re: Bug in VTree 1.31 | Radoslaw Klocek | Fri 4/20/2001


re: Bug in VTree 1.31

From: "Danil Galimov" [danil@o...]
Date: Fri Apr 20, 2001 9:59 am
Subject: Re: [VirtualTreeview] Bug in VTree 1.31

Hi Radoslaw.
Do you have a GP in GDI.EXE? If yes, i have also got this bug in
Win98SE german edition. What version of windows are you using?
Do you have some additionall software running in the background
(like, anti-virus programs)?

> I've found the serious bug in vtree 1.31.
> When I drag a window over the other window containing
> TVirtualStringTree the system crashes. This happens when
option "Show
> window contents while dragging" in Display Properties is
checked. Are
> there any patches correcting this bug?


re: Bug in VTree 1.31

From: "Radoslaw Klocek" [radekk@p...]
Date: Fri Apr 20, 2001 10:26 am
Subject: Re: [VirtualTreeview] Bug in VTree 1.31

Hi!
Yes, GP in GDI.EXE is one of many errors I have.
Configuration: Windows 98SE, polish edition, no additional background
applications.
In Windows 95 & 2000 everything's OK.

When I compiled the VirtualTrees.pas with assertions enabled, the first
error was: "Assertion failed: GetNodeAt: invalid vertical position."

Any ideas?

--
Radoslaw Klocek

> Hi Radoslaw.
> Do you have a GP in GDI.EXE? If yes, i have also got this bug in
> Win98SE german edition. What version of windows are you using?
> Do you have some additionall software running in the background
> (like, anti-virus programs)?
>
> > I've found the serious bug in vtree 1.31.
> > When I drag a window over the other window containing
> > TVirtualStringTree the system crashes. This happens when
> option "Show
> > window contents while dragging" in Display Properties is
> checked. Are
> > there any patches correcting this bug?
>

 | Replies | Author | Date
1298 | Re: Bug in VTree 1.31 | Danil Galimov | Fri 4/20/2001


re: Bug in VTree 1.31

From: "Danil Galimov" [danil@o...]
Date: Fri Apr 20, 2001 10:40 am
Subject: Re: [VirtualTreeview] Bug in VTree 1.31

Hello

> Yes, GP in GDI.EXE is one of many errors I have.
You have many of them? I do not know exactly about it, my friend
has win98se german, and he told me about that errors.

> Configuration: Windows 98SE, polish edition, no additional
> background
> applications.
Actually, the same - localized Win98SE german edition, AVP and
some other stuff in the backgroup. That means, backgroup apps
has no effect.

> In Windows 95 & 2000 everything's OK.
Yeah, that *very strange* errors occures only on his comp.. and
this was very strangely. But since he have upgraded to Win2k, he
do not see that messages anymore :)

> When I compiled the VirtualTrees.pas with assertions enabled, the
> first
> error was: "Assertion failed: GetNodeAt: invalid vertical position."
Yeah, 1 time he have got that error too.. But only once.

> Any ideas?

I do not know, but seems , that localized versions of Win98SE are
not correct in some way. I have some other bug in WinMe russian,
not related to vt, but that bug was only on WinMe russian... So, the
easiest sollution is to use only original versions of WIndows :). This
error (GP in GDI.EXE) is very hard to tap, so i just do not know
what to do in that case.


re: Bug in VTree 1.31

From: "Radoslaw Klocek" [radekk@p...]
Date: Fri Apr 20, 2001 10:54 am
Subject: Re: [VirtualTreeview] Bug in VTree 1.31

(...)
>
> > Any ideas?
>
> I do not know, but seems , that localized versions of Win98SE are
> not correct in some way. I have some other bug in WinMe russian,
> not related to vt, but that bug was only on WinMe russian... So, the
> easiest sollution is to use only original versions of WIndows :). This
> error (GP in GDI.EXE) is very hard to tap, so i just do not know
> what to do in that case.
>

So...
Maybe Herr Lischke could help?

--
Radoslaw Klocek


re: Multi-column treeview

From: Mike Lischke [public@l...]
Date: Fri Apr 20, 2001 11:56 am
Subject: RE: [VirtualTreeview] Multi-column treeview

Hi David,

> 1. Is it possible to left or right align the heading text in
> a multi-column treeview?

With the new version this is possible. You can left and right align a column
as well as center it. The alignment takes also the directionality settings
into account, for instance a left aligned column with a right-to-left
directionality creates a column with images on the right hand side and right
aligned text etc. There will be a demo in the next official release to
demonstrate the various combinations.

> 2. Is it possible to right align og center the contents of a specific
> column in the same treeview?

You can (with the new version) freely mix the alignment. Every column has
its own alignment and bidi mode as well as the tree. The tree's values apply
when there is no column defined. When right-to-left directionality is used
for the tree (and no columns are defined) then the vertical scrollbar will
switch to the left side of the tree under W2K+ and middle east Win9x
systems.

> 3. Is there a simple way of specifying text color for a
> specific column heading?

Without any further customization? Use OnPaintText and assign a new color to
the given canvas.

> Also, in a multi-column treeview with a vertical scrollbar
> there seems to be a redrawing issue with the empty area to the right of
the
> header, above the scrollbar (in other words, the upper right of the
component). I
> frequently find artifacts there from other forms that have
> been either on top of, or below the form containing the treeview.

This could be a relict from version 1.31. I am not sure however. This should
definetly be gone with the latest release. If you need it urgently then
download the latest beta from the file area of this mailing list at YG. Note
however, I will upload soon a new version (perhaps even today, it depends).

> None the less, my compliments on a fantastic component!

Thanks you :o]

Ciao, Mike


pb to install VTV on BCB5

From: [vberthome@f...]
Date: Fri Apr 20, 2001 12:14 pm
Subject: pb to install VTV on BCB5

Is there anybody who can help me or give me tips to install this great
componant on bcb5

I have followed the indications for the installation but i have
problem :

If i try to install it on a computer without 3rd party,
I select "Install Component" => Into new package
but after BCB is asking me for a *.bpk

Thanks a lot

 | Replies | Author | Date
1303 | Re: pb to install VTV on BCB5/Another BCB problem | [NRYJGUSFSVEY@s...] | Fri 4/20/2001
1306 | Re: pb to install VTV on BCB5/Another BCB problem | Roland | Fri 4/20/2001
1314 | Re: pb to install VTV on BCB5/Another BCB problem | [NRYJGUSFSVEY@s...] | Fri 4/20/2001
1316 | Fixed column | Alexander Egorushkin | Fri 4/20/2001
1320 | Re: Fixed column | [Manfred@F...] | Fri 4/20/2001
1326 | Re: Fixed column | Mike Lischke | Sat 4/21/2001
1315 | Re: pb to install VTV on BCB5/Another BCB problem | Alexander Egorushkin | Fri 4/20/2001
1317 | Re: pb to install VTV on BCB5/Another BCB problem | Alexander Egorushkin | Fri 4/20/2001
1318 | Re: pb to install VTV on BCB5/Another BCB problem | [DDZEEZXZCCIO@s...] | Fri 4/20/2001


Who could send to me VitualTree 2.4b?

From: "Radoslaw Klocek" [radekk@p...]
Date: Fri Apr 20, 2001 12:26 pm
Subject: Who could send to me VitualTree 2.4b?

Who could send to me VirtualTree 2.4b?
I can't download it from Yahoo!

TIA

--
Radoslaw Klocek


re: pb to install VTV on BCB5/Another BCB problem

From: [NRYJGUSFSVEY@s...]
Date: Fri Apr 20, 2001 12:48 pm
Subject: Re: [VirtualTreeview] pb to install VTV on BCB5/Another BCB problem

Hello!

> If i try to install it on a computer without 3rd party,
> I select "Install Component" => Into new package
> but after BCB is asking me for a *.bpk

Create a new package (File/New.../Package) and add the units
VirtualTrees.pas and VirtualTreesReg.pas to the package. Now it's ready
to compile and install.

I have another problem (with BCB4, I guess it's the same with BCB5): I
can't use the event OnDragDrop, because TVTDragDropEvent contains an
array, and arrays are not converted properly by BCB(4). I changed
TVTDragDropEvent to:

TVTDragDropEvent = procedure(Sender: TBaseVirtualTree; Source: TObject;
DataObject: IDataObject;
const Formats: Pointer; const Formats_Size: Integer; Shift: TShiftState;
Pt: TPoint; var Effect: Integer; Mode: TDropMode) of object;

(I splittet the array parameter into two parameters, Formats and
Formats_Size.) Of course, I also had to adjust the source code where
OnDragDrop is called.

Now the question, is there a more easy way to solve this problem?

Greetz

Marco

--
NJ0Y - Marco Loos, 48165 Münster
http://nj0y.de
PWGen - Der Passwortverwalter: http://www.pwgen.de

Sie haben die Position des Mauszeigers verändert.
Starten Sie Windows neu, damit die Änderungen wirksam werden.

 | Replies | Author | Date
1306 | Re: pb to install VTV on BCB5/Another BCB problem | Roland | Fri 4/20/2001
1314 | Re: pb to install VTV on BCB5/Another BCB problem | [NRYJGUSFSVEY@s...] | Fri 4/20/2001
1316 | Fixed column | Alexander Egorushkin | Fri 4/20/2001
1320 | Re: Fixed column | [Manfred@F...] | Fri 4/20/2001
1326 | Re: Fixed column | Mike Lischke | Sat 4/21/2001
1315 | Re: pb to install VTV on BCB5/Another BCB problem | Alexander Egorushkin | Fri 4/20/2001
1317 | Re: pb to install VTV on BCB5/Another BCB problem | Alexander Egorushkin | Fri 4/20/2001
1318 | Re: pb to install VTV on BCB5/Another BCB problem | [DDZEEZXZCCIO@s...] | Fri 4/20/2001
1324 | <oleidl.h> | Alexander Egorushkin | Fri 4/20/2001


re: pb to install VTV on BCB5

From: "Roland" [Beduerftig@S...]
Date: Fri Apr 20, 2001 1:24 pm
Subject: Re: pb to install VTV on BCB5

Hi,

> If i try to install it on a computer without 3rd party,
> I select "Install Component" => Into new package
> but after BCB is asking me for a *.bpk

VT 2.x works without problem under BCB5. You don't need the *.bpk
file, use the source *.pas directly.

1. use Component | Component install
2. click on page "In new package"
3. fill in "name of units"
click on "search" and with multiselect choise
Virtualtrees.pas and VirtualtreesReg.pas
4. fill in "search path" $(BCB)\Lib;$(BCB)\Bin;your own path
5. fill in "name of package" <your own name> for example: VT_22x
6. fill in "description" <VT version 22x>
7. click Ok

then you can compile and install

Important note:

Under BCB5 you can't find ColnEdit. I modify the VirtualtreesReg.pas
and then I have no problems:

unit VirtualTreesReg;

interface

uses
Windows, Classes,
DsgnIntf,
{$ifndef BCB}
ColnEdit,
{$endif}
VirtualTrees;

{$ifndef BCB}
type
TVirtualTreeEditor = class (TDefaultEditor)
public
procedure Edit; override;
end;
{$endif}

procedure Register;

//------------------------------------------------

implementation

uses
Dialogs;

type
// The usual trick to make a protected property accessible in the
ShowCollectionEditor call below.
TVirtualTreeCast = class(TBaseVirtualTree);

//------------------------------------------------

{$ifndef BCB}
procedure TVirtualTreeEditor.Edit;
begin
ShowCollectionEditor(Designer, Component, TVirtualTreeCast
(Component).Header.Columns, 'Columns');
end;
{$endif}

//------------------------------------------------

procedure Register;

begin
RegisterComponents('Win32', [TVirtualStringTree, TVirtualDrawTree]);
{$ifndef BCB}
RegisterComponentEditor(TVirtualStringTree, TVirtualTreeEditor);
RegisterComponentEditor(TVirtualDrawTree, TVirtualTreeEditor);
{$endif}
end;

//------------------------------------------------

end.

with best regards
Roland


re: Quick bug

From: Mike Lischke [public@l...]
Date: Fri Apr 20, 2001 1:29 pm
Subject: RE: [VirtualTreeview] Quick bug

Tony,

> If you have images shown, then select stuff, then focus elsewhere, the
> text's selection is gone (good) but the graphic is still 'selected'.

It behaves like the Explorer, so what would you expect should happen?

Ciao, Mike


re: pb to install VTV on BCB5/Another BCB problem

From: "Roland" [Beduerftig@S...]
Date: Fri Apr 20, 2001 1:35 pm
Subject: Re: pb to install VTV on BCB5/Another BCB problem

> can't use the event OnDragDrop, because TVTDragDropEvent contains an
> array, and arrays are not converted properly by BCB(4). I changed
> TVTDragDropEvent to:
>
> TVTDragDropEvent = procedure(Sender: TBaseVirtualTree;
> Source: TObject; DataObject: IDataObject;
> const Formats: Pointer; const Formats_Size: Integer; Shift:
> TShiftState; Pt: TPoint; var Effect: Integer; Mode: TDropMode)
> of object;
>
> (I splittet the array parameter into two parameters, Formats and
> Formats_Size.) Of course, I also had to adjust the source code where
> OnDragDrop is called.

Hi,

I do not understand why you split the parameter, I use VT under BCB5
without this problems, Mike said DataObject: IDataObject; is only
used with option "OLE" with "VCL" is not important.

Note:

I think in BCB4 "interface" will not suported.
"interfaces" build in BCB5 and it is useful to use ServicePack 1.

with best regards
Roland

 | Replies | Author | Date
1314 | Re: pb to install VTV on BCB5/Another BCB problem | [NRYJGUSFSVEY@s...] | Fri 4/20/2001
1316 | Fixed column | Alexander Egorushkin | Fri 4/20/2001
1320 | Re: Fixed column | [Manfred@F...] | Fri 4/20/2001
1326 | Re: Fixed column | Mike Lischke | Sat 4/21/2001


re: Re: pb to install VTV on BCB5/Another BCB p roblem

From: Mike Lischke [public@l...]
Date: Fri Apr 20, 2001 1:45 pm
Subject: RE: [VirtualTreeview] Re: pb to install VTV on BCB5/Another BCB p roblem

Roland,

> I do not understand why you split the parameter, I use VT under BCB5
> without this problems, Mike said DataObject: IDataObject; is only
> used with option "OLE" with "VCL" is not important.

He refers to the open array parameter which contains a list of available OLE
formats. This seems not to be supported by BCB 4. So do I have to include
more conditional compilation (what I would like to avoid) or is there a
better solution?

Ciao, Mike


re: VET & BCB5

From: [tias@m...]
Date: Fri Apr 20, 2001 1:48 pm
Subject: Re: VET & BCB5

--- In [VirtualTreeview@y...], Mike Lischke [public@l...] wrote:
> Mathias,
>
> > When I'm (re)compiling ShellUtilities.pas (included with the VET
> > source) under BCB5 (+ the patch), I get errors (E2303 Type name
> > expected) in the autogenerated ShellUtilities.hpp in the
declaration
> > of the TNamespace class :
> > _di_IDropTarget FDropTargetInterface;
> > _di_IContextMenu3 FContextMenu3Interface;
> > _di_IQueryInfo FQueryInfoInterface;
>
> Try including #include <oleidl.h> for the standard interfaces.

Sorry, I forgot to mention that I tried that as well with exactly the
same result... :-(

/Mathias


Uninitialized nodes

From: Mike Lischke [public@l...]
Date: Fri Apr 20, 2001 1:52 pm
Subject: Uninitialized nodes

Hi all,

a while ago we discussed about the problem what to do when filling the tree
with AddChild and adding own data to each node. If the node was not
initialized then there was no free event for it causing a memory leak. The
solution was to explicitely initialize the nodes, so there will be a
OnFreeNode event for them. So far so good.

Recently there was a bug report about Tree.DeleteChildren and calls to
either DoFreeNode or DeleteNode depending on the initialization state of the
particular node which caused me to remove this test and to call now always
DeleteNode.

This change in turn has now fixed the first, quite serious problem. From now
on (with the new version I will upload soon) there is no need any longer to
validate nodes after AddChild/InsertNode for the reason of getting a free
event for them. Since DeleteNode will always be called there will also
always be a free event. I thought I let you know...

Ciao, Mike


re: Tree.IsVisible[Node] in FormShow()

From: Mike Lischke [public@l...]
Date: Fri Apr 20, 2001 1:58 pm
Subject: RE: [VirtualTreeview] Tree.IsVisible[Node] in FormShow()

Roland,

> While init the Tree in FormShow() I must call Update_Tree() twice to
> show the hidden state correct, and with the OnChangeEvent of a
> combobox is one call of Update_Tree() enough to show the correct
> state.
> Have anyone an idea why I must call Tree->IsVisible .... in init
> twice to show the state correct ?

This problem sounds rather strange. Could it be that it has to do with doing
it in FormShow which is the result of a complex VCL handling of stuff? I'm
just guessing here, though.

Ciao, Mike


re: Drag & Drop

From: Mike Lischke [public@l...]
Date: Fri Apr 20, 2001 2:15 pm
Subject: RE: [VirtualTreeview] Drag & Drop

> I STRONGLY disagree with such a statement. If that is true
> then Delphi is useless because it cannot work in Unix or Mac.

Well it is not my opinion, I just repeated what other people think.

> The 1st step would be calling
> IDragSourceHelper.InitializeFromWindow() (if
> DragDropHelper is supported by the OS) before your call to
> ActiveX.DoDragDrop(), just in case there are any DragDropHelper-aware
> windows out there (like the explorer).

Well, I think it is a bit more than that. It is for instance required that
the helper interfaces can pass their private data along as they like, so the
IDataObject must be prepared to handle this. Another unclear point is who is
then responsible for the drag image? I do some quite complex tricks e.g. to
update the non-client area behind the drag image. How can the image helper
do that.

I have no problems to work that out, but I hesitate because it would only
help on one system, while the other people would still have display
problems. However perhaps there will be an update to ComCtrl 5 (and be it
only with IE6) so the interfaces might then be available on Win9x too.
Anyway, for the time being I am too busy to implement it, but I don't want
to refuse the idea entirely because it seems promising.

Ciao, Mike


re: Drag & Drop

From: GIANNAKOPOULOS KOSTAS [kyan@s...]
Date: Fri Apr 20, 2001 2:33 pm
Subject: RE: [VirtualTreeview] Drag & Drop

> Well, I think it is a bit more than that. It is for instance
> required that
> the helper interfaces can pass their private data along as
> they like, so the
> IDataObject must be prepared to handle this.

You're right, i tried to implement it (and send it to you) and i stumbled
upon this detail, so i aborted it. The good old "RTFM" rule (or RTFMSDN)
still applies!!!

One small nag:
Consider returning more appropriate error codes in IDataObject's methods.
For instance E_NOTIMPL instead on E_FAIL in IDataObject.SetData.
I say this because i got a strange exception trying to implement
DragDropManager that misled me to believe i had made a mistake in
transalting the interfaces and the image helper object did an access
violation when i called it...

> Another unclear
> point is who is
> then responsible for the drag image? I do some quite complex
> tricks e.g. to
> update the non-client area behind the drag image. How can the
> image helper
> do that.

Since the image helper is oblivious of the fact that a window is the drag
source (that's why InitializeFromBitmap is there) i would guess that it
saves the screen bitmap behind the drag image and restores it when
necessary. Maybe it is not the fastest thing to do in the VT's case, but it
is quite fast. Explorer proves it, since SysTreeViews and SysListViews are
not famous for their redraw speed (like your VT :-) ).

> I have no problems to work that out, but I hesitate because

Don't do anything about it for now.
I'll try to implement the IDragSourceHelper part (1st step) when i find some
time and if i get somewhere i'll send it to you.
Maybe Jim will be tempted to implement it, who knows? ;-)

Thanks.

<KY>

 | Replies | Author | Date
1313 | Re: Drag & Drop | Jim Kueneman | Fri 4/20/2001


re: Drag & Drop

From: "Jim Kueneman" [jimdk@m...]
Date: Fri Apr 20, 2001 3:08 pm
Subject: Re: Drag & Drop

--- In [VirtualTreeview@y...], GIANNAKOPOULOS KOSTAS [kyan@s...] wrote:

> time and if i get somewhere i'll send it to you.
> Maybe Jim will be tempted to implement it, who knows? ;-)

Jim is tempted but Jim has plenty of other things to implement first
<g>


re: Re: pb to install VTV on BCB5/Another BCB problem

From: [NRYJGUSFSVEY@s...]
Date: Fri Apr 20, 2001 3:07 pm
Subject: Re: [VirtualTreeview] Re: pb to install VTV on BCB5/Another BCB problem

Hi!

> > TVTDragDropEvent = procedure(Sender: TBaseVirtualTree;
> > Source: TObject; DataObject: IDataObject;
> > const Formats: Pointer; const Formats_Size: Integer; Shift:
> > TShiftState; Pt: TPoint; var Effect: Integer; Mode: TDropMode)
> > of object;
>
> I do not understand why you split the parameter, I use VT under BCB5
> without this problems, Mike said DataObject: IDataObject; is only
> used with option "OLE" with "VCL" is not important.

I guess either you don't use the OnDragDrop event or this is fixed in
BCB5. BCB4 create a .hpp file from the .pas file with a OnDragDrop
definition, but when double-clicking on the OnDragDrop event in the
object inspector it says that the parameters don't fit.

> I think in BCB4 "interface" will not suported.

They keyword is supported, but as no multiple inheritation from VCL
classes is not supported, the editor class (IVTEditLink) cannot be
modified in BCB4.

> "interfaces" build in BCB5 and it is useful to use ServicePack 1.

I have BCB5 at work but not at home :(.

Greetz

Marco

--
NJ0Y - Marco Loos, 48165 Münster
http://nj0y.de
PWGen - Der Passwortverwalter: http://www.pwgen.de

Sie haben die Position des Mauszeigers verändert.
Starten Sie Windows neu, damit die Änderungen wirksam werden.

 | Replies | Author | Date
1316 | Fixed column | Alexander Egorushkin | Fri 4/20/2001
1320 | Re: Fixed column | [Manfred@F...] | Fri 4/20/2001
1326 | Re: Fixed column | Mike Lischke | Sat 4/21/2001


re: pb to install VTV on BCB5/Another BCB problem

From: "Alexander Egorushkin" [egorushkin@m...]
Date: Fri Apr 20, 2001 5:05 pm
Subject: RE: [VirtualTreeview] pb to install VTV on BCB5/Another BCB problem

Hello!

> I have another problem (with BCB4, I guess it's the same with BCB5): I
> can't use the event OnDragDrop, because TVTDragDropEvent contains an
> array, and arrays are not converted properly by BCB(4). I changed
> TVTDragDropEvent to:
>
> TVTDragDropEvent = procedure(Sender: TBaseVirtualTree; Source:
> TObject; DataObject: IDataObject;
> const Formats: Pointer; const Formats_Size: Integer; Shift:
> TShiftState; Pt: TPoint; var Effect: Integer; Mode: TDropMode) of object;
>
There is no such problem in BCB, all arrays are automatically splitted. Is
there any other components that have events with arrays as parameters (may
be in VCL - look at them)? Or may be there exists a function called like
'GetDelphiArraySize'. Or try to find help on using OpenArray template with
the parameter.

> > I think in BCB4 "interface" will not suported.

> They keyword is supported, but as no multiple inheritation from VCL
> classes is not supported, the editor class (IVTEditLink) cannot be
> modified in BCB4.
I think you are wrong here. Interfaces can be modified even in "pure" C++
(I mean without Builder). You shouldn't modify the interface, but you must
provide a CoClass that is inherited from IVTEditLink and implement all
functions of IUnknown and IVTEditLink. Is there a definition of IVTEditLink
in HPP for VirtualTrees?

Sorry, I have not got BC4, so I can't find the solution myself, and so I
just "advice"...

Alex.

 | Replies | Author | Date
1317 | Re: pb to install VTV on BCB5/Another BCB problem | Alexander Egorushkin | Fri 4/20/2001
1318 | Re: pb to install VTV on BCB5/Another BCB problem | [DDZEEZXZCCIO@s...] | Fri 4/20/2001
1324 | <oleidl.h> | Alexander Egorushkin | Fri 4/20/2001
1329 | Re: <oleidl.h> | Mike Lischke | Sat 4/21/2001
1342 | Re: <oleidl.h> | Mike Lischke | Mon 4/23/2001
1407 | Re: <oleidl.h> | Alexander Egorushkin | Fri 4/27/2001
1817 | Re: pb to install VTV on BCB5/Another BCB problem | Mike Lischke | Wed 5/16/2001
1911 | Re: pb to install VTV on BCB5/Another BCB problem | Alexander Egorushkin | Mon 5/21/2001


Fixed column

From: "Alexander Egorushkin" [egorushkin@m...]
Date: Fri Apr 20, 2001 5:07 pm
Subject: Fixed column

Hi, Mike!
Is it possible to make a column fixed in the tree (as in grids)? If not,
could you implement this property (if it doesn't take much time, of course)?

Alex.

 | Replies | Author | Date
1320 | Re: Fixed column | [Manfred@F...] | Fri 4/20/2001
1326 | Re: Fixed column | Mike Lischke | Sat 4/21/2001


re: pb to install VTV on BCB5/Another BCB problem

From: "Alexander Egorushkin" [egorushkin@m...]
Date: Fri Apr 20, 2001 5:10 pm
Subject: RE: [VirtualTreeview] pb to install VTV on BCB5/Another BCB problem

Sorry, one mistake:
...
> There is no such problem in BCB 5, all arrays are automatically ...
...
I meant BCB 5, of course.

Alex.


re: RE: pb to install VTV on BCB5/Another BCB problem

From: [DDZEEZXZCCIO@s...]
Date: Fri Apr 20, 2001 6:32 pm
Subject: Re: RE: [VirtualTreeview] pb to install VTV on BCB5/Another BCB problem

Hi!

> > I have another problem (with BCB4, I guess it's the same with BCB5): I
> > can't use the event OnDragDrop, because TVTDragDropEvent contains an
> > array, and arrays are not converted properly by BCB(4). I changed
> > TVTDragDropEvent to:
> >
> > TVTDragDropEvent = procedure(Sender: TBaseVirtualTree; Source:
> > TObject; DataObject: IDataObject;
> > const Formats: Pointer; const Formats_Size: Integer; Shift:
> > TShiftState; Pt: TPoint; var Effect: Integer; Mode: TDropMode) of object;

I have reinstalled the original version of VTV to give an exact
describtion of what happens.

The generated .hpp file contains these lines:

typedef void __fastcall (__closure *TVTDragDropEvent)(TBaseVirtualTree* Sender,
System::TObject* Source
, _di_IDataObject DataObject, const Word * Formats, const int Formats_Size,
Classes::TShiftState Shift
, const Windows::TPoint &Pt, int &Effect, TDropMode Mode);

When I generate a OnDragDropEvent, the following lines are written to
the .cpp file:

void __fastcall TForm1::VirtualStringTree1DragDrop(
TBaseVirtualTree *Sender, TObject *Source, IDataObject *DataObject,
const array of WORD &Formats, TShiftState Shift, TPoint &Pt,
int &Effect, TDropMode Mode)

Further, the message "Eigenschaft und Methode von
VirtualStringTree1DragDrop sind nicht kompatibel" ("property and method
of VirtualStringTree1DragDrop are not compatible") is produced.

When splitting the array as described a few mails ago, the problem does
not happen.

> Is there any other components that have events with arrays as
> parameters (may be in VCL - look at them)?

I had the same problem with another third-party component, but I can't
remember which one it was :(.

I searched the Include\VCL directory (with all the .hpp files) for
"array of" and did not find anything.

> Or may be there exists a function called like 'GetDelphiArraySize'.

The problem is not accessing to the array, but using the function with
the IDE. When I turn the format of the .hpp file manually to the format
in the .cpp file or reverse, I get an error message when saving the file.
I guess there's no possibility to use the delphi arrays with BCB4. One
could create a class with the array, something like TObjectList (new in
BCB5). That should work. But not the standard delphi arrays.

> > They keyword is supported, but as no multiple inheritation from VCL
> > classes is not supported, the editor class (IVTEditLink) cannot be
> > modified in BCB4.
> I think you are wrong here. Interfaces can be modified even in "pure" C++
> (I mean without Builder). You shouldn't modify the interface, but you must
> provide a CoClass that is inherited from IVTEditLink and implement all
> functions of IUnknown and IVTEditLink.

I'm not sure, it might be that it is possible. But that's not that
important to me that I want to figure it out.

> Is there a definition of IVTEditLink in HPP for VirtualTrees?

__interface IVTEditLink;
typedef System::DelphiInterface<IVTEditLink> _di_IVTEditLink;
__interface IVTEditLink : public IUnknown /*
__guid="{2BE3EAFA-5ACB-45B4-9D9A-B58BCC496E17}" */
{

public:
virtual bool __stdcall BeginEdit(void) = 0 ;
virtual void __stdcall CancelEdit(void) = 0 ;
virtual bool __stdcall CanStop(void) = 0 ;
virtual void __stdcall EndEdit(void) = 0 ;
virtual bool __stdcall PrepareEdit(TBaseVirtualTree* Tree, PVirtualNode Node,
int Column) = 0 ;
virtual Windows::TRect __stdcall GetBounds(void) = 0 ;
virtual void __stdcall SetBounds(const Windows::TRect R) = 0 ;
};

Bye

Marco

--
NJ0Y - Marco Loos, 48165 Münster
http://nj0y.de
PWGen - Der Passwortverwalter: http://www.pwgen.de

Sie haben die Position des Mauszeigers verändert.
Starten Sie Windows neu, damit die Änderungen wirksam werden.

 | Replies | Author | Date
1324 | <oleidl.h> | Alexander Egorushkin | Fri 4/20/2001
1329 | Re: <oleidl.h> | Mike Lischke | Sat 4/21/2001
1342 | Re: <oleidl.h> | Mike Lischke | Mon 4/23/2001
1407 | Re: <oleidl.h> | Alexander Egorushkin | Fri 4/27/2001


Gratulation, Bug and Editor

From: [Manfred@F...]
Date: Fri Apr 20, 2001 10:01 pm
Subject: Gratulation, Bug and Editor

Hello Mike.

At first, sorry for my bad english. I'm from Munich, Bavaria.

I use VirtualTree since 2 months. Its the best component for Delphi i
ever seen (simultaneously with GLScene ;-)).

In 75% of my programms i use at least 1 ListView with lots of data.
I replaced nearly all of them with VirtualStringTree.
On one point i fill a ListView (with 8 Columns) with about 6000 Lines
of data. My office PC (PIII 500) needs 20 sec. to fill the ListView.
The VirtualStringTree needs only 400 ms!!!!! glory

But also i have found a little bug (i think).
I have a VirtualStringTree with MultiSelect = True. If no Entry is
selected and i press [Shift]-[Cursor Down/Up] then a Dialog comes up
with the following text:
"Nodes must never be nil. (...\VirtualTrees.pas, Zeile 8717)"

At least, i'm working on a editor class for VirtualStringTree. I use
the TPropertyEditLink from the advanced demo as starting point.
Currently i include editors for
Strings (masked or not/DropDown/DropDownList)
Integer
Real
Hex
Currency
Date
Time
Filename
Directory
Color
Font
It's a normal unit, no component. Only to include in the uses section
and then make a call in CreateEditor. At this point you also set the
Parameters for the appropriate editor. The Result comes via OnNewText
(or a own Event, i'm in the dark about it).
If i have it in a usable state i load it in the YG files section.

OK. For now, it's enough

cu
Manfred

 | Replies | Author | Date
1328 | Re: Gratulation, Bug and Editor | Mike Lischke | Sat 4/21/2001


re: Fixed column

From: [Manfred@F...]
Date: Fri Apr 20, 2001 10:02 pm
Subject: Re: Fixed column

--- In [VirtualTreeview@y...], "Alexander Egorushkin" [egorushkin@m...]
wrote:
> Hi, Mike!
> Is it possible to make a column fixed in the tree (as in grids)?
If not,
> could you implement this property (if it doesn't take much time, of
course)?
>
> Alex.

I would like it too.

cu
Manfred


re: Fixed column

From: Werner Lehmann [wl@b...]
Date: Fri Apr 20, 2001 10:13 pm
Subject: Re: [VirtualTreeview] Fixed column

Alexander Egorushkin wrote:
>
> Hi, Mike!
> Is it possible to make a column fixed in the tree (as in grids)? If not,
> could you implement this property (if it doesn't take much time, of course)?

The advanced demo which currently only runs with v1.31 (available from Mike
website) demonstrates a fixed column.

Werner

 | Replies | Author | Date
1323 | Re: Fixed column | [Manfred@F...] | Fri 4/20/2001
2910 | Re: Fixed column | Werner Lehmann | Fri 7/6/2001
2928 | Re: Fixed column | Franc v/d Westelaken | Sat 7/7/2001


Small treeline glitch?

From: Werner Lehmann [wl@b...]
Date: Fri Apr 20, 2001 10:16 pm
Subject: Small treeline glitch?

Mike,

I am not sure if this is intended: the tree button which indicates that
a subtree is expanded (the minus symbol) is not drawn correctly for the
last and the first (top level) node that has children.

Instead of a minus I get a plus without the top center part (for the
first node with children) or a plus without the bottom center part
(last node with children). Looks as if the vertical tree line is drawn
up to the center of the minus symbol and not the border of it. I have
set Colors.TreeLineColor to clBlack and the effect is very obvious.

Regards,
Werner

 | Replies | Author | Date
1327 | Re: Small treeline glitch? | Mike Lischke | Sat 4/21/2001
1331 | Re: Small treeline glitch? | Werner Lehmann | Sat 4/21/2001
1333 | Re: Small treeline glitch? | Mike Lischke | Sat 4/21/2001


re: Fixed column

From: [Manfred@F...]
Date: Fri Apr 20, 2001 10:50 pm
Subject: Re: Fixed column

--- In [VirtualTreeview@y...], Werner Lehmann [wl@b...] wrote:
> Alexander Egorushkin wrote:
> >
> > Hi, Mike!
> > Is it possible to make a column fixed in the tree (as in grids)?
If not,
> > could you implement this property (if it doesn't take much time,
of course)?
>
> The advanced demo which currently only runs with v1.31 (available
from Mike
> website) demonstrates a fixed column.
>
> Werner

Thats right. But it's only visually a fixed column.
If i resize the window and a horizontal scrollbar appears i can move
the column away.
A "really" fixed column must stay on the left side also at horizontal
scrolling.

cu
Manfred


<oleidl.h>

From: "Alexander Egorushkin" [egorushkin@m...]
Date: Fri Apr 20, 2001 11:13 pm
Subject: <oleidl.h>

Hi, Mike,
could you replace the line
{$HPPEMIT '#include <oleidl.h>'}
with this one
{$HPPEMIT '#include <objidl.h>'}

Thank you.

My class inherited from TCustomVirtualStringTree has got function DoDragDrop
(one of its parameters is IDataObject - again problems with
terfaces:) ). When I tried to install this component, IDE crashed. When I
removed this function - the component was installed fine. I tried to install
IDE with the function twice, but the result was the same - IDE crash. Then I
tried to replace header that defines standart interfaces - now it works!

Alex.

 | Replies | Author | Date
1329 | Re: <oleidl.h> | Mike Lischke | Sat 4/21/2001
1342 | Re: <oleidl.h> | Mike Lischke | Mon 4/23/2001
1407 | Re: <oleidl.h> | Alexander Egorushkin | Fri 4/27/2001


re: Drag & Drop

From: "Mike Lischke" [public@l...]
Date: Sat Apr 21, 2001 2:23 pm
Subject: RE: [VirtualTreeview] Drag & Drop

Hi Kostas,

> Consider returning more appropriate error codes in IDataObject's methods.
> For instance E_NOTIMPL instead on E_FAIL in IDataObject.SetData.

Mmh, the problem is what is to be considered as being more appropriate? E_FAIL
is an error which says the operation failed for some unspecified reasons.
Basically, E_NOTIMPL is not true in this regard because the method *is*
implemented but could not successfully finish the operation. E_FAIL is the
correct result if the data could not be transfered (according to the docs). I
mean, we cannot changed the drag image interfaces and if it interprets certain
result values wrong then the only option we have is to return something else,
but it should at least fit partly.

> Since the image helper is oblivious of the fact that a window is the drag
> source (that's why InitializeFromBitmap is there) i would guess that it
> saves the screen bitmap behind the drag image and restores it when
> necessary.

The point is not to save the screen, this works already fine. The point is what
to do if the screen changes for some reason? In applications using VT I know
how to replace parts of the drag image but for everything else there is no way
to do that. This is also the reason why I hide the drag image if the mouse is
not over a VT. It can happen however, that parts of the drag image overlap
another window which changes somehow (e.g. an image viewer with an animated gif
or the task bar in auto hide mode which slides up). These cases are unhandable
(and I believe even with the drag image helper, but who knows?) because I would
have to cause those windows to draw themselve into a bitmap of my choice.

Ciao, Mike


re: Fixed column

From: "Mike Lischke" [public@l...]
Date: Sat Apr 21, 2001 2:23 pm
Subject: RE: [VirtualTreeview] Fixed column

Hi Alex,

> Is it possible to make a column fixed in the tree (as in grids)? If not,
> could you implement this property (if it doesn't take much time, of course)?

Currently I see no way to implement a real fixed column. Main problem, as
already pointed out, is to
avoid that it gets scrolled with the rest of the client area. I have also no
plans to implement this
feature soon. Sorry, but the feature freeze was already a long time ago and now
is documentation
time (aside bug fixes).

Ciao, Mike


re: Small treeline glitch?

From: "Mike Lischke" [public@l...]
Date: Sat Apr 21, 2001 2:23 pm
Subject: RE: [VirtualTreeview] Small treeline glitch?

Hi Werner,

> I am not sure if this is intended: the tree button which indicates that
> a subtree is expanded (the minus symbol) is not drawn correctly for the
> last and the first (top level) node that has children.

Yes, this was a bug. I have implemented a second kind of node buttons (a black
triangle, looks very
cool) and needed to set transparency for the node bitmaps. This is wrong
however for the classical
buttons. The interior has the same color as the exterior and will therefore be
transparent too. This
will make show some line artifacts.

I have already fixed this. Please wait for the next upload.

Ciao, Mike


re: Gratulation, Bug and Editor

From: "Mike Lischke" [public@l...]
Date: Sat Apr 21, 2001 2:23 pm
Subject: RE: [VirtualTreeview] Gratulation, Bug and Editor

Hi Manfred,

> At first, sorry for my bad english. I'm from Munich, Bavaria.

You are not the only one. Best wishes from Zorneding.

> I use VirtualTree since 2 months. Its the best component for Delphi i
> ever seen (simultaneously with GLScene ;-)).

Thank you. Well, GLScene is meanwhile maintained by Eric Grange since about a
long while already
(and he did a terrific job, for those interested: www.glscene.org). I had
simply not the time to
develop this further. Interestingly enough I have still 15000 downloads since
last October for
GLScene05 although Eric already published version 0.8. Version 0.5 is however
still compilable with
Delphi 4, perhaps this is the reason.

> My office PC (PIII 500) needs 20 sec. to fill the ListView.
> The VirtualStringTree needs only 400 ms!!!!! glory

:-)

> But also i have found a little bug (i think).
> I have a VirtualStringTree with MultiSelect = True. If no Entry is
> selected and i press [Shift]-[Cursor Down/Up] then a Dialog comes up
> with the following text:
> "Nodes must never be nil. (...\VirtualTrees.pas, Zeile 8717)"

Thank you for the report. I have fixed this and similar potiential problems.

> At least, i'm working on a editor class for VirtualStringTree. I use
> the TPropertyEditLink from the advanced demo as starting point.

Hey, no bad idea. Do you have plans to make this freely available? Thomas
Bogenrieder has already
isolated some editors into one unit (which will come with the new release). I
believe many users of
VT (particularly Delphi beginners) would be happy to get them.

> Parameters for the appropriate editor. The Result comes via OnNewText
> (or a own Event, i'm in the dark about it).

Because the tree knows nothing about the data and the editors there is no fixed
protocol how to pass
the results along. For the string tree there is a normal TEdit editor which
uses a special event
(OnNewText) to pass back results. But this is only to get people starting and
simplify the design if
nothing else is needed. But it could well be that you have more than one input
control in an node
editor form (or frame etc.) Then it is not clear how the interaction is to be
done. In this case the
tree does not care at all and only expects to get notfied when editing stops.

Ciao, Mike


re: <oleidl.h>

From: "Mike Lischke" [public@l...]
Date: Sat Apr 21, 2001 2:23 pm
Subject: RE: [VirtualTreeview] <oleidl.h>

Hi Alex,

> could you replace the line
> {$HPPEMIT '#include <oleidl.h>'}
> with this one
> {$HPPEMIT '#include <objidl.h>'}

Done.

> tried to replace header that defines standart interfaces - now it works!

Excellent :o]

Ciao, Mike

 | Replies | Author | Date
1342 | Re: <oleidl.h> | Mike Lischke | Mon 4/23/2001
1407 | Re: <oleidl.h> | Alexander Egorushkin | Fri 4/27/2001


re: Drag & Drop

From: Werner Lehmann [wl@b...]
Date: Sat Apr 21, 2001 4:23 pm
Subject: Re: [VirtualTreeview] Drag & Drop

Mike Lischke wrote:

> unhandable (and I believe even with the drag image helper, but who knows?)
because
> I would have to cause those windows to draw themselve into a bitmap of my
choice.

This is possible with WM_PRINT (sent to those other windows). Not a top
priority for
me but wanted to let you know.

Regards,
Werner

 | Replies | Author | Date
1332 | Re: Drag & Drop | Mike Lischke | Sat 4/21/2001


re: Small treeline glitch?

From: Werner Lehmann [wl@b...]
Date: Sat Apr 21, 2001 5:51 pm
Subject: Re: [VirtualTreeview] Small treeline glitch?

Mike Lischke wrote:
>
> Yes, this was a bug. I have implemented a second kind of node buttons (a
black triangle, looks very
> cool) and needed to set transparency for the node bitmaps. This is wrong
however for the classical
> buttons. The interior has the same color as the exterior and will therefore
be transparent too. This
> will make show some line artifacts.

Mike, couldn't you use clFuchsia as transparent color? And keep the interior
clWhite, make the exterior clFuchsia? I am looking forward to seeing these
triangles... :)

Werner

 | Replies | Author | Date
1333 | Re: Small treeline glitch? | Mike Lischke | Sat 4/21/2001


re: Drag & Drop

From: "Mike Lischke" [public@l...]
Date: Sat Apr 21, 2001 6:53 pm
Subject: RE: [VirtualTreeview] Drag & Drop

> This is possible with WM_PRINT (sent to those other windows). Not a top
priority for
> me but wanted to let you know.

Unfortunately this is quite unreliable. Some controls support WM_PRINT and some
not (particularly
the client area is often simply empty). Another point is that the window which
changed will not tell
the drag image what happend. How should I know when to recapture?

Ciao, Mike

PS: VT supports both WM_PRINT and WM_PRINTCLIENT.


re: Small treeline glitch?

From: "Mike Lischke" [public@l...]
Date: Sat Apr 21, 2001 7:00 pm
Subject: RE: [VirtualTreeview] Small treeline glitch?

> Mike, couldn't you use clFuchsia as transparent color? And keep the interior
> clWhite, make the exterior clFuchsia? I am looking forward to seeing these
> triangles... :)

I also thought about using a separate color. The triangles are fun. Just an
alternative way. If I
would not want to come to an end I would implement a kind of user defined
expand/collapse buttons
:o]

Ciao, Mike


re: Drag & Drop

From: "Vadim Sedulin" [wsntrl@o...]
Date: Sat Apr 21, 2001 8:32 pm
Subject: Re: [VirtualTreeview] Drag & Drop

Hello Mike!

> These cases are unhandable (and I believe even with the drag image helper,
but who knows?) because I
> would have to cause those windows to draw themselve into a bitmap of my
choice.

You can use transparent window (WS_EX_TRANSPARENT) to show drag image. Of
course, you will need to move it after mouse pointer.

I'm sorry, I don't know english enough to explain an idea and have enough
problems with 3D trees in DB to do it myself... :(

Bye.

Vadim Sedulin
E-Mail: [wsntrl@o...]

 | Replies | Author | Date
1335 | Re: Drag & Drop | Mike Lischke | Sat 4/21/2001


re: Drag & Drop

From: "Mike Lischke" [public@l...]
Date: Sat Apr 21, 2001 9:35 pm
Subject: RE: [VirtualTreeview] Drag & Drop

Vadim,

> You can use transparent window (WS_EX_TRANSPARENT) to show drag image. Of
> course, you will need to move it after mouse pointer.

Thank you for your suggestion, but WS_EX_TRANSPARENT is not what you would
expect it to be. It is
just transparent against mouse messages and every window beneath it is always
drawn before the
transparent window is drawn. That's all and does unfortunately not help at all
to make the drag
image work for windows which change while dragging is active. Btw: I don't use
a window at all. The
drag image is directly drawn onto the desktop. And while we are at it: window
regions and image
lists are unfortunately too slow (and wouldn't help either).

Ciao, Mike


A few questions

From: "Jim Kueneman" [jimdk@m...]
Date: Sat Apr 21, 2001 11:22 pm
Subject: A few questions

Hi Mike,

A few question for VET.

1) What is the fastest way to go though VT? I am implementing a
refresh/loadtree routine where I have saved the PIDLs of the selected
node(s) and of the most expanded branchs so it can be
refreshed/reconstructed later. In doing so I have to run through the
tree looking for equal PIDLs with the saved ones for the nodes to
select or expand. Right now I implemented it in InterateSubTree and
the callback. Is there as better way?

Also when the shell tells me it deleted or added a namespace I will
need to hunt down the node by PIDL.

2) I have redesigned the Demo and made it less busy by putting a tab
control along the bottom and grouped things in a more logical way.
When are you planning the offical release of VT? I would think in a
week I should have a VET that can *almost* replace Explorer <g>

3) You mentioned donating VET to JEDI. Only a few questions, who,
what, when, where, why, and how? <g>

Jim

 | Replies | Author | Date
1338 | Re: A few questions | Mike Lischke | Sun 4/22/2001
1344 | Re: A few questions | GIANNAKOPOULOS KOSTAS | Mon 4/23/2001
1350 | Re: A few questions | Jim Kueneman | Mon 4/23/2001


re: Drag & Drop

From: "Vadim Sedulin" [wsntrl@o...]
Date: Sun Apr 22, 2001 1:53 am
Subject: Re: [VirtualTreeview] Drag & Drop

Hello!

>That's all and does unfortunately not help at all to make the drag image
work for windows which change
> while dragging is active.

?! I thing you wrong. I used transparent windows before and it's work just
fine.

> Btw: I don't use a window at all. The drag image is directly drawn onto
the desktop.
> And while we are at it: window regions and image lists are unfortunately
too slow (and wouldn't help either).

Yes, it is slow. But I do not suggested paint on it. You can use transparent
window to receive notifications about invalidated areas.

Bye.

Vadim Sedulin
E-Mail: [wsntrl@o...]

 | Replies | Author | Date
1339 | Re: Drag & Drop | Mike Lischke | Sun 4/22/2001


re: A few questions

From: "Mike Lischke" [public@l...]
Date: Sun Apr 22, 2001 8:41 am
Subject: RE: [VirtualTreeview] A few questions

Hi Jim,

> 1) What is the fastest way to go though VT?
> Right now I implemented it in InterateSubTree and
> the callback. Is there as better way?

IterateSubtree has been written for that particular purpose so it is fine here.
If you don't need to
filter the iteration then you can of course do it manually too and save a
couple of milliseconds by
using a simple while do Node := GetNext(Node); loop.

> 2) When are you planning the offical release of VT? I would think in a
> week I should have a VET that can *almost* replace Explorer <g>

Well, I would love to have it out at the end of April but realistically guessed
I think it will
rather be mid May. So you have enough time to make your demo ready.

> 3) You mentioned donating VET to JEDI. Only a few questions, who,
> what, when, where, why, and how? <g>

Where: www.delphi-jedi.org
What: Virtual Explorer Tree
When: when it's ready :-)
Why: to help others and to allow others to improve it, maybe GXExplorer and
similar projects will
finally switch to VET
How: Subscribe to JEDI-VCL (http://groups.yahoo.com/group/JEDI-VCL) and simply
announce what you
want

Ciao, MIke


re: Drag & Drop

From: "Mike Lischke" [public@l...]
Date: Sun Apr 22, 2001 8:48 am
Subject: RE: [VirtualTreeview] Drag & Drop

Hi Vadim,

> ?! I thing you wrong. I used transparent windows before and it's work just
> fine. You can use transparent
> window to receive notifications about invalidated areas.

Mmh, this sounds interesting. I can't see currently how this would work but I'm
always willing to
learn, so please can you explain the basics a bit? I'm particularly interested
in one situation
where the drag image reaches below the bottom border of the screen an the task
bar is docked there
too but hidden. Now the mouse moves nearer to the border (with the drag image)
and the task bar
slides up. How can I get the area of the task bar which I have to recapture?

Ah yes, there is another situation which seems also unsolvable to me: What
about a timed animation
(media player, animated gifs etc.) which is not caused by a WM_PAINT but
directly drawn to a window
which is currently covered by the drag image? How to get notice of this event
too and how do I get
the changed content into the drag image (provided WM_PRINTCHILDREN is not
supported)?

Thank you and

Ciao, Mike


New file uploaded to VirtualTreeview

From: [VirtualTreeview@yahoogroups.com>
Date: Sun Apr 22, 2001 11:08 pm
Subject: New file uploaded to VirtualTreeview

Hello,

This email message is a notification to let you know that
a file has been uploaded to the Files area of the VirtualTreeview
group.

File : /VSTEdit.zip
Uploaded by : [Manfred@F...]
Description : Editors for VirtualStringTree, Version 1.0 Beta

You can access this file at the URL

http://groups.yahoo.com/group/VirtualTreeview/files/VSTEdit.zip

To learn more about file sharing for your group, please visit

http://help.yahoo.com/help/us/groups/files

Regards,

Manfred@F...]


Editors for VST

From: [Manfred@F...]
Date: Sun Apr 22, 2001 11:10 pm
Subject: Editors for VST

Mike.

I have finished the first beta release of my TVSTEditor class.

The most editors i use based on RXLib 2.75. I have the necessary
files included (RXCtrls.zip), it's no need to install it.
A short description is also included.

I have uploaded it to YG (VSTEdit.zip). Please have a look and do not
hesitate with your opinion.

cu
Manfred

 | Replies | Author | Date
1343 | Re: Editors for VST | Mike Lischke | Mon 4/23/2001
1345 | Re: Editors for VST | [Manfred@F...] | Mon 4/23/2001
1346 | Re: Editors for VST | [DDZEEZXZCCIO@s...] | Mon 4/23/2001
1347 | Re: Editors for VST | [Manfred@F...] | Mon 4/23/2001
1348 | Re: Editors for VST | Roland | Mon 4/23/2001
1351 | Re: Editors for VST | [NRYJGUSFSVEY@s...] | Mon 4/23/2001
1352 | Re[2]: [VirtualTreeview] Editors for VST | prog-fr | Mon 4/23/2001
1353 | Re: Editors for VST | [Manfred@F...] | Mon 4/23/2001
1356 | Re: Editors for VST | [NRYJGUSFSVEY@s...] | Wed 4/25/2001


re: <oleidl.h>

From: "Mike Lischke" [public@l...]
Date: Mon Apr 23, 2001 7:37 am
Subject: RE: [VirtualTreeview] <oleidl.h>

Alex,

> > {$HPPEMIT '#include <objidl.h>'}

With this new include file does the interface declaration now work without
changes or does the user
still need to comment out these lines:

operator IDropTarget*(void) { return (IDropTarget*)&__IDropTarget; }

etc?

Ciao, Mike

 | Replies | Author | Date
1407 | Re: <oleidl.h> | Alexander Egorushkin | Fri 4/27/2001


re: Editors for VST

From: "Mike Lischke" [public@l...]
Date: Mon Apr 23, 2001 7:55 am
Subject: RE: [VirtualTreeview] Editors for VST

Hi Manfred,

> I have uploaded it to YG (VSTEdit.zip). Please have a look and do not
> hesitate with your opinion.

Thank you for this contribution. I will however not find the time to test the
editors. While it was
likely the least effort to base the editors on RXLib I'm not sure if this could
cause problems. Not
everyone likes (to install) the RXLib.

Anyway, for those who don't hesitate to use RXLib will be happy to get
ready-to-use editors too.
Please let me know when you consider your editors as being ready for
distribution. I would like to
include a short note into the help files.

Ciao, Mike

 | Replies | Author | Date
1345 | Re: Editors for VST | [Manfred@F...] | Mon 4/23/2001
1346 | Re: Editors for VST | [DDZEEZXZCCIO@s...] | Mon 4/23/2001
1347 | Re: Editors for VST | [Manfred@F...] | Mon 4/23/2001
1348 | Re: Editors for VST | Roland | Mon 4/23/2001
1351 | Re: Editors for VST | [NRYJGUSFSVEY@s...] | Mon 4/23/2001
1352 | Re[2]: [VirtualTreeview] Editors for VST | prog-fr | Mon 4/23/2001
1353 | Re: Editors for VST | [Manfred@F...] | Mon 4/23/2001


re: A few questions

From: GIANNAKOPOULOS KOSTAS [kyan@s...]
Date: Mon Apr 23, 2001 8:32 am
Subject: RE: [VirtualTreeview] A few questions

Good Morning Mike and Jim.

> IterateSubtree has been written for that particular purpose
> so it is fine here. If you don't need to
> filter the iteration then you can of course do it manually
> too and save a couple of milliseconds by
> using a simple while do Node := GetNext(Node); loop.

I suspect that Jim needs a different kind of node walking. If you consider
that PIDLs are "paths" of the Shell tree structure, he mustn't iterate the
whole structure but just follow the path. That means:

1. Remove the 1st SHITEMID from the PIDL (points to the desktop)
2. Go to the desktop node (parent).
3. Extraxt the 1st SHITEMID from the PIDL.
4. Load the node's children if not already loaded.
5. Find the child that matches the SHITEMID.
6. Repeat the steps 2-5 with the match as the "parent" until either a
mismatch or the PIDL is completely processed.
Do step only if necessary.

I think this should be done using Node.FirstChild and Node.NextSibling
without having to iterate the whole tree.

Jim, could you take a look at my FolderTreeView implementation of locating a
node by PIDL.

<KY>

 | Replies | Author | Date
1350 | Re: A few questions | Jim Kueneman | Mon 4/23/2001


re: Editors for VST

From: [Manfred@F...]
Date: Mon Apr 23, 2001 8:58 am
Subject: Re: Editors for VST

Mike.

It's no need to install RXLib. All files you need for the editors are
included in my zip. Without RXLib, this files must reside in the
delphi search path. The editors are created at runtime, so it's no
need to install the components.
I favourite this solution because i need the Editors quickly for
myself. Finally i will include the editors as part of my unit, but
it's a longer way.

At last i have an appeal to all users of VT. Please give me a
response what you think about my unit. Before i invest more time i
would like to hear that's the right way. Corrections and suggestions
are welcome. If you like you can mail me directly. (Germans: please
wrote in german).

cu
Manfred

--- In [VirtualTreeview@y...], "Mike Lischke" [public@l...] wrote:
> Hi Manfred,
>
> > I have uploaded it to YG (VSTEdit.zip). Please have a look and do
not
> > hesitate with your opinion.
>
> Thank you for this contribution. I will however not find the time
to test the editors. While it was
> likely the least effort to base the editors on RXLib I'm not sure
if this could cause problems. Not
> everyone likes (to install) the RXLib.
>
> Anyway, for those who don't hesitate to use RXLib will be happy to
get ready-to-use editors too.
> Please let me know when you consider your editors as being ready
for distribution. I would like to
> include a short note into the help files.
>
> Ciao, Mike


re: RE: Editors for VST

From: [DDZEEZXZCCIO@s...]
Date: Mon Apr 23, 2001 10:07 am
Subject: Re: RE: [VirtualTreeview] Editors for VST

Hello!

> > I have uploaded it to YG (VSTEdit.zip). Please have a look and do not
> > hesitate with your opinion.
>
> Thank you for this contribution. I will however not find the time to test the
editors. While it was
> likely the least effort to base the editors on RXLib I'm not sure if this
could cause problems. Not
> everyone likes (to install) the RXLib.

What is RXLib (is there a homepage about RXLib?), and what is the reason
why not everyone could like to install it?

Bye

Marco

--
NJ0Y - Marco Loos, 48165 Münster
http://nj0y.de
PWGen - Das Webmastertool: http://www.pwgen.de

... und als ich nach draussen ging, regnete es!
Aber Microsoft sagte, es regnet nicht ...
... also wurde ich nicht nass!

 | Replies | Author | Date
1347 | Re: Editors for VST | [Manfred@F...] | Mon 4/23/2001
1348 | Re: Editors for VST | Roland | Mon 4/23/2001
1351 | Re: Editors for VST | [NRYJGUSFSVEY@s...] | Mon 4/23/2001
1352 | Re[2]: [VirtualTreeview] Editors for VST | prog-fr | Mon 4/23/2001
1353 | Re: Editors for VST | [Manfred@F...] | Mon 4/23/2001


re: Editors for VST

From: [Manfred@F...]
Date: Mon Apr 23, 2001 11:25 am
Subject: Re: [VirtualTreeview] Editors for VST

Marco.

No reason, RXLib is one of the best free component collection for
Delphi. You will found it on www.rxlib.com.

cu
Manfred

--- In [VirtualTreeview@y...], [DDZEEZXZCCIO@s...] wrote:
> Hello!
>
> > > I have uploaded it to YG (VSTEdit.zip). Please have a look and
do not
> > > hesitate with your opinion.
> >
> > Thank you for this contribution. I will however not find the time
to test the editors. While it was
> > likely the least effort to base the editors on RXLib I'm not sure
if this could cause problems. Not
> > everyone likes (to install) the RXLib.
>
> What is RXLib (is there a homepage about RXLib?), and what is the
reason
> why not everyone could like to install it?
>
> Bye
>
>
> Marco
>
> --
> NJ0Y - Marco Loos, 48165 Münster
> http://nj0y.de
> PWGen - Das Webmastertool: http://www.pwgen.de
>
> ... und als ich nach draussen ging, regnete es!
> Aber Microsoft sagte, es regnet nicht ...
> ... also wurde ich nicht nass!


re: Editors for VST

From: "Roland" [Beduerftig@S...]
Date: Mon Apr 23, 2001 11:30 am
Subject: Re: [VirtualTreeview] Editors for VST

> What is RXLib (is there a homepage about RXLib?),
> and what is the reason
> why not everyone could like to install it?
>
> Bye
>
>
> Marco

Hi Marco,

RXLib is a very big free library.

http://www.rxlib.com/
http://einstein.fet.uni-hannover.de/~od/rxlib/cnengl.htm
http://hauab.de/o/d.phtml/Computers/Programming/Languages/
Delphi/Components_Packs/
http://www.delphiprogramming.de/

regards
Roland

 | Replies | Author | Date
1351 | Re: Editors for VST | [NRYJGUSFSVEY@s...] | Mon 4/23/2001
1352 | Re[2]: [VirtualTreeview] Editors for VST | prog-fr | Mon 4/23/2001
1353 | Re: Editors for VST | [Manfred@F...] | Mon 4/23/2001


re: A few questions

From: "Jim Kueneman" [jimdk@m...]
Date: Mon Apr 23, 2001 12:40 pm
Subject: Re: A few questions

--- In [VirtualTreeview@y...], GIANNAKOPOULOS KOSTAS [kyan@s...] wrote:
--- In [VirtualTreeview@y...], GIANNAKOPOULOS KOSTAS [kyan@s...] wrote:
> I suspect that Jim needs a different kind of node walking. If you
consider
> that PIDLs are "paths" of the Shell tree structure, he mustn't

Ok I must have had brain fade. I already have a "WalkPIDLToNode"
function that does what you suggest. What I wanted to do was to find
a node using the PIDL, only if it exists in the current tree. All I
need is to add an extra parameter such as "ForceExpand" so I can
decide if I want it to do that.

It was late at night.

Jim


re: Editors for VST

From: [NRYJGUSFSVEY@s...]
Date: Mon Apr 23, 2001 3:00 pm
Subject: Re: [VirtualTreeview] Editors for VST

Hello!

> http://www.rxlib.com/

This server is not responding.

> http://einstein.fet.uni-hannover.de/~od/rxlib/cnengl.htm

This page contains old information and is not very informative.

> http://hauab.de/o/d.phtml/Computers/Programming/Languages/
> Delphi/Components_Packs/

This page does not exist.

> http://www.delphiprogramming.de/

There is a link to a page that does not exist.

But I will try again later to reach the first page :).

Tnx + greetz

Marco

--
NJ0Y - Marco Loos, 48165 Münster
http://nj0y.de
PWGen - Der Passwortverwalter: http://www.pwgen.de

Sie haben die Position des Mauszeigers verändert.
Starten Sie Windows neu, damit die Änderungen wirksam werden.

 | Replies | Author | Date
1352 | Re[2]: [VirtualTreeview] Editors for VST | prog-fr | Mon 4/23/2001
1353 | Re: Editors for VST | [Manfred@F...] | Mon 4/23/2001


Re[2]: Editors for VST

From: prog-fr [prog-fr@n...]
Date: Mon Apr 23, 2001 3:20 pm
Subject: Re[2]: [VirtualTreeview] Editors for VST

http://www.rxlib.com/ work


re: Editors for VST

From: [Manfred@F...]
Date: Mon Apr 23, 2001 3:48 pm
Subject: Re: Editors for VST

Marco.

>
> > http://www.rxlib.com/
>
> This server is not responding.
>

I think the server is down at the moment. Try it tomorrow, the
address is correct.

cu
Manfred


re: Drag & Drop

From: "Vadim Sedulin" [wsntrl@o...]
Date: Mon Apr 23, 2001 7:29 pm
Subject: Re: [VirtualTreeview] Drag & Drop

Hello!

> I'm particularly interested in one situation where the drag image
> reaches below the bottom border of the screen an the task bar is
> docked there too but hidden. Now the mouse moves nearer to the
> border (with the drag image) and the task bar slides up. How can
> I get the area of the task bar which I have to recapture?

I can send you a little example. Where to?

> Ah yes, there is another situation which seems also unsolvable to me: What
> about a timed animation (media player, animated gifs etc.) which is not
> caused by a WM_PAINT but directly drawn to a window
> which is currently covered by the drag image? How to get notice of this
> event too and how do I get the changed content into the drag image
> (provided WM_PRINTCHILDREN is not supported)?

Upsss. It's almost unreal. Even system hooks cannot handle this
situations - I checked. I heard something about GDI hooks (afaik
DDIHookProc), but never work with it...

Bye.

Vadim Sedulin
E-Mail: [wsntrl@o...]

 | Replies | Author | Date
1355 | Re: Drag & Drop | Mike Lischke | Mon 4/23/2001


re: Drag & Drop

From: "Mike Lischke" [public@l...]
Date: Mon Apr 23, 2001 8:32 pm
Subject: RE: [VirtualTreeview] Drag & Drop

> I can send you a little example. Where to?

Please send it to [public@l...]

> Upsss. It's almost unreal. Even system hooks cannot handle this
> situations - I checked. I heard something about GDI hooks (afaik
> DDIHookProc), but never work with it...

I did already more than 18 months ago and could imagine that a hook would work
but this cannot be a
solution. Just for a drag image to inject a DLL into other processes (not to
mention that DDI hooks
only for Win9x and are still 16 bit code). But from this example you can see
the basic problem. No
wonder that the blended drag image was first introduced in W2K and not earlier.

Ciao, Mike


re: Editors for VST

From: [NRYJGUSFSVEY@s...]
Date: Wed Apr 25, 2001 2:48 pm
Subject: Re: [VirtualTreeview] Editors for VST

Hello Manfred!

> I have finished the first beta release of my TVSTEditor class.
>
> I have uploaded it to YG (VSTEdit.zip). Please have a look and do not
> hesitate with your opinion.

I took a look on it (exactly only on the included exe demo). It seems to
be very useful.

But most dialog windows do not have a treeview. But some editors are
useful, anyway, e. g. the file-selection edit. I think it would be great
if all these editors were also available as TEdit/TMaskEdit descendant.

Another thing, when simple-left-clicking on a node in your exe sample,
the editor does not open. Just by pressing F2. Is that correct?

Bye

Marco

--
NJ0Y - Marco Loos, 48165 Münster
http://nj0y.de
PWGen - Der Passwortverwalter: http://www.pwgen.de

Sie haben die Position des Mauszeigers verändert.
Starten Sie Windows neu, damit die Änderungen wirksam werden.

 | Replies | Author | Date
1357 | Re: Editors for VST | [Manfred@F...] | Wed 4/25/2001
1358 | Re: Editors for VST | [DDZEEZXZCCIO@s...] | Wed 4/25/2001


re: Editors for VST

From: [Manfred@F...]
Date: Wed Apr 25, 2001 4:04 pm
Subject: Re: Editors for VST

Hello Marco.

--- In [VirtualTreeview@y...], [NRYJGUSFSVEY@s...] wrote:
> I took a look on it (exactly only on the included exe demo). It
seems to
> be very useful.

Thank you.

> But most dialog windows do not have a treeview. But some editors are
> useful, anyway, e. g. the file-selection edit. I think it would be
great
> if all these editors were also available as TEdit/TMaskEdit
descendant.

Have a look at Readme.txt. String-, StringButton-, Filename- and
Directory-Editor are maskable like TMaskEdit. For the numeric editors
a mask feature is not very usefull.

> Another thing, when simple-left-clicking on a node in your exe
sample,
> the editor does not open. Just by pressing F2. Is that correct?

Yes, but the editor opens also if you click the already focused cell.
It's the same behavior like the VST internal Editor (and Explorer).

cu
Manfred

 | Replies | Author | Date
1358 | Re: Editors for VST | [DDZEEZXZCCIO@s...] | Wed 4/25/2001


re: Re: Editors for VST

From: [DDZEEZXZCCIO@s...]
Date: Wed Apr 25, 2001 6:55 pm
Subject: Re: [VirtualTreeview] Re: Editors for VST

Hi!

> > Another thing, when simple-left-clicking on a node in your exe
> sample,
> > the editor does not open. Just by pressing F2. Is that correct?
>
> Yes, but the editor opens also if you click the already focused cell.
> It's the same behavior like the VST internal Editor (and Explorer).

Sorry, yes, it does :). I guess I did not wait long enough and pressed
F2 too early. With the original TreeView (e. g. Explorer) the editor
opens quicker.

Bye

Marco

--
NJ0Y - Marco Loos, 48165 Münster
http://nj0y.de
PWGen - Der Passwortverwalter: http://www.pwgen.de

Sie haben die Position des Mauszeigers verändert.
Starten Sie Windows neu, damit die Änderungen wirksam werden.


Two small bugs

From: Werner Lehmann [wl@b...]
Date: Wed Apr 25, 2001 6:20 pm
Subject: Two small bugs

Hi,

with fullrowselect static text is hardly readable for selected nodes. Its
text is then still black and not white as the normal text is. Also static
text is simply clipped if the column is not wide enough. Shouldn't it be
shortened as normal text?

And I am experimenting with grid mode and alternating row colors. The
following works fine until...

procedure TMain.ListBeforeItemErase(Sender: TBaseVirtualTree;
Canvas: TCanvas; Node: PVirtualNode; ItemRect: TRect; var Color: TColor;
var EraseAction: TItemEraseAction);
begin
EraseAction := eaColor;
if odd((ItemRect.Top + Sender.OffsetY) div
integer(TVirtualStringTree(Sender).DefaultNodeHeight)) then
Color := clWhite
else
Color := ecLightKaki;
end;

...the tree is scrolled with the thumbtrack. During the scroll (that is
as long as the mouse button is pressed down) the row colors are messed
up. Text is drawn ok, but the the background colors are sometimes not as
high as the node height. Hard to describe. I can probably make a demo
project. The effect is gone when the mouse button is released. The
whole tree is repainted obviously and colors are ok again.

Regards,
Werner

 | Replies | Author | Date
1360 | Re: Two small bugs | Jim Kueneman | Wed 4/25/2001
1361 | Re: Two small bugs | Werner Lehmann | Thu 4/26/2001
1364 | Re: Two small bugs | Mike Lischke | Thu 4/26/2001
1365 | Re: Two small bugs | Mike Lischke | Thu 4/26/2001
1374 | Re: Two small bugs | Werner Lehmann | Thu 4/26/2001


re: Two small bugs

From: "Jim Kueneman" [jimdk@m...]
Date: Wed Apr 25, 2001 7:32 pm
Subject: Re: Two small bugs

--- In [VirtualTreeview@y...], Werner Lehmann [wl@b...] wrote:

Werner

Maybe this is the same problem I see in VET sometimes. During a
DragDrop operation if you drag all the way to the top or bottom the
scrolling get off by a few pixels. The tree stops scrolling and the
cells appear to be fully scrolled but the scrollbar has a small gap
where it could scroll just a *little* bit more. When you drag the
mouse back over VT the redraw of the nodes is off by just the few
pixels. It looks weird.

A redraw of the window gets it back in sync again.

Jim


re: Re: Two small bugs

From: Werner Lehmann [wl@b...]
Date: Thu Apr 26, 2001 12:09 am
Subject: Re: [VirtualTreeview] Re: Two small bugs

Jim Kueneman wrote:
>
> Maybe this is the same problem I see in VET sometimes. During a

Jim,

I have not seen what you describe but it sounds as if it was a
different problem. Text is scrolled correct for me only the background
(alternating) colors are messed up. There is no 'few pixel offset' for
the text. Instead I have some nodes with upper third white and the rest
lightkaki. And only until I release the mouse button.

Werner


Marquee selection in full row select mode

From: Werner Lehmann [wl@b...]
Date: Thu Apr 26, 2001 12:10 am
Subject: Marquee selection in full row select mode

Mike,

I am not sure if I have the latest public beta here but in my version
there is still this typo soHideFocusRect, so maybe you forgot to fix
it or I am not up-to-date :)

One other thing though: I like the grid effect for my listview usage
of the VTree. Only disadvantage so far is that marquee selection with
the mouse (click and drag to select) does not work anymore. This is
probably by design. But any chance to get this back? My suggestion is
that if fullrowselect is active VTree need not care about the horz
position of the selecting mouse cursor, it is always accepted (unless
it is to the right of the last column). In effect it suffices for the
user to click anywhere and drag only vertically to select. What do
you say? Or am I missing something.

I just noticed that the alternating colors approach that I posted under
"Two small bugs" produces sometimes two adjacent lightkaki rows (VTree
in listview/grid style). It seems as if this happens only if I scroll the
list down with keyboard. Not sure if it this the same problem that I
described earlier or a problem with that event handler implementation.
Do you recommend a different way to get alternativ colors (nodes are
all equally high)?

Regards,
Werner

 | Replies | Author | Date
1367 | Re: Marquee selection in full row select mode | Mike Lischke | Thu 4/26/2001
1369 | Re: Marquee selection in full row select mode | Werner Lehmann | Thu 4/26/2001


Subject tag poll

From: Mike Lischke [public@l...]
Date: Thu Apr 26, 2001 12:41 pm
Subject: Subject tag poll

Hi all,

just a little reminder. The poll for the subject tag [VirtualTreeview] is
still open but I will close it next weekend. So far 20 people have voted and
clearly the current situation is prefered. If anyone wants to yet to vote
then please go to: http://groups.yahoo.com/group/VirtualTreeview/polls.

Ciao, Mike


re: Two small bugs

From: Mike Lischke [public@l...]
Date: Thu Apr 26, 2001 1:43 pm
Subject: RE: [VirtualTreeview] Two small bugs

Hi Werner,

> with fullrowselect static text is hardly readable for selected nodes.
> Its text is then still black and not white as the normal text is.
> Also static text is simply clipped if the column is not wide enough.
> Shouldn't it be shortened as normal text?

No, not static text. Static text is special in many regards: it does not get
selected (unless full row selection is enabled), it can't be edited, it is
not shortend, it is not taken into the entire node width, it is not
underlined in hot mode etc. For full row select, however, there should
indeed be a default color which is readable, hence I have included a little
setup for the font color. Usually, however, this gets overwritten by the
application to provide additional visual feedback about the static text's
specialness.

> And I am experimenting with grid mode and alternating row colors. The
> following works fine until...
> ...the tree is scrolled with the thumbtrack.

Actually, it does not work even if you don't use thumb scrolling but only
navigate with the arrow keys. But you are very near to a solution. Subtract
the vertical offset instead adding it. The offset is always <= 0 and
subtracting it makes it actually positive. This should solve your problem.

Ciao, Mike


re: Re: Two small bugs

From: Mike Lischke [public@l...]
Date: Thu Apr 26, 2001 1:46 pm
Subject: RE: [VirtualTreeview] Re: Two small bugs

Hi Jim,

> Maybe this is the same problem I see in VET sometimes. During a
> DragDrop operation if you drag all the way to the top or bottom the
> scrolling get off by a few pixels. The tree stops scrolling and the
> cells appear to be fully scrolled but the scrollbar has a small gap
> where it could scroll just a *little* bit more. When you drag the
> mouse back over VT the redraw of the nodes is off by just the few
> pixels. It looks weird.

No, unfortunately this is a totally different issue. I have already tried
several times to find the reason but it is really difficult to debug because
switching to the IDE will stop dragging and the painting can also not be
seen. Remote debugging might help, but this has other drawbacks.

Anyway, I will investigate this again.

Ciao, Mike


Vertical scrollbar not shown

From: "Paul Istrate" [istech@c...]
Date: Thu Apr 26, 2001 2:50 pm
Subject: Vertical scrollbar not shown

Hi Mike,

I have a problem:

ScrollBarOptions:
AlwaysVisible = True
ScrollBars = ssVertical
ScrollBarStyle = sbmRegular
VerticalIncrement = 20

I have a VST with 2 columns but no nodes at all (nodes are created at user
demand).

The problem is that VerticalScrollBar is not shown. Not even after creating
enough nodes to activate it.

If I resize VST the scrollbar appear.

I check with ScrollBars=ssBoth and I see that HorizontalScrollBar is shown
at initial state but VerticalScrollBar no.

Do I miss something?

BTW, I use the last zip uploaded (2.4beta)

Paul Istrate

 | Replies | Author | Date
1368 | Re: Vertical scrollbar not shown | Mike Lischke | Thu 4/26/2001


re: Marquee selection in full row select mode

From: Mike Lischke [public@l...]
Date: Thu Apr 26, 2001 2:44 pm
Subject: RE: [VirtualTreeview] Marquee selection in full row select mode

Werner,

> I am not sure if I have the latest public beta here but in my version
> there is still this typo soHideFocusRect, so maybe you forgot to fix
> it or I am not up-to-date :)

You are not up-to-date ;-) I wanted already to put a new file onto the YG
server but have not come to this somehow.

> One other thing though: I like the grid effect for my listview usage
> of the VTree. Only disadvantage so far is that marquee selection with
> the mouse (click and drag to select) does not work anymore. This is
> probably by design.

Indeed, this is by design. Be careful however not to mix grid extensions and
full row selection.

> But any chance to get this back?

Well, you have asked me so nicely so I could not resist I have change the
code so that dragging only start if a label is hit (even in full row select
mode) and otherwise draw selection will be initiated :o]

Ciao, Mike


re: Vertical scrollbar not shown

From: Mike Lischke [public@l...]
Date: Thu Apr 26, 2001 3:04 pm
Subject: RE: [VirtualTreeview] Vertical scrollbar not shown

Paul,

> I have a problem:
>
> ScrollBarOptions:
> AlwaysVisible = True
>
> The problem is that VerticalScrollBar is not shown. Not even
> after creating enough nodes to activate it.

This should already be fixed in the latest source. Please wait until I have
uploaded it to YG.

Ciao, Mike


re: Marquee selection in full row select mode

From: Werner Lehmann [wl@b...]
Date: Thu Apr 26, 2001 3:32 pm
Subject: Re: [VirtualTreeview] Marquee selection in full row select mode

Mike Lischke wrote:
>
> Well, you have asked me so nicely so I could not resist I have change the
> code so that dragging only start if a label is hit (even in full row select
> mode) and otherwise draw selection will be initiated :o]

Great!

It was not until tonight in my bed that I discovered the dilemma how to
decide if the user intends to begin a drag (and drop) action or a node
selection. Your idea (click on a node text or node background) did not
come to my mind...

Werner


EAccessViolation in GetNextVisible

From: "Jim Kueneman" [jimdk@m...]
Date: Thu Apr 26, 2001 3:34 pm
Subject: EAccessViolation in GetNextVisible

Hi Mike,

I am working on VET and I have run into a problem I don't quite
understand. I am monitering ShellNotification in a thread and then
posting a message to VET when it needs to update the tree.

When I recieve the message I do this:

procedure TCustomVirtualExplorerTree.RefreshNodeByPIDL(aPIDL:
PItemIDList);
var
Node: PVirtualNode;
begin
if Assigned(aPIDL) then
begin
Node := WalkPIDLToNode(aPIDL, False, False);
if Assigned(Node) then
begin
if Expanded[Node] then
begin
DeleteChildren(Node, True);
Expanded[Node] := True;
end;
end
end
end;

This works great until I try to delete a lot of files. When this
happens I may get a number of the messages in succession.
Occationally I get an access violation during the DeleteChildren call
in the GetNextVisible routine. The Node is assigned but it appears to
be pointing to garbage. It happens after this has been called once
already and is being called again quickly. I know you use threads in
VT, does DeleteChildren use a thread to speed up things in anyway? Do
you have any idea?

Jim

 | Replies | Author | Date
1372 | Re: EAccessViolation in GetNextVisible | James S. Batson | Thu 4/26/2001
1376 | Re: EAccessViolation in GetNextVisible | Werner Lehmann | Thu 4/26/2001
1377 | Re: EAccessViolation in GetNextVisible | Jim Kueneman | Fri 4/27/2001
1380 | Re: EAccessViolation in GetNextVisible | Jim Kueneman | Fri 4/27/2001
1385 | Re: EAccessViolation in GetNextVisible | Mike Lischke | Fri 4/27/2001
1392 | Re: EAccessViolation in GetNextVisible | Mike Lischke | Fri 4/27/2001


New file uploaded to VirtualTreeview

From: [VirtualTreeview@yahoogroups.com>
Date: Thu Apr 26, 2001 3:49 pm
Subject: New file uploaded to VirtualTreeview

Hello,

This email message is a notification to let you know that
a file has been uploaded to the Files area of the VirtualTreeview
group.

File : /VirtualTreeview.zip
Uploaded by : [public@l...]
Description : Version 2.4ß

You can access this file at the URL

http://groups.yahoo.com/group/VirtualTreeview/files/VirtualTreeview.zip

To learn more about file sharing for your group, please visit

http://help.yahoo.com/help/us/groups/files

Regards,

public@l...]


re: EAccessViolation in GetNextVisible

From: "James S. Batson" [jbatson@h...]
Date: Thu Apr 26, 2001 5:08 pm
Subject: RE: [VirtualTreeview] EAccessViolation in GetNextVisible

remove me from this list

-----Original Message-----
From: Jim Kueneman [mailto:[jimdk@m...]]
Sent: Thursday, April 26, 2001 11:35 AM
To: VirtualTreeview@yahoogroups.com
Subject: [VirtualTreeview] EAccessViolation in GetNextVisible

Hi Mike,

I am working on VET and I have run into a problem I don't quite
understand. I am monitering ShellNotification in a thread and then
posting a message to VET when it needs to update the tree.

When I recieve the message I do this:

procedure TCustomVirtualExplorerTree.RefreshNodeByPIDL(aPIDL:
PItemIDList);
var
Node: PVirtualNode;
begin
if Assigned(aPIDL) then
begin
Node := WalkPIDLToNode(aPIDL, False, False);
if Assigned(Node) then
begin
if Expanded[Node] then
begin
DeleteChildren(Node, True);
Expanded[Node] := True;
end;
end
end
end;

This works great until I try to delete a lot of files. When this
happens I may get a number of the messages in succession.
Occationally I get an access violation during the DeleteChildren call
in the GetNextVisible routine. The Node is assigned but it appears to
be pointing to garbage. It happens after this has been called once
already and is being called again quickly. I know you use threads in
VT, does DeleteChildren use a thread to speed up things in anyway? Do
you have any idea?

Jim

To unsubscribe from this group, send an email to:
VirtualTreeview-unsubscribe@egroups.com

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/


gdi error using VirtualStringTree

From: [christophepradel@a...]
Date: Thu Apr 26, 2001 9:32 pm
Subject: gdi error using VirtualStringTree

Hi !
I'm a new user of Virtual Treeview and yet have problems using it :

The problem effect is a general protection failure in GDI.Exe, when
manipulating
TVirtualStringTree at design time in delphi 5 Enterprise, on Windows 98 2nd
edition

Has Some one else met this problem ? I have the same problem with two
different computers and environnements, and no problem in delphi when i
release th component

Thank's for your help

Chris

[Non-text portions of this message have been removed]

 | Replies | Author | Date
1378 | Re: gdi error using VirtualStringTree | Werner Lehmann | Fri 4/27/2001
1384 | Re: gdi error using VirtualStringTree | Mike Lischke | Fri 4/27/2001
1390 | Re: gdi error using VirtualStringTree | Radoslaw Klocek | Fri 4/27/2001
1396 | Re: gdi error using VirtualStringTree | Mike Lischke | Fri 4/27/2001
1408 | Re: gdi error using VirtualStringTree | Alexander Egorushkin | Fri 4/27/2001


re: Two small bugs

From: Werner Lehmann [wl@b...]
Date: Thu Apr 26, 2001 11:11 pm
Subject: Re: [VirtualTreeview] Two small bugs

Mike,

Mike Lischke wrote:
>
> No, not static text. Static text is special in many regards: it does not get
> selected (unless full row selection is enabled), it can't be edited, it is
> not shortend, it is not taken into the entire node width, it is not
> underlined in hot mode etc. For full row select, however, there should
> indeed be a default color which is readable, hence I have included a little
> setup for the font color. Usually, however, this gets overwritten by the
> application to provide additional visual feedback about the static text's
> specialness.

Aha, thanks for the explanation. I always wondered why static text was called
like this: I use it only for volatile text :) (total number of specific childs
for instance).

> > And I am experimenting with grid mode and alternating row colors. The
> > following works fine until...
> > ...the tree is scrolled with the thumbtrack.
>
> Actually, it does not work even if you don't use thumb scrolling but only
> navigate with the arrow keys. But you are very near to a solution. Subtract
> the vertical offset instead adding it. The offset is always <= 0 and
> subtracting it makes it actually positive. This should solve your problem.

Yes, perfect. Thanks.

Regards,
Werner


New VTree release

From: Werner Lehmann [wl@b...]
Date: Thu Apr 26, 2001 11:50 pm
Subject: New VTree release

Hi Mike,

here is my usual bug report for the new release (just kidding! :)
This one was easy to find. You changed DeleteNode:

procedure TBaseVirtualTree.DeleteNode(Node: PVirtualNode);
...
if Node.Parent = FRoot then
Parent := nil
else
Parent := Node.Parent;
...
InvalidateToBottom(Parent); [NEW]
InvalidateToBottom(Node.Parent); [OLD]
...

If a top level node is deleted parent is FRoot and InvalidateToBottom
is called with nil:

procedure TBaseVirtualTree.InvalidateToBottom(Node: PVirtualNode);
...
if (FUpdateCount = 0) and ([vsInitialized, vsVisible] * Node.States =
[vsInitialized, vsVisible])) then

Access Violation. My (possibly interims) fix:

if (FUpdateCount = 0) and ((Node = nil) or ([vsInitialized, vsVisible] *
Node.States =
[vsInitialized, vsVisible])) then

BTW, it occurs to me that this release draws quicker. Before I had some
'stuttering' display occasionally. Don't know if you did anything relevant
here, maybe it's only my imagination...

I have checked out the triangles. Although they really look interesting
it is obviously intended to use them without treelines. Since the lines
are not 'aligned' to the triangles: vertical lines go across the triangle
(I would expect them to line up with the vertical triangle line), the
same is true for 'down arrow' triangles and horizontal tree lines. I have
experimented with omitting the tree lines but it can be confusing in medium
sized to large trees. Another downside of no treelines is that all top level
nodes have a large and blank gap at first (until some of them get their
child nodes and the triangle appears; maybe if I reduce the indentation...).

Finally, drag image and no end: remember my new alternating row/node colors?
I can 'erase' them with the drag image on the same VTree, rubber style.

Regards,
Werner

 | Replies | Author | Date
1383 | Re: New VTree release | Mike Lischke | Fri 4/27/2001


re: EAccessViolation in GetNextVisible

From: Werner Lehmann [wl@b...]
Date: Thu Apr 26, 2001 11:51 pm
Subject: Re: [VirtualTreeview] EAccessViolation in GetNextVisible

Jim Kueneman wrote:
>
> This works great until I try to delete a lot of files. When this
> happens I may get a number of the messages in succession.
> Occationally I get an access violation during the DeleteChildren call
> in the GetNextVisible routine. The Node is assigned but it appears to
> be pointing to garbage. It happens after this has been called once
> already and is being called again quickly. I know you use threads in
> VT, does DeleteChildren use a thread to speed up things in anyway? Do
> you have any idea?

You can guarantee that the method is not re-entered while it is being
processed? Maybe some ProcessMessages in a 'hidden' location? If not
try and set a boolean 'processing' constant and add an assertion that
it has to be false like this:

const
processing: boolean = false;
begin
assert(not processing);
processing := true;
try
...
finally
processing := false;
end;
end;

This is only meant as a debugging tool of course. If the assertion fails
you get a usable stack trace :)

BTW, is it intended that only already expanded nodes are refreshed?
What if a node is not expanded anymore but has children which need
to be refreshed? Just a thought, I don't know if this case can happen.

Regards,
Werner

 | Replies | Author | Date
1377 | Re: EAccessViolation in GetNextVisible | Jim Kueneman | Fri 4/27/2001
1380 | Re: EAccessViolation in GetNextVisible | Jim Kueneman | Fri 4/27/2001


re: EAccessViolation in GetNextVisible

From: "Jim Kueneman" [jimdk@m...]
Date: Fri Apr 27, 2001 12:09 am
Subject: Re: EAccessViolation in GetNextVisible

--- In [VirtualTreeview@y...], Werner Lehmann [wl@b...] wrote:
> Jim Kueneman wrote:
>
> You can guarantee that the method is not re-entered while it is
being
> processed? Maybe some ProcessMessages in a 'hidden' location? If not
> try and set a boolean 'processing' constant and add an assertion

I never use ProcessMessages, unless Mike has it hidden some were it
should not be able to do this

>
> This is only meant as a debugging tool of course. If the assertion
fails
> you get a usable stack trace :)

I will give it a try, but in the new version of VT it crashes every
time! Now I can figure it out!

> BTW, is it intended that only already expanded nodes are refreshed?
> What if a node is not expanded anymore but has children which need
> to be refreshed? Just a thought, I don't know if this case can

Yes you are right. This is a work in progress and that was as stop
gap solution. What I really want to know if the Children are
initialized, which I have not spent anytime seeing how to do that. I
am sure it is easy I just have not looked for it.

Thanks,
Jim

 | Replies | Author | Date
1380 | Re: EAccessViolation in GetNextVisible | Jim Kueneman | Fri 4/27/2001


re: gdi error using VirtualStringTree

From: Werner Lehmann [wl@b...]
Date: Thu Apr 26, 2001 11:57 pm
Subject: Re: [VirtualTreeview] gdi error using VirtualStringTree

[christophepradel@a...] wrote:
>
> Has Some one else met this problem ? I have the same problem with two
> different computers and environnements, and no problem in delphi when i
> release th component

Yes, it has been suspected that a localized win98 might be blamed here.
See this thread from April 20:

"Bug in VTree 1.31"

(You can access all messages via web interface in yahoo groups.)

Regards,
Werner


OnChange Event Firing Multiple Times

From: Rea Berryman [fberrym1@t...]
Date: Fri Apr 27, 2001 1:56 am
Subject: OnChange Event Firing Multiple Times

I have created a small example app that displays an integer that is
incremented each time the OnChange event occurs.

I noticed that the OnChange event:

1. Is fired twice for each "single" mouse click even if the node is
already selected.
2. Fires only once as expected if you navigate the nodes using the up
and down arrows.
3. Continues firing if you are at the top or bottom of the tree and
continue to hold down the Up or down arrows respectively.
4. Continuously fires if you hold down the left or right arrows.

Am I doing something wrong? Any ideas?

Thanks,
Rea

 | Replies | Author | Date
1391 | Re: OnChange Event Firing Multiple Times | Mike Lischke | Fri 4/27/2001
1404 | Re: OnChange Event Firing Multiple Times | Rea Berryman | Fri 4/27/2001
1406 | Some bugs in 2.4 | Alexander Egorushkin | Fri 4/27/2001
1409 | Re: Some bugs in 2.4 | [adembaba@e...] | Sat 4/28/2001
1419 | DBVT - a short description | Alexander Egorushkin | Sat 4/28/2001
1423 | Re: DBVT - a short description | Mike Lischke | Sat 4/28/2001
1429 | Re: DBVT - a short description | [adembaba@e...] | Sat 4/28/2001
1488 | Re: DBVT - a short description | Alexander Egorushkin | Mon 4/30/2001
1492 | Re: DBVT - a short description | [adembaba@e...] | Mon 4/30/2001


re: EAccessViolation in GetNextVisible

From: "Jim Kueneman" [jimdk@m...]
Date: Fri Apr 27, 2001 3:35 am
Subject: Re: EAccessViolation in GetNextVisible

--- In [VirtualTreeview@y...], "Jim Kueneman" [jimdk@m...] wrote:
> --- In [VirtualTreeview@y...], Werner Lehmann [wl@b...] wrote:
> > Jim Kueneman wrote:

>
> I will give it a try, but in the new version of VT it crashes every
> time! Now I can figure it out!

Mike,

I think I understand what is happening. When I call DeleteChildren
it starts with this loop:

Run := Node.LastChild;
while Assigned(Run) do
begin
if NodeVisible and (vsVisible in Run.States) then
Dec(FVisibleCount);

Include(Run.States, vsDeleting);
Mark := Run;
Run := Run.PrevSibling;
if Assigned(Run) then
Run.NextSibling := nil;
DeleteNode(Mark)
end;

All is fine until it gets to the last child. At that time Run is nil
and it enters the DeleteNode(Mark) call.

In DeleteNode it deletes its children, then itself (remember this
point)

....
DeleteChildren(Node);
InternalDisconnectNode(Node);
DoFreeNode(Node);
InvalidateCache;
if FUpdateCount = 0 then
begin
ValidateCache;
UpdateScrollbars(True);
....

Then updates the scrollbars:

In UpdateScrollbars it calls UpdateHorizonatalScrollbar:

in UpdateHorizontalScrollbar it tries to GetMaxRightExtend:

if FHeader.UseColumns then
FRangeX := FHeader.FColumns.TotalWidth
else
FRangeX := GetMaxRightExtend;

In GetMaxRightExtend it iterates through VisibleNodes to calcualate
the the scrollbar:

// Get next visible node and update left node position.
NextNode := GetNextVisible(Node);
if NextNode = nil then

In GetNextVisible(Node) is the problem:

// Child nodes are the first choice if possible.
if (vsExpanded in Result.States) and Assigned(Result.FirstChild)
then
begin
Result := Result.FirstChild;
ForceSearch := False;
end
else

Note all the way back in the begining the child nodes where being
freed. On the last node that is freed (which is the Result.FirstNode)
the memory has been freed but it has not set its FirstNode to nil. As
such it sets Result to FirstChild, which is invalid memory as it was
released. The next line that uses Result.States give me the AV.

I have tried a few ideas but they caused problems elsewhere. One was
to try to see if the node is the first node of its parent right before
it is deleted in DoDeleteNode and if it was set the Parent.FirstChild
to nil. Big failure. I don't understand what is under the hood of VT
to try to figure this out :^)

Any ideas?

Jim


Toggle animation

From: GIANNAKOPOULOS KOSTAS [kyan@s...]
Date: Fri Apr 27, 2001 7:55 am
Subject: Toggle animation

Good morning Mike.

I just got the latest version of VT and there seens to be a bug in toggle
animation when you have full row select:
For as long as the animation runs a part of the animated area (the part that
is not "blitted" i think) is black. This does not happen when full row
select is off.

 | Replies | Author | Date
1382 | Toggle animation | GIANNAKOPOULOS KOSTAS | Fri 4/27/2001
1388 | Toggle animation | GIANNAKOPOULOS KOSTAS | Fri 4/27/2001
1395 | Re: Toggle animation | Mike Lischke | Fri 4/27/2001


Toggle animation

From: GIANNAKOPOULOS KOSTAS [kyan@s...]
Date: Fri Apr 27, 2001 7:59 am
Subject: Toggle animation

Well, after having a 2nd look, i think that it doesn't have to do with full
row select.
However, there *are* cases that the black area does not appear and the
toggle animation works ok.


re: New VTree release

From: Mike Lischke [public@l...]
Date: Fri Apr 27, 2001 10:26 am
Subject: RE: [VirtualTreeview] New VTree release

Hi Werner,

> here is my usual bug report for the new release (just kidding! :)

Hey, I appreciate that you find bugs for me. Only the bugs mentioned to me
can be removed, otherwise they would stay in code.

> If a top level node is deleted parent is FRoot and InvalidateToBottom
> is called with nil:
>
> procedure TBaseVirtualTree.InvalidateToBottom(Node: PVirtualNode);
> ...
> if (FUpdateCount = 0) and ([vsInitialized, vsVisible] *
> Node.States = [vsInitialized, vsVisible])) then

This is one of the really stupid errors, because two lines down I checked
for unassigned nodes. This check must of course be before I check
visibility. This is now fixed.

> BTW, it occurs to me that this release draws quicker. Before
> I had some 'stuttering' display occasionally. Don't know if you did
> anything relevant here, maybe it's only my imagination...

Your senses serve you well. I have done some optimizations in order to avoid
painting whereever possible and also to avoid repeated unnecessary value
determination as it happend for column bounds and similar. I tested a tree
with 10000 columns and it was unusuable because painting was extremely slow,
even if there were only 2 columns in view. Now this is at least usable,
although it is still quite slow when painting columns far on the right. For
the time being this is acceptable, however, since 10000 columns are too much
for everyday use. I only want to make sure VT still works under extreme
situations (with -40° temperature and stormy wind forces VT works still fine
;-P).

> I have checked out the triangles. Although they really look
> interesting it is obviously intended to use them without treelines.

Yes indeed. I want to write a custom draw example and this will show one
situation where the classical buttons and tree lines look not so nice.

> Finally, drag image and no end: remember my new alternating
> row/node colors? I can 'erase' them with the drag image on the same VTree,

> rubber style.

What you want to accomplish is quite tricky. In order to make it really
correct you have to determine the actual top offset of node yourself instead
of relying on the given item rect which is relative to the surface where the
node is drawn to. Hence your code must look like:

procedure TfrmGeneralAbilities.VST2BeforeItemErase(
Sender: TBaseVirtualTree; Canvas: TCanvas; Node: PVirtualNode;
ItemRect: TRect; var Color: TColor; var EraseAction: TItemEraseAction);

var
R: TRect;

begin
EraseAction := eaColor;
R := Sender.GetDisplayRect(Node, NoColumn, False);
if odd((R.Top - Sender.OffsetY) div
integer(TVirtualStringTree(Sender).DefaultNodeHeight)) then
Color := clWhite
else
Color := ecLightKaki;
end;

The display speed is still acceptable (even on my 350Mhz office machine),
but scrolling while dragging looks already funny because the time when the
tree is drawn and the time when the drag image is draw is quite far away.
Perhaps I can bring both nearer together.

Ciao, Mike


re: gdi error using VirtualStringTree

From: Mike Lischke [public@l...]
Date: Fri Apr 27, 2001 10:40 am
Subject: RE: [VirtualTreeview] gdi error using VirtualStringTree

> Yes, it has been suspected that a localized win98 might be
> blamed here.
> See this thread from April 20:
>
> "Bug in VTree 1.31"
>
> (You can access all messages via web interface in yahoo groups.)

Has anybody already tried to use VT 2.x on such a system? Unfortunately I
have no idea what the cause could be. On my machine (alternate Win98SE OS)
it worked well. There is however an issue regarding the GetDCEx command on
Win9x/ME systems. Search through the code for GetDCEx.

Ciao, Mike


re: Re: EAccessViolation in GetNextVisible

From: Mike Lischke [public@l...]
Date: Fri Apr 27, 2001 10:38 am
Subject: RE: [VirtualTreeview] Re: EAccessViolation in GetNextVisible

> I never use ProcessMessages, unless Mike has it hidden some were it
> should not be able to do this

I'm very careful with using ProcessMessages because it can produce a lot of
trouble and unexpected behaviour. In VT however I need it in one place: hint
animations. It is necessary to allow the user to work with the tree and the
application also during a hint animation. Perhaps I can utilize the thread
instead at a later stage.

> Yes you are right. This is a work in progress and that was as stop
> gap solution. What I really want to know if the Children are
> initialized, which I have not spent anytime seeing how to do that. I
> am sure it is easy I just have not looked for it.

I recommend that you look first throught the properties and methods
regarding child nodes which are provided by the tree. There is a property
ChildrenInitialized to learn if the child nodes of a particular node are
already initialized. You can use ReinitNode/ReinitChildren to force a new
initialization as well as ResetNode to remove all child nodes of a
particular node and set its state to unitialized (but without forcing
initialization).

Ciao, Mike


New file uploaded to VirtualTreeview

From: [VirtualTreeview@yahoogroups.com>
Date: Fri Apr 27, 2001 11:08 am
Subject: New file uploaded to VirtualTreeview

Hello,

This email message is a notification to let you know that
a file has been uploaded to the Files area of the VirtualTreeview
group.

File : /VSTEdit.zip
Uploaded by : [Manfred@F...]
Description : Editor components (not only) for VirtualStringTree V1.0 beta

You can access this file at the URL

http://groups.yahoo.com/group/VirtualTreeview/files/VSTEdit.zip

To learn more about file sharing for your group, please visit

http://help.yahoo.com/help/us/groups/files

Regards,

Manfred@F...]


new editors

From: [Manfred@F...]
Date: Fri Apr 27, 2001 11:14 am
Subject: new editors

Greetings to all users of VirtualTrees and especially Mike.

Because the TVSTEditor class was a quick hack for my own need i've
made it totally new.
TVSTEditor is down.

I have made a new set of editor components (basically four).

TMFEdit string editor (based on TMaskEdit)
TMFButtonEdit string editor with button (based on TMFEdit)
TMFNumEdit numeric editor with spin buttons and slider
(C++ port from Boian Mitov, based on TMFEdit)
TMFDateTimeEdit date/time editor (currently based on
TDateTimePicker)

More to come in the next days. You can use this editors on a form
like every other editor. So you have the same look and feel between
VST editing and other editors in the program.
The RXLib components are no longer needed. ;-)

Additionally exists a non-visual component: TVSTEditor. This
component links the editors with TVirtualStringTree.
Now you can set the properties for the editors at design time. The
usability is simpler, you must only the entries in OnCreateEditor()
and OnNewData() coded by hand.
OnNeedData() is obsolete, the value is passed in OnCreateEditor().

Have a look at the example code and Readme.txt. There is currently no
help available.
For installation of the components i included extended versions of
the VT dpk files for delphi 4 and 5.
Because i don't have Delphi 4 anymore, i have no possibility to test
it.

I have uploaded the file VSTEdit.zip to YG.

A last annotation.
I have worked on this code at the last 2 days. So it's an early beta
and not fully tested. You can send suggestions and bug reports
directly to me ([Manfred@F...]) or post it to YG.

cu
Manfred

 | Replies | Author | Date
1393 | Re: new editors | Mike Lischke | Fri 4/27/2001
1398 | Re: new editors | Jim Kueneman | Fri 4/27/2001
1399 | Re: new editors | GIANNAKOPOULOS KOSTAS | Fri 4/27/2001
1400 | Re: new editors | Fraser, Pete [Soundcraft UK] | Fri 4/27/2001
1405 | Re: new editors: notes for BCB users | Alexander Egorushkin | Fri 4/27/2001
1453 | Re: new editors: notes for BCB users | [Manfred@F...] | Sun 4/29/2001


Toggle animation

From: GIANNAKOPOULOS KOSTAS [kyan@s...]
Date: Fri Apr 27, 2001 11:44 am
Subject: Toggle animation

I think i found the condition where black aread appear during toggle
animation:

It is when BevelKind has a value other than bkNone.

<KY>


Actual Release

From: [guido.klapperich@t...]
Date: Fri Apr 27, 2001 11:59 am
Subject: Actual Release

I have seen, on YahooGroups there is a version 2.4 of VirtualTreeview,
but on the webpage the actual release is 1.31. Which is the actual non
beta release ?

Guido

 | Replies | Author | Date
1394 | Re: Actual Release | Mike Lischke | Fri 4/27/2001


re: gdi error using VirtualStringTree

From: "Radoslaw Klocek" [pronet@p...]
Date: Fri Apr 27, 2001 12:24 pm
Subject: Re: [VirtualTreeview] gdi error using VirtualStringTree

>
> Has anybody already tried to use VT 2.x on such a system? Unfortunately I
> have no idea what the cause could be. On my machine (alternate Win98SE OS)
> it worked well. There is however an issue regarding the GetDCEx command on
> Win9x/ME systems. Search through the code for GetDCEx.
>

VT 2.4 works OK (Windows 98 PL).

--
Radoslaw Klocek


re: OnChange Event Firing Multiple Times

From: Mike Lischke [public@l...]
Date: Fri Apr 27, 2001 12:28 pm
Subject: RE: [VirtualTreeview] OnChange Event Firing Multiple Times

Hi Rea,

> I noticed that the OnChange event:
> 1. Is fired twice for each "single" mouse click even if the node is
> already selected.

One of these both events comes with a node = nil which indicates a cleared
selection. So you can easily filter.

> 2. Fires only once as expected if you navigate the nodes using the up
> and down arrows.

Although you expected it so I have changed it so that it is consistent with
the rest of the code. You will now also get two events. One with nil for the
cleared selection and one with the new node selected (if the focus has
changed).

> 3. Continues firing if you are at the top or bottom of the tree and
> continue to hold down the Up or down arrows respectively.

Fixed. There will now be no event at all anymore because the focus does not
change, unless the old selection was more than one node. In this case you
will get one event for the cleared selection.

> 4. Continuously fires if you hold down the left or right arrows.

Fixed. This was the same effect as in 3.

Ciao, Mike


re: Re: EAccessViolation in GetNextVisible

From: Mike Lischke [public@l...]
Date: Fri Apr 27, 2001 12:45 pm
Subject: RE: [VirtualTreeview] Re: EAccessViolation in GetNextVisible

Hi Jim,

> DeleteChildren(Node);
> InternalDisconnectNode(Node);
> DoFreeNode(Node);
> InvalidateCache;
> if FUpdateCount = 0 then
> begin
> ValidateCache;
> UpdateScrollbars(True);
> ....
>
> Then updates the scrollbars:...
> In GetNextVisible(Node) is the problem:...
> Note all the way back in the begining the child nodes where being
> freed. On the last node that is freed (which is the
> Result.FirstNode) the memory has been freed but it has not set its
FirstNode to nil. As
> such it sets Result to FirstChild, which is invalid memory as it was
> released. The next line that uses Result.States give me the AV.

Unfortunately your trace is not valid this way. In the code I left above you
can see that Node is disconnected from its parent before the scroll bars are
updated (why the heck don't you use BeginUpdate/EndUpdate?). So there is no
dangling and invalid reference anymore. Hence the wrong memory must be
caused by another problem.

> Any ideas?

Unfortunately not. I haven't even come across the problem...

Ciao, Mike


re: new editors

From: Mike Lischke [public@l...]
Date: Fri Apr 27, 2001 1:22 pm
Subject: RE: [VirtualTreeview] new editors

Hi Manfred,

> Because the TVSTEditor class was a quick hack for my own need i've
> made it totally new.

Hey, this is excellent news. Quite similar to Jim's VET. He also only wanted
to make a simple example and now his ambition gives him no rest until VET is
perfect :-) This is the material of which real programmers are made of ...

> More to come in the next days. You can use this editors on a form
> like every other editor. So you have the same look and feel between
> VST editing and other editors in the program.
> The RXLib components are no longer needed. ;-)

Perfect. If you write an own help for your editors then you don't need to
take care about publication of the next VT version. But it would be cool if
there would be an initial package.

> Have a look at the example code and Readme.txt. There is currently no
> help available.

I'll do as soon as I find the time, promised.

Ciao, Mike

 | Replies | Author | Date
1398 | Re: new editors | Jim Kueneman | Fri 4/27/2001


re: Actual Release

From: Mike Lischke [public@l...]
Date: Fri Apr 27, 2001 1:24 pm
Subject: RE: [VirtualTreeview] Actual Release

Hi Guido,

> I have seen, on YahooGroups there is a version 2.4 of
> VirtualTreeview,
> but on the webpage the actual release is 1.31. Which is the actual non
> beta release ?

Version 1.31 is still the last non-beta. People here (and privately) are so
active sending me bug reports that I had a lot to do to fix them. Now it
seems to come to an end I could finally start documentation. As soon as the
help file is updated the new version will be published.

Ciao, Mike


re: Toggle animation

From: Mike Lischke [public@l...]
Date: Fri Apr 27, 2001 1:30 pm
Subject: RE: [VirtualTreeview] Toggle animation

Good afternoon Kostas,

> I think i found the condition where black aread appear during toggle
> animation:
>
> It is when BevelKind has a value other than bkNone.

Thank you for working this out. Indeed I have to set the tree's brush color
to the tree's color. I assumed this would always be the color of the window
itself, but under some circumstances it is not. Now this is fixed too.

Ciao, Mike


re: gdi error using VirtualStringTree

From: Mike Lischke [public@l...]
Date: Fri Apr 27, 2001 1:34 pm
Subject: RE: [VirtualTreeview] gdi error using VirtualStringTree

> VT 2.4 works OK (Windows 98 PL).

Excellent. We get them all...:o]

Ciao, Mike


re: DoPaintText

From: Mike Lischke [public@l...]
Date: Fri Apr 27, 2001 1:44 pm
Subject: Re: DoPaintText

... moved here from private mail...

> > if Tree is TCustomVirtualStringTree then
> > with TVirtualStringTree(Tree) do
> > DoPaintText(Node, Self.Canvas, Column, ttNormal);
> >
> > to use DoPaintText only if the tree is a string tree. I
> cannot use "as"
> here
> > because this will throw an exception if the tree is not a
> string tree. And
> > simply casting the tree is also not a good option because
> when you derive
> a
> > tree from the base tree then it does not have the
> DoPaintText method and
> > this method should therefore also not be called.
> >
>
> As you wrote, there is a check and DoPaintNode won't be
> called for trees
> other then TCustomVirtualStringTree or its descsendants...
> and they will
> always have DoPaintNode as TCustomVirtualStringTree does.
> Maybe I don't understand something...

Do you mean to use both, the check if it is a string tree (descentant) *and*
the as operator? But then "as" would be unnecessary because the check has
already been made.

Ciao, Mike

 | Replies | Author | Date
1638 | Re: DoPaintText | Radoslaw Klocek | Mon 5/7/2001
1641 | Re: DoPaintText | Mike Lischke | Mon 5/7/2001


re: new editors

From: "Jim Kueneman" [jimdk@m...]
Date: Fri Apr 27, 2001 2:07 pm
Subject: Re: new editors

--- In [VirtualTreeview@y...], Mike Lischke [public@l...] wrote:
> Hey, this is excellent news. Quite similar to Jim's VET. He also
only wanted
> to make a simple example and now his ambition gives him no rest
until VET is
> perfect :-) This is the material of which real programmers are made
of ...

No, I concider it a sickness which my wife is trying to cure me of
(she is a nurse after all) :^)

Jim


re: new editors

From: GIANNAKOPOULOS KOSTAS [kyan@s...]
Date: Fri Apr 27, 2001 2:17 pm
Subject: RE: [VirtualTreeview] new editors

Good afternoon Manfred.

> I have worked on this code at the last 2 days. So it's an early beta
> and not fully tested. You can send suggestions and bug reports
> directly to me ([Manfred@F...]) or post it to YG.

A suggestion: Consider using AnimateWindow in your editors with drop-down to
simulate the unfold effect of comboboxes in Win98/2000.


re: Re: new editors

From: "Fraser, Pete [Soundcraft UK]" [pete.fraser@f...]
Date: Fri Apr 27, 2001 2:21 pm
Subject: RE: [VirtualTreeview] Re: new editors

Don't VETs cure animals - they do in the UK....(or is that cull animals?)
oops

Pete

-----Original Message-----
From: Jim Kueneman [mailto:[jimdk@m...]]
Sent: 27 April 2001 15:07
To: [VirtualTreeview@yahoogroups.com
Subject: [VirtualTreeview] Re: new editors

--- In [VirtualTreeview@y...], Mike Lischke <public@l...] wrote:
> Hey, this is excellent news. Quite similar to Jim's VET. He also
only wanted
> to make a simple example and now his ambition gives him no rest
until VET is
> perfect :-) This is the material of which real programmers are made
of ...

No, I concider it a sickness which my wife is trying to cure me of
(she is a nurse after all) :^)

Jim

Yahoo! Groups Sponsor

<http://rd.yahoo.com/M=190481.1393724.2979175.2/D=egroupmail/S=1700115362:N/
A=613934/?http://www.newaydirect.com> www.newaydirect.com

<http://us.adserver.yahoo.com/l?M=190481.1393724.2979175.2/D=egroupmail/S=17
00115362:N/A=613934/rand=739871856>

To unsubscribe from this group, send an email to:
VirtualTreeview-unsubscribe@egroups.com

Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service
<http://docs.yahoo.com/info/terms/> .

[Non-text portions of this message have been removed]


problems with icons

From: "Moritz Franckenstein" [franckenstein@a...]
Date: Fri Apr 27, 2001 2:31 pm
Subject: problems with icons

hi,

i have moved from 1.31 to 2.4, and now all icons with index >= 4 are
overlapped with icon 0 !?

any ideas?

-moritz

 | Replies | Author | Date
1402 | Re: problems with icons | Mike Lischke | Fri 4/27/2001
2870 | Re: problems with icons | [ian.yahoogroups@a...] | Wed 7/4/2001
2872 | Re: problems with icons | Jim Kueneman | Wed 7/4/2001


re: problems with icons

From: "Mike Lischke" [public@l...]
Date: Fri Apr 27, 2001 3:57 pm
Subject: RE: [VirtualTreeview] problems with icons

Moritz,

> i have moved from 1.31 to 2.4, and now all icons with index >= 4 are
> overlapped with icon 0 !?

I bet you have an OnGetImageIndex event handler which does not check the type
of the image to
return. This can be ikNormal, ikSelected and ikState.

Ciao, Mike

 | Replies | Author | Date
2870 | Re: problems with icons | [ian.yahoogroups@a...] | Wed 7/4/2001
2872 | Re: problems with icons | Jim Kueneman | Wed 7/4/2001


DragImage with Full row select

From: [teusjdejong@p...]
Date: Fri Apr 27, 2001 8:48 pm
Subject: DragImage with Full row select

Mike,

I'm very pleased with the (significant) increase of speed of the
latest version. I'm also pleased to see that a bug in the two
previous releases (when I selected an adjacent group of rows, I could
not deselect one of then with Ctr-click) has been fixed. I wanted to
report a new bug, but I see this already has been reported
(DeleteNode when parent is nil). I've got one remaining problem, but
maybe this is by design. When full row select is on, dragging an
Image with Draimage diMainColumnOnly gives an empty dragimage if you
begin dragging in another column then the main column. This was not
the case in the previous version.

BTW, I hope to finish my demo this weekend.

As you like to say, Ciao,

Teus de Jong

 | Replies | Author | Date
1416 | Re: DragImage with Full row select | Mike Lischke | Sat 4/28/2001
1431 | Re: DragImage with Full row select | Werner Lehmann | Sat 4/28/2001
1442 | Re: DragImage with Full row select | Mike Lischke | Sun 4/29/2001
1509 | Re: DragImage with Full row select | Werner Lehmann | Tue 5/1/2001


re: OnChange Event Firing Multiple Times

From: Rea Berryman [fberrym1@t...]
Date: Fri Apr 27, 2001 9:16 pm
Subject: Re: [VirtualTreeview] OnChange Event Firing Multiple Times

Wow! Unbelievably fast response. Thanks Mike!!

Rea

 | Replies | Author | Date
1406 | Some bugs in 2.4 | Alexander Egorushkin | Fri 4/27/2001
1409 | Re: Some bugs in 2.4 | [adembaba@e...] | Sat 4/28/2001
1419 | DBVT - a short description | Alexander Egorushkin | Sat 4/28/2001
1423 | Re: DBVT - a short description | Mike Lischke | Sat 4/28/2001
1429 | Re: DBVT - a short description | [adembaba@e...] | Sat 4/28/2001
1488 | Re: DBVT - a short description | Alexander Egorushkin | Mon 4/30/2001
1492 | Re: DBVT - a short description | [adembaba@e...] | Mon 4/30/2001
1493 | Re: DBVT - a short description | Alexander Egorushkin | Tue 5/1/2001
1498 | Re: DBVT - a short description | [adembaba@e...] | Tue 5/1/2001


re: new editors: notes for BCB users

From: "Alexander Egorushkin" [egorushkin@m...]
Date: Fri Apr 27, 2001 11:41 pm
Subject: RE: [VirtualTreeview] new editors: notes for BCB users

Manfred, thank you very much for your components!

But I have some points to discuss:

0) Ronald and other BCB users, if you want to use these components, you
should use this code in OnCreateEditor:

void __fastcall TForm1::VirtualStringTree1CreateEditor(
TBaseVirtualTree *Sender, PVirtualNode Node, int Column,
IVTEditLink **EditLink)
//Do not forget to make EditLink pointer to
interface!
{
_di_IVTEditLink Temp;
...
//Creating string editor
VSTEditor1->LinkEditor(Temp, StringWithText);
// Now we have to increase reference count for Temp (because the destructor
of DelphiInterface<>
//calls Release)
//This is the best way, but I don't know how to get GUID of IVTEditLink
//Temp->QueryInterface(IID_IVTEditLink, (void**)&Temp);

//This also works
Temp->AddRef();
//Initialize out parameter here
*EditLink = (IVTEditLink* )Temp;
}

1) OnNewText and OnCancelEdit are disabled by your editors. I think this is
not a good idea.

2) When I press Esc DoNewData is called (?). I expect Esc to cancel editing
(so DoNewData mustn't be called). I think these properties should be added
in TVSTEditor (?):
- Stop Conditions - when to stop (enter, esc, focus, etc),
- Succeed Conditions (enter, focus, etc),
- DispatchByParent (whether the tree handles messages like KEYDOWN with
parameter VK_UP or VK_DOWN; this may be useful if we want to emulate
property dialog).

With respect,
Alex.

> Greetings to all users of VirtualTrees and especially Mike.
>
> Because the TVSTEditor class was a quick hack for my own need i've
> made it totally new.
> TVSTEditor is down.
>
> I have made a new set of editor components (basically four).
>
> TMFEdit string editor (based on TMaskEdit)
> TMFButtonEdit string editor with button (based on TMFEdit)
> TMFNumEdit numeric editor with spin buttons and slider
> (C++ port from Boian Mitov, based on TMFEdit)
> TMFDateTimeEdit date/time editor (currently based on
> TDateTimePicker)
>
> More to come in the next days. You can use this editors on a form
> like every other editor. So you have the same look and feel between
> VST editing and other editors in the program.
> The RXLib components are no longer needed. ;-)
>
> Additionally exists a non-visual component: TVSTEditor. This
> component links the editors with TVirtualStringTree.
> Now you can set the properties for the editors at design time. The
> usability is simpler, you must only the entries in OnCreateEditor()
> and OnNewData() coded by hand.
> OnNeedData() is obsolete, the value is passed in OnCreateEditor().
>
> Have a look at the example code and Readme.txt. There is currently no
> help available.
> For installation of the components i included extended versions of
> the VT dpk files for delphi 4 and 5.
> Because i don't have Delphi 4 anymore, i have no possibility to test
> it.
>
> I have uploaded the file VSTEdit.zip to YG.
>
> A last annotation.
> I have worked on this code at the last 2 days. So it's an early beta
> and not fully tested. You can send suggestions and bug reports
> directly to me ([Manfred@F...]) or post it to YG.
>
> cu
> Manfred
>
>
>
> To unsubscribe from this group, send an email to:
> [VirtualTreeview-unsubscribe@egroups.com
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>
>

Replies Author Date


Some bugs in 2.4

From: "Alexander Egorushkin" [egorushkin@m...]
Date: Fri Apr 27, 2001 11:41 pm
Subject: Some bugs in 2.4

Hi, Mike!
I'm again here!

I've noticed some bugs in the previous beta:
1) When the tree in empty and hoDblClickResize is set, on double clicking on
the edge of the header application crashes in GetNextVisible (Node mustn't
be the hidden root node). This is called from

function TBaseVirtualTree.GetMaxColumnWidth(Column: Integer): Integer;

...
Run := GetFirstVisible; //!!!!!!!!!!!!!!!!!!!!!!!
if Column = FHeader.MainColumn then
begin
if voShowRoot in FOptions then
NodeLeft := Integer((GetNodeLevel(Run) + 1) * FIndent)
else
NodeLeft := Integer(GetNodeLevel(Run) * FIndent);

WithCheck := (voCheckSupport in FOptions) and Assigned(FCheckImages);
end
else
begin
NodeLeft := 0;
WithCheck := False;
end;
while Assigned(Run) do
begin
TextLeft := NodeLeft;
if WithCheck and (Run.CheckType <> ctNone) then
Inc(TextLeft, CheckOffset);
if WithImages and (DoGetImageIndex(Run, ikNormal, Column, Ghosted) > -1)
then
Inc(TextLeft, ImageOffset);
if WithStateImages and (DoGetImageIndex(Run, ikState, Column, Ghosted)
> -1) then
Inc(TextLeft, StateImageOffset);

CurrentWidth := DoGetNodeWidth(Run, Column);

if Result < (TextLeft + CurrentWidth) then
Result := TextLeft + CurrentWidth;

// Get next visible node and update left node position if needed.
NextNode := GetNextVisible(Run); //????????????? - CRASH (assert)

if NextNode = nil then
Break;
if Column = Header.MainColumn then
Inc(NodeLeft, CountLevelDifference(Run, NextNode) * Integer(FIndent));
Run := NextNode;
end;

2) IsVisible[Node] = false works ugly :( Could you fix it (of course if it
will not take much time)? It looks like

- Node
|
- Node
| |
| - Node
|
|
[Hidden node] - the node is hidden but tree lines to the node are shown :(

3) Do you use ScratchBlt when draw Node images? My 16x16 icons deformates
when HodeHeight = 18.

4) I have the first version of DB-aware VST (v 0.001 - I'm too
self-critical). If you wish I could send you a demo, source and a short
description. It is written in C++, does anybody have an idea how Delphi
users can install it?

With respect,
Alex.

 | Replies | Author | Date
1409 | Re: Some bugs in 2.4 | [adembaba@e...] | Sat 4/28/2001
1419 | DBVT - a short description | Alexander Egorushkin | Sat 4/28/2001
1423 | Re: DBVT - a short description | Mike Lischke | Sat 4/28/2001
1429 | Re: DBVT - a short description | [adembaba@e...] | Sat 4/28/2001
1488 | Re: DBVT - a short description | Alexander Egorushkin | Mon 4/30/2001
1492 | Re: DBVT - a short description | [adembaba@e...] | Mon 4/30/2001
1493 | Re: DBVT - a short description | Alexander Egorushkin | Tue 5/1/2001
1498 | Re: DBVT - a short description | [adembaba@e...] | Tue 5/1/2001
2741 | Re: DBVT - a short description | [jopeking@y...] | Thu 6/28/2001


re: <oleidl.h>

From: "Alexander Egorushkin" [egorushkin@m...]
Date: Fri Apr 27, 2001 11:41 pm
Subject: RE: [VirtualTreeview] <oleidl.h>

Hi, Mike!

> > > {$HPPEMIT '#include <objidl.h>'}
>
> With this new include file does the interface declaration now
> work without changes or does the user
> still need to comment out these lines:

No, the user does not need to comment this.

Alex.
>
> operator IDropTarget*(void) { return (IDropTarget*)&__IDropTarget; }
>
> etc?
>
> Ciao, Mike
>
>
> To unsubscribe from this group, send an email to:
> VirtualTreeview-unsubscribe@egroups.com
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>
>


re: gdi error using VirtualStringTree

From: "Alexander Egorushkin" [egorushkin@m...]
Date: Fri Apr 27, 2001 11:41 pm
Subject: RE: [VirtualTreeview] gdi error using VirtualStringTree

> The problem effect is a general protection failure in GDI.Exe, when
> manipulating
> TVirtualStringTree at design time in delphi 5 Enterprise, on
> Windows 98 2nd
> edition

I use Win98 SE RUS - works fine.
IDE crashed when hint appeared, but I've heard that Mike had fixed this
problem.

Alex


re: Some bugs in 2.4

From: [adembaba@e...]
Date: Sat Apr 28, 2001 12:37 am
Subject: Re: Some bugs in 2.4

Alex,

> 4) I have the first version of DB-aware VST (v 0.001 - I'm

This is great news.

> too self-critical). If you wish I could send you a demo,
> source and a short description. It is written in C++, does
> anybody have an idea how Delphi users can install it?

I have no idea how --I wonder if it could at all be done
--unless it is made into a DLL (<ugly>).

Could you not write in Delphi? Please :-)

Cheers,

 | Replies | Author | Date
1419 | DBVT - a short description | Alexander Egorushkin | Sat 4/28/2001
1423 | Re: DBVT - a short description | Mike Lischke | Sat 4/28/2001
1429 | Re: DBVT - a short description | [adembaba@e...] | Sat 4/28/2001
1488 | Re: DBVT - a short description | Alexander Egorushkin | Mon 4/30/2001
1492 | Re: DBVT - a short description | [adembaba@e...] | Mon 4/30/2001
1493 | Re: DBVT - a short description | Alexander Egorushkin | Tue 5/1/2001
1498 | Re: DBVT - a short description | [adembaba@e...] | Tue 5/1/2001
2741 | Re: DBVT - a short description | [jopeking@y...] | Thu 6/28/2001


New version of VET

From: "Jim Kueneman" [jimdk@m...]
Date: Sat Apr 28, 2001 1:48 am
Subject: New version of VET

I uploaded a new version of the Virtual Explorer Tree. It contains
some new enhancments:

1) Views: Can take a snapshot of a treeview layout and recall it
later. Can save to disk as well.

2) Root Node can be Desktop, any special folder, or a user defined
path.

3) Added filtering capablility to the enumeration of folders.

4) Added a thread to monitor shell activity and update the tree (what
a challange compared to a Treeview/Listview combonation!) I would
like feedback on how this works, expecially with a large number of
files being moved around.

5) Added the "Rename" context menu item

6) Shell items are editable through VET.

I would like to thank Kostas Yannakopoulos for some invaluable dialog
on shell issues and code an Explorer Treeview component to browse
through.

As always feedback is greatly appreciated (and required to keep me
interested in continuing to work on VET :^) )

Jim

 | Replies | Author | Date
1412 | Re: New version of VET | Mike Lischke | Sat 4/28/2001
1427 | Re: New version of VET | Jim Kueneman | Sat 4/28/2001
1439 | Re: New version of VET | Mike Lischke | Sun 4/29/2001
1445 | Re: New version of VET | Jim Kueneman | Sun 4/29/2001
1451 | Re: New version of VET | Mike Lischke | Sun 4/29/2001
1457 | GetHitTestInfoAt | Jim Kueneman | Mon 4/30/2001
1464 | Re: GetHitTestInfoAt | Mike Lischke | Mon 4/30/2001
1472 | Re: GetHitTestInfoAt | Jim Kueneman | Mon 4/30/2001
1474 | Re: GetHitTestInfoAt | Geoffrey Pan | Mon 4/30/2001


VET - Get select path

From: [yahoo@a...]
Date: Sat Apr 28, 2001 4:04 am
Subject: VET - Get select path

Okay, stupid question but...

How do I know what path/folder the user has selected in the
VirtualExplorerTreeView?

Ben


re: New version of VET

From: "Mike Lischke" [public@l...]
Date: Sat Apr 28, 2001 10:24 am
Subject: RE: [VirtualTreeview] New version of VET

Hi Jim,

> I uploaded a new version of the Virtual Explorer Tree. It contains
> some new enhancments:

This control is really great. Now there is everything in it I wanted to see.
There are still some
small bugs but generally it is the most outstanding Explorer Tree I've ever
seen. Thank you for this
work.

> 1) Views: Can take a snapshot of a treeview layout and recall it
> later. Can save to disk as well.

- In TVETPersistant.ReadFromStream you use
S.ReadBuffer(FRootFolderCustomPath[1], Count);, if Count
is 0 then the length of the string is 0 and the access to its first element
crashes. I always use
PChar for such constructs as in S.ReadBuffer(PChar(FRootFolderCustomPath)^,
Count); to avoid extra
checks and AVs. the same problem applies to WriteToStream.
- Restore of the view does not restore the expanded state of the currently
selected node.

> 2) Root Node can be Desktop, any special folder, or a user defined
> path.

Excellent! This is what I wanted to ask you to implement :o]

> As always feedback is greatly appreciated (and required to keep me
> interested in continuing to work on VET :^) )

So what remains to be done in VET? It appears quite complete to me. You could
perhaps reformat the
file size string so looks the same as in Explorer but this (and the bugs
mentioned) are only small
changes. So I think it is really complete.

Btw: Since I have taken VET into the VT package I also have taken it into the
help. Would you like
to write descriptions for your TNameSpace class or shall I?

Ciao, Mike

 | Replies | Author | Date
1427 | Re: New version of VET | Jim Kueneman | Sat 4/28/2001
1439 | Re: New version of VET | Mike Lischke | Sun 4/29/2001
1445 | Re: New version of VET | Jim Kueneman | Sun 4/29/2001
1451 | Re: New version of VET | Mike Lischke | Sun 4/29/2001
1457 | GetHitTestInfoAt | Jim Kueneman | Mon 4/30/2001
1464 | Re: GetHitTestInfoAt | Mike Lischke | Mon 4/30/2001
1472 | Re: GetHitTestInfoAt | Jim Kueneman | Mon 4/30/2001
1474 | Re: GetHitTestInfoAt | Geoffrey Pan | Mon 4/30/2001
1495 | Re: GetHitTestInfoAt | Jim Kueneman | Tue 5/1/2001


About PI...

From: "LPA" [lpasseb@w...]
Date: Sat Apr 28, 2001 10:28 am
Subject: About PI...

Hi,

I've seen in files section, PI....
I've d/l it, and I find it very cool..... I'd like to know, if the source
code will be release..

Many thanx for all your wonderfull work...

CU SOON
Laurent

 | Replies | Author | Date
1420 | Re: About PI... | Mike Lischke | Sat 4/28/2001


re: New version of VET

From: "Cyril VELTER" [cyril.velter@l...]
Date: Sat Apr 28, 2001 11:51 am
Subject: Re: [VirtualTreeview] New version of VET

Hi jim,

A little problem in the tree refresh.

When you copy a file by drag and drop in the same folder, the copy is
created but doesn't appear in the tree.
There is the same behavior when you try to delete a file in VET.

cyril

 | Replies | Author | Date
1426 | Re: New version of VET | Jim Kueneman | Sat 4/28/2001


Question on GetMaxColumnWidth

From: "Cyril VELTER" [cyril.velter@l...]
Date: Sat Apr 28, 2001 11:55 am
Subject: Question on GetMaxColumnWidth

Hi mike,

When I call GetMaxColumnWidth, for a tree with no nodes in it, I get
an assertion in

GetMaxColumnWidth
GetNextVisible
Assert(Result <> FRoot, 'Node must not be the hidden root
node.');

Not sure, but i think the culprit is GetFirstVisible which return
FRoot !!

I've added this check at the end of this function :

if Result=FRoot then
Result:=nil;

Is it possible to include the header widht in the GetMaxColumnWidth
function ??

cyril

 | Replies | Author | Date
1421 | Re: Question on GetMaxColumnWidth | Mike Lischke | Sat 4/28/2001
1425 | Re: Question on GetMaxColumnWidth | Cyril VELTER | Sat 4/28/2001
1440 | Re: Question on GetMaxColumnWidth | Mike Lischke | Sun 4/29/2001


re: DragImage with Full row select

From: "Mike Lischke" [public@l...]
Date: Sat Apr 28, 2001 11:58 am
Subject: RE: [VirtualTreeview] DragImage with Full row select

Teus,

> I've got one remaining problem, but
> maybe this is by design. When full row select is on, dragging an
> Image with Draimage diMainColumnOnly gives an empty dragimage if you
> begin dragging in another column then the main column. This was not
> the case in the previous version.

Unfortunately I don't see any good alternatives. The drag image is alwasy
centered around the mouse
pointer and the entire position calculation is based on that fact. I have taken
the point into the
todo list, but I am not sure whether there should be a consideration of this
special case. On the
other hand you can fixed it yourself quity easily. Simply use manual drag and
don't allow drag
starting in others than the main column.

Ciao, Mike


re: Some bugs in 2.4

From: "Mike Lischke" [public@l...]
Date: Sat Apr 28, 2001 12:10 pm
Subject: RE: [VirtualTreeview] Some bugs in 2.4

Hallo Alex,

> 1) When the tree in empty and hoDblClickResize is set, on double clicking on
> the edge of the header application crashes in GetNextVisible (Node mustn't
> be the hidden root node).

Oops, there was a missing check. This is fixed now.

> 2) IsVisible[Node] = false works ugly :( Could you fix it (of course if it
> will not take much time)? It looks like

This should already be fixed in the latest version from yesterday.

> 3) Do you use ScratchBlt when draw Node images? My 16x16 icons deformates
> when HodeHeight = 18.

No, I don't use StretchBlt. Do you have set a special mapping mode for the tree
canvas?

> 4) I have the first version of DB-aware VST (v 0.001 - I'm too
> self-critical). If you wish I could send you a demo, source and a short
> description. It is written in C++, does anybody have an idea how Delphi
> users can install it?

Mmmh, depending on its state I could include it as contribution into the tree
distribution, if you
like. You still have a couple of weeks to bring it into a form which can be
used by other people.

Ciao, Mike


New file uploaded to VirtualTreeview

From: [VirtualTreeview@yahoogroups.com>
Date: Sat Apr 28, 2001 12:12 pm
Subject: New file uploaded to VirtualTreeview

Hello,

This email message is a notification to let you know that
a file has been uploaded to the Files area of the VirtualTreeview
group.

File : /DBVTdemo.zip
Uploaded by : [egorushkin@m...]
Description : Demo and source of VirtualDBTrees

You can access this file at the URL

http://groups.yahoo.com/group/VirtualTreeview/files/DBVTdemo.zip

To learn more about file sharing for your group, please visit

http://help.yahoo.com/help/us/groups/files

Regards,

egorushkin@m...]


DBVT - a short description

From: "Alexander Egorushkin" [egorushkin@m...]
Date: Sat Apr 28, 2001 12:12 pm
Subject: DBVT - a short description

Hi!

> Could you not write in Delphi? Please :-)
Pascal is not my native language :) But I think I have to do it :( - 2000
lines :((

I'm going to upload some samples (in C++) and start the translation
You may install it (Install packages... Select DBVT.bpl) but you cannot
debug it. That's why I decided to rewrite it in Delphi. Another one reason:
now all comments are in Russian (sorry).

DBVT package contains 7 components:

TBaseVirtualDBTree
TCustomSimpleVirtualDBTree
TCustomCheckVirtualDBTree
TCustomDBCheckVirtualDBTree
TCheckVirtualDBTree

TSimpleVirtualDBTree - see Test1.exe
TDBCheckVirtualDBTree - see TestCheck.exe

1.TBaseVirtualDBTree introduces base DB support (read, edit, insert,
options, DBData, events - see source),
This component never used in the form

2. TCustomSimpleDBTree - introduces ViewField
3. TCustomCheckVirtualDBTree - allows checking, saves IDs in TStringList
4. TCustomDBCheckVirtualDBTree - saves checks in another table (Many To Many
relations),
You may use them - but you will have to write lots of event handlers

5. TSimpleVirtualDBTree
6. TCheckVirtualDBTree
7. TDBCheckVirtualDBTree
End user components - drop them onto the form, set properties - they are
ready

Notes on speed:
If you use only DBTree (without grid that can change DB contents and cursor
pos) - it's fast and can work with large tables.
To navigate through the table it's faster to use Tree->GoTo method than
Table->Locate
ListView/TreeView toggle - to optimize it I need IsVisible[Node] property.

Notes on table structure:
You may define table structure in Parent or in Path field. Parent - is just
parent's ID. Path - is a full path (e.g. 10.15.20). If you have another Path
syntax you may use OnReadPathFromDB and OnWritePathToDB to convert it to
ID.ID.ID... Path field is the first step to multi level structures (when one
node can be under two or more other nodes). Now table may be in One-To-Many
relation with itself. I want to implement DBTree with Many-To-Many relation.
Now I'm working on it.

Drag/ Drop
Could anybody help me in implementing this operation correctly? I want to
allow dragging from/to other trees, support copy with Many-To-Many relation.

Editors
I'm planning to create DB editors and create structured DBGrid. But it will
not happen soon...

Alex.

 | Replies | Author | Date
1423 | Re: DBVT - a short description | Mike Lischke | Sat 4/28/2001
1429 | Re: DBVT - a short description | [adembaba@e...] | Sat 4/28/2001
1488 | Re: DBVT - a short description | Alexander Egorushkin | Mon 4/30/2001
1492 | Re: DBVT - a short description | [adembaba@e...] | Mon 4/30/2001
1493 | Re: DBVT - a short description | Alexander Egorushkin | Tue 5/1/2001
1498 | Re: DBVT - a short description | [adembaba@e...] | Tue 5/1/2001
2741 | Re: DBVT - a short description | [jopeking@y...] | Thu 6/28/2001


re: About PI...

From: "Mike Lischke" [public@l...]
Date: Sat Apr 28, 2001 12:15 pm
Subject: RE: [VirtualTreeview] About PI...

Laurent,

> I've seen in files section, PI....
> I've d/l it, and I find it very cool..... I'd like to know, if the source
> code will be release..

I'm sorry, but this will never be released. This control is my company's and
uses a lot of stuff not
related to VT and which is also property of the company (e.g. a scripting
engine, other virtual
controls, Unicode aware editors etc.).

Ciao, Mike


re: Question on GetMaxColumnWidth

From: "Mike Lischke" [public@l...]
Date: Sat Apr 28, 2001 12:18 pm
Subject: RE: [VirtualTreeview] Question on GetMaxColumnWidth

Cyril,

> When I call GetMaxColumnWidth, for a tree with no nodes in it, I get
> an assertion in GetMaxColumnWidth.
> Not sure, but i think the culprit is GetFirstVisible which return
> FRoot !!

Exactly, I have just changed this behaviour.

> Is it possible to include the header widht in the GetMaxColumnWidth
> function ??

<grumble>Mmmh, then I would need another option to make this behavior optional,
which would break
already streamed headers.</grumble>

Ciao, Mike


Show/Hide nodes

From: [andersthomsen@h...]
Date: Sat Apr 28, 2001 12:19 pm
Subject: Show/Hide nodes

Hi all!

I would just like to say, that this tree really need the ability to
show/hide nodes, this would make it completely perfect.

Show/hide would be the easiest way to make a filtering function i
think.

-Thomsen

 | Replies | Author | Date
1424 | Re: Show/Hide nodes | Mike Lischke | Sat 4/28/2001
1428 | Re: Show/Hide nodes | Roland | Sat 4/28/2001


re: DBVT - a short description

From: "Mike Lischke" [public@l...]
Date: Sat Apr 28, 2001 12:26 pm
Subject: RE: [VirtualTreeview] DBVT - a short description

Thank you Alex.

> I'm planning to create DB editors and create structured DBGrid. But it will
> not happen soon...

Don't hurry. Perhaps we could include a beta stage folder into the contribution
to show potential
users what is possible but to show also it is not ready yet. Depends on what
else comes until then.

Ciao, Mike


re: Show/Hide nodes

From: "Mike Lischke" [public@l...]
Date: Sat Apr 28, 2001 12:27 pm
Subject: RE: [VirtualTreeview] Show/Hide nodes

Hi Anders,

> I would just like to say, that this tree really need the ability to
> show/hide nodes, this would make it completely perfect.

The version available in the file area of YG does support hiding nodes. Try it
out :o]

Ciao, Mike

 | Replies | Author | Date
1428 | Re: Show/Hide nodes | Roland | Sat 4/28/2001


re: Question on GetMaxColumnWidth

From: "Cyril VELTER" [cyril.velter@l...]
Date: Sat Apr 28, 2001 2:48 pm
Subject: Re: [VirtualTreeview] Question on GetMaxColumnWidth

Mike,

I found another problem with getmaxcolumnwidth.
In one of my controls, I call it just after setting rootnodecount. This
result in a call to DoGetNodeText with an uninitilized node. Maybe you have
an idea ?

> Cyril,
>
> > When I call GetMaxColumnWidth, for a tree with no nodes in it, I get
> > an assertion in GetMaxColumnWidth.
> > Not sure, but i think the culprit is GetFirstVisible which return
> > FRoot !!
>
> Exactly, I have just changed this behaviour.
>
> > Is it possible to include the header widht in the GetMaxColumnWidth
> > function ??
>
> <grumble>Mmmh, then I would need another option to make this behavior
optional, which would break
> already streamed headers.</grumble>

It's just a suggestion, if it's too much trouble, I really could live
whithout it.

Cyril

 | Replies | Author | Date
1440 | Re: Question on GetMaxColumnWidth | Mike Lischke | Sun 4/29/2001


re: New version of VET

From: Jim Kueneman [jimdk@m...]
Date: Sat Apr 28, 2001 3:45 pm
Subject: Re: [VirtualTreeview] New version of VET

At 01:51 PM 4/28/2001 +0200, you wrote:

> A little problem in the tree refresh.
>
> When you copy a file by drag and drop in the same folder, the copy is
>created but doesn't appear in the tree.
> There is the same behavior when you try to delete a file in VET.

Deleteing through the context menu? That was broken so it really was not
deleted! A new version is going up shortly. I don't see a problem in
Win2k could you give me an exact way to reproduce this.

Jim


re: New version of VET

From: Jim Kueneman [jimdk@m...]
Date: Sat Apr 28, 2001 3:45 pm
Subject: RE: [VirtualTreeview] New version of VET

At 12:24 PM 4/28/2001 +0200, you wrote:

>This control is really great. Now there is everything in it I wanted to
>see. There are still some
>small bugs but generally it is the most outstanding Explorer Tree I've
>ever seen. Thank you for this
>work.

Thanks, it was worth the effort since it was being built off best
implementation of a Treeview component around. A building is only as
strong as its foundation!

>- In TVETPersistant.ReadFromStream you use
>S.ReadBuffer(FRootFolderCustomPath[1], Count);, if Count
>is 0 then the length of the string is 0 and the access to its first
>element crashes. I always use
>PChar for such constructs as in
>S.ReadBuffer(PChar(FRootFolderCustomPath)^, Count); to avoid extra

Agreed. If you look through all the Stream methods I did do it your way in
a place or two. Don't know why I kept going back and forth. ......

>- Restore of the view does not restore the expanded state of the currently
>selected node.

Yea, I knew that but it was a lot of work to fix it right and I was hoping
no one would notice :^) It is now implemented.

>So what remains to be done in VET? It appears quite complete to me. You
>could perhaps reformat the
>file size string so looks the same as in Explorer but this (and the bugs
>mentioned) are only small

That is already implemented in TNamespace. It is now implemented in the
component and demo.

>Btw: Since I have taken VET into the VT package I also have taken it into
>the help. Would you like
>to write descriptions for your TNameSpace class or shall I?

Is this to be HTML or WinHelp? I have no way to do WinHelp except RTF and
the help compiler, too much work :^) I have no tools to write help so you
tell me.

As far as more work on VET..... Number 1 on my list is to take advantage
of the multi select feature, somehow. I am still thinking about how to do
that.

Jim

 | Replies | Author | Date
1439 | Re: New version of VET | Mike Lischke | Sun 4/29/2001
1445 | Re: New version of VET | Jim Kueneman | Sun 4/29/2001
1451 | Re: New version of VET | Mike Lischke | Sun 4/29/2001
1457 | GetHitTestInfoAt | Jim Kueneman | Mon 4/30/2001
1464 | Re: GetHitTestInfoAt | Mike Lischke | Mon 4/30/2001
1472 | Re: GetHitTestInfoAt | Jim Kueneman | Mon 4/30/2001
1474 | Re: GetHitTestInfoAt | Geoffrey Pan | Mon 4/30/2001
1495 | Re: GetHitTestInfoAt | Jim Kueneman | Tue 5/1/2001


re: Show/Hide nodes

From: "Roland" [Beduerftig@S...]
Date: Sat Apr 28, 2001 6:05 pm
Subject: Re: Show/Hide nodes

> Hi Anders,
>
> > I would just like to say, that this tree really need the
> > ability to
> > show/hide nodes, this would make it completely perfect.
>
> The version available in the file area of YG does support
> hiding nodes. Try it out :o]
>
> Ciao, Mike

Hi Anders,

see also Message 1292, there is shown a example and a
workaround with for a problem, when you call show/hide first in
FormShow().
I don't kwown whether you need the workaround under Delphi, the
problem is for BCB5.

with best regards
Roland


re: DBVT - a short description

From: [adembaba@e...]
Date: Sat Apr 28, 2001 9:36 pm
Subject: Re: DBVT - a short description

Alex,

> > Could you not write in Delphi? Please :-)
> Pascal is not my native language :) But I think I have to
> do it :( - 2000 lines :((

2,000 lines? It should not take /you/ more than a couple
hours .. :-))

> I'm going to upload some samples (in C++) and start the
> translation You may install it (Install packages... Select
> DBVT.bpl) but you cannot debug it. That's why I decided to
> rewrite it in Delphi. Another one reason: now all comments
> are in Russian (sorry).

I could not find *.BPL file in the demos.

BTW, could you make the demo so that it uses a relative
directory path and not an alias. Running the demos would
be much less hassle that way

Thanks for the valuable contribution.

Cheers,

Adem.

 | Replies | Author | Date
1488 | Re: DBVT - a short description | Alexander Egorushkin | Mon 4/30/2001
1492 | Re: DBVT - a short description | [adembaba@e...] | Mon 4/30/2001
1493 | Re: DBVT - a short description | Alexander Egorushkin | Tue 5/1/2001
1498 | Re: DBVT - a short description | [adembaba@e...] | Tue 5/1/2001


Drag and drop w/o horz auto scroll

From: Werner Lehmann [wl@b...]
Date: Sat Apr 28, 2001 10:56 pm
Subject: Drag and drop w/o horz auto scroll

Hi,

I have two trees right beside each other (lets call them A and B).
A has several columns and the horz scrollbar is always shown. Further-
more, A is set to full row select. Occasionally nodes may be dragged
from A to B, never within A itself. Effect: while the nodes are
dragged over A and its right border A scrolls its clientarea to the
left. Then the drop takes place on B.

How can I prevent this horz scrolling? Currently the user has to scroll
A horizontally back after each drag and drop. If possible I would still
keep autoscroll for marquee selection in A alone.

Regards,
Werner

 | Replies | Author | Date
1443 | Re: Drag and drop w/o horz auto scroll | Mike Lischke | Sun 4/29/2001
1468 | Re: Drag and drop w/o horz auto scroll | Werner Lehmann | Mon 4/30/2001
1507 | Re: Drag and drop w/o horz auto scroll | Mike Lischke | Tue 5/1/2001
1511 | Re: Drag and drop w/o horz auto scroll | Werner Lehmann | Tue 5/1/2001


re: DragImage with Full row select

From: Werner Lehmann [wl@b...]
Date: Sat Apr 28, 2001 11:10 pm
Subject: Re: [VirtualTreeview] DragImage with Full row select

Mike Lischke wrote:
>
> Unfortunately I don't see any good alternatives. The drag image is alwasy
centered around the mouse
> pointer and the entire position calculation is based on that fact. I have
taken the point into the
> todo list, but I am not sure whether there should be a consideration of this
special case. On the
> other hand you can fixed it yourself quity easily. Simply use manual drag and
don't allow drag
> starting in others than the main column.

I have exactly the same problem. If this behaviour is new to the lastest
release (as Teus says, I didn't
check it out), what has happened that it cannot be kept? If I were an user I
would expect that dragging
can start on each column. Clearly an empty drag image is not desirable...

Did a test with manual drag and a BeginDrag in MouseMove (while ssLeft is in
Shift). I get no drag image
this way. BTW, if I change dragtype to VCL I get no dragimage either. Am I
missing something or is this
some VCL drag and drop inherent consequence? If so, the manual drag would not
make any sense here, since
the original problem was a wrong drag image and this way we get no drag image
at all and could just as
well use VCL dragtype and automatic dragging in the first place.

Regards,
Werner

 | Replies | Author | Date
1442 | Re: DragImage with Full row select | Mike Lischke | Sun 4/29/2001


New file uploaded to VirtualTreeview

From: [VirtualTreeview@yahoogroups.com>
Date: Sun Apr 29, 2001 12:58 am
Subject: New file uploaded to VirtualTreeview

Hello,

This email message is a notification to let you know that
a file has been uploaded to the Files area of the VirtualTreeview
group.

File : /VET.zip
Uploaded by : [jimdk@m...]
Description : Virtual Explorer Tree (VET) Version 1.0

You can access this file at the URL

http://groups.yahoo.com/group/VirtualTreeview/files/VET.zip

To learn more about file sharing for your group, please visit

http://help.yahoo.com/help/us/groups/files

Regards,

jimdk@m...]


VET 1.0

From: "Jim Kueneman" [jimdk@m...]
Date: Sun Apr 29, 2001 1:19 am
Subject: VET 1.0

I am now happy enough with VET that I am calling it version 1.0. I
will not change the interface to the component ( at least try not
to, to the best of my ability :^) ) so feel free to use it and be
fairly sure it will be compatiable with future changes.

What is new in 1.0

1) Fixed LoadFromStream and WriteToStream as Mike suggested.

2) Fixed bug in context menu so they work

3) Added a property to select between actual file size, Explorer (KB)
style, and the actual number of disk bytes the file consumes based on
the bytes per sector (dependant on version the file system being
used).

4) Found some memory leaks using MemProof

5) Fixed bug in Views. Now remembers if the nodes that define how to
reconstruct the tree are expanded or not and restores them to their
old state.

6) Added F5 refresh key.

Mike, Explorer uses backspace to back up from a node to its parent
as well as using the arrow keys. What are your feelings on adding
this to VT, or should I implement it in VET? Also Is there some way
to "auto fit" all columns? (Like Ctrl (NumPad)+ in explorer)

7) Fixed a few issues in the refreshing of the tree after a drag and
drop. ( Note the Recycle Bin does not update without a refresh (F5) I
am trying to find a solution. For some reason the PIDL sent for the
notification is not being reconized as the Recycle Bin )

enjoy

Jim

 | Replies | Author | Date
1435 | Re: VET 1.0 | [adembaba@e...] | Sun 4/29/2001
1437 | Re: VET 1.0 | Jim Kueneman | Sun 4/29/2001
1450 | Re: VET 1.0 | Mike Lischke | Sun 4/29/2001
1460 | Re: VET 1.0 (Auto fit) | [adembaba@e...] | Mon 4/30/2001
1458 | Re: VET 1.0 | [adembaba@e...] | Mon 4/30/2001
1475 | Re: VET 1.0 | Jim Kueneman | Mon 4/30/2001
1485 | Re: VET 1.0 | [adembaba@e...] | Mon 4/30/2001
1494 | Re: VET 1.0 | Jim Kueneman | Tue 5/1/2001
1499 | Re: VET 1.0 | [adembaba@e...] | Tue 5/1/2001


VT OnStartDrag/OnEndDrag

From: "Vadim Sedulin" [wsntrl@o...]
Date: Sun Apr 29, 2001 2:46 am
Subject: VT OnStartDrag/OnEndDrag

Hello Mike!

I found that OnStartDrag/OnEndDrag are very useful in some situations. Can
you introduce this events?

====
TVTStartDragEvent = procedure (Sender: TBaseVirtualTree; IsOLE: Boolean) of
object;
TVTEndDragEvent = procedure (Sender: TBaseVirtualTree; IsOLE: Boolean) of
object;

TBaseVirtualTree = class(TCustomControl)
private
...
FOnVTStartDrag: TVTStartDragEvent;
FOnVTEndDrag: TVTEndDragEvent;
protected
...
procedure DoStartDrag(var DragObject: TDragObject); override;
procedure DoEndDrag(Target: TObject; X, Y: Integer); override;
procedure DoVTStartDrag (IsOLE: Boolean); dynamic;
procedure DoVTEndDrag (IsOLE: Boolean); dynamic;
...
property OnVTStartDrag: TVTStartDragEvent read FOnVTStartDrag write
OnVTStartDrag;
property OnVTEndDrag: TVTEndDragEvent read FOnVTEndDrag write OnVTEndDrag;
...
end;

...

procedure TBaseVirtualTree.DoStartDrag(var DragObject: TDragObject);
begin
inherited;
DoVTStartDrag (False);
end;

procedure TBaseVirtualTree.DoEndDrag(Target: TObject; X, Y: Integer);
begin
inherited;
DoVTEndDrag (False);
end;

procedure TBaseVirtualTree.DoVTStartDrag (IsOLE: Boolean);
begin
if Assigned(FOnVTStartDrag) then
FOnVTStartDrag (Self, IsOLE);
end;

procedure TBaseVirtualTree.DoVTEndDrag (IsOLE: Boolean);
begin
if Assigned(FOnVTEndDrag) then
FOnVTEndDrag (Self, IsOLE);
end;

procedure TBaseVirtualTree.DoDragging(P: TPoint);

....

try
DoVTStartDrag (True); // <-- insert
ActiveX.DoDragDrop(DragManager{ as IDataObject}, DragManager{ as
IDropSource}, AllowedEffects, DragEffect);
finally
DoVTEndDrag (True);
FDragImage.EndDrag;

....

end;

====

Bye.

Vadim Sedulin
E-Mail: [wsntrl@o...]

 | Replies | Author | Date
1441 | Re: VT OnStartDrag/OnEndDrag | Mike Lischke | Sun 4/29/2001


re: VET 1.0

From: [adembaba@e...]
Date: Sun Apr 29, 2001 3:29 am
Subject: Re: VET 1.0

> I am now happy enough with VET that I am calling it version 1.0.

Thanks Jim,

Beatiful stuff!

Do you also plan to add column-header-click sorting?

> Also Is there some way to "auto fit" all columns? (Like
> Ctrl (NumPad)+ in explorer)

Actually, I would also like more options added to THeader so
that we can pre-specify which colums should 'auto-fit' and
fit when clicked on the column header border.

> enjoy

You bet :-)

Cheers,

Adem

 | Replies | Author | Date
1437 | Re: VET 1.0 | Jim Kueneman | Sun 4/29/2001
1450 | Re: VET 1.0 | Mike Lischke | Sun 4/29/2001
1460 | Re: VET 1.0 (Auto fit) | [adembaba@e...] | Mon 4/30/2001
1458 | Re: VET 1.0 | [adembaba@e...] | Mon 4/30/2001
1475 | Re: VET 1.0 | Jim Kueneman | Mon 4/30/2001
1485 | Re: VET 1.0 | [adembaba@e...] | Mon 4/30/2001
1494 | Re: VET 1.0 | Jim Kueneman | Tue 5/1/2001
1499 | Re: VET 1.0 | [adembaba@e...] | Tue 5/1/2001


A few additions to consider

From: "Anthony Mills" [amills@m...]
Date: Sun Apr 29, 2001 5:38 am
Subject: A few additions to consider

Mike,

I've developed a list of stuff I change when each new release of VT comes
out, so I thought I'd share a few of them in hopes that I could cut down on
the number of patches I implement. :-)

But first, I'd like to ask for an addition to TVTPopupEvent so it sends the
X and Y coordinates of the request. The reason? Well, it's all Jim
Kueneman's fault. His TNamespace.ShowContextMenu caused me to implement
something that would integrate shell context menus into the already-existing
menus (if the specified files are all in the same directory), then dispatch
the result appropriately. Unfortunately, this forces me to call
TrackPopupMenu and dispatch the result myself. So what I'm currently doing
is getting the coordinates from Mouse.CursorPos (then returning PopupMenu =
nil and AskParent = False).

However, if the person requests the menu by using the keyboard, the menu is
shown under the mouse, not in the proper place in the middle of the item
caption.

I realize this is a very esoteric reason for wanting X and Y coordinates,
but it could happen in any circumstance where one wants to take control.

Anyway, the patches I usually apply are:

**** Publish TVirtualStringTree.OnEndDrag

I still use VCL DND and a number of my procedures rely on OnEndDrag.

**** Expand on TBaseVirtualTree.WMKeyDown's handling of VK_APPS and Ctrl-A

After I sent code to you before for VK_APPS handling, I wrote an expanded
version that pops up the menu with the origin in the middle of the focused
node. I also validated everything in the case of a Select All, since
SelectAll seems to not select uninitialized nodes.

The VK_APPS patch requires an additional ColWidth (Integer) variable to be
added to WMKeyDown's list of variables.

VK_APPS:
if Assigned(FFocusedNode) then
begin
R := GetDisplayRect(FFocusedNode, FFocusedColumn, True);
ColWidth := DoGetNodeWidth(FFocusedNode, FFocusedColumn);
if FFocusedColumn >= 0 then
begin
if ColWidth > FHeader.Columns[FFocusedColumn].Width then
ColWidth := FHeader.Columns[FFocusedColumn].Width;
end
else
begin
if ColWidth > ClientWidth then
ColWidth := ClientWidth;
end;
DoPopupMenu(FFocusedNode, FFocusedColumn,
Point(R.Left + ColWidth div 2, (R.Top + R.Bottom) div 2));
end;
Ord('a'), Ord('A'):
begin
if voMultiSelect in FOptions then
if ssCtrl in Shift then begin
ValidateChildren(nil, True);
SelectAll(True);
end;
end;

**** Initialize nodes (if necessary) in TBaseVirtualTree.InvalidateNode

If you call InvalidateNode on an uninitialized node, VT doesn't seem to like
it. So I changed it to this:

function TBaseVirtualTree.InvalidateNode(Node: PVirtualNode): TRect;

// initiate repaint of given node and returns the just invalidated
rectangle

begin
if FUpdateCount = 0 then
begin
if Assigned(Node) and not (vsInitialized in Node.States) then
InitNode(Node);

Result := GetDisplayRect(Node, -1, False);
InvalidateRect(Handle, @Result, False);
end;
end;

**** Add ' and (tsDrawSelecting in FStates)' to
TBaseVirtualTree.CanAutoScroll

Just because I don't think VT should autoscroll when you're not draw
selecting.

function TBaseVirtualTree.CanAutoScroll: Boolean;

// Determines if auto scrolling is currently allowed.

begin
// don't scroll the client area if the header is currently doing
tracking or dragging
Result := (voAutoScroll in FOptions) and (FHeader.FStates = []) and
(tsDrawSelecting in FStates);
end;

**** Add a procedure TreeClearCache

This could probably be done much better with a method procedure, but it
started out as a separate procedure created just to solve one need. Please
excuse the style; I wrote it back when I was first integrating VT into my
apps. :-)

procedure TreeClearCache(Tree: TCustomVirtualStringTree; Parent:
PVirtualNode);

procedure InvalidateChild(Node: PVirtualNode);
var
N: PVirtualNode;
begin
N := Node^.FirstChild;
while N <> nil do begin
PInteger(@N^.Data)^ := 0;
if N^.FirstChild <> nil then
InvalidateChild(N);
N := N^.NextSibling;
end;
end;

begin
if Parent = nil then
InvalidateChild(Tree.RootNode)
else begin
InvalidateChild(Parent);
PInteger(@Parent^.Data)^ := 0;
end;
Tree.Invalidate;
end;

I often have places where the underlying data in a VT will change and I need
to invalidate the nodes in question and force them to query for their data
again (and I want the caption lengths correct). Is there a more elegant
solution? I know TVirtualStringTree.InvalidateNode will clear the cache for
a node, but I need a method to clear a node (unless it's the root node) and
all its descendents.

Whew! Long post. Thanks for reading through it.

Regards,

Tony

 | Replies | Author | Date
1448 | Re: A few additions to consider | Mike Lischke | Sun 4/29/2001


re: Re: VET 1.0

From: Jim Kueneman [jimdk@m...]
Date: Sun Apr 29, 2001 6:15 am
Subject: Re: [VirtualTreeview] Re: VET 1.0

At 03:29 AM 4/29/2001 +0000, you wrote:

>Beatiful stuff!

Thanks.

You may want to download it again. I did not test it on Win9x and the
Disk Usage file size value is not right on disks larger than 2Gig. It
took a bit of searching but I found how to get the right values for FAT32
and larger harddrives (MSDOS call of all things!) It should work for all
versions of Windows now (anyone have Win95 SR1 to try it on?)

>Do you also plan to add column-header-click sorting?

Yes, but again with the folders and files mixed it becomes a confusing
issue on how this should work. Files and folders from other drives (even
networked drives) would be in the mix!

I think a new derivative of VET that emulates the Listview in report mode
is necessary and then a separate Treeview with only folders. That would
simplify a lot of things.

>Actually, I would also like more options added to THeader so
>that we can pre-specify which colums should 'auto-fit' and
>fit when clicked on the column header border.

That would be slick.

Jim

 | Replies | Author | Date
1450 | Re: VET 1.0 | Mike Lischke | Sun 4/29/2001
1460 | Re: VET 1.0 (Auto fit) | [adembaba@e...] | Mon 4/30/2001
1458 | Re: VET 1.0 | [adembaba@e...] | Mon 4/30/2001
1475 | Re: VET 1.0 | Jim Kueneman | Mon 4/30/2001
1485 | Re: VET 1.0 | [adembaba@e...] | Mon 4/30/2001
1494 | Re: VET 1.0 | Jim Kueneman | Tue 5/1/2001
1499 | Re: VET 1.0 | [adembaba@e...] | Tue 5/1/2001


re: VET 1.0

From: "Cyril VELTER" [cyril.velter@l...]
Date: Sun Apr 29, 2001 8:37 am
Subject: Re: [VirtualTreeview] VET 1.0

I Jim,

Great Job !!

The two problem I descibe in my previous message are gone with this
version.

> I am now happy enough with VET that I am calling it version 1.0. I
> will not change the interface to the component ( at least try not
> to, to the best of my ability :^) ) so feel free to use it and be
> fairly sure it will be compatiable with future changes.
>
> What is new in 1.0
>

> 6) Added F5 refresh key.
>
> Mike, Explorer uses backspace to back up from a node to its parent
> as well as using the arrow keys. What are your feelings on adding
> this to VT, or should I implement it in VET? Also Is there some way
> to "auto fit" all columns? (Like Ctrl (NumPad)+ in explorer)
>

It's quite easy to implement columns autofit, I just implemented it in
one of my components. You just have to iterate through your columns and
call Header.Columns.Items[i].Width:=GetMaxColumnWidth(i);

cyril

 | Replies | Author | Date
1449 | Re: VET 1.0 | Mike Lischke | Sun 4/29/2001


re: New version of VET

From: "Mike Lischke" [public@l...]
Date: Sun Apr 29, 2001 12:52 pm
Subject: RE: [VirtualTreeview] New version of VET

Jim,

> Thanks, it was worth the effort since it was being built off best
> implementation of a Treeview component around. A building is only as
> strong as its foundation!

:o]

> Is this to be HTML or WinHelp? I have no way to do WinHelp except RTF and
> the help compiler, too much work :^) I have no tools to write help so you
> tell me.

Actually, I will create again plain HTML and compiled HTML files. All you would
have to do is to
fill a structure like this (provided by me):

<Classes>
<Class Name="TCustomVirtualExplorerTree">
<Events>
<Event Name="OnEnumFolder">
<Summary></Summary>
<Desc></Desc>
</Event>
<Event Name="OnShellExecute">
<Summary></Summary>
<Desc></Desc>
</Event>
<Event Name="OnShellNotify">
<Summary></Summary>
<Desc></Desc>
</Event>
</Events>
<Methods>
<Method Name="BrowseTo">
<Summary></Summary>
<Desc></Desc>
</Method>
<Method Name="ClearImageThread">
<Summary></Summary>
<Desc></Desc>
</Method>
<Method Name="CollapseNamespaceFolder">
<Summary></Summary>
<Desc></Desc>
</Method>

etc.

All you would have to do is to fill the parts enclosed in <summary></summary>
and <Desc></Desc>.
Everything else is management only important for you to show what description
is needed. I would do
all the formatting etc. but you can already use some special tags if you like
(like the HTML tags
<ul><li></li</ul>, <table> or some helper for code: <DelphiCode></DelphiCode>
etc.).

If you can find the time then I would much appreciate the help, so I can focus
on the VT
documentation.

Ciao, Mike

 | Replies | Author | Date
1445 | Re: New version of VET | Jim Kueneman | Sun 4/29/2001
1451 | Re: New version of VET | Mike Lischke | Sun 4/29/2001
1457 | GetHitTestInfoAt | Jim Kueneman | Mon 4/30/2001
1464 | Re: GetHitTestInfoAt | Mike Lischke | Mon 4/30/2001
1472 | Re: GetHitTestInfoAt | Jim Kueneman | Mon 4/30/2001
1474 | Re: GetHitTestInfoAt | Geoffrey Pan | Mon 4/30/2001
1495 | Re: GetHitTestInfoAt | Jim Kueneman | Tue 5/1/2001


re: Question on GetMaxColumnWidth

From: "Mike Lischke" [public@l...]
Date: Sun Apr 29, 2001 12:52 pm
Subject: RE: [VirtualTreeview] Question on GetMaxColumnWidth

Hi Cyril,

> I found another problem with getmaxcolumnwidth.
> In one of my controls, I call it just after setting rootnodecount. This
> result in a call to DoGetNodeText with an uninitilized node. Maybe you have
> an idea ?

Okay, this was a bug in the GetFirstVisible/GetNextVisible implementation.
Should be fixed now.

Ciao, Mike


re: VT OnStartDrag/OnEndDrag

From: "Mike Lischke" [public@l...]
Date: Sun Apr 29, 2001 12:52 pm
Subject: RE: [VirtualTreeview] VT OnStartDrag/OnEndDrag

Hi Vadim,

> I found that OnStartDrag/OnEndDrag are very useful in some situations. Can
> you introduce this events?

Thank you for your suggestion. I wanted already to have those events in the
tree but I simply forgot
them. We don't need, however, to introduce all those new methods and events. I
have included the
calls to DoStartDrag and DoEndDrag in DoDragging (they will be called
implicitly by the VCL for
their dragging too). There are now two flags to determine what drag operation
is actually being
happen: tsVCLDragging and tsOLEDragging. This should satisfy every need in this
regard.

Ciao, Mike


re: DragImage with Full row select

From: "Mike Lischke" [public@l...]
Date: Sun Apr 29, 2001 12:52 pm
Subject: RE: [VirtualTreeview] DragImage with Full row select

Werner,

> Did a test with manual drag and a BeginDrag in MouseMove (while ssLeft is in
Shift). I
> get no drag image this way. BTW, if I change dragtype to VCL I get no
dragimage either. Am I
missing
> something or is this some VCL drag and drop inherent consequence? If so, the
manual drag would not
make any
> sense here, since the original problem was a wrong drag image and this way we
get no drag image at
all and
> could just as well use VCL dragtype and automatic dragging in the first place.

The point is here that the drag image is set to show only the main column while
the users starts
dragging in any other column. If the full drag image is enabled then of course
there will be one
shown. What I would like to avoid is to suddenly show a drag image from the
main column over a place
belonging to another column. There are however means to still show something by
setting the width of
the drag image to a wider value, so less gets clipped.

For VCL dd I could not show a drag image at all because the image was tightly
integrated into the
drag manager. I don't know why Borland has implemented a totally own handling
but it was a bad idea,
which dd developers have now to live with. But since I have recently splitted
the drag image
handling and the drag manager I can imagine to have a drag image also during
VCL dd. I have still to
think about it.

Ciao, Mike


re: Drag and drop w/o horz auto scroll

From: "Mike Lischke" [public@l...]
Date: Sun Apr 29, 2001 12:52 pm
Subject: RE: [VirtualTreeview] Drag and drop w/o horz auto scroll

> How can I prevent this horz scrolling? Currently the user has to scroll
> A horizontally back after each drag and drop. If possible I would still
> keep autoscroll for marquee selection in A alone.

There was another posting related to this problem. Perhaps I should enable auto
scrolling only for
selection with the rectangle and drag'n drop?

Ciao, Mike


re: VET 1.0

From: "Mike Lischke" [public@l...]
Date: Sun Apr 29, 2001 12:52 pm
Subject: RE: [VirtualTreeview] VET 1.0

> Mike, Explorer uses backspace to back up from a node to its parent
> as well as using the arrow keys. What are your feelings on adding
> this to VT, or should I implement it in VET? Also Is there some way
> to "auto fit" all columns? (Like Ctrl (NumPad)+ in explorer)

VK_BACK is now implemented. Auto fit of columns as well, but I had to assign a
different hot key
(Ctrl + Shift + '+') because the other one is already taken by the tree for a
full expand.

Ciao, Mike

 | Replies | Author | Date
1476 | Re: VET 1.0 | Jim Kueneman | Mon 4/30/2001


re: New version of VET

From: Jim Kueneman [jimdk@m...]
Date: Sun Apr 29, 2001 1:31 pm
Subject: RE: [VirtualTreeview] New version of VET

At 02:52 PM 4/29/2001 +0200, you wrote:

Hi Mike,

>Actually, I will create again plain HTML and compiled HTML files. All you
>would have to do is to
>fill a structure like this (provided by me):
>
> <Classes>
> <Class Name="TCustomVirtualExplorerTree">
> <Events>

I can handle this. I am assuming you have something that generates this
framework for you? What a tedious job doing it by hand!

>All you would have to do is to fill the parts enclosed in
><summary></summary> and <Desc></Desc>.
>Everything else is management only important for you to show what
>description is needed. I would do
>all the formatting etc. but you can already use some special tags if you
>like (like the HTML tags
><ul><li></li</ul>, <table> or some helper for code:
><DelphiCode></DelphiCode> etc.).

Do you have a small example? I have a visual web page development program
can that be used to edit / create the help?

Jim

 | Replies | Author | Date
1451 | Re: New version of VET | Mike Lischke | Sun 4/29/2001
1457 | GetHitTestInfoAt | Jim Kueneman | Mon 4/30/2001
1464 | Re: GetHitTestInfoAt | Mike Lischke | Mon 4/30/2001
1472 | Re: GetHitTestInfoAt | Jim Kueneman | Mon 4/30/2001
1474 | Re: GetHitTestInfoAt | Geoffrey Pan | Mon 4/30/2001
1495 | Re: GetHitTestInfoAt | Jim Kueneman | Tue 5/1/2001


Getting node from index

From: [andersthomsen@h...]
Date: Sun Apr 29, 2001 2:04 pm
Subject: Getting node from index

Okay, It's probably a stupid question, but I couldn't find an answer
anywhere.

How to get a node from its index number? (tree.items[i])

-Thomsen

 | Replies | Author | Date
1452 | Re: Getting node from index | Mike Lischke | Sun 4/29/2001


some questions

From: [andersthomsen@h...]
Date: Sun Apr 29, 2001 3:48 pm
Subject: some questions

Mike,

I'm trying to implent VirtualStringTree to my app, but I have some
problems with this.

1. If I do this:
tree.beginupdate;
tree.rootnodecount := (some thousands);
(a function that runs though the nodes and unsets the vsVisible to
some nodes)
tree.endupdate;

This causes a "Cache not entirely filled" exception.

I then tried to remove the begin/endupdate lines. This caused no
error, but the tree is not showed until I click somewhere in the tree.

Another problem (bug?) is, that if I only have 20 nodes visible
(vsVisible), the scrollbar min/max settings aren't updated, I can
still scroll down the list, which is empty.

Also, I have a multicolumn tree using MultiSelect and FullRowSelect.
When I hold down Ctrl to select multiple items, the nodes aren't
correctly painted. The selection color of the rootcolumn is correctly
painted on MouseDown, but the remaining columns aren't drawed until
MouseUp.

And just a small question, what is the general difference between
StringTree and DrawTree.

-Anders Thomsen

 | Replies | Author | Date
1463 | Re: some questions | Mike Lischke | Mon 4/30/2001
1552 | Re: some questions | [andersthomsen@h...] | Thu 5/3/2001


re: A few additions to consider

From: "Mike Lischke" [public@l...]
Date: Sun Apr 29, 2001 6:51 pm
Subject: RE: [VirtualTreeview] A few additions to consider

Hi Tony,

> I've developed a list of stuff I change when each new release of VT comes
> out, so I thought I'd share a few of them in hopes that I could cut down on
> the number of patches I implement. :-)

Sure, let's minimize the work.

> But first, I'd like to ask for an addition to TVTPopupEvent so it sends the
> X and Y coordinates of the request.

This was so easy to add (the position is already passed to DoPopupMenu)...

> **** Publish TVirtualStringTree.OnEndDrag

Done.

> **** Expand on TBaseVirtualTree.WMKeyDown's handling of VK_APPS and Ctrl-A
>
> After I sent code to you before for VK_APPS handling, I wrote an expanded
> version that pops up the menu with the origin in the middle of the focused
> node.
> Ord('a'), Ord('A'):
> begin
> if voMultiSelect in FOptions then
> if ssCtrl in Shift then begin
> ValidateChildren(nil, True);
> SelectAll(True);
> end;
> end;

Mmmh, good idea. I have however changed SelectAll. Of course it should select
either all nodes or
only the visible ones and has to initialize them too. But particularly for
visible-only selection
there is no need to validate every node in the tree.

> **** Initialize nodes (if necessary) in TBaseVirtualTree.InvalidateNode
> If you call InvalidateNode on an uninitialized node, VT doesn't seem to like
> it.

No need to do this. The only method which is called there is GetDisplayRect
which already validates
the given node.

> **** Add ' and (tsDrawSelecting in FStates)' to TBaseVirtualTree.CanAutoScroll

Done (plus extra check for dragging).

> **** Add a procedure TreeClearCache
> I know TVirtualStringTree.InvalidateNode will clear the cache for
> a node, but I need a method to clear a node (unless it's the root node) and
> all its descendents.

There are methods to do this. Please look up ReinitNode, ReinitChildren and
ResetNode.

Ciao, Mike


re: VET 1.0

From: "Mike Lischke" [public@l...]
Date: Sun Apr 29, 2001 6:51 pm
Subject: RE: [VirtualTreeview] VET 1.0

Cyril,

> It's quite easy to implement columns autofit, I just implemented it in
> one of my components. You just have to iterate through your columns and
> call Header.Columns.Items[i].Width:=GetMaxColumnWidth(i);

I have implemented it even with animation. If only everything would be so easy
to implement ...
(then programming would perhaps be too boring).

Ciao, Mike


re: Re: VET 1.0

From: "Mike Lischke" [public@l...]
Date: Sun Apr 29, 2001 6:51 pm
Subject: RE: [VirtualTreeview] Re: VET 1.0

Jim,

> >Do you also plan to add column-header-click sorting?
>
> Yes, but again with the folders and files mixed it becomes a confusing
> issue on how this should work. Files and folders from other drives (even
> networked drives) would be in the mix!

This should actually be very trivial. Okay, you will compare PIDLs but I think
the shell folder
should handle the case that folders are to be placed before files. If not then
use the cache data
and lookup the sort code I have used in the draw tree sample.

> I think a new derivative of VET that emulates the Listview in report mode
> is necessary and then a separate Treeview with only folders. That would
> simplify a lot of things.

But would not be so cool :o]

> That would be slick.

Header.AutoFitColumns implemented.

Ciao, Mike

 | Replies | Author | Date
1460 | Re: VET 1.0 (Auto fit) | [adembaba@e...] | Mon 4/30/2001


re: New version of VET

From: "Mike Lischke" [public@l...]
Date: Sun Apr 29, 2001 6:51 pm
Subject: RE: [VirtualTreeview] New version of VET

Jim,

> I can handle this.

Excellent.

>I am assuming you have something that generates this
> framework for you? What a tedious job doing it by hand!

Yes, of course. It is Time2Help which parses the units added to the help
project and creating the
frame work on the fly.

> Do you have a small example? I have a visual web page development program
> can that be used to edit / create the help?

Well, the syntax is similar to HTML. A typical topic looks so:

<TopicBook Title="Virtual Treeview">
<TopicBook Title="Instruction, Overview & Installation">
<Topic ID="IDH_Topic_Overview" Title="Introduction">
<NSR>
<font size="6"><B>Virtual Treeview introduction</B></font>
</NSR>
<P>Organizing hierarchical or complex data into a tree structure is
the most obvious and
usually best understandable way to work with it. But just displaying it is not
enough anymore, other
things need to be considered as well like the tree's capacity, its user
interface, ease of use,
response time, reliability, configurability, feature richness etc. These
requirements led to the
development of the <B>Virtual Treeview</B>.</P>
<P Align="Center"><Img Src="Overview"/></P>
<P/>
<P>Virtual Treeview can be characterized by the following core
capabilities:</P>
<UL>
<LI>Virtual Treeview is <B>extremely fast</B> and designed for
<B>high speed
access</B>.</LI>
<LI>Virtual Treeview is <B>memory sparing</B> which is the
premise for speed and
capacity.</LI>
<LI>Virtual Treeview is a <B>high capacity</B> control.</LI>
<LI>Virtual Tree's design is satisfying <B>professional
demands</B> and implements a
<B>virtual paradigm</B>, which allows for separating structure and data. This
in turn allows for
small memory requirements etc.</LI>
<LI>The virtual paradigm required also a <B>new serialization
concept</B> to make it
possible to save and store a tree to/from a stream (including all user
data).</LI>
<LI>Virtual Treeview is <B>highly customizable</B>. Several
levels of customization
support ease the life of component developers writing totally new descentants
and application
developers who just want to give the tree a little different appearance.</LI>
<LI>Of course all features are supported under every 32 bit
Windows, including (but
not limited to) such unique features like <B>Unicode</B>, <B>right-to-left</B>
directionality and
layout, <B>alpha blended drag image</B> and <B>OLE</B> drag'n drop and
clipboard operations.</LI>
</UL>
<HR Type="Dotted"/>
<P>Virtual Treeview has been written by <A
HRef="http://www.lischke-online.de">Dipl.
Ing. Mike Lischke</A> for<Br/>
<Br/>
<Font Size="4"> <Img Src="DPLogo"/><A
HRef="http://www.digitalpublishing.de/home_english.htm">digital publishing AG,
The Interactive
Learning Experience.</A></Font></P>
<P>Believing in the spirit and synergy effects of Open Source,
digital publishing AG
gladly releases Virtual Treeview as Open Source under the <A
HRef="MPL.htm">Mozilla Public
License</A>.</P>
<P><B>digital publishing AG does not provide any support for this
control. If you have
problems or just want to express your opinion then please contact the original
author <A
HRef="mailto:[public@l...]?subject=[OH] Virtual Treeview">Mike
Lischke</A>
exclusively.</B></P>
</Topic>

Ciao, Mike

 | Replies | Author | Date
1457 | GetHitTestInfoAt | Jim Kueneman | Mon 4/30/2001
1464 | Re: GetHitTestInfoAt | Mike Lischke | Mon 4/30/2001
1472 | Re: GetHitTestInfoAt | Jim Kueneman | Mon 4/30/2001
1474 | Re: GetHitTestInfoAt | Geoffrey Pan | Mon 4/30/2001
1495 | Re: GetHitTestInfoAt | Jim Kueneman | Tue 5/1/2001


re: Getting node from index

From: "Mike Lischke" [public@l...]
Date: Sun Apr 29, 2001 6:51 pm
Subject: RE: [VirtualTreeview] Getting node from index

Hi Anders,

> Okay, It's probably a stupid question, but I couldn't find an answer
> anywhere.
> How to get a node from its index number? (tree.items[i])

Ther is no such property like Items. A tree is traversed by taking the first
node and go through the
other nodes by the provided navigation functions like GetNext, GetNextVisible
etc. Depending on what
you want to do you can however optimize access, e.g. each child node of a node
has a unique index.

Ciao, Mike


re: new editors: notes for BCB users

From: [Manfred@F...]
Date: Sun Apr 29, 2001 11:29 pm
Subject: Re: new editors: notes for BCB users

Hi Alex.

--- In [VirtualTreeview@y...], "Alexander Egorushkin" [egorushkin@m...]
wrote:
> Manfred, thank you very much for your components!
>

Mike and many other programmers help me with her components. So i
will contribute a little part too.

>
> 1) OnNewText and OnCancelEdit are disabled by your editors. I think
this is
> not a good idea.
>
> 2) When I press Esc DoNewData is called (?). I expect Esc to cancel
editing

You're right. I have fixed this and the events are fired now.
Therefore i dropped the OnNewData event in TVSTEditor. For string
editors you can use the text parameter in OnNewText(). For other
value types you should use the appropriate value of the used editor
(look at the sample code).

> I think these properties should be added
> in TVSTEditor (?):
> - Stop Conditions - when to stop (enter, esc, focus, etc),
> - Succeed Conditions (enter, focus, etc),
> - DispatchByParent (whether the tree handles messages like
KEYDOWN with
> parameter VK_UP or VK_DOWN; this may be useful if we want to emulate
> property dialog).
>

I'll think about it.

The new version has also a new editor: TMFComboEdit.

cu
Manfred


New file uploaded to VirtualTreeview

From: [VirtualTreeview@yahoogroups.com>
Date: Sun Apr 29, 2001 11:31 pm
Subject: New file uploaded to VirtualTreeview

Hello,

This email message is a notification to let you know that
a file has been uploaded to the Files area of the VirtualTreeview
group.

File : /VSTEdit.zip
Uploaded by : [Manfred@F...]
Description : Editor components (not only) for VirtualStringTree V1.0 Beta

You can access this file at the URL

http://groups.yahoo.com/group/VirtualTreeview/files/VSTEdit.zip

To learn more about file sharing for your group, please visit

http://help.yahoo.com/help/us/groups/files

Regards,

Manfred@F...]


New file uploaded to VirtualTreeview

From: [VirtualTreeview@yahoogroups.com>
Date: Sun Apr 29, 2001 11:46 pm
Subject: New file uploaded to VirtualTreeview

Hello,

This email message is a notification to let you know that
a file has been uploaded to the Files area of the VirtualTreeview
group.

File : /VSTEdit.zip
Uploaded by : [Manfred@F...]
Description : Editors for VirtualStringTree

You can access this file at the URL

http://groups.yahoo.com/group/VirtualTreeview/files/VSTEdit.zip

To learn more about file sharing for your group, please visit

http://help.yahoo.com/help/us/groups/files

Regards,

Manfred@F...]


Help, please

From: "Wiktor Sadowski" [wiktor@w...]
Date: Fri Mar 2, 2001 2:29 am
Subject: Help, please

I would be more than gratefull if someone send me the latest
versions of VirtualTreeview.zip, VET.zip and VSTEdit.zip.
I have tried to download them from Yahoo many times
but without success.

Thanks in advance

Wiktor Sadowski

 | Replies | Author | Date
1462 | Re: Help, please | Mike Lischke | Mon 4/30/2001
1486 | Re: Help, please | Wiktor Sadowski | Mon 4/30/2001


GetHitTestInfoAt

From: Jim Kueneman [jimdk@m...]
Date: Mon Apr 30, 2001 4:34 am
Subject: GetHitTestInfoAt

Mike,

If there are enough columns to force a horz scroll bar and you click
on the vert scroll bar a call to GetHitTestInfoAt will return a valid index
for the column UNDER the scrollbar. This is true for the horz scrollbar
as well. Should that not return an invalid column?

Jim

 | Replies | Author | Date
1464 | Re: GetHitTestInfoAt | Mike Lischke | Mon 4/30/2001
1472 | Re: GetHitTestInfoAt | Jim Kueneman | Mon 4/30/2001
1474 | Re: GetHitTestInfoAt | Geoffrey Pan | Mon 4/30/2001
1495 | Re: GetHitTestInfoAt | Jim Kueneman | Tue 5/1/2001


re: VET 1.0

From: [adembaba@e...]
Date: Mon Apr 30, 2001 5:36 am
Subject: Re: VET 1.0

> >Do you also plan to add column-header-click sorting?
>
> Yes, but again with the folders and files mixed it becomes
> a confusing issue on how this should work. Files and folders
> from other drives (even networked drives) would be in the mix!

I dont think it would. I have done a similar thing in my
ZipUnzipDemo and thanks to the VT, it does not make a blunder
the way you seem to fear it would.

> I think a new derivative of VET that emulates the Listview in
> report mode is necessary and then a separate Treeview with
> only folders. That would simplify a lot of things.

Again, in the light of above, I am not sure if this is needed
--if we are talking about sorting.

Cheers,

Adem

 | Replies | Author | Date
1475 | Re: VET 1.0 | Jim Kueneman | Mon 4/30/2001
1485 | Re: VET 1.0 | [adembaba@e...] | Mon 4/30/2001
1494 | Re: VET 1.0 | Jim Kueneman | Tue 5/1/2001
1499 | Re: VET 1.0 | [adembaba@e...] | Tue 5/1/2001


More fine grained version numbers please

From: [adembaba@e...]
Date: Mon Apr 30, 2001 5:58 am
Subject: More fine grained version numbers please

Hi,

I was wondering if it would not be a better idea to
use more fine grained version numbers for VT, VET
and others.

This would help immensely, as otherwise I have only
the date of upload to go by --which is not very
informative.

So, how about using something like VT 2.4xx or
2.4a..2.4z, etc.

Plus, we could have a folder 'Older versions' where
people needing older versions could get what they are
looking for.

We do, after all, have a 20 Meg storage of which we
have so far filled up about 3 Meg or so.

Just an idea..

Cheers,
Adem

 | Replies | Author | Date
1480 | Re: More fine grained version numbers please | Mike Lischke | Mon 4/30/2001
1483 | Re: More fine grained version numbers please | [adembaba@e...] | Mon 4/30/2001
1489 | Re: More fine grained version numbers please | Alexander Egorushkin | Mon 4/30/2001
1515 | Re: More fine grained version numbers please | Mike Lischke | Tue 5/1/2001
1500 | Re: More fine grained version numbers please | Vadim Sedulin | Tue 5/1/2001
1519 | Re: More fine grained version numbers please | Mike Lischke | Tue 5/1/2001


re: VET 1.0 (Auto fit)

From: [adembaba@e...]
Date: Mon Apr 30, 2001 6:15 am
Subject: Re: VET 1.0 (Auto fit)

Mike,

> Header.AutoFitColumns implemented.

Thanks for Header.AutoFitColumns. But...

Would it not be more helpful if you could add a
'coAutoFit' to TVTColumnOption and then instead
of 'Header.AutoFitColumns' give us a

Header.AutoFitOnBorderClick

which would mean VT would autofit the column much
like Explorer (Excel etc) does.

Just asking :-)

Cheers,

Adem


New file uploaded to VirtualTreeview

From: [VirtualTreeview@yahoogroups.com>
Date: Mon Apr 30, 2001 7:26 am
Subject: New file uploaded to VirtualTreeview

Hello,

This email message is a notification to let you know that
a file has been uploaded to the Files area of the VirtualTreeview
group.

File : /VirtualTreeview.zip
Uploaded by : [public@l...]
Description : Version 2.4ß

You can access this file at the URL

http://groups.yahoo.com/group/VirtualTreeview/files/VirtualTreeview.zip

To learn more about file sharing for your group, please visit

http://help.yahoo.com/help/us/groups/files

Regards,

public@l...]


re: Help, please

From: "Mike Lischke" [public@l...]
Date: Mon Apr 30, 2001 7:33 am
Subject: RE: [VirtualTreeview] Help, please

Hi Wiktor and all interested,

> I would be more than gratefull if someone send me the latest
> versions of VirtualTreeview.zip, VET.zip and VSTEdit.zip.
> I have tried to download them from Yahoo many times
> but without success.

I have created a folders for those beta version on my homepage and place the
three files there. The
address is www.lischke-online.de/Downloads/Betas. Please refrain from spreading
the folders
existance. I can't give support for these beta versions other than on this
mailing list.

Ciao, Mike


re: some questions

From: "Mike Lischke" [public@l...]
Date: Mon Apr 30, 2001 8:11 am
Subject: RE: [VirtualTreeview] some questions

Hi Anders,

you did not say which version you use. I assume is one of the post-1.31 version
because you are
talking about visibility.

> 1. If I do this:
> tree.beginupdate;
> tree.rootnodecount := (some thousands);
> (a function that runs though the nodes and unsets the vsVisible to
> some nodes)
> tree.endupdate;

I recommend to do this differently:

Tree.RootNodeCount := (some thousands nodes)
Tree.ValidateNode(nil, True),

and in OnInitNode simply remove the ivsVisible flag from InitialStates.

> This causes a "Cache not entirely filled" exception.

You hit a very special situation which occurs very seldomly. The problem you
encounter is that you
are modifying the visibility of nodes while the tree is still validating the
internal cache. The
validation however is based on the visibilty of the nodes. A possible solution
is what I gave above
plus a BeginUpdate/EndUpdate pair around it to prevent the cache to be
validated until all nodes are
touch once.

> Another problem (bug?) is, that if I only have 20 nodes visible
> (vsVisible), the scrollbar min/max settings aren't updated, I can
> still scroll down the list, which is empty.

This is all the result from an invalid cache.

> Also, I have a multicolumn tree using MultiSelect and FullRowSelect.
> When I hold down Ctrl to select multiple items, the nodes aren't
> correctly painted. The selection color of the rootcolumn is correctly
> painted on MouseDown, but the remaining columns aren't drawed until
> MouseUp.

Mmmh, works fine with the latest version of VT. Please try this.

> And just a small question, what is the general difference between
> StringTree and DrawTree.

The differences are similar to those of TStringGrid and TDrawGrid. The string
tree has support to
display node captions and handles other aspects of string captions (like
caching the width for quick
draw selection and providing a possibility to edit a node's caption). The draw
tree merely publishes
the DoPaintNode method to allow the application to draw whatever it likes into
the node rectangle. I
have demonstrated this in the draw tree demo which provides a kind of image
directory browser.

Ciao, Mike

 | Replies | Author | Date
1552 | Re: some questions | [andersthomsen@h...] | Thu 5/3/2001


re: GetHitTestInfoAt

From: "Mike Lischke" [public@l...]
Date: Mon Apr 30, 2001 8:41 am
Subject: RE: [VirtualTreeview] GetHitTestInfoAt

Jim,

> If there are enough columns to force a horz scroll bar and you click
> on the vert scroll bar a call to GetHitTestInfoAt will return a valid index
> for the column UNDER the scrollbar. This is true for the horz scrollbar
> as well. Should that not return an invalid column?

Why? This would only be a limitation without a reason to do it. In some
situations it is even
necessary (e.g. when dragging). Is this a problem for your?

Ciao, Mike

 | Replies | Author | Date
1472 | Re: GetHitTestInfoAt | Jim Kueneman | Mon 4/30/2001
1474 | Re: GetHitTestInfoAt | Geoffrey Pan | Mon 4/30/2001
1495 | Re: GetHitTestInfoAt | Jim Kueneman | Tue 5/1/2001


strange: expand all problem

From: "Moritz Franckenstein" [franckenstein@a...]
Date: Mon Apr 30, 2001 9:29 am
Subject: strange: expand all problem

hi,

when i press the * button to expand all subnodes, the subnodes are
copied and added to the end, when i press it again, only the correct
nodes are copied again.

example:

a
b
c

when i press * on the "a" node, i get

a
b
c
b
c

when pressing it again, i only get one more b/c every time.

-moritz

 | Replies | Author | Date
1466 | Re: strange: expand all problem | Moritz Franckenstein | Mon 4/30/2001
1479 | Re: strange: expand all problem | Moritz Franckenstein | Mon 4/30/2001
1497 | Re: strange: expand all problem | Jim Kueneman | Tue 5/1/2001
1502 | Re: strange: expand all problem | Moritz Franckenstein | Tue 5/1/2001
1504 | Re: strange: expand all problem | Mike Lischke | Tue 5/1/2001
1508 | Re: strange: expand all problem | Moritz Franckenstein | Tue 5/1/2001
1520 | Re: strange: expand all problem | Mike Lischke | Tue 5/1/2001
1523 | Re: strange: expand all problem | Moritz Franckenstein | Tue 5/1/2001
1527 | Re: strange: expand all problem | Mike Lischke | Wed 5/2/2001


re: strange: expand all problem

From: "Moritz Franckenstein" [franckenstein@a...]
Date: Mon Apr 30, 2001 9:50 am
Subject: Re: strange: expand all problem

> when i press the * button to expand all subnodes, the subnodes are
> copied and added to the end, when i press it again, only the
correct
> nodes are copied again.

hmm, oninitchildren of node to be expanded is executed every time i
press the * button and i am adding new children there - is that wrong?

-moritz

 | Replies | Author | Date
1479 | Re: strange: expand all problem | Moritz Franckenstein | Mon 4/30/2001
1497 | Re: strange: expand all problem | Jim Kueneman | Tue 5/1/2001
1502 | Re: strange: expand all problem | Moritz Franckenstein | Tue 5/1/2001


Property 'OnShortenString' not defined

From: "Paul Istrate" [istech@c...]
Date: Mon Apr 30, 2001 8:30 am
Subject: Property 'OnShortenString' not defined

Hi Mike,

Property OnShortenString is not defined in TCustomVirtualStringTree and not
published in TVirtualStringTree.

Any reason for this, or you simply forgot?

Regards,
Paul Istrate

 | Replies | Author | Date
1505 | Re: Property 'OnShortenString' not defined | Mike Lischke | Tue 5/1/2001


re: Drag and drop w/o horz auto scroll

From: Werner Lehmann [wl@b...]
Date: Mon Apr 30, 2001 10:08 am
Subject: Re: [VirtualTreeview] Drag and drop w/o horz auto scroll

Mike Lischke wrote:
>
> > How can I prevent this horz scrolling? Currently the user has to scroll
> > A horizontally back after each drag and drop. If possible I would still
> > keep autoscroll for marquee selection in A alone.
>
> There was another posting related to this problem. Perhaps I should enable
auto scrolling only for
> selection with the rectangle and drag'n drop?

Mike,

I have tested the latest release now. One of the change notes regarding this
problem is:

// - limited auto scroll to draw selection and dragging

There may be a misunderstanding. I admit that my problem might also be very
special for me. Anyhow I have still the problem that if I drag from a
fullrowselect tree over to another tree on the right and the dragging goes
over the right border of the drop source tree this tree is scrolled
horizontally.
As if the user might want to drop on a different column in the same tree.
This is never the case, slightly indicated by the full row selection. Still,
even if this is special for my case only, how can I stop this horizontal
auto scrolling during a drag operation? Because users have to scroll the
tree horizontally back to the left, manually, to initiate the next drag
or see the whole main column again.

Regards,
Werner


suggestion: new keyboard shortcut

From: "Moritz Franckenstein" [franckenstein@a...]
Date: Mon Apr 30, 2001 11:10 am
Subject: suggestion: new keyboard shortcut

what about the '/' key to collapse all children of the current node?

or: the '/' key could set the current node to expanded and all
children to collapsed (including their children).

otherwise there would be no way to quickly undo the "expand all"
command.

 | Replies | Author | Date
1506 | Re: suggestion: new keyboard shortcut | Mike Lischke | Tue 5/1/2001
1675 | Re: suggestion: new keyboard shortcut | Moritz Franckenstein | Tue 5/8/2001
1699 | Re: suggestion: new keyboard shortcut | Mike Lischke | Wed 5/9/2001


suggestion: option to use tab instead of cursor keys

From: "Moritz Franckenstein" [franckenstein@a...]
Date: Mon Apr 30, 2001 11:20 am
Subject: suggestion: option to use tab instead of cursor keys

what about a new option to switch columns with the tab key instead of
the cursor keys? the cursor keys could then be used for expanding /
collapsing like in the no-columns-mode. i think that would be more
intuitive.

 | Replies | Author | Date
1512 | Re: suggestion: option to use tab instead of curs | Mike Lischke | Tue 5/1/2001


Re:new editors: notes for BCB users

From: "Roland" [Beduerftig@S...]
Date: Mon Apr 30, 2001 12:07 pm
Subject: Re:[VirtualTreeview] new editors: notes for BCB users

Hi Alexander,

I try to build in your workaround for using OwnEditor under VT 2.4b,
here the short list how I try it:

Step 1

I declare the property editor in BCB5 in the HPP-file
(there is copy from the VirtualTrees.HPP and added with AddRef(),
Release() and QueryInterface, because the procedure normally
protected, and we need this public)

class TPropertyEdit : public System::TInterfacedObject {
typedef System::TInterfacedObject inherited;
private:
public:
bool __stdcall BeginEdit(void);
void __stdcall CancelEdit(void);
bool __stdcall CanStop(void);
void __stdcall EndEdit(void);
Windows::TRect __stdcall GetBounds();
bool __stdcall PrepareEdit(TBaseVirtualTree* Tree,
PVirtualNode Node, int Column);
void __stdcall SetBounds(const Windows::TRect R);
__fastcall TPropertyEdit(void);
__fastcall virtual ~TPropertyEdit(void);
virtual HResult __stdcall QueryInterface(const GUID& IID,
void **Obj) { return(QueryInterface(IID, Obj)); };
virtual int __stdcall AddRef(void) { return(_AddRef()); };
virtual int __stdcall Release(void) { return(_Release()); };
};
//----------------------------------------------------------------

Step 2

and write the code for all procedure in the CPP-file, like this:

__fastcall TPropertyEdit::TPropertyEdit(void) {
}
//----------------------------------------------------------------

__fastcall TPropertyEdit::~TPropertyEdit(void) {
}
//----------------------------------------------------------------

and so on, with minimal code, because I only to want to whether the
interface work

Step 3

I look in VST and translate this procedure (written in Delphi)

procedure TVSTEditor.LinkEditor(var EditLink: IVTEditLink; Text:
String);
begin
FLink := TVSTEditorLink.Create;
FLink.EditorLink := Self;
FLink.EditType := etEditor;
EditLink := FLink;
if Assigned( FEditor ) then FEditor.Text := Text;
end;

Step 4a

...into BCB5 direct with your first idea
(you says "this is the best ...")

void __fastcall TForm1::TreeCreateEditor(TBaseVirtualTree *Sender,
PVirtualNode Node, int Column, IVTEditLink **EditLink)
// I modified here the pointer to the interface !
{
TPropertyEdit* PropertyLink = new TPropertyEdit();
PropertyLink->QueryInterface(__uuidof(IVTEditLink),
(void**)PropertyLink);
*EditLink = (IVTEditLink*)PropertyLink;
}

Step 4b

... and with your workaround for BCB5

void __fastcall TForm1::TreeCreateEditor(TBaseVirtualTree *Sender,
PVirtualNode Node, int Column, IVTEditLink **EditLink)
// I modified here the pointer to the interface !
{
_di_IVTEditLink VTEditLink = (IVTEditLink*) new TPropertyEdit();
VTEditLink->AddRef();
*EditLink = (IVTEditLink*)VTEditLink;
}

Now the results:

4a. will crash with stackoverflow in the line QueryInterface()

4b. will crash in the VT at the line ...

procedure TBaseVirtualTree.DoEdit;
begin
....
FEditLink := CreateEditor(FFocusedNode, FEditColumn);
....
if FEditLink.PrepareEdit(Self, FFocusedNode, FEditColumn) then

... FEditLink.PrepareEdit, because the FEditLink is valid, but the
VTable to this pointer isn't valid and VT jumps to "nothing" ....

It seems the same problems as we discus for two weeks ago, I think we
must initialize the VTable to the pointer FEditLink, and a
simple AddRef() isn't enough to do this.

with best regards
Roland

 | Replies | Author | Date
1473 | Re: new editors: notes for BCB users | Roland | Mon 4/30/2001
1487 | Re: new editors: notes for BCB users | Alexander Egorushkin | Mon 4/30/2001
1501 | Re: new editors: notes for BCB users | Roland | Tue 5/1/2001


re: GetHitTestInfoAt

From: Jim Kueneman [jimdk@m...]
Date: Mon Apr 30, 2001 12:30 pm
Subject: RE: [VirtualTreeview] GetHitTestInfoAt

At 10:41 AM 4/30/2001 +0200, you wrote:
>Why? This would only be a limitation without a reason to do it. In some
>situations it is even
>necessary (e.g. when dragging). Is this a problem for your?

Sort of. I am looking at DoHeaderMouseDown to handle the Ctrl + LeftButton
click to AutoFit a column, but now I realize the node that is passed is not
what I assumed (it is the node under the header) as I well as the column
returned by GetHitTestInfoAt so I will be moving to DoHeaderClick and get
the selected node (which is what I really want). Evenutally VET it will
save the column widths on a node by node basis like Explorer.

Jim

 | Replies | Author | Date
1474 | Re: GetHitTestInfoAt | Geoffrey Pan | Mon 4/30/2001
1495 | Re: GetHitTestInfoAt | Jim Kueneman | Tue 5/1/2001


Re:new editors: notes for BCB users

From: "Roland" [Beduerftig@S...]
Date: Mon Apr 30, 2001 1:04 pm
Subject: Re:[VirtualTreeview] new editors: notes for BCB users

Hi Alexander,

I think I have seen the main difference between my last example and
your message 1405.

In your message ther is shown to use an own Editor writen i Delphi,
and here the "interface" is initialize from Delphi and BCB5 call a
class TComponent and need only a pointer to the editor.

And in my example I write all complet in BCB5 and nothing in Delphi, I
want use VT without modification and use the OwnEditor written in BCB5
under VT, and here the "interface" must be initialize by myself, this
is the reason why the FEditLink is a valid pointer and the VTable to
this pointer (= "interface") is undefined.

I think your right, QueryInterface is the way to initialize the VTable
to FEditLink, but the lastest try was a stackoverflow !!??

with the best regards
Roland


re: GetHitTestInfoAt

From: "Geoffrey Pan" [gpan@c...]
Date: Mon Apr 30, 2001 2:39 pm
Subject: RE: [VirtualTreeview] GetHitTestInfoAt

Would appreciate if someone can explain the changes to getNodeAt, not sure
what the two additional params (beyond X,Y) do

-----Original Message-----
From: Jim Kueneman [mailto:[jimdk@m...]]
Sent: Monday, April 30, 2001 7:30 AM
To: VirtualTreeview@yahoogroups.com
Subject: RE: [VirtualTreeview] GetHitTestInfoAt

At 10:41 AM 4/30/2001 +0200, you wrote:
>Why? This would only be a limitation without a reason to do it. In some
>situations it is even
>necessary (e.g. when dragging). Is this a problem for your?

Sort of. I am looking at DoHeaderMouseDown to handle the Ctrl + LeftButton
click to AutoFit a column, but now I realize the node that is passed is not
what I assumed (it is the node under the header) as I well as the column
returned by GetHitTestInfoAt so I will be moving to DoHeaderClick and get
the selected node (which is what I really want). Evenutally VET it will
save the column widths on a node by node basis like Explorer.

Jim

To unsubscribe from this group, send an email to:
VirtualTreeview-unsubscribe@egroups.com

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/

 | Replies | Author | Date
1495 | Re: GetHitTestInfoAt | Jim Kueneman | Tue 5/1/2001


re: VET 1.0

From: "Jim Kueneman" [jimdk@m...]
Date: Mon Apr 30, 2001 2:56 pm
Subject: Re: VET 1.0

--- In [VirtualTreeview@y...], [adembaba@e...] wrote:

> I dont think it would. I have done a similar thing in my
> ZipUnzipDemo and thanks to the VT, it does not make a blunder
> the way you seem to fear it would.

Please excuse my thick headedness. The light finally came on and I
was heading down the wrong path. It is currently in work.

I would like some opinions though.

How should the folders be handled? Should they always be above the
files? I realize that they should stay clustered together but
should the tree be "flipped" upside down with all the folders on the
bottom? I have looked at it both ways and the upside down tree is
somewhat confusing. Anyone have some input?

Jim

 | Replies | Author | Date
1485 | Re: VET 1.0 | [adembaba@e...] | Mon 4/30/2001
1494 | Re: VET 1.0 | Jim Kueneman | Tue 5/1/2001
1499 | Re: VET 1.0 | [adembaba@e...] | Tue 5/1/2001


re: VET 1.0

From: "Jim Kueneman" [jimdk@m...]
Date: Mon Apr 30, 2001 3:02 pm
Subject: Re: VET 1.0

--- In [VirtualTreeview@y...], "Mike Lischke" [public@l...] wrote:
> > Mike, Explorer uses backspace to back up from a node to its
parent
> > as well as using the arrow keys. What are your feelings on adding
> > this to VT, or should I implement it in VET? Also Is there some
way
> > to "auto fit" all columns? (Like Ctrl (NumPad)+ in explorer)
>
> VK_BACK is now implemented. Auto fit of columns as well, but I had
to assign a different hot key
> (Ctrl + Shift + '+') because the other one is already taken by the
tree for a full expand.

How about an option to use "classic VT" hot keys or "explorer" full
expand keys and use the Ctrl + Shift + '+' for a full expand in
"explorer" mode (I always *want* something don't I). I can
envision some upset people who hit Ctrl + '+' to autofit like explorer
and suddenly they are waiting for their entire network to enumerate!

Jim


re: Re: VET 1.0 (Auto fit)

From: Mike Lischke [public@l...]
Date: Mon Apr 30, 2001 3:28 pm
Subject: RE: [VirtualTreeview] Re: VET 1.0 (Auto fit)

Hi Adem,

> Would it not be more helpful if you could add a
> 'coAutoFit' to TVTColumnOption and then instead
> of 'Header.AutoFitColumns' give us a
>
> Header.AutoFitOnBorderClick
>
> which would mean VT would autofit the column much
> like Explorer (Excel etc) does.

VT does auto fit its columns now exactly as the Explorer does. A double
click on the splitter resizes a column while the hot key (whatever it will
be, more on this in another mail) fits all columns to their texts.

Adding an option is no option because it would change a streamed property
with all the trouble like increasing stream version number and taking care
for it during load and save. Additionally, the option would not add value to
the header (unless I miss something important).

Ciao, Mike

 | Replies | Author | Date
1478 | Sorting of plain treeview | Geoffrey Pan | Mon 4/30/2001
1496 | Re: Sorting of plain treeview | Jim Kueneman | Tue 5/1/2001
1484 | Re: VET 1.0 (Auto fit) | [adembaba@e...] | Mon 4/30/2001


Sorting of plain treeview

From: "Geoffrey Pan" [gpan@c...]
Date: Mon Apr 30, 2001 3:47 pm
Subject: Sorting of plain treeview

How can I get a plain treeview (no columns) to autosort. I know this is a
old question, am running 2.4 beta with AutoSort turned on, but not sure how
to link the callback function (I know some changes were made since 2.0).

Geoffrey Pan

 | Replies | Author | Date
1496 | Re: Sorting of plain treeview | Jim Kueneman | Tue 5/1/2001


re: strange: expand all problem

From: "Moritz Franckenstein" [franckenstein@a...]
Date: Mon Apr 30, 2001 4:01 pm
Subject: Re: strange: expand all problem

hmm2, pressing * on a node sometimes causes a full expand of the
rootnode instead of the current node. i have also seen that in the
VET demo.

> hmm, oninitchildren of node to be expanded is executed every time i
> press the * button and i am adding new children there - is that
wrong?

 | Replies | Author | Date
1497 | Re: strange: expand all problem | Jim Kueneman | Tue 5/1/2001
1502 | Re: strange: expand all problem | Moritz Franckenstein | Tue 5/1/2001


re: More fine grained version numbers please

From: Mike Lischke [public@l...]
Date: Mon Apr 30, 2001 4:19 pm
Subject: RE: [VirtualTreeview] More fine grained version numbers please

> I was wondering if it would not be a better idea to
> use more fine grained version numbers for VT, VET
> and others.

Good idea.

> This would help immensely, as otherwise I have only
> the date of upload to go by --which is not very
> informative.

I imagine another scheme. Something like Major.Minor.Build, but I am open to
further suggestions. Does anybody has experiences with proper versioning?

> Plus, we could have a folder 'Older versions' where
> people needing older versions could get what they are
> looking for.

It was already mention quite a while ago to create a Museum folder. And just
this morning (before I read your mail) I decided to create one finally.

Ciao, Mike

 | Replies | Author | Date
1483 | Re: More fine grained version numbers please | [adembaba@e...] | Mon 4/30/2001
1489 | Re: More fine grained version numbers please | Alexander Egorushkin | Mon 4/30/2001
1515 | Re: More fine grained version numbers please | Mike Lischke | Tue 5/1/2001


general questions about how to fill the tree

From: "Moritz Franckenstein" [franckenstein@a...]
Date: Mon Apr 30, 2001 4:44 pm
Subject: general questions about how to fill the tree

hi,

my current "project" is to display an xml document in a treeview. i
have got it to work, it looks nice, but i am not sure if i did it
right.

first i want to put the rootnode of the xml document into the tree.
but that didnt work correctly - i only managed it inside the
OnInitNode event (tested if parent is nil and then set it).
i would like to use the same event handler for different treeviews
with different xmldoc's in it - how can i initialize the tree with
the rootnode and its data correctly?

where is the right place to set the hasChildren flag, where do i have
to add the subnodes and where to set the data?
at the moment, i add the children in a loop in OnInitChildren and
also set the data to the IXMLDOMNode there.
then, in OnInitNode i get the xmlnode out of the data and set the
hasChildren flag accordingly.
is that the best way?

thanks in advance!
-moritz

 | Replies | Author | Date
1518 | Re: general questions about how to fill the tree | Mike Lischke | Tue 5/1/2001


InvalidateChildren and versioning

From: "Anthony Mills" [amills@m...]
Date: Mon Apr 30, 2001 7:43 pm
Subject: InvalidateChildren and versioning

Mike,

I was going to report an error in TBaseVirtualTree.InvalidateToBottom but
then you went and uploaded a new version which fixed it! What's worse, your
fix was slightly more elegant than mine! Argh!

> There are methods to do this. Please look up ReinitNode, ReinitChildren
and
> ResetNode.

I did, but I don't want the nodes to be reinitialized; I just want them
invalidated. I want the caption length cleared and the node invalidated to
force VT to redraw the caption and call DoGetText while it's doing that. I
guess what I want is an InvalidateChildren method:

procedure TBaseVirtualTree.InvalidateChildren(Node: PVirtualNode;
Recursive: Boolean);

// Invalidates Node and its immediate children.
// If Recursive is True then all grandchildren are invalidated as well.

procedure ProcessChildren(Node: PVirtualNode; Recursive: Boolean);

var
Run: PVirtualNode;

begin
Run := Node.FirstChild;
while Assigned(Run) do
begin
InvalidateNode(Run);
if Recursive and Assigned(Run.FirstChild) then
ProcessChildren(Run, True);
Run := Run.NextSibling;
end;
end;

begin
if Assigned(Node) and (Node <> FRoot) then
begin
InvalidateNode(Node);
ProcessChildren(Node, Recursive);
end
else
ProcessChildren(FRoot, Recursive);
end;

> I imagine another scheme. Something like Major.Minor.Build, but I am open
to
> further suggestions. Does anybody has experiences with proper versioning?

Internally, my company uses version numbers like 2.4.417.0 (the first
'release build' on April 17 of version 2.4), and it seems to work very well
as long as we don't take a year between each minor release. :-)

So I usually rename VT versions to 2.4.417 or similar.

I have no idea if this is 'proper' or not. ;-)

Regards,

Tony

 | Replies | Author | Date
1517 | Re: InvalidateChildren and versioning | Mike Lischke | Tue 5/1/2001


re: More fine grained version numbers please

From: [adembaba@e...]
Date: Mon Apr 30, 2001 8:19 pm
Subject: Re: More fine grained version numbers please

> > This would help immensely, as otherwise I have only
> > the date of upload to go by --which is not very
> > informative.
>
> I imagine another scheme. Something like Major.Minor.Build,
> but I am open to further suggestions.

That scheme is quite fine when things are less than
dynamic, which is hardly the case for VT :-)

But, unless I am mistaken, we have seen more than one
version of 2.3B and 2.4B (similar for VET, and Editors)
which is what brought me to the point of raising the
point.

> Does anybody has experiences with proper versioning?

Apparently, not too many --or else, someone else
would have brought that up

Cheers,


re: VET 1.0 (Auto fit)

From: [adembaba@e...]
Date: Mon Apr 30, 2001 8:24 pm
Subject: Re: VET 1.0 (Auto fit)

Hi Mike,

> Adding an option is no option because it would change a streamed
> property with all the trouble like increasing stream version
> number and taking care for it during load and save. Additionally,
> the option would not add value to the header (unless I miss
> something important).

I was not aware of this sort of drawback.

It probably is not *that* important. It would have meant
that only *some* columns would autofit while others did
not.

Cheers,


re: VET 1.0

From: [adembaba@e...]
Date: Mon Apr 30, 2001 8:30 pm
Subject: Re: VET 1.0

Hi Jim,

> Please excuse my thick headedness.

Nope. If anyone it is me since I am the person who
keeps *asking* for features instead of implementing them.

> The light finally came on and I was heading down the wrong
> path. It is currently in work.
>
> I would like some opinions though.
>
> How should the folders be handled? Should they always be above the
> files? I realize that they should stay clustered together but
> should the tree be "flipped" upside down with all the folders
> on the bottom? I have looked at it both ways and the upside
> down tree is somewhat confusing. Anyone have some input?

IMHO, forlders must be clustered such that when sorted
ascending all folders remain at the top (sorted amongst
themselves), and when descending, they are at the bottom.

I believe this is how Windows does it, and people are used
to the interface (well, for one, I am :-).

Cheers,

 | Replies | Author | Date
1494 | Re: VET 1.0 | Jim Kueneman | Tue 5/1/2001
1499 | Re: VET 1.0 | [adembaba@e...] | Tue 5/1/2001


re: Help, please

From: "Wiktor Sadowski" [wiktor@w...]
Date: Fri Mar 2, 2001 8:57 pm
Subject: Re: [VirtualTreeview] Help, please

Mike,
Thank you very much and thanks to all who responded!

Wiktor

> I have created a folders for those beta version on my homepage and place
the three files there. The
> address is www.lischke-online.de/Downloads/Betas. Please refrain from
spreading the folders
> existance. I can't give support for these beta versions other than on this
mailing list.
>
> Ciao, Mike
>


re: new editors: notes for BCB users

From: "Alexander Egorushkin" [egorushkin@m...]
Date: Mon Apr 30, 2001 9:45 pm
Subject: RE: [VirtualTreeview] new editors: notes for BCB users

Hi, Ronald!

> Step 1
>
> I declare the property editor in BCB5 in the HPP-file
> (there is copy from the VirtualTrees.HPP and added with AddRef(),
> Release() and QueryInterface, because the procedure normally
> protected, and we need this public)
>
> class TPropertyEdit : public System::TInterfacedObject {
> typedef System::TInterfacedObject inherited;
> private:
> public:
> bool __stdcall BeginEdit(void);
> void __stdcall CancelEdit(void);
> bool __stdcall CanStop(void);
> void __stdcall EndEdit(void);
> Windows::TRect __stdcall GetBounds();
> bool __stdcall PrepareEdit(TBaseVirtualTree* Tree,
> PVirtualNode Node, int Column);
> void __stdcall SetBounds(const Windows::TRect R);
> __fastcall TPropertyEdit(void);
> __fastcall virtual ~TPropertyEdit(void);
> virtual HResult __stdcall QueryInterface(const GUID& IID,
> void **Obj) { return(QueryInterface(IID, Obj)); };
> virtual int __stdcall AddRef(void) { return(_AddRef()); };
> virtual int __stdcall Release(void) { return(_Release()); };
> };
> //----------------------------------------------------------------
I wanted to do the same for you, but I really was very busy. Sorry.
So, there are some errors here:
1) Where is defined that this class implements IUnknown and IVTEditLink
interfaces?
2) Hence QueryInterface will return E_NOINTERFACE if you pass
__uuidof(IVTEditLink) to it.

From help on TInterfacedObject
...
"Do not use TInterfacedObject in C++Builder applications. COM support in
C++Builder is based on the ATL library. TInterfacedObject exists for
interfaces that are used by the C++Builder IDE, such as component editors".

IVTEditLink is a simle interface so I think we can implement it without ATL.

class TPropertyEdit : public IVTEditLink
{
ULONG FRefCount;
// Other private members
// May be, pointer to real editor,
//because it's just a link
public:
// Constructor/Destructor
__fastcall TPropertyEdit(void);
virtual __fastcall ~TPropertyEdit(void);

//IUnknown members
virtual ULONG __stdcall AddRef();
virtual ULONG __stdcall Release();
virtual HResult __stdcall QueryInterface(const GUID& IID, void** ppv);

//IVTEditLinkMembers
virtual bool __stdcall BeginEdit(void);
virtual void __stdcall CancelEdit(void);
virtual bool __stdcall CanStop(void);
virtual void __stdcall EndEdit(void);
virtual bool __stdcall PrepareEdit(TBaseVirtualTree* Tree, PVirtualNode
Node, int Column);
virtual Windows::TRect __stdcall GetBounds(void);
virtual void __stdcall SetBounds(const Windows::TRect R);
};

> Step 2
>
__fastcall TPropertyEdit::TPropertyEdit(void)
{
//...
//Other initializations

FRefCount = 0;
}
> //----------------------------------------------------------------
>
__fastcall TPropertyEdit::~TPropertyEdit(void)
{
//TODO: Add your source code here :)
}
> //----------------------------------------------------------------
>
>
> Step 3
Implement IUnknown interface
ULONG __stdcall TPropertyEdit::AddRef()
{
//thread safe increment
return InterlockedIncrement(&FRefCount);
}
ULONG __stdcall TPropertyEdit::Release()
{
InterlockedDecrement(&FRefCount);
if(FRefCount == 0)
{
delete this;
return 0;
}
return FRefCount;
}
HResult __stdcall TPropertyEdit::QueryInterface(const GUID& IID, void**
ppv)
{
if(IID == IID_Unknown)
*ppv = (IUnknown*)this;
else if(IID == __uuidof(IVTEditLink))
*ppv = (IVTEditLink*)this;
else
{
*ppv = NULL;
return E_NOINTERFACE;
}
((IUnknown*)(*ppv))->AddRef();
return S_OK;
}

Step 4
Implement IVTEditLink methods

Step 5
Assign your own just created edit link to the tree
> Step a
>
>
> void __fastcall TForm1::TreeCreateEditor(TBaseVirtualTree *Sender,
> PVirtualNode Node, int Column, IVTEditLink **EditLink)
> // I modified here the pointer to the interface !
OK!
> {
> TPropertyEdit* PropertyLink = new TPropertyEdit();
// FRefCount is 0
> PropertyLink->QueryInterface(__uuidof(IVTEditLink),
> (void**)EditLink);
// | PropertyLink is a pointer,
// we must use & operator to
convert
// it to pointer to interface
// FRefCount is 1 (if SUCCEED)!
> }

>
> Step b
> void __fastcall TForm1::TreeCreateEditor(TBaseVirtualTree *Sender,
> PVirtualNode Node, int Column, IVTEditLink **EditLink)
> // I modified here the pointer to the interface !
OK!
> {
> _di_IVTEditLink VTEditLink = (IVTEditLink*) new TPropertyEdit();
{
// N e v e r d o i t when you deal with real COM
> VTEditLink->AddRef();
> *EditLink = (IVTEditLink*)VTEditLink;
}
// or instead this
// VTEditLink->QueryInterface(__uuidof(IVTEditLink), (void**)EditLink);
> }
>
> Now the results:
Should work :)
Alex.

 | Replies | Author | Date
1501 | Re: new editors: notes for BCB users | Roland | Tue 5/1/2001


re: Re: DBVT - a short description

From: "Alexander Egorushkin" [egorushkin@m...]
Date: Mon Apr 30, 2001 9:45 pm
Subject: RE: [VirtualTreeview] Re: DBVT - a short description

Hi!
I decided to write a DB VTree that can contain one or more levels. Each
level - a DataSource that can be structured (field Path ot Parent) or just a
table. Relations between levels One-To-Many or Many-To-Many; one level can
be in One-To-Many or Many-To-Many relations to itself (if it is structured).
So, with this component one will be able to view one hierarhical table,
master-detail relation and so on. I will write it directly in Delphi.
Is anybody interested in DBVT-aware component?

>
> I could not find *.BPL file in the demos.
Just uploaded. To install it you must rename your VT package to
VirtualTreeView.dcp (sorry).

 | Replies | Author | Date
1492 | Re: DBVT - a short description | [adembaba@e...] | Mon 4/30/2001
1493 | Re: DBVT - a short description | Alexander Egorushkin | Tue 5/1/2001
1498 | Re: DBVT - a short description | [adembaba@e...] | Tue 5/1/2001


re: More fine grained version numbers please

From: "Alexander Egorushkin" [egorushkin@m...]
Date: Mon Apr 30, 2001 9:45 pm
Subject: RE: [VirtualTreeview] More fine grained version numbers please

> Does anybody has experiences with proper versioning?
X.Y.NumberOfBugsFixed.NumberOfFeaturesImplemented :)

Alex.

 | Replies | Author | Date
1515 | Re: More fine grained version numbers please | Mike Lischke | Tue 5/1/2001


New file uploaded to VirtualTreeview

From: [VirtualTreeview@yahoogroups.com>
Date: Mon Apr 30, 2001 9:50 pm
Subject: New file uploaded to VirtualTreeview

Hello,

This email message is a notification to let you know that
a file has been uploaded to the Files area of the VirtualTreeview
group.

File : /dbvt.zip
Uploaded by : [egorushkin@m...]
Description : DBVT.bpl

You can access this file at the URL

http://groups.yahoo.com/group/VirtualTreeview/files/dbvt.zip

To learn more about file sharing for your group, please visit

http://help.yahoo.com/help/us/groups/files

Regards,

egorushkin@m...]


System Resources Error in VirtualTree

From: Kent Briggs [kbriggs@b...]
Date: Mon Apr 30, 2001 10:27 pm
Subject: System Resources Error in VirtualTree

I'm getting an "out of system resources" error with the latest 2.4 beta. Try
the following:

1. Create a new app and add a TPanel control. Set Align to alLeft.
2. Add a TSplitter to form and set AutoSnap to false.
3. Add a TVirtualStringTree to the empty spot on the form and set Align to
alClient.
4. Add at least one header.column to the virtualtree and set
header.options.hovisible to true.
5. Run the app and maximize form to full screen.
6. Slide the splitter control all the way to the right.
7. Restore the form to its previous size.
8. Scroll the form to the right and attempt to grab the splitter and
re-center it.

At this point, I get the system resources execption on line 12454,
RestoreDC(DC,SavedDC), in the TBaseVirtualTree.WMNCPaint event.

--
Kent Briggs, [kbriggs@b...]
Briggs Softworks, http://www.briggsoft.com

 | Replies | Author | Date
1516 | Re: System Resources Error in VirtualTree | Mike Lischke | Tue 5/1/2001
1525 | Re: System Resources Error in VirtualTree | Geoffrey Pan | Wed 5/2/2001


re: DBVT - a short description

From: [adembaba@e...]
Date: Mon Apr 30, 2001 10:49 pm
Subject: Re: DBVT - a short description

Hi Alex,

> I will write it directly in Delphi.
> Is anybody interested in DBVT-aware component?

Are you kidding!!!! :-) Months ago we discussed about
this, and wished someone with the time and knowledge
had come along to do it.

> > I could not find *.BPL file in the demos.
> Just uploaded. To install it you must rename your VT package to
> VirtualTreeView.dcp (sorry).

It had to be that way, didn't it..

I have, unfortunately, combined everything Mike has written
(or things that are directly derived from tem) into one single
*.dpk (namely, MikeLischkeVCL.dpk) which has innumerable
components in it --as far as I know, Mike is the most prolific
developer of truely serious stuff (serious:= unlike those who
add a single feature to Borland VCLs and publishes them as a
new VCL) So, I for one can not simply rename the BPL --I'll
gladly and eagerly wait for yhe Delphi version.

Keep up the good work.

Cheers,

 | Replies | Author | Date
1493 | Re: DBVT - a short description | Alexander Egorushkin | Tue 5/1/2001
1498 | Re: DBVT - a short description | [adembaba@e...] | Tue 5/1/2001


re: Re: DBVT - a short description

From: "Alexander Egorushkin" [egorushkin@m...]
Date: Tue May 1, 2001 12:26 am
Subject: RE: [VirtualTreeview] Re: DBVT - a short description

Hi!

> I have, unfortunately, combined everything Mike has written
> (or things that are directly derived from tem) into one single
> *.dpk (namely, MikeLischkeVCL.dpk) which has innumerable
> components in it
What other components? Are they accessable?

> --as far as I know, Mike is the most prolific
> developer of truely serious stuff (serious:= unlike those who
> add a single feature to Borland VCLs and publishes them as a
> new VCL) So, I for one can not simply rename the BPL --I'll
> gladly and eagerly wait for yhe Delphi version.
>
> Keep up the good work.
My first principle in programming is as follows: do not make other people
debug what you can debug yourself (it's very topically in COM :)

Alex.

 | Replies | Author | Date
1498 | Re: DBVT - a short description | [adembaba@e...] | Tue 5/1/2001


re: VET 1.0

From: "Jim Kueneman" [jimdk@m...]
Date: Tue May 1, 2001 12:29 am
Subject: Re: VET 1.0

--- In [VirtualTreeview@y...], [adembaba@e...] wrote:
> > on the bottom? I have looked at it both ways and the upside
> > down tree is somewhat confusing. Anyone have some input?
>
> IMHO, forlders must be clustered such that when sorted
> ascending all folders remain at the top (sorted amongst
> themselves), and when descending, they are at the bottom.
>
> I believe this is how Windows does it, and people are used
> to the interface (well, for one, I am :-).

That is the way windows does it but.... that is in the listview as a
single level entity. VET get confusing trying to decide what is a
folder and what is a file when all the details are turned on and you
are looking at details on the right. Add to that all the expandable
folders are on the bottom and the tree "expands from the bottom of the
node". I will upload that implementation when ready and see what you
think but I find is odd to have to scroll to the bottom of a list to
expand to the next level?

Maybe it is just me.

Jim

 | Replies | Author | Date
1499 | Re: VET 1.0 | [adembaba@e...] | Tue 5/1/2001


re: GetHitTestInfoAt

From: Jim Kueneman [jimdk@m...]
Date: Tue May 1, 2001 1:36 am
Subject: RE: [VirtualTreeview] GetHitTestInfoAt

At 09:39 AM 4/30/2001 -0500, you wrote:
>Would appreciate if someone can explain the changes to getNodeAt, not sure
>what the two additional params (beyond X,Y) do

I will take a stab at it. The first parameter, Relative, defines how to
interpert X and Y. Imagine a large tree fully expanded that won't fit in
the window. It may be take 10000 pixels to fully realize it in the
vertical direction. Now take a picture frame (the window) and slide it
around that complete image of the tree. If you always concider the top
right corner of the frame 0, 0 and you say point 2, 2 then in Relative
coordinates it is 2 pixels to the right and 2 down from the corner of the
frame regardless of where it is on the logical image. The actual point on
the map of the whole tree will only be 2, 2 if the corner of the window
aligns with the 0, 0 point of the logical map. So if you get a mouse
coordinate for instance it will be relative to the window so VT maps this
coordinate to the logical map of the tree to find the right node. If
Relative is false the point passed in an actual point on the logical map
and the node is found directly. My guess is you will rarely use Relative =
false in an application.

The next is the Y coordinate of the top of the node, its coordinate system
(Relative or Absolute to the image map depending on the previous
paramter) I am not sure of an instance it would be useful except
internally for dragging maybe?

Jim


re: Sorting of plain treeview

From: Jim Kueneman [jimdk@m...]
Date: Tue May 1, 2001 1:43 am
Subject: Re: [VirtualTreeview] Sorting of plain treeview

At 10:47 AM 4/30/2001 -0500, you wrote:
>How can I get a plain treeview (no columns) to autosort. I know this is a
>old question, am running 2.4 beta with AutoSort turned on, but not sure how
>to link the callback function (I know some changes were made since 2.0).

The callback is gone. Use the OnCompareNode event.

Jim


re: Re: strange: expand all problem

From: Jim Kueneman [jimdk@m...]
Date: Tue May 1, 2001 1:45 am
Subject: Re: [VirtualTreeview] Re: strange: expand all problem

At 04:01 PM 4/30/2001 +0000, you wrote:
>hmm2, pressing * on a node sometimes causes a full expand of the
>rootnode instead of the current node. i have also seen that in the
>VET demo.

Are you sure? I thought this was happening too but I was fooling
myself. I would click on a '+' to expand a node then hit '*' to my
confusion the whole tree expanded from the root. Clicking '+' does not
select the node it was still the root node selected <g>

Jim

 | Replies | Author | Date
1502 | Re: strange: expand all problem | Moritz Franckenstein | Tue 5/1/2001


re: DBVT - a short description

From: [adembaba@e...]
Date: Tue May 1, 2001 2:38 am
Subject: Re: DBVT - a short description

> What other components? Are they accessable?

Check out http://www.lischke-online.de

> My first principle in programming is as follows: do not
> make other people debug what you can debug yourself
> (it's very topically in COM :)

How un-Microsoft can you get :-)

Cheers,


re: VET 1.0

From: [adembaba@e...]
Date: Tue May 1, 2001 2:47 am
Subject: Re: VET 1.0

> > I believe this is how Windows does it, and people are used
> > to the interface (well, for one, I am :-).
>
> That is the way windows does it but.... that is in the listview
> as a single level entity. VET get confusing trying to decide
> what is a folder and what is a file when all the details are
> turned on and you are looking at details on the right. Add
> to that all the expandable folders are on the bottom and the
> tree "expands from the bottom of the node". I will upload that
> implementation when ready and see what you think but I find is
> odd to have to scroll to the bottom of a list to expand to the
> next level?

Maybe we could ask Mike to give us Ctrl+Alt+Something
keyboard shortcut so that we could toggle all folders
under the focused node to be (in)visible :-))

Joking aside (and I am not sure I was), where else can
you see all the files and folders under all folders
of interest without continually clicking different folders
on the treeview pane and hoping you'd develop photographic
memory through flashing listview contents to your tiring
eyes...

MS Windows Explorer tries to do this with a clumsy 'Explore'
item in the shell menu.

Cheers,


re: Re: More fine grained version numbers please

From: "Vadim Sedulin" [wsntrl@o...]
Date: Tue May 1, 2001 6:58 am
Subject: Re: [VirtualTreeview] Re: More fine grained version numbers please

Hello Mike!

> Does anybody has experiences with proper versioning?

Standard "Major.Minor.Release.Build" is good enough. Major=as is, Minor=new
features added, Release=bug fixes, Build=for debug purposes.

Bye.

Vadim Sedulin
E-Mail: [wsntrl@o...]

 | Replies | Author | Date
1519 | Re: More fine grained version numbers please | Mike Lischke | Tue 5/1/2001


re: new editors: notes for BCB users

From: "Roland" [Beduerftig@S...]
Date: Tue May 1, 2001 8:37 am
Subject: Re: new editors: notes for BCB users

Hi Alexander,
> Step 5
> Assign your own just created edit link to the tree
> >
> > Step a
TPropertyEdit* PropertyLink = new TPropertyEdit();
PropertyLink->QueryInterface(__uuidof(IVTEditLink),
(void**)EditLink);
> > Step b
_di_IVTEditLink VTEditLink = (IVTEditLink*) new PropertyEdit();
VTEditLink->QueryInterface(__uuidof(IVTEditLink),(void**)EditLink);
> >
> > Now the results:
> Should work :)
> Alex.

I build in your source and try both ways Step a and Step b

The result is:

It seems so ! PrepareEdit() will call correct and no exception will
happened.

Note:

I at home today, but tomorrow I will test on the office computer with
the full source code.

After this test I upload the complet short Demoprogram for all the
other BCB5 User to show to use this interface.

Many thanks for help Alexander
Roland


re: strange: expand all problem

From: "Moritz Franckenstein" [franckenstein@a...]
Date: Tue May 1, 2001 8:42 am
Subject: Re: strange: expand all problem

--- In [VirtualTreeview@y...], Jim Kueneman [jimdk@m...] wrote:
> At 04:01 PM 4/30/2001 +0000, you wrote:
> >hmm2, pressing * on a node sometimes causes a full expand of the
> >rootnode instead of the current node. i have also seen that in the
> >VET demo.
>
> Are you sure? I thought this was happening too but I was fooling
> myself. I would click on a '+' to expand a node then hit '*' to my
> confusion the whole tree expanded from the root. Clicking '+' does
not
> select the node it was still the root node selected <g>

yes, i am sure - i have focused the node by clicking on it. but it
doesnt happen always.


VET 1.0a

From: [jimdk@m...]
Date: Tue May 1, 2001 6:44 am
Subject: VET 1.0a

Version 1.0a

- Implemented Ctrl + Left Click on a column header to toggle between
Autofit with and its previous width.
- Implemented Shift + Left Click on a column header to toggle between
minimum width and its previous width.
- Bug fix in Created and Accessed Time (oversight when coverting to
WideStrings)
- Implemented column click sorting in report view.
- "Fixed" refreshing of Recycle Bin by forcing a refresh of entire
tree the notification PIDL is not valid. :^(
- Fixed bug when desktop item was created or renamed if c drive node
is initialized but not expanded the refresh would expand as far as it
could since VET also get a refresh for the physical desktop folder
- Added FolderTextColor and FileTextColor properties to try to make
folders and files visually different to help accent the distinction
between them.

I also added a folder in the Museum to place the older VET source.

Jim

 | Replies | Author | Date
1522 | Re: VET 1.0a | Jim Kueneman | Tue 5/1/2001


re: Re: strange: expand all problem

From: "Mike Lischke" [public@l...]
Date: Tue May 1, 2001 9:35 am
Subject: RE: [VirtualTreeview] Re: strange: expand all problem

Hi Moritz,

> hmm, oninitchildren of node to be expanded is executed every time i
> press the * button and i am adding new children there - is that wrong?

This was a bug. Note the time form :o]

Ciao, Mike

 | Replies | Author | Date
1508 | Re: strange: expand all problem | Moritz Franckenstein | Tue 5/1/2001
1520 | Re: strange: expand all problem | Mike Lischke | Tue 5/1/2001
1523 | Re: strange: expand all problem | Moritz Franckenstein | Tue 5/1/2001


re: Property 'OnShortenString' not defined

From: "Mike Lischke" [public@l...]
Date: Tue May 1, 2001 10:05 am
Subject: RE: [VirtualTreeview] Property 'OnShortenString' not defined

Paul,

> Property OnShortenString is not defined in TCustomVirtualStringTree and not
> published in TVirtualStringTree.
> Any reason for this, or you simply forgot?

I simply forgot to publish it, sorry.

Ciao, Mike


re: suggestion: new keyboard shortcut

From: "Mike Lischke" [public@l...]
Date: Tue May 1, 2001 10:05 am
Subject: RE: [VirtualTreeview] suggestion: new keyboard shortcut

> what about the '/' key to collapse all children of the current node?

If only every suggestion would be so easy to implement :o] Accepted and done
(actually it is the / key on the numpad, as with the * key),

Ciao, Mike

 | Replies | Author | Date
1675 | Re: suggestion: new keyboard shortcut | Moritz Franckenstein | Tue 5/8/2001


re: Drag and drop w/o horz auto scroll

From: "Mike Lischke" [public@l...]
Date: Tue May 1, 2001 10:05 am
Subject: RE: [VirtualTreeview] Drag and drop w/o horz auto scroll

Werner,

> There may be a misunderstanding. I admit that my problem might also be very
> special for me. Anyhow I have still the problem that if I drag from a
> fullrowselect tree over to another tree on the right and the dragging goes
> over the right border of the drop source tree this tree is scrolled
> horizontally.

This is not so special as you might think. The problem was however, that I have
forgotten to change the scroll delay implementation for dragging. Auto
scrolling for draw selection is handled by a timer (including the initial delay
when to start scrolling). For drag'n drop however this is not possible and the
scrolling is done during OnDragOver. I have now fixed this behavior so that the
AutoScrollDelay property is properly taken into account. By setting it to 1
second you can avoid auto scrolling the tree when the drag image moves to the
borders of it and further.

Ciao, Mike


re: strange: expand all problem

From: "Moritz Franckenstein" [franckenstein@a...]
Date: Tue May 1, 2001 11:05 am
Subject: Re: strange: expand all problem

--- In [VirtualTreeview@y...], "Mike Lischke" [public@l...] wrote:
> > hmm, oninitchildren of node to be expanded is executed every time
i
> > press the * button and i am adding new children there - is that
wrong?
>
> This was a bug. Note the time form :o]

wonderful, so it is correct that i always add all children when this
event is called?

 | Replies | Author | Date
1520 | Re: strange: expand all problem | Mike Lischke | Tue 5/1/2001
1523 | Re: strange: expand all problem | Moritz Franckenstein | Tue 5/1/2001


re: DragImage with Full row select

From: Werner Lehmann [wl@b...]
Date: Tue May 1, 2001 2:09 pm
Subject: Re: [VirtualTreeview] DragImage with Full row select

Mike Lischke wrote:
>
> The point is here that the drag image is set to show only the main column
while the users starts
> dragging in any other column. If the full drag image is enabled then of
course there will be one
> shown. What I would like to avoid is to suddenly show a drag image from the
main column over a place
> belonging to another column. There are however means to still show something
by setting the width of
> the drag image to a wider value, so less gets clipped.

Ok then. I will set the drag imagekind to Complete. The drag image is not
larger (as I expected at
first until I noticed the DragWidth property). It may appear odd to some users
that the main column
may not be shown in the drag image (or that a drag does not start if static
text is clicked on). But I
can live with that; users will learn :)

> For VCL dd I could not show a drag image at all because the image was tightly
integrated into the
> drag manager. I don't know why Borland has implemented a totally own handling
but it was a bad idea,
> which dd developers have now to live with. But since I have recently splitted
the drag image
> handling and the drag manager I can imagine to have a drag image also during
VCL dd. I have still to
> think about it.

Personally I am not too focused on VCL vs. OLE dragging. I support drag and
drop only within one
instance of the application (or are there other important difference between
both?).

Regards,
Werner


Two wishes...

From: Werner Lehmann [wl@b...]
Date: Tue May 1, 2001 2:11 pm
Subject: Two wishes...

Hi Mike,

I am taking the freedom and the chance to ask for two things where the
developers
of comctl32 would not even listen to me :)

(1) Is it possible two have alternating row colors but keep the color to the
right
of the last visible column clWindow/White? Looks a little bit odd now if the
columns do not fill the whole width of the VTree. BeforeItemErase does not
provide a column parameter. It's probably called once for each full node
paint
cycle... Do I have to do the cell painting myself then? (that would be too
much
effort for the effect :)

(2) OnDragAllowed: I have some nodes which must not be dragged around (as they
can
not be dropped anywhere). I would like to avoid the dragging in the first
place.
Unfortunately OnDragAllowed is not even executed. Is manual dragging a pre-
condition for this event?

Also, I am not sure how to restrict dragging to the main column (to avoid the
empty drag image) and still keep a drag image. The last time I tried with manual
drag I got no drag image at all. Could you advise? If not I switch to Complete
drag image (without too much headaches).

Regards,
Werner

 | Replies | Author | Date
1543 | Re: Two wishes... | Mike Lischke | Thu 5/3/2001


re: Drag and drop w/o horz auto scroll

From: Werner Lehmann [wl@b...]
Date: Tue May 1, 2001 2:10 pm
Subject: Re: [VirtualTreeview] Drag and drop w/o horz auto scroll

Mike Lischke wrote:
>
> This is not so special as you might think. The problem was however, that I
have forgotten to change the scroll delay implementation for dragging. Auto
scrolling for draw selection is handled by a timer (including the initial delay
when to start scrolling). For drag'n drop however this is not possible and the
scrolling is done during OnDragOver. I have now fixed this behavior so that the
AutoScrollDelay property is properly taken into account. By setting it to 1
second you can avoid auto scrolling the tree when the drag image moves to the
borders of it and further.

Good solution :)

Regards,
Werner


re: suggestion: option to use tab instead of cursor keys

From: "Mike Lischke" [public@l...]
Date: Tue May 1, 2001 2:20 pm
Subject: RE: [VirtualTreeview] suggestion: option to use tab instead of cursor keys

> what about a new option to switch columns with the tab key instead of
> the cursor keys? the cursor keys could then be used for expanding /
> collapsing like in the no-columns-mode. i think that would be more
> intuitive.

Mmmh, difficult. I have implemented the tab handling via the new WantTabs
property (as used in some other VCL controls). For the navigation we could
limit arrow-key movement to grid extensions only, to preserve the typical grid
behavior.

Ciao, Mike


re: Re: VET 1.0

From: "Mike Lischke" [public@l...]
Date: Tue May 1, 2001 2:20 pm
Subject: RE: [VirtualTreeview] Re: VET 1.0

Jim,

> How should the folders be handled? Should they always be above the
> files? I realize that they should stay clustered together but
> should the tree be "flipped" upside down with all the folders on the
> bottom? I have looked at it both ways and the upside down tree is
> somewhat confusing. Anyone have some input?

The only thing I can add is that we are used the reverse order form Explorer
too, so if a user chooses to sort in the reverse order then (s)he has to (and
will) accept that folders are then reversed too.

Ciao, Mike


re: Re: VET 1.0

From: "Mike Lischke" [public@l...]
Date: Tue May 1, 2001 2:20 pm
Subject: RE: [VirtualTreeview] Re: VET 1.0

> How about an option to use "classic VT" hot keys or "explorer" full
> expand keys and use the Ctrl + Shift + '+' for a full expand in
> "explorer" mode (I always *want* something don't I). I can
> envision some upset people who hit Ctrl + '+' to autofit like explorer
> and suddenly they are waiting for their entire network to enumerate!

Essentially reversing the current situation, huh? Okay, I agree with your point
and TTreeview does not use Ctrl + '+' at all. Additionally, the hot keys (at
least those not already used in Explorer) are likely not yet in wide use since
I have not documented them yet. So be it then. I changed the code so the Ctrl +
'+' does the auto fit (as in TListView) and Ctrl + Shift + '+' does the full
expand.

Ciao, Mike


re: More fine grained version numbers please

From: "Mike Lischke" [public@l...]
Date: Tue May 1, 2001 2:20 pm
Subject: RE: [VirtualTreeview] More fine grained version numbers please

> > Does anybody has experiences with proper versioning?
> X.Y.NumberOfBugsFixed.NumberOfFeaturesImplemented :)

Ah, this would always lead to 3 digit numbers, guess whether for bug fixes or
features ;-)

Ciao, Mike


re: System Resources Error in VirtualTree

From: "Mike Lischke" [public@l...]
Date: Tue May 1, 2001 2:20 pm
Subject: RE: [VirtualTreeview] System Resources Error in VirtualTree

Hi Kent,

> 1. Create a new app and add a TPanel control. Set Align to alLeft.
> 2. Add a TSplitter to form and set AutoSnap to false.
> 3. Add a TVirtualStringTree to the empty spot on the form and set Align to
> alClient.
> 4. Add at least one header.column to the virtualtree and set
> header.options.hovisible to true.
> 5. Run the app and maximize form to full screen.
> 6. Slide the splitter control all the way to the right.
> 7. Restore the form to its previous size.
> 8. Scroll the form to the right and attempt to grab the splitter and
> re-center it.
> At this point, I get the system resources execption on line 12454,
> RestoreDC(DC,SavedDC), in the TBaseVirtualTree.WMNCPaint event.

This is a precise algorithm to get this special error, thank you. The error
itself is caused by code
to resize the double buffer bitmap of the header because its right border is
less than its left
border. This can only happen in one case: if the window width is smaller than
the window's borders.
I have included code to check for this event.

Ciao, Mike

 | Replies | Author | Date
1525 | Re: System Resources Error in VirtualTree | Geoffrey Pan | Wed 5/2/2001


re: InvalidateChildren and versioning

From: "Mike Lischke" [public@l...]
Date: Tue May 1, 2001 2:20 pm
Subject: RE: [VirtualTreeview] InvalidateChildren and versioning

Hi Tony,

> I was going to report an error in TBaseVirtualTree.InvalidateToBottom but
> then you went and uploaded a new version which fixed it! What's worse, your
> fix was slightly more elegant than mine! Argh!

Pure accident :o]

> I did, but I don't want the nodes to be reinitialized; I just want them
> invalidated. I want the caption length cleared and the node invalidated to
> force VT to redraw the caption and call DoGetText while it's doing that. I
> guess what I want is an InvalidateChildren method:

Thank you for the code. I have taken it (slightly changed) into VT. It was
necessary to take care
for initialization of nodes.

> Internally, my company uses version numbers like 2.4.417.0 (the first
> 'release build' on April 17 of version 2.4), and it seems to work very well
> as long as we don't take a year between each minor release. :-)

Mmh, what I don't like here is that you have two normal and increasing numbers
as well as a date.
This is quite confusing if you don't know the convention. I would wonder why
the heck the
programmers don't have increased the minor number when they are already at
build 417. What did they
during all these builds? But at least I have learned a scheme I did not know
before. Thank your for
the suggestion.

Ciao, Mike


re: general questions about how to fill the tree

From: "Mike Lischke" [public@l...]
Date: Tue May 1, 2001 2:20 pm
Subject: RE: [VirtualTreeview] general questions about how to fill the tree

Hi Moritz,

> first i want to put the rootnode of the xml document into the tree.
> but that didnt work correctly - i only managed it inside the
> OnInitNode event (tested if parent is nil and then set it).
> i would like to use the same event handler for different treeviews
> with different xmldoc's in it - how can i initialize the tree with
> the rootnode and its data correctly?

So you have only one node (I prefer the term top-level-node, as there is
already a hidden root node
which is never visible) per document as root. The initialization is quite
simple I think and you
already have done most of the work. When you load a document you just clear the
tree and set its
RootNodeCount to 1 (or more if you have more top level nodes). Then in the
OnInitNode event you can
test for Parent = nil as you already do and then query your DOM class what to
attach to the
particular node. I think this is an excellent case where VT can show its full
power because the data
management is done somewhere else only the visualization is done by the tree.
You only have to
connect data and node based on parent/child relationship.

> where is the right place to set the hasChildren flag, where do i have
> to add the subnodes and where to set the data?

Okay, the general approach (as shown in the Minimal demo) is to use OnInitNode
to fill a node's data
member and determine its initial properties like whether it has child nodes.
Take care that you not
simply set InitialStates := [ivsHasChildren]; as there is alread ivsVisible as
initial style set and
you would overwrite it (which would result in an invisble node).

In OnInitChildren you need only to take the node's connection to your DOM (a
node is always
initialized before its child count is queried, this is guaranteed) and query
the DOM about the
number of sub tags for this node. Only the number, nothing else. If the node's
children are accessed
later on then again OnInitNode is triggered, so these both events are necessary
to build and
initialize your structure, not more.

Ciao, Mike


re: Re: More fine grained version numbers please

From: "Mike Lischke" [public@l...]
Date: Tue May 1, 2001 2:20 pm
Subject: RE: [VirtualTreeview] Re: More fine grained version numbers please

Vadim,

> Standard "Major.Minor.Release.Build" is good enough. Major=as is, Minor=new
> features added, Release=bug fixes, Build=for debug purposes.

Somehow I feel uncomfortable using 4 numbers. It seems to me a bit to much for
its purpose. I still
tend to Major.Minor.Build (where Build could well be Release). Thank you for
your contribution.

Ciao, Mike


re: Re: strange: expand all problem

From: "Mike Lischke" [public@l...]
Date: Tue May 1, 2001 2:23 pm
Subject: RE: [VirtualTreeview] Re: strange: expand all problem

> wonderful, so it is correct that i always add all children when this
> event is called?

Not in OnInitChildren. There you only set the number of children. After return
the caller will
created the number of child nodes you gave back. If it is necessary (e.g. for
display) then the
nodes will be initialized each after another via the OnInitNode event.

Ciao, Mike

 | Replies | Author | Date
1523 | Re: strange: expand all problem | Moritz Franckenstein | Tue 5/1/2001


Gratulations and an attempt of contribution from a newbie

From: "Dean Zobec" [dezobec@t...]
Date: Tue May 1, 2001 4:24 pm
Subject: Gratulations and an attempt of contribution from a newbie

Mike,
My gratulation for the component. I'ts no doubt the best component I've seen
since I've been using Delphi (and I started with 1.0!). I hope I'll to
understand the inner workings of the component in a reasonably short time,
well, maybe one year will not be enough but I'll sure learn a lot in the
meantime!

Just in case it could be useful, I report you a possible small error:
When debugging with Memproof a program of mine which uses a VirtualStringTree
with columns I've found a non deallocated timer. The row that allocates the
timer is this:
SetTimer(Treeview.Handle, HeaderTimer, 50, nil);

Thank you again Mike for the wonderful work.

Regards,
Dean Zobec

[Non-text portions of this message have been removed]

 | Replies | Author | Date
1542 | Re: Gratulations and an attempt of contribution f | Mike Lischke | Thu 5/3/2001
1665 | Re: Gratulations and an attempt of contribution f | Mike Lischke | Tue 5/8/2001
1702 | Re: Gratulations and an attempt of contribution f | Mike Lischke | Wed 5/9/2001


re: VET 1.0a

From: "Jim Kueneman" [jimdk@m...]
Date: Tue May 1, 2001 4:19 pm
Subject: Re: VET 1.0a

--- In [VirtualTreeview@y...], [jimdk@m...] wrote:
>
> Version 1.0a

Don't bother the QA department was not doing their job <g> some fixes
created more problems. Stick with 1.0 for now.

Jim


re: strange: expand all problem

From: "Moritz Franckenstein" [franckenstein@a...]
Date: Tue May 1, 2001 8:52 pm
Subject: Re: strange: expand all problem

--- In [VirtualTreeview@y...], "Mike Lischke" [public@l...] wrote:
> So you have only one node (I prefer the term top-level-node, as
there is already a hidden root node
> which is never visible) per document as root. The initialization is
quite simple I think and you
> already have done most of the work. When you load a document you
just clear the tree and set its
> RootNodeCount to 1 (or more if you have more top level nodes). Then
in the OnInitNode event you can
> test for Parent = nil as you already do and then query your DOM
class what to attach to the particular node.

yes, that's exactly what i did. but why can't i add the rootnode's
data manually while initializing my application?
then the oninitnode would not have to check if it is a rootnode and i
could use the same event-handler for different trees.

> > so it is correct that i always add all children when this event
is called?
> Not in OnInitChildren. There you only set the number of children.
After return the caller will
> created the number of child nodes you gave back. If it is necessary
(e.g. for display) then the
> nodes will be initialized each after another via the OnInitNode
event.

hm, i don't understand that. how can the oninitnode know what xmlnode
to put into the data?
and another problem is that there is no fast way to get only the
number of childnodes of a xmlnode. i would have to count them
manually.


Calling OnGetPopupMenu when no node is selected

From: "Anthony Mills" [amills@m...]
Date: Tue May 1, 2001 7:09 pm
Subject: Calling OnGetPopupMenu when no node is selected

Mike,

Another change to think about:

I'd like DoPopupMenu to call OnGetPopupMenu even if no node has been clicked
on (i.e. the person right-clicked in whitespace), since setting FPopupMenu
doesn't allow me to customize popup menus.

For example:

procedure TBaseVirtualTree.DoPopupMenu(Node: PVirtualNode; Column:
Integer;
Position: TPoint);

// Support for node-dependent popup menus.

var
Run: PVirtualNode;
Menu: TPopupMenu;
AskParent: Boolean;

begin
if Assigned(FOnGetPopupMenu) then
begin
Run := Node;
FocusedNode := Run;
Menu := nil;
AskParent := True;
if Assigned(Run) then
repeat
FOnGetPopupMenu(Self, Run, Column, Position, AskParent, Menu);
Run := Run.Parent;
until Assigned(Menu) or not AskParent or (Run = FRoot);
else
FOnGetPopupMenu(Self, nil, -1, Position, AskParent, Menu);

StopTimer(EditTimer); // Stop anyway in case app handled menu itself?
if Assigned(Menu) then
begin
Menu.PopupComponent := Self;
with ClientToScreen(Position) do
Menu.Popup(X, Y);
end;
end;
end;

> Mmh, what I don't like here is that you have two normal and increasing
> numbers as well as a date. This is quite confusing if you don't know the
> convention. I would wonder why the heck the programmers don't have
> increased the minor number when they are already at build 417. What did
> they during all these builds? But at least I have learned a scheme I did
> not know before. Thank your for the suggestion.

It does seem a little odd at first, but once you're over the initial hurdle
you find that it's very useful to be able to tell the age of a build just by
looking at its version number. You can also tell just how much newer a
recent build is, etc.

Many thanks for VT, again! Being able to tinker with it is the icing on the
cake.

Regards,

Tony


re: System Resources Error in VirtualTree

From: "Geoffrey Pan" [gpan@c...]
Date: Wed May 2, 2001 3:16 am
Subject: RE: [VirtualTreeview] System Resources Error in VirtualTree

Will see if this fixes a panel unhide bug I'm running into that sounds
similar :)

-----Original Message-----
From: Mike Lischke [mailto:[public@l...]]
Sent: Tuesday, May 01, 2001 9:21 AM
To: VirtualTreeview@yahoogroups.com
Subject: RE: [VirtualTreeview] System Resources Error in VirtualTree

Hi Kent,

> 1. Create a new app and add a TPanel control. Set Align to alLeft.
> 2. Add a TSplitter to form and set AutoSnap to false.
> 3. Add a TVirtualStringTree to the empty spot on the form and set Align to
> alClient.
> 4. Add at least one header.column to the virtualtree and set
> header.options.hovisible to true.
> 5. Run the app and maximize form to full screen.
> 6. Slide the splitter control all the way to the right.
> 7. Restore the form to its previous size.
> 8. Scroll the form to the right and attempt to grab the splitter and
> re-center it.
> At this point, I get the system resources execption on line 12454,
> RestoreDC(DC,SavedDC), in the TBaseVirtualTree.WMNCPaint event.

This is a precise algorithm to get this special error, thank you. The error
itself is caused by code
to resize the double buffer bitmap of the header because its right border is
less than its left
border. This can only happen in one case: if the window width is smaller
than the window's borders.
I have included code to check for this event.

Ciao, Mike

To unsubscribe from this group, send an email to:
VirtualTreeview-unsubscribe@egroups.com

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/


Highlighted Text

From: "Jim Kueneman" [jimdk@m...]
Date: Wed May 2, 2001 4:12 am
Subject: Highlighted Text

Mike,

If in the DoPaintText method one chooses to set the Canvas.Font to a
different color I notice that VT takes care of the color when the
node is hilighted. My question is why when you are dragging a node
the "target" node that is hilighted does not use the same hilight text
color as a normal select. Is this by design? Am I suppose to handle
the hilight color somewhere?

Jim

 | Replies | Author | Date
1528 | Re: Highlighted Text | Mike Lischke | Wed 5/2/2001
1533 | Re: Highlighted Text | Jim Kueneman | Wed 5/2/2001
1539 | Re: Highlighted Text | Mike Lischke | Thu 5/3/2001
1553 | Re: Highlighted Text | Jim Kueneman | Fri 5/4/2001
1555 | Re: Highlighted Text | Mike Lischke | Fri 5/4/2001


re: Re: strange: expand all problem

From: Mike Lischke [public@l...]
Date: Wed May 2, 2001 2:07 pm
Subject: RE: [VirtualTreeview] Re: strange: expand all problem

Moritz,

> yes, that's exactly what i did. but why can't i add the rootnode's
> data manually while initializing my application?
> then the oninitnode would not have to check if it is a rootnode and i
> could use the same event-handler for different trees.

You can manually attach the data. Simply set the RootNodeCount to 1 (or call
AddNode) and retrieve the data pointer of the first node. Set your data and
you are done. Check in OnInitNode for ParentNode = nil to avoid intializing
the the root node twice.

> hm, i don't understand that. how can the oninitnode know what xmlnode
> to put into the data?

OnInitNode does of course not know this, but you can conclude it from the
parent-child relationship of the nodes passed in. The top level node is
initialized somewhere else and gets a marker what it represents. In
OnInitNode you check this marker and the index of the node to be initialized
to know what element of the particular entity is now needed. Once you have
found it mark the node accordingly to know what to attach if its child nodes
must be intialized.

> and another problem is that there is no fast way to get only the
> number of childnodes of a xmlnode. i would have to count them
> manually.

I assumed you would have stored the DOM in a kind of TList network. Is it
stored using a linked list?

Ciao, Mike


re: Highlighted Text

From: Mike Lischke [public@l...]
Date: Wed May 2, 2001 2:16 pm
Subject: RE: [VirtualTreeview] Highlighted Text

Jim,

> My question is why when you are dragging a node
> the "target" node that is hilighted does not use the same
> hilight text color as a normal select. Is this by design? Am I suppose
to handle
> the hilight color somewhere?

I'm not sure I fully understood what you mean. There are two differnt colors
for selection and nodes being the current drop target. Both colors are the
same by default, so you should not care about them if you want to have both
the same.

Ciao, Mike

 | Replies | Author | Date
1533 | Re: Highlighted Text | Jim Kueneman | Wed 5/2/2001


re: Calling OnGetPopupMenu when no node is sele cted

From: Mike Lischke [public@l...]
Date: Wed May 2, 2001 2:12 pm
Subject: RE: [VirtualTreeview] Calling OnGetPopupMenu when no node is sele cted

Hi Tony,

> I'd like DoPopupMenu to call OnGetPopupMenu even if no node
> has been clicked on (i.e. the person right-clicked in whitespace), since
> setting FPopupMenu doesn't allow me to customize popup menus.

Yes, why not? It is simple and a nice addition. Done.

> Many thanks for VT, again! Being able to tinker with it is
> the icing on the cake.

:o] Thank you.

Ciao, Mike


Help system for VT

From: "Jonx" [knipjo@h...]
Date: Wed May 2, 2001 4:24 pm
Subject: Help system for VT

Hi,
Like most of you, I'm only lurcking around here... But I'm doing this
since a long time.
We all know why most people only look what is going on and do not
participate: we don't
have enought time for this.
Ok, this was to explain why I only come out now with what follows...

What I want to talk about here is about the fact that they is not
much static help around.
I mean up to date help files, FAQs or why not a code repository...

It's been a long time I talked about this to Mike. He already took a
look at it a suggested some
enhancement, I applied all his suggestion, except what concerns the
clarity of the pages...
It's not that I don't want to, it's because I was short of time and
wanted to finally release
something.

Now what is it ? For the moment it's not clear, but I want to find a
way to share knowledge about
that cool component between all of you and especially those that only
begin to use the component.
It's so huge that it's not easy to start with it. It's also something
that will help reduce
the post of questions already answered here...

So, to do that I tried to setup a dynamic virtual treeview FAQ...It's
using PHP/MySQL and you can find it here:
http://vtfaq.happytocode.com, the goal here is to answer the
frequently and unfrequently asked question...

But while doing some PHP for my own needs I also had to use it at
work to build a place to share press releases.
That leeds us to the second part that you can find here:
http://vtcr.happytocode.com
The goal here is more to share a piece of code, a whole application,
but only with source code. The design is
borrowed from the excellent www.zend.com site. and the themes for
exemples are not significative it's just to
show you the idea... if you want a better idea, just go to
https://www.zend.com/codex.php and look around. We can
have the same here.

Now what do I want from you ? Please take a look at those two sites
and try to envision what would be best for us...
After that go to http://www.happytocode.com/vt_poll.php, it's a fast
done poll, so excuse the badly shaped design.
Tell me there what you need and add a small comment 255 chars ;) If
you want to be more specific you can write me
at mailto:[vt.faq@h...]
Don't be afraid by the bars, with one vote for the moment representy
100% it's not very significative for the moment.

Now, you will see that there is not much to see there. Simply because
this will take some time. It's also because
I won't have enought time just of myself to handle everything there.

That's why I'm looking if some of you would agree to help to add some
content. The way this should work has yet to
be defined... This can be as much as administrate a whole section or
ony submit short pieces from time to time.

I welcome all your suggestions, so just go ahead and let me know what
you think...
Thank you very much for your input.

John.

 | Replies | Author | Date
1538 | Re: Help system for VT | Fraser, Pete [Soundcraft UK] | Thu 5/3/2001
1544 | Re: Help system for VT | Mike Lischke | Thu 5/3/2001


autosizing columns

From: "Moritz Franckenstein" [franckenstein@a...]
Date: Wed May 2, 2001 3:39 pm
Subject: autosizing columns

hi,

to have a column autosize feature is a nice idea but in most cases
your implementation is not really useful because then one column
cannot be resized manually if i understood everything right.

has anyone implemented a better way?

if mike would want to implement a way where all columns can be
resized a setting of -1 in autosizeindex could be used or so...

-moritz

 | Replies | Author | Date
1534 | Re: autosizing columns | Moritz Franckenstein | Thu 5/3/2001
1537 | Re: autosizing columns | Mike Lischke | Thu 5/3/2001
1541 | Re: autosizing columns | Mike Lischke | Thu 5/3/2001
1545 | Re: autosizing columns | Moritz Franckenstein | Thu 5/3/2001
1546 | Re: autosizing columns | Mike Lischke | Thu 5/3/2001
1547 | Re: autosizing columns | Moritz Franckenstein | Thu 5/3/2001
1548 | Re: autosizing columns | Moritz Franckenstein | Thu 5/3/2001
1549 | Re: autosizing columns | Mike Lischke | Thu 5/3/2001
1551 | Re: autosizing columns | Moritz Franckenstein | Thu 5/3/2001


One indecent request :-)

From: [adembaba@e...]
Date: Wed May 2, 2001 9:48 pm
Subject: One indecent request :-)

Hi Mike,

Having seen the speed with which you have
fulfilled requests, one is tempted to go
beyond the brink and ask:

[[ Imagine a VT with too many columns ]]

Is it possible to have the headers of the
non-main columns be a dropdown-combos whereby
the user would be able to select the column
s/he wishes to display by simply choosing
from the currently not-visible.

Just asking :-)

Cheers,

 | Replies | Author | Date
1540 | Re: One indecent request :-) | Mike Lischke | Thu 5/3/2001


re: Highlighted Text

From: "Jim Kueneman" [jimdk@m...]
Date: Wed May 2, 2001 7:45 pm
Subject: Re: Highlighted Text

--- In [VirtualTreeview@y...], Mike Lischke [public@l...] wrote:
> Jim,
>
> I'm not sure I fully understood what you mean. There are two
differnt colors
> for selection and nodes being the current drop target. Both colors
are the
> same by default, so you should not care about them if you want to
have both
> the same.

Sorry poorly explained.

If I do not set the color of the text in the DoPaintText method but
allow it to be handled by VT then when I select a node or drag over a
node the text is painted in white to contrast the blue selection /
droptarget bar.

If I do set the color of the text in the DoPaintText method then the
text is draw in the new color, and it is then painted white by VT when
the selection is on that node so it is a good contrast to the blue.
BUT if you drag one node (which VT has handled the contrasting text
color) the target node, which is also drawn with the hilighted bar,
uses the color defined in DoPaintText. If that color is dark you
can't read the text in the blue background.

Jim


re: autosizing columns

From: "Moritz Franckenstein" [franckenstein@a...]
Date: Thu May 3, 2001 8:21 am
Subject: Re: autosizing columns

> to have a column autosize feature is a nice idea but in most cases
> your implementation is not really useful because then one column
> cannot be resized manually if i understood everything right.

now i have tried it myself, and it seems to work ok.
but i think it is not very elegant.
and it has a problem, maybe that can be fixed by a change in VT:
the horizontal scrollbar has to be disabled because it would flicker
and change the clientwidth/height so that OnResize is called, and
that causes problems.
anyway, when the columns are autosizing we dont need a scrollbar :)

any ideas how to improve the following to include it into VT?

(sorry for the self-describing variable names: W=Width A=Start B=End
C=Count D=Delta <smile/>)

-moritz

procedure TForm1.TreeColumnResize(Sender: TVTHeader; Column: Integer);
const
Min = 50;
var
I, W, A, B, C, D: Integer;
begin
if Sizing then Exit;
W:= Sender.Treeview.ClientWidth;
with Sender.Columns do begin
for I:= Count-1 downto 0 do Dec(W, Items[I].Width);
if W = 0 then Exit;
Sizing:= True;

if Column = Count-1 then begin A:= 0; B:= Column-1; end
else begin A:= Column+1; B:= Count-1; end;

C:= B-A+1;
D:= W div C;
if D = 0 then if W > 0 then D:= 1 else D:= -1;
for I:= A to B do
with Items[I] do
if Width+D <= Min then begin
Dec(C);
Dec(W, Width-Min);
Width:= Min;
end;

if C > 0 then begin
D:= W div C;
if D = 0 then if W > 0 then D:= 1 else D:= -1;
for I:= A to B-1 do
with Items[I] do
if Width+D > Min then begin
Width:= Width + D;
Dec(W, D);
end;
with Items[B] do
if Width+W > Min then Width:= Width + W;
end;
end;
Sizing:= False;
end;

procedure TForm1.TreeResize(Sender: TObject);
begin
TreeColumnResize((Sender as TVirtualStringTree).Header, -1);
end;


New file uploaded to VirtualTreeview

From: [VirtualTreeview@yahoogroups.com>
Date: Thu May 3, 2001 8:56 am
Subject: New file uploaded to VirtualTreeview

Hello,

This email message is a notification to let you know that
a file has been uploaded to the Files area of the VirtualTreeview
group.

File : /PropertyEditor.zip
Uploaded by : [Beduerftig@S...]
Description : For BCB5-User: Demoprogram shown an owneditor under BCB5 using
VT 2.4x

You can access this file at the URL

http://groups.yahoo.com/group/VirtualTreeview/files/PropertyEditor.zip

To learn more about file sharing for your group, please visit

http://help.yahoo.com/help/us/groups/files

Regards,

Beduerftig@S...]


For BCB5-User: Demo program show how using IVTEditLink under BCB5

From: "Roland" [Beduerftig@S...]
Date: Thu May 3, 2001 9:05 am
Subject: For BCB5-User: Demo program show how using IVTEditLink under BCB5

Hi all BCB5-User,

at first many thanks to Alexander Egorushkin from their excellant
help how to implement the interface under BCB5.

I wrote with this info a little demoprogramm to show an own editor
under BCB5. I used the library VT2.4beta here from this newsgroup.

You can find more information in the source files. I have uploaded
the demo with source.

Download the demo, use it free and have fun
Roland


re: autosizing columns

From: "Mike Lischke" [public@l...]
Date: Thu May 3, 2001 9:58 am
Subject: RE: [VirtualTreeview] autosizing columns

Hi Moritz,

> to have a column autosize feature is a nice idea but in most cases
> your implementation is not really useful because then one column
> cannot be resized manually if i understood everything right.

I'm not sure what you really want. The auto size idea is based on the
distribution paradigm where
the width of every column is subtracted from the available space in the client
area and the
remaining space is assigned to the auto size column (if it is not less than 0,
which means there is
no space to split). So when I resize a column other than the autosize column
then the overall width
changes and the auto size column has to be resized too. If I try to resize the
auto size column,
however, then nothing changes in the other columns and therefore nothing
changes in the auto size
column. If I would allow to change the auto size column via the mouse then I
would have to find
another (second level) auto size column which now takes the remaining space as
is resized
automatically. Of course this column must not be taken into the width
calculation to avoid
concurrent situations, but only in this special situation, otherwise it is a
normal column. Why
making everything so complicated? Usually the last visible column is the
autosize column and this
means it ends directly on the client area border, so there is no sense anyway
to allow resizing it.

Ciao, Mike


re: Help system for VT

From: "Fraser, Pete [Soundcraft UK]" [pete.fraser@f...]
Date: Thu May 3, 2001 10:44 am
Subject: RE: [VirtualTreeview] Help system for VT

I'd be interested in improving the help for VirtualTree as I want to use it
(when I've got time to port my code to it).
I have a tool, GenHelp, which makes this simpler and integrates into the IDE
cleanly. However I don't have all the time in the world to do this :(
What we could do is for different people to document different areas and
then pass them to me for merging with the main help file. Any comments?
As the tool is shareware and the trial version adds a nag message, anyone
can use it and the final help file will 'loose' the nags.

Rgds. Pete
GenHelp, the Component Writers Help authoring tool.
==========================================
Work: [pete.fraser@s...]
Home: [pete.fraser@f...]
http://www.frasersoft.co.uk/genhelp <http://www.frasersoft.co.uk/genhelp>

[Non-text portions of this message have been removed]


re: Re: Highlighted Text

From: Mike Lischke [public@l...]
Date: Thu May 3, 2001 12:11 pm
Subject: RE: [VirtualTreeview] Re: Highlighted Text

Hi Jim,

> If I do set the color of the text in the DoPaintText method then the
> text is draw in the new color, and it is then painted white
> by VT when
> the selection is on that node so it is a good contrast to the blue.

Sorry, but this is not so. If you set a new text color (Font.Color) in
OnPaintText then this color is used in all operations and states. Perhaps
there was a bug in an earlier version? I should upload 2.4.2 finally so you
all get updated. Let me just see the other mails.

Ciao, Mike

 | Replies | Author | Date
1553 | Re: Highlighted Text | Jim Kueneman | Fri 5/4/2001


re: One indecent request :-)

From: Mike Lischke [public@l...]
Date: Thu May 3, 2001 12:13 pm
Subject: RE: [VirtualTreeview] One indecent request :-)

Adem,

> Having seen the speed with which you have
> fulfilled requests, one is tempted to go
> beyond the brink and ask:

:o] The reason why I invest so much time and power is that I want to finish
major 2 and publish it so I can focus on stuff which is suspended since
months. If there are many changes in the future I should perhaps open a
sourceforge page for VT.

Ciao, Mike


re: Re: autosizing columns

From: Mike Lischke [public@l...]
Date: Thu May 3, 2001 12:27 pm
Subject: RE: [VirtualTreeview] Re: autosizing columns

Hi Moritz,

> now i have tried it myself, and it seems to work ok.
> but i think it is not very elegant.
> and it has a problem, maybe that can be fixed by a change in VT:
> the horizontal scrollbar has to be disabled because it would flicker
> and change the clientwidth/height so that OnResize is called, and
> that causes problems.
> anyway, when the columns are autosizing we dont need a scrollbar :)

Well, this is interesting. An even distribution over all columns is also
nice. I wonder however how it behaves when you resize one column.

Ciao, Mike

 | Replies | Author | Date
1545 | Re: autosizing columns | Moritz Franckenstein | Thu 5/3/2001


re: Gratulations and an attempt of contribution from a newbie

From: Mike Lischke [public@l...]
Date: Thu May 3, 2001 12:30 pm
Subject: RE: [VirtualTreeview] Gratulations and an attempt of contribution from a newbie

Hi Dean,

> My gratulation for the component. I'ts no doubt the best
> component I've seen since I've been using
> Delphi (and I started with 1.0!).

Blush.. thank you :o]

> Just in case it could be useful, I report you a possible small error:
> When debugging with Memproof a program of mine which uses a
> VirtualStringTree with columns I've
> found a non deallocated timer. The row that allocates the
> timer is this:
> SetTimer(Treeview.Handle, HeaderTimer, 50, nil);

Yep, thank you. This was a bug I removed a couple of weeks ago. I don't
remember which version of VT it was. Please try the beta available in the
file area of this mailing list. So far there were no bug reports with this
version and I'm quite confident it is stable.

Ciao, Mike


re: Two wishes...

From: Mike Lischke [public@l...]
Date: Thu May 3, 2001 12:44 pm
Subject: RE: [VirtualTreeview] Two wishes...

Hi Werner,

> (1) Is it possible two have alternating row colors but keep
> the color to the right
> of the last visible column clWindow/White? Looks a little
> bit odd now if the
> columns do not fill the whole width of the VTree.
> BeforeItemErase does not
> provide a column parameter. It's probably called once for
> each full node paint
> cycle... Do I have to do the cell painting myself then?
> (that would be too much
> effort for the effect :)

I'm afraid this is your only option. Otherwise I would have to add specific
code to VT for this special case. I think the lesser effort is that you move
your background code to OnBeforeCellPaint and add the missing FillRect call.

> (2) OnDragAllowed: I have some nodes which must not be
> dragged around (as they can
> not be dropped anywhere). I would like to avoid the
> dragging in the first place.
> Unfortunately OnDragAllowed is not even executed. Is
> manual dragging a pre-
> condition for this event?

Exactly. What you want is to customized drag start so you have to use the
customization feature by going to manual drag.

>
> Also, I am not sure how to restrict dragging to the main
> column (to avoid the
> empty drag image) and still keep a drag image. The last time
> I tried with manual
> drag I got no drag image at all. Could you advise? If not I
> switch to Complete
> drag image (without too much headaches).

My fault, I forgot to include the column in the OnDragAllowed event.
Changed.

But on the other hand I don't understand why you want to use only the main
column as drag image. The image is always of the same size, it just does not
show the same content (as is a bit faster when painting, but that's a one
time shot).

Ciao, Mike

PS: Why do you use manual line breaks in your mail? Usually lines are broken
up automatically. But in your case it is, well, difficult to read because my
(automatic) line breaks settings conflict with yours ;-)


re: Help system for VT

From: Mike Lischke [public@l...]
Date: Thu May 3, 2001 1:06 pm
Subject: RE: [VirtualTreeview] Help system for VT

Hi Pete,

> I'd be interested in improving the help for VirtualTree as I
> want to use it (when I've got time to port my code to it).

Excellent :o]

> I have a tool, GenHelp, which makes this simpler and
> integrates into the IDE cleanly. However I don't have all the time in the
world to do this :(

No doubts. Although with a 48 hours day I could write a lot more code :-)

> As the tool is shareware and the trial version adds a nag
> message, anyone can use it and the final help file will 'loose' the nags.

Mmh, I did not see that GenHelp generates HTML and CHM files. Are there any
plans to do so or did I simply overlook something? Frankly, I don't use the
old help format anymore and think the time has come where one can expect
some more eye friendly form. I got totally used (and addicted) to CHM files
(be it my own help files, the ones from JEDI or MSDN). Only Delphi still
comes with the old format.

Another point which will likely prevent me to use GenHelp is that I already
use Time2Help (full version, so I even paid money to make users of my stuff
a good help file) and have already written quite a lot of text which I don't
see to get to GenHelp without much trouble. Perhaps you have a good idea?

Ciao, Mike


re: autosizing columns

From: "Moritz Franckenstein" [franckenstein@a...]
Date: Thu May 3, 2001 1:20 pm
Subject: Re: autosizing columns

--- In [VirtualTreeview@y...], Mike Lischke [public@l...] wrote:
> Well, this is interesting. An even distribution over all columns is
also
> nice. I wonder however how it behaves when you resize one column.

try my example. you only have to set the two events. i can also send
you my current exe file, if you like.

i think the way it behaves when you resize one column is not bad.

-moritz


re: Re: autosizing columns

From: Mike Lischke [public@l...]
Date: Thu May 3, 2001 2:07 pm
Subject: RE: [VirtualTreeview] Re: autosizing columns

Moritz,

> try my example. you only have to set the two events. i can also send
> you my current exe file, if you like.

I actually tried your example, how else can I give a comment on it and say
it is nice?

> i think the way it behaves when you resize one column is not bad.

You cannot really check it with this code because it is not called when you
resize a column, but you might link it to the proper event...

Ciao, Mike

 | Replies | Author | Date
1547 | Re: autosizing columns | Moritz Franckenstein | Thu 5/3/2001
1548 | Re: autosizing columns | Moritz Franckenstein | Thu 5/3/2001


re: autosizing columns

From: "Moritz Franckenstein" [franckenstein@a...]
Date: Thu May 3, 2001 2:26 pm
Subject: Re: autosizing columns

--- In [VirtualTreeview@y...], Mike Lischke [public@l...] wrote:
> You cannot really check it with this code because it is not called
when you
> resize a column, but you might link it to the proper event...

i'm sorry, i thought it was clear. the method TreeColumnResize has to
be linked to OnColumnResize and the method TreeResize has to be
linked to OnResize.

the horizontal scrollbar has to be disabled.

and a global variable Sizing: Boolean is needed (maybe not really).

you can still have my app. :)

 | Replies | Author | Date
1548 | Re: autosizing columns | Moritz Franckenstein | Thu 5/3/2001


re: autosizing columns

From: "Moritz Franckenstein" [franckenstein@a...]
Date: Thu May 3, 2001 2:48 pm
Subject: Re: autosizing columns

ok, i have found out that it behaves a little bit funny with more
than 3 columns... until now i have only had tested it with 2 and 3
columns :|


re: Re: autosizing columns

From: Mike Lischke [public@l...]
Date: Thu May 3, 2001 2:56 pm
Subject: RE: [VirtualTreeview] Re: autosizing columns

> i'm sorry, i thought it was clear. the method TreeColumnResize has to
> be linked to OnColumnResize and the method TreeResize has to be
> linked to OnResize.

Then the cast from Sender to a string tree makes no sense unless you have an
old VT version. I made on 23. February the header the sender in all
header/column related events. Anyway, even triggered by the column resize it
looks nice.

> the horizontal scrollbar has to be disabled.

Tried with a Header.Columns.BeginUpdate/EndUpdate to keep the scroll bar but
to no avail. By only accessing internal variables and updating only once
this should be no problem however.

Ciao, Mike

PS: With your resize version VT no longer needs the AutoSize property in the
header. Taking this out will change the stream format. Any ideas?

 | Replies | Author | Date
1551 | Re: autosizing columns | Moritz Franckenstein | Thu 5/3/2001


re: Re: autosizing columns

From: Mike Lischke [public@l...]
Date: Thu May 3, 2001 3:01 pm
Subject: RE: [VirtualTreeview] Re: autosizing columns

> ok, i have found out that it behaves a little bit funny with more
> than 3 columns... until now i have only had tested it with 2 and 3
> columns :|

Oh, it still works and the effect looks really smooth but unfortunately
people will not like to have their columns resized depending on the wind
direction. They need reproducible results. If you connect your code also
with the tree resize event then you'll see it looks much better. All columns
resize in the same manner.

Ciao, Mike

 | Replies | Author | Date
1560 | Re: autosizing columns | Moritz Franckenstein | Fri 5/4/2001


re: autosizing columns

From: "Moritz Franckenstein" [franckenstein@a...]
Date: Thu May 3, 2001 3:13 pm
Subject: Re: autosizing columns

> Then the cast from Sender to a string tree makes no sense unless
you have an
> old VT version. I made on 23. February the header the sender in all
> header/column related events. Anyway, even triggered by the column
resize it looks nice.

yes, but the OnResize event has TObject as Sender and OnColumnResize
wants TVTHeader. How can i do that without cast?

procedure TForm1.TreeColumnResize(Sender: TVTHeader; Column: Integer);

procedure TForm1.TreeResize(Sender: TObject);
begin
TreeColumnResize((Sender as TVirtualStringTree).Header, -1);
end;

> PS: With your resize version VT no longer needs the AutoSize
property in the header.

why that?

btw: dont use my implementation, i think it has to be rewritten. i
makes problems with more then 3 columns, when you only resize for 1
pixel many times due to the auto-updating nature while dragging.


re: some questions

From: [andersthomsen@h...]
Date: Thu May 3, 2001 5:18 pm
Subject: Re: some questions

Mike,

Thanks for the help, unfortunatly it did not help me : )

I'm using your latest beta (just downloaded it from the "files"
section).
I fill the tree with some nodes, and then onInitNode I set the
InitialState to [] (not visible).
I've tried with and without the begin/endupdate pair and nothing
works.
The scrollbar range is still too large.
I've created a small examlpe project to show what's wrong (delphi5):
http://www.malerthomsen.dk/vt.zip
(~6kb)
Also, when I quit the project I get an "integer overflow".

If you (or somebody else) got the time, please tell whats wrong.

Thanks!

Regards,
Anders Thomsen

--- In [VirtualTreeview@y...], "Mike Lischke" [public@l...] wrote:
> Hi Anders,
>
> you did not say which version you use. I assume is one of the post-
1.31 version because you are
> talking about visibility.
>
> > 1. If I do this:
> > tree.beginupdate;
> > tree.rootnodecount := (some thousands);
> > (a function that runs though the nodes and unsets the vsVisible to
> > some nodes)
> > tree.endupdate;
>
> I recommend to do this differently:
>
> Tree.RootNodeCount := (some thousands nodes)
> Tree.ValidateNode(nil, True),
>
> and in OnInitNode simply remove the ivsVisible flag from
InitialStates.
>
> > This causes a "Cache not entirely filled" exception.
>
> You hit a very special situation which occurs very seldomly. The
problem you encounter is that you
> are modifying the visibility of nodes while the tree is still
validating the internal cache. The
> validation however is based on the visibilty of the nodes. A
possible solution is what I gave above
> plus a BeginUpdate/EndUpdate pair around it to prevent the cache to
be validated until all nodes are
> touch once.
>
> > Another problem (bug?) is, that if I only have 20 nodes visible
> > (vsVisible), the scrollbar min/max settings aren't updated, I can
> > still scroll down the list, which is empty.
>
> This is all the result from an invalid cache.
>
> > Also, I have a multicolumn tree using MultiSelect and
FullRowSelect.
> > When I hold down Ctrl to select multiple items, the nodes aren't
> > correctly painted. The selection color of the rootcolumn is
correctly
> > painted on MouseDown, but the remaining columns aren't drawed
until
> > MouseUp.
>
> Mmmh, works fine with the latest version of VT. Please try this.
>
> > And just a small question, what is the general difference between
> > StringTree and DrawTree.
>
> The differences are similar to those of TStringGrid and TDrawGrid.
The string tree has support to
> display node captions and handles other aspects of string captions
(like caching the width for quick
> draw selection and providing a possibility to edit a node's
caption). The draw tree merely publishes
> the DoPaintNode method to allow the application to draw whatever it
likes into the node rectangle. I
> have demonstrated this in the draw tree demo which provides a kind
of image directory browser.
>
> Ciao, Mike


re: Re: Highlighted Text

From: Jim Kueneman [jimdk@m...]
Date: Fri May 4, 2001 4:34 am
Subject: RE: [VirtualTreeview] Re: Highlighted Text

At 02:11 PM 5/3/2001 +0200, you wrote:
>Sorry, but this is not so. If you set a new text color (Font.Color) in
>OnPaintText then this color is used in all operations and states. Perhaps
>there was a bug in an earlier version? I should upload 2.4.2 finally so you
>all get updated. Let me just see the other mails.

I see what I did. Ok, now how do I detect that the node is "drop target"
highlighted so I can change the color to contrast the selection bar? I can
use

vsSelected in Node.State

for the selected nodes to change the color but that flag is not set in the
drop target node ( or that Node never calls DoPaintText, it is hard to
debug when using drag drop)

Jim


Problems when the total width of columns in a tree exceeds the client width

From: [basil@r...]
Date: Fri May 4, 2001 6:58 am
Subject: Problems when the total width of columns in a tree exceeds the client width

Hi, Mike!

I've got more than 10 columns in a VirtualTree (2.4) and
I've met some strange behavior of the tree in these cases:

1. It seems to me that the rightmost columns are autoresizeable
with the header.options.hoAutoResize set to false?

2. When I put a tree on TActiveForm (i.e. ActiveX form) than I found
out the following:
The client area of the tree becomes a mess when I use horizontal
scrollbar. Calling Invalidate method inside OnScroll event doesn't
help.

Thanks.

Basil.

 | Replies | Author | Date
1556 | Re: Problems when the total width of columns in a | Mike Lischke | Fri 5/4/2001
1557 | Re: Problems when the total width of columns in a | GIANNAKOPOULOS KOSTAS | Fri 5/4/2001
1558 | Re: Problems when the total width of columns in a | Mike Lischke | Fri 5/4/2001


re: Re: Highlighted Text

From: Mike Lischke [public@l...]
Date: Fri May 4, 2001 7:25 am
Subject: RE: [VirtualTreeview] Re: Highlighted Text

Hi Jim,

> I see what I did. Ok, now how do I detect that the node is
> "drop target" highlighted so I can change the color to contrast the
> selection bar?

Since only one node can be the drop target at a given time (same as for the
focused node) there is no need to use a flag in the node states. There is a
property called DropTargetNode which contains the current drop target node.

Ciao, Mike


re: Problems when the total width of columns in a tree exceeds the client width

From: Mike Lischke [public@l...]
Date: Fri May 4, 2001 7:42 am
Subject: RE: [VirtualTreeview] Problems when the total width of columns in a tree exceeds the client width

Hi Basil,

> 1. It seems to me that the rightmost columns are autoresizeable
> with the header.options.hoAutoResize set to false?

I cannot reproduce this problem. I have used the Advanced demo and inserted
more than 10 columns into a tree. Resizing one column behaves as it should,
only this one column is resized without the the header trying to do an auto
resize.

> 2. When I put a tree on TActiveForm (i.e. ActiveX form) than I found
> out the following:
> The client area of the tree becomes a mess when I use horizontal
> scrollbar. Calling Invalidate method inside OnScroll event doesn't
> help.

Mmh, I never have worked with TActiveForm. This problem sounds like an
interference between the form painting and the tree painting but that's only
a wild guess. If you could send me a simple demo then I'm perhaps able to
figure out what's wrong. But I cannot promise anything because I will have
to get used with ActiveX libraries.

Ciao, Mike


re: Problems when the total width of columns in a tree exceeds the client width

From: GIANNAKOPOULOS KOSTAS [kyan@s...]
Date: Fri May 4, 2001 8:13 am
Subject: RE: [VirtualTreeview] Problems when the total width of columns in a tree exceeds the client width

Some hints about Active Forms that might help you figure this out:

Since they live inside a dll the main message pump is not TApplication's but
is somewhere in the host application of the dll. As a result
TApplication.Idle() is never called so hints and actions will not work
properly.
This can be solved by creating a timer and in its OnTimer event call
TApplication.Idle explicitly. Since WM_TIMER messages are of the lowest
possible priority (even lower than WM_PAINT) this will not cost much.

Another quirk of TActiveForm is that its Tab order handling is different
than that of TForm and buggy: it does not depend on the TabOrder property of
the controls but on the underlying windows' ZOrder. A fix to this is
rearranging the ZOrder according to the TabOrder like this:

L := TList.Create;
try
GetTabOrderList(L);
for I := L.Count - 1 downto 0 do
SetWindowPos(TWinControl(L[I]).Handle, HWND_TOP, 0, 0, 0, 0,
SWP_NOACTIVATE or SWP_NOMOVE or SWP_NOSIZE);
finally
L.Free;
end;

> -----Original Message-----
> From: Mike Lischke [mailto:[public@l...]]
> Sent: Friday, May 04, 2001 10:43 AM
> To: 'VirtualTreeview@yahoogroups.com'
> Subject: RE: [VirtualTreeview] Problems when the total width
> of columns
> in a tree exceeds the client width
>
>
> Hi Basil,
>
> > 1. It seems to me that the rightmost columns are autoresizeable
> > with the header.options.hoAutoResize set to false?
>
> I cannot reproduce this problem. I have used the Advanced
> demo and inserted
> more than 10 columns into a tree. Resizing one column behaves
> as it should,
> only this one column is resized without the the header trying
> to do an auto
> resize.
>
> > 2. When I put a tree on TActiveForm (i.e. ActiveX form)
> than I found
> > out the following:
> > The client area of the tree becomes a mess when I use horizontal
> > scrollbar. Calling Invalidate method inside OnScroll
> event doesn't
> > help.
>
> Mmh, I never have worked with TActiveForm. This problem sounds like an
> interference between the form painting and the tree painting
> but that's only
> a wild guess. If you could send me a simple demo then I'm
> perhaps able to
> figure out what's wrong. But I cannot promise anything
> because I will have
> to get used with ActiveX libraries.
>
> Ciao, Mike
>
> To unsubscribe from this group, send an email to:
> VirtualTreeview-unsubscribe@egroups.com
>
>
>
> Your use of Yahoo! Groups is subject to
> http://docs.yahoo.com/info/terms/
>
>
>


re: Problems when the total width of columns in a tree exceeds the client width

From: Mike Lischke [public@l...]
Date: Fri May 4, 2001 8:19 am
Subject: RE: [VirtualTreeview] Problems when the total width of columns in a tree exceeds the client width

Hi Kostas,

> Some hints about Active Forms that might help you figure this out:

Thank you for this extra info. It seems Active Forms have their own
problems...

> Since they live inside a dll the main message pump is not
> TApplication's but is somewhere in the host application of the dll. As a
result
> TApplication.Idle() is never called so hints and actions will not work
> properly.

This should not really be a problem with VT because the Idle state is not
used there and hints are triggered in the message loop (where I hope that
the message loop as such is very much the same as the one from
TApplication).

Ciao, Mike


Grid mode and hidden nodes

From: "Cyril VELTER" [cyril.velter@l...]
Date: Fri May 4, 2001 9:28 am
Subject: Grid mode and hidden nodes

Hi mike,

I've a strange behavior in Grid mode when I hide some nodes : the
vertical scroll bar doesn't reflect the hidden nodes (I can scroll bellow
the last visible node).

cyril

 | Replies | Author | Date
1565 | Re: Grid mode and hidden nodes | Mike Lischke | Fri 5/4/2001
1576 | Re: Grid mode and hidden nodes | [andersthomsen@h...] | Fri 5/4/2001
1579 | Re: Grid mode and hidden nodes | Cyril VELTER | Fri 5/4/2001
1582 | Re: Grid mode and hidden nodes | Mike Lischke | Fri 5/4/2001
1590 | Re: Grid mode and hidden nodes | Mike Lischke | Sat 5/5/2001
1598 | Re: Grid mode and hidden nodes | [andersthomsen@h...] | Sat 5/5/2001
1600 | Re: Grid mode and hidden nodes | Mike Lischke | Sat 5/5/2001
1604 | Re: Grid mode and hidden nodes | [andersthomsen@h...] | Sat 5/5/2001
1605 | Re: Grid mode and hidden nodes | Mike Lischke | Sat 5/5/2001


re: autosizing columns

From: "Moritz Franckenstein" [franckenstein@a...]
Date: Fri May 4, 2001 9:46 am
Subject: Re: autosizing columns

> Oh, it still works and the effect looks really smooth but
unfortunately
> people will not like to have their columns resized depending on the
wind
> direction. They need reproducible results.

i have now taken the wind direction calculating component out and now
it is absolutely smooth and reproducible.

connect the two methods to the two corresponding events of the tree.

diable the horizontal scrollbar.

var
Sizing: Boolean;
Columns: array of Single;

SetLength(Columns, Tree.Header.Columns.Length);

procedure TForm1.TreeColumnResize(Sender: TVTHeader; Column: Integer);
var
I, W, A, B, C, D: Integer;
D2: Single;
begin
if Sizing then Exit;
W:= Sender.Treeview.ClientWidth;

with Sender.Columns, Columns do begin

{ experimental feature:
if (Column > 0) and (Column < Count-1)
and (Items[Column].Width = Items[Column].MinWidth) then
for I:= Column-1 downto 0 do
if Items[I].Width > Items[I].MinWidth then begin
Items[I].Width:= Items[I].Width-1;
Break;
end; }

for I:= Count-1 downto 0 do begin
D:= Items[I].Width;
Dec(W, D);
if Round(Columns[I]) <> D then Columns[I]:= D;
end;
if W = 0 then Exit;
Sizing:= True;

if Column = Count-1 then begin A:= 0; B:= Column-1; end
else begin A:= Column+1; B:= Count-1; end;

C:= B-A+1;

D2:= W / C;
for I:= A to B do
with Items[I] do
if Round(Columns[I]+D2) < MinWidth then begin
Dec(C);
Inc(W, Width-MinWidth);
Columns[I]:= MinWidth;
Width:= MinWidth;
end;

if C > 0 then begin
D2:= W / C;
for I:= A to B-1 do
with Items[I] do
if Round(Columns[I]+D2) >= MinWidth then begin
Columns[I]:= Columns[I]+D2;
D:= Round(Columns[I]);
Dec(W, D-Width);
Width:= D;
end;
end;

if W <> 0 then
with Items[B] do begin
if Width+W > MinWidth then Width:= Width + W;
Columns[B]:= Width;
end;

end;
Sizing:= False;
end;

procedure TForm1.TreeResize(Sender: TObject);
begin
TreeColumnResize((Sender as TVirtualStringTree).Header, -1);
end;


Drop Buttons.pas and save 6 KB in Exe Size

From: Ralf Junker [ralfjunker@g...]
Date: Fri May 4, 2001 10:08 am
Subject: Drop Buttons.pas and save 6 KB in Exe Size

Hi Mike & Group,

including Buttons.pas into the VirtualTrees.pas's uses clause adds some 6 KB to
the executable file's size (when compiled without packages). 6 KB might not
seem a lot, but why not save them when they can be saved easily?

Just drop "Buttons" from the interface's uses clause and copy the only line
needed in Buttons.pas to the VirtualTrees.pas's interface:

TButtonLayout = (blGlyphLeft, blGlyphRight, blGlyphTop, blGlyphBottom);

That's all and your executable file size will be around 6 KB smaller.

Maybe you want to use the Button.pas's TButtonLayout, but IMHO I don't think it
is especially important where the type originates from.

Thanks for the nice work done and in progress,

-- Ralf

 | Replies | Author | Date
1567 | Re: Drop Buttons.pas and save 6 KB in Exe Size | Mike Lischke | Fri 5/4/2001
1571 | Re: Drop Buttons.pas and save 6 KB in Exe Size | Bender Heri | Fri 5/4/2001
1572 | Re: Drop Buttons.pas and save 6 KB in Exe Size | Mike Lischke | Fri 5/4/2001


GetMaxColumnWidth

From: "Cyril VELTER" [cyril.velter@l...]
Date: Fri May 4, 2001 10:10 am
Subject: GetMaxColumnWidth

Hi mike,

I've some quite long lists that I display in a treeview. I want to
approximate a good column width without validating and accessing the text of
all the nodes. I've modified the standard GetMaxColumnWidth to take a new
parameter to limit the number of node used to compute the max width. With
the default value, all nodes are used.

cyril

Here is the diff :

diff -r1.16 VirtualTrees.pas

1925c1925

< function GetMaxColumnWidth(Column: Integer): Integer;

---

> function GetMaxColumnWidth(Column: Integer; MaxNodeToCheck: Integer=-1):
Integer;

18762c18762

< function TBaseVirtualTree.GetMaxColumnWidth(Column: Integer): Integer;

---

> function TBaseVirtualTree.GetMaxColumnWidth(Column: Integer;
MaxNodeToCheck: Integer): Integer;

18840c18840,18843

< Run := NextNode;

---

> Run := NextNode;

> Dec(MaxNodeToCheck);

> if MaxNodeToCheck=0 then

> break;

 | Replies | Author | Date
1568 | Re: GetMaxColumnWidth | Mike Lischke | Fri 5/4/2001
1578 | Re: GetMaxColumnWidth | Cyril VELTER | Fri 5/4/2001
1591 | Re: GetMaxColumnWidth | Mike Lischke | Sat 5/5/2001
1599 | Re: GetMaxColumnWidth | Cyril VELTER | Sat 5/5/2001


Multi line header

From: [F.vdwestelaken@c...]
Date: Fri May 4, 2001 11:22 am
Subject: Multi line header

Hi,

is it possible to have more than one line of text in a columnheader ?
Or do I have to use OwnerDraw for this and draw the text myself ?

Regards,
Franc.

 | Replies | Author | Date
1569 | Re: Multi line header | Mike Lischke | Fri 5/4/2001


Poll results for VirtualTreeview

From: [VirtualTreeview@yahoogroups.com
Date: Fri May 4, 2001 12:39 pm
Subject: Poll results for VirtualTreeview

The following VirtualTreeview poll is now closed. Here are the
final results:

POLL QUESTION: Due to discussions in other mailing
lists I want to know what you think
about the mailing list subject tag.

CHOICES AND RESULTS
- Use [VT], 7 votes, 17.50%
- Use another one (mail me your suggestion), 0 votes, 0.00%
- Keep [Virtual Treeview], 32 votes, 80.00%
- Omit the tag completely, 1 votes, 2.50%

For more information about this group, please visit
http://groups.yahoo.com/group/VirtualTreeview

For help with Yahoo! Groups, please visit
http://help.yahoo.com/help/us/groups/

 | Replies | Author | Date
2369 | Poll results for VirtualTreeview | VirtualTreeview@y...] | Tue 6/12/2001
2370 | Re: Poll results for VirtualTreeview | Mike Lischke | Tue 6/12/2001
2371 | Re: Poll results for VirtualTreeview | Ariel Selig | Tue 6/12/2001


re: Grid mode and hidden nodes

From: Mike Lischke [public@l...]
Date: Fri May 4, 2001 12:35 pm
Subject: RE: [VirtualTreeview] Grid mode and hidden nodes

> I've a strange behavior in Grid mode when I hide some nodes : the
> vertical scroll bar doesn't reflect the hidden nodes (I can
> scroll bellow the last visible node).

This is indeed strange if it only happens in grid mode because from the view
of the scroll bars there is no difference between the modes. Can you
elaborate a bit more (or send me a simple demo)?

Ciao, Mike

 | Replies | Author | Date
1576 | Re: Grid mode and hidden nodes | [andersthomsen@h...] | Fri 5/4/2001


re: Re: autosizing columns

From: Mike Lischke [public@l...]
Date: Fri May 4, 2001 12:40 pm
Subject: RE: [VirtualTreeview] Re: autosizing columns

Moritz,

> i have now taken the wind direction calculating component out and now
> it is absolutely smooth and reproducible.

We are getting closer :o] Unfortunately the columns "jump" with this
implementation. E.g. when I have more than 10 columns in a tree and resize
the tree in small steps then only the last column grows to fit the client
area. After some more moves suddenly every column is enlarged by a few
pixels and the last column becomes smaller again. This game is repeated all
the time when I resize the tree window (larger or smaller, doesn't matter).

Ciao, Mike

 | Replies | Author | Date
1575 | Re: autosizing columns | Moritz Franckenstein | Fri 5/4/2001


re: Drop Buttons.pas and save 6 KB in Exe Size

From: Mike Lischke [public@l...]
Date: Fri May 4, 2001 12:47 pm
Subject: RE: [VirtualTreeview] Drop Buttons.pas and save 6 KB in Exe Size

Hi Ralf,

> including Buttons.pas into the VirtualTrees.pas's uses clause
> adds some 6 KB to the executable file's size (when compiled
> without packages). 6 KB might not seem a lot, but why not
> save them when they can be saved easily?
>
> TButtonLayout = (blGlyphLeft, blGlyphRight, blGlyphTop,
> blGlyphBottom);

Mmh, I know, but I have often seen this little nasty problem where the
compiler says that one type does not fit to another type, which is caused by
the duplicate declaration (and happens only if both units, here Buttons and
VirtualTrees are in the uses clause). Sure this is easily solved by full
identifier qualification but causes serious headaches for beginners (and
people will stone me when this happens in the try-out phase or will at least
throw away VT). Getting rid of Buttons.pas is tempting but what is the
price?

Ciao, Mike


re: GetMaxColumnWidth

From: Mike Lischke [public@l...]
Date: Fri May 4, 2001 12:51 pm
Subject: RE: [VirtualTreeview] GetMaxColumnWidth

Hi Cyril,

> I've some quite long lists that I display in a treeview. I want to
> approximate a good column width without validating and
> accessing the text of all the nodes. I've modified the standard
GetMaxColumnWidth
> to take a new parameter to limit the number of node used to compute the
max
> width. With the default value, all nodes are used.

I always love optimizations but I'm not sure what the real purpose of yours
is. I mean, right it limits the accessed nodes in the width iteration but
what general use has this? The loop will always start with the first node
and nobody except the application can say how many nodes are necessary to
query. This means however that this optimization depends on information from
the application and hence therer is no general use. Do I miss something
here?

Ciao, Mike


re: Multi line header

From: Mike Lischke [public@l...]
Date: Fri May 4, 2001 12:53 pm
Subject: RE: [VirtualTreeview] Multi line header

Hi Franc,

> is it possible to have more than one line of text in a columnheader ?
> Or do I have to use OwnerDraw for this and draw the text myself ?

No, more than one line is not possible in the header. The reason is the
quite complex interaction between the text, the images, the button layout,
the bidi mode and the alignment. I recommend to do a custom draw in this
case.

Ciao, Mike


UpdateLayeredWindow

From: "Simon Lau" [jonarr@s...]
Date: Fri May 4, 2001 1:06 pm
Subject: UpdateLayeredWindow

My apologies,

This isn't related to VT but it seemed like a good way to ask a lot of
intelligent people a question.

Has anybody successfully used the UpdateLayeredWindow function from Windows
2000 in Delphi?

I have the declarations, I've seen a C++ sample and I've read the MSDN
documentation but I've had no luck in implementing anything that works in
Delphi. Maybe one of you has had more luck.

Great work on VT by the way.
Thanks
Simon

 | Replies | Author | Date
1573 | Re: UpdateLayeredWindow | Mike Lischke | Fri 5/4/2001
1574 | Re: UpdateLayeredWindow | Roland | Fri 5/4/2001
1577 | Re: UpdateLayeredWindow | Moritz Franckenstein | Fri 5/4/2001
1580 | Re: UpdateLayeredWindow | Simon Lau | Fri 5/4/2001


re: Drop Buttons.pas and save 6 KB in Exe Size

From: Bender Heri [HBender@E...]
Date: Fri May 4, 2001 1:15 pm
Subject: RE: [VirtualTreeview] Drop Buttons.pas and save 6 KB in Exe Size

Maybe make your own type TVTButtonLayout ?

Heri

> -----Original Message-----
> From: Mike Lischke [mailto:[public@l...]]
> Sent: Friday, May 04, 2001 2:48 PM
> To: 'VirtualTreeview@yahoogroups.com'
> Subject: RE: [VirtualTreeview] Drop Buttons.pas and save 6 KB in Exe
> Size
>
>
> Hi Ralf,
>
> > including Buttons.pas into the VirtualTrees.pas's uses clause
> > adds some 6 KB to the executable file's size (when compiled
> > without packages). 6 KB might not seem a lot, but why not
> > save them when they can be saved easily?
> >
> > TButtonLayout = (blGlyphLeft, blGlyphRight, blGlyphTop,
> > blGlyphBottom);
>
> Mmh, I know, but I have often seen this little nasty problem where the
> compiler says that one type does not fit to another type,
> which is caused by
> the duplicate declaration (and happens only if both units,
> here Buttons and
> VirtualTrees are in the uses clause). Sure this is easily
> solved by full
> identifier qualification but causes serious headaches for
> beginners (and
> people will stone me when this happens in the try-out phase
> or will at least
> throw away VT). Getting rid of Buttons.pas is tempting but what is the
> price?
>
> Ciao, Mike
>
> To unsubscribe from this group, send an email to:
> VirtualTreeview-unsubscribe@egroups.com
>
>
>
> Your use of Yahoo! Groups is subject to
> http://docs.yahoo.com/info/terms/
>
>


re: Drop Buttons.pas and save 6 KB in Exe Size

From: Mike Lischke [public@l...]
Date: Fri May 4, 2001 1:28 pm
Subject: RE: [VirtualTreeview] Drop Buttons.pas and save 6 KB in Exe Size

> Maybe make your own type TVTButtonLayout ?

Sometimes my ignorance hurts. Yes of course Heri, this is the best solution.
Implemented and Buttons.pas removed.

Ciao, Mike


re: UpdateLayeredWindow

From: Mike Lischke [public@l...]
Date: Fri May 4, 2001 1:29 pm
Subject: RE: [VirtualTreeview] UpdateLayeredWindow

Hi Simon.

> This isn't related to VT but it seemed like a good way to ask a lot of
> intelligent people a question.

I can't help you with that but you can make it on-topic by writing the
necessary stuff for VT once you have figured out how it works ;-)

Ciao, Mike


re: UpdateLayeredWindow

From: "Roland" [Beduerftig@S...]
Date: Fri May 4, 2001 1:41 pm
Subject: Re: UpdateLayeredWindow

Hi Simon,

> Has anybody successfully used the UpdateLayeredWindow function
> from Windows2000 in Delphi?
>
> I have the declarations, I've seen a C++ sample and I've read
> the MSDN documentation but I've had no luck in implementing
> anything that works in Delphi. Maybe one of you has had more luck.

I think the easiest way is to translate the C++ to Delphi if you must
use the function, or you build a DLL with C++ export the function
call and use it under Delphi.

with best regards
Roland


re: autosizing columns

From: "Moritz Franckenstein" [franckenstein@a...]
Date: Fri May 4, 2001 1:52 pm
Subject: Re: autosizing columns

--- In [VirtualTreeview@y...], Mike Lischke [public@l...] wrote:
> We are getting closer :o] Unfortunately the columns "jump" with this
> implementation. E.g. when I have more than 10 columns in a tree
and resize
> the tree in small steps then only the last column grows to fit the
client

here is a fix, the round errors are now carried over to the next
column instead of the last column. i think both ways are ok and have
their disadvantages.

procedure TForm1.TreeColumnResize(Sender: TVTHeader; Column: Integer);
var
I, W, A, B, C, D: Integer;
D2, Carry: Single;
begin
if Sizing then Exit;
W:= Sender.Treeview.ClientWidth;

with Sender.Columns do begin
(...)
Carry:= 0;
if C > 0 then begin
D2:= W / C;
for I:= A to B-1 do
with Items[I] do
if Round(Columns[I]+D2) >= MinWidth then begin
Columns[I]:= Columns[I]+D2+Carry;
D:= Round(Columns[I]);
Carry:= Columns[I]-D;
Dec(W, D-Width);
Width:= D;
end;
end;
(...)


re: Grid mode and hidden nodes

From: [andersthomsen@h...]
Date: Fri May 4, 2001 1:55 pm
Subject: Re: Grid mode and hidden nodes

Hi,

I've got the same problem, and it doesn't only happen in grid-mode.
Take a look at this project (~6kb):
http://www.malerthomsen.dk/vt.zip
I've used the latest beta of Virtual Tree.

-Thomsen

--- In [VirtualTreeview@y...], Mike Lischke [public@l...] wrote:
> > I've a strange behavior in Grid mode when I hide some nodes :
the
> > vertical scroll bar doesn't reflect the hidden nodes (I can
> > scroll bellow the last visible node).
>
> This is indeed strange if it only happens in grid mode because from
the view
> of the scroll bars there is no difference between the modes. Can you
> elaborate a bit more (or send me a simple demo)?
>
> Ciao, Mike


re: UpdateLayeredWindow

From: "Moritz Franckenstein" [franckenstein@a...]
Date: Fri May 4, 2001 1:58 pm
Subject: Re: UpdateLayeredWindow

> Has anybody successfully used the UpdateLayeredWindow function from
Windows 2000 in Delphi?

const
WS_EX_LAYERED = $00080000;
LWA_COLORKEY = $00000001;
LWA_ALPHA = $00000002;

function SetLayeredWindowAttributes(Handle: HWND; crKey: DWORD;
bAlpha: Byte; dwFlags: DWORD): BOOL; stdcall; external 'user32.dll';

if this is what you mean, i can send you the full delphi source of a
nice funny little application that uses it.


re: GetMaxColumnWidth

From: "Cyril VELTER" [cyril.velter@l...]
Date: Fri May 4, 2001 2:03 pm
Subject: Re: [VirtualTreeview] GetMaxColumnWidth

Hi Mike,

> > I've some quite long lists that I display in a treeview. I want to
> > approximate a good column width without validating and
> > accessing the text of all the nodes. I've modified the standard
> GetMaxColumnWidth
> > to take a new parameter to limit the number of node used to compute the
> max
> > width. With the default value, all nodes are used.
>
> I always love optimizations but I'm not sure what the real purpose of
yours
> is. I mean, right it limits the accessed nodes in the width iteration but
> what general use has this? The loop will always start with the first node
> and nobody except the application can say how many nodes are necessary to
> query. This means however that this optimization depends on information
from
> the application and hence therer is no general use. Do I miss something
> here?

But I call GetMaxColumnWidth from my application (it's a public method
!!) with a proper value. I use it just after loading a big list in VT (more
than 1000 node and 20 columns). I just want to autosize several key columns
to a "best approximate" width without taking too much time. So I manually
call GetMaxColumnWidth and tell it to not use more than a fix number of
node.

GetMaxColumnWidth is called at two points inside VT :

* Double click in a header : The beahvior should not be modified. If the
user make this action with a very long list, he knwo it could take some
times.
* Header.AutoSizeColumn : O, to be consistent this one should also take
the parameter and pass it to GetMaxColumnWidth.

cyril


re: Re: Grid mode and hidden nodes

From: "Cyril VELTER" [cyril.velter@l...]
Date: Fri May 4, 2001 2:14 pm
Subject: Re: [VirtualTreeview] Re: Grid mode and hidden nodes

> I've got the same problem, and it doesn't only happen in grid-mode.
> Take a look at this project (~6kb):
> http://www.malerthomsen.dk/vt.zip
> I've used the latest beta of Virtual Tree.
>
> -Thomsen
>
>
> --- In [VirtualTreeview@y...], Mike Lischke [public@l...] wrote:
> > > I've a strange behavior in Grid mode when I hide some nodes :
> the
> > > vertical scroll bar doesn't reflect the hidden nodes (I can
> > > scroll bellow the last visible node).
> >
> > This is indeed strange if it only happens in grid mode because from
> the view
> > of the scroll bars there is no difference between the modes. Can you
> > elaborate a bit more (or send me a simple demo)?
> >
> > Ciao, Mike

I've not tested in tree mode, but I see the exact same behavior as
the Thomsen demo.

cyril


re: Re: UpdateLayeredWindow

From: "Simon Lau" [jonarr@s...]
Date: Fri May 4, 2001 2:22 pm
Subject: Re: [VirtualTreeview] Re: UpdateLayeredWindow

> if this is what you mean, i can send you the full delphi source of a
> nice funny little application that uses it.

Unfortunatly that is not what I mean. Here is a translation of the
declaration:

Function UpdateLayeredWindow( Wnd : HWND; Dst : HDC; pptDst : TPoint; psize
: pSize; hdcSrc : HDC;
pptSrc : TPoint; crKey : COLORREF; pblend :
TBlendFunction; dwFlags: DWORD) : Bool; stdcall;

> I think the easiest way is to translate the C++ to Delphi if you must
> use the function, or you build a DLL with C++ export the function
> call and use it under Delphi.

I tried translating the C++ example, but my C++ isn't very good and as well
as that, it was written in MFC which confuses me no end.
If anybody would like to see the original MFC example, its here:
http://www.codeproject.com/dialog/faderwnd.asp?print=true

But thanks for the help anyway. I've been trying to figure it out for a year
now, and really I'm not sure how I'd be able to apply it to VT. Alpha
blended VT? I don't think Layered window functions would work with a
component like VT. I tried making individual buttons transparent using
SetLayeredWindowAttributes but it didn't work. I suppose you could use
layered windows for rendering the drag and drop effects, but then it only
works on Win2k/XP and we all know we'd like VT to be cross platform.

Thanks
Simon


Grid mode

From: [F.vdwestelaken@c...]
Date: Fri May 4, 2001 2:24 pm
Subject: Grid mode

Hi,

is it possible when using VTree in GridMode to have CTRL-HOME to move
to the upperleft cell and CTRL-END to move to the lower right cell
(like Excel does ?). VirtualTree does move to the first and last row,
but doesn't move the cell selection accordingly.

Franc.

 | Replies | Author | Date
1592 | Re: Grid mode | Mike Lischke | Sat 5/5/2001
1618 | Re: Grid mode | Franc v/d Westelaken | Sun 5/6/2001
1621 | Re: Grid mode | Mike Lischke | Sun 5/6/2001


re: Re: Grid mode and hidden nodes

From: Mike Lischke [public@l...]
Date: Fri May 4, 2001 2:52 pm
Subject: RE: [VirtualTreeview] Re: Grid mode and hidden nodes

> I've got the same problem, and it doesn't only happen in grid-mode.
> Take a look at this project (~6kb):
> http://www.malerthomsen.dk/vt.zip
> I've used the latest beta of Virtual Tree.

Okay, this is again a real serious bug you both found there. I have not yet
fixed it but so far I can tell I will have to resign the ivsVisible style
due to the way VT works. More about it when I have solved the issue.

Ciao, Mike


Use Hints and Popups in the same Tree

From: "Moritz Franckenstein" [franckenstein@a...]
Date: Fri May 4, 2001 2:57 pm
Subject: Use Hints and Popups in the same Tree

hi,

i am looking for a way to display a hint for some colums and a popup
(for displaying too long texts) for some other columns.

maybe a new parameter to OnGetHint could help to choose between hint
and popup at runtime. or maybe a new HintMode setting that
automatically displays a popup when OnGetHint return nothing. or
setting different hintmodes for different columns... and so on :)

but i think, the first idea might be the best. or a combination.

or is there already an easy way to have this?

-moritz

 | Replies | Author | Date
1594 | Re: Use Hints and Popups in the same Tree | Mike Lischke | Sat 5/5/2001
1627 | Re: Use Hints and Popups in the same Tree | Moritz Franckenstein | Sun 5/6/2001
1664 | Re: Use Hints and Popups in the same Tree | Mike Lischke | Tue 5/8/2001
1677 | Re: Use Hints and Popups in the same Tree | Moritz Franckenstein | Tue 5/8/2001


Selected Node Deleted

From: Jim Kueneman [jimdk@m...]
Date: Sat May 5, 2001 1:30 am
Subject: Selected Node Deleted

Mike,

I seem to have found a bug in the selection / deletion code

if I do this:

no Multi-select

Node: PVirtualNode;
NS: TNamespace;
i: integer;

IsSelected := Selected[Node]; < True the node is selected
i := SelectedCount; < Ok great One is selected
DeleteNode(Node); < Lets delete it
i := SelectedCount; < One is still selected,
which one?
Node := GetFirstSelected; < Returns something ?
// Node has a one byte higher address than the Original Node?
ValidateNamespace(Node, NS); < NS points to junk.

I have worked around it by

if Selected[Node] then
Selected[Node] := False;
DeleteNode(Node);

Jim

 | Replies | Author | Date
1585 | Re: Selected Node Deleted | Jim Kueneman | Sat 5/5/2001
1596 | Re: Selected Node Deleted | Mike Lischke | Sat 5/5/2001
1607 | Re: Selected Node Deleted | Jim Kueneman | Sat 5/5/2001
1613 | Re: Selected Node Deleted | Mike Lischke | Sun 5/6/2001


re: Selected Node Deleted

From: Jim Kueneman [jimdk@m...]
Date: Sat May 5, 2001 2:13 am
Subject: Re: [VirtualTreeview] Selected Node Deleted

>// Node has a one byte higher address than the Original Node?
> ValidateNamespace(Node, NS); < NS points to junk.

Sorry you don't know what this is:

function TCustomVirtualExplorerTree.ValidateNamespace(Node: PVirtualNode;
var Namespace: TNamespace): Boolean;
var
NewNodeData: PNodeData;
begin
Namespace := nil;
Result := False;
if Assigned(Node) then
begin
NewNodeData := InternalData(Node);
if Assigned(NewNodeData) then
Namespace := NewNodeData.Namespace;
Result := Assigned(Namespace)
end
end;


New file uploaded to VirtualTreeview

From: [VirtualTreeview@yahoogroups.com>
Date: Sat May 5, 2001 4:23 am
Subject: New file uploaded to VirtualTreeview

Hello,

This email message is a notification to let you know that
a file has been uploaded to the Files area of the VirtualTreeview
group.

File : /VET_1.0b.zip
Uploaded by : [jimdk@m...]
Description : Virtual Explorer Tree Version 1.0b

You can access this file at the URL

http://groups.yahoo.com/group/VirtualTreeview/files/VET_1.0b.zip

To learn more about file sharing for your group, please visit

http://help.yahoo.com/help/us/groups/files

Regards,

jimdk@m...]


VET 1.0b

From: "Jim Kueneman" [jimdk@m...]
Date: Sat May 5, 2001 4:29 am
Subject: VET 1.0b

Virtual Explorer Tree 1.0b is in the files area as advertised. I
think I have finally found all the little glitches in the shell change
notifications. Also sorting of the columns is now supported along with
a few short cuts for autosizing individual columns (Read the updates
in the VirtualExplorerTree.pas file)

Reports of problems or suggestion are always welcome.
(MultiSelect is the next big addition)

Jim

 | Replies | Author | Date
1595 | Re: VET 1.0b | Mike Lischke | Sat 5/5/2001
1608 | Re: VET 1.0b | Jim Kueneman | Sat 5/5/2001
1611 | VET 1.1 | Jim Kueneman | Sun 5/6/2001
1612 | MultiSelect Scrolling | Jim Kueneman | Sun 5/6/2001
1615 | Re: MultiSelect Scrolling | Mike Lischke | Sun 5/6/2001


Do an editor with code folding using VT

From: "Jonx" [knipjo@h...]
Date: Sat May 5, 2001 1:08 pm
Subject: Do an editor with code folding using VT

Hello,
I just had an idea that I would like to see come true:
Do you think it would be possible to to an editor like
tsynatxmemo or synedit, that will use a virtualtree as
drawing base ??? This would let up implement code folding
very easily...
What do think ? maybe someone is already working on this ?
Do you think this would be hard ? why ? I think it may
even be easy. No ?

Besides from that, I posted a message about providing a
place to share concrete help and answers for our VT
community...It seems that except Roland absolutly no one
is interessed. This is not much of 310 people lurking around.
Anyway...

Thanks for your comments.

John.

 | Replies | Author | Date
1589 | Re: Do an editor with code folding using VT | Werner Lehmann | Sat 5/5/2001
1597 | Re: Do an editor with code folding using VT | Mike Lischke | Sat 5/5/2001
1609 | Re: Do an editor with code folding using VT | Werner Lehmann | Sat 5/5/2001
1644 | Re: Do an editor with code folding using VT | Roland | Mon 5/7/2001


re: Do an editor with code folding using VT

From: Werner Lehmann [wl@b...]
Date: Sat May 5, 2001 3:25 pm
Subject: Re: [VirtualTreeview] Do an editor with code folding using VT

Jonx wrote:
>
> Hello,
> I just had an idea that I would like to see come true:
> Do you think it would be possible to to an editor like
> tsynatxmemo or synedit, that will use a virtualtree as
> drawing base ??? This would let up implement code folding
> very easily...
> What do think ? maybe someone is already working on this ?
> Do you think this would be hard ? why ? I think it may
> even be easy. No ?

I don't think that this would be a good idea (starting from
a VT ancestor, that is). Don't get me wrong: I like the
code folding idea since the time I saw it first on my Atari
ST with GfA Basic. And I have asked Borland to implement it
for two times already so I am all for it. But I believe that
the tree would not be the ideal ancestor. You would have to
owner paint all nodes. Text selection (over several lines),
text movement, cut & paste... Too much work (aside the possibly
bad performance) for this single gain. I believe that the actual
code folding implementation can be put on top of one of these
syntax highlighting components far more easily. But I need
it inside of the Delphi IDE. Maybe it's possible with OTA but
I doubt it. Would take too much time anyway.

> Besides from that, I posted a message about providing a
> place to share concrete help and answers for our VT
> community...It seems that except Roland absolutly no one
> is interessed. This is not much of 310 people lurking around.
> Anyway...

We have 'a place to share concrete help and answers' and it
is here on this list. Online help and FAQ is in the works.
Secondly, probably noone here has a lot of time to share. That
will be the cause for your disappointing feedback.

Regards,
Werner

 | Replies | Author | Date
1597 | Re: Do an editor with code folding using VT | Mike Lischke | Sat 5/5/2001


re: Re: Grid mode and hidden nodes

From: "Mike Lischke" [public@l...]
Date: Sat May 5, 2001 4:50 pm
Subject: RE: [VirtualTreeview] Re: Grid mode and hidden nodes

Hi Anders,

> I've got the same problem, and it doesn't only happen in grid-mode.
> Take a look at this project (~6kb):
> http://www.malerthomsen.dk/vt.zip
> I've used the latest beta of Virtual Tree.

Okay, I think I have a stable solution. Firstly, as I already said there is no
ivsVisible state anymore because to make it work in every situation I would
have to allow update cache and vertical scroll bar which disturbs sometimes
other operations unpredictable. A second step I took to make the code more
stable is to use the last available node in cache validation as last entry in
the cache if it is not filled up instead throwing an exception.

In your code you have also a little problem. See this code:

procedure TForm1.Button2Click(Sender: TObject);
var aNode : PVirtualNode;
begin
randomize;
tree.beginupdate;
aNode := tree.GetFirst;
while aNode <> nil do
begin
{if random(2) = 1 then
aNode.States := aNode.States + [vsVisible]
else
aNode.states := aNode.states - [vsVisible];}
Tree.IsVisible[aNode] := Random(2) = 1;
aNode := tree.GetNext(aNode)
end;
tree.endupdate
end;

If you don't want to take care about all aspects of hiding/showing nodes (like
cache invalidation and scrollbar update) then use the IsVisible property of the
tree to modify a node's visiblity state.

Ciao, Mike

 | Replies | Author | Date
1598 | Re: Grid mode and hidden nodes | [andersthomsen@h...] | Sat 5/5/2001
1600 | Re: Grid mode and hidden nodes | Mike Lischke | Sat 5/5/2001
1604 | Re: Grid mode and hidden nodes | [andersthomsen@h...] | Sat 5/5/2001
1605 | Re: Grid mode and hidden nodes | Mike Lischke | Sat 5/5/2001


re: GetMaxColumnWidth

From: "Mike Lischke" [public@l...]
Date: Sat May 5, 2001 4:50 pm
Subject: RE: [VirtualTreeview] GetMaxColumnWidth

Cyril,

> But I call GetMaxColumnWidth from my application (it's a public method
> !!) with a proper value. I use it just after loading a big list in VT (more
> than 1000 node and 20 columns). I just want to autosize several key columns
> to a "best approximate" width without taking too much time. So I manually
> call GetMaxColumnWidth and tell it to not use more than a fix number of
> node.

It seems I was not clear enough. I have no doubts that you have a need for such
a solution, otherwise you would not have proposed it, but my concern was about
general use for many users. Just because one developer needs something does not
justify that it is taken into the implementation (except it is the developer
:-)). I have to explain why there is this parameter and I still have no good
reason to include it because of its limited use. And please don't say it does
not harm, so why not include it. If this would be a valid argument then I could
also include winsock and other stuff into VT.

I hope you get me right. I don't want to stop you from suggesting interesting
solutions, but it is important that they are useful for many users.

Ciao, Mike


re: Grid mode

From: "Mike Lischke" [public@l...]
Date: Sat May 5, 2001 4:50 pm
Subject: RE: [VirtualTreeview] Grid mode

Franc.,

> is it possible when using VTree in GridMode to have CTRL-HOME to move
> to the upperleft cell and CTRL-END to move to the lower right cell
> (like Excel does ?). VirtualTree does move to the first and last row,
> but doesn't move the cell selection accordingly.

Good idea. Actually, the move must be restricted to the visible and focusable
columns,which makes the task a bit more difficult. But I have already solved a
very similar problem for TAB handling, so it took only a couple of minutes to
write and test.

Ciao, Mike

 | Replies | Author | Date
1618 | Re: Grid mode | Franc v/d Westelaken | Sun 5/6/2001
1621 | Re: Grid mode | Mike Lischke | Sun 5/6/2001


re: Re: autosizing columns

From: "Mike Lischke" [public@l...]
Date: Sat May 5, 2001 4:50 pm
Subject: RE: [VirtualTreeview] Re: autosizing columns

Hi Moritz,

> here is a fix, the round errors are now carried over to the next
> column instead of the last column. i think both ways are ok and have
> their disadvantages.

This is also not really better. The columns don't jump so much as before,
right, but it still happens often that a column oscillates which looks not very
good. Additionally you have neither taken the maximum width into account nor
any of the column's options, e.g. visibility and no resize.

I bet the solution is not a simple as you thought initially, but I have no time
to make it a round solution. There is simply too much other work waiting.
Anyway, thank you for trying. Perhaps we can include your (then improved code)
in a later version of VT?

Ciao, Mike

 | Replies | Author | Date
1642 | Re: autosizing columns | Moritz Franckenstein | Mon 5/7/2001
1647 | Re: autosizing columns | Jim Kueneman | Mon 5/7/2001


re: Use Hints and Popups in the same Tree

From: "Mike Lischke" [public@l...]
Date: Sat May 5, 2001 4:50 pm
Subject: RE: [VirtualTreeview] Use Hints and Popups in the same Tree

Hi Moritz,

> i am looking for a way to display a hint for some colums and a popup
> (for displaying too long texts) for some other columns.

This is a good idea. I have taken it into the todo list. For the near release
however time will be
too short.

> maybe a new parameter to OnGetHint could help to choose between hint
> and popup at runtime. or maybe a new HintMode setting

A new parameter will likely not work because at this time several parameters of
the hint are already
determined and cannot be changed on the fly. I have to think about a good
mechanism to support
tooltips and hints together. However the users of your application could get a
bit irritated when
the hint mode changes fequently, have you thought about this?

Ciao, Mike

 | Replies | Author | Date
1627 | Re: Use Hints and Popups in the same Tree | Moritz Franckenstein | Sun 5/6/2001


re: VET 1.0b

From: "Mike Lischke" [public@l...]
Date: Sat May 5, 2001 4:50 pm
Subject: RE: [VirtualTreeview] VET 1.0b

> Virtual Explorer Tree 1.0b is in the files area as advertised.

Great! You have taken the notification thread into the main unit. Is this
correct? I have deleted
the separate unit without getting any problems.

> Reports of problems or suggestion are always welcome.
> (MultiSelect is the next big addition)

I'm looking forward for multi selection. Meanwhile a suggestion from me: You
could stop the image
retrieval process when a node for which the thread is active has been
collapsed. This way VET
becomes even more responsive.

Ciao, Mike

 | Replies | Author | Date
1608 | Re: VET 1.0b | Jim Kueneman | Sat 5/5/2001
1611 | VET 1.1 | Jim Kueneman | Sun 5/6/2001
1612 | MultiSelect Scrolling | Jim Kueneman | Sun 5/6/2001
1615 | Re: MultiSelect Scrolling | Mike Lischke | Sun 5/6/2001


re: Selected Node Deleted

From: "Mike Lischke" [public@l...]
Date: Sat May 5, 2001 4:50 pm
Subject: RE: [VirtualTreeview] Selected Node Deleted

Hi Jim,

> I seem to have found a bug in the selection / deletion code
> DeleteNode(Node); < Lets delete it
> i := SelectedCount; < One is still selected,

Do you have perhaps a BeginUpdate call before? The selection count is update
only after the final
EndUpdate.

Ciao, Mike

 | Replies | Author | Date
1607 | Re: Selected Node Deleted | Jim Kueneman | Sat 5/5/2001
1613 | Re: Selected Node Deleted | Mike Lischke | Sun 5/6/2001


re: Do an editor with code folding using VT

From: "Mike Lischke" [public@l...]
Date: Sat May 5, 2001 5:02 pm
Subject: RE: [VirtualTreeview] Do an editor with code folding using VT

Hi Werner, John,

> I don't think that this would be a good idea (starting from
> a VT ancestor, that is). Don't get me wrong: I like the
> code folding idea since the time I saw it first on my Atari
> ST with GfA Basic.

I agree here with Werner. But a code folding editor is one of my next projects
(together with a full
blown Unicode library). I want to extend my Unicode Syntax Edit to allow code
folding and have
already some cool ideas. I also thought that using VT in the gutter as
structure viewer would be
cool, but I'm not yet sure.

> We have 'a place to share concrete help and answers' and it
> is here on this list. Online help and FAQ is in the works.

Actually, John is the one who works on the FAQs and that was for which he asked
for help...

Ciao, Mike


re: Grid mode and hidden nodes

From: [andersthomsen@h...]
Date: Sat May 5, 2001 5:39 pm
Subject: Re: Grid mode and hidden nodes

Hi,

Hmm..
Isn't the IsVisible function only for evaluating if the node's parent
is expaned or collapsed? Or can it also be used for setting the
vsVisible tag?
When are you going to upload the updated version?

Regards,
Anders Thomsen

--- In [VirtualTreeview@y...], "Mike Lischke" [public@l...] wrote:
> Hi Anders,
>
> > I've got the same problem, and it doesn't only happen in grid-
mode.
> > Take a look at this project (~6kb):
> > http://www.malerthomsen.dk/vt.zip
> > I've used the latest beta of Virtual Tree.
>
> Okay, I think I have a stable solution. Firstly, as I already said
there is no ivsVisible state anymore because to make it work in every
situation I would have to allow update cache and vertical scroll bar
which disturbs sometimes other operations unpredictable. A second
step I took to make the code more stable is to use the last available
node in cache validation as last entry in the cache if it is not
filled up instead throwing an exception.
>
> In your code you have also a little problem. See this code:
>
> procedure TForm1.Button2Click(Sender: TObject);
> var aNode : PVirtualNode;
> begin
> randomize;
> tree.beginupdate;
> aNode := tree.GetFirst;
> while aNode <> nil do
> begin
> {if random(2) = 1 then
> aNode.States := aNode.States + [vsVisible]
> else
> aNode.states := aNode.states - [vsVisible];}
> Tree.IsVisible[aNode] := Random(2) = 1;
> aNode := tree.GetNext(aNode)
> end;
> tree.endupdate
> end;
>
> If you don't want to take care about all aspects of hiding/showing
nodes (like cache invalidation and scrollbar update) then use the
IsVisible property of the tree to modify a node's visiblity state.
>
> Ciao, Mike

 | Replies | Author | Date
1600 | Re: Grid mode and hidden nodes | Mike Lischke | Sat 5/5/2001


re: GetMaxColumnWidth

From: "Cyril VELTER" [cyril.velter@l...]
Date: Sat May 5, 2001 5:42 pm
Subject: Re: [VirtualTreeview] GetMaxColumnWidth

Hi, Mike,

> It seems I was not clear enough. I have no doubts that you have a need for
such a solution, otherwise you would not have proposed it, but my >concern
was about general use for many users. Just because one developer needs
something does not justify that it is taken into the implementation
>(except it is the developer :-)). I have to explain why there is this
parameter and I still have no good reason to include it because of its
limited use. And >please don't say it does not harm, so why not include it.
If this would be a valid argument then I could also include winsock and
other stuff into VT.
>

Ok, I just thought it could have been a usefull feature for people
using VT with a lot of nodes and columns (and especialy when node validation
is time expensive, like in database applications) which make
GetMaxColumnWidth take too much time.

cyril


re: Re: Grid mode and hidden nodes

From: "Mike Lischke" [public@l...]
Date: Sat May 5, 2001 5:50 pm
Subject: RE: [VirtualTreeview] Re: Grid mode and hidden nodes

> Isn't the IsVisible function only for evaluating if the node's parent
> is expaned or collapsed? Or can it also be used for setting the
> vsVisible tag?

IsVisible can be used for both to test if a node is visible (which includes a
visible path, i.e. all
its parents are expanded, and that the node contains the vsVisible state).

> When are you going to upload the updated version?

Tonight. I have now finished everything which was mentioned.

Ciao, Mike


Redrawing problems

From: [andersthomsen@h...]
Date: Sat May 5, 2001 7:03 pm
Subject: Redrawing problems

Hi,

I have some problems with making the tree paint itself. I think it's
because my app is a Winamp plugin, but I don't know.
The problem is, that if I load/create some nodes, they're not drawn
to the tree. Mostly the tree canvas displays the application that
lays under the form (for instance the Windows Desktop). To get the
tree painted, I just click around somewhere in the tree, and it
repaints. Is there any method to force-paint the tree on formshow or
something?

Also, the tree is placed on Tpanels, if that has anything to say.

This component is the only component that doesn't redraw correctly,
all others do (Tlistviews, buttons aso.)

-Thomsen
(using latest beta)

 | Replies | Author | Date
1602 | Re: Redrawing problems | Mike Lischke | Sat 5/5/2001


re: Redrawing problems

From: "Mike Lischke" [public@l...]
Date: Sat May 5, 2001 7:29 pm
Subject: RE: [VirtualTreeview] Redrawing problems

Anders,

> Also, the tree is placed on Tpanels, if that has anything to say.
>
> This component is the only component that doesn't redraw correctly,
> all others do (Tlistviews, buttons aso.)

This is more than strange. Why on earth should the tree suddenly stop painting?
Do you have called
BeginUpdate without corresponding EndUpdate call? Can you debug the code while
it is used as
plug-in? If yes then set a break point in method PaintTree and see if the
execution stops there and
examine the initialization.

Ciao, Mike


New file uploaded to VirtualTreeview

From: [VirtualTreeview@yahoogroups.com>
Date: Sat May 5, 2001 7:36 pm
Subject: New file uploaded to VirtualTreeview

Hello,

This email message is a notification to let you know that
a file has been uploaded to the Files area of the VirtualTreeview
group.

File : /VirtualTree.zip
Uploaded by : [public@l...]
Description : Version 2.4.3 ß

You can access this file at the URL

http://groups.yahoo.com/group/VirtualTreeview/files/VirtualTree.zip

To learn more about file sharing for your group, please visit

http://help.yahoo.com/help/us/groups/files

Regards,

public@l...]


re: Grid mode and hidden nodes

From: [andersthomsen@h...]
Date: Sat May 5, 2001 8:00 pm
Subject: Re: Grid mode and hidden nodes

Hi,

Okay, I'm now using the IsVisible to set the vsVisible to
nodes.states.
And I just installed the tree you just uploaded. However, the
scrollbar still doesn't seem to be updated.

-Thomsen

--- In [VirtualTreeview@y...], "Mike Lischke" [public@l...] wrote:
> Hi Anders,
>
> > I've got the same problem, and it doesn't only happen in grid-
mode.
> > Take a look at this project (~6kb):
> > http://www.malerthomsen.dk/vt.zip
> > I've used the latest beta of Virtual Tree.
>
> Okay, I think I have a stable solution. Firstly, as I already said
there is no ivsVisible state anymore because to make it work in every
situation I would have to allow update cache and vertical scroll bar
which disturbs sometimes other operations unpredictable. A second
step I took to make the code more stable is to use the last available
node in cache validation as last entry in the cache if it is not
filled up instead throwing an exception.
>
> In your code you have also a little problem. See this code:
>
> procedure TForm1.Button2Click(Sender: TObject);
> var aNode : PVirtualNode;
> begin
> randomize;
> tree.beginupdate;
> aNode := tree.GetFirst;
> while aNode <> nil do
> begin
> {if random(2) = 1 then
> aNode.States := aNode.States + [vsVisible]
> else
> aNode.states := aNode.states - [vsVisible];}
> Tree.IsVisible[aNode] := Random(2) = 1;
> aNode := tree.GetNext(aNode)
> end;
> tree.endupdate
> end;
>
> If you don't want to take care about all aspects of hiding/showing
nodes (like cache invalidation and scrollbar update) then use the
IsVisible property of the tree to modify a node's visiblity state.
>
> Ciao, Mike

 | Replies | Author | Date
1605 | Re: Grid mode and hidden nodes | Mike Lischke | Sat 5/5/2001


re: Re: Grid mode and hidden nodes

From: "Mike Lischke" [public@l...]
Date: Sat May 5, 2001 8:54 pm
Subject: RE: [VirtualTreeview] Re: Grid mode and hidden nodes

Anders,

> And I just installed the tree you just uploaded. However, the
> scrollbar still doesn't seem to be updated.

Do you wanna kill me? :-) I have tested with your code that it works and it
did. Here is the entire
code:

unit Unit1;

interface

uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, VirtualTrees;

type
TForm1 = class(TForm)
tree: TVirtualStringTree;
Button1: TButton;
Button2: TButton;
procedure Button1Click(Sender: TObject);
procedure treeInitNode(Sender: TBaseVirtualTree; ParentNode,
Node: PVirtualNode; var InitialStates: TVirtualNodeInitStates);
procedure FormCreate(Sender: TObject);
procedure treeGetText(Sender: TBaseVirtualTree; Node: PVirtualNode;
Column: Integer; TextType: TVSTTextType; var Text: WideString);
procedure Button2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
type
TTreeData = record
Text: integer;
end;
PTreeData = ^TTreeData; //this is a node example

var
Form1: TForm1;

implementation

{$R *.DFM}

procedure TForm1.Button1Click(Sender: TObject);
begin
screen.cursor := crhourglass;
tree.beginupdate;
tree.clear;
tree.RootNodeCount := 6000;
tree.ValidateNode(nil, true);
tree.EndUpdate;
screen.cursor := crdefault
end;

procedure TForm1.treeInitNode(Sender: TBaseVirtualTree; ParentNode,
Node: PVirtualNode; var InitialStates: TVirtualNodeInitStates);
var data:PTreeData;
begin
Data := tree.GetNodeData(Node);
data.Text := node.index;
{ if random(2) = 1 then
InitialStates := [ivsVisible]
else
Initialstates := []
}end;

procedure TForm1.FormCreate(Sender: TObject);
begin
randomize;
tree.NodeDataSize := SizeOf(TTreeData);
end;

procedure TForm1.treeGetText(Sender: TBaseVirtualTree; Node: PVirtualNode;
Column: Integer; TextType: TVSTTextType; var Text: WideString);
var data:Ptreedata;
begin
data := tree.getnodedata(node);
case column of
0:text := inttostr(data.text);
else
text := inttostr(data.text * column)
end
end;

procedure TForm1.Button2Click(Sender: TObject);
var aNode : PVirtualNode;
begin
randomize;
tree.beginupdate;
aNode := tree.GetFirst;
while aNode <> nil do
begin
{if random(2) = 1 then
aNode.States := aNode.States + [vsVisible]
else
aNode.states := aNode.states - [vsVisible];}
Tree.IsVisible[aNode] := Random(2) = 1;
aNode := tree.GetNext(aNode)
end;
tree.endupdate
end;

end.

Ciao, Mike


re: Re: Grid mode and hidden nodes

From: "Cyril VELTER" [cyril.velter@l...]
Date: Sat May 5, 2001 9:14 pm
Subject: Re: [VirtualTreeview] Re: Grid mode and hidden nodes

Hi mike,

> Anders,
>
> > And I just installed the tree you just uploaded. However, the
> > scrollbar still doesn't seem to be updated.
>
> Do you wanna kill me? :-) I have tested with your code that it works and
it did. Here is the entire
> code:

Great works !!!

I've just upgraded to your latest version and it now works as expected
now. I've replaced all ivsVisible and vsVisible change by IsVisible call.

cyril


re: Selected Node Deleted

From: Jim Kueneman [jimdk@m...]
Date: Sat May 5, 2001 9:22 pm
Subject: RE: [VirtualTreeview] Selected Node Deleted

At 06:50 PM 5/5/2001 +0200, you wrote:

> > I seem to have found a bug in the selection / deletion code
> > DeleteNode(Node); < Lets delete it
> > i := SelectedCount; < One is still selected,
>
>Do you have perhaps a BeginUpdate call before? The selection count is
>update only after the final
>EndUpdate.

No, I *have* to tape a sticky note to my screen "BeginUpdate / EndUpdate
is NOT optional in VT......." Say it 50 times nightly before going to bed <g>

Jim

 | Replies | Author | Date
1613 | Re: Selected Node Deleted | Mike Lischke | Sun 5/6/2001


re: VET 1.0b

From: Jim Kueneman [jimdk@m...]
Date: Sat May 5, 2001 9:28 pm
Subject: RE: [VirtualTreeview] VET 1.0b

At 06:50 PM 5/5/2001 +0200, you wrote:
> > Virtual Explorer Tree 1.0b is in the files area as advertised.
>
>Great! You have taken the notification thread into the main unit. Is this
>correct? I have deleted
>the separate unit without getting any problems.

Yes that is true.

>I'm looking forward for multi selection. Meanwhile a suggestion from me:
>You could stop the image

Almost done, fairly easy if I use the voLevelSelectContraint and only allow
siblings to be selected. A tougher challange is to implement it in
different folders, as I mentioned before. I can do it if the drag
originates and ends in VET but dragging outside of VET is a
challange. Maybe I can do it from inside IDataObject? I have not really
looked at it closely yet.

>retrieval process when a node for which the thread is active has been
>collapsed. This way VET
>becomes even more responsive.

Seems easy enough <g>

Jim


re: Do an editor with code folding using VT

From: Werner Lehmann [wl@b...]
Date: Sat May 5, 2001 11:35 pm
Subject: Re: [VirtualTreeview] Do an editor with code folding using VT

Mike Lischke wrote:
>
> > We have 'a place to share concrete help and answers' and it
> > is here on this list. Online help and FAQ is in the works.
>
> Actually, John is the one who works on the FAQs and that was for which he
asked for help...

In this case I have to apologize to John. I did not notice that
he is the one who tries to maintain the official faq.

When is a question frequently asked? Judging by this list I know
of only one common problem: the addchild / initnode / invalidatenode
one. I think we have no general answer when to use what. Of course
this could also be an answer: that there is no generally usable
approach :) After all, personal taste and programming style influences
this topic a lot.

To build and collect a faq and to keep it up-to-date takes a fair amount
of time. Personally I would favor the second best solution: to make
an archive of this list public. This could be as simple as uploading
monthly digests. If I had a question I would just search the archive
(file). If it was a faq I would surely find the answer there.

I understand that this is not very friendly to new users of the
components. But lets keep in mind that these users are developers
in the first place. They should be able to figure some things out.
And those very basic starting problems have been addressed quite
nicely in Johns current faq which is part of the help file.

How many times has a question to be asked to be a frequently asked
one? The number is bigger than 2 IMO. I have not seen too many of
these. And cleary, recording each single question and answer in a
nice html would be nice to have but would require too much work.

Regards,
Werner

 | Replies | Author | Date
1644 | Re: Do an editor with code folding using VT | Roland | Mon 5/7/2001


New file uploaded to VirtualTreeview

From: [VirtualTreeview@yahoogroups.com>
Date: Sun May 6, 2001 5:11 am
Subject: New file uploaded to VirtualTreeview

Hello,

This email message is a notification to let you know that
a file has been uploaded to the Files area of the VirtualTreeview
group.

File : /VET_V1.1.zip
Uploaded by : [jimdk@m...]
Description : Virtual Explorer Tree V1.1

You can access this file at the URL

http://groups.yahoo.com/group/VirtualTreeview/files/VET_V1.1.zip

To learn more about file sharing for your group, please visit

http://help.yahoo.com/help/us/groups/files

Regards,

jimdk@m...]


VET 1.1

From: Jim Kueneman [jimdk@m...]
Date: Sun May 6, 2001 5:19 am
Subject: VET 1.1

VET 1.1 is now uploaded.

It supports MultiSelect, within the limitations of the shell data transfer
mechanism. Only items of a common parent may be selected at one time.

Shortcut keys have been added for Copy, Cut, Paste, and Delete (same as
explorer)

>I'm looking forward for multi selection. Meanwhile a suggestion from me:
>You could stop the image
>retrieval process when a node for which the thread is active has been
>collapsed. This way VET
>becomes even more responsive.

Mike, try the new version and let me know if it does what you are looking
for. I hope so since it was only one line of extra code :^)

It now does everything I envisioned it to do. Suggestions for improvements
are welcome. I now need to start documenting. :^(

Jim


MultiSelect Scrolling

From: Jim Kueneman [jimdk@m...]
Date: Sun May 6, 2001 5:22 am
Subject: MultiSelect Scrolling

Mike,

Is there a reason VT does not autoscroll while dragging the muliselect
rectangle?

Jim

 | Replies | Author | Date
1615 | Re: MultiSelect Scrolling | Mike Lischke | Sun 5/6/2001


re: Selected Node Deleted

From: "Mike Lischke" [public@l...]
Date: Sun May 6, 2001 8:50 am
Subject: RE: [VirtualTreeview] Selected Node Deleted

Jim,

> No, I *have* to tape a sticky note to my screen "BeginUpdate / EndUpdate
> is NOT optional in VT......." Say it 50 times nightly before going to bed <g>

Don't get me wrong. BeginUpdate/EndUpdate is *not* mandatory. All I wanted to
say is that *if* you
have called BeginUpdate already then you have to wait until the final EndUpdate
call for the
selection to be updated.

Ciao, Mike


ActiveX

From: "Mike Lischke" [public@l...]
Date: Sun May 6, 2001 8:42 am
Subject: ActiveX

Hi all,

is there somebody on this list who would like to create together with me an OCX
to be used in VB (or even VC)? By a recent bug hunt for active forms I saw what
cool things can be made and want now to have the VB/VC guys using VT too :-)

For those who don't hesitate to download a 300KB OCX try
http://www.lischke-online.de/download/Betas/ActiveFormTest.htm to see an
example of Jim's VET in IE. Of course ActiveX must be enabled for this page to
work. I have set write-protection for this folder so you can be assured nobody
(except me of course) can replace the OCX and install a trojan horse on your
machine :o]

Ciao, Mike

Dipl. Ing. Mike Lischke
Senior software developer
--
Homepage: http://www.lischke-online.de
GraphicEx: http://www.lischke-online.de/Graphics.html
Virtual Treeview: http://www.lischke-online.de/VirtualTreeview.html
Unicode Edit and library: http://www.lischke-online.de/Unicode.html
Joint Endeavor of Delphi Innovators (JEDI): http://www.delphi-jedi.org

 | Replies | Author | Date
1617 | Re: ActiveX | prog-fr | Sun 5/6/2001
1620 | Re: ActiveX | Mike Lischke | Sun 5/6/2001
1624 | Selecting multiple cells in GridMode | Franc v/d Westelaken | Sun 5/6/2001
1626 | Re: Selecting multiple cells in GridMode | Mike Lischke | Sun 5/6/2001
1622 | Re: ActiveX | Steffen Binas | Sun 5/6/2001
1625 | Re: ActiveX | Mike Lischke | Sun 5/6/2001
1634 | Re: ActiveX | Geoffrey Pan | Mon 5/7/2001
1632 | Re: ActiveX | Paul Istrate | Sun 5/6/2001
1716 | Re: ActiveX | [prog-fr@n...] | Wed 5/9/2001


re: MultiSelect Scrolling

From: "Mike Lischke" [public@l...]
Date: Sun May 6, 2001 8:50 am
Subject: RE: [VirtualTreeview] MultiSelect Scrolling

> Is there a reason VT does not autoscroll while dragging the muliselect
> rectangle?

Should work. Have you enabled it? What auto scroll delay value have you set?

Ciao, Mike


Changes in stream format

From: "Vadim Sedulin" [wsntrl@o...]
Date: Sun May 6, 2001 9:20 am
Subject: Changes in stream format

Hello Mike!

> PS: With your resize version VT no longer needs the AutoSize property in
the
> header. Taking this out will change the stream format. Any ideas?

Insert new property "_Version_" and implement loading of disabled/changed
properties through DefineProperties.

Bye.

Vadim Sedulin
E-Mail: [wsntrl@o...]

 | Replies | Author | Date
1619 | Re: Changes in stream format | Mike Lischke | Sun 5/6/2001


re: ActiveX

From: prog-fr [prog-fr@n...]
Date: Sun May 6, 2001 9:32 am
Subject: Re: [VirtualTreeview] ActiveX

This OCX work good in my IE 5.01 in W2K

 | Replies | Author | Date
1620 | Re: ActiveX | Mike Lischke | Sun 5/6/2001
1624 | Selecting multiple cells in GridMode | Franc v/d Westelaken | Sun 5/6/2001
1626 | Re: Selecting multiple cells in GridMode | Mike Lischke | Sun 5/6/2001


re: Grid mode

From: "Franc v/d Westelaken" [F.vdwestelaken@c...]
Date: Sun May 6, 2001 10:39 am
Subject: RE: [VirtualTreeview] Grid mode

Hi Mike,

I downloaded your latest beta version and the naviagtion keys 'home' and
'end' are working, but the CTRL-Home and CTRL-end has some strange effects.

I have one suggestion though. Perhaps it's more obvious to users when
VTreeView uses the same navigation keys as a standard TStringGrid ? Thus:

- 'Home' and 'CTRL-<left arow>' moves to the left most cell on the current
row
- 'End' and 'CTRL-<right arrow>' moves to the right most cell on the current
row
- CTRL-HOME moves to the upperleft cell of the grid
- CTRL-END moves to the bottomright cell of the grid

Regards Franc.

> Good idea. Actually, the move must be restricted to the visible and
> focusable columns,which makes the task a bit more difficult. But I have
> already solved a very similar problem for TAB handling, so it took only a
> couple of minutes to write and test.

[Non-text portions of this message have been removed]

 | Replies | Author | Date
1621 | Re: Grid mode | Mike Lischke | Sun 5/6/2001


re: Changes in stream format

From: "Mike Lischke" [public@l...]
Date: Sun May 6, 2001 1:22 pm
Subject: RE: [VirtualTreeview] Changes in stream format

Hi Vadim,

> Insert new property "_Version_" and implement loading of disabled/changed
> properties through DefineProperties.

Of course I have already version information for both the VT stream format and
the header stream
format. DefineProperties has nothing to do with this stuff. Unfortunately, one
must be very careful
when changing the stream formats and adjust loader/writer routines. I went
already through the
trouble to write the stream fix which wrote a stream format which was not
compatible with any other
format (I changed the size of a variable).

I would like to avoid stream changes as long as possible to prevent existing
products which use VT
streams keep working.

Ciao, Mike


re: ActiveX

From: "Mike Lischke" [public@l...]
Date: Sun May 6, 2001 1:22 pm
Subject: RE: [VirtualTreeview] ActiveX

> This OCX work good in my IE 5.01 in W2K

Excellent! Thank you for feedback.

 | Replies | Author | Date
1624 | Selecting multiple cells in GridMode | Franc v/d Westelaken | Sun 5/6/2001
1626 | Re: Selecting multiple cells in GridMode | Mike Lischke | Sun 5/6/2001


re: Grid mode

From: "Mike Lischke" [public@l...]
Date: Sun May 6, 2001 1:22 pm
Subject: RE: [VirtualTreeview] Grid mode

Hi Franc,

> I downloaded your latest beta version and the naviagtion keys 'home' and
> 'end' are working, but the CTRL-Home and CTRL-end has some strange effects.

This is something I cannot explain. Both key combinations should of course
work. I'm very sure I
have tested them before I have uploaded the latest build. But now I have tested
them again and
indeed they do not work as expected. I will fix this today.

Ciao, Mike


re: ActiveX

From: Steffen Binas [steffen.binas@a...]
Date: Sun May 6, 2001 2:16 pm
Subject: RE: [VirtualTreeview] ActiveX

At 15:22 06.05.2001, you wrote:
> > This OCX work good in my IE 5.01 in W2K
>
>Excellent! Thank you for feedback.
IE 5.5 in W2K also works fine with your OCX...

 | Replies | Author | Date
1625 | Re: ActiveX | Mike Lischke | Sun 5/6/2001
1634 | Re: ActiveX | Geoffrey Pan | Mon 5/7/2001


VET 1.1.1, again

From: Jim Kueneman [jimdk@m...]
Date: Sun May 6, 2001 2:37 pm
Subject: VET 1.1.1, again

Sorry, one more bug fix. Compressed color did not work in 1.1 I moved
the colors to a separate class so there will be some errors when streaming
an older version VET. Sorry for the change but I think it is more
consistance with VT. I also published some more VT properties that are useful.

Jim

 | Replies | Author | Date
1630 | Re: VET 1.1.1, again | [adembaba@e...] | Sun 5/6/2001
1631 | Re: VET 1.1.1, again | Jim Kueneman | Sun 5/6/2001
1659 | Re: VET 1.1.1, again | [adembaba@e...] | Mon 5/7/2001
1676 | Re: VET 1.1.1, again | Jim Kueneman | Tue 5/8/2001
1679 | Re: VET 1.1.1, again | [tias@m...] | Tue 5/8/2001
1684 | Re: VET 1.1.1, again | Jim Kueneman | Tue 5/8/2001
1713 | Re: VET 1.1.1, again | [tias@m...] | Wed 5/9/2001
1715 | Re: VET 1.1.1, again | Jim Kueneman | Wed 5/9/2001


Selecting multiple cells in GridMode

From: "Franc v/d Westelaken" [F.vdwestelaken@c...]
Date: Sun May 6, 2001 2:37 pm
Subject: Selecting multiple cells in GridMode

Hi,

when working in grid mode will there be an option to select multiple cells
on the same row instead of only the leftmost cell when multiselect is
enabled ? Or is that option already there and am I missing something ?

Regards,
Franc.

[Non-text portions of this message have been removed]

 | Replies | Author | Date
1626 | Re: Selecting multiple cells in GridMode | Mike Lischke | Sun 5/6/2001


re: ActiveX

From: "Mike Lischke" [public@l...]
Date: Sun May 6, 2001 3:45 pm
Subject: RE: [VirtualTreeview] ActiveX

> > > This OCX work good in my IE 5.01 in W2K
> >
> >Excellent! Thank you for feedback.
> IE 5.5 in W2K also works fine with your OCX...

:o] Thanks and I have already checked it with IE 6.0b on W2K. Btw: is everybody
only working on W2K?
I mean, $150 for the professional version is not much to pay for such a good
system, so it could
well be...

Ciao, Mike

 | Replies | Author | Date
1634 | Re: ActiveX | Geoffrey Pan | Mon 5/7/2001


re: Selecting multiple cells in GridMode

From: "Mike Lischke" [public@l...]
Date: Sun May 6, 2001 3:51 pm
Subject: RE: [VirtualTreeview] Selecting multiple cells in GridMode

Franc,

> when working in grid mode will there be an option to select multiple cells
> on the same row instead of only the leftmost cell when multiselect is
> enabled ? Or is that option already there and am I missing something ?

I have waited for this question already for a long time. I knew somebody would
ask it one day ;-)
Actually, in order to select several columns of one node you would have to
store the selected
columns in the node, which would increase the node data size (although there is
still this 16 bit
wide dummy member to align fields, which can be used to indicate at least the
first 16 columns).
Additionally, there would quickly appear requests to allow block selection and
draw selection which
add significant implementation effort. Clearly, VT is no full grid control.

Ciao, Mike


re: Use Hints and Popups in the same Tree

From: "Moritz Franckenstein" [franckenstein@a...]
Date: Sun May 6, 2001 4:43 pm
Subject: Re: Use Hints and Popups in the same Tree

> However the users of your application could get a bit irritated when
> the hint mode changes fequently, have you thought about this?

no, in my case the hint mode would not change, i only wanted to have
different hint modes on different columns. the first colum should
have a dynamically generated hint, and the other colums should
display popups, when they are too small to display the full text.

now i can only use hints for both but have to determine the full text
an if it is already fully displayed, what the popup would do
automatically. and i dont know how to it manually.

-moritz


ckFlat boxes transparent

From: Werner Lehmann [wl@b...]
Date: Sun May 6, 2001 5:59 pm
Subject: ckFlat boxes transparent

Mike,

with the new ckFlat style you forgot to make the interior of the
first two items of each type in the bmp resource white. They are
transparent now and hard to see for selected nodes.

Furthermore, I like the idea to provide flat check boxes but the
thick black border is very dominating IMO. I have uploaded an
alternative with slightly modified checkboxes and radio buttons.
(the drop down button style is unchanged apart from a white interior
for the first item, I could not come up with something else and
satisfying enough). The 'new' flat style is based on the design
which is used in Maik Porkert's flatstyle components BTW.

Maybe I can convince you to use these ones instead? Or add another
ckLightFlat (vs. ckDarkFlat) style? I must admit that this would
not fit very well into the previous Light/Dark Tick/Check pattern
but the same is true for ckFlat which does not provide 'ticks'.

Regards,
Werner

 | Replies | Author | Date
1639 | Re: ckFlat boxes transparent | Mike Lischke | Mon 5/7/2001
1645 | Re: ckFlat boxes transparent | Werner Lehmann | Mon 5/7/2001
1646 | Re: ckFlat boxes transparent | Mike Lischke | Mon 5/7/2001


New file uploaded to VirtualTreeview

From: [VirtualTreeview@yahoogroups.com>
Date: Sun May 6, 2001 6:02 pm
Subject: New file uploaded to VirtualTreeview

Hello,

This email message is a notification to let you know that
a file has been uploaded to the Files area of the VirtualTreeview
group.

File : /VirtualTrees_Resource.zip
Uploaded by : [wl@b...]
Description : Resource file virtualtrees.res with modified ckFlat check
imagekind.

You can access this file at the URL

http://groups.yahoo.com/group/VirtualTreeview/files/VirtualTrees_Resource.zip

To learn more about file sharing for your group, please visit

http://help.yahoo.com/help/us/groups/files

Regards,

wl@b...]


re: VET 1.1.1, again

From: [adembaba@e...]
Date: Sun May 6, 2001 7:40 pm
Subject: Re: VET 1.1.1, again

Jim,

I use a somewhat weird screen settings, and your VET demo
has problems with Anchor properties for TBevels. So, I
modified the demo sources to use TGroupBoxes which are
far better. Could I send you demo sources.

Cheers,

--- In [VirtualTreeview@y...], Jim Kueneman [jimdk@m...] wrote:
>
> Sorry, one more bug fix. Compressed color did not work in 1.1 I
moved
> the colors to a separate class so there will be some errors when
streaming
> an older version VET. Sorry for the change but I think it is more
> consistance with VT. I also published some more VT properties that
are useful.
>
> Jim

 | Replies | Author | Date
1631 | Re: VET 1.1.1, again | Jim Kueneman | Sun 5/6/2001
1659 | Re: VET 1.1.1, again | [adembaba@e...] | Mon 5/7/2001
1676 | Re: VET 1.1.1, again | Jim Kueneman | Tue 5/8/2001
1679 | Re: VET 1.1.1, again | [tias@m...] | Tue 5/8/2001
1684 | Re: VET 1.1.1, again | Jim Kueneman | Tue 5/8/2001
1713 | Re: VET 1.1.1, again | [tias@m...] | Wed 5/9/2001
1715 | Re: VET 1.1.1, again | Jim Kueneman | Wed 5/9/2001


re: Re: VET 1.1.1, again

From: Jim Kueneman [jimdk@m...]
Date: Sun May 6, 2001 9:21 pm
Subject: Re: [VirtualTreeview] Re: VET 1.1.1, again

At 07:40 PM 5/6/2001 +0000, you wrote:
>Jim,
>
>I use a somewhat weird screen settings, and your VET demo
>has problems with Anchor properties for TBevels. So, I
>modified the demo sources to use TGroupBoxes which are
>far better. Could I send you demo sources.

Sure, send away.

Jim
[jimdk@m...]

 | Replies | Author | Date
1659 | Re: VET 1.1.1, again | [adembaba@e...] | Mon 5/7/2001
1676 | Re: VET 1.1.1, again | Jim Kueneman | Tue 5/8/2001
1679 | Re: VET 1.1.1, again | [tias@m...] | Tue 5/8/2001
1684 | Re: VET 1.1.1, again | Jim Kueneman | Tue 5/8/2001
1713 | Re: VET 1.1.1, again | [tias@m...] | Wed 5/9/2001
1715 | Re: VET 1.1.1, again | Jim Kueneman | Wed 5/9/2001


re: ActiveX

From: "Paul Istrate" [istech@c...]
Date: Sun May 6, 2001 9:20 pm
Subject: Re: [VirtualTreeview] ActiveX

Hi Mike,

No feedback about OCX, but about W2K. I have'nt it.

I use W98.

Paul Istrate

----- Original Message -----
From: Mike Lischke [public@l...]
To: <VirtualTreeview@yahoogroups.com>
Sent: Sunday, May 06, 2001 6:45 PM
Subject: RE: [VirtualTreeview] ActiveX

> > > > This OCX work good in my IE 5.01 in W2K
> > >
> > >Excellent! Thank you for feedback.
> > IE 5.5 in W2K also works fine with your OCX...
>
> :o] Thanks and I have already checked it with IE 6.0b on W2K. Btw: is
everybody only working on W2K?
> I mean, $150 for the professional version is not much to pay for such a
good system, so it could
> well be...
>
> Ciao, Mike
>
>
> To unsubscribe from this group, send an email to:
> VirtualTreeview-unsubscribe@egroups.com
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>


Filling Property Sheets

From: Kim Bracknell [kbracknell@f...]
Date: Sun May 6, 2001 11:46 pm
Subject: Filling Property Sheets

Hi Mike,
The "Advanced" VT example shows a property sheet. Values here are hard
coded. I was wondering if yourself or other VT experts may have a sample
that enumerates property sheet values from an existing OLE document, either
by directly reading values or via drag/drop?
TIA,
Kim.

 | Replies | Author | Date
1640 | Re: Filling Property Sheets | Mike Lischke | Mon 5/7/2001
1643 | Re: Filling Property Sheets | Kim Bracknell | Mon 5/7/2001


re: ActiveX

From: "Geoffrey Pan" [gpan@c...]
Date: Mon May 7, 2001 1:58 am
Subject: RE: [VirtualTreeview] ActiveX

WinXP here :)

-----Original Message-----
From: Mike Lischke [mailto:[public@l...]]
Sent: Sunday, May 06, 2001 10:46 AM
To: VirtualTreeview@yahoogroups.com
Subject: RE: [VirtualTreeview] ActiveX

> > > This OCX work good in my IE 5.01 in W2K
> >
> >Excellent! Thank you for feedback.
> IE 5.5 in W2K also works fine with your OCX...

:o] Thanks and I have already checked it with IE 6.0b on W2K. Btw: is
everybody only working on W2K?
I mean, $150 for the professional version is not much to pay for such a good
system, so it could
well be...

Ciao, Mike

To unsubscribe from this group, send an email to:
VirtualTreeview-unsubscribe@egroups.com

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/


VET 1.1(.1) & BCB5 doesn't compile.

From: [tias@m...]
Date: Mon May 7, 2001 2:55 am
Subject: VET 1.1(.1) & BCB5 doesn't compile.

Hello there !

What happened in ShellUtilites.pas ?
BCB5 keeps giving me the error
"[Pascal Error] ShellUtilities.pas/2809): Unsupported language
feature: 'import of DLL symbol by ordinal'.

The help on this error doesn't clarify much (at least not for me) :
"You are attempting to translate a Pascal unit to a C++ header file
which contains unsupported language features.

You must remove the offending construct from the interface section
before the unit can be translated."

Any ideas, anyone ?

BTW: VirtualExplorerTree.pas compiles just fine.

TIA,
Mathias Thorell


VET 1.0b & BCB5 doesn't compile

From: [tias@m...]
Date: Mon May 7, 2001 2:46 am
Subject: VET 1.0b & BCB5 doesn't compile

Hi there !

What happened with ShellUtilities.pas in VET 1.0b ?
BCB5 can't auto generate the .hpp-file, I just keep get this message
on the last row of the ShellUtilities.pas file :
[Pascal Error] ShellUtilities.pas(2808): Unsupported language feature:
'import of DLL symbol by ordinal'. :--(

The help for this error doesn't clarify much either;
"You are attempting to translate a Pascal unit to a C++ header file
which contains unsupported language features.

You must remove the offending construct from the interface section
before the unit can be translated."

Any ideas, anyone ?

(BTW: VirtualExplorerTree.pas compiles just fine ;-)

TIA,
Mathias Thorell

 | Replies | Author | Date
1637 | Re: VET 1.0b & BCB5 doesn't compile | Jim Kueneman | Mon 5/7/2001
1651 | Re: VET 1.0b & BCB5 doesn't compile | [tias@m...] | Mon 5/7/2001
1652 | Re: VET 1.0b & BCB5 doesn't compile | [tias@m...] | Mon 5/7/2001
1653 | Re: VET 1.0b & BCB5 doesn't compile | [tias@m...] | Mon 5/7/2001
1654 | Re: VET 1.0b & BCB5 doesn't compile | Mike Lischke | Mon 5/7/2001
1657 | Re: VET 1.0b & BCB5 doesn't compile | [tias@m...] | Mon 5/7/2001


re: VET 1.0b & BCB5 doesn't compile

From: Jim Kueneman [jimdk@m...]
Date: Mon May 7, 2001 3:35 am
Subject: Re: [VirtualTreeview] VET 1.0b & BCB5 doesn't compile

At 02:46 AM 5/7/2001 +0000, you wrote:
>Hi there !
>
>What happened with ShellUtilities.pas in VET 1.0b ?
>BCB5 can't auto generate the .hpp-file, I just keep get this message
>on the last row of the ShellUtilities.pas file :
>[Pascal Error] ShellUtilities.pas(2808): Unsupported language feature:
>'import of DLL symbol by ordinal'. :--(

My guess is the following but I have NO idea how to do this in C but look
for the lines

interface
....
function ILIsParent(PIDL1: PItemIDList; PIDL2: PItemIDList;
ImmediateParent: LongBool): LongBool; stdcall;
function ILIsEqual(PIDL1: PItemIDList; PIDL2: PItemIDList): LongBool; stdcall;
....

implementation

....
function ILIsEqual; external Shell32 Index 21;
function ILIsParent; external Shell32 Index 23;

This allows Delphi to statically link to the undocumented functions
automaticlly during program startup. My guess you will have to link
dynamically like I did with FileIconInit.

I have changed the latest version of ShellUtilities to do that. I am
uploading it to the files area.

Jim

 | Replies | Author | Date
1651 | Re: VET 1.0b & BCB5 doesn't compile | [tias@m...] | Mon 5/7/2001
1652 | Re: VET 1.0b & BCB5 doesn't compile | [tias@m...] | Mon 5/7/2001
1653 | Re: VET 1.0b & BCB5 doesn't compile | [tias@m...] | Mon 5/7/2001


re: Re: DoPaintText

From: "Radoslaw Klocek" [radekk@p...]
Date: Mon May 7, 2001 6:16 am
Subject: Re: [VirtualTreeview] Re: DoPaintText

----- Original Message -----
From: "Mike Lischke" [public@l...]
To: "Virtual Treeview mailing list (E-Mail)"
<VirtualTreeview@yahoogroups.com>
Sent: Friday, April 27, 2001 3:44 PM
Subject: [VirtualTreeview] Re: DoPaintText

> ... moved here from private mail...
>
> > > if Tree is TCustomVirtualStringTree then
> > > with TVirtualStringTree(Tree) do
> > > DoPaintText(Node, Self.Canvas, Column, ttNormal);
> > >
> > > to use DoPaintText only if the tree is a string tree. I
> > cannot use "as"
> > here
> > > because this will throw an exception if the tree is not a
> > string tree. And
> > > simply casting the tree is also not a good option because
> > when you derive
> > a
> > > tree from the base tree then it does not have the
> > DoPaintText method and
> > > this method should therefore also not be called.
> > >
> >
> > As you wrote, there is a check and DoPaintNode won't be
> > called for trees
> > other then TCustomVirtualStringTree or its descsendants...
> > and they will
> > always have DoPaintNode as TCustomVirtualStringTree does.
> > Maybe I don't understand something...
>
>
> Do you mean to use both, the check if it is a string tree (descentant)
*and*
> the as operator? But then "as" would be unnecessary because the check has
> already been made.
>

Sorry, I was off-line for last week.
That's OK. I just wonder, why do you check for TCustomVirtualStringTree and
then you cast to TVirtualStringTree.

--
Radoslaw Klocek

 | Replies | Author | Date
1641 | Re: DoPaintText | Mike Lischke | Mon 5/7/2001


re: ckFlat boxes transparent

From: "Mike Lischke" [public@l...]
Date: Mon May 7, 2001 7:19 am
Subject: RE: [VirtualTreeview] ckFlat boxes transparent

Hi Werner,

> with the new ckFlat style you forgot to make the interior of the
> first two items of each type in the bmp resource white. They are
> transparent now and hard to see for selected nodes.

Ah yes, it look so well with a bitmap background in one of the demos so I
didn't think further.

> Maybe I can convince you to use these ones instead? Or add another
> ckLightFlat (vs. ckDarkFlat) style? I must admit that this would
> not fit very well into the previous Light/Dark Tick/Check pattern
> but the same is true for ckFlat which does not provide 'ticks'.

Mmmh, not sure how to proceed. I have based the design on what you can find in
Internet Explorer and
any other option trees in Windows 2000 (e.g. for folders etc.). This is to
enable VT to be used in
similar dialogs without creating an own check image list. Btw. you can of
course always create an
own check image list (as normal image list on a form) and assign it to VT to be
used instead of the
built-in images.

Ciao, Mike


re: Filling Property Sheets

From: "Mike Lischke" [public@l...]
Date: Mon May 7, 2001 7:42 am
Subject: RE: [VirtualTreeview] Filling Property Sheets

Hi Kim,

> The "Advanced" VT example shows a property sheet. Values here are hard
> coded. I was wondering if yourself or other VT experts may have a sample
> that enumerates property sheet values from an existing OLE document, either
> by directly reading values or via drag/drop?

Sorry, but I can't help with this. Perhaps somebody else here? Or at least try
the newsgroups at
news.borland.com. There are very competent people answering your questions.

Ciao, Mike


re: Re: DoPaintText

From: "Mike Lischke" [public@l...]
Date: Mon May 7, 2001 7:44 am
Subject: RE: [VirtualTreeview] Re: DoPaintText

Hi Radoslaw,

> That's OK. I just wonder, why do you check for TCustomVirtualStringTree and
> then you cast to TVirtualStringTree.

Oops, this is a little quirk. To be entirely correct I need to cast to the same
class as I have
tested before. But since the non-custom version does not add any members or
code there is no harm as
it is now. I will change it however.

Ciao, Mike


re: autosizing columns

From: "Moritz Franckenstein" [franckenstein@a...]
Date: Mon May 7, 2001 8:09 am
Subject: Re: autosizing columns

--- In [VirtualTreeview@y...], "Mike Lischke" [public@l...] wrote:
> This is also not really better. The columns don't jump so much as
before, right, but it still happens often that a column oscillates
which looks not very good. Additionally you have neither taken the
maximum width into account nor any of the column's options, e.g.
visibility and no resize.

this was not intended to be the final solution to build into vt. it
was to demonstrate that such a feature is possible and useful. to
implement the max width and so on is only a small step.

and about the behavior of the columns: i dont know how to improve
that more. maybe a better way is not possible when the columns are
updating while dragging. there will always be rounding errors.

but i think it is looking good enough. i am using it in my project.

it would be nice if someone could try my implementation (for example
in VET) and maybe improve it...

-moritz

 | Replies | Author | Date
1647 | Re: autosizing columns | Jim Kueneman | Mon 5/7/2001


re: Filling Property Sheets

From: Kim Bracknell [kbracknell@f...]
Date: Mon May 7, 2001 8:10 am
Subject: RE: [VirtualTreeview] Filling Property Sheets

Thanks Mike - I'll try there.

-----Original Message-----
From: Mike Lischke [mailto:[public@l...]]
Sent: Monday, 7 May 2001 3:43 PM
To: VirtualTreeview@yahoogroups.com
Subject: RE: [VirtualTreeview] Filling Property Sheets

Hi Kim,

> The "Advanced" VT example shows a property sheet. Values here are hard
> coded. I was wondering if yourself or other VT experts may have a sample
> that enumerates property sheet values from an existing OLE document,
either
> by directly reading values or via drag/drop?

Sorry, but I can't help with this. Perhaps somebody else here? Or at least
try the newsgroups at
news.borland.com. There are very competent people answering your questions.

Ciao, Mike

To unsubscribe from this group, send an email to:
VirtualTreeview-unsubscribe@egroups.com

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/


re: Do an editor with code folding using VT

From: "Roland" [Beduerftig@S...]
Date: Mon May 7, 2001 8:20 am
Subject: Re: Do an editor with code folding using VT

Hi Werner,

> I understand that this is not very friendly to new users of the
> components. But lets keep in mind that these users are developers
> in the first place. They should be able to figure some things out.
> And those very basic starting problems have been addressed quite
> nicely in Johns current faq which is part of the help file.

I think the idea of FAQ is a good first step for new users of the
component, because in a FAQ he can find very fast the important
information to use VT, for example our problem "How I can use an
owneditor under BCB5 ?".
When John include this question in FAQ, the new user can find the
answer with a demoprogram and can work quickly.
The other way to find the answer of this question in this newsgroup
is a more complex work.

with best regards
Roland


re: ckFlat boxes transparent

From: Werner Lehmann [wl@b...]
Date: Mon May 7, 2001 9:54 am
Subject: Re: [VirtualTreeview] ckFlat boxes transparent

Mike Lischke wrote:
>
> > Maybe I can convince you to use these ones instead? Or add another
> > ckLightFlat (vs. ckDarkFlat) style? I must admit that this would
> > not fit very well into the previous Light/Dark Tick/Check pattern
> > but the same is true for ckFlat which does not provide 'ticks'.
>
> Mmmh, not sure how to proceed. I have based the design on what you can find
in Internet Explorer and
> any other option trees in Windows 2000 (e.g. for folders etc.). This is to
enable VT to be used in

Yes, I figured so. These images (to be seen in checklistbox as well) always
seemed to be 'too dark'
to me.

> similar dialogs without creating an own check image list. Btw. you can of
course always create an
> own check image list (as normal image list on a form) and assign it to VT to
be used instead of the
> built-in images.

I knew that but it was worth a question. I have no problem if you want to keep
the current ckFlat
style :)

Werner


re: ckFlat boxes transparent

From: Mike Lischke [public@l...]
Date: Mon May 7, 2001 12:05 pm
Subject: RE: [VirtualTreeview] ckFlat boxes transparent

> I have no problem if
> you want to keep the current ckFlat style :)

Well, if I'd use different images than those of Windows I can expect once
per week someone asking why the images are different ;-).

Ciao, Mike


re: Re: autosizing columns

From: Jim Kueneman [jimdk@m...]
Date: Mon May 7, 2001 12:12 pm
Subject: Re: [VirtualTreeview] Re: autosizing columns

At 08:09 AM 5/7/2001 +0000, you wrote:
>it would be nice if someone could try my implementation (for example
>in VET) and maybe improve it...

I am sorry what are you trying to accomplish? I went back and looked at
the old posts but I am not sure what the initial suggestion was and I did
not follow this very closely.

Jim


re: Re: autosizing columns

From: Mike Lischke [public@l...]
Date: Mon May 7, 2001 12:18 pm
Subject: RE: [VirtualTreeview] Re: autosizing columns

> I am sorry what are you trying to accomplish? I went back
> and looked at
> the old posts but I am not sure what the initial suggestion
> was and I did
> not follow this very closely.

Moritz suggested a better way to column handle autosizing. The main problems
are however that the implementation gets quite complex if everything should
work correctly and I don't have the time to make this implementation ready.
Hence his question for help. Btw: there is another little problem: I don't
know what to do with the then obsolete AutoSizeIndex property of TVTHeader.
Throwing it away causes extra work to avoid to break streaming, keeping it
is meaningless. I thought about another semantic, but which?

Ciao, Mike

 | Replies | Author | Date
1649 | Re: autosizing columns | Jim Kueneman | Mon 5/7/2001


re: Re: autosizing columns

From: Jim Kueneman [jimdk@m...]
Date: Mon May 7, 2001 12:43 pm
Subject: RE: [VirtualTreeview] Re: autosizing columns

At 02:18 PM 5/7/2001 +0200, you wrote:
> > I am sorry what are you trying to accomplish? I went back
> > and looked at
> > the old posts but I am not sure what the initial suggestion
> > was and I did
> > not follow this very closely.
>
>Moritz suggested a better way to column handle autosizing. The main problems

Better than what? I am sorry but you are going to have to hand hold me to
get me upto speed <g> It may be awhile before I get a chance as I acutally
tried to use VET in something and I am having thread problems left and
right with 2 VET components in an application. The image threads run all
over VT, expecially if a node is deleted during the time its image is being
retrieved. I have made it more thread safe with critical sections but I am
getting a strange infrequent thead deadlock between the main app and the
image thread <grrrr>

>Hence his question for help. Btw: there is another little problem: I don't
>know what to do with the then obsolete AutoSizeIndex property of TVTHeader.
>Throwing it away causes extra work to avoid to break streaming, keeping it
>is meaningless. I thought about another semantic, but which?

Sorry Mike I don't even know what that property did before! <g> Plus I am
not sure how Autosizing works now, how does it work?

Jim


re: Re: autosizing columns

From: Mike Lischke [public@l...]
Date: Mon May 7, 2001 12:58 pm
Subject: RE: [VirtualTreeview] Re: autosizing columns

Jim,

> It may be awhile before I get a chance
> as I acutally tried to use VET in something and I am having thread
problems
> left and right with 2 VET components in an application. The image
> threads run all over VT, expecially if a node is deleted during the time
its
> image is being retrieved. I have made it more thread safe with critical
> sections but I am getting a strange infrequent thead deadlock between the
main
> app and the image thread <grrrr>

I have not looked deeper into your current sources but I assume the thread
looks still very similar to what I suggested, doesn't it? But in this case
you have a thread safe list which gets your icons to validate. So when you
delete a node it first tries to remove itself from this list which will
block the main thread until the image thread releases access to the thread
list (the list should of course be locked only for short time periods by any
thread).

> Sorry Mike I don't even know what that property did before!
> <g> Plus I am not sure how Autosizing works now, how does it work?

Well, if you don't need it then don't care about it. I have Moritz already
given my opinion and have still something open (regarding mixed tooltips and
hints, but have not yet decided). Just for the record: auto sizing is making
all columns exactly as wide as the client area of VT and keep this also when
resizing the tree or any column.

Ciao, Mike

 | Replies | Author | Date
1655 | Re: autosizing columns | Jim Kueneman | Mon 5/7/2001


re: VET 1.0b & BCB5 doesn't compile

From: [tias@m...]
Date: Mon May 7, 2001 1:43 pm
Subject: Re: VET 1.0b & BCB5 doesn't compile

--- In [VirtualTreeview@y...], Jim Kueneman [jimdk@m...] wrote:
> My guess is the following but I have NO idea how to do this in C but
look
> for the lines
>
> interface
> ....
> function ILIsParent(PIDL1: PItemIDList; PIDL2: PItemIDList;
> ImmediateParent: LongBool): LongBool; stdcall;
> function ILIsEqual(PIDL1: PItemIDList; PIDL2: PItemIDList):
LongBool; stdcall;
> ....
>
> implementation
>
> ....
> function ILIsEqual; external Shell32 Index 21;
> function ILIsParent; external Shell32 Index 23;
>
> This allows Delphi to statically link to the undocumented functions
> automaticlly during program startup. My guess you will have to link
> dynamically like I did with FileIconInit.
>
> I have changed the latest version of ShellUtilities to do that. I
am
> uploading it to the files area.

Sadly it din't work, I get the same error. But I'm going to try to
implement it as dynamically instead if statically.... I'll tell you
more soon.

Hasta Luego !

/Mathias Thorell

 | Replies | Author | Date
1652 | Re: VET 1.0b & BCB5 doesn't compile | [tias@m...] | Mon 5/7/2001
1653 | Re: VET 1.0b & BCB5 doesn't compile | [tias@m...] | Mon 5/7/2001


re: VET 1.0b & BCB5 doesn't compile

From: [tias@m...]
Date: Mon May 7, 2001 1:58 pm
Subject: Re: VET 1.0b & BCB5 doesn't compile

--- In [VirtualTreeview@y...], [tias@m...] wrote:
> Sadly it din't work, I get the same error. But I'm going to try to
> implement it as dynamically instead if statically.... I'll tell you
> more soon.

Oops... Sorry ! ShellUtilites.pas works fine, now I get the errors in
VirtualExplorerTree.pas (on SHChangeNotifyRegister &
SHChangeNotifyDeRegister). Strange since it compiled yesterday (or
maybe I was too tired when I looked at it...)
Anyway, I'm trying to do the same, dynamic, shell32-linking in
VirtualExplorerTree.pas as well (have to practice more in Pascal, I
think...)

/Mathias

 | Replies | Author | Date
1653 | Re: VET 1.0b & BCB5 doesn't compile | [tias@m...] | Mon 5/7/2001


re: VET 1.0b & BCB5 doesn't compile

From: [tias@m...]
Date: Mon May 7, 2001 2:21 pm
Subject: Re: VET 1.0b & BCB5 doesn't compile

--- In [VirtualTreeview@y...], [tias@m...] wrote:
<snip>
> Anyway, I'm trying to do the same, dynamic, shell32-linking in
> VirtualExplorerTree.pas as well (have to practice more in Pascal, I
> think...)

Ok. Now it's working, so if you have time, change
VirtualExplorerTree.pas so it's linking dynamically to
SHChangeNotifyRegister and SHChangeNotifyDeRegister.

Now I only get "the usual" errors in the auto-generated
ShellUtilities.hpp when I'm trying to use VirtualExplorerTree in a C++
application (I posted this about 2-3 weeks ago) :
In the declaration of TNamespace, the following types are completly
unknown to BCB5;
_di_IDropTarget
_di_IQueryInfo
_di_IContextMenu3
It works perfectly if I comment out all references/declarations to
these types plus the declarations of IEIFLAG_* and CSIDL_*. These
static const declarations generates a "E2040 Declaration terminated
incorrectly" error, usually due to that these are declared somewhere
else in another .h/.hpp-file...

Also, TNamespace is referenced in ShellUtilities.hpp before its
declarated;

typedef DynamicArray<TNamespace* > TNamespaceArray;

class DELPHICLASS TNamespace;

If I swap the order of these two lines, everyting is ok.

Thanks for the help anyway !

/Mathias T.


re: Re: VET 1.0b & BCB5 doesn't compile

From: Mike Lischke [public@l...]
Date: Mon May 7, 2001 2:41 pm
Subject: RE: [VirtualTreeview] Re: VET 1.0b & BCB5 doesn't compile

> In the declaration of TNamespace, the following types are completly
> unknown to BCB5;
> _di_IDropTarget
> _di_IQueryInfo
> _di_IContextMenu3
> It works perfectly if I comment out all references/declarations to
> these types plus the declarations of IEIFLAG_* and CSIDL_*.

Perhaps Jim has to include in VET the same statement as I do in VT:

{$HPPEMIT '#include <objidl.h>'}

Ciao, Mike

 | Replies | Author | Date
1657 | Re: VET 1.0b & BCB5 doesn't compile | [tias@m...] | Mon 5/7/2001


re: autosizing columns

From: "Jim Kueneman" [jimdk@m...]
Date: Mon May 7, 2001 3:16 pm
Subject: Re: autosizing columns

--- In [VirtualTreeview@y...], Mike Lischke [public@l...] wrote:
> Jim,
> I have not looked deeper into your current sources but I assume the
thread
> looks still very similar to what I suggested, doesn't it? But in
this case

Yes.

> you have a thread safe list which gets your icons to validate. So
when you
> delete a node it first tries to remove itself from this list which
will
> block the main thread until the image thread releases access to the
thread
> list (the list should of course be locked only for short time
periods by any
> thread).

The problem was I was trying to syncronize the two VETs so it was
possible to quickly change focus on one with the keyboard and force
the other to change before it finished clearing the icon list. The
problems occured here:

{ the node has been removed from the list but in the meantime VT has }
{ deleted or is in the process of deleting the nodes! }
{ Usually the InvalidateNode threw an AV because the node had been }
{ freed. }
if not Terminated and Assigned(Node) then
try
if FTree.ValidateNamespace(Node, Data) then
Data.GetIconIndex(False, icSmall);
if not Terminated then
FTree.InvalidateNode(Node);

So what I did was wrap all access to VT in the thread with critical
sections plus any node deletions in VT which signaled the thread that
a node (or nodes) are being deleted. That way before the thread
acutally accesses the node after it takes control through the critical
section so VT can't delete it out from under it then checks to see if
the node is flaged for deletion before invalidating it. The mysterous
locks were because I was calling BeginUpdate/Endupdate inside the
thread around InvalidateNode. Somehow within this block of locked
code VT was calling Clear which also has a critical section so it can
flag the thread it is about to clear all the nodes. Hence the deadlock
By removing the BeginUpdate/Endupdate the locks vanished and so did
the AV's but every so often the image is not redrawn in the tree and
it stays the default icon until a repaint. Maybe I should call Update
after InvalidateNode to force a WM_PAINT message. If I remember right
WM_PAINTs don't accumulate. If there is one in the queue it does not
post another so it should minimize the number of times VT has to paint
itself. Make sense?

Jim


GDI crash problem on W95 and "ShortenString"

From: Björn Lindell [bli@c...]
Date: Mon May 7, 2001 3:29 pm
Subject: GDI crash problem on W95 and "ShortenString"

Problem occured with 2.4.3B (dloaded 2001-05-07)

On my Win95B-machine I sometimes get very reproducible
crashes. It doesn't happen on a freshly booted machine,
my guess it is after some resource consumption has been
going on. What happens is if I try to size a column,
by dragging a header, the application will totally crash
(to a Close/Ignore dialog). Only option is choosing Close,
then it will tell me of some segment error in GDI.EXE
(with no chance for debug or exception handling in delphi)

Whereas I am used to expecting applications to have problems
when resources are low, it doesn't seem that any special resource
would be dramatically low in this situation, but still it makes me
wonder since it is only after some uptime the error will occur.
I also have no problem running other apps after the error,
or for that matter relaunching the problematic app.

What i noticed was that the error occured when the column size
was beeing shrinked so much that only the "..." remained. So
I looked in "virtualtrees.pas" and found the function "ShortenString"
Now, if i put

Result := s;
exit;

at the top of this function, the error never occurs (although of
course I don't get the string shortening either).
I also tried by putting
Result := s;
at the very bottom of the function, to see if it was something
in the actual function or if it was the result of the function that was
the problem. It turned out the error occured each time for this as well,
so it definitely seems to have something with the function itself to do.

I looked a bit on the web and found some reports on W95 +
GetTextExtentPoint32W
related problems, but none that matched exactly (supposedly it can crash
if a string containing B7 is passed, but this seems not to be the case in my
situation).

The next time the error occurs (after some normal uptime i suppose, I will
try
substituting for the "A" version APIs in this case and see if it makes a
difference)


re: VET 1.0b & BCB5 doesn't compile

From: [tias@m...]
Date: Mon May 7, 2001 4:07 pm
Subject: Re: VET 1.0b & BCB5 doesn't compile

--- In [VirtualTreeview@y...], Mike Lischke [public@l...] wrote:
> > In the declaration of TNamespace, the following types are
completly
> > unknown to BCB5;
> > _di_IDropTarget
> > _di_IQueryInfo
> > _di_IContextMenu3
> > It works perfectly if I comment out all references/declarations to
> > these types plus the declarations of IEIFLAG_* and CSIDL_*.
>
> Perhaps Jim has to include in VET the same statement as I do in VT:
>
> {$HPPEMIT '#include <objidl.h>'}

Tried that and sadly, it doesn't fix the problem. Same errors apperas
:-(

/Mathias T.


R: Gratulations and an attempt of contribution from a newbie

From: "Dean Zobec" [dezobec@t...]
Date: Mon May 7, 2001 6:23 pm
Subject: R: [VirtualTreeview] Gratulations and an attempt of contribution from a newbie

Hi Mike,
as you suggested I downloaded today the version 2.4.3 beta from the file
area but I'm afraid the problem still persists with this version. I was able
to reproduce the error in a simple case: in the demo Minimal I added two
columns in the header, setting in header options hoVisible to true. When
running the program on my NT Workstation 4.0 machine with Memproof I saw
that the timers allocated in
SetTimer(Treeview.Handle, HeaderTimer, 50, nil)
when moving the mouse from one header column to the other get never
deallocated. This occurs only when moving the mouse from one header column
to another: when you move the mouse from one header column to another area
the newly set timer gets properly deallocated.
Could this have any connection with the problem reported today by Björn
Lindell ?
I'll try to go into details but when it comes to programming at the windows
api level my experiences are few. Hope this report can still be useful.
Thank you again.
Dean Zobec

----- Original Message -----

> > Just in case it could be useful, I report you a possible small error:
> > When debugging with Memproof a program of mine which uses a
> > VirtualStringTree with columns I've
> > found a non deallocated timer. The row that allocates the
> > timer is this:
> > SetTimer(Treeview.Handle, HeaderTimer, 50, nil);
>
> Yep, thank you. This was a bug I removed a couple of weeks ago. I don't
> remember which version of VT it was. Please try the beta available in the
> file area of this mailing list. So far there were no bug reports with
this
> version and I'm quite confident it is stable.

 | Replies | Author | Date
1691 | R: [VirtualTreeview] Gratulations and an attempt | Dean Zobec | Tue 5/8/2001


re: VET 1.1.1, again

From: [adembaba@e...]
Date: Mon May 7, 2001 6:43 pm
Subject: Re: VET 1.1.1, again

Jim,

It is not possible to send attachments using this group's
email util, so I had to put it in the files area.

Let me know when you get a copy so that I can
delete it from there.

Cheers,

> >I use a somewhat weird screen settings, and your VET demo
> >has problems with Anchor properties for TBevels. So, I
> >modified the demo sources to use TGroupBoxes which are
> >far better. Could I send you demo sources.
>
>
> Sure, send away.

 | Replies | Author | Date
1676 | Re: VET 1.1.1, again | Jim Kueneman | Tue 5/8/2001
1679 | Re: VET 1.1.1, again | [tias@m...] | Tue 5/8/2001
1684 | Re: VET 1.1.1, again | Jim Kueneman | Tue 5/8/2001
1713 | Re: VET 1.1.1, again | [tias@m...] | Wed 5/9/2001
1715 | Re: VET 1.1.1, again | Jim Kueneman | Wed 5/9/2001


[no subject]

From: [F.vdwestelaken@c...]
Date: Tue May 8, 2001 7:34 am
Subject:

May 2001 12:42:42 +0200
To: [VirtualTreeview@yahoogroups.com>
Message-ID: [MMEBIEFEHHOLNALGMHDOKEALDKAA.F.vdWestelaken@c...]
X-Priority: 3 (Normal)
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2911.0)
Importance: Normal
In-Reply-To: [NABBLOKFMDBHOGNKKJHEOEFDCMAA.public@l...]
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2462.0000
From: "Franc v/d Westelaken" <F.vdwestelaken@c...]
MIME-Version: 1.0
Mailing-List: list VirtualTreeview@yahoogroups.com; contact
VirtualTreeview-owner@yahoogroups.com
Delivered-To: mailing list VirtualTreeview@yahoogroups.com
Precedence: bulk
List-Unsubscribe: <mailto:VirtualTreeview-unsubscribe@yahoogroups.com>
Date: Sun, 6 May 2001 12:39:54 +0200
Reply-To: VirtualTreeview@yahoogroups.com
Subject: RE: [VirtualTreeview] Grid mode
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
X-UIDL: 809
Status: U

Hi Mike,

I downloaded your latest beta version and the naviagtion keys 'home' and
'end' are working, but the CTRL-Home and CTRL-end has some strange effects.

I have one suggestion though. Perhaps it's more obvious to users when
VTreeView uses the same navigation keys as a standard TStringGrid ? Thus:

- 'Home' and 'CTRL-<left arow>' moves to the left most cell on the current
row
- 'End' and 'CTRL-<right arrow>' moves to the right most cell on the current
row
- CTRL-HOME moves to the upperleft cell of the grid
- CTRL-END moves to the bottomright cell of the grid

Regards Franc.

> Good idea. Actually, the move must be restricted to the visible and
> focusable columns,which makes the task a bit more difficult. But I have
> already solved a very similar problem for TAB handling, so it took only a
> couple of minutes to write and test.

[Non-text portions of this message have been removed]

To unsubscribe from this group, send an email to:
VirtualTreeview-unsubscribe@egroups.com

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/


[no subject]

From: [F.vdwestelaken@c...]
Date: Tue May 8, 2001 7:34 am
Subject:

ay 2001 16:32:01 +0200
To: [VirtualTreeview@yahoogroups.com>
Message-ID: [MMEBIEFEHHOLNALGMHDOMEAMDKAA.F.vdWestelaken@c...]
X-Priority: 3 (Normal)
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2911.0)
Importance: Normal
In-Reply-To: [NABBLOKFMDBHOGNKKJHEIEFOCMAA.public@l...]
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2462.0000
From: "Franc v/d Westelaken" <F.vdwestelaken@c...]
MIME-Version: 1.0
Mailing-List: list VirtualTreeview@yahoogroups.com; contact
VirtualTreeview-owner@yahoogroups.com
Delivered-To: mailing list VirtualTreeview@yahoogroups.com
Precedence: bulk
List-Unsubscribe: <mailto:VirtualTreeview-unsubscribe@yahoogroups.com>
Date: Sun, 6 May 2001 16:37:14 +0200
Reply-To: VirtualTreeview@yahoogroups.com
Subject: [VirtualTreeview] Selecting multiple cells in GridMode
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
X-UIDL: 815
Status: U

Hi,

when working in grid mode will there be an option to select multiple cells
on the same row instead of only the leftmost cell when multiselect is
enabled ? Or is that option already there and am I missing something ?

Regards,
Franc.

[Non-text portions of this message have been removed]

To unsubscribe from this group, send an email to:
VirtualTreeview-unsubscribe@egroups.com

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/


incremental search

From: [basil@r...]
Date: Tue May 8, 2001 5:25 am
Subject: incremental search

Hi, Mike.

Is there any way to do incremental search in a column?

Thanks.
Basil.

 | Replies | Author | Date
1685 | Re: incremental search | Mike Lischke | Tue 5/8/2001
1722 | incremental search | [basil@r...] | Thu 5/10/2001
1730 | Re: incremental search | Mike Lischke | Thu 5/10/2001


New file uploaded to VirtualTreeview

From: [VirtualTreeview@yahoogroups.com>
Date: Tue May 8, 2001 9:10 am
Subject: New file uploaded to VirtualTreeview

Hello,

This email message is a notification to let you know that
a file has been uploaded to the Files area of the VirtualTreeview
group.

File : /VirtualTree 2.4.5 ß.zip
Uploaded by : [public@l...]
Description :

You can access this file at the URL

http://groups.yahoo.com/group/VirtualTreeview/files/VirtualTree%202.4.5%20%80%A0\
%A0%DF.zip

To learn more about file sharing for your group, please visit

http://help.yahoo.com/help/us/groups/files

Regards,

public@l...]


re: Re: Use Hints and Popups in the same Tree

From: Mike Lischke [public@l...]
Date: Tue May 8, 2001 8:42 am
Subject: RE: [VirtualTreeview] Re: Use Hints and Popups in the same Tree

Moritz,

> no, in my case the hint mode would not change, i only wanted to have
> different hint modes on different columns. the first colum should
> have a dynamically generated hint, and the other colums should
> display popups, when they are too small to display the full text.

I like your idea of having a column based hint mode. This requires however
to introduce a new class member, which will again change the stream format.
But together with your resizing code (and the connect removal of
AutoSizeIndex) it nearly justifies to take the effort and implement
everything needed for a new stream format.

The only thing I would like to have before, however, is working auto
resizing code based on your idea.

Ciao, Mike

 | Replies | Author | Date
1677 | Re: Use Hints and Popups in the same Tree | Moritz Franckenstein | Tue 5/8/2001


re: Gratulations and an attempt of contribution from a newbie

From: Mike Lischke [public@l...]
Date: Tue May 8, 2001 9:07 am
Subject: RE: [VirtualTreeview] Gratulations and an attempt of contribution from a newbie

Hi Dean,

> as you suggested I downloaded today the version 2.4.3 beta
> from the file area but I'm afraid the problem still persists with this
> version. This occurs only when moving the mouse from one
> header column to another: when you move the mouse from one header column
to
> another area the newly set timer gets properly deallocated.

Okay, I just uploaded a new version of VT to YG with an additional KillTimer
call for the case when going from one column to another. I was under the
impression that there is no need to call KillTimer if you use the same timer
in a new call to SetTimer. Anyway, try it out.

Ciao, Mike


re: Re: autosizing columns

From: Mike Lischke [public@l...]
Date: Tue May 8, 2001 8:25 am
Subject: RE: [VirtualTreeview] Re: autosizing columns

Hi Jim,

> So what I did was wrap all access to VT in the thread with critical
> sections plus any node deletions in VT which signaled the thread that
> a node (or nodes) are being deleted.

Aha, I understand.

>...but every so often the image is not redrawn in the tree and
> it stays the default icon until a repaint. Maybe I should call Update
> after InvalidateNode to force a WM_PAINT message. If I remember right
> WM_PAINTs don't accumulate. If there is one in the queue it does not
> post another so it should minimize the number of times VT has
> to paint itself. Make sense?

Mmh, WM_PAINT does indeed accumulate, but not as several messages but as
accumulated update (clip) region. EndUpdate calls Invalidate for the entire
tree and does some other (quite expensive) work. So it should not be used
for frequent single node updates but for large operations, like deleting
many nodes or something like that. Calling UpdateWindow after your operation
is a good alternative, but I have doubts it will work if InvalidateNode does
not work. Somehow the nodes seems not get invalidated, or do you think it
has to do with not enough CPU time?

Ciao, Mike

 | Replies | Author | Date
1681 | Re: autosizing columns | Jim Kueneman | Tue 5/8/2001
1683 | changing subjects (was: Re: autosizing columns) | Moritz Franckenstein | Tue 5/8/2001


re: GDI crash problem on W95 and "ShortenString "

From: Mike Lischke [public@l...]
Date: Tue May 8, 2001 8:37 am
Subject: RE: [VirtualTreeview] GDI crash problem on W95 and "ShortenString "

Hi Björn,

> Problem occured with 2.4.3B (dloaded 2001-05-07)

Thank you for your detailed bug report.

> What i noticed was that the error occured when the column size
> was beeing shrinked so much that only the "..." remained. So
> I looked in "virtualtrees.pas" and found the function "ShortenString"

Unfortunately, I have no idea what's wrong and never heard about this
problem before. You already have tried every potential source of help I
would use too, so I'm helpless here. The question is, does the current Win95
market justify special effort to fix this problem? I mean, how many user do
you expect using your product on Win95?

> The next time the error occurs (after some normal uptime i
> suppose, I will try substituting for the "A" version APIs in this case and
see if
> it makes a difference)

Yes, please do that and give me your results.

Ciao, Mike

 | Replies | Author | Date
1694 | Re: GDI crash problem on W95 and "ShortenString " | [bli@c...] | Wed 5/9/2001


re: (unknown)

From: Mike Lischke [public@l...]
Date: Tue May 8, 2001 9:18 am
Subject: RE: [VirtualTreeview] (unknown)

Franc,

> when working in grid mode will there be an option to select
> multiple cells
> on the same row instead of only the leftmost cell when multiselect is
> enabled ? Or is that option already there and am I missing something ?

I have already answered this question on Sunday, May 6. Why do you ask again
(and with this strange subject line)?

Ciao, Mike

 | Replies | Author | Date
1670 | Re: (unknown) | Mike Lischke | Tue 5/8/2001
1672 | Re: (unknown) | Mike Lischke | Tue 5/8/2001
1689 | Re: (unknown) | Franc v/d Westelaken | Tue 5/8/2001
2852 | Re: (unknown) | GIANNAKOPOULOS KOSTAS | Tue 7/3/2001
2876 | Re: (unknown) | [agallero@n...] | Wed 7/4/2001


Bug in TVirtualTreeHintWindow?

From: "Radoslaw Klocek" [radekk@p...]
Date: Tue May 8, 2001 8:57 am
Subject: Bug in TVirtualTreeHintWindow?

Hi!
I noticed, that the custom hint window lives longer than the tree object for
which it was created.
This causes problem with tooltip hint in my descendant class of
TCustomVirtualStringTree.
Error occurs in TVirtualTreeHintWindow.IsHintMsg. Function checks
FHintData.Tree.FStates when the FHintData.Tree doesn't already exist!
I catch the exception:

function TVirtualTreeHintWindow.IsHintMsg(var Msg: TMsg): Boolean;
begin
try
Result := inherited IsHintMsg(Msg)
and Assigned(FHintData.Tree) and not (tsHintCancelling in
FHintData.Tree.FStates);
if Msg.Message = WM_NCMOUSEMOVE then
Result := False;
except
FHintData.Tree := nil;
Result := False;
end;
end;

but this is only partial solution.

--
Radoslaw Klocek

 | Replies | Author | Date
1671 | Bug in TVirtualTreeHintWindow? | Radoslaw Klocek | Tue 5/8/2001
1698 | Re: Bug in TVirtualTreeHintWindow? | Mike Lischke | Wed 5/9/2001
1736 | Re: Bug in TVirtualTreeHintWindow? | Vadim Sedulin | Thu 5/10/2001
1743 | Re: Bug in TVirtualTreeHintWindow? | Mike Lischke | Fri 5/11/2001
1752 | Re: Bug in TVirtualTreeHintWindow? | Vadim Sedulin | Fri 5/11/2001


re: (unknown)

From: Mike Lischke [public@l...]
Date: Tue May 8, 2001 9:15 am
Subject: RE: [VirtualTreeview] (unknown)

Hi Franc,

> I downloaded your latest beta version and the naviagtion keys
> 'home' and 'end' are working, but the CTRL-Home and CTRL-end has some
> strange effects.

What is strange?

> I have one suggestion though. Perhaps it's more obvious to users when
> VTreeView uses the same navigation keys as a standard
> TStringGrid ?

Not necessarily. Keep in mind VT is not a grid and can only approximate the
grid behavior. Its main task is still to be a tree and there other premises
apply.

> - 'Home' and 'CTRL-<left arow>' moves to the left most cell
> on the current row

'Home' moves the focus to the first row. Arrow keys together with Ctrl
scroll the tree in the particular direction.

> - 'End' and 'CTRL-<right arrow>' moves to the right most cell
> on the current row

'End' moves the focus to the last row.

> - CTRL-HOME moves to the upperleft cell of the grid
> - CTRL-END moves to the bottomright cell of the grid

This is now built-in. It does not move the focus however. Simply use the
keys without Ctrl to move the focus too.

Ciao, Mike


Bug in TVirtualTreeHintWindow?

From: "Radoslaw Klocek" [radekk@p...]
Date: Tue May 8, 2001 7:33 am
Subject: Bug in TVirtualTreeHintWindow?

Hi!
I noticed, that the custom hint window lives longer than the tree object for
which it was created.
This causes problem with tooltip hint in my descendant class of
TCustomVirtualStringTree.
Error occurs in TVirtualTreeHintWindow.IsHintMsg. Function checks
FHintData.Tree.FStates when the FHintData.Tree doesn't already exist!
I catch the exception:

function TVirtualTreeHintWindow.IsHintMsg(var Msg: TMsg): Boolean;
begin
try
Result := inherited IsHintMsg(Msg)
and Assigned(FHintData.Tree) and not (tsHintCancelling in
FHintData.Tree.FStates);
if Msg.Message = WM_NCMOUSEMOVE then
Result := False;
except
FHintData.Tree := nil;
Result := False;
end;
end;

but this is only partial solution.

--
Radoslaw Klocek


re: (unknown)

From: Mike Lischke [public@l...]
Date: Tue May 8, 2001 9:51 am
Subject: RE: [VirtualTreeview] (unknown)

Franc,

while thinking about the navigation keys I remembered that VT has a grid
mode which can be used to modify key handling. So I started changing the key
down code and found it was simple to implement what you want :-) Although,
some things do not work. Mainly because VT cannot select several cells of
one node.

> - 'Home' and 'CTRL-<left arow>' moves to the left most cell
> on the current row

'Home' moves now to the first column of the current node. Arrow keys and
Ctrl still scroll the tree (in TStringGrid the work as would Ctrl no be
pressed).

> - 'End' and 'CTRL-<right arrow>' moves to the right most cell
> on the current row

'End' moves now to the last column of the current node.

Ciao, Mike


re: Re: autosizing columns

From: GIANNAKOPOULOS KOSTAS [kyan@s...]
Date: Tue May 8, 2001 10:37 am
Subject: RE: [VirtualTreeview] Re: autosizing columns

Good afternoon Mike & Jim.

Sorry to cut in on your conversation but:

> > So what I did was wrap all access to VT in the thread with critical
> > sections plus any node deletions in VT which signaled the
> thread that
> > a node (or nodes) are being deleted.
>
> Aha, I understand.

Quote from TImageThread.Execute:

if not Terminated and Assigned(Node) then
try
if FTree.ValidateNamespace(Node, Data) then
Data.GetIconIndex(False, icSmall);
if not Terminated then
FTree.InvalidateNode(Node);
except // no exceptions within the thread please, stop loop
instead
LastCount := 1;
end;
End Quote

I don't think it is a good idea to call any VT's methods (or TNamespace's,
unless you are absolutely sure it is thread safe) in a ThreadProc, even if
you try hard to protect the resources they access with a critical section.
That's because some methods may have side-effects like writing to data
members of the VT (maybe not now but in future versions?) and this would
trash it.

I propose to Jim to have the thread do all the necessary time expensive work
of getting the images in its Execute method and post the results to the VT
via a PostMessage, so that the VT will handle the results in the main
thread, like he did with TNotifyEventThread.Execute.

BTW, Jim, why one TNotifyEventThread per VET? A good optimization would be
to have only one singleton TNotifyEventThread and replace its "FOwner" with
a "FLiveVETS" TThreadList where you will add any created instances of VET
and NotifyChange() will enumerate it.

<KY>


resize columns at design time

From: "Moritz Franckenstein" [franckenstein@a...]
Date: Tue May 8, 2001 12:55 pm
Subject: resize columns at design time

hi,

wouldn't it be nice to enable resizing of the columns in the form
designer? i have already seen that in other components.

clicking on a column could also open the properties for this column.

:)

-moritz

 | Replies | Author | Date
1700 | Re: resize columns at design time | Mike Lischke | Wed 5/9/2001


re: suggestion: new keyboard shortcut

From: "Moritz Franckenstein" [franckenstein@a...]
Date: Tue May 8, 2001 1:01 pm
Subject: Re: suggestion: new keyboard shortcut

--- In [VirtualTreeview@y...], "Mike Lischke" [public@l...] wrote:
> > what about the '/' key to collapse all children of the current
node?
> > or: the '/' key could set the current node to expanded and all
children to collapsed (including their children).

> If only every suggestion would be so easy to implement :o] Accepted
and done (actually it is the / key on the numpad, as with the * key),
>
> Ciao, Mike

hm, i have seen you have implemented the first suggestion, but i
think, with the second one it would be much easier to understand what
happened. currently it looks like the result of pressing the '-' key,
until you expand it again.
and one could use the / key instead of the + key to expand a node if
he doesnt want to get the last state of the subnodes...

-moritz


re: Re: VET 1.1.1, again

From: Jim Kueneman [jimdk@m...]
Date: Tue May 8, 2001 1:15 pm
Subject: Re: [VirtualTreeview] Re: VET 1.1.1, again

At 06:43 PM 5/7/2001 +0000, you wrote:
> > >I use a somewhat weird screen settings, and your VET demo
> > >has problems with Anchor properties for TBevels. So, I
> > >modified the demo sources to use TGroupBoxes which are
> > >far better. Could I send you demo sources.

I have it. I need to make a few minor tweaks to get it to clean it up on
my settings. When I am done I will let you try it.

Thanks,
Jim

 | Replies | Author | Date
1679 | Re: VET 1.1.1, again | [tias@m...] | Tue 5/8/2001
1684 | Re: VET 1.1.1, again | Jim Kueneman | Tue 5/8/2001
1713 | Re: VET 1.1.1, again | [tias@m...] | Wed 5/9/2001
1715 | Re: VET 1.1.1, again | Jim Kueneman | Wed 5/9/2001


re: Use Hints and Popups in the same Tree

From: "Moritz Franckenstein" [franckenstein@a...]
Date: Tue May 8, 2001 1:20 pm
Subject: Re: Use Hints and Popups in the same Tree

--- In [VirtualTreeview@y...], Mike Lischke [public@l...] wrote:
> I like your idea of having a column based hint mode. This requires
however
> to introduce a new class member, which will again change the stream
format.
> But together with your resizing code (and the connect removal of
> AutoSizeIndex) it nearly justifies to take the effort and implement
> everything needed for a new stream format.
>
> The only thing I would like to have before, however, is working auto
> resizing code based on your idea.

at the moment i dont know how to improve the behaviour while
autoresizing.
additionally i wanted to allow pushing the resized column to the left
by dragging its width beyond the minwidth. but i didnt get that to
work correctly.
i also dont know how to fix the problem with the horizontal scrollbar
(disabling helps).
what i can do is include maxwidth and invisible column support. is
something else missing?

why dont you want to keep the old autoresize method as an option?
maybe a little bit changed: it always uses the right column for
autosize and the left one if the right is to be resized. this would
be ok for most trees with only two or three columns...


re: Re: autosizing columns

From: Jim Kueneman [jimdk@m...]
Date: Tue May 8, 2001 1:00 pm
Subject: RE: [VirtualTreeview] Re: autosizing columns

At 01:37 PM 5/8/2001 +0300, you wrote:
>Good afternoon Mike & Jim.
>
>Sorry to cut in on your conversation but:

>I don't think it is a good idea to call any VT's methods (or TNamespace's,
>unless you are absolutely sure it is thread safe) in a ThreadProc, even if
>you try hard to protect the resources they access with a critical section.
>That's because some methods may have side-effects like writing to data
>members of the VT (maybe not now but in future versions?) and this would
>trash it.

No arguments here. I have been nervous of the thread since the begining
since it did access VT without any type of synconization. I have it
working now except for the occational not drawing the new icon. I just
can't call BeginUpdate and EndUpdate from the critical section or it deadlocks.

>I propose to Jim to have the thread do all the necessary time expensive work
>of getting the images in its Execute method and post the results to the VT
>via a PostMessage, so that the VT will handle the results in the main
>thread, like he did with TNotifyEventThread.Execute.

I have implemented and tested that. I does work but it feel very sluggish
and I did not like it. It may be the best solution though. I will keep
looking into it.

>BTW, Jim, why one TNotifyEventThread per VET? A good optimization would be
>to have only one singleton TNotifyEventThread and replace its "FOwner" with
>a "FLiveVETS" TThreadList where you will add any created instances of VET
>and NotifyChange() will enumerate it.

That is on my list of things to do. It is very expensive to let to more
than one VET process all those notifications. The only thing stopping me
is the fact I need to know when a new VET is placed on the form and when
one is deleted and who will be the master, etc etc. Maybe the best
solution is to create a new nonvisual component and connect VETs to it for
notification. Suggestions?

Jim


re: VET 1.1.1, again

From: [tias@m...]
Date: Tue May 8, 2001 1:39 pm
Subject: Re: VET 1.1.1, again

Is it too much to ask for to have the Anchors property published as
well ?

I also need the RebuildRootNamespace() method to be public: I use it
to update the tree (really I only want to update the currently
selected path, but RebuildRootNamespace() works ok for me also.
The case when I do this is for example if I chenge the rules in the
OnEnumFolder and want the tree to represent these changes.

/Mathias Thorell

 | Replies | Author | Date
1684 | Re: VET 1.1.1, again | Jim Kueneman | Tue 5/8/2001
1713 | Re: VET 1.1.1, again | [tias@m...] | Wed 5/9/2001
1715 | Re: VET 1.1.1, again | Jim Kueneman | Wed 5/9/2001


re: Test, please ignore

From: Bender Heri [HBender@E...]
Date: Tue May 8, 2001 2:00 pm
Subject: RE: [VirtualTreeview] Test, please ignore


re: Re: autosizing columns

From: Jim Kueneman [jimdk@m...]
Date: Tue May 8, 2001 1:06 pm
Subject: RE: [VirtualTreeview] Re: autosizing columns

At 10:25 AM 5/8/2001 +0200, you wrote:
>Hi Jim,
>many nodes or something like that. Calling UpdateWindow after your operation
>is a good alternative, but I have doubts it will work if InvalidateNode does
>not work. Somehow the nodes seems not get invalidated, or do you think it
>has to do with not enough CPU time?

I am not sure. They all are getting a InvalidateNode call but they just
sometimes don't get redrawn. What is weird that is usually is a directory
that only contain 6 or 7 items and it can be any number in any order that
do not get redrawn with the new image.

Jim

 | Replies | Author | Date
1683 | changing subjects (was: Re: autosizing columns) | Moritz Franckenstein | Tue 5/8/2001


re: Re: autosizing columns

From: GIANNAKOPOULOS KOSTAS [kyan@s...]
Date: Tue May 8, 2001 2:25 pm
Subject: RE: [VirtualTreeview] Re: autosizing columns

> The only thing stopping me
> is the fact I need to know when a new VET is placed on the
> form and when
> one is deleted and who will be the master, etc etc. Maybe the best
> solution is to create a new nonvisual component and connect
> VETs to it for
> notification. Suggestions?

No need for a component, the singleton TNotifyEventThread will be the
"master".

Add a FLiveVETs TList and a CriticalSection to protect it.

Add 2 methods TNotifyEventThread.RegisterTree and
TNotifyEventThread.UnregisterTree. These will be called in the main thread
and add/remove the Self pointers of all VETs in the FLiveVETs list in an
Enter/LeaveCriticalSection block. RegisterTree will also start the shell
monitoring the 1st time a tree is added and UnregisterTree will stop it when
the count is zero (this is the reason for the critical section, otherwise a
TThreadList would do).

Every VET will register itself to the singleton in its constructor and
unregister itself in its destructor.

TNotifyEventThread.NotifyChange will enumerate the FLiveVETs list in an
Enter/LeaveCriticalSection block too. Enumeration is quite fast (PostMessage
returns immediately) so the Constructors/Destructors of VETs will not be
blocked for a long time.

Create the singleton TNotifyEventThread instance in the
VirtualExplorerTree.pas' initialization section and free it in the
finalization section. This variable does not have to be visible outside the
unit. You could defer the creation of the singleton the 1st time a VET is
created, to avoid having it always created.

Sounds simple, doesn't it?

<KY>


changing subjects (was: Re: autosizing columns)

From: "Moritz Franckenstein" [franckenstein@a...]
Date: Tue May 8, 2001 3:05 pm
Subject: changing subjects (was: Re: autosizing columns)

maybe it is a good idea to change the subject if the subject changes?!

:)


re: VET 1.1.1, again

From: "Jim Kueneman" [jimdk@m...]
Date: Tue May 8, 2001 3:08 pm
Subject: Re: VET 1.1.1, again

--- In [VirtualTreeview@y...], [tias@m...] wrote:
> Is it too much to ask for to have the Anchors property published as
> well ?

For you? Of course not <g> I am sure I overlooked a few properties
that can be published.

> I also need the RebuildRootNamespace() method to be public: I use it
> to update the tree (really I only want to update the currently
> selected path, but RebuildRootNamespace() works ok for me also.
> The case when I do this is for example if I chenge the rules in the
> OnEnumFolder and want the tree to represent these changes.

RebuildTree simply calls RebuildRootNamespace. RefreshTree saves the
current state of the tree, Rebuilds it then trys to restore it like it
was. Both are public.

What you really want is RefreshNodeByPIDL which you can get the PIDL
from the TNamespace associated with the Node (Using ValidateNamespace)
but RefreshNodeByPIDL is not public. I will add a new public method
like

RefreshNode(Node: PVirtualNode);

Jim

 | Replies | Author | Date
1713 | Re: VET 1.1.1, again | [tias@m...] | Wed 5/9/2001
1715 | Re: VET 1.1.1, again | Jim Kueneman | Wed 5/9/2001


re: incremental search

From: Mike Lischke [public@l...]
Date: Tue May 8, 2001 9:19 am
Subject: RE: [VirtualTreeview] incremental search

Hi Basil,

> Is there any way to do incremental search in a column?

I have been thinking about this feature for a long time too. Only my limited
time prevented me from implementing it. Would you like to take this task?

Ciao, Mike


BCB5: IVTEditLink new NotifyEvent and Division by NULL

From: "Roland" [Beduerftig@S...]
Date: Tue May 8, 2001 3:42 pm
Subject: BCB5: IVTEditLink new NotifyEvent and Division by NULL

Hi Mike,

I uploaded the demo program PropertyEdit in the file area in this
newsgroup, using the VT 2.4x from 26. April 2001.

The program works fine.

How I downloaded the lastest version 2.4.5. (8. Mai 2001) and the
programs will no longer work:

1. You installed a new NotifyEvent
virtual void __stdcall ProcessMessage(Messages::TMessage &Message);
Question:
What was the reason to build in the new event ?
Note:
Under BCB5 we must implement all methods of the interface !
There is no problem, but I have not understand, what I should do
in the event.

2. An error happened in VT an line
procedure ConvertAndAddImages(IL: TImageList;
const ImageName: String);
......
for I := 0 to (Images.Width div Images.Height) - 1 do
.......
=> Division by NULL
Note:
I stop with the debugger before the exception happened and look
in the variable list, Images.Width and Images.Height from the last
Bitmap in the list == NULL => then crash !
The next step was:
Go back to version 2.4.x from 5. Mai 2001, it same error occured
The next step was:
Go back to version 2.4x from 26. April 2001, all things Ok !

When you uploaded a new version I will try it, and then I can modify
the demo program.

with best regards
Roland


New file uploaded to VirtualTreeview

From: [VirtualTreeview@yahoogroups.com>
Date: Tue May 8, 2001 4:16 pm
Subject: New file uploaded to VirtualTreeview

Hello,

This email message is a notification to let you know that
a file has been uploaded to the Files area of the VirtualTreeview
group.

File : /VSTEdit.zip
Uploaded by : [Manfred@F...]
Description : Editors for VST V1.0.1 Beta

You can access this file at the URL

http://groups.yahoo.com/group/VirtualTreeview/files/VSTEdit.zip

To learn more about file sharing for your group, please visit

http://help.yahoo.com/help/us/groups/files

Regards,

Manfred@F...]


Editors for VST

From: [Manfred@F...]
Date: Tue May 8, 2001 4:19 pm
Subject: Editors for VST

I have uploaded a new Beta of my Editors for VirtualStringTree.
The only changes are bugfixes and compatibility with the newest
version of VST.

with best regards
Manfred


re: (unknown)

From: "Franc v/d Westelaken" [F.vdwestelaken@c...]
Date: Tue May 8, 2001 4:49 pm
Subject: RE: [VirtualTreeview] (unknown)

Hi Mike,

I don't know what happens but I'm sure I posted this question only once and
that was sunday. I never posted it a second time. I also noticed that my
second post from sunday appeared today on the list again with subject
'(unknown)'. This post was about the naviagtion keys. You replied on that
one already on sunday (you said it was working when you tested it, and after
I noticed that it wasn't working as expected you tried it yourself and
noticed that too, remember) and I see you replied on the post from today
also. But again, I never posted these questions a second time. I've no idea
what happened. As you can see in the e-mail (which has a rather strange
format). All headers are included, the date is 'sun 6, 2001 12:39:54', so
this is my original post, but I didn't resend it. Something must have gone
wrong with Yahoo groups ???

Regards,
Franc.
-----Original Message-----
From: Mike Lischke [mailto:[public@l...]]
Sent: dinsdag 8 mei 2001 11:18
To: 'VirtualTreeview@yahoogroups.com'
Subject: RE: [VirtualTreeview] (unknown)

Franc,

> when working in grid mode will there be an option to select
> multiple cells
> on the same row instead of only the leftmost cell when multiselect is
> enabled ? Or is that option already there and am I missing something ?

I have already answered this question on Sunday, May 6. Why do you ask
again
(and with this strange subject line)?

Ciao, Mike

Yahoo! Groups Sponsor

To unsubscribe from this group, send an email to:
VirtualTreeview-unsubscribe@egroups.com

Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.

[Non-text portions of this message have been removed]


Custom selection color

From: Kent Briggs [kbriggs@b...]
Date: Tue May 8, 2001 8:55 pm
Subject: Custom selection color

I have a virtual treeview (ver 2.4.5) control with full row select and
multiselection turned on. I would like the focused node to have a different
selection color than the default navy color that normal selected items have. I
tried checking for sender.focusednode=node inside the OnPaintText event and then
setting canvas.brush.style:=clRed but that had no effect. I tried a similar
technique inside OnBeforeCellPaint and added canvas.fillrect with the supplied
trect. That almost worked. The areas in between columns turned red but the
actual text in the columns was drawn over a Navy background. How can I get the
entire row to paint with a solid background color of my choosing?

--
Kent Briggs, [kbriggs@b...]
Briggs Softworks, http://www.briggsoft.com

 | Replies | Author | Date
1696 | Re: Custom selection color | Mike Lischke | Wed 5/9/2001
1711 | Re: Custom selection color | Kent Briggs | Wed 5/9/2001
1712 | Re: Custom selection color | Mike Lischke | Wed 5/9/2001
1714 | Re: Custom selection color | Mike Lischke | Wed 5/9/2001
1717 | Re: Custom selection color | Kent Briggs | Wed 5/9/2001


R: Gratulations and an attempt of contribution from a newbie

From: "Dean Zobec" [dezobec@t...]
Date: Tue May 8, 2001 9:19 pm
Subject: R: [VirtualTreeview] Gratulations and an attempt of contribution from a newbie

Thank you Mike for your prompt solution, Danke, Grazie, Hvala!

> Okay, I just uploaded a new version of VT to YG with an additional
KillTimer
> call for the case when going from one column to another. I was under the
> impression that there is no need to call KillTimer if you use the same
timer
> in a new call to SetTimer. Anyway, try it out.

Your efficiency is amazing! :o]
I tried the new version, the additional StopTimer completely solves the
problem and I'm very happy to use this component! :-)

Ciao, Dean


re: New file uploaded to VirtualTreeview

From: "Vadim Sedulin" [wsntrl@o...]
Date: Wed May 9, 2001 5:06 am
Subject: Re: [VirtualTreeview] New file uploaded to VirtualTreeview

Mike,

Please, don't use national characters in filenames.

Bye.

Vadim Sedulin
E-Mail: [wsntrl@o...]


Another bug in VTree

From: "Radoslaw Klocek" [radekk@p...]
Date: Wed May 9, 2001 8:06 am
Subject: Another bug in VTree

Hi!

I've found small error in VTree:
The range check error is raised in TBaseVirtualTree.UpdateVerticalScrollBar
when ClientHeight of VTree has negative value.

--
Radoslaw Klocek

 | Replies | Author | Date
1704 | Re: Another bug in VTree | Mike Lischke | Wed 5/9/2001


re: GDI crash problem on W95 and "ShortenString "

From: [bli@c...]
Date: Wed May 9, 2001 8:52 am
Subject: Re: GDI crash problem on W95 and "ShortenString "

Hi Mike,

>
> > What i noticed was that the error occured when the column size
> > was beeing shrinked so much that only the "..." remained. So
> > I looked in "virtualtrees.pas" and found the
function "ShortenString"
>
> Unfortunately, I have no idea what's wrong and never heard about
this
> problem before. You already have tried every potential source of
help I
> would use too, so I'm helpless here. The question is, does the
current Win95
> market justify special effort to fix this problem? I mean, how many
user do
> you expect using your product on Win95?

My advice is to do nothing, unless you hear something that puts you
right onto the "solution". This kind of problem I have occurs rarely,
and is hard to track down as to the actual problem. And there are
probably a lot of other more important issues to attend to than this
bug :-)

Just want to add to the info that in a previous version,
(VT 2.1), the problem occured when the tree and header was
initialized programmatically, in the latest version, it only occured
after user-resizing of the column.

Also, I can well live with the workaround of not having
the "shortenstring" function, so in the stuff I release i will just
put an "result := s; exit;" at the start of the function as I
mentioned.

> > The next time the error occurs (after some normal uptime i
> > suppose, I will try substituting for the "A" version APIs in this
case and
> see if
> > it makes a difference)
>
> Yes, please do that and give me your results.

Will do.


OnHeaderClick not triggered if hoDrag = false (and more)

From: [bli@c...]
Date: Wed May 9, 2001 9:01 am
Subject: OnHeaderClick not triggered if hoDrag = false (and more)

Hi,
I guess this would be a bug:
In the latest (2.4.3) VT, the OnHeaderClick event is not triggered
if the header option hoDrag is set to false.

Also, the OnHeaderDragging event is not published (or declared a
property even)

Workaround:
In my project, I currently don't want to allow people to drag the
header, so my current workaround was to edit the VirtualTrees.pas
to publish the OnHeaderDragging event, and then write an event
handler that simply sets "allowed := false" so no dragging is
allowed.

A second problem:
It seems if I click the header semi-frequent, some clicks will not
cause events. A wild guess would be that this may have something to
to with dragging being enabled. The behaviour "problem" is quite
obvious and it was not a problem in the previous version I was
running (VT 2.1)

Best regards,
Bjorn Lindell


re: Custom selection color

From: Mike Lischke [public@l...]
Date: Wed May 9, 2001 10:26 am
Subject: RE: [VirtualTreeview] Custom selection color

Hi Kent,

> I have a virtual treeview (ver 2.4.5) control with full row select and
> multiselection turned on. I would like the focused node to
> have a different selection color than the default navy color that normal
> selected items have.

You are almost there. Without a bit help from VT however, you cannot hide
the selection. So I have included a new option call voHideSelection which
will do exactly that. Wait for the new upload.

Ciao, Mike


re: BCB5: IVTEditLink new NotifyEvent and Divis ion by NULL

From: Mike Lischke [public@l...]
Date: Wed May 9, 2001 10:33 am
Subject: RE: [VirtualTreeview] BCB5: IVTEditLink new NotifyEvent and Divis ion by NULL

Hi Roland,

> 1. You installed a new NotifyEvent
> virtual void __stdcall ProcessMessage(Messages::TMessage &Message);
> Question:
> What was the reason to build in the new event ?
> Note:
> Under BCB5 we must implement all methods of the interface !
> There is no problem, but I have not understand, what I should do
> in the event.

This is in Delphi not different. A need arised to forward messages from the
tree to the edits (e.g. mouse down to simulate a double click if an editor
is build on mouse down, as it happen in the object inspector).
ProcessMessage does exactly this. If called in may (but not has to) forward
the message to its edit control(s).

> 2. An error happened in VT an line
> procedure ConvertAndAddImages(IL: TImageList;
> const ImageName: String);

Strange. There was not the most up-to-date res file in the zip (which
contains the images loaded there). Please try the next upload.

Ciao, Mike

 | Replies | Author | Date
1709 | Re: BCB5: IVTEditLink new NotifyEvent and Divis i | Roland | Wed 5/9/2001


re: Bug in TVirtualTreeHintWindow?

From: Mike Lischke [public@l...]
Date: Wed May 9, 2001 11:00 am
Subject: RE: [VirtualTreeview] Bug in TVirtualTreeHintWindow?

Hi Radoslaw,

> I noticed, that the custom hint window lives longer than the
> tree object for which it was created.

This is due to the internal handling of hint windows. I have no influence on
it. The only way to explicitely destroy the VT hint window would be to
switch off and on TApplciation.ShowHint property.

> This causes problem with tooltip hint in my descendant class of
> TCustomVirtualStringTree.
> Error occurs in TVirtualTreeHintWindow.IsHintMsg. Function checks
> FHintData.Tree.FStates when the FHintData.Tree doesn't already exist!

Yes, you are right. This is a problem. I checked that I really need the tree
and I do (for painting). But I have reworked the code so that pending or
showing hints are cancelled on node destruction. Node destruction was the
reson why I included the check in the first place. No the entire hint is
cancelled and should not cause problems anymore. Wait for next upload.

Ciao, Mike


re: Re: suggestion: new keyboard shortcut

From: Mike Lischke [public@l...]
Date: Wed May 9, 2001 11:04 am
Subject: RE: [VirtualTreeview] Re: suggestion: new keyboard shortcut

Moritz,

> hm, i have seen you have implemented the first suggestion, but i
> think, with the second one it would be much easier to understand what
> happened. currently it looks like the result of pressing the '-' key,
> until you expand it again.
> and one could use the / key instead of the + key to expand a node if
> he doesnt want to get the last state of the subnodes...

I see what you mean, but with this you cannot see the difference between '/'
and '+' keys. I also want to stay as close as possible to existing UI
elements.

Ciao, Mike


re: resize columns at design time

From: Mike Lischke [public@l...]
Date: Wed May 9, 2001 11:05 am
Subject: RE: [VirtualTreeview] resize columns at design time

> wouldn't it be nice to enable resizing of the columns in the form
> designer? i have already seen that in other components.

This was enabled but caused problems with the IDE (context menu did not work
there). So I have this disabled.

> clicking on a column could also open the properties for this column.

There is already code to activate the collection editor. Can you give me the
additonal code to select one entry in the collection editor?

Ciao, Mike


re: Re: autosizing columns

From: Mike Lischke [public@l...]
Date: Wed May 9, 2001 11:07 am
Subject: RE: [VirtualTreeview] Re: autosizing columns

Hi Jim,

> I am not sure. They all are getting a InvalidateNode call
> but they just sometimes don't get redrawn. What is weird that is usually

> is a directory that only contain 6 or 7 items and it can be any number in
> any order that do not get redrawn with the new image.

Well, since VT is flickerfree and paints fast enough you have as last
ressort always a full invalidation. Multithreaded applications are among the
most difficult to debug, so if nothing else helps...

Ciao, Mike


re: Gratulations and an attempt of contribution from a newbie

From: Mike Lischke [public@l...]
Date: Wed May 9, 2001 11:08 am
Subject: RE: [VirtualTreeview] Gratulations and an attempt of contribution from a newbie

Hi Dean,

> Your efficiency is amazing! :o]

:-)

> I tried the new version, the additional StopTimer completely
> solves the
> problem and I'm very happy to use this component! :-)

If I would sell VT I could now say: aaaah a satisfied customer. How much can
we raise the price? :-)

Ciao, Mike


re: New file uploaded to VirtualTreeview

From: Mike Lischke [public@l...]
Date: Wed May 9, 2001 11:11 am
Subject: RE: [VirtualTreeview] New file uploaded to VirtualTreeview

> Please, don't use national characters in filenames.

Okay.

Ciao, Mike


re: Another bug in VTree

From: Mike Lischke [public@l...]
Date: Wed May 9, 2001 11:13 am
Subject: RE: [VirtualTreeview] Another bug in VTree

> I've found small error in VTree:
> The range check error is raised in
> TBaseVirtualTree.UpdateVerticalScrollBar
> when ClientHeight of VTree has negative value.

Isn't it strange that the client area can become negative at all? It is
stupid mathematics, which caused that. They take the window area and
subtract the borders from the rectangle which may lead to the strange effect
that the right border is less than the left border. Fixed.

Ciao, Mike


re: Re: GDI crash problem on W95 and "ShortenSt ring "

From: Mike Lischke [public@l...]
Date: Wed May 9, 2001 11:15 am
Subject: RE: [VirtualTreeview] Re: GDI crash problem on W95 and "ShortenSt ring "

Hi Bjorn,

> My advice is to do nothing, unless you hear something that puts you
> right onto the "solution". This kind of problem I have occurs rarely,
> and is hard to track down as to the actual problem. And there are
> probably a lot of other more important issues to attend to than this
> bug :-)

Okay, I'll keep that in mind for a while and if there are more complains I
will look for a Win95 machine (could become difficult though).

Ciao, Mike

 | Replies | Author | Date
1755 | Re: GDI crash problem on W95 and "ShortenSt ring | =?iso-8859-1?Q?Bj=F6rn_Lindel | Fri 5/11/2001
1778 | Re: GDI crash problem on W95 and "ShortenSt ring | Mike Lischke | Sun 5/13/2001


re: OnHeaderClick not triggered if hoDrag = fal se (and more)

From: Mike Lischke [public@l...]
Date: Wed May 9, 2001 11:28 am
Subject: RE: [VirtualTreeview] OnHeaderClick not triggered if hoDrag = fal se (and more)

> I guess this would be a bug:
> In the latest (2.4.3) VT, the OnHeaderClick event is not triggered
> if the header option hoDrag is set to false.

Oops, my fault. I forgot to handle the click before mouse up is handled.
Fixed.

> Also, the OnHeaderDragging event is not published (or declared a
> property even)

Again oops. Simply forgot to publish...

> It seems if I click the header semi-frequent, some clicks will not
> cause events. A wild guess would be that this may have something to
> to with dragging being enabled. The behaviour "problem" is quite
> obvious and it was not a problem in the previous version I was
> running (VT 2.1)

I guess with "semi-frequent" you mean you clicked several times quickly on
the header, right? In newer versions of VT the header properly recognizes
double-clicks and does not handle them as single clicks (see also
TListView).

Ciao, Mike


New file uploaded to VirtualTreeview

From: [VirtualTreeview@yahoogroups.com>
Date: Wed May 9, 2001 11:39 am
Subject: New file uploaded to VirtualTreeview

Hello,

This email message is a notification to let you know that
a file has been uploaded to the Files area of the VirtualTreeview
group.

File : /VirtualTree 2.4.7.zip
Uploaded by : [public@l...]
Description : Beta version

You can access this file at the URL

http://groups.yahoo.com/group/VirtualTreeview/files/VirtualTree%202.4.7.zip

To learn more about file sharing for your group, please visit

http://help.yahoo.com/help/us/groups/files

Regards,

public@l...]


re: New file uploaded to VirtualTreeview

From: Mike Lischke [public@l...]
Date: Wed May 9, 2001 11:40 am
Subject: RE: [VirtualTreeview] New file uploaded to VirtualTreeview

> This email message is a notification to let you know that
> a file has been uploaded to the Files area of the VirtualTreeview
> group.
>
> File : /VirtualTree 2.4.7.zip
> Uploaded by : [public@l...]
> Description : Beta version

I had to reupload again because I forgot to include the new tree. So if
anybody was so fast to download it in the 5 minutes I needed to reupload
then please download again.

Ciao, Mike


re: BCB5: IVTEditLink new NotifyEvent and Divis ion by NULL

From: "Roland" [Beduerftig@S...]
Date: Wed May 9, 2001 12:43 pm
Subject: Re: BCB5: IVTEditLink new NotifyEvent and Divis ion by NULL

Hi Mike,

> > 1. You installed a new NotifyEvent
> > virtual void __stdcall ProcessMessage(Messages::
> > TMessage &Message);
> > Question:
> > What was the reason to build in the new event ?
> .......
> is build on mouse down, as it happen in the object inspector).
> ProcessMessage does exactly this. If called in may
> (but not has to) forward the message to its edit control(s).

Ok. I understand.

> > 2. An error happened in VT an line
> > procedure ConvertAndAddImages(IL: TImageList;
> > const ImageName: String);
>
> Strange. There was not the most up-to-date res file in the
> zip (which contains the images loaded there).
> Please try the next upload.

I download the version 2.4.7. now and test it, all works fine !

with best regards
Roland


problems with vt's events

From: "Moritz Franckenstein" [franckenstein@a...]
Date: Wed May 9, 2001 12:52 pm
Subject: problems with vt's events

hi,

during the last days i have tried to investigate some access
violation problems and other strange behaviour but did not find out
much.

i have to update lots of things in my application when something in
the tree changes, including the focused node and the scrolled
position. so i have set some events of vt to execute a method of
mine that updates all my other things.

but now i dont know how to handle the following problems correctly:
- sometimes several events are executed at the same time
- in my event handler i do things to the tree that trigger new events
- it seems that during some events i get invalid or non-initialized
nodes. for example, when i call Tree.Clear, some events are executed
and funny things happen. when the same events are executed after
Tree.Clear has returned, they work again. It is hard to describe.

can you give me some general hints for those things?

-moritz

 | Replies | Author | Date
1723 | Re: problems with vt's events | Roland | Thu 5/10/2001
1733 | Re: problems with vt's events | Moritz Franckenstein | Thu 5/10/2001
1735 | Re: problems with vt's events | Mike Lischke | Thu 5/10/2001
1744 | Re: problems with vt's events | Moritz Franckenstein | Fri 5/11/2001


re: Custom selection color

From: Kent Briggs [kbriggs@b...]
Date: Wed May 9, 2001 2:04 pm
Subject: Re: [VirtualTreeview] Custom selection color

Mike Lischke wrote:

> Hi Kent,
>
> > I have a virtual treeview (ver 2.4.5) control with full row select and
> > multiselection turned on. I would like the focused node to
> > have a different selection color than the default navy color that normal
> > selected items have.
>
> You are almost there. Without a bit help from VT however, you cannot hide
> the selection. So I have included a new option call voHideSelection which
> will do exactly that. Wait for the new upload.

Actually I'm not looking to hide the selection. I just want to change the
selection bar color.

--
Kent Briggs, [kbriggs@b...]
Briggs Softworks, http://www.briggsoft.com


re: Custom selection color

From: Mike Lischke [public@l...]
Date: Wed May 9, 2001 2:08 pm
Subject: RE: [VirtualTreeview] Custom selection color

> -----Original Message-----
> From: Kent Briggs [mailto:[kbriggs@b...]]
> Sent: Wednesday, May 09, 2001 4:04 PM
> To: [VirtualTreeview@yahoogroups.com
> Subject: Re: [VirtualTreeview] Custom selection color
>
>
> Mike Lischke wrote:
>
> > Hi Kent,
> >
> > > I have a virtual treeview (ver 2.4.5) control with full
> row select and
> > > multiselection turned on. I would like the focused node to
> > > have a different selection color than the default navy
> color that normal
> > > selected items have.
> >
> > You are almost there. Without a bit help from VT however,
> you cannot hide
> > the selection. So I have included a new option call
> voHideSelection which
> > will do exactly that. Wait for the new upload.
>
> Actually I'm not looking to hide the selection. I just want
> to change the
> selection bar color.
>
> --
> Kent Briggs, kbriggs@b...]
> Briggs Softworks, http://www.briggsoft.com
>
>
>
> To unsubscribe from this group, send an email to:
> VirtualTreeview-unsubscribe@egroups.com
>
>
>
> Your use of Yahoo! Groups is subject to
http://docs.yahoo.com/info/terms/


re: VET 1.1.1, again

From: [tias@m...]
Date: Wed May 9, 2001 2:13 pm
Subject: Re: VET 1.1.1, again

--- In [VirtualTreeview@y...], "Jim Kueneman" [jimdk@m...] wrote:

> For you? Of course not <g> I am sure I overlooked a few properties
> that can be published.

I know... Anchors is actually the most common property that I usually
forget, even thogh I'm using it a lot... :-)

> RebuildTree simply calls RebuildRootNamespace. RefreshTree saves the
> current state of the tree, Rebuilds it then trys to restore it like
it
> was. Both are public.

Aha, I missed that one (RebuildTree).

> What you really want is RefreshNodeByPIDL which you can get the PIDL
> from the TNamespace associated with the Node (Using
ValidateNamespace)
> but RefreshNodeByPIDL is not public. I will add a new public method
> like
>
> RefreshNode(Node: PVirtualNode);

Sounds great, even thogh a complete rebuild of the tree is extremely
fast on my machine (so far).

BTW: Did you see my eariler posting (msg #1653) that the dynamic dll
linking now works in both ShellUtilities.pas (your fix) and
VirtualExplorerTree.pas (I made a similar fix there) ?
I also had some comments about the declaration/reference order of
TNamespace + some things about _di_IDropTarget, _di_IQueryInfo &
_di_IContextMenu3....

/Mathias

 | Replies | Author | Date
1715 | Re: VET 1.1.1, again | Jim Kueneman | Wed 5/9/2001


re: Custom selection color

From: Mike Lischke [public@l...]
Date: Wed May 9, 2001 2:11 pm
Subject: RE: [VirtualTreeview] Custom selection color

Oops, sorry, the last message went out without actual answer...

Kent,

> Actually I'm not looking to hide the selection. I just want
> to change the selection bar color.

No, you want to change the color of the focused node, not the selection.
Since there is no extra color only for the focused node you have to draw
this yourself. In order to draw it yourself you have to avoid that the tree
draws the default stuff. And in order to avoid that the tree draws what it
usually does there is now an option voHideSelection.

Ciao, Mike


re: VET 1.1.1, again

From: "Jim Kueneman" [jimdk@m...]
Date: Wed May 9, 2001 2:31 pm
Subject: Re: VET 1.1.1, again

--- In [VirtualTreeview@y...], [tias@m...] wrote:
> --- In [VirtualTreeview@y...], "Jim Kueneman" [jimdk@m...] wrote:

> BTW: Did you see my eariler posting (msg #1653) that the dynamic dll
> linking now works in both ShellUtilities.pas (your fix) and
> VirtualExplorerTree.pas (I made a similar fix there) ?
> I also had some comments about the declaration/reference order of
> TNamespace + some things about _di_IDropTarget, _di_IQueryInfo &
> _di_IContextMenu3....

Yes I did, the problem is my 10 month old daughter spilled orange
juice in my keyboard which shorted out the driver so only half of the
keys work and I can't log in to get to the new version of VET to make
the changes!

Jim


re: ActiveX

From: [prog-fr@n...]
Date: Wed May 9, 2001 2:34 pm
Subject: Re: ActiveX

i have an error when i resizing the IE form from the litle size
--- In [VirtualTreeview@y...], "Mike Lischke" [public@l...] wrote:
> Hi all,
>
> is there somebody on this list who would like to create together
with me an OCX to be used in VB (or even VC)? By a recent bug hunt
for active forms I saw what cool things can be made and want now to
have the VB/VC guys using VT too :-)
>
> For those who don't hesitate to download a 300KB OCX try
http://www.lischke-online.de/download/Betas/ActiveFormTest.htm to see
an example of Jim's VET in IE. Of course ActiveX must be enabled for
this page to work. I have set write-protection for this folder so you
can be assured nobody (except me of course) can replace the OCX and
install a trojan horse on your machine :o]
>
> Ciao, Mike
>
> Dipl. Ing. Mike Lischke
> Senior software developer
> --
> Homepage: http://www.lischke-online.de
> GraphicEx: http://www.lischke-online.de/Graphics.html
> Virtual Treeview: http://www.lischke-online.de/VirtualTreeview.html
> Unicode Edit and library: http://www.lischke-online.de/Unicode.html
> Joint Endeavor of Delphi Innovators (JEDI): http://www.delphi-
jedi.org


re: Custom selection color

From: Kent Briggs [kbriggs@b...]
Date: Wed May 9, 2001 2:49 pm
Subject: Re: [VirtualTreeview] Custom selection color

Mike Lischke wrote:

> > Actually I'm not looking to hide the selection. I just want
> > to change the selection bar color.
>
> No, you want to change the color of the focused node, not the selection.
> Since there is no extra color only for the focused node you have to draw
> this yourself. In order to draw it yourself you have to avoid that the tree
> draws the default stuff. And in order to avoid that the tree draws what it
> usually does there is now an option voHideSelection.

Thanks, I understand now.

--
Kent Briggs, [kbriggs@b...]
Briggs Softworks, http://www.briggsoft.com


VET&BCB Solved(?) + some new VET-functionality

From: [tias@m...]
Date: Wed May 9, 2001 8:52 pm
Subject: VET&BCB Solved(?) + some new VET-functionality

Hello there, especially Jim !

Finally I've managed to come to a solution for the ShellUtilities.hpp-
errors when using BCB5 with ShellUtilities.pas. It's probably not the
superb and best way to solve it, but it works for me anyway...
I had to create a new .h-file (named it BCBShellUtilites.h) which
contains some dummy declarations of the _di_IDropTarget,
_di_IQueryInfo & _di_IContextMenu3 callses.
Also, I had to #undef all IEIFLAG_* and CSIDL_* constants that are
declared as static const Shortint by ShellUtilities.hpp.
They are #defined by the shlobj.h-file in the BCB environment.
Also, I had to add the line "class DELPHICLASS TNamespace;" due to
a problem when the Pascal compiler is creating the .hpp-file.
(TNamespace gets reffered to before it's identified.)
In ShellUtilities.pas, I had to add one line, just below the
"interface" line :
{$HPPEMIT '#include <BCBShellUtilities.h>'}

If you want the file, I can upload it to the filearea of this group
and/or send it to you via e-mail, tell me what you prefer !

Also, I've been adding some new functionality in VET, if
you're interested to get the modified code, tell me that too !

The new stuff is :

Ability to add custom icons (and Nodes) to the FSystemImages
without disturbing the icons shown from the filesystem.
This made it neccesary to add a few events, functions and properties
to handle a CustomData pointer, making the App able to find out which
Icons, Text & Hints to be displayed for these icons

The new events are :
FOnGetCustomImageIndex: TVETOnGetCustomImageIndex;
FOnGetCustomText: TVETOnGetCustomText;
FOnGetCustomHint: TVETOnGetCustomText;

The new properties :
property NumCustomImgs: Integer read FNumCustomImgs;
property OnGetCustomImageIndex;
property OnGetCustomText;
property OnGetCustomHint;

The new public functions :
function GetCustomData(Node: PVirtualNode): Pointer;
function AddCustomIcon(var nIco: TIcon): Integer;
function AddCustomNode(ParentNode: PVirtualNode; Data: Pointer):
PVirtualNode;
procedure DeleteCustom(Idx: Integer);

Sadly, I can't make the AddCustomNode() to work before the CreateWnd()
procedure has been called, but at for me, it doesn't matter...

Hasta Luego !
/Mathias Thorell

 | Replies | Author | Date
1720 | Re: VET&BCB Solved(?) + some new VET-functionalit | Jim Kueneman | Thu 5/10/2001
1724 | Re: VET&BCB Solved(?) + some new VET-functionalit | Roland | Thu 5/10/2001
1756 | Re: VET&BCB Solved(?) + some new VET-functionalit | [tias@m...] | Fri 5/11/2001
1764 | VET 1.1.7 is ready | Jim Kueneman | Sat 5/12/2001
1765 | Re: VET 1.1.7 is ready | [adembaba@e...] | Sat 5/12/2001
1767 | Re: VET 1.1.7 is ready | Jim Kueneman | Sat 5/12/2001
1766 | Re: VET 1.1.7 --Active Property ? | [adembaba@e...] | Sat 5/12/2001
1768 | Re: VET 1.1.7 --Active Property ? | Jim Kueneman | Sat 5/12/2001
1769 | Re: VET 1.1.7 --Active Property ? | Jim Kueneman | Sat 5/12/2001


OLE DRAG AND DROP

From: "Juan Carlos" [jaristizabal@d...]
Date: Wed May 9, 2001 8:43 pm
Subject: OLE DRAG AND DROP

HELLO EVERY BODY,

I'll apreciate if some body could help me.

I'm trying to implement Ole drag and dorp. I allready used the example code I
found on Html help: OnDragDrop but it didn't work on my project.

Thank you

Juan Carlos Aristizabal M.

[Non-text portions of this message have been removed]

 | Replies | Author | Date
1728 | Re: OLE DRAG AND DROP | Mike Lischke | Thu 5/10/2001


re: VET&BCB Solved(?) + some new VET-functionality

From: Jim Kueneman [jimdk@m...]
Date: Thu May 10, 2001 1:24 am
Subject: Re: [VirtualTreeview] VET&BCB Solved(?) + some new VET-functionality

At 08:52 PM 5/9/2001 +0000, you wrote:

>I had to create a new .h-file (named it BCBShellUtilites.h) which
>contains some dummy declarations of the _di_IDropTarget,
>_di_IQueryInfo & _di_IContextMenu3 callses.

I can understand the IQueryInfo and IContextMenu3 but the IDropTarget is
unimaginable that it is not defined.

>a problem when the Pascal compiler is creating the .hpp-file.
>(TNamespace gets reffered to before it's identified.)

This is most likely because Delphi is a single pass compiler and does not
use prototypes like C (I hope I am using the right terminology, C is like
Greek to me!) So Delphi gives you a "forward" keyword where I can define
just the name of a class.... type
TNamespace = class

Doing such I can now use a TNamespace as a type in a data structure I want
to use in the TNamespace class. ??? Did you get that???? It makes it so a
TNamespace can know about TNamespaces in its declaration before it is fully
defined. Due to the single pass this would be impossible otherwise.

It sounds like BCB does not support that idea.

>If you want the file, I can upload it to the filearea of this group
>and/or send it to you via e-mail, tell me what you prefer !

Emailing them is fine.

[jimdk@m...]

>Also, I've been adding some new functionality in VET, if
>you're interested to get the modified code, tell me that too !
>
>The new stuff is :
>
>Ability to add custom icons (and Nodes) to the FSystemImages
>without disturbing the icons shown from the filesystem.

Are you actually manipulating the system image list? If so I would prefer
to say away from that!

Jim

 | Replies | Author | Date
1724 | Re: VET&BCB Solved(?) + some new VET-functionalit | Roland | Thu 5/10/2001
1756 | Re: VET&BCB Solved(?) + some new VET-functionalit | [tias@m...] | Fri 5/11/2001
1764 | VET 1.1.7 is ready | Jim Kueneman | Sat 5/12/2001
1765 | Re: VET 1.1.7 is ready | [adembaba@e...] | Sat 5/12/2001
1767 | Re: VET 1.1.7 is ready | Jim Kueneman | Sat 5/12/2001
1766 | Re: VET 1.1.7 --Active Property ? | [adembaba@e...] | Sat 5/12/2001
1768 | Re: VET 1.1.7 --Active Property ? | Jim Kueneman | Sat 5/12/2001
1769 | Re: VET 1.1.7 --Active Property ? | Jim Kueneman | Sat 5/12/2001
1772 | Re: VET 1.1.7 --Active Property ? | [adembaba@e...] | Sun 5/13/2001


re: VET&BCB Solved(?) + some new VET-functionality

From: "Jim Kueneman" [jimdk@m...]
Date: Thu May 10, 2001 3:37 am
Subject: Re: VET&BCB Solved(?) + some new VET-functionality

--- In [VirtualTreeview@y...], [tias@m...] wrote:
> Hello there, especially Jim !
>
> Finally I've managed to come to a solution for the
ShellUtilities.hpp-

Just to add to the confusion, I am reworking the ShellNotify and feel
using the reference counting of an interface is the way to go. I
remember some discussion on this subject with the inline editor with
Mike. Can BCB handle delphi interfaces?

Jim

 | Replies | Author | Date
1725 | Re: VET&BCB Solved(?) + some new VET-functionalit | Roland | Thu 5/10/2001


incremental search

From: [basil@r...]
Date: Thu May 10, 2001 4:53 am
Subject: incremental search

Hi, Mike.

Thank you for the proposal to implement
incremental searching. I am lack of time too.
So let's return to that proposal later if it is acceptable.
Btw, please, consider the possibility to include
the following function (it may be the first step
towards the incremental searching):

This function is for seaching a node for a pattern.

// search options:
// soExact - the pattern and the node's caption must match
// soInitial - the pattern must match the initial part of
// the node's caption
// soInternal - the node's caption must contain the pattern

TSearchOptions = (soExact, soInitial, soInternal);

function TVirtualStringTree.FindNode(
node:PVirtualNode; // node to start searching from,
// nil - start from the begining of a tree
pattern:String; // string to search for
column:Integer; // column to search through
caseSensitive:Boolean; // true - case sensitive searching
// false - case insensitive searching
searchOption:TSearchOptions // search option
):PVirtualNode;
var
nomorenodes,nodefound: Boolean;
snode:PVirtualNode;
s,d:String;
text:WideString;
begin
result:= nil;
snode:= node;
if (node = nil) then snode:= getFirst;
nomorenodes:= false;
while (nomorenodes = false) do
begin
OnGetText(self, snode, column, ttNormal, text);
s:= text;
d:= pattern;
if (caseSensitive = false) then
begin
s:= AnsiUpperCase(s);
d:= AnsiUpperCase(d);
end;
nodefound:= false;
case searchOption of
soExact: nodefound:= d = s;
soInitial: nodefound:= Pos(d,s) = 1;
soInternal: nodefound:= Pos(d,s) > 0;
end;
if (nodefound = true) then begin result:= snode; break; end;

snode:= getNext(snode);
if (snode = nil) then nomorenodes:= true;
end;
end;

Thanks.
Basil


re: problems with vt's events

From: "Roland" [Beduerftig@S...]
Date: Thu May 10, 2001 6:20 am
Subject: Re: problems with vt's events

Good morning,

> - in my event handler i do things to the tree that
> trigger new events
> - it seems that during some events i get invalid or non-initialized
> nodes. for example, when i call Tree.Clear, some events
> are executed

when you Clear() of course other event will be trigger, for example
the event for free a node and so on, normally is this not a problem,
but in special case you must use a semaphore, for example:

define a global variable

const
VTclearSema : boolean = false;

before you call Clear() set this semaphore
VTclearSema := true;
Clear();

and now you can ask in your events
if VTclearSema then Exit;

and at the end clear the semaphore with VTclearSema := false;

and now the problem will fixed

Note:

This is a workaround for a special things you must do in your
application, normally is this not the way to use VT.

have a nice day
Roland

 | Replies | Author | Date
1733 | Re: problems with vt's events | Moritz Franckenstein | Thu 5/10/2001
1735 | Re: problems with vt's events | Mike Lischke | Thu 5/10/2001
1744 | Re: problems with vt's events | Moritz Franckenstein | Fri 5/11/2001


re: VET&BCB Solved(?) + some new VET-functionality

From: "Roland" [Beduerftig@S...]
Date: Thu May 10, 2001 6:30 am
Subject: Re: VET&BCB Solved(?) + some new VET-functionality

Good morning Jim,

> It sounds like BCB does not support that idea.

No, there is no problem forward a class like as in Delphi, but in BCB
we must not use the keyword forward.

Note:

in the beginning to use VT under BCB we must change some position in
Delphicode and use forward a class, the reason was that Delphi must
created the correct HPP-file.

have a sunny day
Roland


re: VET&BCB Solved(?) + some new VET-functionality

From: "Roland" [Beduerftig@S...]
Date: Thu May 10, 2001 6:35 am
Subject: Re: VET&BCB Solved(?) + some new VET-functionality

Good morning Jim,

> > Finally I've managed to come to a solution for the
> ShellUtilities.hpp-
>
>
> Just to add to the confusion, I am reworking the ShellNotify and
feel
> using the reference counting of an interface is the way to go. I
> remember some discussion on this subject with the inline editor
with
> Mike. Can BCB handle delphi interfaces?

No not direct, read the last message BCB5: IVTEditLink and see the
Demoprogram in the file area in this group.

The very important information about to use interface with VT came
from Alexander and I implement this info in a demo program to show
how it really works.

have a sunny day
Roland


re: VET&BCB Solved(?) + some new VET-functional ity

From: Mike Lischke [public@l...]
Date: Thu May 10, 2001 7:23 am
Subject: RE: [VirtualTreeview] VET&BCB Solved(?) + some new VET-functional ity

> Also, I had to #undef all IEIFLAG_* and CSIDL_* constants that are
> declared as static const Shortint by ShellUtilities.hpp.

Couldn't this be solved by specifying {$externalsymbol} as in Windows.pas so
less editing of the translated C code is necessary.

> Also, I had to add the line "class DELPHICLASS TNamespace;" due to
> a problem when the Pascal compiler is creating the .hpp-file.

Here perhaps the HPPEMIT command may help again to avoid manually adding
this.

> In ShellUtilities.pas, I had to add one line, just below the
> "interface" line :
> {$HPPEMIT '#include <BCBShellUtilities.h>'}

Can this extra file be avoided somehow? Otherwise this must be maintained
too.

Ciao, Mike

 | Replies | Author | Date
1757 | Re: VET&BCB Solved(?) + some new VET-functional i | [tias@m...] | Fri 5/11/2001


New file uploaded to VirtualTreeview

From: [VirtualTreeview@yahoogroups.com>
Date: Thu May 10, 2001 7:32 am
Subject: New file uploaded to VirtualTreeview

Hello,

This email message is a notification to let you know that
a file has been uploaded to the Files area of the VirtualTreeview
group.

File : /OLE.zip
Uploaded by : [public@l...]
Description : Beta version (OLE/VCL drag'n drop, cut'n paste)

You can access this file at the URL

http://groups.yahoo.com/group/VirtualTreeview/files/OLE.zip

To learn more about file sharing for your group, please visit

http://help.yahoo.com/help/us/groups/files

Regards,

public@l...]


re: OLE DRAG AND DROP

From: Mike Lischke [public@l...]
Date: Thu May 10, 2001 7:32 am
Subject: RE: [VirtualTreeview] OLE DRAG AND DROP

Hi Juan,

> I'm trying to implement Ole drag and dorp. I allready used
> the example code I found on Html help:
> OnDragDrop but it didn't work on my project.

I just have uploaded one of the new demo projects (OLE). It is not finished
yet but works already quite well. It shows how to handle drag'n drop.
Download it from the VT file area of YG.

Ciao, Mike


re: Re: ActiveX

From: Mike Lischke [public@l...]
Date: Thu May 10, 2001 7:34 am
Subject: RE: [VirtualTreeview] Re: ActiveX

> i have an error when i resizing the IE form from the litle size

Mmh, what version of IE and what OS version do you use? I have tried the
page with IE6.0b and have no problems at all, regardless of the size of the
explorer window.

Ciao, Mike


re: incremental search

From: Mike Lischke [public@l...]
Date: Thu May 10, 2001 7:41 am
Subject: RE: [VirtualTreeview] incremental search

Hi Basil,

> Thank you for the proposal to implement
> incremental searching. I am lack of time too.
> So let's return to that proposal later if it is acceptable.

Well, I have implemented incremental searching now too. Because I was
thinking about it for quite a while it wasn't that hard to quickly find a
solution. It works forward and backward and uses an event
(OnIncrementalSearch) to do the actual comparation. This way I could include
it in the base tree class instead only the string tree.

I hope you are not angry about me asking you to find an implementation while
doing my own. There were several circumstances which caused me to implement
incremental search myself. Sorry.

Ciao, Mike


note about incremental searching

From: [basil@r...]
Date: Thu May 10, 2001 1:09 pm
Subject: note about incremental searching

Hi, Mike.

Your implementaion of searching is excellent indeed.
Thank you very much. I have just one note:
Would it be acceptable to add a property, say,
IncrementalSearchFrom with the two values:
sfDefault - to search from the last found (as it is now implemented)
sfFocused - to search from the focused node in order to have the
possibility to search the same pattern below or
above the last found.

Bye, Basil

 | Replies | Author | Date
1739 | Re: note about incremental searching | Mike Lischke | Fri 5/11/2001
1747 | Re: note about incremental searching | Werner Lehmann | Fri 5/11/2001


problem with right click select

From: "Moritz Franckenstein" [franckenstein@a...]
Date: Thu May 10, 2001 4:38 pm
Subject: problem with right click select

hi,

i dont get the popup menu on right click to work like in windows
explorer.

when you select multiple files in the explorer and then right click
on the selection, a popup menu appears.
and when nothing is selected and you right click on one file, this
file is selected and a popup menu appears also.

but in vt the first thing doesnt work when voRightClickSelect is set
(the selection is gone) and the second doesnt work if it is not (the
entry isnt selected).

is that my fault or can that be fixed inside vt?

-moritz

 | Replies | Author | Date
1787 | Re: problem with right click select | Moritz Franckenstein | Mon 5/14/2001
1799 | Re: problem with right click select | Mike Lischke | Tue 5/15/2001
1809 | Re: problem with right click select | Moritz Franckenstein | Tue 5/15/2001
1802 | Re: problem with right click select | Mike Lischke | Tue 5/15/2001
1805 | Re: problem with right click select | Moritz Franckenstein | Tue 5/15/2001
1810 | Re: problem with right click select | Mike Lischke | Tue 5/15/2001
1819 | Re: problem with right click select | Mike Lischke | Wed 5/16/2001
1823 | Re: problem with right click select | Moritz Franckenstein | Wed 5/16/2001
1824 | Re: problem with right click select | Mike Lischke | Wed 5/16/2001


re: problems with vt's events

From: "Moritz Franckenstein" [franckenstein@a...]
Date: Thu May 10, 2001 4:43 pm
Subject: Re: problems with vt's events

--- In [VirtualTreeview@y...], "Roland" [Beduerftig@S...] wrote:

> Note:
>
> This is a workaround for a special things you must do in your
> application, normally is this not the way to use VT.

thank you for your info, but i think there must be a better solution.
should i maybe post a message to myself inside the event handler
instead of doing my updates?

here is a description of what i am trying to do:

i have placed a graphic component next to the tree that draws lines
to each tree node to make visual links to another component.
and that lines have to be updated when the position of the nodes
change.
what is the best way to do that?

-moritz

 | Replies | Author | Date
1735 | Re: problems with vt's events | Mike Lischke | Thu 5/10/2001
1744 | Re: problems with vt's events | Moritz Franckenstein | Fri 5/11/2001


Enabled/Disabled bug

From: "Vadim Sedulin" [wsntrl@o...]
Date: Thu May 10, 2001 7:53 pm
Subject: Enabled/Disabled bug

Hello Mike!

After "Form.Enabled := False; ... Form.Enabled := True;" nodes remain
grayed, even after selection changed.

Bye.

Vadim Sedulin
E-Mail: [wsntrl@o...]

 | Replies | Author | Date
1742 | Re: Enabled/Disabled bug | Mike Lischke | Fri 5/11/2001
1751 | Re: Enabled/Disabled bug | Vadim Sedulin | Fri 5/11/2001
1773 | Re: Enabled/Disabled bug | Mike Lischke | Sun 5/13/2001


re: Re: problems with vt's events

From: "Mike Lischke" [public@l...]
Date: Thu May 10, 2001 4:59 pm
Subject: RE: [VirtualTreeview] Re: problems with vt's events

> i have placed a graphic component next to the tree that draws lines
> to each tree node to make visual links to another component.
> and that lines have to be updated when the position of the nodes
> change.
> what is the best way to do that?

Perhaps the OnScroll event is what you are looking for?

Ciao, Mike

 | Replies | Author | Date
1744 | Re: problems with vt's events | Moritz Franckenstein | Fri 5/11/2001


re: Bug in TVirtualTreeHintWindow?

From: "Vadim Sedulin" [wsntrl@o...]
Date: Thu May 10, 2001 8:05 pm
Subject: Re: [VirtualTreeview] Bug in TVirtualTreeHintWindow?

Hello Mike!

> Hi Radoslaw,
>
> > I noticed, that the custom hint window lives longer than the
> > tree object for which it was created.
>
> This is due to the internal handling of hint windows. I have no influence
on
> it. The only way to explicitely destroy the VT hint window would be to
> switch off and on TApplciation.ShowHint property.

How about Application.HideHint? This method used by many VCLs.

Bye.

Vadim Sedulin
E-Mail: [wsntrl@o...]


Mousedown, Column Color and Selection rectangle...

From: [andersthomsen@h...]
Date: Thu May 10, 2001 8:04 pm
Subject: Mousedown, Column Color and Selection rectangle...

...has nothing to do with each other : )

Okay, I have some questions and request:

1)
Could you make VT (optionable?) so that the OnMouseDown is triggered
AFTER the selection is changed when clicking in the tree? I need this
since I sometimes need to popup a menu when rightclicking in the
tree, and sometimes I don't need to pop it up. That's why I'm calling
the menu from onMouseDown instead of using the PopUpMenu property.
And wether the menu should popup is determined by the selected nodes.

2)
How to change the text and bckcolor of the columns? I tried to use
OndrawHeader, but I can't get it to work

3)
Is it possible to disable the selection rectangle, since I would like
to use every mousedown+mousemove to drag'n'drop.

That should be it : )

PS. I'm the one who complained about incorrect/missing redrawing of
the tree. I mentioned that I'm using it in a winamp plugin, and this
must be the problem. However, I solved the issue by adding
tree.repaint to the OnPaint event of the parent form.

Best regards,
Anders thomsen


Paint bug during OLE dd?

From: "Paul Istrate" [istech@c...]
Date: Fri May 11, 2001 12:42 am
Subject: Paint bug during OLE dd?

Hi Mike,

I encount a strange behaviour during OLE dd. It is about repainting
DropTargetNode.

I have a tree which has enough nodes to activate vertical scrollbar.
During DD image is displayed if I move mouse (with button pressed, of
course) to, let's say, bottom margin, tree scrolls toward last nodes. That's
OK.

When last node is hit, if you reverse mouse move (also, with button pressed)
all nodes touched are painted upper than initial position.

If action is performed toward top margin, when come down, all nodes touched
are paintend lower than initial position.

I noticed that vertical scrollbar does not reach bottom/top margin when last
(first) node is displayed.

I check OLE.exe demo uploaded by you and same behaviour is present.

Regards,
Paul Istrate

 | Replies | Author | Date
1740 | Re: Paint bug during OLE dd? | Mike Lischke | Fri 5/11/2001


re: note about incremental searching

From: Mike Lischke [public@l...]
Date: Fri May 11, 2001 8:12 am
Subject: RE: [VirtualTreeview] note about incremental searching

Hi Basil,

> Would it be acceptable to add a property, say,
> IncrementalSearchFrom with the two values:
> sfDefault - to search from the last found (as it is now implemented)
> sfFocused - to search from the focused node in order to have the
> possibility to search the same pattern below or
> above the last found.

Okay, I have implemented a very similar approach. I added the property you
proposed (I actually named it IncrementalSearchStart) and also a third
option (ssAlwaysStartOver) together with ssLastHit and ssFocusedNode. Wait
for next upload.

Ciao, Mike


re: Paint bug during OLE dd?

From: Mike Lischke [public@l...]
Date: Fri May 11, 2001 9:11 am
Subject: RE: [VirtualTreeview] Paint bug during OLE dd?

Hi Paul,

> I encount a strange behaviour during OLE dd. It is about repainting
> DropTargetNode.

Yes, I know this effect, but have no solution yet. Somehow the last paint
does not come through. I still have to investigate this problem.

Ciao, Mike


re: Mousedown, Column Color and Selection recta ngle...

From: Mike Lischke [public@l...]
Date: Fri May 11, 2001 9:10 am
Subject: RE: [VirtualTreeview] Mousedown, Column Color and Selection recta ngle...

Hi Anders,

> 1)
> Could you make VT (optionable?) so that the OnMouseDown is triggered
> AFTER the selection is changed when clicking in the tree?

Mmh, I could but I don't want. This would prevent the application or
descentants from modifying the message before it is handled by the tree.
Making it optional would produce more trouble than it solves. I know there
are many things which could be added but VT is already huge, so let us be
careful with additions.

> 2)
> How to change the text and bckcolor of the columns? I tried to use
> OndrawHeader, but I can't get it to work

Try setting hoOwnerDraw in Header.Options.

> 3)
> Is it possible to disable the selection rectangle, since I would like
> to use every mousedown+mousemove to drag'n'drop.

Okay, I have included a new option called voDisableDrawSelection. This will
do what you want. Wait for next upload.

To all:
The options property of Virtual Treeview is now filled up with 32 entries.
It is impossible to add more because it is a published property which may
only be four bytes long. Just to let you know.

Ciao, Mike

 | Replies | Author | Date
1800 | Re: Mousedown, Column Color and Selection recta n | Mike Lischke | Tue 5/15/2001


re: Enabled/Disabled bug

From: Mike Lischke [public@l...]
Date: Fri May 11, 2001 8:48 am
Subject: RE: [VirtualTreeview] Enabled/Disabled bug

Hi Vadim,

> After "Form.Enabled := False; ... Form.Enabled := True;" nodes remain
> grayed, even after selection changed.

Do you use the latest build? If I disable a form with a VT then its node
don't become grayed at all (and look as usual when enabled again). Nodes are
painted grayed only if the tree itself is disabled. But also this works
here. Can you elaborate more and perhaps send me a demo?

Ciao, Mike


re: Bug in TVirtualTreeHintWindow?

From: Mike Lischke [public@l...]
Date: Fri May 11, 2001 8:52 am
Subject: RE: [VirtualTreeview] Bug in TVirtualTreeHintWindow?

> How about Application.HideHint? This method used by many VCLs.

HideHint does not destroy the last hint window. It only hides it. Also
CancelHint (which does more than only hiding the hint) does not free the
hint window. There is a private variable in TApplication which keeps the
last created hint window and this is only changed if CM_HINTSHOW returns a
new class or TApplication.ShowHint is set to False. That is the reason why
VT cannot destroy its own hint window.

Ciao, Mike


re: problems with vt's events

From: "Moritz Franckenstein" [franckenstein@a...]
Date: Fri May 11, 2001 9:57 am
Subject: Re: problems with vt's events

--- In [VirtualTreeview@y...], "Mike Lischke" [public@l...] wrote:
> > i have placed a graphic component next to the tree that draws
lines
> > to each tree node to make visual links to another component.
> > and that lines have to be updated when the position of the nodes
> > change.
> > what is the best way to do that?
>
> Perhaps the OnScroll event is what you are looking for?

it seems that you didnt read the complete thread about this - of
course i have used that event and also had to put the update into
several other events, because every change in the tree like expanding
a node has also to be reflected.
but all this causes problems like access violations and funny
behaviour due to invalid or non-initialized nodes.

here is the initial message of mine:
http://groups.yahoo.com/group/VirtualTreeview/message/1710

-moritz


Incremental Searching

From: Werner Lehmann [wl@b...]
Date: Fri May 11, 2001 10:02 am
Subject: Incremental Searching

Mike,

I like your i.s. implementation. There is only one thing: a new search
always starts from the top (in forward search mode). That is because
you do

FLastSearchNode := nil;

when one search is finished. The usual explorer behaviour is different:
the search always starts with the focused node. If you have 20 nodes all
beginning with 'a', you could cycle through them with subsequent 'a'-key
presses. Not so with the current i.s. implementation which throws you
back to the first 'a'-node.

Another difference to the explorer way of searching is wrap around: currently
we don't have a search wrap around at the end of the node list.

Should be considerably easy to change, unless you had something special
in mind with FLastSearchNode for not using the focused node. What do you
think?

Regards,
Werner

 | Replies | Author | Date
1780 | Re: Incremental Searching | Mike Lischke | Sun 5/13/2001
1783 | Re: Incremental Searching | Werner Lehmann | Sun 5/13/2001
1798 | Re: Incremental Searching | Mike Lischke | Tue 5/15/2001
1801 | Re: Incremental Searching | Mike Lischke | Tue 5/15/2001
1882 | Re: Incremental Searching | Werner Lehmann | Sat 5/19/2001
1894 | Re: Incremental Searching | Mike Lischke | Mon 5/21/2001
1918 | Re: Incremental Searching | Mike Lischke | Mon 5/21/2001
1883 | Re: Incremental Searching | Werner Lehmann | Sat 5/19/2001
1888 | Re: Incremental Searching | Mike Lischke | Sun 5/20/2001


VET suggestion

From: "Fraser, Pete [Soundcraft UK]" [pete.fraser@f...]
Date: Fri May 11, 2001 10:20 am
Subject: VET suggestion

I don't know if anyone has suggested this, or even if it is already in
there....but.... do you have a filter option in VET which allows you to only
display certain types of files or even NOT to display certain types of
files.
This is a feature I'm often wanting in Explorer and had on my old Atari ST
Neodesk add-in.

Just my 2p worth

Rgds Pete

[Non-text portions of this message have been removed]

 | Replies | Author | Date
1749 | Re: VET suggestion | Jim Kueneman | Fri 5/11/2001


re: note about incremental searching

From: Werner Lehmann [wl@b...]
Date: Fri May 11, 2001 10:15 am
Subject: Re: [VirtualTreeview] note about incremental searching

Mike Lischke wrote:
>
> Okay, I have implemented a very similar approach. I added the property you
> proposed (I actually named it IncrementalSearchStart) and also a third
> option (ssAlwaysStartOver) together with ssLastHit and ssFocusedNode. Wait
> for next upload.

Mike,

I have seen this message too late, please ignore my last posting about that
topic. I will check out your new version first....

Werner


TopRow

From: [andersthomsen@h...]
Date: Fri May 11, 2001 11:57 am
Subject: TopRow

Hi,

I'm requesting a way to set the "TopRow". When updating a tree, I
would like to have the Vertical scroll position stored and then
recalled again after clearing the tree and adding new nodes.
I've tried reading the TopNode and then setting the TopNode = the
node I would like to have as the TopNode. But this won't work.
-Thomsen

 | Replies | Author | Date
1750 | Re: TopRow | Radoslaw Klocek | Fri 5/11/2001
1758 | Re: TopRow | Paul Istrate | Fri 5/11/2001
1775 | Re: TopRow | Mike Lischke | Sun 5/13/2001


re: VET suggestion

From: Jim Kueneman [jimdk@m...]
Date: Fri May 11, 2001 12:10 pm
Subject: Re: [VirtualTreeview] VET suggestion

At 11:20 AM 5/11/2001 +0100, you wrote:
>I don't know if anyone has suggested this, or even if it is already in
>there....but.... do you have a filter option in VET which allows you to only
>display certain types of files or even NOT to display certain types of

OnEnumFolder does not do what you want? It allows you to look at every
object a folder is enumerating and choose if you want it to be
displayed. The parameters are the new object (TNamespace) and if it should
be allowed to be in the tree (AllowAsChild)

Jim


re: TopRow

From: "Radoslaw Klocek" [radekk@p...]
Date: Fri May 11, 2001 12:11 pm
Subject: Re: [VirtualTreeview] TopRow

----- Original Message -----
From: [andersthomsen@h...]
To: <VirtualTreeview@yahoogroups.com>
Sent: Friday, May 11, 2001 1:57 PM
Subject: [VirtualTreeview] TopRow

> Hi,
>
> I'm requesting a way to set the "TopRow". When updating a tree, I
> would like to have the Vertical scroll position stored and then
> recalled again after clearing the tree and adding new nodes.
> I've tried reading the TopNode and then setting the TopNode = the
> node I would like to have as the TopNode. But this won't work.
> -Thomsen
>

It works. Maybe you set the TopNode before EndUpdate?

--
Radoslaw Klocek


re: Enabled/Disabled bug

From: "Vadim Sedulin" [wsntrl@o...]
Date: Fri May 11, 2001 12:49 pm
Subject: Re: [VirtualTreeview] Enabled/Disabled bug

Hello Mike!

> Do you use the latest build? If I disable a form with a VT then its node
> don't become grayed at all (and look as usual when enabled again). Nodes
are
> painted grayed only if the tree itself is disabled. But also this works
> here. Can you elaborate more and perhaps send me a demo?

Yes. VT 2.4.5, 2.4.7...

====
unit Unit1;

interface

uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
Buttons, VirtualTrees;

type
TForm1 = class(TForm)
VTree: TVirtualStringTree;
SpeedButton1: TSpeedButton;
procedure FormCreate(Sender: TObject);
procedure SpeedButton1Click(Sender: TObject);
private
public
end;

var
Form1: TForm1;

implementation

{$R *.DFM}

procedure TForm1.FormCreate(Sender: TObject);
var
Node: PVirtualNode;
begin
Node := VTree.AddChild(nil);
Node := VTree.AddChild(Node);
Node := VTree.AddChild(Node);
end;

procedure TForm1.SpeedButton1Click(Sender: TObject);
begin
Enabled:=False;
MessageBox(Handle,'Close me','Hello',MB_OK);
Enabled:=True;
end;

end.
====

When main form disabled, node background changed to gray. And it is not
restored until main form minimized/maximized.

Bye.

Vadim Sedulin
E-Mail: [wsntrl@o...]


re: Bug in TVirtualTreeHintWindow?

From: "Vadim Sedulin" [wsntrl@o...]
Date: Fri May 11, 2001 12:21 pm
Subject: Re: [VirtualTreeview] Bug in TVirtualTreeHintWindow?

Hello Mike!

> HideHint does not destroy the last hint window. It only hides it. Also
> CancelHint (which does more than only hiding the hint) does not free the
> hint window. There is a private variable in TApplication which keeps the
> last created hint window and this is only changed if CM_HINTSHOW returns a
> new class or TApplication.ShowHint is set to False. That is the reason why
> VT cannot destroy its own hint window.

Aha, never know. Thanks.

Bye.

Vadim Sedulin
E-Mail: [wsntrl@o...]


VirtualTree accepts dropped files

From: [andersthomsen@h...]
Date: Fri May 11, 2001 1:23 pm
Subject: VirtualTree accepts dropped files

Greetings,

Has anyone got some example code on how to make VT accept dropped
files from e.g. explorer, and to drag files from VT to explorer.
I've tried looking at VET but it doesn't make much sense to me : )

-Thomsen

 | Replies | Author | Date
1759 | Re: VirtualTree accepts dropped files | Jim Kueneman | Fri 5/11/2001
1774 | Re: VirtualTree accepts dropped files | Mike Lischke | Sun 5/13/2001


OnChildInit...

From: [Thorsten.Claus@c...]
Date: Fri May 11, 2001 5:25 am
Subject: OnChildInit...

Hi,
I tried to get the "OnChildInit" to work and got some strange behaviour:

Situation:
----------
I've got a directory tree with a file describing the subdirectories.
I want to display the initial root directory with a +sign right to it (if there
are subdirs).
When Opening, the new nodes should be initialized with the description from the
file.

I tried [pseudocode]:
--------

VSTInitChildren(...)
begin
FreeAllObjectsAndClear(GlobalStringList);
currentNodeToInit := 0;
while not EOF(descriptionfile) do begin
data := ReadDataFrom(descriptionfile);
GlobaStringList.AddObject(data.string, data);
inc(ChildCount);
end;
end;

after this event the event "OnInitNode" is fired:

VSTInitNode(...)
begin
if not Assigned(ParentNode) then exit; //we are root
if (GlobalStringList.Count > 0) and
(currentNodeToInit < GlobalStringList.Count) do begin
pNodeData := Sender.GetNodeData(Node);
InitNodeFromObject(pNodeData, GlobalStringList.Objects[currentNodeToInit]);
Inc(currentNodeToInit);
end;
end;

The Problem:
------------
When scrolling fast through the tree with the cursor keys, sometimes my
"GlobalStringList" is not filled properly and I have less Objects in that list
than childnodes to add.

So how can I make my program work correctly?

Clueless,
Thorsten Claus

 | Replies | Author | Date
1760 | Re: OnChildInit... | Werner Lehmann | Fri 5/11/2001


re: Re: GDI crash problem on W95 and "ShortenSt ring "

From: Björn Lindell [bli@c...]
Date: Fri May 11, 2001 1:53 pm
Subject: Re: [VirtualTreeview] Re: GDI crash problem on W95 and "ShortenSt ring "

The error occured once again, clearly due to low system resources.
I tried exchanging "GetTextExtentPoint32W" with "GetTextExtentPoint32A"
at the two places in "ShortenString", and then the error actually
disappeared.

As I am not good with unicode (and the VT source), is there any risk
with having the "A" variant apart from the fact that the shorten string
result
might be incorrect (typically returning a longer/shorter string than
necessary).
I could only see it would affect what is display, not any other side
effects. And
that is far better than having the app crash...
Obviously, I dont imply adding this to VT in anyway, since it cripples the
Unicode
support somewhat, and I'm the only one with the problem. I am just going to
patch
my source with this.

----- Original Message -----
From: "Mike Lischke" [public@l...]
To: <VirtualTreeview@yahoogroups.com>
Sent: Wednesday, May 09, 2001 1:15 PM
Subject: RE: [VirtualTreeview] Re: GDI crash problem on W95 and "ShortenSt
ring "

> Hi Bjorn,
>
> > My advice is to do nothing, unless you hear something that puts you
> > right onto the "solution". This kind of problem I have occurs rarely,
> > and is hard to track down as to the actual problem. And there are
> > probably a lot of other more important issues to attend to than this
> > bug :-)
>
> Okay, I'll keep that in mind for a while and if there are more complains I
> will look for a Win95 machine (could become difficult though).
>
> Ciao, Mike
>
> To unsubscribe from this group, send an email to:
> VirtualTreeview-unsubscribe@egroups.com
>
>
>
> Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
>
>


re: VET&BCB Solved(?) + some new VET-functionality

From: [tias@m...]
Date: Fri May 11, 2001 2:01 pm
Subject: Re: VET&BCB Solved(?) + some new VET-functionality

--- In [VirtualTreeview@y...], Jim Kueneman [jimdk@m...] wrote:
> At 08:52 PM 5/9/2001 +0000, you wrote:
>
>
> >I had to create a new .h-file (named it BCBShellUtilites.h) which
> >contains some dummy declarations of the _di_IDropTarget,
> >_di_IQueryInfo & _di_IContextMenu3 callses.
>
> I can understand the IQueryInfo and IContextMenu3 but the
IDropTarget is
> unimaginable that it is not defined.

The base classes are declared as virtual classes in shlobj.h
(IQueryInfo, IContextMenu3 and IDropTarget).
But there's nothing declared with the prfix "_di_" that Delphi adds
:-(

> This is most likely because Delphi is a single pass compiler and
does not
> use prototypes like C (I hope I am using the right terminology, C is
like
> Greek to me!) So Delphi gives you a "forward" keyword where I can
define
> just the name of a class.... type
> TNamespace = class
>
> Doing such I can now use a TNamespace as a type in a data structure
I want
> to use in the TNamespace class. ??? Did you get that???? It makes
it so a
> TNamespace can know about TNamespaces in its declaration before it
is fully
> defined. Due to the single pass this would be impossible otherwise.
>
> It sounds like BCB does not support that idea.

Yep, that's supported in C++, but the Delphi compiler swaps the pascal
lines

TNamespace = class;
TPIDLArray = array of PItemIDList;
TRelativePIDLArray = TPIDLArray;
TAbsolutePIDLArray = TPIDLArray;
TNamespaceArray = array of TNamespace;

to

typedef DynamicArray<Shlobj::PItemIDList > TPIDLArray;
typedef DynamicArray<Shlobj::PItemIDList > TRelativePIDLArray;
typedef DynamicArray<Shlobj::PItemIDList > TAbsolutePIDLArray;
typedef DynamicArray<TNamespace* > TNamespaceArray;
class DELPHICLASS TNamespace;

I have no idea why it does this...

> Are you actually manipulating the system image list? If so I would
prefer
> to say away from that!

Yep, I know it's not the most safe solution, but I have never found
out how to use two different ImageLists in any VCL conmponent so
far...
I'll keep it for myself (deriving from VET insted), oki ?

/Mathias

 | Replies | Author | Date
1764 | VET 1.1.7 is ready | Jim Kueneman | Sat 5/12/2001
1765 | Re: VET 1.1.7 is ready | [adembaba@e...] | Sat 5/12/2001
1767 | Re: VET 1.1.7 is ready | Jim Kueneman | Sat 5/12/2001
1766 | Re: VET 1.1.7 --Active Property ? | [adembaba@e...] | Sat 5/12/2001
1768 | Re: VET 1.1.7 --Active Property ? | Jim Kueneman | Sat 5/12/2001
1769 | Re: VET 1.1.7 --Active Property ? | Jim Kueneman | Sat 5/12/2001
1772 | Re: VET 1.1.7 --Active Property ? | [adembaba@e...] | Sun 5/13/2001
1785 | Re: VET 1.1.7 --Active Property ? | Jim Kueneman | Mon 5/14/2001
1786 | Re: VET 1.1.7 --Active Property ? | [adembaba@e...] | Mon 5/14/2001


re: VET&BCB Solved(?) + some new VET-functional ity

From: [tias@m...]
Date: Fri May 11, 2001 2:09 pm
Subject: Re: VET&BCB Solved(?) + some new VET-functional ity

--- In [VirtualTreeview@y...], Mike Lischke [public@l...] wrote:
>> Also, I had to #undef all IEIFLAG_* and CSIDL_* constants that are
>> declared as static const Shortint by ShellUtilities.hpp.
>
> Couldn't this be solved by specifying {$externalsymbol} as in
Windows.pas so
> less editing of the translated C code is necessary.

The problem (I'm not too familiar with {$externalsymbol}) as I see it
is that these constants are #defined, not declared as const's,
teherfore it's not a true symbol, it's just a preprocesser directive.

>> Also, I had to add the line "class DELPHICLASS TNamespace;" due to
>> a problem when the Pascal compiler is creating the .hpp-file.

> Here perhaps the HPPEMIT command may help again to avoid manually
adding
> this.

Yep, you're completly right about that. (See below also ;-)

>> In ShellUtilities.pas, I had to add one line, just below the
>> "interface" line :
> > {$HPPEMIT '#include <BCBShellUtilities.h>'}

> Can this extra file be avoided somehow? Otherwise this must be
maintained
> too.

Heh, in my first attempts, I used HPPEMIT for everything, although it
made the ShellUtilities.pas file look a little messed up, but to avoid
a separate hpp-file the answer is yes, it can all be contained in the
.pas file, using the HPPEMIT directive.

Hasta Luego !
/Mathias T.


re: TopRow

From: "Paul Istrate" [istech@c...]
Date: Fri May 11, 2001 2:19 pm
Subject: Re: [VirtualTreeview] TopRow

Hi Andres,

Save then Node and then use ScrollIntoView.

I hope will help you.

Regards,
Paul Istrate


re: VirtualTree accepts dropped files

From: Jim Kueneman [jimdk@m...]
Date: Fri May 11, 2001 2:41 pm
Subject: Re: [VirtualTreeview] VirtualTree accepts dropped files

At 01:23 PM 5/11/2001 +0000, you wrote:
>Greetings,
>
>Has anyone got some example code on how to make VT accept dropped
>files from e.g. explorer, and to drag files from VT to explorer.
>I've tried looking at VET but it doesn't make much sense to me : )

Really? It makes sense to me <g> There are a few ways.

1) To only accept files look at WM_DROPFILES
2) Use these components http://www.melander.dk/delphi/dragdrop/
3) Learn about COM drag and drop (sort of used in VET, only I did not have
to do any of the hard work the namespaces created the databojects)

Jim


re: OnChildInit...

From: Werner Lehmann [wl@b...]
Date: Fri May 11, 2001 4:16 pm
Subject: Re: [VirtualTreeview] OnChildInit...

"Thorsten.Claus" wrote:
>
> Hi,
> I tried to get the "OnChildInit" to work and got some strange behaviour:
>
> VSTInitNode(...)
> begin
> if not Assigned(ParentNode) then exit; //we are root
> if (GlobalStringList.Count > 0) and
> (currentNodeToInit < GlobalStringList.Count) do begin
> pNodeData := Sender.GetNodeData(Node);
> InitNodeFromObject(pNodeData,
GlobalStringList.Objects[currentNodeToInit]);
> Inc(currentNodeToInit);
> end;
> end;

Thorsten,

it seems to me that you rely on a node init order, probably top down or
something.
I believe that you must not rely on that. Even at the danger that Mike might
beat
me :) I suggest you try to use the AddChild method and initialize your nodes not
in OnInitNode:

Node := AddChild(a parent node or nil);
// set node data here
Tree.InvalidateNode(Node);

I am not using InitNode or FreeNode at all. As far as I can tell they can only
be
used if the data to be init'ed can be resolved from the knowledge about the
parent
node in OnInitNode.

Another way for you might be to find out which child index the current node in
OnInitNode has (you'll have to count probably) and use that as an index into
your
stringlist.

Werner


Using custom calendar

From: Juan [usamge@f...]
Date: Fri May 11, 2001 5:36 pm
Subject: Using custom calendar

Hi,

Can I use a custom calendar?

TIA,
Juan.

 | Replies | Author | Date
1777 | Re: Using custom calendar | Mike Lischke | Sun 5/13/2001


Autoscroll doesn't work

From: [andersthomsen@h...]
Date: Fri May 11, 2001 7:00 pm
Subject: Autoscroll doesn't work

Greets,

I have a tree with these properties:
AutoScrollDelay = 300
AutoScrollInterval = 1
DragMode = Automatic
DragType = VCL
vsAutoscroll in Options
vsAcceptOLEdrops NOT in Options

OnDragOver is always "Accept = true"

I use it for moving nodes around the tree, not to other trees.
I use a Drag'n'Drop component to drop files from explorer to it, and
here the autoscroll works fine. It also works when multiselecting
with the selection rectangle.

-Thomsen

 | Replies | Author | Date
1776 | Re: Autoscroll doesn't work | Mike Lischke | Sun 5/13/2001
1866 | Re: Autoscroll doesn't work | [andersthomsen@h...] | Fri 5/18/2001
1867 | Re: Autoscroll doesn't work | Jim Kueneman | Fri 5/18/2001
1868 | Re: Autoscroll doesn't work | [andersthomsen@h...] | Fri 5/18/2001
1874 | Re: Autoscroll doesn't work | Mike Lischke | Sat 5/19/2001


New file uploaded to VirtualTreeview

From: [VirtualTreeview@yahoogroups.com>
Date: Sat May 12, 2001 4:11 am
Subject: New file uploaded to VirtualTreeview

Hello,

This email message is a notification to let you know that
a file has been uploaded to the Files area of the VirtualTreeview
group.

File : /VET_V1.1.7.zip
Uploaded by : [jimdk@m...]
Description : VET version 1.1.7 with Updated Demo by benadembaba (not sure
where to break that up <g>))

You can access this file at the URL

http://groups.yahoo.com/group/VirtualTreeview/files/VET_V1.1.7.zip

To learn more about file sharing for your group, please visit

http://help.yahoo.com/help/us/groups/files

Regards,

jimdk@m...]


VET 1.1.7 is ready

From: Jim Kueneman [jimdk@m...]
Date: Sat May 12, 2001 4:19 am
Subject: VET 1.1.7 is ready

Finally, I think the notification and image thread issues are fixed. By
the time I was finished I rewrote most methods that handle these tasks and
they are now much tighter and cleaner. I think it is noticable faster in
these areas, but maybe it is just because I have been working on it so
long <g>

The real internal build number won't fit in a LongInt so I decided to up it
to where Mike has his VT. I think I will do this so it is easy to know
what version of VT the release of VET was tested on.

Also the demo is reworked slightly to be more "weird screen settings"
friendly, thanks to "benadembaba " ( If you tell me how to break this up to
your actual name I wll add it to the credits)

I have not yet tested it competely on NT4 yet.

Feedback is appreciated,

Enjoy,
Jim

 | Replies | Author | Date
1765 | Re: VET 1.1.7 is ready | [adembaba@e...] | Sat 5/12/2001
1767 | Re: VET 1.1.7 is ready | Jim Kueneman | Sat 5/12/2001
1766 | Re: VET 1.1.7 --Active Property ? | [adembaba@e...] | Sat 5/12/2001
1768 | Re: VET 1.1.7 --Active Property ? | Jim Kueneman | Sat 5/12/2001
1769 | Re: VET 1.1.7 --Active Property ? | Jim Kueneman | Sat 5/12/2001
1772 | Re: VET 1.1.7 --Active Property ? | [adembaba@e...] | Sun 5/13/2001
1785 | Re: VET 1.1.7 --Active Property ? | Jim Kueneman | Mon 5/14/2001
1786 | Re: VET 1.1.7 --Active Property ? | [adembaba@e...] | Mon 5/14/2001


re: VET 1.1.7 is ready

From: [adembaba@e...]
Date: Sat May 12, 2001 4:31 am
Subject: Re: VET 1.1.7 is ready

> Also the demo is reworked slightly to be more "weird screen
settings"
> friendly, thanks to "benadembaba " ( If you tell me how to break
this up to
> your actual name I wll add it to the credits)

Even though I dont believe my touch-ups are at all creditworthy
(I frankly dont), the name is Adem Baba..

I have not been able to d/l the code yet --I keep getting an
'Ooooops!' messsage from the server.

Cheers,

Adem

 | Replies | Author | Date
1767 | Re: VET 1.1.7 is ready | Jim Kueneman | Sat 5/12/2001


re: VET 1.1.7 --Active Property ?

From: [adembaba@e...]
Date: Sat May 12, 2001 4:45 am
Subject: Re: VET 1.1.7 --Active Property ?

Hi Jim,

I have just d/l'ed VET and it simply great.

I am just wondering if it should not have an
Active property. This could be useful when you
want to avoid the --sometimes-- lengthy load-times.

Just an idea,

Cheers,

Adem

 | Replies | Author | Date
1768 | Re: VET 1.1.7 --Active Property ? | Jim Kueneman | Sat 5/12/2001
1769 | Re: VET 1.1.7 --Active Property ? | Jim Kueneman | Sat 5/12/2001
1772 | Re: VET 1.1.7 --Active Property ? | [adembaba@e...] | Sun 5/13/2001
1785 | Re: VET 1.1.7 --Active Property ? | Jim Kueneman | Mon 5/14/2001
1786 | Re: VET 1.1.7 --Active Property ? | [adembaba@e...] | Mon 5/14/2001


re: Re: VET 1.1.7 is ready

From: Jim Kueneman [jimdk@m...]
Date: Sat May 12, 2001 4:49 am
Subject: Re: [VirtualTreeview] Re: VET 1.1.7 is ready

At 04:31 AM 5/12/2001 +0000, you wrote:
>Even though I dont believe my touch-ups are at all creditworthy
>(I frankly dont), the name is Adem Baba..

Any effort should be rewarded (especially at the salary I pay <g>)

>I have not been able to d/l the code yet --I keep getting an
>'Ooooops!' messsage from the server.

I deleted it then reuploaded it (it had a 400k .map file in it) right
after my email, Try again.

Jim


re: Re: VET 1.1.7 --Active Property ?

From: Jim Kueneman [jimdk@m...]
Date: Sat May 12, 2001 4:55 am
Subject: Re: [VirtualTreeview] Re: VET 1.1.7 --Active Property ?

At 04:45 AM 5/12/2001 +0000, you wrote:
>Hi Jim,
>
>I have just d/l'ed VET and it simply great.

Thanks, I just found the image thread is not as "thread safe" as it could
be. You have to use 2 VET and sync them together so one is constantly
creating and destroying the tree then scroll the other as fast as you can
with the keyboard and eventually it will have deleted a node during the
time the image is being retrieved. I see how but I don't see an easy way
to detect this case, I love multiple threads .............

>I am just wondering if it should not have an
>Active property. This could be useful when you
>want to avoid the --sometimes-- lengthy load-times.

Elaborate a bit more on what you are looking mean and how you would use it.

Jim

 | Replies | Author | Date
1769 | Re: VET 1.1.7 --Active Property ? | Jim Kueneman | Sat 5/12/2001
1772 | Re: VET 1.1.7 --Active Property ? | [adembaba@e...] | Sun 5/13/2001
1785 | Re: VET 1.1.7 --Active Property ? | Jim Kueneman | Mon 5/14/2001
1786 | Re: VET 1.1.7 --Active Property ? | [adembaba@e...] | Mon 5/14/2001


re: Re: VET 1.1.7 --Active Property ?

From: Jim Kueneman [jimdk@m...]
Date: Sat May 12, 2001 4:57 am
Subject: Re: [VirtualTreeview] Re: VET 1.1.7 --Active Property ?

At 09:55 PM 5/11/2001 -0700, you wrote:

>Elaborate a bit more on what you are looking mean and how you would use it.

Wow, I need to go to bed.

TRANSLATION:

Elaborate a bit more on what you are looking for and how you would use it.

Jim

 | Replies | Author | Date
1772 | Re: VET 1.1.7 --Active Property ? | [adembaba@e...] | Sun 5/13/2001
1785 | Re: VET 1.1.7 --Active Property ? | Jim Kueneman | Mon 5/14/2001
1786 | Re: VET 1.1.7 --Active Property ? | [adembaba@e...] | Mon 5/14/2001


Home / End keys

From: Kent Briggs [kbriggs@b...]
Date: Sat May 12, 2001 11:11 pm
Subject: Home / End keys

I'm running VT 2.4.7. Is there an easy way to make the Home and End keys (also
Shift-Home and Shift-End) to work like they do in regular TListView component?
Specifically, I don't want the horizontal scrollbar position to move when these
keys are pressed.

Also, when I press any non-control key (alphanumeric key, return key, etc), the
VT acts like the Home was pressed and moves the selection to the first row. I'd
rather it either just beep or ignore the key.

--
Kent Briggs, [kbriggs@b...]
Briggs Softworks, http://www.briggsoft.com

 | Replies | Author | Date
1779 | Re: Home / End keys | Mike Lischke | Sun 5/13/2001


re: Mousedown, Column Color and Selection recta ngle...

From: Werner Lehmann [wl@b...]
Date: Fri May 11, 2001 10:14 am
Subject: Re: [VirtualTreeview] Mousedown, Column Color and Selection recta ngle...

Mike Lischke wrote:
>
> To all:
> The options property of Virtual Treeview is now filled up with 32 entries.
> It is impossible to add more because it is a published property which may
> only be four bytes long. Just to let you know.

I believe that this is just ok. 32 option values are already a little bit
confusing (I know even I added to them and this should not be taken as a
complaint :)

Developer Express has had the same problem with their TdxTreeList (which is
essentially direct competition for VTree but not virtual) and the DB descendant.
They introduced an OptionsEx property and both are quite full already. I must
admit that I am a little bit reluctant to go through all these options each
time a new component is dropped on the form. With VTree no problem for me
because I have followed the development for some time but new users might be
confused as well.

I believe that it would be best to split the options up into different option
properties with a common topic each. It is ridiculous to let a technical limit
of 32 option values rule out further optionals. I know that this is not likely
to happen (streaming, compatibility) but I still wanted to express my opinion
about it :)

Regards,
Werner

 | Replies | Author | Date
1781 | Re: Mousedown, Column Color and Selection recta | Mike Lischke | Sun 5/13/2001


re: VET 1.1.7 --Active Property ?

From: [adembaba@e...]
Date: Sun May 13, 2001 7:23 am
Subject: Re: VET 1.1.7 --Active Property ?

Hi Jim,

> >Elaborate a bit more on what you are looking mean and how you
would use it.
>
> Wow, I need to go to bed.
>
> TRANSLATION:

:-))

> Elaborate a bit more on what you are looking for and how you would
use it.

On a machine here I have quite a large number of folders
under root, and VET Demo takes a little too long to start
basically because VET is evaluating all those folders
(TNameSpace's).

To avoid this, I could (in design time) set

VirtualExplorerTree1.Active := False;

and in OnShow (or OnActivate, or even in the Loaded)
event, I would set it to

VirtualExplorerTree1.Active := True;

Also, having an Active property would enable me
to stop VET continously monitoring the system (at
least that is what I think it will) with regards
to changes in the files etc.

Cheers,

Adem

 | Replies | Author | Date
1785 | Re: VET 1.1.7 --Active Property ? | Jim Kueneman | Mon 5/14/2001
1786 | Re: VET 1.1.7 --Active Property ? | [adembaba@e...] | Mon 5/14/2001


re: Enabled/Disabled bug

From: "Mike Lischke" [public@l...]
Date: Sun May 13, 2001 8:54 am
Subject: RE: [VirtualTreeview] Enabled/Disabled bug

Hi Vadim,

> When main form disabled, node background changed to gray. And it is not
> restored until main form minimized/maximized.

Now I understand. You told me something about that the tree is disabled and not
enabled, but what you encounter here is only the wrong color used while
painting. Well, this is (again) a bug in the VCL. When showing a message box
the currently focused control looses the focus (and VT is therefore drawn as
being unfocused) but the form's ActiveControl is not updated accordingly. This
is necessary however to focus the same control again which was previously
focused. There is a check wether the active control changed and this fails so
no SetFocus call is made. You can only give back the focus if you change the
active control or set the focus manually.

Ciao, Mike


re: VirtualTree accepts dropped files

From: "Mike Lischke" [public@l...]
Date: Sun May 13, 2001 8:54 am
Subject: RE: [VirtualTreeview] VirtualTree accepts dropped files

Anders,

> Has anyone got some example code on how to make VT accept dropped
> files from e.g. explorer, and to drag files from VT to explorer.

The new OLE demo will show at least a part of the handling. Basically you have
to listen to the drop event and iterate through the available formats. If you
find CF_HDROP then you can safely assume that one or more files have been
dropped onto the tree. Now decompose the memory area (search MSDN for
CF_HDROP). This needs only a couple of lines. You will get the file names which
you can use to do operations with/on them.

Ciao, Mike


re: TopRow

From: "Mike Lischke" [public@l...]
Date: Sun May 13, 2001 8:54 am
Subject: RE: [VirtualTreeview] TopRow

Hi Anders,

> I'm requesting a way to set the "TopRow". When updating a tree, I
> would like to have the Vertical scroll position stored and then
> recalled again after clearing the tree and adding new nodes.
> I've tried reading the TopNode and then setting the TopNode = the
> node I would like to have as the TopNode. But this won't work.

Perhaps it would be better to use the OffsetXY property which allows for much
better reproducability of the tree's scroll state. TopNode uses a memory
address (the node) which is likely not valid anymore once the nodes have been
destroyed.

Ciao, Mike


re: Autoscroll doesn't work

From: "Mike Lischke" [public@l...]
Date: Sun May 13, 2001 8:54 am
Subject: RE: [VirtualTreeview] Autoscroll doesn't work

> I use it for moving nodes around the tree, not to other trees.
> I use a Drag'n'Drop component to drop files from explorer to it,

Using a drag'n drop component for VT is doubling work and memory. There is
almost everything already
in VT what you need. The only missing part is that to decompose incoming data.

>and
> here the autoscroll works fine. It also works when multiselecting
> with the selection rectangle.

And what is your question?

Ciao, Mike

 | Replies | Author | Date
1866 | Re: Autoscroll doesn't work | [andersthomsen@h...] | Fri 5/18/2001
1867 | Re: Autoscroll doesn't work | Jim Kueneman | Fri 5/18/2001
1868 | Re: Autoscroll doesn't work | [andersthomsen@h...] | Fri 5/18/2001
1874 | Re: Autoscroll doesn't work | Mike Lischke | Sat 5/19/2001


re: Using custom calendar

From: "Mike Lischke" [public@l...]
Date: Sun May 13, 2001 8:54 am
Subject: RE: [VirtualTreeview] Using custom calendar

Hi Juan,

> Can I use a custom calendar?

Yes of course.

Ciao, Mike


re: Re: GDI crash problem on W95 and "ShortenSt ring "

From: "Mike Lischke" [public@l...]
Date: Sun May 13, 2001 8:54 am
Subject: RE: [VirtualTreeview] Re: GDI crash problem on W95 and "ShortenSt ring "

Hi Björn,

> The error occured once again, clearly due to low system resources.
> I tried exchanging "GetTextExtentPoint32W" with "GetTextExtentPoint32A"
> at the two places in "ShortenString", and then the error actually
> disappeared.
> As I am not good with unicode (and the VT source), is there any risk
> with having the "A" variant apart from the fact that the shorten string
> result might be incorrect. (typically returning a longer/shorter string than
> necessary).

As long as you work only on ANSI strings then there should be no problems.
Store the incoming wide string into a normal (local) long string variable and
shorten this. Afterwards assign it back to the result. This way an automatic
conversion is done.

> Obviously, I dont imply adding this to VT in anyway, since it cripples the
> Unicode support somewhat, and I'm the only one with the problem. I am just
going to
> patch my source with this.

I think this is the best solution. I don't know why it applies only to your
machine, but I have not heard about this problem from any user of our products
(and they represent the entire range of Windows versions).

Ciao, Mike


re: Home / End keys

From: "Mike Lischke" [public@l...]
Date: Sun May 13, 2001 8:54 am
Subject: RE: [VirtualTreeview] Home / End keys

Hi Kent,

> I'm running VT 2.4.7. Is there an easy way to make the Home and End keys
(also
> Shift-Home and Shift-End) to work like they do in regular TListView component?
> Specifically, I don't want the horizontal scrollbar position to move when
these
> keys are pressed.

Oops, a little mistake on my side. I forgot to wrap the column moving code in a
check for grid mode.
This is now done.

> Also, when I press any non-control key (alphanumeric key, return key, etc),
the
> VT acts like the Home was pressed and moves the selection to the first row.
I'd
> rather it either just beep or ignore the key.

:o] Switch off incremental search.

Ciao, Mike


re: Incremental Searching

From: "Mike Lischke" [public@l...]
Date: Sun May 13, 2001 8:54 am
Subject: RE: [VirtualTreeview] Incremental Searching

Hi Werner,

> Another difference to the explorer way of searching is wrap around:
> currently we don't have a search wrap around at the end of the node list.
>
> Should be considerably easy to change, unless you had something special
> in mind with FLastSearchNode for not using the focused node. What do you
> think?

This is a good idea. Thinking in progress...

Ciao, Mike


re: Mousedown, Column Color and Selection recta ngle...

From: "Mike Lischke" [public@l...]
Date: Sun May 13, 2001 8:54 am
Subject: RE: [VirtualTreeview] Mousedown, Column Color and Selection recta ngle...

Hi Werner,

> I believe that it would be best to split the options up into different option
> properties with a common topic each. It is ridiculous to let a technical limit
> of 32 option values rule out further optionals. I know that this is not likely
> to happen (streaming, compatibility) but I still wanted to express my opinion
> about it :)

Fully agreed. The annoying fact is that you start as normal and find yourself
limited somehow and
left with the problem to keep backward compatibility. If I would have known
that in the first place
(that options are limited to 4 bytes and that I will need so many) then I would
have chosen a
different option structure, no doubts.

For the time being the current structure is sufficient and I hope there will
nothing have to be
added anymore. But hope and reality are two different things so I will think
about splitting and
grouping the options. I have to talk with some other people however, to avoid
breaking too much
code.

Ciao, Mike


New file uploaded to VirtualTreeview

From: [VirtualTreeview@yahoogroups.com>
Date: Sun May 13, 2001 8:59 am
Subject: New file uploaded to VirtualTreeview

Hello,

This email message is a notification to let you know that
a file has been uploaded to the Files area of the VirtualTreeview
group.

File : /VirtualTree 2.4.9.zip
Uploaded by : [public@l...]
Description : Beta version

You can access this file at the URL

http://groups.yahoo.com/group/VirtualTreeview/files/VirtualTree%202.4.9.zip

To learn more about file sharing for your group, please visit

http://help.yahoo.com/help/us/groups/files

Regards,

public@l...]


re: Incremental Searching

From: Werner Lehmann [wl@b...]
Date: Sun May 13, 2001 5:30 pm
Subject: Re: [VirtualTreeview] Incremental Searching

Mike,

Mike Lischke wrote:
>
> This is a good idea. Thinking in progress...

with v2.4.9 you added an option to start the incremental search from
the focused node. I am sorry to insist here but we still don't have
the explorer behaviour here (if this is the goal at all). If the
focused node satisfies the search text the focus is not changed even
if GetNext(FocusedNode) would satisfy the search as well. The conse-
quence of this is that you cannot move through subsequent files beginning
with the same letter because you are stuck with the currently focused
node.

I suggest that the search comparison starts with the node *after* the
focused node, including a wrap around if needed.

As a side node, right after updating from 2.4.7 to .9 I got an AV with
incremental searching, the debugger stopped on the line in virtualtrees.pas
where the inc search event handler is called but no variable values where
available. I could not reproduce the problem, may as well be my fault in
the event handler (which has been working before...). The error happened
when I pressed s very often and finally let the button pushed down. After
that (when the app was still running) I got that error very often, even
with an AV in kernel32.dll. Once I could see what the search text was:
something like 'sssssssssssssssssssssssss'#$1b'ss'. The $1b was an Esc
that I pressed probably.

Regards,
Werner


How about new event? (and, perhaps a new property...)

From: "Paul Istrate" [istech@c...]
Date: Mon May 14, 2001 2:15 am
Subject: How about new event? (and, perhaps a new property...)

Hi Mike,

How about new event? It's about OnColumnsResized.

If you want to perform some global actions AFTER a column is resized,
OnColumnResize is not usefull.

Reasons: it is triggered twice (for both columns involved) and is triggered
till user release mouse button.

For example:

I use a tree with not equal NodeHeights (because nodes labels holds text
with different lengths - I do word wrap). Initially, I set NodeHeigths in
OnInitNode event. When user resize columns I want to recalculate NodeHeights
and redisplay nodes labels.

I can't do this in OnColumnResize because is time consuming. If I choose
this way, the user will see a mouse cursor (HSplit) not smoothly followed by
colums.

If you consider that such event serve general purposes and is easy to
implement, please do so, otherwise don't bother. I can manage.

I also want to tell you again about Node.Align.

Due to 'proportional' way in which this member is treatead when you obtain
VAlign (in CalculateVerticalAlignments), it is not usefull if you want to
draw buttons and images at a fixed position from, let's say, top of node
rect. I mean if nodes have not equals heights.

I think a property NodeAlignment with naFixedFromTop, naFixedFromBottom,
naProportional options will be more flexible.

In this way only CalculateVerticalAlignment should be modified.

Again, I can live with actual VT state. This were just thoughts...

Regards,
Paul Istrate


re: Re: VET 1.1.7 --Active Property ?

From: Jim Kueneman [jimdk@m...]
Date: Mon May 14, 2001 3:55 am
Subject: Re: [VirtualTreeview] Re: VET 1.1.7 --Active Property ?

At 07:23 AM 5/13/2001 +0000, you wrote:
>On a machine here I have quite a large number of folders
>under root, and VET Demo takes a little too long to start
>basically because VET is evaluating all those folders
>(TNameSpace's).
>To avoid this, I could (in design time) set

So you are looking more for a way to shut off the "live update" during
design time? It that is what you are after that should be easy. I could
even make it automatic by looking at ComponentState and looking for
csDesigning. That way if you chose no update during designing you would
get a blank window but when the program actuallly ran it would fill the
tree. Is that acceptable?

Off the top of my head I can't think of an easy way to "stopping
execution" of VET then restarting it without skipping a beat. I can stop
it by clearing it and not reassigning a rootnode (blank screen) then start
it by assigning the root node again, just in case this is what you were
thinking.

>Also, having an Active property would enable me
>to stop VET continously monitoring the system (at
>least that is what I think it will) with regards
>to changes in the files etc.

Just set the UseChangeNotifyThread property to false. That will destroy
the thread. Setting it to True will recreate the thread and start
monitoring. Neither the Monitoring or Icon thread are active during
design time.

Jim

 | Replies | Author | Date
1786 | Re: VET 1.1.7 --Active Property ? | [adembaba@e...] | Mon 5/14/2001


re: VET 1.1.7 --Active Property ?

From: [adembaba@e...]
Date: Mon May 14, 2001 10:25 am
Subject: Re: VET 1.1.7 --Active Property ?

Hi Jim,

> So you are looking more for a way to shut off the "live update"
during
> design time? It that is what you are after that should be easy.
I could
> even make it automatic by looking at ComponentState and looking for
> csDesigning. That way if you chose no update during designing you
would
> get a blank window but when the program actuallly ran it would fill
the
> tree. Is that acceptable?

This sounds like an interesting way of doing it, but, it
does deviate from the way most Delphi components (mainly
those pertaining data access) handle design-time activity.

In other words, if you mean you would implement something
like VET1.ActiveInDesignTime := True/False (or
VET1.Options := VET1.Options + [xyzActiveInDesignTime],
this might be confusing to users.

> Off the top of my head I can't think of an easy way
to "stopping
> execution" of VET then restarting it without skipping a beat. I
can stop
> it by clearing it and not reassigning a rootnode (blank screen)
then start
> it by assigning the root node again, just in case this is what you
were
> thinking.
>
> >Also, having an Active property would enable me
> >to stop VET continously monitoring the system (at
> >least that is what I think it will) with regards
> >to changes in the files etc.
>
> Just set the UseChangeNotifyThread property to false. That will
destroy
> the thread. Setting it to True will recreate the thread and start
> monitoring. Neither the Monitoring or Icon thread are active
during
> design time.

AFAIK, if there were a VET1.Active property that shuts off
VET (including the monitoring thread), it would be just fine.

Cheers,
Adem


re: problem with right click select

From: "Moritz Franckenstein" [franckenstein@a...]
Date: Mon May 14, 2001 11:51 am
Subject: Re: problem with right click select

hi mike, did you oversee this?

> i dont get the popup menu on right click to work like in windows
> explorer.
>
> when you select multiple files in the explorer and then right click
> on the selection, a popup menu appears.
> and when nothing is selected and you right click on one file, this
> file is selected and a popup menu appears also.
>
> but in vt the first thing doesnt work when voRightClickSelect is
set
> (the selection is gone) and the second doesnt work if it is not
(the
> entry isnt selected).
>
> is that my fault or can that be fixed inside vt?
>
> -moritz


VET with extra columns

From: Steffen Binas [steffen.binas@a...]
Date: Mon May 14, 2001 8:43 pm
Subject: VET with extra columns

I downloaded the new VET 1.1.7 and created a file open dialog with some
filtering functions which would not be possible with a standard TOpenDialog
(thanks to ExplorerEnumFolder). Now I want to display additional data in
some extra columns. New columns can easyly be added after creating VET:

with VET.Header.Columns.Add do
Text := 'Additional Data';

But because there is no OnDrawNode-Event in VET I can't display the data.
Did I miss something or is it not possible at the moment?

Regards,
Steffen


VET 1.1.8 (Expecially Adem, Mathias, and Steffen)

From: Jim Kueneman [jimdk@m...]
Date: Tue May 15, 2001 5:36 am
Subject: VET 1.1.8 (Expecially Adem, Mathias, and Steffen)

Steffen ............................

Added an OnGetVETText event:

procedure TForm1.VirtualExplorerTree1GetVETText(
Sender: TCustomVirtualExplorerTree; Column: Integer; Node: PVirtualNode;
Namespace: TNamespace; var Text: WideString; var Handled: Boolean);
begin

end;

You can use the included columns as they are and add more. Look at the
column index, set the text and set Handled to true. You can also override
the default behavior of the built in columns by setting the text and
setting Handled to True, If it is false VET will draw the text normally.

You can't override the MainColumn

Adem ...........................

Added an Active Property. Default is False.

Mathias ...........................

You now have a RefreshNode method and see if this will compile in BCB.

Rest using Win 2000..............................

Try dragging a file into VET from explorer or the desktop. What do you
think. Now to get Mike to add a hook to create my own fancy bitmap for
dragging so I can use IDragSourceHelper!

Jim

 | Replies | Author | Date
1796 | Re: VET 1.1.8 (Expecially Adem, Mathias, and Stef | Jim Kueneman | Tue 5/15/2001
1806 | Re: VET 1.1.8 (Expecially Adem, Mathias, and Stef | [tias@m...] | Tue 5/15/2001
1834 | Re: VET 1.1.8 (Expecially Adem, Mathias, and Stef | Roland | Wed 5/16/2001
1835 | Re: VET 1.1.8 (Expecially Adem, Mathias, and Stef | [tias@m...] | Wed 5/16/2001
1836 | Re: VET 1.1.8 (Expecially Adem, Mathias, and Stef | Roland | Wed 5/16/2001
1838 | Re: VET 1.1.8 (Expecially Adem, Mathias, and Stef | Steffen Binas | Wed 5/16/2001
1843 | Re: VET 1.1.8 (Expecially Adem, Mathias, and Stef | Roland | Thu 5/17/2001
1847 | Re: VET 1.1.8 (Expecially Adem, Mathias, and Stef | Steffen Binas | Thu 5/17/2001
1848 | Re: VET 1.1.8 (Expecially Adem, Mathias, and Stef | Roland | Thu 5/17/2001


New file uploaded to VirtualTreeview

From: [VirtualTreeview@yahoogroups.com>
Date: Tue May 15, 2001 5:35 am
Subject: New file uploaded to VirtualTreeview

Hello,

This email message is a notification to let you know that
a file has been uploaded to the Files area of the VirtualTreeview
group.

File : /VET_V1.1.8.zip
Uploaded by : [jimdk@m...]
Description : VET version 1.1.8

You can access this file at the URL

http://groups.yahoo.com/group/VirtualTreeview/files/VET_V1.1.8.zip

To learn more about file sharing for your group, please visit

http://help.yahoo.com/help/us/groups/files

Regards,

jimdk@m...]


New file uploaded to VirtualTreeview

From: [VirtualTreeview@yahoogroups.com>
Date: Tue May 15, 2001 9:41 am
Subject: New file uploaded to VirtualTreeview

Hello,

This email message is a notification to let you know that
a file has been uploaded to the Files area of the VirtualTreeview
group.

File : /PropertyEditor.zip
Uploaded by : [Beduerftig@S...]
Description : for BCB5: show how to use IVTEditLink with VT 2.4.9

You can access this file at the URL

http://groups.yahoo.com/group/VirtualTreeview/files/PropertyEditor.zip

To learn more about file sharing for your group, please visit

http://help.yahoo.com/help/us/groups/files

Regards,

Beduerftig@S...]


for BCB5: update Demo show usage of IVTEditLink

From: "Roland" [Beduerftig@S...]
Date: Tue May 15, 2001 9:54 am
Subject: for BCB5: update Demo show usage of IVTEditLink

Hallo,

I updated the demo show the usage of IVTEditLink with VT.

The main reason was, Mike had added a new method to the interface:
virtual void __stdcall ProcessMessage(Messages::TMessage &Message);

- I downloaded version 2.4.9. from file area
- I also added this method to complet the demo to use the latest VT

by the way I fix 2 little problems with the demo:

1. when someone click at a row the OwnEditor will starting,
you must not press any key or wait any time
2. demo show to handle the global KeyDown-Message for example:
handle ESC-Key for Abort and CR-Key for Default-Button-Click

with best regards
Roland


Some new options

From: "Danil Galimov" [danil@o...]
Date: Tue May 15, 2001 10:08 am
Subject: Some new options

Hello all.
Mike, what about adding an integer version constants to VT? Like
Version, SubVersion, and BuildNumber? Also, maybe you can add
an option for animated scrolling? Like in windows standart listbox
control?
Thanks.

 | Replies | Author | Date
1794 | Re: Some new options | Roland | Tue 5/15/2001
1795 | Re: Some new options | Danil Galimov | Tue 5/15/2001
1804 | Re: Some new options | Mike Lischke | Tue 5/15/2001
1813 | Re: Some new options | Danil Galimov | Wed 5/16/2001
1815 | Re: Some new options | Roland | Wed 5/16/2001
1821 | Re: Some new options | Mike Lischke | Wed 5/16/2001
1825 | Re: Some new options | Danil Galimov | Wed 5/16/2001


re: Some new options

From: "Roland" [Beduerftig@S...]
Date: Tue May 15, 2001 11:42 am
Subject: Re: Some new options

> Hello all.
> Mike, what about adding an integer version constants to VT? Like
> Version, SubVersion, and BuildNumber? Also, maybe you can add
> an option for animated scrolling? Like in windows standart listbox
> control?
> Thanks.

Hi Danil,

there is a version number with subversion and buildnummer in VT, you
can directly use it, see also:

for BCB-User:

at the end of VirtualTrees.hpp

//-- var, const, procedure ------------------------------------
#define VTVersion "2.4.8"
......

for Delphi-User:

at the begin of VirtualTrees.pas

const
VTVersion = '2.4.8';
.......

when you want to show in the about box of your application you can
use it, for example:

Label1.Caption := 'VirtualTree v' + VTVersion;
or
ListBox.Items.Add('VirtualTree v' + VTVersion);

with best regards
Roland

 | Replies | Author | Date
1795 | Re: Some new options | Danil Galimov | Tue 5/15/2001


re: Re: Some new options

From: "Danil Galimov" [danil@o...]
Date: Tue May 15, 2001 11:42 am
Subject: Re: [VirtualTreeview] Re: Some new options

Hi Roland, i know this, but i want to have one or more INTEGER
constants, not strings. Who knows, in future it maybe like
VTVersion='New 2.4.8 beta' or something like this. I will not be able
to extract the minor and major version.

> const
> VTVersion = '2.4.8';


re: VET 1.1.8 (Expecially Adem, Mathias, and Steffen)

From: "Jim Kueneman" [jimdk@m...]
Date: Tue May 15, 2001 12:27 pm
Subject: Re: VET 1.1.8 (Expecially Adem, Mathias, and Steffen)

--- In [VirtualTreeview@y...], Jim Kueneman [jimdk@m...] wrote:

>
> Added an Active Property. Default is False.
>

Forgot the word of warning. Anyone currently using VET before yelling
at me for breaking it you will get a blank window if you recompile
with the new version. Set this property to true at design time or set
it to true in the forms OnShow event.

Jim


re: How about new event? (and, perhaps a new pr operty...)

From: Mike Lischke [public@l...]
Date: Tue May 15, 2001 12:50 pm
Subject: RE: [VirtualTreeview] How about new event? (and, perhaps a new pr operty...)

Hi Paul,

> How about new event? It's about OnColumnsResized.
>
> If you want to perform some global actions AFTER a column is resized,
> OnColumnResize is not usefull.

Wouldn't a simple OnHeaderMouseUp be sufficient instead adding yet another
event?

> I think a property NodeAlignment with naFixedFromTop,
> naFixedFromBottom, naProportional options will be more flexible.

Good idea. I have implemented a similar approach. Wait for next upload.

Ciao, Mike


re: Incremental Searching

From: Mike Lischke [public@l...]
Date: Tue May 15, 2001 12:53 pm
Subject: RE: [VirtualTreeview] Incremental Searching

Hi Werner,

> The usual explorer behaviour is different:
> the search always starts with the focused node. If you have
> 20 nodes all beginning with 'a', you could cycle through them with
> subsequent 'a'-key presses.

Fixed.

> Another difference to the explorer way of searching is wrap around:
> currently we don't have a search wrap around at the end of the node list.

Also fixed.

> Should be considerably easy to change, unless you had
> something special in mind with FLastSearchNode for not using the focused
node.
> What do you think?

I agree, although it was not that easy to change (particularly if you
consider everything together like visible nodes only, backward search, wrap
around and some little but important other considerations). Seems it works
now, however. Wait for next upload.

Ciao, Mike


re: problem with right click select

From: Mike Lischke [public@l...]
Date: Tue May 15, 2001 12:59 pm
Subject: RE: [VirtualTreeview] problem with right click select

Hi Moritz.

> i dont get the popup menu on right click to work like in windows
> explorer.
>
> when you select multiple files in the explorer and then right click
> on the selection, a popup menu appears.
> and when nothing is selected and you right click on one file, this
> file is selected and a popup menu appears also.
>
> but in vt the first thing doesnt work when voRightClickSelect is set
> (the selection is gone) and the second doesnt work if it is not (the
> entry isnt selected).

What version do you use? I have fixed that a long time ago and it still
works. With voRightClickSelect and either an assigned popup to the
Tree.Popup property or a menu return in OnGetPopupMenu everything is fine.

Ciao, Mike

 | Replies | Author | Date
1809 | Re: problem with right click select | Moritz Franckenstein | Tue 5/15/2001


re: Mousedown, Column Color and Selection recta ngle...

From: Mike Lischke [public@l...]
Date: Tue May 15, 2001 1:05 pm
Subject: RE: [VirtualTreeview] Mousedown, Column Color and Selection recta ngle...

> I believe that it would be best to split the options up into
> different option properties with a common topic each. It is ridiculous to
let
> a technical limit of 32 option values rule out further optionals. I know
that
> this is not likely to happen (streaming, compatibility) but I still wanted
to
> express my opinion about it :)

Well, splitting the options would be the cleanest way I think, but I
hesitate to do this now. Adding property to VT is not problematic as this
has no impact on existing code. Only removing something (and reordering
would mean to remove either property Options entirely or at least some of
the options there).

On the other hand with careful desgin and enhancement it is not very likely
that more options will appear (also considered the fact that VT is already
very complex and new people have more and more trouble to learn its usage).

Ciao, Mike


re: Incremental Searching

From: Mike Lischke [public@l...]
Date: Tue May 15, 2001 1:09 pm
Subject: RE: [VirtualTreeview] Incremental Searching

> As a side node, right after updating from 2.4.7 to .9 I got an AV with
> incremental searching, the debugger stopped on the line in

Mmh, I tried this too but could not produce any error whatsoever. Either the
error was really on your side or I have removed it implictly when I reworked
the code and tested it (ah there is a third possibility: I am too stupid to
reproduce it, this has some probability too :o]).

Ciao, Mike


re: Re: problem with right click select

From: Mike Lischke [public@l...]
Date: Tue May 15, 2001 1:10 pm
Subject: RE: [VirtualTreeview] Re: problem with right click select

Hi Moritz,

> hi mike, did you oversee this?

No, no, but sometimes I have simply other things than VT to work on. I do
not earn my money with VT but with product development ;-)

Ciao, Mike

 | Replies | Author | Date
1805 | Re: problem with right click select | Moritz Franckenstein | Tue 5/15/2001


re: VET 1.1.8 (Expecially Adem, Mathias, and St effen)

From: Mike Lischke [public@l...]
Date: Tue May 15, 2001 1:14 pm
Subject: RE: [VirtualTreeview] VET 1.1.8 (Expecially Adem, Mathias, and St effen)

> Try dragging a file into VET from explorer or the desktop.
> What do you think. Now to get Mike to add a hook to create my own fancy
> bitmap for dragging so I can use IDragSourceHelper!

What do you need Jim? Is it enough to have an event which is triggered in
TBaseVirtualTree.PrepareDragImage and which is called instead of PaintTree?

Ciao, Mike

 | Replies | Author | Date
1811 | Re: VET 1.1.8 (Expecially Adem, Mathias, and St e | Jim Kueneman | Tue 5/15/2001


re: Some new options

From: Mike Lischke [public@l...]
Date: Tue May 15, 2001 1:19 pm
Subject: RE: [VirtualTreeview] Some new options

Hi Danil,

> Mike, what about adding an integer version constants to VT? Like
> Version, SubVersion, and BuildNumber?

Why?

>Also, maybe you can add
> an option for animated scrolling? Like in windows standart listbox
> control?

Mmh, I never have liked that because it was almost always obstructive.
Perhaps with the new animation support I can implement it better compared
with TComboBox and the like. For the time being I will not add any more
features since I want to finish the documentation finally, but I take the
suggestion into my todo list.

Ciao, Mike

 | Replies | Author | Date
1813 | Re: Some new options | Danil Galimov | Wed 5/16/2001
1815 | Re: Some new options | Roland | Wed 5/16/2001


re: problem with right click select

From: "Moritz Franckenstein" [franckenstein@a...]
Date: Tue May 15, 2001 1:47 pm
Subject: Re: problem with right click select

> > hi mike, did you oversee this?
>
> No, no, but sometimes I have simply other things than VT to work
on. I do
> not earn my money with VT but with product development ;-)
>
> Ciao, Mike

i'm very sorry, of course i know that.

normally your answers coming very quickly, but this time it was 5
days! (so it's your fault :) <-- JOKE !

your support is always great! thank you.

-moritz


re: VET 1.1.8 (Expecially Adem, Mathias, and Steffen)

From: [tias@m...]
Date: Tue May 15, 2001 1:53 pm
Subject: Re: VET 1.1.8 (Expecially Adem, Mathias, and Steffen)

--- In [VirtualTreeview@y...], Jim Kueneman [jimdk@m...] wrote:
> Mathias ...........................
> You now have a RefreshNode method and see if this will compile in
BCB.

BCB is now happily eating both ShellUtilities.pas &
VirtualExplorerTree.pas, works perfectly !
Haven't had time to test the RefresNode method yet though, but I'm
sure it will do the work I need... ;-)

Many thanks Jim !

/Mathias Thorell

 | Replies | Author | Date
1834 | Re: VET 1.1.8 (Expecially Adem, Mathias, and Stef | Roland | Wed 5/16/2001
1835 | Re: VET 1.1.8 (Expecially Adem, Mathias, and Stef | [tias@m...] | Wed 5/16/2001
1836 | Re: VET 1.1.8 (Expecially Adem, Mathias, and Stef | Roland | Wed 5/16/2001
1838 | Re: VET 1.1.8 (Expecially Adem, Mathias, and Stef | Steffen Binas | Wed 5/16/2001
1843 | Re: VET 1.1.8 (Expecially Adem, Mathias, and Stef | Roland | Thu 5/17/2001
1847 | Re: VET 1.1.8 (Expecially Adem, Mathias, and Stef | Steffen Binas | Thu 5/17/2001
1848 | Re: VET 1.1.8 (Expecially Adem, Mathias, and Stef | Roland | Thu 5/17/2001
1910 | VET and BCB | Alexander Egorushkin | Mon 5/21/2001
1920 | Re: VET and BCB | [tias@m...] | Mon 5/21/2001


re: How about new event?... (and a bug report)

From: "Paul Istrate" [istech@c...]
Date: Tue May 15, 2001 2:05 pm
Subject: Re: [VirtualTreeview] How about new event?... (and a bug report)

Hi Mike,

> > How about new event? It's about OnColumnsResized.
> >
> > If you want to perform some global actions AFTER a column is resized,
> > OnColumnResize is not usefull.
>
> Wouldn't a simple OnHeaderMouseUp be sufficient instead adding yet another
> event?
>

Unfortunately, OnHeaderMouseUp is not triggered after button release if the
previous action was a resize of columns!

But, no problem. I will find a solution.

Also, I want to report you the following situation:

I use a VDT (VirtualDrawTree) and I set/draw hints only for first column
(VDT has 2 columns). VDT is located on form left side. On right side of VDT
I have a splitter.

If I use the splitter to decrease VDT width, when mouse is over the first
column, splitter mark is not shown anymore, instead the VDT hint is painted.

I think VDT should not treat mouse move if mouse down was not in its area,
so mouse move is treated in another control, like splitter.

I doesn't tested with a VST so I don't know if have same behaviour.

Regards and thank you for NodeAlignment,
Paul Istrate

 | Replies | Author | Date
1816 | Re: How about new event?... (and a bug report) | Mike Lischke | Wed 5/16/2001


Popup Menu

From: GIANNAKOPOULOS KOSTAS [kyan@s...]
Date: Tue May 15, 2001 2:22 pm
Subject: Popup Menu

Good afternoon Mike.

I think i found a small bug:

In an OnGetPopupMenu event handler i didn't explicitly set the PopupMenu
parameter to nil when Node was nil, expecting PopupMenu to be nil (since it
is a var parameter nobody says i should assign it).

In TBaseVirtualTree.DoPopupMenu the Menu local variable is initialized (to
nil) ONLY if the passed node is not nil, but the "if Assigned(Menu) then"
block runs even if Node = nil with a Menu variable pointing to garbage.
So, if you right-click in the client area (not a node) you will get an ugly
AV.

Solution: Move statement "Menu := nil;" (and maybe replace it with "Menu :=
PopupMenu;") before test "if Assigned(Run)".

<KY>

 | Replies | Author | Date
1818 | Re: Popup Menu | Mike Lischke | Wed 5/16/2001


re: problem with right click select

From: "Moritz Franckenstein" [franckenstein@a...]
Date: Tue May 15, 2001 3:01 pm
Subject: Re: problem with right click select

> What version do you use? I have fixed that a long time ago and it
still
> works. With voRightClickSelect and either an assigned popup to the
> Tree.Popup property or a menu return in OnGetPopupMenu everything
is fine.

i am using the latest beta.

here is how to test it:
put a new VirtualTreeView on a form and set the RootNodeCount
property to 10, and voMultiSelect and voRightClickSelect to True.
then run it, select some nodes and right-click somewhere in the
selection. the selection is gone. what do i have to set to get it to
work?

...
oh. now i have set DragMode to dmAutomatic and it works as expected!
what's that?

-moritz


re: Re: problem with right click select

From: Mike Lischke [public@l...]
Date: Tue May 15, 2001 3:01 pm
Subject: RE: [VirtualTreeview] Re: problem with right click select

> normally your answers coming very quickly, but this time it was 5
> days! (so it's your fault :) <-- JOKE !

Was it really so long? Wow, I thought it's been only two days. The time
currently runs away for me.... Sorry if I sounded too harsh!

Ciao, Mike


re: VET 1.1.8 (Expecially Adem, Mathias, and St effen)

From: "Jim Kueneman" [jimdk@m...]
Date: Tue May 15, 2001 3:48 pm
Subject: Re: VET 1.1.8 (Expecially Adem, Mathias, and St effen)

--- In [VirtualTreeview@y...], Mike Lischke [public@l...] wrote:
> > Try dragging a file into VET from explorer or the desktop.
> > What do you think. Now to get Mike to add a hook to create my
own fancy
> > bitmap for dragging so I can use IDragSourceHelper!
>
> What do you need Jim? Is it enough to have an event which is
triggered in
> TBaseVirtualTree.PrepareDragImage and which is called instead of
PaintTree?

Is your image convertable to a bitmap? All that is needed is a handle
to a bitmap. What I really meant was "All that is needed is *Mike* to
provide a bitmap. <g>

Jim


Some small bugs and suggestions

From: "Danil Galimov" [danil@o...]
Date: Wed May 16, 2001 7:58 am
Subject: Some small bugs and suggestions

Mike,
I'm using VT 2.4.5, and have found the following bug:
Changing ButtonStyle property works only once, second time it
continues using last images regardless of ButtonStyle property.
Also, new style of showing a connection between chile nodes
looks good, but can you also make a property (later) to select old
style of new?
In grid mode (grid effect enabled+extended selection enabled,
maybe also in normal mode) the cursor keys (left and right) do not
scroll the VT, as they should in standart controls. I think you
should add this behaviour by default.

 | Replies | Author | Date
1820 | Re: Some small bugs and suggestions | Mike Lischke | Wed 5/16/2001
1822 | Re: Some small bugs and suggestions | Danil Galimov | Wed 5/16/2001
1828 | Re: Some small bugs and suggestions | Mike Lischke | Wed 5/16/2001
1831 | Re: Some small bugs and suggestions | Danil Galimov | Wed 5/16/2001
1833 | Re: Some small bugs and suggestions | Roland | Wed 5/16/2001
1837 | Re: Some small bugs and suggestions | Werner Lehmann | Wed 5/16/2001
1854 | Re: Some small bugs and suggestions | Mike Lischke | Fri 5/18/2001
1855 | Re: Some small bugs and suggestions | Mike Lischke | Fri 5/18/2001
1856 | Re: Some small bugs and suggestions | Mike Lischke | Fri 5/18/2001


re: Some new options

From: "Danil Galimov" [danil@o...]
Date: Wed May 16, 2001 8:02 am
Subject: RE: [VirtualTreeview] Some new options

> > Mike, what about adding an integer version constants to VT? Like
> > Version, SubVersion, and BuildNumber?
>
> Why?
For example, for displaying it in a program. VTVersion is good, but
it's string, and i cannot expect it always to be the same standart
(like '2.4.5', or '2.4') or you should try and keed the same standart
for it, so i can always extract the version and subversion.

 | Replies | Author | Date
1815 | Re: Some new options | Roland | Wed 5/16/2001


re: Re: VET 1.1.8 (Expecially Adem, Mathias, an d St effen)

From: Mike Lischke [public@l...]
Date: Wed May 16, 2001 8:21 am
Subject: RE: [VirtualTreeview] Re: VET 1.1.8 (Expecially Adem, Mathias, an d St effen)

Hi Jim,

> Is your image convertable to a bitmap? All that is needed is
> a handle to a bitmap. What I really meant was "All that is needed is
*Mike* to
> provide a bitmap. <g>

Well, the drag image internally uses bitmaps, so all I had to do is to make
the main bitmap public in the TVTDragImage class. Look for property Image in
the next upload. Btw: the IDragSourceHelper interface will only be available
on W2K+. What are your plans regarding the other platforms?

Ciao, Mike

 | Replies | Author | Date
1842 | Re: VET 1.1.8 (Expecially Adem, Mathias, an d St | Jim Kueneman | Thu 5/17/2001


re: Some new options

From: "Roland" [Beduerftig@S...]
Date: Wed May 16, 2001 8:42 am
Subject: Re: Some new options

Good morning,

> > Why?
> For example, for displaying it in a program. VTVersion is good, but
> it's string, and i cannot expect it always to be the same standart
> (like '2.4.5', or '2.4') or you should try and keed the same
> standart for it, so i can always extract the version and subversion.

You said for displaying in a program, but why would you extract the
version and subversion, you have the source and must compile it to a
component for use and you know at this time what version you have.

For examble, I take the VT version 2.3.x from file area compile it
and write a demo (you can see it also in file area), then 2 weeks
later I take VT version 2.4.x and now the compiler show an error,
because Mike added a new method in the interface, ok then I must also
add the method to demoprogram, and now I have the lastest version.

I will show the version of VT only in the "about this program" for
information, I don't understand what you want to do with the extract
information.

have a nice day
Roland


re: How about new event?... (and a bug report)

From: Mike Lischke [public@l...]
Date: Wed May 16, 2001 8:41 am
Subject: RE: [VirtualTreeview] How about new event?... (and a bug report)

Hi Paul,

> Unfortunately, OnHeaderMouseUp is not triggered after button
> release if the previous action was a resize of columns!

Ah, this was a little bug which managed it to hide until now. I have
reworked this code so the mouse up is fired correctly (after tracking, after
dragging, on disabled buttons and on the free area).

> I think VDT should not treat mouse move if mouse down was not
> in its area, so mouse move is treated in another control, like splitter.

Mmh, does the tree have the focus when the hint appears?

Ciao, Mike


re: pb to install VTV on BCB5/Another BCB problem

From: "Mike Lischke" [public@l...]
Date: Wed May 16, 2001 9:09 am
Subject: Re: pb to install VTV on BCB5/Another BCB problem

Hi Alexander,

> There is no such problem in BCB, all arrays are automatically
> splitted. Is there any other components that have events with
> arrays as parameters (may be in VCL - look at them)? Or may be
> there exists a function called like 'GetDelphiArraySize'. Or try to
> find help on using OpenArray template with the parameter.

I would like to fix this problem once and for all so I changed the
OnDragDrop event to take a TFormatArray type instead of "array of
Word" (TFormatArray is indeed defined as "array of Word"). It works
well under Delphi and requires only a minimal change in existing drop
handlers (only the parameter list changes slightly). Could you please
verify that there is no problem any longer in this regard?

Thank you and

Ciao, Mike

 | Replies | Author | Date
1911 | Re: pb to install VTV on BCB5/Another BCB problem | Alexander Egorushkin | Mon 5/21/2001


re: Popup Menu

From: Mike Lischke [public@l...]
Date: Wed May 16, 2001 9:06 am
Subject: RE: [VirtualTreeview] Popup Menu

Hi Kostas,

> In an OnGetPopupMenu event handler i didn't explicitly set
> the PopupMenu parameter to nil when Node was nil, expecting PopupMenu to
be
> nil (since it is a var parameter nobody says i should assign it).

Thank you for pointing this out. This bug is now fixed too.

Ciao, Mike


re: Re: problem with right click select

From: Mike Lischke [public@l...]
Date: Wed May 16, 2001 9:09 am
Subject: RE: [VirtualTreeview] Re: problem with right click select

Hi Moritz,

> here is how to test it:
> put a new VirtualTreeView on a form and set the RootNodeCount
> property to 10, and voMultiSelect and voRightClickSelect to True.
> then run it, select some nodes and right-click somewhere in the
> selection. the selection is gone. what do i have to set to get it to
> work?
>
> ...
> oh. now i have set DragMode to dmAutomatic and it works as expected!
> what's that?

The point is that the right mouse button (as well as the middle button)
behaves exactly like the left button if enabled and there is no popup menu
assigned/used. When dragging is enabled then the selection stays on mouse
down because the tree cannot say what the user will do next. If there is a
popup menu then the selection stays as well. Otherwise it is immediately
cleared just like with the left mouse button.

That's what I thought people would expect when telling the right mouse
button should do the same like the left mouse button.

Ciao, Mike

 | Replies | Author | Date
1823 | Re: problem with right click select | Moritz Franckenstein | Wed 5/16/2001


re: Some small bugs and suggestions

From: Mike Lischke [public@l...]
Date: Wed May 16, 2001 9:14 am
Subject: RE: [VirtualTreeview] Some small bugs and suggestions

Hi Danil,

> I'm using VT 2.4.5, and have found the following bug:
> Changing ButtonStyle property works only once, second time it
> continues using last images regardless of ButtonStyle property.

Yes this was a bug I found already. Please download the latest source to
have the fix too.

> Also, new style of showing a connection between chile nodes
> looks good, but can you also make a property (later) to select old
> style of new?

What do you mean here? Are you talking about the tree lines?

To all:
Has anybody realized that the tree lines are since a while dotted instead
of solid lines?

> In grid mode (grid effect enabled+extended selection enabled,
> maybe also in normal mode) the cursor keys (left and right) do not
> scroll the VT, as they should in standart controls. I think you
> should add this behaviour by default.

Mmmh, seems there wasn't everything correct in 2.4.5. Please see if the
latest source behaves better now.

Ciao, Mike

 | Replies | Author | Date
1822 | Re: Some small bugs and suggestions | Danil Galimov | Wed 5/16/2001


re: Some new options

From: Mike Lischke [public@l...]
Date: Wed May 16, 2001 9:16 am
Subject: RE: [VirtualTreeview] Some new options

> For example, for displaying it in a program. VTVersion is good, but
> it's string, and i cannot expect it always to be the same standart
> (like '2.4.5', or '2.4') or you should try and keed the same standart
> for it, so i can always extract the version and subversion.

You know, I'm very careful to keep existing applications working and changes
in the interface as small as possible when improving VT. I promise you can
rely on the format of the version string. There is no need for me to change
it. I would rather add another string if I want to add information and even
this will be very unlikely.

Ciao, Mike

 | Replies | Author | Date
1825 | Re: Some new options | Danil Galimov | Wed 5/16/2001


re: Some small bugs and suggestions

From: "Danil Galimov" [danil@o...]
Date: Wed May 16, 2001 9:19 am
Subject: RE: [VirtualTreeview] Some small bugs and suggestions

> What do you mean here? Are you talking about the tree lines?
>
> To all:
> Has anybody realized that the tree lines are since a while dotted
> instead
> of solid lines?
Yeah, i'm talking about it. Maybe yuo can add a property for
customizing lines style?


re: problem with right click select

From: "Moritz Franckenstein" [franckenstein@a...]
Date: Wed May 16, 2001 9:25 am
Subject: Re: problem with right click select

--- In [VirtualTreeview@y...], Mike Lischke [public@l...] wrote:
> > here is how to test it:
> > put a new VirtualTreeView on a form and set the RootNodeCount
> > property to 10, and voMultiSelect and voRightClickSelect to True.
> > then run it, select some nodes and right-click somewhere in the
> > selection. the selection is gone. what do i have to set to get it
to
> > work?

> The point is that the right mouse button (as well as the middle
button)
> behaves exactly like the left button if enabled and there is no
popup menu assigned/used.

i have assigned a popup menu and the same happens: the selection is
cleared when i right click it, and the the menu pops up. what am i
doing wrong? help!

-moritz


re: Re: problem with right click select

From: Mike Lischke [public@l...]
Date: Wed May 16, 2001 9:26 am
Subject: RE: [VirtualTreeview] Re: problem with right click select

> i have assigned a popup menu and the same happens: the selection is
> cleared when i right click it, and the the menu pops up. what am i
> doing wrong? help!

Aaaaaaaah, f%&#+*. Sorry my fault. This happens if dragging is not enabled.
But of course if there is a popup menu then the selection should stay. Going
to fix that...

Ciao, Mike

 | Replies | Author | Date
1826 | Re: problem with right click select | Moritz Franckenstein | Wed 5/16/2001


re: Some new options

From: "Danil Galimov" [danil@o...]
Date: Wed May 16, 2001 9:21 am
Subject: RE: [VirtualTreeview] Some new options

Ok, so as i understand, the VTversion will be always like
"x.x.x"? This will allow me always to extract a version correctly.
Thanks.

> You know, I'm very careful to keep existing applications working and
> changes in the interface as small as possible when improving VT. I
> promise you can rely on the format of the version string. There is no
> need for me to change it. I would rather add another string if I want
> to add information and even this will be very unlikely.


re: problem with right click select

From: "Moritz Franckenstein" [franckenstein@a...]
Date: Wed May 16, 2001 9:43 am
Subject: Re: problem with right click select

--- In [VirtualTreeview@y...], Mike Lischke [public@l...] wrote:
> > i have assigned a popup menu and the same happens: the selection
is
> > cleared when i right click it, and the the menu pops up. what am
i
> > doing wrong? help!
>
> Aaaaaaaah, f%&#+*. Sorry my fault. This happens if dragging is not
enabled.
> But of course if there is a popup menu then the selection should
stay. Going
> to fix that...

:)


how to derive a new compontent...

From: "Moritz Franckenstein" [franckenstein@a...]
Date: Wed May 16, 2001 9:53 am
Subject: how to derive a new compontent...

...from CustomVirtualStringTree that manages its own data internally:

is there a small example?

i have tried to understand those internaldatasize pointer
calculations inside the VET source but it seems to be a little bit
complicated.

a small example would help, but if someone has done that before and
maybe has the time to help me directly by email, icq (22030984) or
yahoo (maf_soft) that would be even more helpful :)

thanks in advance!

-moritz

 | Replies | Author | Date
1830 | Re: how to derive a new compontent... | Roland | Wed 5/16/2001


re: Some small bugs and suggestions

From: Mike Lischke [public@l...]
Date: Wed May 16, 2001 10:24 am
Subject: RE: [VirtualTreeview] Some small bugs and suggestions

> Yeah, i'm talking about it. Maybe yuo can add a property for
> customizing lines style?

Very difficult. The problem is that for speed reasons there is an internal
brush now to fill up the lines. I would have to allow the application to
modify this brush. Additionally, the brush is of course only created once
and customization would require to change the logic. Okay, one could provde
two or three fixed line styles. Would this be enough?

To all:
Anybody else out there who would like to have switchable line styles? Have
you ever seen a commercial application where the line style could be
changed? What advantage does a different line style have over the usual
dotted style?

Ciao, Mike

 | Replies | Author | Date
1831 | Re: Some small bugs and suggestions | Danil Galimov | Wed 5/16/2001
1833 | Re: Some small bugs and suggestions | Roland | Wed 5/16/2001


New file uploaded to VirtualTreeview

From: [VirtualTreeview@yahoogroups.com>
Date: Wed May 16, 2001 10:41 am
Subject: New file uploaded to VirtualTreeview

Hello,

This email message is a notification to let you know that
a file has been uploaded to the Files area of the VirtualTreeview
group.

File : /VirtualTree 2.4.11.zip
Uploaded by : [public@l...]
Description : Beta version

You can access this file at the URL

http://groups.yahoo.com/group/VirtualTreeview/files/VirtualTree%202.4.11.zip

To learn more about file sharing for your group, please visit

http://help.yahoo.com/help/us/groups/files

Regards,

public@l...]

 | Replies | Author | Date
1832 | Re: New file uploaded to VirtualTreeview | Danil Galimov | Wed 5/16/2001
1839 | Re: New file uploaded to VirtualTreeview | Mike Lischke | Wed 5/16/2001


re: how to derive a new compontent...

From: "Roland" [Beduerftig@S...]
Date: Wed May 16, 2001 11:12 am
Subject: Re: how to derive a new compontent...

Hi Moritz,

> is there a small example?
>
> i have tried to understand those internaldatasize pointer
> calculations inside the VET source but it seems to be a little bit
> complicated.
>
> a small example would help, but if someone has done that before and
> maybe has the time to help me directly by email, icq (22030984) or
> yahoo (maf_soft) that would be even more helpful :)
>
> thanks in advance!
>
> -moritz

we have small example, send me a mail, then I will reply the example
in the attachment.

Roland


re: Some small bugs and suggestions

From: "Danil Galimov" [danil@o...]
Date: Wed May 16, 2001 11:22 am
Subject: RE: [VirtualTreeview] Some small bugs and suggestions

> Very difficult. The problem is that for speed reasons there is an
> internal brush now to fill up the lines. I would have to allow the
> application to modify this brush. Additionally, the brush is of course
> only created once and customization would require to change the logic.
> Okay, one could provde two or three fixed line styles. Would this be
> enough?
It will be enough for me, but who knows, it might be not enough for
someone else :) You can make it as public property? like
CustomCheckImages, right?


re: New file uploaded to VirtualTreeview

From: "Danil Galimov" [danil@o...]
Date: Wed May 16, 2001 11:33 am
Subject: Re: [VirtualTreeview] New file uploaded to VirtualTreeview

Hello all
Mike, have you also updated your web site? (i mean,
http://www.lischke-online.de/download/Betas/)?
This is still the only way for me for gettinbg VT....

 | Replies | Author | Date
1839 | Re: New file uploaded to VirtualTreeview | Mike Lischke | Wed 5/16/2001


re: Some small bugs and suggestions

From: "Roland" [Beduerftig@S...]
Date: Wed May 16, 2001 1:14 pm
Subject: Re: Some small bugs and suggestions

> To all:
> Anybody else out there who would like to have switchable
> line styles? Have
> you ever seen a commercial application where the line style could be
> changed? What advantage does a different line style have over
> the usual dotted style?

Hi Mike,

before VT I used also LMDListBox a ListBox with an internal header
and the property to switch gridlines, none, horizontal, vertical and
both.

This component use the gridcolor like as linestyle, lightgray looks
like dotted style oder black looks like solid style.

For my application was this enough, and with VT I can work in the
same way.

with best regards
Roland


re: VET 1.1.8 (Expecially Adem, Mathias, and Steffen)

From: "Roland" [Beduerftig@S...]
Date: Wed May 16, 2001 2:43 pm
Subject: Re: VET 1.1.8 (Expecially Adem, Mathias, and Steffen)

Hi Mathias,

> BCB is now happily eating both ShellUtilities.pas &
> VirtualExplorerTree.pas, works perfectly !
> Haven't had time to test the RefresNode method yet though, but I'm
> sure it will do the work I need... ;-)
>
> Many thanks Jim !
>
> /Mathias Thorell

I had read your message here and then I think that is the best time
to added ShellUtilities.pas and VirtualExplorerTree.pas to the
package VirtualTree (I have download version 2.4.11.).

Ok fine, BCB5 will compile without any error and now I have 3
components on the toolbar.

As the next step a create a new project drop the new ExplorerTree
from the toolbar down the form and press compile, the following error
will be shown:

class _di_IQueryInfo : public IQueryInfo { public:
error E2303: typename required
class _di_IContextMenu3 : public IContextMenu3 { public:
error E2303: typename required

struct TShellDetails{
unsigned JustifyFmt;
int nChar;
_STRRET Text;
error E2450 undefined structure (_STREET)

I search "IQueryInfo" on my fixdisk, "IQueryInfo" is defined in
shlobj.h and this file will be include from shlobj.hpp and this file
is in the ShellUtilies.hpp, but what's wrong.

Have you any idea ?

with best regards
Roland

 | Replies | Author | Date
1835 | Re: VET 1.1.8 (Expecially Adem, Mathias, and Stef | [tias@m...] | Wed 5/16/2001
1836 | Re: VET 1.1.8 (Expecially Adem, Mathias, and Stef | Roland | Wed 5/16/2001
1838 | Re: VET 1.1.8 (Expecially Adem, Mathias, and Stef | Steffen Binas | Wed 5/16/2001
1843 | Re: VET 1.1.8 (Expecially Adem, Mathias, and Stef | Roland | Thu 5/17/2001
1847 | Re: VET 1.1.8 (Expecially Adem, Mathias, and Stef | Steffen Binas | Thu 5/17/2001
1848 | Re: VET 1.1.8 (Expecially Adem, Mathias, and Stef | Roland | Thu 5/17/2001
1910 | VET and BCB | Alexander Egorushkin | Mon 5/21/2001
1920 | Re: VET and BCB | [tias@m...] | Mon 5/21/2001
1927 | Re: VET and BCB | Jim Kueneman | Tue 5/22/2001


re: VET 1.1.8 (Expecially Adem, Mathias, and Steffen)

From: [tias@m...]
Date: Wed May 16, 2001 3:15 pm
Subject: Re: VET 1.1.8 (Expecially Adem, Mathias, and Steffen)

--- In [VirtualTreeview@y...], "Roland" [Beduerftig@S...] wrote:
> Hi Mathias,
> I had read your message here and then I think that is the best time
> to added ShellUtilities.pas and VirtualExplorerTree.pas to the
> package VirtualTree (I have download version 2.4.11.).
> Ok fine, BCB5 will compile without any error and now I have 3
> components on the toolbar.
>
> As the next step a create a new project drop the new ExplorerTree
> from the toolbar down the form and press compile, the following
error
> will be shown:
>
> class _di_IQueryInfo : public IQueryInfo { public:
> error E2303: typename required
<snip>
> I search "IQueryInfo" on my fixdisk, "IQueryInfo" is defined in
> shlobj.h and this file will be include from shlobj.hpp and this file
> is in the ShellUtilies.hpp, but what's wrong.
>
> Have you any idea ?

I always define the constant NO_WIN32_LEAN_AND_MEAN (in
Project->Options: Conditional defines).
I figured that one out a long time ago since I kept getting wierd
errors in many headerfiles (shlobj.h was actually on of them).
Don't ask my why ;-), but it's sure keeping BCB5 happy in all my
projects...

/Mathias

Ps. Didn't you get error messages on the _di_IQueryInfo stuff in BCB5
before these HPPEMIT-fixes ? Ds.

 | Replies | Author | Date
1836 | Re: VET 1.1.8 (Expecially Adem, Mathias, and Stef | Roland | Wed 5/16/2001
1838 | Re: VET 1.1.8 (Expecially Adem, Mathias, and Stef | Steffen Binas | Wed 5/16/2001
1843 | Re: VET 1.1.8 (Expecially Adem, Mathias, and Stef | Roland | Thu 5/17/2001
1847 | Re: VET 1.1.8 (Expecially Adem, Mathias, and Stef | Steffen Binas | Thu 5/17/2001
1848 | Re: VET 1.1.8 (Expecially Adem, Mathias, and Stef | Roland | Thu 5/17/2001
1910 | VET and BCB | Alexander Egorushkin | Mon 5/21/2001
1920 | Re: VET and BCB | [tias@m...] | Mon 5/21/2001
1927 | Re: VET and BCB | Jim Kueneman | Tue 5/22/2001
1938 | Re: VET and BCB | Roland | Tue 5/22/2001


re: VET 1.1.8 (Expecially Adem, Mathias, and Steffen)

From: "Roland" [Beduerftig@S...]
Date: Wed May 16, 2001 4:17 pm
Subject: Re: VET 1.1.8 (Expecially Adem, Mathias, and Steffen)

Hi Mathias,

> I always define the constant NO_WIN32_LEAN_AND_MEAN (in

you are right, when I add the constant all will work fine !

I think that is a very good info for the FAQ sites from John, because
many BCB-User have this problem !

> Ps. Didn't you get error messages on the _di_IQueryInfo
> stuff in BCB5 before these HPPEMIT-fixes ? Ds.

No, because the last weeks only I use VT, and today is the first time
I try VirtualExplorer (VE !)

================================================================

Hi Jim and Steffen,

I read the last messages about adding some privat columns, I also can
need this function, but I have 2 questions:

1. How can I translate the Standardcolumn-Text for example "Files",
because I want write a multilanguage application
2. When I try to use GetVETText() with a double in PropertyEditor
a error will shown:
void __fastcall TreeGetVETText(TCustomVirtualExplorerTree
*Sender, int Column, PVirtualNode Node,
TNamespace *Namespace,
WideString &Text, bool &Handled)
E2015 Mehrdeutigkeit zwischen 'TNamespace'
und 'Shellutilities::TNamespace'

have a nice evening
Roland

 | Replies | Author | Date
1838 | Re: VET 1.1.8 (Expecially Adem, Mathias, and Stef | Steffen Binas | Wed 5/16/2001
1843 | Re: VET 1.1.8 (Expecially Adem, Mathias, and Stef | Roland | Thu 5/17/2001
1847 | Re: VET 1.1.8 (Expecially Adem, Mathias, and Stef | Steffen Binas | Thu 5/17/2001
1848 | Re: VET 1.1.8 (Expecially Adem, Mathias, and Stef | Roland | Thu 5/17/2001
1910 | VET and BCB | Alexander Egorushkin | Mon 5/21/2001
1920 | Re: VET and BCB | [tias@m...] | Mon 5/21/2001
1927 | Re: VET and BCB | Jim Kueneman | Tue 5/22/2001
1938 | Re: VET and BCB | Roland | Tue 5/22/2001
1840 | Re: VET 1.1.8 (Expecially Adem, Mathias, and Stef | [tias@m...] | Wed 5/16/2001


re: Some small bugs and suggestions

From: Werner Lehmann [wl@b...]
Date: Wed May 16, 2001 5:37 pm
Subject: Re: [VirtualTreeview] Some small bugs and suggestions

Mike Lischke wrote:
>
> > Yeah, i'm talking about it. Maybe yuo can add a property for
> > customizing lines style?
>
> Very difficult. The problem is that for speed reasons there is an internal
> brush now to fill up the lines. I would have to allow the application to
> modify this brush. Additionally, the brush is of course only created once
> and customization would require to change the logic. Okay, one could provde
> two or three fixed line styles. Would this be enough?

It would for me. BTW, if you made the brush public, what "changes to the
logic" would be needed? Would a simple invalidate in the property setter
method do it?

> To all:
> Anybody else out there who would like to have switchable line styles? Have
> you ever seen a commercial application where the line style could be
> changed? What advantage does a different line style have over the usual
> dotted style?

TdxTreelist from Developer Express (part of the Quantum Express Grid Suite)
has the ability to toggle between these both styles. About the advantage:
it is mainly a matter of personal taste I suppose (which can vary :). Only
thing I can think of is if you have a background bitmap. In this case dotted
might be hard to be spotted :)

Regards,
Werner


re: Re: VET 1.1.8 (Expecially Adem, Mathias, and Steffen)

From: Steffen Binas [steffen.binas@a...]
Date: Wed May 16, 2001 6:39 pm
Subject: Re: [VirtualTreeview] Re: VET 1.1.8 (Expecially Adem, Mathias, and Steffen)

>Hi Jim and Steffen,
>
>I read the last messages about adding some privat columns, I also can
>need this function, but I have 2 questions:
>
>1. How can I translate the Standardcolumn-Text for example "Files",
> because I want write a multilanguage application
Simply change the text ;-)
VET.Header.Columns[0].Text := 'Dateiname';
VET.Header.Columns[3].Text := 'Letzte Änderung';

Regards,
Steffen

eMail: [Steffen.Binas@a...]
Homepage: http://www.aquasoftware.de

 | Replies | Author | Date
1843 | Re: VET 1.1.8 (Expecially Adem, Mathias, and Stef | Roland | Thu 5/17/2001
1847 | Re: VET 1.1.8 (Expecially Adem, Mathias, and Stef | Steffen Binas | Thu 5/17/2001
1848 | Re: VET 1.1.8 (Expecially Adem, Mathias, and Stef | Roland | Thu 5/17/2001
1910 | VET and BCB | Alexander Egorushkin | Mon 5/21/2001
1920 | Re: VET and BCB | [tias@m...] | Mon 5/21/2001
1927 | Re: VET and BCB | Jim Kueneman | Tue 5/22/2001
1938 | Re: VET and BCB | Roland | Tue 5/22/2001


re: New file uploaded to VirtualTreeview

From: "Mike Lischke" [public@l...]
Date: Wed May 16, 2001 7:06 pm
Subject: Re: New file uploaded to VirtualTreeview

--- In [VirtualTreeview@y...], "Danil Galimov" [danil@o...] wrote:
> Hello all
> Mike, have you also updated your web site? (i mean,
> http://www.lischke-online.de/download/Betas/)?
> This is still the only way for me for gettinbg VT....

The file is there now: http://www.lischke-
online.de/download/Betas/VirtualTree.zip.

Ciao, Mike


re: VET 1.1.8 (Expecially Adem, Mathias, and Steffen)

From: [tias@m...]
Date: Wed May 16, 2001 7:47 pm
Subject: Re: VET 1.1.8 (Expecially Adem, Mathias, and Steffen)

--- In [VirtualTreeview@y...], "Roland" [Beduerftig@S...] wrote:
Hi Roland !

<snip>

> 2. When I try to use GetVETText() with a double in PropertyEditor
> a error will shown:
> void __fastcall TreeGetVETText(TCustomVirtualExplorerTree
> *Sender, int Column, PVirtualNode Node,
> TNamespace *Namespace,
> WideString &Text, bool &Handled)
> E2015 Mehrdeutigkeit zwischen 'TNamespace'
> und 'Shellutilities::TNamespace'

Hmmm, that's interesting...
Try to change the line "class TNamspace;" in the Shellutilities.hpp to
"namespace Shellutilities { class TNamespace; }" (of course without
the quotes :-) and tell me if that's working.

/Mathias.

 | Replies | Author | Date
1844 | Re: VET 1.1.8 (Expecially Adem, Mathias, and Stef | Roland | Thu 5/17/2001


Backspace in empty VT

From: Kent Briggs [kbriggs@b...]
Date: Wed May 16, 2001 8:29 pm
Subject: Backspace in empty VT

FYI: I noticed a little bug today when pressing the backspace key in an empty
VT. An access violation occurs in line 12075 of VT 2.4.11. At that point,
the focusednode is being changed to the parent of the focusednode but since
focusednode is nil in an empty tree, the error occurs.

--
Kent Briggs, [kbriggs@b...]
Briggs Softworks, http://www.briggsoft.com

 | Replies | Author | Date
1895 | Re: Backspace in empty VT | Mike Lischke | Mon 5/21/2001


re: Re: VET 1.1.8 (Expecially Adem, Mathias, an d St effen)

From: Jim Kueneman [jimdk@m...]
Date: Thu May 17, 2001 1:07 am
Subject: RE: [VirtualTreeview] Re: VET 1.1.8 (Expecially Adem, Mathias, an d St effen)

At 10:21 AM 5/16/2001 +0200, you wrote:

>Well, the drag image internally uses bitmaps, so all I had to do is to make
>the main bitmap public in the TVTDragImage class. Look for property Image in
>the next upload. Btw: the IDragSourceHelper interface will only be available
>on W2K+. What are your plans regarding the other platforms?

Have them upgrade to W2k <g>. I planned on using your drag implementation
if it is not W2k.

Jim


re: VET 1.1.8 (Expecially Adem, Mathias, and Steffen)

From: "Roland" [Beduerftig@S...]
Date: Thu May 17, 2001 7:48 am
Subject: Re: VET 1.1.8 (Expecially Adem, Mathias, and Steffen)

> >1. How can I translate the Standardcolumn-Text for example "Files",
> > because I want write a multilanguage application
> Simply change the text ;-)
> VET.Header.Columns[0].Text := 'Dateiname';
> VET.Header.Columns[3].Text := 'Letzte Änderung';

Good morning Steffen,

sorry my question was to similar, I try again:

You said VET.Header.Columns[3].Text .... that means all Columns must
have a fix position in VET and when I add own Columns then .... ?

Question:

When we define Symbols:

const
vciFileName = 0;
vciSize = 1;
....
vciUserDef = 100;

Ok then we can translate the standard with:
VET.Header.Columns[vciFileName].Text := ...

that was easy, but:

1. when someone add a standard column or change the position
of a standard column we must only compile the application,
Ready ! ( we must not check we have the right position
of the columns )

2. When VET ask for Text with GetVETText(..., int Column, ...)
should not give us the visible column number, better the
logical column number:
procedure GetVETText(...);
begin
....
// the standard columns are handled by VET
// or of course the user can modify here the Text
// case Column of
// vciSize: Text := ....
// end;
// but normally we must fill in only our own
if (Column >= vciUserDef) then
case (Column-vciUserDef) of
0: Text := ...
1: Text := ....
end;
end;

This is an idea when someone would work with standard columns and own
columns mixed with VET, for example to show additional information
about files shown with VET.

have a nice day
Roland

 | Replies | Author | Date
1847 | Re: VET 1.1.8 (Expecially Adem, Mathias, and Stef | Steffen Binas | Thu 5/17/2001
1848 | Re: VET 1.1.8 (Expecially Adem, Mathias, and Stef | Roland | Thu 5/17/2001
1910 | VET and BCB | Alexander Egorushkin | Mon 5/21/2001
1920 | Re: VET and BCB | [tias@m...] | Mon 5/21/2001
1927 | Re: VET and BCB | Jim Kueneman | Tue 5/22/2001
1938 | Re: VET and BCB | Roland | Tue 5/22/2001


re: VET 1.1.8 (Expecially Adem, Mathias, and Steffen)

From: "Roland" [Beduerftig@S...]
Date: Thu May 17, 2001 8:11 am
Subject: Re: VET 1.1.8 (Expecially Adem, Mathias, and Steffen)

Hi Mathias,

> <snip>
>
> > 2. When I try to use GetVETText() with a double in PropertyEditor
> > a error will shown:
> > void __fastcall TreeGetVETText(TCustomVirtualExplorerTree
> > *Sender, int Column, PVirtualNode Node,
> > TNamespace *Namespace,
> > WideString &Text, bool &Handled)
> > E2015 Mehrdeutigkeit zwischen 'TNamespace'
> > und 'Shellutilities::TNamespace'
>
> Hmmm, that's interesting...
> Try to change the line "class TNamspace;" in the
> Shellutilities.hpp to ......

I modify in Shellutilities.pas
the line
(*$HPPEMIT 'class TNamespace;'*)
to
(*$HPPEMIT 'namespace Shellutilities { class TNamespace; };'*)

Ok then BCB is happy and Testproject will work !

Thanks and have a nice day
Roland


Problem while scrolling through a VTV control

From: [ceiabxl@y...]
Date: Thu May 17, 2001 9:30 am
Subject: Problem while scrolling through a VTV control

I have created a VTreeview with many rootnodes. I read the texts
attached to each node from a file. I can display the texts for each
node.
Problem : when I scroll down in the VTV box, I can see only the
captions of a few nodes but not the complete list even if the nodes
themselves are well created.
The amount of captions displayed depends on the size of my control at
design time. The bigger, the more texts are displayed. Then, I only
have the grid displayed, with the corresponding texts.

Am I missing something. I do not see many differences between my
tests and the Minimal application cominf with the control...

I thank you for your help.

Alain Reymond


Small suggestion

From: "Danil Galimov" [danil@o...]
Date: Thu May 17, 2001 11:09 am
Subject: Small suggestion

Hello all.
Mike, i know, ths options property is filled up :), but can you add to
your ToDo list the creatinon of somee option for showing focused
item than VT is in inactive state? Like KeepSelection?

 | Replies | Author | Date
1858 | Re: Small suggestion | Mike Lischke | Fri 5/18/2001


re: Re: VET 1.1.8 (Expecially Adem, Mathias, and Steffen)

From: Steffen Binas [steffen.binas@a...]
Date: Thu May 17, 2001 11:39 am
Subject: Re: [VirtualTreeview] Re: VET 1.1.8 (Expecially Adem, Mathias, and Steffen)

At 09:48 17.05.2001, you wrote:
> > >1. How can I translate the Standardcolumn-Text for example "Files",
> > > because I want write a multilanguage application
> > Simply change the text ;-)
> > VET.Header.Columns[0].Text := 'Dateiname';
> > VET.Header.Columns[3].Text := 'Letzte Änderung';
>
>You said VET.Header.Columns[3].Text .... that means all Columns must
>have a fix position in VET and when I add own Columns then .... ?

The index is always the same. When you change the position there is only
the Position property changed.

>Question:
>
>When we define Symbols:
>
>const
> vciFileName = 0;
> vciSize = 1;
> ....
> vciUserDef = 100;
>
>Ok then we can translate the standard with:
> VET.Header.Columns[vciFileName].Text := ...
with this symbols it would be more readable.

>that was easy, but:
>
>1. when someone add a standard column or change the position
> of a standard column we must only compile the application,
> Ready ! ( we must not check we have the right position
> of the columns )
>
>2. When VET ask for Text with GetVETText(..., int Column, ...)
> should not give us the visible column number, better the
> logical column number:
This is what it does. It gives us the logical column number.

I do it like that:

var
MyColumnIndex: Integer;

with VET.Header.Column.Add do
begin
MyColumnIndex := Index;
Text := 'My Column';
Position := 0; // Make it the first column -> Index remains MyColumnIndex
end;

procedure GetVETText(...);
begin
if Column = MyColumnIndex then
Text := 'My Text';
end;

Regards,
Steffen

eMail: [Steffen.Binas@a...]
Homepage: http://www.aquasoftware.de

 | Replies | Author | Date
1848 | Re: VET 1.1.8 (Expecially Adem, Mathias, and Stef | Roland | Thu 5/17/2001
1910 | VET and BCB | Alexander Egorushkin | Mon 5/21/2001
1920 | Re: VET and BCB | [tias@m...] | Mon 5/21/2001
1927 | Re: VET and BCB | Jim Kueneman | Tue 5/22/2001
1938 | Re: VET and BCB | Roland | Tue 5/22/2001


re: VET 1.1.8 (Expecially Adem, Mathias, and Steffen)

From: "Roland" [Beduerftig@S...]
Date: Thu May 17, 2001 1:49 pm
Subject: Re: VET 1.1.8 (Expecially Adem, Mathias, and Steffen)

Hi Steffen,

<snip>

> var
> MyColumnIndex: Integer;
>
> with VET.Header.Column.Add do
> begin
> MyColumnIndex := Index;
> Text := 'My Column';
> ....
> if Column = MyColumnIndex then
> Text := 'My Text';

Thanks, I have understand, I must define a global merker for the
columnindex then I can use it to put the Text to VET.

have a nice and sunny day
Roland


need help with DoInitNode and DoInitChildren

From: "Moritz Franckenstein" [franckenstein@a...]
Date: Thu May 17, 2001 2:54 pm
Subject: need help with DoInitNode and DoInitChildren

hi all (and mike),

when i am right, the normal way to dynamically fill the tree with
data is to use these two events:

- DoInitNode has to find its own data by looking at its parent and
its index. then it has to set the HasChildren flag and the
usernodedata (the link to the real data).

- DoInitChildren is executed when a node is expanding and can use the
usernodedata to find out the number of children, nothing else.

is that correct?

but with this i have the following problems:

- i cannot find my data by an index.
- i cannot find out the number of children of the node.

of course i can get all children out of my data and loop through
them. that would make the two things possible. i could manually count
the children and i also could loop through the nodes until i have
found the index i want.

but that would be really bad programming:

- in DoInitNode it would need one loop to find the correct node by
its index. then it would need to start another loop to find out if
there are children (but it could stop when the first is found).
- in DoInitChildren it would need a complete loop to count the
children by getting one after the other, counting it and freeing it
again. that's the only way because not every data item has to be
displayed.

how can i solve this problem in a reasonable way? i want a solution
that is fast and has preferably no disadvantages :)

it is now two days that i am reasearching that but found no good
solution. i hope that someone can help me.

btw.: to give you some extra info about what i am doing - i want to
derive a new component from the CustomVirtualStringTree class that
gets an IXMLDOMDocument and displays it in a tree structure. from
outside my component has to provide all events that are necessary to
allow the user to do a lot of things with this document, like
selecting, editing or changing xml nodes or the structure.

thanks,
-moritz


re: need help with DoInitNode and DoInitChildre n

From: Bender Heri [HBender@E...]
Date: Fri May 18, 2001 7:10 am
Subject: RE: [VirtualTreeview] need help with DoInitNode and DoInitChildre n

Hi Moritz

There is annother possibility, although it breaks the virtual paradigma.

When you init the tree, you can init all nodes with AddChild, followed
immediatly by assigning the NodeData. All you have to to then is to set the
vsInitialized flag in the just created PVirtualNode. This ensures no
DoInitNode is called and furthermore you get a call to DoFreeNode when the
node is removed from the tree (to free your own data).

If the tree is not too big, this is a reasonable alternative to the virtual
approach.

Heri Bender

> -----Original Message-----
> From: Moritz Franckenstein [mailto:[franckenstein@a...]]
> Sent: Thursday, May 17, 2001 4:55 PM
> To: VirtualTreeview@yahoogroups.com
> Subject: [VirtualTreeview] need help with DoInitNode and
> DoInitChildren
>
>
>
> hi all (and mike),
>
> when i am right, the normal way to dynamically fill the tree with
> data is to use these two events:
>
> - DoInitNode has to find its own data by looking at its parent and
> its index. then it has to set the HasChildren flag and the
> usernodedata (the link to the real data).
>
> - DoInitChildren is executed when a node is expanding and can use the
> usernodedata to find out the number of children, nothing else.
>
> is that correct?
>
> but with this i have the following problems:
>
> - i cannot find my data by an index.
> - i cannot find out the number of children of the node.
>
> of course i can get all children out of my data and loop through
> them. that would make the two things possible. i could manually count
> the children and i also could loop through the nodes until i have
> found the index i want.
>
> but that would be really bad programming:
>
> - in DoInitNode it would need one loop to find the correct node by
> its index. then it would need to start another loop to find out if
> there are children (but it could stop when the first is found).
> - in DoInitChildren it would need a complete loop to count the
> children by getting one after the other, counting it and freeing it
> again. that's the only way because not every data item has to be
> displayed.
>
> how can i solve this problem in a reasonable way? i want a solution
> that is fast and has preferably no disadvantages :)
>
> it is now two days that i am reasearching that but found no good
> solution. i hope that someone can help me.
>
> btw.: to give you some extra info about what i am doing - i want to
> derive a new component from the CustomVirtualStringTree class that
> gets an IXMLDOMDocument and displays it in a tree structure. from
> outside my component has to provide all events that are necessary to
> allow the user to do a lot of things with this document, like
> selecting, editing or changing xml nodes or the structure.
>
> thanks,
> -moritz
>
>
> To unsubscribe from this group, send an email to:
> VirtualTreeview-unsubscribe@egroups.com
>
>
>
> Your use of Yahoo! Groups is subject to
> http://docs.yahoo.com/info/terms/
>
>

 | Replies | Author | Date
1852 | Re: need help with DoInitNode and DoInitChildre n | Moritz Franckenstein | Fri 5/18/2001
1859 | Re: need help with DoInitNode and DoInitChildre n | Mike Lischke | Fri 5/18/2001
1861 | Re: need help with DoInitNode and DoInitChildre n | Jonx | Fri 5/18/2001


something else

From: [gslurink@n...]
Date: Fri May 18, 2001 2:42 pm
Subject: something else

Hi all,

I'm an enthousiastic user of VT and VET and follower of this group. I
have a question that is not related to VT but since you folks seem to
know your way around with Delphi I dare to ask it anyway. Forgive me for
'misusing' this group.

I plan to buy Delphi 6 (Professional). I'm now using the Trial Edition of
Delphi 5 Enterprise. I have bought several years ago Delphi 1 and Delphi
2. But then I have not used Delphi for some years until recently I
rediscovered this great tool.

My questions are following:

Since I cannot afford the Enterprise version or even the Professional
Full version, I hope to be eligible for the Professional Upgrade version.
Does anyone know if I am eligible for this with the Delphi versions that
I have ? Some people say you can only upgrade to the professional version
if your previous version is also professional. I think I have Delphi 2
Standard, not Delpi 2 Professional, but I'm not sure if there even
existed a professional version at that time.

What will happen when I buy the Professional Upgrade and install it ?
Will it ask for CD of the previous version ? Is there a change that I
cannot use it at all ?

Another option would be to buy the Personal version. I write most
software, like Internet components and database components myself. Are
there compelling reasons to buy Delphi Professional and not Delphi
Personal when I want to make professional, commercial software ? Do you
have experience with serious limitations in Delphi Personal which might
get in the way ?

Thanks and Regards,
Gerard.

 | Replies | Author | Date
1862 | Re: something else | Jim Kueneman | Fri 5/18/2001


re: need help with DoInitNode and DoInitChildre n

From: "Moritz Franckenstein" [franckenstein@a...]
Date: Fri May 18, 2001 8:29 am
Subject: Re: need help with DoInitNode and DoInitChildre n

> There is annother possibility, although it breaks the virtual
paradigma.

i have already thought about that but i dont like it - my tree
structure could get very big and has to be completely rebuild many
times. and most of the time the tree would stay collapsed and so
there is no need to initialize all nodes. what i need is the fastest
possible way, and that can only be the virtual way.

thank you,
-moritz


Good news and bad news

From: Mike Lischke [public@l...]
Date: Fri May 18, 2001 8:47 am
Subject: Good news and bad news

Hi all,

changes are going on all the time and something significant about Virtual
Treeview has happend meanwhile. I have been forced to take back some
changes/improvements I made recently to stay compatible with products of my
company. i did not agree but had no other choice so I thought back and forth
how handle such situations in the future. After going through many arguments
I decided to split VT into a public and company version. I know about the
trouble maintaining two different branches of source code but the point is
that the company version will not (and should not) change very much at all.
Only bug fixes may be applied.

The bad news is that I will not have as much time to work on VT as I had in
the past. This will also affect the daily support (depends on things to do
here).

The good news is that I feel not so much bound anymore to compatibility
maintanance (applications with the last public version of VT should keep
working after an update or require only little changes, however). This means
I can now include whatever you like and consider as being useful for more
than two people. For the public version I don't have to consider any old
stream formats nor interface. So speak up and tell me what you want, but
keep in mind that I want to finish a new public version finally. Many people
are waiting for a complete help file, bug fixes etc.

Have a nice day

Ciao, Mike

 | Replies | Author | Date
1863 | Re: Good news and bad news | Kent Briggs | Fri 5/18/2001
1871 | Re: Good news and bad news | Mike Lischke | Sat 5/19/2001
1884 | Re: Good news and bad news | Kent Briggs | Sat 5/19/2001
1893 | Re: Good news and bad news | Mike Lischke | Mon 5/21/2001
1892 | Re: Good news and bad news | Rea Berryman | Mon 5/21/2001


re: Some small bugs and suggestions

From: Mike Lischke [public@l...]
Date: Fri May 18, 2001 9:25 am
Subject: RE: [VirtualTreeview] Some small bugs and suggestions

Hi Werner,

> It would for me. BTW, if you made the brush public, what
> "changes to the logic" would be needed? Would a simple invalidate in the
> property setter method do it?

Not entirely. There is now the full implementation again (a property, a
type, a property setter, an event for customization, a property fot the
event, proper reinitialization, an overridable event caller and a simple
logic to switch between the styles).

Ciao, Mike


re: Some small bugs and suggestions

From: Mike Lischke [public@l...]
Date: Fri May 18, 2001 9:26 am
Subject: RE: [VirtualTreeview] Some small bugs and suggestions

Hi Danil,

> It will be enough for me, but who knows, it might be not enough for
> someone else :) You can make it as public property? like
> CustomCheckImages, right?

Line styles are now implemented (lsDotted, lsSolid, lsCustomStyle).

Ciao, Mike


re: Re: Some small bugs and suggestions

From: Mike Lischke [public@l...]
Date: Fri May 18, 2001 9:27 am
Subject: RE: [VirtualTreeview] Re: Some small bugs and suggestions

Hi Roland,

> For my application was this enough, and with VT I can work in the
> same way.

Since you were the third person asking for line styles you qualified the
wish to be included :o]

Ciao, Mike


re: Problem while scrolling through a VTV contr ol

From: Mike Lischke [public@l...]
Date: Fri May 18, 2001 9:38 am
Subject: RE: [VirtualTreeview] Problem while scrolling through a VTV contr ol

Hi Alain,

> Problem : when I scroll down in the VTV box, I can see only the
> captions of a few nodes but not the complete list even if the nodes
> themselves are well created.
> The amount of captions displayed depends on the size of my control at
> design time. The bigger, the more texts are displayed. Then, I only
> have the grid displayed, with the corresponding texts.

I'm not sure I understood what your problem is. You wrote the captions are
displayed well, but only in a particular area of the tree (a particular
range of nodes)? Do you cache the captions or do you always read from file?

Ciao, Mike

 | Replies | Author | Date
1860 | Re: Problem while scrolling through a VTV contr o | [ceiabxl@y...] | Fri 5/18/2001
1870 | Re: Problem while scrolling through a VTV contr o | Werner Lehmann | Fri 5/18/2001
1872 | Re: Problem while scrolling through a VTV contr o | Mike Lischke | Sat 5/19/2001
1877 | Re: Problem while scrolling through a VTV contr o | [ceiabxl@y...] | Sat 5/19/2001
1880 | Re: Problem while scrolling through a VTV contr o | [andersthomsen@h...] | Sat 5/19/2001
1885 | Re: Problem while scrolling through a VTV contr o | [ceiabxl@y...] | Sat 5/19/2001
1898 | Re: Problem while scrolling through a VTV contr o | Mike Lischke | Mon 5/21/2001
1921 | Re: Problem while scrolling through a VTV contr o | [ceiabxl@y...] | Mon 5/21/2001
1878 | Re: Problem while scrolling through a VTV contr o | Werner Lehmann | Sat 5/19/2001


re: Small suggestion

From: Mike Lischke [public@l...]
Date: Fri May 18, 2001 9:39 am
Subject: RE: [VirtualTreeview] Small suggestion

Danil,

> Mike, i know, ths options property is filled up :), but can
> you add to
> your ToDo list the creatinon of somee option for showing focused
> item than VT is in inactive state? Like KeepSelection?

Not necessary. Switch off option voHideSelection and you shoud be fine :o]

Ciao, Mike


re: need help with DoInitNode and DoInitChildre n

From: Mike Lischke [public@l...]
Date: Fri May 18, 2001 9:41 am
Subject: RE: [VirtualTreeview] need help with DoInitNode and DoInitChildre n

> but with this i have the following problems:
>
> - i cannot find my data by an index.
> - i cannot find out the number of children of the node.

We clarify this with private mail, so we can talk in german and ease
communication...

 | Replies | Author | Date
1861 | Re: need help with DoInitNode and DoInitChildre n | Jonx | Fri 5/18/2001


re: Problem while scrolling through a VTV contr ol

From: [ceiabxl@y...]
Date: Fri May 18, 2001 10:09 am
Subject: Re: Problem while scrolling through a VTV contr ol

Hi Mike,

First of all, I must congratulate you for the quality of VTV. It is
also appreciated to receive support from the author himself. In two
words, thank you for the great job.

Now, I apologize for my bad english of yesterday.I was not very clear
in my explanation. What I meant is the following.

I created an application with à VTV control. The client area has a
fixed dimension with scrolling enable.
I created rootnodes. Each node has a small text attached to it (in my
case the name of a pathology). In my test, I create about 900
differents nodes. The first are displayed in the client area. When I
scroll, I can see the text the 20 first nodes only (approximatively).
I am sure that all nodes are present because I can scroll to the end
of the list, but without any text attached to them. I can only see
the grids.

If at design time, I put a bigger client area for the VTV control, I
shall be able to see maybe 30 texts. But when scrolling down, the
same problem as described before occurs : no more description of the
pathology...

Am I doing something wrong ?

Mit freundlichen Gruessen,

Alain

--- In [VirtualTreeview@y...], Mike Lischke [public@l...] wrote:
> Hi Alain,
>
> > Problem : when I scroll down in the VTV box, I can see only the
> > captions of a few nodes but not the complete list even if the
nodes
> > themselves are well created.
> > The amount of captions displayed depends on the size of my
control at
> > design time. The bigger, the more texts are displayed. Then, I
only
> > have the grid displayed, with the corresponding texts.
>
> I'm not sure I understood what your problem is. You wrote the
captions are
> displayed well, but only in a particular area of the tree (a
particular
> range of nodes)? Do you cache the captions or do you always read
from file?
>
> Ciao, Mike


re: need help with DoInitNode and DoInitChildre n

From: "Jonx" [knipjo@h...]
Date: Fri May 18, 2001 1:19 pm
Subject: Re: need help with DoInitNode and DoInitChildre n

> > - i cannot find my data by an index.
> > - i cannot find out the number of children of the node.
> We clarify this with private mail, so we can talk in german and ease
> communication...
When you have clarified things, would it be possible for you to post
your final thoughts here ?
I'm very interessed...
Thank you,
John.


re: something else

From: Jim Kueneman [jimdk@m...]
Date: Fri May 18, 2001 1:38 pm
Subject: Re: [VirtualTreeview] something else

At 07:42 AM 5/18/2001 +0000, you wrote:
>Hi all,
>
>Another option would be to buy the Personal version. I write most
>software, like Internet components and database components myself. Are
>there compelling reasons to buy Delphi Professional and not Delphi
>Personal when I want to make professional, commercial software ? Do you

I can answer this one. If you want to use the VCL the source code in
imperative when things don't work as expected. Also look at the new D6
info on Borlands website. The licence for the personal version EXCLUDES
you from writing commercial software with it. I for one a very
disappointed at a number of changes in Delphi with D6 (not least the new
price structure but that is an whine for the Delphi news groups).

Jim


re: Good news and bad news

From: Kent Briggs [kbriggs@b...]
Date: Fri May 18, 2001 2:18 pm
Subject: Re: [VirtualTreeview] Good news and bad news

Mike Lischke wrote:

> So speak up and tell me what you want, but keep in mind that I want to finish
> a new public version finally. Many people are waiting for a complete help
> file, bug fixes etc.

I'd like to see an IntegralHeight property like the one found in TListbox. If
true, only whole nodes are scrolled into view.

--
Kent Briggs, [kbriggs@b...]
Briggs Softworks, http://www.briggsoft.com


[no subject]

From: Pascal pagès [pages_pascal@y...]
Date: Fri May 18, 2001 6:11 pm
Subject:

___________________________________________________________
Do You Yahoo!? -- Pour faire vos courses sur le Net,
Yahoo! Shopping : http://fr.shopping.yahoo.com


VirtualTreeview

From: Pascal pagès [pages_pascal@y...]
Date: Fri May 18, 2001 6:20 pm
Subject: VirtualTreeview

___________________________________________________________
Do You Yahoo!? -- Pour faire vos courses sur le Net,
Yahoo! Shopping : http://fr.shopping.yahoo.com


re: Autoscroll doesn't work

From: [andersthomsen@h...]
Date: Fri May 18, 2001 7:00 pm
Subject: Re: Autoscroll doesn't work

> And what is your question?

The problem is that autoscroll doesn't work when I try to drag nodes.

-Thomsen

-- In [VirtualTreeview@y...], "Mike Lischke" [public@l...] wrote:
> > I use it for moving nodes around the tree, not to other trees.
> > I use a Drag'n'Drop component to drop files from explorer to it,
>
> Using a drag'n drop component for VT is doubling work and memory.
There is almost everything already
> in VT what you need. The only missing part is that to decompose
incoming data.
>
> >and
> > here the autoscroll works fine. It also works when multiselecting
> > with the selection rectangle.
>
> And what is your question?
>
> Ciao, Mike

 | Replies | Author | Date
1867 | Re: Autoscroll doesn't work | Jim Kueneman | Fri 5/18/2001
1868 | Re: Autoscroll doesn't work | [andersthomsen@h...] | Fri 5/18/2001
1874 | Re: Autoscroll doesn't work | Mike Lischke | Sat 5/19/2001


re: Re: Autoscroll doesn't work

From: Jim Kueneman [jimdk@m...]
Date: Fri May 18, 2001 7:51 pm
Subject: Re: [VirtualTreeview] Re: Autoscroll doesn't work

At 07:00 PM 5/18/2001 +0000, you wrote:
> > And what is your question?
>
>The problem is that autoscroll doesn't work when I try to drag nodes.

Are you waiting as long as the autoscroll delay property? Default is
1000ms which feels like forever <g>

Set it to 100ms

Jim

 | Replies | Author | Date
1868 | Re: Autoscroll doesn't work | [andersthomsen@h...] | Fri 5/18/2001


re: Autoscroll doesn't work

From: [andersthomsen@h...]
Date: Fri May 18, 2001 8:12 pm
Subject: Re: Autoscroll doesn't work

Yes, I've checked that, and that's not the problem...

--- In [VirtualTreeview@y...], Jim Kueneman [jimdk@m...] wrote:
> At 07:00 PM 5/18/2001 +0000, you wrote:
> > > And what is your question?
> >
> >The problem is that autoscroll doesn't work when I try to drag
nodes.
>
>
> Are you waiting as long as the autoscroll delay property? Default
is
> 1000ms which feels like forever <g>
>
> Set it to 100ms
>
> Jim


Problems with NodeHeight

From: [andersthomsen@h...]
Date: Fri May 18, 2001 9:00 pm
Subject: Problems with NodeHeight

I've got some thousand nodes in a tree, some with different
nodeheight.
There seems to be a problem with the way the tree is drawn. If the
tree is scrolled all the way to the top, there doesn't seem to be any
problem, unless I try to select a node. Then the selection color is
only halfway drawn or something like that. If I scroll down a bit and
try to select a node, the node underneath the clicked node is
selected (also with some small drawing errors). If I scroll all the
way towards the buttom, the tree actually scrolls some pages when I
try to select some nodes. Maybe it has something to do with the
DefaultNodeHeight is beeing used instead of the NodeHeight property
of each node, I don't know.
BTW, I'm using checkboxes on some of the nodes, if that has anything
to do with it.

Cheers,
Thomsen

 | Replies | Author | Date
1873 | Re: Problems with NodeHeight | Mike Lischke | Sat 5/19/2001
1875 | Re: Problems with NodeHeight | [andersthomsen@h...] | Sat 5/19/2001
1890 | Re: Problems with NodeHeight | Mike Lischke | Sun 5/20/2001
3079 | Problems with NodeHeight | [andersthomsen@h...] | Sat 7/14/2001
3080 | Problems with NodeHeight | [andersthomsen@h...] | Sat 7/14/2001
3112 | Re: Problems with NodeHeight | Mike Lischke | Sun 7/15/2001


re: Re: Problem while scrolling through a VTV contr ol

From: Werner Lehmann [wl@b...]
Date: Fri May 18, 2001 11:53 pm
Subject: Re: [VirtualTreeview] Re: Problem while scrolling through a VTV contr ol

Mike,

judging by this description it sounds very much like a similar problem
to the one that we had when the tree did only draw halfway down after
sorting. Might be the same reason here?

Werner

[ceiabxl@y...] wrote:
>
> I created an application with à VTV control. The client area has a
> fixed dimension with scrolling enable.
> I created rootnodes. Each node has a small text attached to it (in my
> case the name of a pathology). In my test, I create about 900
> differents nodes. The first are displayed in the client area. When I
> scroll, I can see the text the 20 first nodes only (approximatively).
> I am sure that all nodes are present because I can scroll to the end
> of the list, but without any text attached to them. I can only see
> the grids.


re: Good news and bad news

From: "Mike Lischke" [public@l...]
Date: Sat May 19, 2001 10:06 am
Subject: RE: [VirtualTreeview] Good news and bad news

Hi Kent,

> I'd like to see an IntegralHeight property like the one found in TListbox.
> If true, only whole nodes are scrolled into view.

How to handle trees with varying node heights? Btw: Have you seen the
VerticalIncrement property of Tree.ScrollBarOptions? I suppose you want node
wise scrolling also when thumb tracking, right?

Anybody else who would like to see this feature in VT?

Ciao, Mike


re: Re: Problem while scrolling through a VTV contr ol

From: "Mike Lischke" [public@l...]
Date: Sat May 19, 2001 10:06 am
Subject: RE: [VirtualTreeview] Re: Problem while scrolling through a VTV contr ol

Hi Alain,

> First of all, I must congratulate you for the quality of VTV. It is
> also appreciated to receive support from the author himself. In two
> words, thank you for the great job.

Thank you :o]

> I created rootnodes. Each node has a small text attached to it (in my
> case the name of a pathology). In my test, I create about 900
> differents nodes. The first are displayed in the client area. When I
> scroll, I can see the text the 20 first nodes only (approximatively).

Mmh, this sounds strange. What version of VT do you use? As Werner already
suggested your problem could be related to a cache problem I had to fix a while
ago.

Ciao, Mike

 | Replies | Author | Date
1877 | Re: Problem while scrolling through a VTV contr o | [ceiabxl@y...] | Sat 5/19/2001
1880 | Re: Problem while scrolling through a VTV contr o | [andersthomsen@h...] | Sat 5/19/2001
1885 | Re: Problem while scrolling through a VTV contr o | [ceiabxl@y...] | Sat 5/19/2001
1898 | Re: Problem while scrolling through a VTV contr o | Mike Lischke | Mon 5/21/2001
1921 | Re: Problem while scrolling through a VTV contr o | [ceiabxl@y...] | Mon 5/21/2001


re: Problems with NodeHeight

From: "Mike Lischke" [public@l...]
Date: Sat May 19, 2001 10:06 am
Subject: RE: [VirtualTreeview] Problems with NodeHeight

Anders,

> There seems to be a problem with the way the tree is drawn. If the
> tree is scrolled all the way to the top, there doesn't seem to be any
> problem, unless I try to select a node. Then the selection color is
> only halfway drawn or something like that.

I don't quite understand this problem. Could you please make a small demo
project which shows this
behavior? This way I can quickly fix it (I hope).

Ciao, Mike

 | Replies | Author | Date
1875 | Re: Problems with NodeHeight | [andersthomsen@h...] | Sat 5/19/2001
1890 | Re: Problems with NodeHeight | Mike Lischke | Sun 5/20/2001


re: Re: Autoscroll doesn't work

From: "Mike Lischke" [public@l...]
Date: Sat May 19, 2001 10:06 am
Subject: RE: [VirtualTreeview] Re: Autoscroll doesn't work

Hi Anders,

> The problem is that autoscroll doesn't work when I try to drag nodes.

Do you have enabled auto scrolling? There is an option in Tree.Options.

Ciao, Mike


re: Problems with NodeHeight

From: [andersthomsen@h...]
Date: Sat May 19, 2001 11:59 am
Subject: Re: Problems with NodeHeight

Mike,

Okay, I've tried to make an example problems which shows my two
current problems:
http://www.malerthomsen.dk/VTbug.zip

Thank you for all the work you're doing!

-Thomsen

--- In [VirtualTreeview@y...], "Mike Lischke" [public@l...] wrote:
> Anders,
>
> > There seems to be a problem with the way the tree is drawn. If the
> > tree is scrolled all the way to the top, there doesn't seem to be
any
> > problem, unless I try to select a node. Then the selection color
is
> > only halfway drawn or something like that.
>
> I don't quite understand this problem. Could you please make a
small demo project which shows this
> behavior? This way I can quickly fix it (I hope).
>
> Ciao, Mike

 | Replies | Author | Date
1890 | Re: Problems with NodeHeight | Mike Lischke | Sun 5/20/2001


idea to improve the grid lines

From: "Moritz Franckenstein" [franckenstein@a...]
Date: Sat May 19, 2001 11:59 am
Subject: idea to improve the grid lines

take a look at my example:

this is a screenshot of the normal grid lines:
http://groups.yahoo.com/group/VirtualTreeview/files/treegridnormal.gif

now i have edited it a little bit:
http://groups.yahoo.com/group/VirtualTreeview/files/treegridnew.gif

in my optinion the second layout is better. what do you all think
about it?
i would like to have this layout as an option in vt.

-moritz

 | Replies | Author | Date
1879 | Re: idea to improve the grid lines | Werner Lehmann | Sat 5/19/2001
1881 | Re: idea to improve the grid lines | Moritz Franckenstein | Sat 5/19/2001
1886 | Re: idea to improve the grid lines | Mike Lischke | Sat 5/19/2001
1889 | Re: idea to improve the grid lines | Mike Lischke | Sun 5/20/2001
1891 | Re: idea to improve the grid lines | Moritz Franckenstein | Sun 5/20/2001
1899 | Re: idea to improve the grid lines | Mike Lischke | Mon 5/21/2001


re: Problem while scrolling through a VTV contr ol

From: [ceiabxl@y...]
Date: Sat May 19, 2001 12:18 pm
Subject: Re: Problem while scrolling through a VTV contr ol

Hello Mike,
> Mmh, this sounds strange. What version of VT do you use? As Werner
already suggested your problem could be related to a cache problem I
had to fix a while ago.
I use the last version (I think). It is 1.31. The one I downloaded
from your web site.

A bientôt,

Alain

 | Replies | Author | Date
1880 | Re: Problem while scrolling through a VTV contr o | [andersthomsen@h...] | Sat 5/19/2001
1885 | Re: Problem while scrolling through a VTV contr o | [ceiabxl@y...] | Sat 5/19/2001
1898 | Re: Problem while scrolling through a VTV contr o | Mike Lischke | Mon 5/21/2001
1921 | Re: Problem while scrolling through a VTV contr o | [ceiabxl@y...] | Mon 5/21/2001


re: Re: Problem while scrolling through a VTV contr ol

From: Werner Lehmann [wl@b...]
Date: Sat May 19, 2001 12:32 pm
Subject: Re: [VirtualTreeview] Re: Problem while scrolling through a VTV contr ol

[ceiabxl@y...] wrote:
>
> I use the last version (I think). It is 1.31. The one I downloaded
> from your web site.

Alain,

please go to the file area of this list on yahoogroups.com and download
version 2.4.11. Hopefully your problem will be gone with this one.

Werner


re: idea to improve the grid lines

From: Werner Lehmann [wl@b...]
Date: Sat May 19, 2001 12:34 pm
Subject: Re: [VirtualTreeview] idea to improve the grid lines

Moritz Franckenstein wrote:
>
> take a look at my example:
>
> this is a screenshot of the normal grid lines:
> http://groups.yahoo.com/group/VirtualTreeview/files/treegridnormal.gif
>
> now i have edited it a little bit:
> http://groups.yahoo.com/group/VirtualTreeview/files/treegridnew.gif
>
> in my optinion the second layout is better. what do you all think
> about it?
> i would like to have this layout as an option in vt.

Moritz,

I am all for it. Of course it makes only sense if the maincolumn is
column #1.

Werner

 | Replies | Author | Date
1881 | Re: idea to improve the grid lines | Moritz Franckenstein | Sat 5/19/2001
1886 | Re: idea to improve the grid lines | Mike Lischke | Sat 5/19/2001


re: Problem while scrolling through a VTV contr ol

From: [andersthomsen@h...]
Date: Sat May 19, 2001 12:36 pm
Subject: Re: Problem while scrolling through a VTV contr ol

The version you're using is the latest non-beta version.

Try version 2.4.11 instead, which you'll find in the "Files"-section
of this group.

-Thomsen

--- In [VirtualTreeview@y...], [ceiabxl@y...] wrote:
> Hello Mike,
> > Mmh, this sounds strange. What version of VT do you use? As
Werner
> already suggested your problem could be related to a cache problem
I
> had to fix a while ago.
> I use the last version (I think). It is 1.31. The one I downloaded
> from your web site.
>
> A bientôt,
>
> Alain

 | Replies | Author | Date
1885 | Re: Problem while scrolling through a VTV contr o | [ceiabxl@y...] | Sat 5/19/2001
1898 | Re: Problem while scrolling through a VTV contr o | Mike Lischke | Mon 5/21/2001
1921 | Re: Problem while scrolling through a VTV contr o | [ceiabxl@y...] | Mon 5/21/2001


re: idea to improve the grid lines

From: "Moritz Franckenstein" [franckenstein@a...]
Date: Sat May 19, 2001 2:22 pm
Subject: Re: idea to improve the grid lines

> I am all for it. Of course it makes only sense if the maincolumn is
> column #1.
>
> Werner

yes, and also in bidimode righttoleft when its the last column.

-moritz

 | Replies | Author | Date
1886 | Re: idea to improve the grid lines | Mike Lischke | Sat 5/19/2001


re: Incremental Searching

From: Werner Lehmann [wl@b...]
Date: Sat May 19, 2001 3:42 pm
Subject: Re: [VirtualTreeview] Incremental Searching

Mike Lischke wrote:
>
> > The usual explorer behaviour is different:
> > the search always starts with the focused node. If you have
> > 20 nodes all beginning with 'a', you could cycle through them with
> > subsequent 'a'-key presses.
>
> Fixed.

Yes, that works now. There is still one difference to the explorer with respect
to this part of the feature: lets assume that you searched successfully for a
node beginning with 'a', and it is focused now. You press 'a' again in short
time (you can even hold the a-key down). Explorer will try to find a file
beginning
with 'aa'. If not found it will reject the second 'a' and search for the next
file beginning with 'a'.

Here's the difference: even if incremental search is not successful the search
string grows. By holding down a key I can easily get a search string of 20 's's
although no node begins with more than a single 's'. You can also notice this
behaviour (explorer style I mean :) in the Delphi IDE: press ctrl+E. You will
not
be able to enter a search text which is not somewhere in the file which is
searched.

I am not sure if I should (can) insist on a change for this behaviour. You
decide...

> > Another difference to the explorer way of searching is wrap around:
> > currently we don't have a search wrap around at the end of the node list.
>
> Also fixed.

Works as well. With one bug left: if the search starts on the last node
(forward,
all nodes searched) the incremental search event is called with a nil node. Easy
to reject this in the event handler but should not happen in the first place.
IMHO.

> > Should be considerably easy to change, unless you had
> > something special in mind with FLastSearchNode for not using the focused
> node.
> > What do you think?
>
> I agree, although it was not that easy to change (particularly if you
> consider everything together like visible nodes only, backward search, wrap
> around and some little but important other considerations). Seems it works
> now, however. Wait for next upload.

Ok, I see that multiple inc search properties complicate the implementation for
all possible combinations. Thanks for doing it anyway.

Regards,
Werner

 | Replies | Author | Date
1894 | Re: Incremental Searching | Mike Lischke | Mon 5/21/2001
1918 | Re: Incremental Searching | Mike Lischke | Mon 5/21/2001


re: Incremental Searching

From: Werner Lehmann [wl@b...]
Date: Sat May 19, 2001 3:49 pm
Subject: Re: [VirtualTreeview] Incremental Searching

Mike Lischke wrote:
>
> > As a side node, right after updating from 2.4.7 to .9 I got an AV with
> > incremental searching, the debugger stopped on the line in
>
> Mmh, I tried this too but could not produce any error whatsoever. Either the
> error was really on your side or I have removed it implictly when I reworked
> the code and tested it (ah there is a third possibility: I am too stupid to
> reproduce it, this has some probability too :o]).

Here is only one person stupid and it is me :)

Part of my inc search event handler looks like this:

var
NodeText, CmpText: string;
begin
...
CmpText := Text; // yes, I am ignoring widestrings all the time, probably
// a disappointment for Mike "Unicode" Lischke :)
result := AnsiStrLIComp(PChar(CmpText), PChar(NodeText), Length(CmpText));
end;

This code works as long as the search string (CmpText) is not longer than
the NodeText. If NodeText is shorter it will result in an AV in kernel32...

This is better:

result := AnsiStrLIComp(PChar(CmpText), PChar(NodeText),
Min(Length(CmpText), Length(NodeText)));

BTW, do you know how the length of a AnsiString is computed? Is there still
a length stored somewhere at "PChar(stringvar) - x" or is it linear search
for a trailing zero byte?

Regards,
Werner

 | Replies | Author | Date
1888 | Re: Incremental Searching | Mike Lischke | Sun 5/20/2001
1928 | DragManager | Jim Kueneman | Tue 5/22/2001
1929 | Re: DragManager, It's my bug not yours | Jim Kueneman | Tue 5/22/2001


re: Good news and bad news

From: Kent Briggs [kbriggs@b...]
Date: Sat May 19, 2001 5:33 pm
Subject: Re: [VirtualTreeview] Good news and bad news

Mike Lischke wrote:

> Hi Kent,
>
> > I'd like to see an IntegralHeight property like the one found in TListbox.
> > If true, only whole nodes are scrolled into view.
>
> How to handle trees with varying node heights?

I suppose if any part of the node was above or below the visible client area,
it just wouldn't get painted. I don't know what kind of technical problems
this brings so it might not be worth it.

> Btw: Have you seen the VerticalIncrement property of Tree.ScrollBarOptions?

Isn't that only used for autoscrolling?

> I suppose you want node wise scrolling also when thumb tracking, right?

That's the way the treeview in Windows Explorer works. As you drag down the
thumb control, only whole nodes pop into view at the top. It does allow
partial items to be displayed at the bottom,
however. Perhaps there could be two options: IntegralHeightTop and
IntegralHeightBottom (or WholeNodeTop, WholeNodeBottom).

--
Kent Briggs, [kbriggs@b...]
Briggs Softworks, http://www.briggsoft.com

 | Replies | Author | Date
1893 | Re: Good news and bad news | Mike Lischke | Mon 5/21/2001


re: Problem while scrolling through a VTV contr ol

From: [ceiabxl@y...]
Date: Sat May 19, 2001 5:48 pm
Subject: Re: Problem while scrolling through a VTV contr ol

Hello Thomsen,

I downloaded version 2.4.11 from the files section. The problem
remains the same.

I placed the source of my test at
http://www.ceia.com/delphi/vtvtest.zip

Just in case ...

Have a nice week-end.

Alain

--- In [VirtualTreeview@y...], [andersthomsen@h...] wrote:
> The version you're using is the latest non-beta version.
>
> Try version 2.4.11 instead, which you'll find in the "Files"-
section
> of this group.
>
> -Thomsen
>
> --- In [VirtualTreeview@y...], [ceiabxl@y...] wrote:
> > Hello Mike,
> > > Mmh, this sounds strange. What version of VT do you use? As
> Werner
> > already suggested your problem could be related to a cache
problem
> I
> > had to fix a while ago.
> > I use the last version (I think). It is 1.31. The one I
downloaded
> > from your web site.
> >
> > A bientôt,
> >
> > Alain

 | Replies | Author | Date
1898 | Re: Problem while scrolling through a VTV contr o | Mike Lischke | Mon 5/21/2001
1921 | Re: Problem while scrolling through a VTV contr o | [ceiabxl@y...] | Mon 5/21/2001


re: Re: idea to improve the grid lines

From: "Mike Lischke" [public@l...]
Date: Sat May 19, 2001 5:51 pm
Subject: RE: [VirtualTreeview] Re: idea to improve the grid lines

> > I am all for it. Of course it makes only sense if the maincolumn is
> > column #1.
> yes, and also in bidimode righttoleft when its the last column.

Wahnsinnige :o)

I'll think about it...

Ciao, Mike


Bug in GetLastVisibleChild

From: [andersthomsen@h...]
Date: Sat May 19, 2001 6:49 pm
Subject: Bug in GetLastVisibleChild

Hi Mike,

I needed the function GetLastVisible, but it isn't there, so instead
I tried using GetLastVisibleChild(tree.RootNode), which should return
the same node.
However, there seems to be a bug in this function:

function TBaseVirtualTree.GetLastVisibleChild(Node: PVirtualNode):
PVirtualNode;

begin
if (Node = nil) or (Node = FRoot) then //The node is the rootnode
Result := FRoot.LastChild //This node is just the last node,
else //not the last visible node!!!
Result := Node;

if Assigned(Result) then
begin
if not FullyVisible[Result] then //And since the last node in
Result := nil // my tree is not visible,
else //the function returns nil!!
... ....

Is this correct or is it a bug?

-Thomsen

 | Replies | Author | Date
1897 | Re: Bug in GetLastVisibleChild | Mike Lischke | Mon 5/21/2001


re: Incremental Searching

From: "Mike Lischke" [public@l...]
Date: Sun May 20, 2001 11:39 am
Subject: RE: [VirtualTreeview] Incremental Searching

Hi Werner,

> This is better:
>
> result := AnsiStrLIComp(PChar(CmpText), PChar(NodeText),
> Min(Length(CmpText), Length(NodeText)));

Would you like to see the code of my own search handler :-)?

procedure TfrmProperties.VST3IncrementalSearch(Sender: TBaseVirtualTree; Node:
PVirtualNode; const
Text: WideString;
var Result: Integer);

var
S, PropText: string;

begin
// Note: This code requires a proper Unicode/WideString comparation routine
which I did not want
to link here for
// size and clarity reasons. For now strings are (implicitely) converted to
ANSI to make the
comparation work.
// Search is not case sensitive.
S := Text;
if Node.Parent = Sender.RootNode then
begin
// root nodes
if Node.Index = 0 then
PropText := 'Description'
else
PropText := 'Origin';
end
else
begin
PropText := PropertyTexts[Node.Parent.Index, Node.Index, ptkText];
end;

// By using StrLIComp we can specify a maximum length to compare. This allows
us to find also
nodes
// which match only partially.
Result := StrLIComp(PChar(S), PChar(PropText), Min(Length(S),
Length(PropText)))
end;

> BTW, do you know how the length of a AnsiString is computed? Is there still
> a length stored somewhere at "PChar(stringvar) - x" or is it linear search
> for a trailing zero byte?

For ANSI strings there is still a length value and additonally a reference
counter value in front of
the string. PChars and PWideChars are walked character by character to find a
trailing 0.

Ciao, Mike

 | Replies | Author | Date
1928 | DragManager | Jim Kueneman | Tue 5/22/2001
1929 | Re: DragManager, It's my bug not yours | Jim Kueneman | Tue 5/22/2001


re: idea to improve the grid lines

From: "Mike Lischke" [public@l...]
Date: Sun May 20, 2001 11:39 am
Subject: RE: [VirtualTreeview] idea to improve the grid lines

Hi Moritz,

> this is a screenshot of the normal grid lines:
> http://groups.yahoo.com/group/VirtualTreeview/files/treegridnormal.gif
> now i have edited it a little bit:
> http://groups.yahoo.com/group/VirtualTreeview/files/treegridnew.gif
>
> in my optinion the second layout is better. what do you all think
> about it?

Well, I have a first idea how to draw a tree this way, but I wonder what you
consider being better
in the second layout? Ok, the horizontal grid lines starting with the vertical
tree lines have the
effect to layout the tree like source code. Not a bad option. But the tree
lines look now weird.
Shouldn't they still point to the right for node entries?

Ciao, Mike

 | Replies | Author | Date
1891 | Re: idea to improve the grid lines | Moritz Franckenstein | Sun 5/20/2001
1899 | Re: idea to improve the grid lines | Mike Lischke | Mon 5/21/2001


re: Re: Problems with NodeHeight

From: "Mike Lischke" [public@l...]
Date: Sun May 20, 2001 11:39 am
Subject: RE: [VirtualTreeview] Re: Problems with NodeHeight

Hi Anders,

> Okay, I've tried to make an example problems which shows my two
> current problems:
> http://www.malerthomsen.dk/VTbug.zip

Thank you for this demo. It helped a lot to find out what was wrong. In the
upper tree you had the
problem with wrongly painted nodes, right? This is due to the direct assignment
of the height to the
internal NodeHeight member of a node. This way the tree does not get notified
about changes. Better
you use: Tree.NodeHeight[aNode] := 30;

For the scrolling I found that the implementation for VCL drag'n drop was
incomplete (and buggy
too). Sorry, I simply have lost this out of my mind when I restructured the OLE
drag'n drop (which
was tough stuff) and never came back to finish that (I don't use VCL dd).

With the next update your problems should then be fixed.

Ciao, Mike


re: idea to improve the grid lines

From: "Moritz Franckenstein" [franckenstein@a...]
Date: Sun May 20, 2001 6:56 pm
Subject: Re: idea to improve the grid lines

http://groups.yahoo.com/group/VirtualTreeview/files/treegridnew.gif

> Well, I have a first idea how to draw a tree this way, but I wonder
what you consider being better in the second layout?
hm. i'm not sure, it's just a feeling :)
maybe its because of no more crossing of grid lines with tree lines.
i found that to be not so nice.

> Ok, the horizontal grid lines starting with the vertical tree lines
have the
> effect to layout the tree like source code. Not a bad option. But
the tree lines look now weird.
> Shouldn't they still point to the right for node entries?
i have also thought about that but then decided to use this way. hm.
maybe start a poll? :)

it's not so urgent, only one spontaneous idea.

-moritz

 | Replies | Author | Date
1899 | Re: idea to improve the grid lines | Mike Lischke | Mon 5/21/2001


re: Good news and bad news

From: Rea Berryman [fberrym1@t...]
Date: Mon May 21, 2001 1:11 am
Subject: Re: [VirtualTreeview] Good news and bad news

Yes, that would be a nice addition!

Rea

Mike Lischke wrote:

> I suppose you want node wise scrolling also when thumb tracking, right?
>
> Anybody else who would like to see this feature in VT?


re: Good news and bad news

From: "Mike Lischke" [public@l...]
Date: Mon May 21, 2001 7:23 am
Subject: RE: [VirtualTreeview] Good news and bad news

Hi Kent,

> I suppose if any part of the node was above or below the visible client area,
it just
> wouldn't get painted. I don't know what kind of technical problems this
brings so it
> might not be worth it.

I would like to defer the IntegralHeight feature a while to get out the next
public release first. I
hope you don't mind.

> > Btw: Have you seen the VerticalIncrement property of Tree.ScrollBarOptions?
> Isn't that only used for autoscrolling?

Indeed, but this is not correct. I have changed the tree so that it uses the
increments also for
normal scrolling.

Ciao, Mike


re: Incremental Searching

From: "Mike Lischke" [public@l...]
Date: Mon May 21, 2001 7:23 am
Subject: RE: [VirtualTreeview] Incremental Searching

Hi Werner,

> There is still one difference to the explorer with respect
> to this part of the feature: lets assume that you searched successfully for a
> node beginning with 'a', and it is focused now. You press 'a' again in short
> time (you can even hold the a-key down). Explorer will try to find a file
beginning
> with 'aa'. If not found it will reject the second 'a' and search for the next
> file beginning with 'a'.

For the time being I want to leave that out. I think this is not a feature
which is useful enough to
justify more time for a solution if everything else works. Btw: in the Delphi
IDE you also cannot
keep a letter pressed and the editor will jump to other places starting with
the already entered
combination. But this search is different in some other ways too (like being
not time limited) so it
should not be used as reference.

> if the search starts on the last node (forward,
> all nodes searched) the incremental search event is called with a nil node.

Fixed.

Ciao, Mike


re: Backspace in empty VT

From: "Mike Lischke" [public@l...]
Date: Mon May 21, 2001 7:23 am
Subject: RE: [VirtualTreeview] Backspace in empty VT

Hi Kent,

> FYI: I noticed a little bug today when pressing the backspace key in an empty
> VT. An access violation occurs in line 12075 of VT 2.4.11.

Thank you. This bug is fixed now.

Ciao, Mike


Small flaws

From: "Danil Galimov" [danil@o...]
Date: Mon May 21, 2001 7:42 am
Subject: Small flaws

Hello all.
Mike, in latest VT, then i enable voHideFocusRect, the captions
are not drawn. To be more corectly, they are drawn as spaces :)

Also, there is some strange behavoir with hints. I have assigned
Hint property, and fade hint animation, but the hint is displayed
without any delay, then i move corsor to VT, and without any
animation. I'm using win98, so is fade hint animation avaliable on
win2k only?

And a small suggestion: what about AutoHint property, which will
automatically show hints for header columns and nodes' captions,
which have shortened? This is a default behaviour in some
WIndows controls, so i think, not only me want it :)

And in some windows configuration (large icons), some custom
check images are not fully drawn. I will post somewhere a
screenshot (and custom images file :)) so you can see it yourself.
Thanks.

 | Replies | Author | Date
2007 | Re: Small flaws | Mike Lischke | Sun 5/27/2001


re: Bug in GetLastVisibleChild

From: "Mike Lischke" [public@l...]
Date: Mon May 21, 2001 8:03 am
Subject: RE: [VirtualTreeview] Bug in GetLastVisibleChild

Hi Anders,

> I needed the function GetLastVisible, but it isn't there, so instead
> I tried using GetLastVisibleChild(tree.RootNode), which should return
> the same node.

I have reworked this part of the node navigation last weekend. The functions
are now consistent
(e.g. GetLastChild retrieves only the last child node of the given node instead
iterating the entire
branch) and complete (GetLast, GetLastChild, GetLastVisible,
GetLastVisibleChild + xxxNoInit
variants).

> However, there seems to be a bug in this function:

This is fixed now.

Ciao, Mike


re: Re: Problem while scrolling through a VTV contr ol

From: "Mike Lischke" [public@l...]
Date: Mon May 21, 2001 8:03 am
Subject: RE: [VirtualTreeview] Re: Problem while scrolling through a VTV contr ol

Hi Alain,

> I downloaded version 2.4.11 from the files section. The problem
> remains the same.

Yes indeed the problem persists because in is not (directly) caused by the
tree. There are several
things I would implement differently but for now I recommend simply to count
the number of entries
(as you do with your gloabl index variable) and use this to set the root node
count in the load
code. This will make your initialization of the Data.Index member via the
mentioned global variable
no longer work. But you don't need this member. Every node comes already with
an index relative to
its parent node. Use this like:

procedure TLogoAppForm.VSTGetText(Sender: TBaseVirtualTree;
Node: PVirtualNode; Column: Integer; TextType: TVSTTextType;
var Text: WideString);
begin
Data := Sender.GetNodeData(Node);
// if Assigned(Data) then
// Text := MyRec[1,Data.Index]+' '+MyRec[2,Data.Index];
Text := MyRec[1, Node.Index + 1]+' '+MyRec[2, Node.Index];
end;

Ciao, Mike

 | Replies | Author | Date
1921 | Re: Problem while scrolling through a VTV contr o | [ceiabxl@y...] | Mon 5/21/2001


re: Re: idea to improve the grid lines

From: "Mike Lischke" [public@l...]
Date: Mon May 21, 2001 8:03 am
Subject: RE: [VirtualTreeview] Re: idea to improve the grid lines

Hi Moritz,

> it's not so urgent, only one spontaneous idea.

Ok, defered to a later release :o)

Ciao, Mike


New file uploaded to VirtualTreeview

From: [VirtualTreeview@yahoogroups.com>
Date: Mon May 21, 2001 8:19 am
Subject: New file uploaded to VirtualTreeview

Hello,

This email message is a notification to let you know that
a file has been uploaded to the Files area of the VirtualTreeview
group.

File : /VirtualTree 2.4.16.zip
Uploaded by : [public@l...]
Description : Beta version

You can access this file at the URL

http://groups.yahoo.com/group/VirtualTreeview/files/VirtualTree%202.4.16.zip

To learn more about file sharing for your group, please visit

http://help.yahoo.com/help/us/groups/files

Regards,

[public@l...]

Replies Author Date


Problems with new nodes

From: Steffen Schemel [st_schemel@y...]
Date: Mon May 21, 2001 9:45 am
Subject: Problems with new nodes

Hello!

I had a problem on create new root-nodes. The
demonstration works correctly. Then i have this code
used to work with an oracle-db. On initnode i set the
data from an query, the text i have set with gettext.
The problem is: when the new node the visible area
leaves (it was create not into the visible area, its
scrolling down), all this nodes became the data and
text from the last! dataset. I dont know why.

Can you help me???

Regards
St. Schemel

__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
http://auctions.yahoo.com/

 | Replies | Author | Date
1912 | Re: Problems with new nodes | Alexander Egorushkin | Mon 5/21/2001
1966 | Re: Problems with new nodes | Steffen Schemel | Wed 5/23/2001
1971 | Re: Problems with new nodes | Alexander Egorushkin | Wed 5/23/2001
1984 | Re: Problems with new nodes | Steffen Schemel | Thu 5/24/2001
2065 | Re: Problems with new nodes | Steffen Schemel | Wed 5/30/2001
2068 | Re: Problems with new nodes | Alexander Egorushkin | Wed 5/30/2001
2070 | Re: Problems with new nodes | Roland | Wed 5/30/2001
2066 | Re: Problems with new nodes | Werner Lehmann | Wed 5/30/2001
2067 | Re: Problems with new nodes | Steffen Schemel | Wed 5/30/2001


re: New file uploaded to VirtualTreeview

From: [mdissel@h...]
Date: Mon May 21, 2001 12:27 pm
Subject: Re: New file uploaded to VirtualTreeview

Hello

I found a bug in the new version 2.4.16..

the declaration differs from the prevous declaration ..

TCustomVirtualExplorerTree = class(TCustomVirtualStringTree)
..
function DoKeyAction(var CharCode: Word; var Shift: TShiftState):
Boolean; virtual;

the VAR statement was missing.

Regards,

Marco

--- In [VirtualTreeview@y...], [VirtualTreeview@y...] wrote:
>
> Hello,
>
> This email message is a notification to let you know that
> a file has been uploaded to the Files area of the VirtualTreeview
> group.
>
> File : /VirtualTree 2.4.16.zip
> Uploaded by : [public@l...]
> Description : Beta version
>
> You can access this file at the URL
>
> http://groups.yahoo.com/group/VirtualTreeview/files/VirtualTree%
202.4.16.zip
>
> To learn more about file sharing for your group, please visit
>
> http://help.yahoo.com/help/us/groups/files
>
> Regards,
>
> [public@l...]


re: Re: New file uploaded to VirtualTreeview

From: Mike Lischke [public@l...]
Date: Mon May 21, 2001 12:50 pm
Subject: RE: [VirtualTreeview] Re: New file uploaded to VirtualTreeview

Hi Marco,

> I found a bug in the new version 2.4.16..
>
> the declaration differs from the prevous declaration ..
> function DoKeyAction(var CharCode: Word; var Shift: TShiftState):
> Boolean; virtual;
> the VAR statement was missing.

Correct, thank you. VET needs an update too when VT changes. But I don't
want to make changes in parallel to Jim so please fix it on your own until
the package is updated.

Ciao, Mike

 | Replies | Author | Date
1913 | TCollection vs. List | Alexander Egorushkin | Mon 5/21/2001
1915 | Re: TCollection vs. List | [adembaba@e...] | Mon 5/21/2001
1930 | Re: TCollection vs. List | Alexander Egorushkin | Tue 5/22/2001
1925 | Re: New file uploaded to VirtualTreeview | Jim Kueneman | Tue 5/22/2001
1926 | Re: New file uploaded to VirtualTreeview, Oops | Jim Kueneman | Tue 5/22/2001
2132 | Re: New file uploaded to VirtualTreeview | Kent Briggs | Sat 6/2/2001
2133 | Re: New file uploaded to VirtualTreeview | Mike Lischke | Sat 6/2/2001
2279 | Re: New file uploaded to VirtualTreeview | Kent Briggs | Fri 6/8/2001
2280 | Re: New file uploaded to VirtualTreeview | Mike Lischke | Fri 6/8/2001


Image of focused node

From: [lorenz@k...]
Date: Mon May 21, 2001 12:59 pm
Subject: Image of focused node

Hi,

I´m using the latest VT-Version and almost everything is right.

But if I select a node, the node´s background turns blue (thats nice)
and the nodes image looks like "grayed out" (exactly it´s "blueed
out"). I´m using VirtualStringTree.

How can I manage that the focused node stays in its normal color?

Is there a property I don´t know so far, or what is the problem?

Greetings

S. Lorenz

PS: Please excuse my english :-)

 | Replies | Author | Date
1906 | Re: Image of focused node | Werner Lehmann | Mon 5/21/2001
1942 | Re: Image of focused node | Mike Lischke | Tue 5/22/2001


Whistler

From: Mike Lischke [public@l...]
Date: Mon May 21, 2001 3:56 pm
Subject: Whistler

Hi all,

I just had the pleasure to test some of the VT demos my new Whistler
professional beta 1 (Windows XP) system and must say they look grrrrrrreat
:o)

One problem arises, however, due to the new layout there. The scrollbars do
not fit very well and look strange. I'm quite sure this related to the flat
SB redirection and I would like to remove the flat scroll bars
implementation entirely. First however, I would like to have some feedback
from you about this. Does anybody actually use flat scroll bars? Does
anybody mind removing flat scroll bars from VT?

Ciao, Mike

Dipl. Ing. Mike Lischke
Senior software engineer
_________________________
digital publishing AG
Tumblinger Strasse 32
80337 Munich, Germany
Fon +49 (89) 747 482 32
Fax +49 (89) 747 923 08
http://www.digitalpublishing.de

 | Replies | Author | Date
1907 | Re: Whistler | Simon Moscrop | Mon 5/21/2001
1908 | Re: Whistler | Jim Kueneman | Mon 5/21/2001
1916 | Re: Whistler | [adembaba@e...] | Mon 5/21/2001
1914 | Re: Whistler | Paul Istrate | Mon 5/21/2001
1924 | Re: Whistler | Wez Furlong | Mon 5/21/2001
2005 | Re: Whistler | Mike Lischke | Sun 5/27/2001
1922 | Re: Whistler | Werner Lehmann | Mon 5/21/2001
1945 | Re: Whistler | Mike Lischke | Tue 5/22/2001
1957 | Re: Whistler | Alexander Egorushkin | Tue 5/22/2001


re: Image of focused node

From: Werner Lehmann [wl@b...]
Date: Mon May 21, 2001 3:51 pm
Subject: Re: [VirtualTreeview] Image of focused node

[lorenz@k...] wrote:
>
> How can I manage that the focused node stays in its normal color?

You mean the image of the focused node probably. The blue-blending of
that image is a feature, not a bug, and has been introduced by Mike
some weeks ago. BTW, it corresponds to the behaviour of the windows
explorer.

> Is there a property I don´t know so far, or what is the problem?

No property that I knew of.

Werner


re: Whistler

From: "Simon Moscrop" [SimonMoscrop@H...]
Date: Mon May 21, 2001 4:41 pm
Subject: Re: [VirtualTreeview] Whistler

I have no problem with the removal of flast scroll bars

- just thought i'd let you know.
- Simon Moscrop
----- Original Message -----
From: Mike Lischke
To: Virtual Treeview mailing list (E-Mail)
Sent: Monday, May 21, 2001 4:56 PM
Subject: [VirtualTreeview] Whistler

Hi all,

I just had the pleasure to test some of the VT demos my new Whistler
professional beta 1 (Windows XP) system and must say they look grrrrrrreat
:o)

One problem arises, however, due to the new layout there. The scrollbars do
not fit very well and look strange. I'm quite sure this related to the flat
SB redirection and I would like to remove the flat scroll bars
implementation entirely. First however, I would like to have some feedback
from you about this. Does anybody actually use flat scroll bars? Does
anybody mind removing flat scroll bars from VT?

Ciao, Mike

Dipl. Ing. Mike Lischke
Senior software engineer
_________________________
digital publishing AG
Tumblinger Strasse 32
80337 Munich, Germany
Fon +49 (89) 747 482 32
Fax +49 (89) 747 923 08
http://www.digitalpublishing.de

To unsubscribe from this group, send an email to:
VirtualTreeview-unsubscribe@egroups.com

Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.

[Non-text portions of this message have been removed]


re: Whistler

From: "Jim Kueneman" [jimdk@m...]
Date: Mon May 21, 2001 4:36 pm
Subject: Re: Whistler

--- In [VirtualTreeview@y...], Mike Lischke [public@l...] wrote:
> from you about this. Does anybody actually use flat scroll bars?
Does
> anybody mind removing flat scroll bars from VT?

I have never liked the look of flat scrollbars so no bother to me.

Jim

 | Replies | Author | Date
1916 | Re: Whistler | [adembaba@e...] | Mon 5/21/2001


New poll for VirtualTreeview

From: VirtualTreeview@yahoogroups.com
Date: Mon May 21, 2001 4:45 pm
Subject: New poll for VirtualTreeview

Enter your vote today! A new poll has been created for the
VirtualTreeview group:

Flat scroll bars seem to create more
problems than they a worth. Under
Windows XP they also break the look and
feel of the new style. So I would like
to remove flat scroll bar support from
Virtual Treeview. What is your opinion?

o Remove flat scroll bars.
o Keep flat scroll bars.

To vote, please visit the following web page:

http://groups.yahoo.com/group/VirtualTreeview/polls

Note: Please do not reply to this message. Poll votes are
not collected via email. To vote, you must go to the Yahoo! Groups
web site listed above.

Thanks!


VET and BCB

From: "Alexander Egorushkin" [egorushkin@m...]
Date: Mon May 21, 2001 5:01 pm
Subject: VET and BCB

Good day, Jim!
I'm sorry for my late reply on the subject, but I was out all the time.

(*$HPPEMIT 'class _di_IDropTarget : public IDropTarget { public:'*)
...

(*$HPPEMIT 'class _di_IQueryInfo : public IQueryInfo { public:'*)
...

(*$HPPEMIT 'class _di_IContextMenu3 : public IContextMenu3 { public:'*)
...

BCB is not so ugly as you think about it :) Could you try this:

{HPPEMIT 'typedef DelphiInterface<IDropTarget> _di_IDropTarget;'}
{HPPEMIT 'typedef DelphiInterface<IQueryInfo> _di_IQueryInfo;'}
{HPPEMIT 'typedef DelphiInterface<IContextMenu3> _di_IContextMenu3;'}

I'm not sure about _di_IDropTarget, may be it is declared in <objidl.h> (if
it is used in VTV - that's true). Ronald and Mathias could you try it (I
have upgraded to Win2k and haven't installed BCB yet).

Alex.

 | Replies | Author | Date
1920 | Re: VET and BCB | [tias@m...] | Mon 5/21/2001
1927 | Re: VET and BCB | Jim Kueneman | Tue 5/22/2001
1938 | Re: VET and BCB | Roland | Tue 5/22/2001


re: Re: pb to install VTV on BCB5/Another BCB problem

From: "Alexander Egorushkin" [egorushkin@m...]
Date: Mon May 21, 2001 5:01 pm
Subject: RE: [VirtualTreeview] Re: pb to install VTV on BCB5/Another BCB problem

Hi, Mike!
Thank you for your great work! While I was on my holiday, VTV improved
much.

> I would like to fix this problem once and for all so I changed the
> OnDragDrop event to take a TFormatArray type instead of "array of
> Word" (TFormatArray is indeed defined as "array of Word"). It works
> well under Delphi and requires only a minimal change in existing drop
> handlers (only the parameter list changes slightly). Could you please
> verify that there is no problem any longer in this regard?
I'll test it as soon as I install BCB on my machine.

Alex.


re: Problems with new nodes

From: "Alexander Egorushkin" [egorushkin@m...]
Date: Mon May 21, 2001 5:01 pm
Subject: RE: [VirtualTreeview] Problems with new nodes

Hello, Steffen!

> I had a problem on create new root-nodes. The
> demonstration works correctly. Then i have this code
> used to work with an oracle-db. On initnode i set the
> data from an query, the text i have set with gettext.
> The problem is: when the new node the visible area
> leaves (it was create not into the visible area, its
> scrolling down), all this nodes became the data and
> text from the last! dataset. I dont know why.
>
> Can you help me???

Could you describe your problem more thoroughly or send a demo. Do you fill
the tree directly from the DB or do you use a tree buffer (NodeData)? What
code is in GetNodeText? As an example how to work with databases you may use
DBVT or IBO_VTree packages from download area. But unfortunately the first
is in C++. On the next week I'm planning to download the first version of
Delphi version of DBVT.
When I worked on BCB version of DBVT I've encountered the following
problem.

AnsiString tmp;
TDBVTData* Data; //this structure contains Text member of type WideString
...
while ...

tmp = ViewField->AsString;
Data->Text = tmp; //!!!
...

After the marked line somtimes rose an error in OLE32.DLL or all the nodes
suddenly became equal! I don't know why that happened but I had to rewrite
the heart of my component twice. May be you encountered the same problem.

Alex.

 | Replies | Author | Date
1966 | Re: Problems with new nodes | Steffen Schemel | Wed 5/23/2001
1971 | Re: Problems with new nodes | Alexander Egorushkin | Wed 5/23/2001
1984 | Re: Problems with new nodes | Steffen Schemel | Thu 5/24/2001
2065 | Re: Problems with new nodes | Steffen Schemel | Wed 5/30/2001
2068 | Re: Problems with new nodes | Alexander Egorushkin | Wed 5/30/2001
2070 | Re: Problems with new nodes | Roland | Wed 5/30/2001


TCollection vs. List

From: "Alexander Egorushkin" [egorushkin@m...]
Date: Mon May 21, 2001 5:01 pm
Subject: TCollection vs. List

Hi Mike and everybody!
I need your advice. I'm working on Data Aware VT and have to emulate table
relations. Two approaches are possible:
TCollection member in the component - all levels are descendants of
TCollectionEditor
List - every level is a component that you must drop on the form and link
them manually to themselves and to the tree.

Pro and Contra TCollection
- TCollection is better for the situations with lots of levels. But I'm not
sure if one would like to use more than 4 levels.
+ TCollection is easier (for me and for you).
- It isn't so easy to inherit from the descendant of TCollectionItem (see
VTV column).
- List fits to V paradigm better (data out from the tree)

Thank you. Alex.

 | Replies | Author | Date
1915 | Re: TCollection vs. List | [adembaba@e...] | Mon 5/21/2001
1930 | Re: TCollection vs. List | Alexander Egorushkin | Tue 5/22/2001


re: Whistler

From: "Paul Istrate" [istech@c...]
Date: Mon May 21, 2001 6:11 pm
Subject: Re: [VirtualTreeview] Whistler

Hi Mike,

I do not use flat sroll bars and, of course, I don't mind if you remove it.

Btw: Do you remember my suggestion regarding buttons bellow vertical
scrollbar?

FOR ALL,
(bellow are a part of a message which I sent to Mike some months ago.
If anybody will consider that my proposal will improve Virtual Controls,
please send your opinion. Of course, because I feel that will be a
time-consuming implementation, Mike will have last word... Unfortunately, I
can't help)

"How about adding, at design time - through a property like Header, below
vertical scrollbar, a series of buttons at user request. These buttons with
height and width exactly the same as scrollbar buttons. In a manner similar
to Microsoft's Word buttons below vertical scroll bar.

This conduct to a shorten vertical scrollbar and, I think, a greater
flexibility in working with tree.

These buttons can be created as a collection like columns. All with hints,
image glyphs (loaded from an ImageList, another than Images or StateImages),
with events (like OnHeaderClick) and styles like scroll bars (regular...).

In my case, I would like to have 3 such buttons. The middle to put on the
screen a form where the user can select scroll type and other things, and
first and third to quickly find an user request.

Of course, this kind of button can be used for anything user wants and the
event which say that was pressed can serve as a placeholder for a lot of
usefull actions regarding tree exploatation.

The main advantage is that such buttons stays with tree. Are part of
control.

Unfortunately I don't know how to manipulate scrollbars of a control to be
shorten... but I think that such buttons will be useful for all users of
your VirtualTrees."

Regards,
Paul Istrate

 | Replies | Author | Date
1924 | Re: Whistler | Wez Furlong | Mon 5/21/2001
2005 | Re: Whistler | Mike Lischke | Sun 5/27/2001


re: TCollection vs. List

From: [adembaba@e...]
Date: Mon May 21, 2001 6:33 pm
Subject: Re: TCollection vs. List

> I'm working on Data Aware VT and have to emulate table
> relations. Two approaches are possible:

Alex,

To me, TCollection + TCollectionItem seem to be the natural
choice.

There is, however, possibly another approach which
might be more suitable; it is something I use a lot:
it is TPolymorphicTree, something I have sort of refined
over time. I could post it to the file area or post its
source in another eMail. You might like to take a look at
it before making a decision.

Cheers,
Adem

 | Replies | Author | Date
1930 | Re: TCollection vs. List | Alexander Egorushkin | Tue 5/22/2001


re: Whistler

From: [adembaba@e...]
Date: Mon May 21, 2001 6:37 pm
Subject: Re: Whistler

> > Does anybody mind removing flat scroll bars from VT?
>
> I have never liked the look of flat scrollbars so no bother to me.

I second that.

Cheers,
Adem


New file uploaded to VirtualTreeview

From: [VirtualTreeview@yahoogroups.com>
Date: Mon May 21, 2001 6:59 pm
Subject: New file uploaded to VirtualTreeview

Hello,

This email message is a notification to let you know that
a file has been uploaded to the Files area of the VirtualTreeview
group.

File : /Virtual Tree Help.zip
Uploaded by : [public@l...]
Description : Latest help file for VT

You can access this file at the URL

http://groups.yahoo.com/group/VirtualTreeview/files/Virtual%20Tree%20Help.zip

To learn more about file sharing for your group, please visit

http://help.yahoo.com/help/us/groups/files

Regards,

public@l...]

 | Replies | Author | Date
1919 | Re: New file uploaded to VirtualTreeview | Mike Lischke | Mon 5/21/2001


re: Incremental Searching

From: "Mike Lischke" [public@l...]
Date: Mon May 21, 2001 7:03 pm
Subject: RE: [VirtualTreeview] Incremental Searching

Hi Werner,

> Yes, that works now. There is still one difference to the explorer with
respect
> to this part of the feature: lets assume that you searched successfully for a
> node beginning with 'a', and it is focused now. You press 'a' again in short
> time (you can even hold the a-key down). Explorer will try to find a file
beginning
> with 'aa'. If not found it will reject the second 'a' and search for the next
> file beginning with 'a'.

Unfortunatley, some weird things happen also there. Create 5 files like this:

x.txt
xx.txt
xxx.txt
xxxbx.txt
xxxx.txt

Now try to find the file with four consecutive 'x' letters. You will see that
you cannot (except if
the focus is accidently on the x.txt file when pressing 'x' four times). They
made some very ugly
hacks to do the advancing, I'm quite sure.

Ciao, Mike


re: New file uploaded to VirtualTreeview

From: "Mike Lischke" [public@l...]
Date: Mon May 21, 2001 7:04 pm
Subject: RE: [VirtualTreeview] New file uploaded to VirtualTreeview

I also created a new folder called "Screen shots" and moved the two little
images from Moritz there.

Ciao, Mike


re: VET and BCB

From: [tias@m...]
Date: Mon May 21, 2001 7:14 pm
Subject: Re: VET and BCB

--- In [VirtualTreeview@y...], "Alexander Egorushkin" [egorushkin@m...]
wrote:

<snip>

> BCB is not so ugly as you think about it :) Could you try this:
>
> {HPPEMIT 'typedef DelphiInterface<IDropTarget>
_di_IDropTarget;'}
> {HPPEMIT 'typedef DelphiInterface<IQueryInfo>
_di_IQueryInfo;'}
> {HPPEMIT 'typedef DelphiInterface<IContextMenu3>
_di_IContextMenu3;'}
>
> I'm not sure about _di_IDropTarget, may be it is declared in
<objidl.h> (if
> it is used in VTV - that's true). Ronald and Mathias could you try
it (I
> have upgraded to Win2k and haven't installed BCB yet).

Works perfectly !
Thanks !

To Jim :
Now the ugly stuff consists only of these lines (except for the
{$EXTERNALSYM xxx}: stuff that still has to be where it is :

(*$HPPEMIT 'namespace Shellutilities { class TNamespace; }'*)
{HPPEMIT 'typedef DelphiInterface<IDropTarget> _di_IDropTarget;'}
{HPPEMIT 'typedef DelphiInterface<IQueryInfo> _di_IQueryInfo;'}
{HPPEMIT 'typedef DelphiInterface<IContextMenu3> _di_IContextMenu3;'}

/Mathias T

 | Replies | Author | Date
1927 | Re: VET and BCB | Jim Kueneman | Tue 5/22/2001


re: Problem while scrolling through a VTV contr ol

From: [ceiabxl@y...]
Date: Mon May 21, 2001 8:40 pm
Subject: Re: Problem while scrolling through a VTV contr ol

Hello Mike,

Thank you for your help. It works now.

But just 1 question. Was I conceptually wrong when I wrote my
procedure ?

Bis spaeter,

Alain

--- In [VirtualTreeview@y...], "Mike Lischke" [public@l...] wrote:
> Hi Alain,
>
> > I downloaded version 2.4.11 from the files section. The problem
> > remains the same.
>
> Yes indeed the problem persists because in is not (directly) caused
by the tree. There are several
> things I would implement differently but for now I recommend simply
to count the number of entries
> (as you do with your gloabl index variable) and use this to set the
root node count in the load
> code. This will make your initialization of the Data.Index member
via the mentioned global variable
> no longer work. But you don't need this member. Every node comes
already with an index relative to
> its parent node. Use this like:
>
> procedure TLogoAppForm.VSTGetText(Sender: TBaseVirtualTree;
> Node: PVirtualNode; Column: Integer; TextType: TVSTTextType;
> var Text: WideString);
> begin
> Data := Sender.GetNodeData(Node);
> // if Assigned(Data) then
> // Text := MyRec[1,Data.Index]+' '+MyRec[2,Data.Index];
> Text := MyRec[1, Node.Index + 1]+' '+MyRec[2, Node.Index];
> end;
>
> Ciao, Mike


re: Whistler

From: Werner Lehmann [wl@b...]
Date: Mon May 21, 2001 9:40 pm
Subject: Re: [VirtualTreeview] Whistler

Mike Lischke wrote:
>
> implementation entirely. First however, I would like to have some feedback
> from you about this. Does anybody actually use flat scroll bars? Does
> anybody mind removing flat scroll bars from VT?

I am using sbm3D style scrollbars everywhere. I try to keep the overall
appearance
of my application flat (toolbars and more). sbmRegular does not fit very well
here.
I am not sure which style you refer to as 'flat'.

The VCL calls the styles "normal, flat, hottrack" and you call them "regular,
3D,
flat" (in this order, corresponding). So if you mean your notion of 'flat' it is
ok by me. If you mean the VCL's 'flat' I'd like to keep it!

Regards,
Werner


re: Incremental Searching

From: Werner Lehmann [wl@b...]
Date: Mon May 21, 2001 9:44 pm
Subject: Re: [VirtualTreeview] Incremental Searching

Hi Mike,

Mike Lischke wrote:
>
> Unfortunatley, some weird things happen also there. Create 5 files like this:
>
> x.txt
> xx.txt
> xxx.txt
> xxxbx.txt
> xxxx.txt
>
> Now try to find the file with four consecutive 'x' letters. You will see that
you cannot (except if
> the focus is accidently on the x.txt file when pressing 'x' four times). They
made some very ugly
> hacks to do the advancing, I'm quite sure.

I don't understand you right probably. Because I created the 5 files and
behaviour is as follows: with each press of 'x' focus moves to the next
file. Regardless how fast or slow if 'x' is pressed multiple times. If
I hold 'x' down focus advances very fast through all x-files :) and then
wraps around.

Regards,
Werner


re: Whistler

From: "Wez Furlong" [wez.egroups@t...]
Date: Mon May 21, 2001 8:42 pm
Subject: Re: [VirtualTreeview] Whistler

What a cool idea!
Although it might make sense to implement it as a generic scrollbar control
with buttons?

--Wez.

On 2001-05-21 19:11:23, "Paul Istrate" wrote:
>
> "How about adding, at design time - through a property like Header,
> below
> vertical scrollbar, a series of buttons at user request. These buttons
> with
> height and width exactly the same as scrollbar buttons. In a manner
> similar
> to Microsoft's Word buttons below vertical scroll bar.
>

[Non-text portions of this message have been removed]


re: Re: New file uploaded to VirtualTreeview

From: Jim Kueneman [jimdk@m...]
Date: Tue May 22, 2001 1:04 am
Subject: RE: [VirtualTreeview] Re: New file uploaded to VirtualTreeview

At 02:50 PM 5/21/2001 +0200, you wrote:
>Hi Marco,
>
> > I found a bug in the new version 2.4.16..
> >
> > the declaration differs from the prevous declaration ..
> > function DoKeyAction(var CharCode: Word; var Shift: TShiftState):
> > Boolean; virtual;
> > the VAR statement was missing.
>
>Correct, thank you. VET needs an update too when VT changes. But I don't
>want to make changes in parallel to Jim so please fix it on your own until
>the package is updated.

I am confused. The version of VT I was using and 2.4.16 I just down loaded
both have the "var".

Jim

 | Replies | Author | Date
1926 | Re: New file uploaded to VirtualTreeview, Oops | Jim Kueneman | Tue 5/22/2001


re: Re: New file uploaded to VirtualTreeview, Oops

From: Jim Kueneman [jimdk@m...]
Date: Tue May 22, 2001 1:08 am
Subject: RE: [VirtualTreeview] Re: New file uploaded to VirtualTreeview, Oops

At 06:04 PM 5/21/2001 -0700, you wrote:
>At 02:50 PM 5/21/2001 +0200, you wrote:
> >Hi Marco,
> >
> > > I found a bug in the new version 2.4.16..
> > >
> > > the declaration differs from the prevous declaration ..
> > > function DoKeyAction(var CharCode: Word; var Shift: TShiftState):
>
>
>I am confused. The version of VT I was using and 2.4.16 I just down loaded
>both have the "var".

Never mind wrong var.
Done

Jim


re: Re: VET and BCB

From: Jim Kueneman [jimdk@m...]
Date: Tue May 22, 2001 1:09 am
Subject: Re: [VirtualTreeview] Re: VET and BCB

At 07:14 PM 5/21/2001 +0000, you wrote:
>--- In [VirtualTreeview@y...], "Alexander Egorushkin" [egorushkin@m...]
>
>(*$HPPEMIT 'namespace Shellutilities { class TNamespace; }'*)
>{HPPEMIT 'typedef DelphiInterface<IDropTarget> _di_IDropTarget;'}
>{HPPEMIT 'typedef DelphiInterface<IQueryInfo> _di_IQueryInfo;'}
>{HPPEMIT 'typedef DelphiInterface<IContextMenu3> _di_IContextMenu3;'}

Done

Jim


DragManager

From: Jim Kueneman [jimdk@m...]
Date: Tue May 22, 2001 3:54 am
Subject: DragManager

Mike,

I have been having some problems with the last 2 releases of VT (at
least) If I check Optomization in the compiler options the DragManager has
problems. I am creating my own decendant of the TVTDragDropManager class
as I have been from the begining of VET. In VT CreateWnd you register the
window . You then pass DragManager property which creates
a TVTDragDropManager if necessary. On the return of this call the
FRefCount = 1, makes sense, and the ShellFormats and DataOb ject point to
something. I then do a drag and drop and put a break in the
DoBeforeDrag. FDragDrop now points to garbage. The FRefCount is sometimes
2,000,000,0000 or some equally bizzare number. The the ShellFormats and
DataObject pointers are sometimes nil and sometimes some illogical value.

If I turn off Optomization when this break occurs the RefCount = 1 and the
pointers are the same as when the object was created in the CreateWnd call
to register the window for OLE Drag Drop.

Have you done anything that could cause this odd problem? The object is
NOT being destroyed. I put breaks on _Release and Destroy and it is only
destroyed after the Window is destroyed and RevokeDragDrop is called.

Jim

 | Replies | Author | Date
1929 | Re: DragManager, It's my bug not yours | Jim Kueneman | Tue 5/22/2001


re: DragManager, It's my bug not yours

From: Jim Kueneman [jimdk@m...]
Date: Tue May 22, 2001 5:35 am
Subject: Re: [VirtualTreeview] DragManager, It's my bug not yours

At 08:54 PM 5/21/2001 -0700, you wrote:
>Have you done anything that could cause this odd problem? The object is
>NOT being destroyed. I put breaks on _Release and Destroy and it is only
>destroyed after the Window is destroyed and RevokeDragDrop is called.

Sorry Mike I found the bug. It is weird it only crashed with optomization
on. I forget a "var" in the IDropTargetHelper TPoint parameter to make it
a pointer. It seems like it would have problems even without optomization.

Jim


re: Re: TCollection vs. List

From: "Alexander Egorushkin" [egorushkin@m...]
Date: Tue May 22, 2001 5:36 am
Subject: RE: [VirtualTreeview] Re: TCollection vs. List

Hi, Adem!

> > I'm working on Data Aware VT and have to emulate table
> > relations. Two approaches are possible:
>
> Alex,
>
> To me, TCollection + TCollectionItem seem to be the natural
> choice.
>
> There is, however, possibly another approach which
> might be more suitable; it is something I use a lot:
> it is TPolymorphicTree, something I have sort of refined
> over time. I could post it to the file area or post its
> source in another eMail. You might like to take a look at
> it before making a decision.

Yes, please, could you send it to me (mailto:[egorushkin@m...]).
Thank you!

Alex.


Splitting source sizes

From: [Thorsten.Claus@c...]
Date: Mon May 21, 2001 10:03 pm
Subject: Splitting source sizes

Hi,
I have a VT on my form and with all its eventhandlers the source gets quite
large. And now I have a procedure to be performed on that tree which is *very*
large (with all its helpers). How can I split up the source into smaller pieces
*not* using includes (because I don't have Delphis codehelp anymore :))?

Sincerley,
Thorsten Claus

 | Replies | Author | Date
1935 | Re: Splitting source sizes | Werner Lehmann | Tue 5/22/2001


.Clear()

From: [Thorsten.Claus@c...]
Date: Mon May 21, 2001 10:04 pm
Subject: .Clear()

Hi,
does .Clear() on a tree frees the NodeData?

Thorsten Claus

 | Replies | Author | Date
1936 | Re: .Clear() | Werner Lehmann | Tue 5/22/2001
1947 | Re: .Clear() | Mike Lischke | Tue 5/22/2001


New file uploaded to VirtualTreeview

From: [VirtualTreeview@yahoogroups.com>
Date: Tue May 22, 2001 6:11 am
Subject: New file uploaded to VirtualTreeview

Hello,

This email message is a notification to let you know that
a file has been uploaded to the Files area of the VirtualTreeview
group.

File : /VET_V1.1.16.zip
Uploaded by : [jimdk@m...]
Description : VET Beta version

You can access this file at the URL

http://groups.yahoo.com/group/VirtualTreeview/files/VET_V1.1.16.zip

To learn more about file sharing for your group, please visit

http://help.yahoo.com/help/us/groups/files

Regards,

jimdk@m...]


re: DragManager, It's my bug not yours

From: Werner Lehmann [wl@b...]
Date: Tue May 22, 2001 7:51 am
Subject: Re: [VirtualTreeview] DragManager, It's my bug not yours

Jim Kueneman wrote:
>
> Sorry Mike I found the bug. It is weird it only crashed with optomization
> on. I forget a "var" in the IDropTargetHelper TPoint parameter to make it
> a pointer. It seems like it would have problems even without optomization.

I recently had a very similar problem: crash with optimization, no crash
without. This was not related to VTree but a different component that I
wrote. It turned out that I modified the parameter list of one event (I
removed the last parameter) but I did not recompile the design time package.
Therefore the event handler on my testform was still compatible in the old
way (without removed parameter), at least for the compiler. When this handler
method was exited its return address pointed to garbage.

If I am not mistaken the first three params of a procedure are directly found
in cpu registers. In methods the first param is self so we have only two other
params left for registers. My method had three params. So the last param had
to be pushed on the stack. The method (event handler) popped that param (which
really was the return address) and on exit popped the stack again to find
the return address (which really was whatever).

It is still a riddle why only optimization breaks this :)

Werner


re: Splitting source sizes

From: Werner Lehmann [wl@b...]
Date: Tue May 22, 2001 7:56 am
Subject: Re: [VirtualTreeview] Splitting source sizes

"Thorsten.Claus" wrote:
>
> I have a VT on my form and with all its eventhandlers the source gets quite
large. And now I have a procedure to be performed on that tree which is *very*
large (with all its helpers). How can I split up the source into smaller pieces
*not* using includes (because I don't have Delphis codehelp anymore :))?

I know what you mean. I have three VTree's on my main form. And the event
handlers alone take up quite some room. Right from the beginning I am
passing a reference to each VTree to the constructors of those classes that
handle the data which is to be displayed by them. These classes hook up the
events. So I don't have that on my main form anymore. Alas, this units is
over 3000 LOC already, but that's not the fault of VTree but a circular
reference... :)

Ok, you can do the same or similar. You can always implement event handlers in
different units, 'uses' them, and manually point the events to these handlers.
How to do this clever depends on your project, mainly how the data with which
the event handlers work, is accessed.

Werner


re: .Clear()

From: Werner Lehmann [wl@b...]
Date: Tue May 22, 2001 7:59 am
Subject: Re: [VirtualTreeview] .Clear()

"Thorsten.Claus" wrote:
>
> Hi,
> does .Clear() on a tree frees the NodeData?

AFAIK OnFreeNode is called if the node is initialized. It is initialized
if you used OnInitNode or if you manually set the initialize flag in the
appropriate node record field.

I am holding a reference to all node datas in my own list. This way I
can easily free and access all data items without having to traverse the
tree or rely on OnFreeNode.

Werner


re: Buttons bellow VScrollBar

From: "Paul Istrate" [istech@c...]
Date: Tue May 22, 2001 8:55 am
Subject: Re: [VirtualTreeview] Buttons bellow VScrollBar

>Although it might make sense to implement it as a generic scrollbar control
with buttons?

>--Wez.

Hi Wez,

I think an TCustomControl descendant with scrollbar(s) with this additions
will be more appropriate, because not only TVirtualBaseTree can be derived
from such a control...

But... let's wait Mike's opinion.

Regards
Paul Istrate

 | Replies | Author | Date
1948 | Re: Buttons bellow VScrollBar | Mike Lischke | Tue 5/22/2001


re: VET and BCB

From: "Roland" [Beduerftig@S...]
Date: Tue May 22, 2001 9:33 am
Subject: Re: VET and BCB

<snip>
> BCB is not so ugly as you think about it :) Could you try this:
>
> {HPPEMIT 'typedef DelphiInterface<IDropTarget>
_di_IDropTarget;'}
> {HPPEMIT 'typedef DelphiInterface<IQueryInfo>
_di_IQueryInfo;'}
> {HPPEMIT 'typedef DelphiInterface<IContextMenu3>
_di_IContextMenu3;'}
>
> I'm not sure about _di_IDropTarget, may be it is declared in
<objidl.h> (if
> it is used in VTV - that's true). Ronald and Mathias could you try
it (I
> have upgraded to Win2k and haven't installed BCB yet).

Hi Alexander,

I hope you had a good holiday. We discuss this problems last week,
you can read also messages 1834, 1835, 1840.

VET works Ok with BCB5, after the modification with the namespace and
after adding the conditional define in the basic options of the
project (this was a tip from Mathias).

have a nice day
Roland


re: Re: need help with DoInitNode and DoInitChi ldre n

From: Mike Lischke [public@l...]
Date: Tue May 22, 2001 10:45 am
Subject: RE: [VirtualTreeview] Re: need help with DoInitNode and DoInitChi ldre n

Hi John,

> When you have clarified things, would it be possible for you to post
> your final thoughts here ?

I'm not sure if we find a final solution. It is mainly Moritz' task to find
something which fits. If there comes out something of general interest then
I will let you (all) know, of course.

Ciao, Mike

 | Replies | Author | Date
1953 | Re: need help with DoInitNode and DoInitChi ldre | Moritz Franckenstein | Tue 5/22/2001
2009 | Re: need help with DoInitNode and DoInitChi ldre | Mike Lischke | Sun 5/27/2001
2039 | Re: need help with DoInitNode and DoInitChi ldre | Moritz Franckenstein | Mon 5/28/2001
2040 | Re: need help with DoInitNode and DoInitChi ldre | Mike Lischke | Mon 5/28/2001
2029 | Re: need help with DoInitNode and DoInitChi ldre | Werner Lehmann | Sun 5/27/2001


re: DragManager

From: GIANNAKOPOULOS KOSTAS [kyan@s...]
Date: Tue May 22, 2001 11:03 am
Subject: RE: [VirtualTreeview] DragManager

Good afternoon Jim and Mike.

I want to make some comments on the TVTDragDropManager thing that *might* be
related to this:

I am not feeling very comfortable with the idea of having a
TInterfacedObject descendant constructor's result stored into an object
pointer. If you do this you have a pointer to an interfaced object with a
refcount of 0, which can self destruct at any time. This is OK if you use it
by calling a property getter that creates it if it has been destroyed, but
if there is an _AddRef/_Release pair inside code you don't control (like
inside DoDragDrop) it would be possible for the object to go away right
under your feet.

Maybe the different behaviour with optimization on is due to different
handling of interface pointers by the compiler, maybe it generates calls to
_AddRef/_Release in a different way.

Suggestion: Do an explicit _AddRef right after the construction and an
explicit _Release when you are done with it, in the destructor of the VT.
This way you will have better lifetime management of the object.

> -----Original Message-----
> From: Jim Kueneman [mailto:[jimdk@m...]]
> Sent: Tuesday, May 22, 2001 6:55 AM
> To: VirtualTreeview@yahoogroups.com
> Subject: [VirtualTreeview] DragManager
>
>
> Mike,
>
> I have been having some problems with the last 2 releases
> of VT (at
> least) If I check Optomization in the compiler options the
> DragManager has
> problems. I am creating my own decendant of the
> TVTDragDropManager class
> as I have been from the begining of VET. In VT CreateWnd you
> register the
> window .....

 | Replies | Author | Date
1949 | Re: DragManager | Jim Kueneman | Tue 5/22/2001
1952 | Re: DragManager | GIANNAKOPOULOS KOSTAS | Tue 5/22/2001
2013 | Re: DragManager | Mike Lischke | Sun 5/27/2001
2014 | Re: DragManager | Mike Lischke | Sun 5/27/2001
2041 | Re: DragManager | GIANNAKOPOULOS KOSTAS | Mon 5/28/2001
2050 | Re: DragManager | Mike Lischke | Mon 5/28/2001
2056 | Re: DragManager | GIANNAKOPOULOS KOSTAS | Tue 5/29/2001
2110 | Re: DragManager | Mike Lischke | Sat 6/2/2001
2135 | Re: DragManager | Jim Kueneman | Sat 6/2/2001


re: TCollection vs. List

From: GIANNAKOPOULOS KOSTAS [kyan@s...]
Date: Tue May 22, 2001 11:05 am
Subject: RE: [VirtualTreeview] TCollection vs. List

You can use TCollection/TCollectionItem so that the delphi property editors
work, bringing up a "Collection Editor" and write a TComponent Editor for
your data-aware tree that will display a form more appropriate of editing a
tree structure, something like TTreeView's Item Editor.

<KY>

> -----Original Message-----
> From: Alexander Egorushkin [mailto:[egorushkin@m...]]
> Sent: Monday, May 21, 2001 8:02 PM
> To: VirtualTreeview@yahoogroups.com
> Subject: [VirtualTreeview] TCollection vs. List
>
>
> Hi Mike and everybody!
> I need your advice. I'm working on Data Aware VT and have to
> emulate table
> relations. Two approaches are possible:
> TCollection member in the component - all levels are descendants of
> TCollectionEditor
> List - every level is a component that you must drop on the
> form and link
> them manually to themselves and to the tree.


re: Image of focused node

From: Mike Lischke [public@l...]
Date: Tue May 22, 2001 11:30 am
Subject: RE: [VirtualTreeview] Image of focused node

Hi S.,

> I´m using the latest VT-Version and almost everything is right.

Great to read :o)

> But if I select a node, the node´s background turns blue (thats nice)
> and the nodes image looks like "grayed out" (exactly it´s "blueed
> out"). I´m using VirtualStringTree.
>
> How can I manage that the focused node stays in its normal color?
>
> Is there a property I don´t know so far, or what is the problem?

Well, blending the images of selected items is what the standard treeview
does so I implemented it too. There is no property to disabled this behavior
but you can change PaintImage:

These lines:

// Blend image if it is ghosted...
if Ghosted or
// ... or it is not the check image and the node is selected (but
selection is not for the entire row)...
((vsSelected in Node.States) and (ImageInfoIndex <> iiCheck) and
([voFullRowSelect, voGridExtensions] * FOptions = [])) or
// ... or if cut is pending and the node is in the cut set.
((vsCutOrCopy in Node.States) and (tsCutPending in FStates)) then
ExtraStyle := ExtraStyle or ILD_BLEND50;

to these:

// Blend image if it is ghosted...
if Ghosted or
// ... or if cut is pending and the node is in the cut set.
((vsCutOrCopy in Node.States) and (tsCutPending in FStates)) then
ExtraStyle := ExtraStyle or ILD_BLEND50;

Ciao, Mike


re: Re: Problem while scrolling through a VTV c ontr ol

From: Mike Lischke [public@l...]
Date: Tue May 22, 2001 11:46 am
Subject: RE: [VirtualTreeview] Re: Problem while scrolling through a VTV c ontr ol

Alain,

> But just 1 question. Was I conceptually wrong when I wrote my
> procedure ?

ok, telegram style:

- you have collected your data and incremented the root node count in each
iteration instead to use the collected data and set the root node count only
once
- you do not use BeginUpdate/EndUpdate
- you use global variables which might not be in the state you expect it
- you store information (the index) which is already available (Node.Index)
- you load the data completely instead only if needed

I can't remember more points and have already deleted your test project.

Ciao, Mike

 | Replies | Author | Date
1954 | Re: Problem while scrolling through a VTV c ontr | [ceiabxl@y...] | Tue 5/22/2001


VET Download

From: GIANNAKOPOULOS KOSTAS [kyan@s...]
Date: Tue May 22, 2001 11:54 am
Subject: VET Download

Good afternoon, Jim.

Would it be possible to exclude file VirtualExplorerTreeProject.exe from
your download VET_XXX.zip? The size of the file would be decreased
significantly, making its download faster.
After all if someone wants to see the demo they can compile it.

Thank you.

<KY>

 | Replies | Author | Date
1950 | Re: VET Download | Jim Kueneman | Tue 5/22/2001
1951 | Re: VET Download | Roland | Tue 5/22/2001


re: Whistler

From: Mike Lischke [public@l...]
Date: Tue May 22, 2001 11:55 am
Subject: RE: [VirtualTreeview] Whistler

Hi Werner,

> I am using sbm3D style scrollbars everywhere. I try to keep
> the overall appearance of my application flat (toolbars and more).
sbmRegular does
> not fit very well here. I am not sure which style you refer to as 'flat'.
>
> The VCL calls the styles "normal, flat, hottrack" and you
> call them "regular, 3D, flat" (in this order, corresponding). So if you
mean your
> notion of 'flat' it is ok by me. If you mean the VCL's 'flat' I'd like to
keep it!

Mmh, that makes things problematic. The current poll clearly shows what
people like (19:2 for removing flat scroll bars). Actually 3D and flat style
as used by VT are different sides of the same medal. If I want to remove one
completely then I have to remove all. I already have code to use the
original APIs instead of the redirection in FlatSB if normal scroll bars are
used. But this seems not enough.

With Whistler flat styles will be the new UI paradigm, no doubt. And VT fits
very well into this scheme (header, alpha blended images etc.) only the
scroll bars are totally different, even if the original APIs were used. And
think about it, how many commercial or at least wide spread application have
you seen where controls have flat scroll bars? The only one *I* know of is
MS Encarta for which those scroll bars have been invented originally.

Ciao, Mike

 | Replies | Author | Date
1957 | Re: Whistler | Alexander Egorushkin | Tue 5/22/2001


re: Incremental Searching

From: Mike Lischke [public@l...]
Date: Tue May 22, 2001 11:58 am
Subject: RE: [VirtualTreeview] Incremental Searching

> I don't understand you right probably. Because I created the
> 5 files and behaviour is as follows: with each press of 'x' focus moves
> to the next file. Regardless how fast or slow if 'x' is pressed multiple
times. If
> I hold 'x' down focus advances very fast through all x-files
> :) and then wraps around.

Yes, but wouldn't you expect the selection on the file named xxxx.txt if you
press 'x' four times? I do and it does not happen. The selection is
somewhere else, depending on the starting point. If you press 'abcd' in a
folder containing files like:

ab.txt
abc.txt
abcd.txt
abcde.txt

then of course abcd.txt will be selected (or abcde.txt if the selection is
already on abcd.txt).

Ciao, Mike


re: .Clear()

From: Mike Lischke [public@l...]
Date: Tue May 22, 2001 12:01 pm
Subject: RE: [VirtualTreeview] .Clear()

> does .Clear() on a tree frees the NodeData?

Yes,

Ciao, Mike


re: Buttons bellow VScrollBar

From: Mike Lischke [public@l...]
Date: Tue May 22, 2001 12:20 pm
Subject: RE: [VirtualTreeview] Buttons bellow VScrollBar

> I think an TCustomControl descendant with scrollbar(s) with
> this additions will be more appropriate, because not only TVirtualBaseTree

> can be derived from such a control...

Yes indeed would this be the most generic solution, but I have no idea how
to tell the default NC handler to leave some parts of the non-client area
for my own use. I mean WM_NCCALCSIZE is ok, but you can only define
rectangular areas and you cannot tell a scroll bar to use only part of it.

Ciao, Mike


re: DragManager

From: Jim Kueneman [jimdk@m...]
Date: Tue May 22, 2001 12:37 pm
Subject: RE: [VirtualTreeview] DragManager

At 02:03 PM 5/22/2001 +0300, you wrote:
>Good afternoon Jim and Mike.
>
>I am not feeling very comfortable with the idea of having a
>TInterfacedObject descendant constructor's result stored into an object
>pointer. If you do this you have a pointer to an interfaced object with a
>refcount of 0, which can self destruct at any time. This is OK if you use it
>by calling a property getter that creates it if it has been destroyed, but
>if there is an _AddRef/_Release pair inside code you don't control (like
>inside DoDragDrop) it would be possible for the object to go away right
>under your feet.

KY,

I partally agree, but the way Mike implemented this is very safe it
think. He call RegisterDragDrop by passing the object as an IDropTarget
which calls the property getter that creates the object within the call to
RegisterDragDrop. By passing it as an interface Delphi increases the
reference count, and on returning from the function Delphi decreases the
reference count. That would take it count to zero, but Windows has saved
a copy of the reference hence incrementing the reference count that should
not be released until RevokeDragDrop is called.

Also Mike uses the VT reference in the object to set its pointer to the
TInterfacedObject decendant to nil if the object is being destroyed.

destructor TBaseDragDropManager.Destroy;
begin
// Set the owners reference to us to nil otherwise it will access an
invalid pointer
// after our desctruction is complete.
FOwner.FDragManager := nil;
FFormatEtcList.Free;
inherited;
end;

Jim


re: VET Download

From: Jim Kueneman [jimdk@m...]
Date: Tue May 22, 2001 12:40 pm
Subject: Re: [VirtualTreeview] VET Download

At 02:54 PM 5/22/2001 +0300, you wrote:
>Good afternoon, Jim.
>
>Would it be possible to exclude file VirtualExplorerTreeProject.exe from
>your download VET_XXX.zip? The size of the file would be decreased
>significantly, making its download faster.
>After all if someone wants to see the demo they can compile it.

I was struggling over if I should do that, and for historical reasons I
decided to wait till someone complained. My only thought was you could
look at the demo without having to have install the components first. I
know I prefer that in things I try out.

I will make two downloads available, one source only the other with the exe.

Jim

 | Replies | Author | Date
1951 | Re: VET Download | Roland | Tue 5/22/2001


re: VET Download

From: "Roland" [Beduerftig@S...]
Date: Tue May 22, 2001 12:52 pm
Subject: Re: VET Download

Hi Jim,

<snip>

> My only thought was you could look at the demo without having
> to have install the components first. I know I prefer that in
> things I try out.
>
> I will make two downloads available, one source only the other
> with the exe.

This is a good idea, I also prefer in the first step to look at the
demo program to see whether the component is right for my problem,
without installing components into the IDE.

have a nice day
Roland


re: DragManager

From: GIANNAKOPOULOS KOSTAS [kyan@s...]
Date: Tue May 22, 2001 1:46 pm
Subject: RE: [VirtualTreeview] DragManager

> I partally agree, but the way Mike implemented this is
> very safe it
> think. He call RegisterDragDrop by passing the object as an
> IDropTarget
> which calls the property getter that creates the object
> within the call to
> RegisterDragDrop. By passing it as an interface Delphi increases the
> reference count, and on returning from the function Delphi
> decreases the
> reference count.

I think that the compiler doesn't _AddRef/_Release an interface parameter is
declared as "const", since the calling function is not supposed to modify
(and release) the pointer. To prove this i single-stepped in a CPU window
the method CreateWnd and FDragManager.RefCount had a value of zero until the
instruction "CALL RegisterDragDrop" and even after that.

> That would take it count to zero, but
> Windows has saved
> a copy of the reference hence incrementing the reference
> count that should
> not be released until RevokeDragDrop is called.

This is true.
But what if RegisterDragDrop did something like: AddRef/Release/Addref ?
Wouldn't this cause a problem?
OK, since it works it is obvious that it doesn't. But i think that COM
demands that you should never pass an interface pointer to an object with a
RefCount of 0, actually an object should have a zero refcount only just
prior to its destruction, without having any outstanding references.

> Also Mike uses the VT reference in the object to set its
> pointer to the
> TInterfacedObject decendant to nil if the object is being destroyed.

Also true.

Sorry, call me purist (or any other name you like), but i've worked a lot
with Delphi and COM interfaces (and shot myself in the foot many times)
that's why i'm a little bit paranoid about them. I've burnt onto the surface
of my brain the rule that i have to store the result of a
TInterfacedObject's constructor (or the result of a CoCreateInstance) to an
interface pointer, not a Delphi pointer, or else AV's will start popping up.
Mike's way, though very intricate, is not very "transparent" and can easily
mislead someone to believe that a bug is lurking somewhere in there.

<KY>


re: need help with DoInitNode and DoInitChi ldre n

From: "Moritz Franckenstein" [franckenstein@a...]
Date: Tue May 22, 2001 2:48 pm
Subject: Re: need help with DoInitNode and DoInitChi ldre n

> > When you have clarified things, would it be possible for you to
post
> > your final thoughts here ?
>
> I'm not sure if we find a final solution. It is mainly Moritz' task
to find
> something which fits. If there comes out something of general
interest then
> I will let you (all) know, of course.
>
> Ciao, Mike

to all (i have already told mike):

i can imagine a lot of situations where the normal approach would be
impossible or only not so nice (i mean that DoInitChildren only
returns the ChildCount, and DoInitNode finds its data by the child
index).

one example could be that all children of a node are a result of a
database query which is now in an ADORecordset. i dont want to make
this query first to find out if there are any results (HasChildren),
then later again to find the number of results (ChildCount) and then
again to get result number 17.
yes, of course i could read the recordset into a list that is stored
in the parentnode's data and then access this list but i think, the
node-specific data should better be directly in the correct node and
not in its parent.

suggestions are welcome!

-moritz


re: Problem while scrolling through a VTV c ontr ol

From: [ceiabxl@y...]
Date: Tue May 22, 2001 3:14 pm
Subject: Re: Problem while scrolling through a VTV c ontr ol

Mike,

Obviously, I am not yet totally confident with the VTV control...
I'll try ti improve my knowledge.

Thank you for your help.

Alain

--- In [VirtualTreeview@y...], Mike Lischke [public@l...] wrote:
> Alain,
>
> > But just 1 question. Was I conceptually wrong when I wrote my
> > procedure ?
>
> ok, telegram style:
>
> - you have collected your data and incremented the root node count
in each
> iteration instead to use the collected data and set the root node
count only
> once
> - you do not use BeginUpdate/EndUpdate
> - you use global variables which might not be in the state you
expect it
> - you store information (the index) which is already available
(Node.Index)
> - you load the data completely instead only if needed
>
> I can't remember more points and have already deleted your test
project.
>
> Ciao, Mike


re: Incremental Searching

From: Werner Lehmann [wl@b...]
Date: Tue May 22, 2001 5:44 pm
Subject: Re: [VirtualTreeview] Incremental Searching

Mike Lischke wrote:
>
> > I don't understand you right probably. Because I created the
> > 5 files and behaviour is as follows: with each press of 'x' focus moves
> > to the next file. Regardless how fast or slow if 'x' is pressed multiple
> times. If
> > I hold 'x' down focus advances very fast through all x-files
> > :) and then wraps around.
>
> Yes, but wouldn't you expect the selection on the file named xxxx.txt if you
> press 'x' four times? I do and it does not happen. The selection is
> somewhere else, depending on the starting point. If you press 'abcd' in a
> folder containing files like:
>
> ab.txt
> abc.txt
> abcd.txt
> abcde.txt
>
> then of course abcd.txt will be selected (or abcde.txt if the selection is
> already on abcd.txt).

Well. This discussion is purely academically but I don't mind. From my
impression of the explorer search style I would say the algorithm is
very simple:

Assume s = old accumulated search text, c = new key code

(1) check if any file matches s + c, beginning with the file after the focused
one. if matching file found -> focus it, go to (4)

(2) check if any file beginns with c, beginning with the file after the focused
one. if matching file found -> s := s + c, focus it, go to (4)

(3) no matching file found, beep, maybe s := ''

(4) ready

Werner

 | Replies | Author | Date
2015 | Re: Incremental Searching | Mike Lischke | Sun 5/27/2001
2037 | Re: Incremental Searching | [ebolefeysot@b...] | Mon 5/28/2001


re: Whistler

From: Werner Lehmann [wl@b...]
Date: Tue May 22, 2001 5:58 pm
Subject: Re: [VirtualTreeview] Whistler

Mike Lischke wrote:
>
> Hi Werner,

Hi,

> > I am using sbm3D style scrollbars everywhere. I try to keep
> > the overall appearance of my application flat (toolbars and more).
> sbmRegular does
> > not fit very well here. I am not sure which style you refer to as 'flat'.
> >
> > The VCL calls the styles "normal, flat, hottrack" and you
> > call them "regular, 3D, flat" (in this order, corresponding). So if you
> mean your
> > notion of 'flat' it is ok by me. If you mean the VCL's 'flat' I'd like to
> keep it!
>
> Mmh, that makes things problematic. The current poll clearly shows what
> people like (19:2 for removing flat scroll bars). Actually 3D and flat style
> as used by VT are different sides of the same medal. If I want to remove one
> completely then I have to remove all. I already have code to use the
> original APIs instead of the redirection in FlatSB if normal scroll bars are
> used. But this seems not enough.

I am not sure why you want to remove an already built-in feature which is
used at least by me and someone else. I mean... how does just keeping it
hurt? And there is one more point: it seems that only the new flat scrollbar
control allows more than 16 bit (signed) as range value. I just ran into
the 32000 pixel range limit of a TScrollingWinControl descendant :(

With respect to Whistler: I will stay for very long with Win2k. I don't like
that forced registration 'feature'. And except from Luna (which I never
experienced) I don't see any exciting features for a single user system
(which even M$ admits, speaking of a Win2k.1). And even if this all is not
important: noone forces anyone to use a scrollbar style that he/she does
not like or that does not fit visually with Whistler. BTW, how do the Luna
scrollbars look like?

Having said all that do what you must do.

> With Whistler flat styles will be the new UI paradigm, no doubt. And VT fits
> very well into this scheme (header, alpha blended images etc.) only the
> scroll bars are totally different, even if the original APIs were used. And
> think about it, how many commercial or at least wide spread application have
> you seen where controls have flat scroll bars? The only one *I* know of is
> MS Encarta for which those scroll bars have been invented originally.

Part of my UI is based on the encarta style (you may know the flatstyle
components). This must not necessarily look black-on-brownish... If you
say that "even if the original APIs were used", "scroll bars are totally
different" I don't see the gain for this action...

Regards,
Werner

 | Replies | Author | Date
1958 | Re: Whistler | Mike Lischke | Tue 5/22/2001
2012 | Re: Whistler | Mike Lischke | Sun 5/27/2001


re: Whistler

From: "Alexander Egorushkin" [egorushkin@m...]
Date: Tue May 22, 2001 6:50 pm
Subject: RE: [VirtualTreeview] Whistler

Hi, Mike!

> The only one *I* know of is
> MS Encarta for which those scroll bars have been invented originally.
>
Paradox 9 and other applications from WordPerfect Office 2000 use flat
controls (but only when they are not focused). To say the truth I don't like
that UI...

Alex.


re: Whistler

From: "Mike Lischke" [public@l...]
Date: Tue May 22, 2001 8:26 pm
Subject: RE: [VirtualTreeview] Whistler

Hi Werner,

> I am not sure why you want to remove an already built-in feature which is
> used at least by me and someone else. I mean... how does just keeping it
> hurt? And there is one more point: it seems that only the new flat scrollbar
> control allows more than 16 bit (signed) as range value. I just ran into
> the 32000 pixel range limit of a TScrollingWinControl descendant :(

Well, although the vast majority voted to take flat scroll bars out I have not
yet met the final
decision. I will do more tests to ensure that only total removal will solve the
problems.

This is not considered to be a full answer to your question, Werner, but I'm
going to leave my
computers for a couple of days and make with the family a short trip to a
lonely hostel. Well, it
will not be so lonely as this a meeting with fellows from my studies (and their
families).

Read you on Sunday. I will try to follow up then all messages and answer where
I can.

Ciao, MIke


re: Whistler

From: Kim Bracknell [kbracknell@f...]
Date: Wed May 23, 2001 12:56 am
Subject: RE: [VirtualTreeview] Whistler

I agree with Werner... a lot of our users will be on W2K for a long time
yet. I personally like the "flat" look and if it can be left intact without
any trouble, then perhaps it would be best to leave it included for now?
My 2 cents worth...
Kim.

-----Original Message-----
From: Werner Lehmann [mailto:[wl@b...]]
Sent: Wednesday, 23 May 2001 1:58 AM
To: VirtualTreeview@yahoogroups.com
Subject: Re: [VirtualTreeview] Whistler

Mike Lischke wrote:
>
> Hi Werner,

Hi,

> > I am using sbm3D style scrollbars everywhere. I try to keep
> > the overall appearance of my application flat (toolbars and more).
> sbmRegular does
> > not fit very well here. I am not sure which style you refer to as
'flat'.
> >
> > The VCL calls the styles "normal, flat, hottrack" and you
> > call them "regular, 3D, flat" (in this order, corresponding). So if you
> mean your
> > notion of 'flat' it is ok by me. If you mean the VCL's 'flat' I'd like
to
> keep it!
>
> Mmh, that makes things problematic. The current poll clearly shows what
> people like (19:2 for removing flat scroll bars). Actually 3D and flat
style
> as used by VT are different sides of the same medal. If I want to remove
one
> completely then I have to remove all. I already have code to use the
> original APIs instead of the redirection in FlatSB if normal scroll bars
are
> used. But this seems not enough.

I am not sure why you want to remove an already built-in feature which is
used at least by me and someone else. I mean... how does just keeping it
hurt? And there is one more point: it seems that only the new flat scrollbar
control allows more than 16 bit (signed) as range value. I just ran into
the 32000 pixel range limit of a TScrollingWinControl descendant :(

With respect to Whistler: I will stay for very long with Win2k. I don't like
that forced registration 'feature'. And except from Luna (which I never
experienced) I don't see any exciting features for a single user system
(which even M$ admits, speaking of a Win2k.1). And even if this all is not
important: noone forces anyone to use a scrollbar style that he/she does
not like or that does not fit visually with Whistler. BTW, how do the Luna
scrollbars look like?

Having said all that do what you must do.

> With Whistler flat styles will be the new UI paradigm, no doubt. And VT
fits
> very well into this scheme (header, alpha blended images etc.) only the
> scroll bars are totally different, even if the original APIs were used.
And
> think about it, how many commercial or at least wide spread application
have
> you seen where controls have flat scroll bars? The only one *I* know of is
> MS Encarta for which those scroll bars have been invented originally.

Part of my UI is based on the encarta style (you may know the flatstyle
components). This must not necessarily look black-on-brownish... If you
say that "even if the original APIs were used", "scroll bars are totally
different" I don't see the gain for this action...

Regards,
Werner

To unsubscribe from this group, send an email to:
VirtualTreeview-unsubscribe@egroups.com

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/


Expanding Nodes

From: [Thorsten.Claus@c...]
Date: Wed May 23, 2001 12:04 am
Subject: Expanding Nodes

Hi,
when programatically expanding nodes by calling

Include(nodes.state, vsExpanded)

I do not get any scrollbars.
when clicking on some of that nodes I get an Integer-fault....

What do I haveto set?

Thorsten

 | Replies | Author | Date
1963 | Re: Expanding Nodes | Danil Galimov | Wed 5/23/2001
2004 | Re: Expanding Nodes | Mike Lischke | Sun 5/27/2001


Drag N Drop from tree

From: [MJLeaver@n...]
Date: Wed May 23, 2001 8:27 am
Subject: Drag N Drop from tree

While attempting to get drag and drop (from explorer) to the virtual
tree working, it reminded me why I never want to return to C++.
Anyway, the code I finally came up with (that works - it seems) is
below. I'd appreciate any comments, e.g. "Idiot, its easier than
that".

More importantly, could some kind person point me in the direction of
source code to get drag and drop *to* the explorer working. I've
looked in the messages, and in the files, but I cannot find any
examples.

---

procedure TTree.MainTreeDragDrop(Sender: TBaseVirtualTree;
Source: TObject; DataObject: IDataObject; Formats: TFormatArray;
Shift: TShiftState; Pt: TPoint; var Effect: Integer; Mode:
TDropMode);
var I: Integer;
Buffer: array[0..2048] of Char;
fmtetc: tagFORMATETC;
stgmed: tagSTGMEDIUM;
dropH: HDROP;
nFiles, nNames: Cardinal;
szFileName: array[0..MAX_PATH + 1] of Char;
FilenamesList: TStringList;
begin
// VCL drag & drop
if Length(Formats) < 1 then begin
Beep;
Exit;
end;

for I := 0 to High(Formats) do begin
if Formats[I] = CF_VIRTUALTREE then begin
// From the tree
DragDrop(Sender, Shift);
Break;
end else begin
// From the desktop
FilenamesList:=nil;
if GetClipboardFormatName(Formats[I], @Buffer, 2048) < 1
then continue;
if not Assigned(DataObject) then continue;

// Get the data from the clipboard
fmtetc.cfFormat:=CF_HDROP;
fmtetc.ptd:=nil;
fmtetc.dwAspect:=DVASPECT_CONTENT;
fmtetc.lindex:= -1;
fmtetc.tymed:=TYMED_HGLOBAL;
if DataObject.GetData(fmtetc, stgmed)<>S_OK then continue;

// Lock the data
dropH:=HDROP(Windows.GlobalLock(stgmed.hGlobal));
try
if dropH=0 then continue;

try
// Get the number of filenames
nFiles := DragQueryFile(dropH, $FFFFFFFF, nil, 0);

// Get the filenames of each file
FilenamesList:=TStringList.Create;
for nNames:=0 to nFiles - 1 do begin
ZeroMemory(@szFileName, MAX_PATH + 1);
DragQueryFile(dropH, nNames, szFilename,
MAX_PATH + 1);

// Directories not supported
if FileExists(szFilename) then
FilenamesList.Add(szFilename);
end;

// Get the files
DropFiles(Sender, Shift, FilenamesList);
Break;
finally
// Clean-up
FreeAndNil(FilenamesList);
GlobalUnlock(stgmed.hGlobal);
end;
finally
ReleaseStgMedium(stgmed);
end;
end;
end;
end;

 | Replies | Author | Date
1974 | Re: Drag N Drop from tree | Jim Kueneman | Wed 5/23/2001
1976 | Re: Drag N Drop from tree | Teus de Jong | Wed 5/23/2001
2035 | Re: Drag N Drop from tree | Michael Leaver | Mon 5/28/2001
2043 | Re: Drag N Drop from tree | Teus de Jong | Mon 5/28/2001


HasChildren flag not reading correctly?

From: [zh66w6@h...]
Date: Wed May 23, 2001 9:12 am
Subject: HasChildren flag not reading correctly?

Hi All,

I recently updated VirtualTree to the latest Beta and the behaviour
of HasChildren seems to have changed.

I am using a virtualtree component to mirror the structure of a
database. Instead of reading the whole database into the tree, I just
check to see whether there are any records 'below' the current record
and set the Node's HasChildren flag appropriately. When the user
expands the node, the records below are fetched. This used to work
fine. Unfotunately HasChildren now seems to check to see if there are
any actual nodes below the node, not whether or not the HasChildren
flag has been set manually. If I set the HasChildren flag when there
are no nodes below it, the '+' appears next to the node, but if I
then try to read HasChildren, it reads as FALSE. Is this a bug or has
something been changed?

Cheers,
Paul

 | Replies | Author | Date
2006 | Re: HasChildren flag not reading correctly? | Mike Lischke | Sun 5/27/2001


re: Expanding Nodes

From: "Danil Galimov" [danil@o...]
Date: Wed May 23, 2001 9:24 am
Subject: Re: [VirtualTreeview] Expanding Nodes

Hello

you should write a code like

VirtualStringTree1.Expanded[Nodes]:=True;

and shouldn't never change the node states indirectly unless you're
fully understanding what are you doing.

> Hi,
> when programatically expanding nodes by calling
>
> Include(nodes.state, vsExpanded)
>
> I do not get any scrollbars.
> when clicking on some of that nodes I get an Integer-fault....

 | Replies | Author | Date
2004 | Re: Expanding Nodes | Mike Lischke | Sun 5/27/2001


Re-2: Expanding Nodes

From: [Thorsten.Claus@c...]
Date: Wed May 23, 2001 2:31 am
Subject: Re-2: [VirtualTreeview] Expanding Nodes

Ah,
thanks, I read this in an example about "OnInitNode..." and thought I could do
this at any time.... :)

Thorsten

-------- Original Message --------
Subject: Re: [VirtualTreeview] Expanding Nodes (23-Mai-2001 11:28)
From: [danil@o...]
To: [Thorsten.Claus@c...]

>
> Hello
>
> you should write a code like
>
> VirtualStringTree1.Expanded[Nodes]:=True;
>
> and shouldn't never change the node states indirectly unless you're
> fully understanding what are you doing.


ChildCount[nil]

From: "Moritz Franckenstein" [franckenstein@a...]
Date: Wed May 23, 2001 10:31 am
Subject: ChildCount[nil]

suggestion to mike: allow ChildCount[nil] to get/set the
rootnodecount. maybe this is also missing in some other places. it
would make things easier (i would no longer need those checks before
calling some functions: if Parent = nil then Parent:= RootNode)

-moritz

 | Replies | Author | Date
2010 | Re: ChildCount[nil] | Mike Lischke | Sun 5/27/2001


re: Problems with new nodes

From: Steffen Schemel [st_schemel@y...]
Date: Wed May 23, 2001 12:06 pm
Subject: RE: [VirtualTreeview] Problems with new nodes

Hi !

I have used this code (fragments):

type
pmyrec = ^tmyrec;
tmyrec = record
caption : string[50];
id0 : longint;
id1 : longint;
id2 : longint;
text0 : string[50];
text1 : string[50];
end;

...

procedure newnode(text:string);
begin
nodetext := text;
form1.vtpc.rootnodecount :=
form1.VTPC.RootNodeCount +1;
end;

procedure treeaufbauen;
var strg : string;
begin
//jetzt den tree aufbauen
with datamodule2.abfarbeitsplatz1 do
begin
first;
while not eof do
begin
strg := fieldbyname('NAME').text;
strg := strg + ' ' +
fieldbyname('ARB_ID').text;
newnode(strg);
next;
end;
end;
end;

...

procedure TForm1.VTPC1InitNode(Sender:
TBaseVirtualTree; ParentNode,
Node: PVirtualNode; var InitialStates:
TVirtualNodeInitStates);
var data : pmyrec;
strg : string;
begin
with sender do
begin
data := getnodedata(node);
strg := data.caption;
data.caption := nodetext;
end;
end;

...

procedure TForm1.VTPC1GetText(Sender:
TBaseVirtualTree; Node: PVirtualNode;
Column: Integer; TextType: TVSTTextType; var Text:
WideString);
var
data: pmyrec;
begin
data := sender.GetNodeData (node);
if assigned(data) then
text := data.caption;
end;

I hope, this can help you...
datamodule2.abfarbeitsplatz1 are a query from an
oracle-database, i have not testet with another
database yet.

Regards
Steffen

__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
http://auctions.yahoo.com/

 | Replies | Author | Date
1971 | Re: Problems with new nodes | Alexander Egorushkin | Wed 5/23/2001
1984 | Re: Problems with new nodes | Steffen Schemel | Thu 5/24/2001
2065 | Re: Problems with new nodes | Steffen Schemel | Wed 5/30/2001
2068 | Re: Problems with new nodes | Alexander Egorushkin | Wed 5/30/2001
2070 | Re: Problems with new nodes | Roland | Wed 5/30/2001


drag nodes over other controls ...

From: [muellers@s...]
Date: Wed May 23, 2001 12:32 pm
Subject: drag nodes over other controls ...

what am i doing wrong?

if you write an ondragover handler on a panel (or form) to accept
drag&drop it will not be called if you drag nodes over it (but
dragging other objects over it will call it!) ?!

how can i accept nodes dragged from a vtree to a tpanel?

cheers stefan

 | Replies | Author | Date
1968 | Re: drag nodes over other controls ... | GIANNAKOPOULOS KOSTAS | Wed 5/23/2001
1985 | Re: drag nodes over other controls ... | [muellers@s...] | Thu 5/24/2001


re: drag nodes over other controls ...

From: GIANNAKOPOULOS KOSTAS [kyan@s...]
Date: Wed May 23, 2001 12:41 pm
Subject: RE: [VirtualTreeview] drag nodes over other controls ...

If your tree uses OLE drag drop (DragType = dtOLE), i don't think you can,
singe TPanel and TForm know nothing about OLE drag-drop. You can drag nodes
from a VT to another Delphi control only if DragType = dtVCL.

On the other hand, you cannot drag nodes into another application or accept
objects dropped from another application if DragType = dtVCL.

Don't blame Mike for this, blame Borland for not supporting OLE drag-drop in
their controls.

<KY>

> -----Original Message-----
> From: [muellers@s...] [mailto:[muellers@s...]]
> Sent: Wednesday, May 23, 2001 3:32 PM
> To: [VirtualTreeview@yahoogroups.com
> Subject: [VirtualTreeview] drag nodes over other controls ...
>
>
> what am i doing wrong?
>
> if you write an ondragover handler on a panel (or form) to accept
> drag&drop it will not be called if you drag nodes over it (but
> dragging other objects over it will call it!) ?!
>
> how can i accept nodes dragged from a vtree to a tpanel?
>
> cheers stefan
>
>
> To unsubscribe from this group, send an email to:
> [VirtualTreeview-unsubscribe@egroups.com
>
>
>
> Your use of Yahoo! Groups is subject to
> http://docs.yahoo.com/info/terms/
>
>

Replies Author Date


[no subject]

From: Ralph Stoesser [rastoess@z...]
Date: Wed May 23, 2001 12:45 pm
Subject:


strange behaviour of the '*' and '/' keys

From: "Moritz Franckenstein" [franckenstein@a...]
Date: Wed May 23, 2001 1:29 pm
Subject: strange behaviour of the '*' and '/' keys

something went wrong with these shortcuts... they should make a full
expand / collapse of the current node but also change the focused
node to the next node or something...

-moritz

 | Replies | Author | Date
2011 | Re: strange behaviour of the '*' and '/' keys | Mike Lischke | Sun 5/27/2001


re: Problems with new nodes

From: "Alexander Egorushkin" [egorushkin@m...]
Date: Wed May 23, 2001 1:29 pm
Subject: RE: [VirtualTreeview] Problems with new nodes

Hi, Steffen!

> procedure newnode(text:string);
> begin
> nodetext := text;
> form1.vtpc.rootnodecount :=
> form1.VTPC.RootNodeCount +1;

That is wrong! If you want to add a new node you must use AddChild(Node:
Parent), where parent may be nil. RootNodeCount property setter starts
initialization procedure hence OnInitNode will be called for all nodes. But
you don't move through database in your OnInitNode hence all nodes are
filled equally!
> end;

>
> procedure treeaufbauen;
> var strg : string;
> begin
> //jetzt den tree aufbauen
> with datamodule2.abfarbeitsplatz1 do
> begin
> first;
> while not eof do
> begin
> strg := fieldbyname('NAME').text;
> strg := strg + ' ' +
> fieldbyname('ARB_ID').text;

*wrong
> newnode(strg);
use
form1.vtpc.AddChild(nil);
instead.

> next;
> end;
> end;
> end;
>
> ...
>
> procedure TForm1.VTPC1InitNode(Sender:
> TBaseVirtualTree; ParentNode,
> Node: PVirtualNode; var InitialStates:
> TVirtualNodeInitStates);
> var data : pmyrec;
> strg : string;
> begin
> with sender do
> begin
> data := getnodedata(node);

Do you really want to keep this line?
> strg := data.caption;

> data.caption := nodetext;
> end;
> end;
>
> ...

 | Replies | Author | Date
1984 | Re: Problems with new nodes | Steffen Schemel | Thu 5/24/2001
2065 | Re: Problems with new nodes | Steffen Schemel | Wed 5/30/2001
2068 | Re: Problems with new nodes | Alexander Egorushkin | Wed 5/30/2001
2070 | Re: Problems with new nodes | Roland | Wed 5/30/2001


changing ttNormal Text...

From: [Thorsten.Claus@c...]
Date: Wed May 23, 2001 6:50 am
Subject: changing ttNormal Text...

Hi,
I do have to change the ttNormal-Text programatically.
The Problem:
the new text is longer and overlaps now with the static text!
I called VT.Invalidate(), but this does not seem to solve this...
VST.InvalidateNode() seems do do it right, but do I really have to iterate
through the tree by myself? :)

any suggestions?

Thorsten

 | Replies | Author | Date
1979 | Re: changing ttNormal Text... | Werner Lehmann | Wed 5/23/2001
2008 | Re: changing ttNormal Text... | Mike Lischke | Sun 5/27/2001


IVTEditLink missing CanClose for valid a value

From: "Roland" [Beduerftig@S...]
Date: Wed May 23, 2001 3:10 pm
Subject: IVTEditLink missing CanClose for valid a value

Hi to all,

I use VT and the interface IVTEditLink to build a propertyeditor for
device settings.
The programs works fine, but I must validate the values of the edit-
components, and now I miss a function like CanClose, it means for
example:

field1 = combobox
field2 = number, range 1 til 20
field3 = number, range 10 til 120
field4 = combobox
...
....

Ok I put 400 in field3 and click in VT on field4 then the validator
of field3 says RangeError, in OnEndEdit I will not change the orginal
value and show a messagebox, but after press Ok in messagebox the
focus will change to field4 and I cannot stay on field3.

The missing function CanClose() should call the owneditor before
EndEdit, because now the component can validate the value and when Ok
CanClose := true else CanClose := false and nothing will happened.

Note:

CanStop works intern and with the function I cannot say "Validerror
no change to an other node" to VT.

Have someone an idea for a workaround for this problem ?

Roland

 | Replies | Author | Date
1975 | Editors for BCB (for Ronald) | Alexander Egorushkin | Wed 5/23/2001
2036 | Re: Editors for BCB (for Ronald) | Roland | Mon 5/28/2001
2113 | Re: IVTEditLink missing CanClose for valid a valu | Mike Lischke | Sat 6/2/2001


re: Drag N Drop from tree

From: "Jim Kueneman" [jimdk@m...]
Date: Wed May 23, 2001 3:48 pm
Subject: Re: Drag N Drop from tree

--- In [VirtualTreeview@y...], [MJLeaver@n...] wrote:
> While attempting to get drag and drop (from explorer) to the virtual
> tree working, it reminded me why I never want to return to C++.
> Anyway, the code I finally came up with (that works - it seems) is
> below. I'd appreciate any comments, e.g. "Idiot, its easier than
> that".

That looks impressive <g>. How about if you use DragAcceptFiles to
register the window as a drop source then write a message handler for
WM_DROPFILES. It will save you digging into the IDataObject although
you will have to either write a decendant or use an "imposter" class
(details of which I don't have access to right now)

>
> More importantly, could some kind person point me in the direction
of
> source code to get drag and drop *to* the explorer working. I've
> looked in the messages, and in the files, but I cannot find any
> examples.

Uses
ActiveX;

Write a decendant of class(TVTDragDropManager)

TShellDragDropManager = class(TVTDragDropManager)
public
function RenderData(FormatEtc: TFormatEtc; var StgMedium:
TStgMedium): HResult; override;
procedure SetOLEFormats(Formats: TOLEFormats); override;
end;

procedure TShellDragDropManager.SetOLEFormats(Formats: TOLEFormats);
var
Format: TFormatEtc;
i: integer;
begin
inherited;
Format.ptd := nil;
Format.dwAspect := DVASPECT_CONTENT;
Format.lindex := -1;
Format.tymed := TYMED_HGLOBAL;
Format.cfFormat := CF_HDROP;
FormatEtcList.Add(Format);
end;

function TShellDragDropManager.RenderData(FormatEtc: TFormatEtc;
var StgMedium: TStgMedium): HResult;
begin
{ Let VT handle its drag/drop among other tasks }
Result := inherited RenderData(FormatEtc, StgMedium);
{ VT did not want it }
if Result <> S_OK then
begin
{Being asked to render CF_HDROP data?}
if FormatEtc = CF_HDROP then
begin
StgMedium.tymed := TYMED_HGLOBAL;
StgMedium.unkForRelease := nil;
StgMedium.hGlobal := GlobalAlloc(GHND or GMEM_SHARE, HDropSize);
GlobalLock...
..Create a CF_HDROP structure of files in the structure
GlobalUnlock...
Result := S_OK
end else
Result := E_FAIL
end;
end;

Then return an instance of this new class in the event:

property OnCreateDragManager: TVTCreateDragManagerEvent read
FOnCreateDragManager write FOnCreateDragManager;

I think the HDROP format is already registered but

RegisterClipboardFormat(cf_HDROP) can't hurt.

This should get you most of the way there.

Jim


Editors for BCB (for Ronald)

From: "Alexander Egorushkin" [egorushkin@m...]
Date: Wed May 23, 2001 3:50 pm
Subject: Editors for BCB (for Ronald)

Hi, Ronald!

I've just looked at your demo: nice work! But there are two small bugs. I
think you should delete FEdit in destructor (as Mike does)

__fastcall TPropertyEdit::~TPropertyEdit(void)
{
// Release() will delete myself if counter == 0 !!!!!
//Add this
if(FEdit)
delete FEdit;
}

The second "bug" is when the last node is edited and you press VK_DOWN key
the focus remains on the last node. Only after the second keypress it moves
to the first node.

Alex.

 | Replies | Author | Date
2036 | Re: Editors for BCB (for Ronald) | Roland | Mon 5/28/2001


re: Drag N Drop from tree

From: "Teus de Jong" [teusjdejong@p...]
Date: Wed May 23, 2001 4:00 pm
Subject: Re: [VirtualTreeview] Drag N Drop from tree

> More importantly, could some kind person point me in the direction of
> source code to get drag and drop *to* the explorer working. I've
> looked in the messages, and in the files, but I cannot find any
> examples.
>

Here is a routine that I use in a sample component that will be on Mike's VT
Page in the near future.

The first is a general routine that can be called by overriding VT's
DORenderdata.

The other one's are routines that fill the memory structure with what is
requested.

You have to put the following statements in an initialization routine:
CF_IDLIST:=RegisterClipboardFormat(CFSTR_SHELLIDLIST);
CF_PrefDrop:=RegisterClipboardFormat(CFSTR_PREFERREDDROPEFFECT);
CF_Filename:=RegisterClipboardFormat(CFSTR_FILENAME);

Furthermore, make your own DragDropManager by overriding VT's one, somewhat
like this:

// DragDropmanager with FileOleFormats
// because we introduce no new things except a harmless array,
// it will be freed by VT
TVLDragDropManager=class(TVTDragDropmanager)
private
protected
public
FDropFormats: array[0..3] of UInt;
function RenderData(FormatEtc: TFormatEtc; var StgMedium: TStgMedium):
HResult; override;
procedure SetOLEFormats(Formats: TOLEFormats); override;
end;

{TVLDragDropManager}
function TVLDragDropManager.RenderData(FormatEtc: TFormatEtc; var StgMedium:
TStgMedium): HResult;
var
t: integer;
IsFileFormat: Boolean;
begin
// is it one of our file formats?
IsFileFormat:=false;
for t:=0 to Length(FDropFormats)-1 do
if formatetc.cfFormat=FDropFormats[t] then
begin
IsFileFormat:=true;
break;
end;
// if yes, then deliver the goods
if IsFileFormat and assigned(DragContainer.DragOwner)
and (DragContainer.DragOwner is TBaseFileViewer) then
result:=DoRenderdata(TVTFilelist(DragContainer.Dragowner), FormatEtc,
StgMedium)
// else let VT do it
else
result:=inherited renderdata(FormatEtc, StgMedium);
end;

// Add our own OLEFormats
procedure TVLDragDropManager.SetOLEFormats(Formats: TOLEFormats);
var
t: integer;
begin
inherited;
for t:=0 to Length(FDropFormats)-1 do
begin
FileOleFormat.cfFormat := FDropFormats[t];
FormatEtcList.Add(FileOleFormat);
end;
end;

Here are the other routines.

// function Renderdata
// overrides VT's Dorenderdata
function DoRenderdata(aTree: TBaseFileViewer; FormatEtc: TFormatEtc; var
StgMedium: TStgMedium): HResult;
var
pt: TPoint;
t: integer;
eff: UInt;
TheFormat: UINT;
begin
TheFormat:=0;
with aTree.FVLDragManager do
for t:=0 to Length(FDropFormats)-1 do
if formatetc.cfFormat=FDropFormats[t] then
begin
TheFormat:=formatetc.cfFormat;
break;
end;
if (TheFormat<>0) then
begin
// deliver the data in the requested format
StgMedium.hGlobal:=CreateHDrop(DragContainer, FormatEtc.cfFormat, eff,
pt, true);
if StgMedium.hGlobal = 0 then
result:=E_OUTOFMEMORY
else
begin
StgMedium.tymed := TYMED_HGLOBAL;
StgMedium.unkForRelease := nil;
result := S_OK;
end;
end
else
result := DV_E_FORMATETC;
end;
end;

{Drag Drop}
type
TFileRec=record
offset: UINT;
PIDL: PItemIDList;
Size: UINT;
end;
PFileRec=^TFileRec;

// make a idlist for drag/drop
procedure MakePidlList(Files: TStringList; PIDLList: TList);
var
Filerec, PrevFilerec: PFileRec;
StartPIDL: UINT;
t: integer;
begin
// StartPIDL: first PIDL; this is located after cidl and offsets
// cidl: 1 UINT; first offset=Directory pidl offset: 1 UINT
// offset for all files: file.count UINTs
StartPIDL:=SizeOf(UINT)*2+Files.Count*SizeOf(UINT);
// alloc FileRec for directory
New(FileRec);
FileRec^.PIDL:=GetPIDLForPath(ExtractFilePath(files[0]), true);
if FileRec^.PIDL=nil then
begin
Dispose(FileRec);
exit;
end;
FileRec^.offset:=StartPIDL;
FileRec^.Size:=GetPIDLSize(FileRec^.PIDL);
PIDLList.Add(FileRec);

// get FileRec's (PIDLs) for files}
for t:=0 to files.Count-1 do
begin
New(FileRec);
FileRec^.PIDL:=GetPIDLForPath(files[t], False);
if FileRec^.PIDL=nil then
begin
Dispose(Filerec);
exit;
end;
// offset = previous offset + previous size
// TList has one element more (the folder) then files,
// so t does the job
PrevFileRec:=PFileRec(PIDLList[t]);
FileRec^.offset:=PrevFileRec^.offset+PrevFileRec^.Size;
FileRec^.Size:=UINT(GetPIDLSize(FileRec^.PIDL));
PIDLList.Add(FileRec);
end;
end;

// clear a the Pidllist
procedure Clearpidllist(PidlList: TList);
var t: integer;
begin
for t:=0 to PIDLList.Count-1 do begin
FreePIDL(PFileRec(PIDLList[t]).PIDL);
// free pidl
Dispose(PFileRec(PIDLList[t]));
end;
end;

// CreateHdrop: make drag/drop object depending on the type requested
function CreateHDrop(Files: TStringList; dt, ef: UINT; pt: TPoint;
InClientArea: Boolean): HGlobal;
var
DropFiles : PDropFiles;
c: PChar;
Ida: PIDA;
PIDLList: TList;
Filerec: PFileRec;
TotalSize: UINT;
t, strlength: integer;
MyPtr: ^Byte;
p: PINT;
s: string;

begin
result := 0;
if dt = CF_filename then
begin
// a simple filename
s:=getShortFilename(Files[0]);
DragDropRoot:=getrootpath(Files[0]);
strlength:=Length(s)+1;
Result:=GlobalAlloc(GHND or GMEM_SHARE, strlength+1);
c:=GlobalLock(Result);
try
StrPCopy(c, s);
finally
GlobalUnlock(result);
end;
end
else
if dt=CF_HDROP then
begin
// standard dropfiles structure
strlength := 0;
DragDropRoot:=getrootpath(Files[0]);
for t := 0 to Files.Count-1 do
Inc(strlength, Length(Files[t])+1);
// alloocate memory
Result:=GlobalAlloc(GHND or GMEM_SHARE, SizeOf(TDropFiles)+strlength+1);
if Result=0 then
exit;
// lock memory handle
dropfiles:=GlobalLock(Result);
try
DropFiles.pFiles:=sizeof(TDropFiles);
DropFiles.pt:=pt;
DropFiles.fNC:=InClientArea;
DropFiles.fWide:=False;

// Copy file names to buffer; buffer starts at DropFiles +
DropFiles.pFiles..
c:=PChar(DropFiles)+SizeOf(TDropFiles);
for t := 0 to Files.Count-1 do
begin
StrPCopy (c, Files[t]);
c:=c+Length(Files[t])+1;
end;
finally
// unlock memory handle
GlobalUnlock(result);
end;
end
else
if dt=CF_IDLIST then
begin
// see Clipboard Formats for Shell Data Transfers and
// "Shell IDList Array" Format Win32Hlp
// | UINT size | Files.count+1 UINT offset | pidl for folder |
files.count pidl.s for files |
DragDropRoot:=getrootpath(Files[0]);
PIDLList:=TList.Create;
if PIDLList=nil then
exit;
try
MakePIDLLIst(files, PIDLLIst);
if PIDLList.Count=0 then
exit;
// Size to alloc
TotalSize:=PFileRec(PIDLList[PIDLList.Count-1])^.offset+
PFileRec(PIDLList[PIDLList.Count-1])^.Size;

// allocate
Result := GlobalAlloc(GHND or GMEM_SHARE, TotalSize);
if (Result = 0) then
exit;

// lock the handle
Ida:=GlobalLock(Result);
try
MyPtr:=pointer(Ida);

// plug files.count in cidl and inc offset
Ida^.cidl:=files.count;
Inc(MyPtr, SizeOf(UINT));

// plug in all offsets
for t:=0 to PIDLList.Count-1 do
begin
Move(PFileRec(PIDLList[t])^.offset, MyPtr^, SizeOf(UInt));
Inc(MyPtr, SizeOf(UINT));
end;

// plug in PIDL's
for t:=0 to PIDLList.count-1 do
begin
FileRec:=PFileRec(PIDLList[t]);
Move(FileRec^.PIDL^, MyPtr^, FileRec^.Size);
Inc(MyPtr, FileRec^.Size);
end;
finally
// unlock the handle
GlobalUnLock(Result);
end;
finally
// dispose of all records in Pidllist
ClearPidllist(PIDLLIst);
FreeAndNil(PidLList);
end;
end
else
if dt=CF_PrefDrop then
begin
Result:=GlobalAlloc(GHND or GMEM_SHARE, SizeOf(UInt));
p:=GlobalLock(Result);
try
p^:=ef;
finally
GlobalUnlock(Result);
end;
end;
end;

I hope this helps.

Teus de Jong.


Background color in VT

From: Kent Briggs [kbriggs@b...]
Date: Wed May 23, 2001 6:09 pm
Subject: Background color in VT

I noticed a little anomaly with the background color in VT. The little "+" and
"-" boxes to the left of tree nodes that have children are always drawn with a
background color of clWindow. However, if I change the VT's Color property to
something else (clYellow, for example), the background of the little boxes stays
at clWindow. It seems to me the background of the little boxes should be the
same as the VT's main Color property to maintain a consistent look.

--
Kent Briggs, [kbriggs@b...]
Briggs Softworks, http://www.briggsoft.com

 | Replies | Author | Date
1978 | Re: Background color in VT | Werner Lehmann | Wed 5/23/2001
1980 | Re: Background color in VT | Kent Briggs | Wed 5/23/2001
2018 | Re: Background color in VT | Mike Lischke | Sun 5/27/2001
1981 | Re: Background color in VT | Kent Briggs | Wed 5/23/2001
1982 | Re: Background color in VT | Jim Kueneman | Wed 5/23/2001
1983 | Re: Background color in VT | Kent Briggs | Wed 5/23/2001
2016 | Re: Background color in VT | Mike Lischke | Sun 5/27/2001
2031 | Re: Background color in VT | Kent Briggs | Sun 5/27/2001


re: Background color in VT

From: Werner Lehmann [wl@b...]
Date: Wed May 23, 2001 6:29 pm
Subject: Re: [VirtualTreeview] Background color in VT

Kent Briggs wrote:
>
> I noticed a little anomaly with the background color in VT. The little "+"
and
> "-" boxes to the left of tree nodes that have children are always drawn with a
> background color of clWindow. However, if I change the VT's Color property to
> something else (clYellow, for example), the background of the little boxes
stays
> at clWindow. It seems to me the background of the little boxes should be the
> same as the VT's main Color property to maintain a consistent look.

This is a matter of taste. I would always prefer them to be white inside
(if clWindow is white). But at least if there is a background wallpaper
defined it makes a lot of sense not to make the interior transparent. The
tree-buttons would be hard to see otherwise.

Regards,
Werner


re: changing ttNormal Text...

From: Werner Lehmann [wl@b...]
Date: Wed May 23, 2001 6:33 pm
Subject: Re: [VirtualTreeview] changing ttNormal Text...

"Thorsten.Claus" wrote:
>
> I called VT.Invalidate(), but this does not seem to solve this...
> VST.InvalidateNode() seems do do it right, but do I really have to iterate
through the tree by myself? :)

InvalidateNode would be suggestion too. I don't understand your point about
iterating the tree. If you can change the text of a node you have already
a PVirtualNode at hand that you can pass on to InvalidateNode.

Regards,
Werner


re: Background color in VT

From: Kent Briggs [kbriggs@b...]
Date: Wed May 23, 2001 6:44 pm
Subject: Re: [VirtualTreeview] Background color in VT

Kent Briggs wrote:

> I noticed a little anomaly with the background color in VT. The little "+"
and
> "-" boxes to the left of tree nodes that have children are always drawn with a
> background color of clWindow. However, if I change the VT's Color property to
> something else (clYellow, for example), the background of the little boxes
stays
> at clWindow. It seems to me the background of the little boxes should be the
> same as the VT's main Color property to maintain a consistent look.

I just came across another problem. The "+" and "-" characters inside the
buttons
are drawn with the VT's main font color set a design time. However, if I
change the
vt.font.color at run time, the buttons do not update with the new color.

--
Kent Briggs, [kbriggs@b...]
Briggs Softworks, http://www.briggsoft.com

 | Replies | Author | Date
2018 | Re: Background color in VT | Mike Lischke | Sun 5/27/2001


re: Background color in VT

From: Kent Briggs [kbriggs@b...]
Date: Wed May 23, 2001 7:20 pm
Subject: Re: [VirtualTreeview] Background color in VT

Werner Lehmann wrote:

> Kent Briggs wrote:
> >
> > I noticed a little anomaly with the background color in VT. The little "+"
and
> > "-" boxes to the left of tree nodes that have children are always drawn
with a
> > background color of clWindow. However, if I change the VT's Color property
to
> > something else (clYellow, for example), the background of the little boxes
stays
> > at clWindow. It seems to me the background of the little boxes should be
the
> > same as the VT's main Color property to maintain a consistent look.
>
> This is a matter of taste. I would always prefer them to be white inside
> (if clWindow is white). But at least if there is a background wallpaper
> defined it makes a lot of sense not to make the interior transparent. The
> tree-buttons would be hard to see otherwise.

If the background image was interfering with the buttons then it would be
interfering
with the text in the tree also. But regardless, I'm not asking for a
transparent
button. I just want it to get its background color from the tree's color and
not
hard-coded to clWindow. For most people, the tree's color will be set to
clWindow
anyway so such a change will not affect them at all, with or without a
background
image.

--
Kent Briggs, [kbriggs@b...]
Briggs Softworks, http://www.briggsoft.com


re: Background color in VT

From: "Jim Kueneman" [jimdk@m...]
Date: Wed May 23, 2001 9:01 pm
Subject: Re: Background color in VT

--- In [VirtualTreeview@y...], Kent Briggs [kbriggs@b...] wrote:
> at clWindow. It seems to me the background of the little boxes
should be the
> same as the VT's main Color property to maintain a consistent look.
oft.com

Kent,

I appears to be a little oversight on Mikes part. The bitmaps are
only created when the Window is created, when the ButtonStyle is
changed and when LineStyle changes.

Change the color of the background then change the LineStyle or or
ButtonStyle to force it the recreate the little bitmaps with the new
background.

Jim


re: Re: Background color in VT

From: Kent Briggs [kbriggs@b...]
Date: Wed May 23, 2001 11:26 pm
Subject: Re: [VirtualTreeview] Re: Background color in VT

Jim Kueneman wrote:

> Change the color of the background then change the LineStyle or or
> ButtonStyle to force it the recreate the little bitmaps with the new
> background.

Thanks, I'll give that a try.

--
Kent Briggs, [kbriggs@b...]
Briggs Softworks, http://www.briggsoft.com


re: Problems with new nodes

From: Steffen Schemel [st_schemel@y...]
Date: Thu May 24, 2001 8:25 am
Subject: RE: [VirtualTreeview] Problems with new nodes

Hi Alexander!

--- Alexander Egorushkin [egorushkin@m...]
wrote:
> Hi, Steffen!
>
>
> > procedure newnode(text:string);
> > begin
> > nodetext := text;
> > form1.vtpc.rootnodecount :=
> > form1.VTPC.RootNodeCount +1;
>
> That is wrong! If you want to add a new node you
> must use AddChild(Node:
> Parent), where parent may be nil. RootNodeCount
> property setter starts
> initialization procedure hence OnInitNode will be
> called for all nodes. But
> you don't move through database in your OnInitNode
> hence all nodes are
> filled equally!

Like in my program...

> > end;
>
>
> >
> > procedure treeaufbauen;
> > var strg : string;
> > begin
> > //jetzt den tree aufbauen
> > with datamodule2.abfarbeitsplatz1 do
> > begin
> > first;
> > while not eof do
> > begin
> > strg := fieldbyname('NAME').text;
> > strg := strg + ' ' +
> > fieldbyname('ARB_ID').text;
>
> *wrong
> > newnode(strg);
> use
> form1.vtpc.AddChild(nil);
> instead.

i will taste it on monday, now i've been not at the
office...

>
> > next;
> > end;
> > end;
> > end;
> >
> > ...
> >
> > procedure TForm1.VTPC1InitNode(Sender:
> > TBaseVirtualTree; ParentNode,
> > Node: PVirtualNode; var InitialStates:
> > TVirtualNodeInitStates);
> > var data : pmyrec;
> > strg : string;
> > begin
> > with sender do
> > begin
> > data := getnodedata(node);
>
> Do you really want to keep this line?
> > strg := data.caption;

No, that was for debugging...

>
> > data.caption := nodetext;
> > end;
> > end;
> >
> > ...
>
>

Thanks and i wish a very fine Weekend.
Steffen

__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
http://auctions.yahoo.com/

 | Replies | Author | Date
2065 | Re: Problems with new nodes | Steffen Schemel | Wed 5/30/2001
2068 | Re: Problems with new nodes | Alexander Egorushkin | Wed 5/30/2001
2070 | Re: Problems with new nodes | Roland | Wed 5/30/2001


re: drag nodes over other controls ...

From: [muellers@s...]
Date: Thu May 24, 2001 9:32 am
Subject: Re: drag nodes over other controls ...

thanks for the answer - i now accept ole-drops on the tpanel - and
that works ok ... just a little bit unused to it but anyway more
powerful/useful so it's no problem!

cheers stefan

--- In [VirtualTreeview@y...], GIANNAKOPOULOS KOSTAS [kyan@s...] wrote:
> If your tree uses OLE drag drop (DragType = dtOLE), i don't think
you can,
> singe TPanel and TForm know nothing about OLE drag-drop. You can
drag nodes
> from a VT to another Delphi control only if DragType = dtVCL.
>
> On the other hand, you cannot drag nodes into another application
or accept
> objects dropped from another application if DragType = dtVCL.
>
> Don't blame Mike for this, blame Borland for not supporting OLE
drag-drop in
> their controls.
>
> <KY>
>
> > -----Original Message-----
> > From: [muellers@s...] [mailto:[muellers@s...]]
> > Sent: Wednesday, May 23, 2001 3:32 PM
> > To: [VirtualTreeview@y...]
> > Subject: [VirtualTreeview] drag nodes over other controls ...
> >
> >
> > what am i doing wrong?
> >
> > if you write an ondragover handler on a panel (or form) to accept
> > drag&drop it will not be called if you drag nodes over it (but
> > dragging other objects over it will call it!) ?!
> >
> > how can i accept nodes dragged from a vtree to a tpanel?
> >
> > cheers stefan
> >
> >
> > To unsubscribe from this group, send an email to:
> > VirtualTreeview-unsubscribe@egroups.com
> >
> >
> >
> > Your use of Yahoo! Groups is subject to
> > http://docs.yahoo.com/info/terms/
> >
> >


New file uploaded to VirtualTreeview

From: [VirtualTreeview@yahoogroups.com>
Date: Thu May 24, 2001 11:34 am
Subject: New file uploaded to VirtualTreeview

Hello,

This email message is a notification to let you know that
a file has been uploaded to the Files area of the VirtualTreeview
group.

File : /VT Tree Disappearing Expand Buttons.zip
Uploaded by : [zh66w6@h...]
Description : Disappearing Expand buttons on SaveToFile Example

You can access this file at the URL

http://groups.yahoo.com/group/VirtualTreeview/files/VT%20Tree%20Disappearing%20E\
xpand%20Buttons.zip

To learn more about file sharing for your group, please visit

http://help.yahoo.com/help/us/groups/files

Regards,

zh66w6@h...]


SaveToFile causes vsHasChildren state to be removed

From: [zh66w6@h...]
Date: Thu May 24, 2001 11:38 am
Subject: SaveToFile causes vsHasChildren state to be removed

When saving to a file, VT removes the vsHasChildren state from all
nodes that don't have actual nodes below them. Surely this is not
correct as the vsHasChildren state can be set for a node even if no
actual child nodes exist (see my previous post for a full description
of the problem [1962]).

I have uploaded a demo app the the files section which shows the
problem.

Am I doing something wrong or is this a bug/feature?

I hope someone can help as this is driving me nuts!

Cheers,
Paul

 | Replies | Author | Date
1988 | Re: SaveToFile causes vsHasChildren state to be r | [andersthomsen@h...] | Thu 5/24/2001
1989 | Re: SaveToFile causes vsHasChildren state to be r | [zh66w6@h...] | Thu 5/24/2001
1990 | Re: SaveToFile causes vsHasChildren state to be r | [andersthomsen@h...] | Thu 5/24/2001
2114 | Re: SaveToFile causes vsHasChildren state to be r | Mike Lischke | Sat 6/2/2001


re: SaveToFile causes vsHasChildren state to be removed

From: [andersthomsen@h...]
Date: Thu May 24, 2001 1:29 pm
Subject: Re: SaveToFile causes vsHasChildren state to be removed

Hmm.. I just replied to this, but it seems as it didn't got posted,
Lets try again : )

Either:
Set voInitOnSave to false (in Options)
OR:
Do this in the OnInitChildren even:
ChildCount := 1

That should do it : )

Cheers,
Thomsen

--- In [VirtualTreeview@y...], [zh66w6@h...] wrote:
> When saving to a file, VT removes the vsHasChildren state from all
> nodes that don't have actual nodes below them. Surely this is not
> correct as the vsHasChildren state can be set for a node even if no
> actual child nodes exist (see my previous post for a full
description
> of the problem [1962]).
>
> I have uploaded a demo app the the files section which shows the
> problem.
>
> Am I doing something wrong or is this a bug/feature?
>
> I hope someone can help as this is driving me nuts!
>
> Cheers,
> Paul

 | Replies | Author | Date
1989 | Re: SaveToFile causes vsHasChildren state to be r | [zh66w6@h...] | Thu 5/24/2001


re: SaveToFile causes vsHasChildren state to be removed

From: [zh66w6@h...]
Date: Thu May 24, 2001 1:35 pm
Subject: Re: SaveToFile causes vsHasChildren state to be removed

That works great :) You're a star!

--- In [VirtualTreeview@y...], [andersthomsen@h...] wrote:
> Hmm.. I just replied to this, but it seems as it didn't got posted,
> Lets try again : )
>
> Either:
> Set voInitOnSave to false (in Options)
> OR:
> Do this in the OnInitChildren even:
> ChildCount := 1
>
> That should do it : )
>
> Cheers,
> Thomsen


re: SaveToFile causes vsHasChildren state to be removed

From: [andersthomsen@h...]
Date: Thu May 24, 2001 1:21 pm
Subject: Re: SaveToFile causes vsHasChildren state to be removed

Hi,

Try This:

Set voInitOnSave (in Options) = false

This causes the childs not to get initiated when the nodes are saved.
If you take a look at:
procedure TBaseVirtualTree.InitChildren(Node: PVirtualNode);
you'll see that if no child exists, the vsHasChildren is excluded.

Instead of that, you can use the OnInitChildren event like this:
procedure TForm1.VT1InitChildren(Sender: TBaseVirtualTree;
Node: PVirtualNode; var ChildCount: Cardinal);
begin
childcount := 1
end;

Then the childcount is =1, and the vsHasChilden is not excluded.

Hope this helps.

Cheers, Thomsen

--- In [VirtualTreeview@y...], [zh66w6@h...] wrote:
> When saving to a file, VT removes the vsHasChildren state from all
> nodes that don't have actual nodes below them. Surely this is not
> correct as the vsHasChildren state can be set for a node even if no
> actual child nodes exist (see my previous post for a full
description
> of the problem [1962]).
>
> I have uploaded a demo app the the files section which shows the
> problem.
>
> Am I doing something wrong or is this a bug/feature?
>
> I hope someone can help as this is driving me nuts!
>
> Cheers,
> Paul


Small bug and toggle animation

From: Werner Lehmann [wl@b...]
Date: Fri May 25, 2001 12:57 am
Subject: Small bug and toggle animation

Hi Mike,

I have two small things:

- the first is a bug. You can scroll up one page with ctrl+page-up but only one
node down with ctrl+page-down...

- In my app I have two VTree's. The children of a node in #2 are dependent on
the
focused node of #1. If focus changes in #1 the children of that node in #2
have
to be replaced. This node is always expanded.

Well, something happened and all out of a sudden (for me) the focus switch in
#1
with arrow keys took forever (not really forever but it seemed far too long
and
caused a lot of stuttering if the nodes were browsed by keyboard). I was
scratching
my head about this for longer than a month now. To cut a long story short: I
had
enabled the ToggleAnimation in all trees, also in #2. Exchanging the children
of
that node in #2 took 200 + eps ms because the animation took so long. You
might
say so what, why did I enable it in the first place.

I am using a BeginUpdate/EndUpdate pair while children are exchanged (which
involves a collapse + expand), and the animation is not visible. Still it
takes
its 200 ms...

The problem went away when I added two checks for (FUpdateCount = 0) in
ToggleNode
to the 'if' before collapse and expand animation. Man, was I relieved. Elvis
entered the building again :) Can I have this in the distribution?

Regards,
Werner

PS: I am using grid mode in one VTree. Ctrl+End selects the last node (ok) but
also the last column. I know that you added this feature on request as a
speciality
for grid mode. Can I have another speciality if grid mode + fullrowselect is
used?
I'd like to have no horz. scrolling on ctrl end/home if fullrowselect is on.

 | Replies | Author | Date
2022 | Re: Small bug and toggle animation | Mike Lischke | Sun 5/27/2001


Question about paint

From: GIANNAKOPOULOS KOSTAS [kyan@s...]
Date: Fri May 25, 2001 8:37 am
Subject: Question about paint

Good morning Mike.

Let's suppose that i wanted to paint formatted text (imagine RTF for
instance) for a node/column.
This involves 2 things:

1. Actually painting the text
2. Altering the rectangle that is considered "content rectangle" for the
cell (especially the main column) so that it reflects the extent of the
formatted text, which could be different than what it would be if the text
was plain and that mouse clicks work correctly.

For 1 i thought of using OnAfterCellPaint, but i'm lacking access to an
important member of the TVTPaintInfo structure you have filled: the content
rectangle.

For 2 i can't find a way to do it.

Can you give me a hint?

Thanx

<KY>

 | Replies | Author | Date
2021 | Re: Question about paint | Mike Lischke | Sun 5/27/2001


How to change a color?

From: "Danil Galimov" [danil@o...]
Date: Fri May 25, 2001 10:33 am
Subject: How to change a color?

Hello all

Then i have static text enabled with grid mode, the static text is
shown as black then the node is selected, making it almost
unreadable. How can i change that color?

 | Replies | Author | Date
2023 | Re: How to change a color? | Mike Lischke | Sun 5/27/2001


VET (ShellUtilities) in BCB...

From: [tias@m...]
Date: Fri May 25, 2001 3:34 pm
Subject: VET (ShellUtilities) in BCB...

Hi (Jim) !

I noticed a typo in VET 1.1.16, three HPPEMIT's are missing a dollar
sign :
{HPPEMIT 'typedef DelphiInterface<IDropTarget> _di_IDropTarget;'}
{HPPEMIT 'typedef DelphiInterface<IQueryInfo> _di_IQueryInfo;'}
{HPPEMIT 'typedef DelphiInterface<IContextMenu3> _di_IContextMenu3;'}

Should be :

{$HPPEMIT 'typedef DelphiInterface<IDropTarget> _di_IDropTarget;'}
{$HPPEMIT 'typedef DelphiInterface<IQueryInfo> _di_IQueryInfo;'}
{$HPPEMIT 'typedef DelphiInterface<IContextMenu3> _di_IContextMenu3;'}

Otherwise I'm happy :-) !

/Mathias Thorell

 | Replies | Author | Date
1995 | Re: VET (ShellUtilities) in BCB... | Jim Kueneman | Fri 5/25/2001
1998 | VET version 1.1.17 | Jim Kueneman | Sat 5/26/2001


re: VET (ShellUtilities) in BCB...

From: Jim Kueneman [jimdk@m...]
Date: Fri May 25, 2001 3:45 pm
Subject: Re: [VirtualTreeview] VET (ShellUtilities) in BCB...

At 03:34 PM 5/25/2001 +0000, you wrote:
>Hi (Jim) !
>
>I noticed a typo in VET 1.1.16, three HPPEMIT's are missing a dollar
>sign :

And I for one should know the importance of a dollar sign!

Fixed.

Jim


Right mouse button in header

From: "Cyril VELTER" [cyril.velter@l...]
Date: Fri May 25, 2001 6:48 pm
Subject: Right mouse button in header

Hi Mike,

It seems that the WM_NCRBUTTONDOWN message is not handled in
TVTHeader.HandleMessage or do I miss something ?
This result as DoHeaderMouseDown not being called for right buton
clicks.

Thanks,

cyril

 | Replies | Author | Date
2017 | Re: Right mouse button in header | Mike Lischke | Sun 5/27/2001


New file uploaded to VirtualTreeview

From: [VirtualTreeview@yahoogroups.com>
Date: Sat May 26, 2001 4:09 am
Subject: New file uploaded to VirtualTreeview

Hello,

This email message is a notification to let you know that
a file has been uploaded to the Files area of the VirtualTreeview
group.

File : /VET_V1.1.17.zip
Uploaded by : [jimdk@m...]
Description : Virtual Explorer Tree version 1.1.17

You can access this file at the URL

http://groups.yahoo.com/group/VirtualTreeview/files/VET_V1.1.17.zip

To learn more about file sharing for your group, please visit

http://help.yahoo.com/help/us/groups/files

Regards,

jimdk@m...]


VET version 1.1.17

From: Jim Kueneman [jimdk@m...]
Date: Sat May 26, 2001 4:14 am
Subject: VET version 1.1.17

VET is finally 100% image thread safe (or at least I can't make is crash
anymore) and I feel I now have all the bases covered where it could have
problems.

Also I uploaded a first cut at a help file for VET. It will be included in
VT help eventually but this allows some feedback while I finish the
rest. The classes in ShellUtilities.pas file are documented, only the
types and variables are left. About half the classes in the
TVirtualExplorerTree.pas file are done, unfortunately not including
TVirtualExplorerTree sorry I am working on it.

Jim


New file uploaded to VirtualTreeview

From: [VirtualTreeview@yahoogroups.com>
Date: Sat May 26, 2001 4:15 am
Subject: New file uploaded to VirtualTreeview

Hello,

This email message is a notification to let you know that
a file has been uploaded to the Files area of the VirtualTreeview
group.

File : /VET_V1.1.17_Help.zip
Uploaded by : [jimdk@m...]
Description : Partially completed Help for VirtualExplorerTree

You can access this file at the URL

http://groups.yahoo.com/group/VirtualTreeview/files/VET_V1.1.17_Help.zip

To learn more about file sharing for your group, please visit

http://help.yahoo.com/help/us/groups/files

Regards,

jimdk@m...]

 | Replies | Author | Date
2025 | Re: New file uploaded to VirtualTreeview | Mike Lischke | Sun 5/27/2001
2026 | Re: New file uploaded to VirtualTreeview | Mike Lischke | Sun 5/27/2001
2045 | Re: New file uploaded to VirtualTreeview | Jim Kueneman | Mon 5/28/2001
2047 | Re: New file uploaded to VirtualTreeview | Mike Lischke | Mon 5/28/2001
2044 | Re: New file uploaded to VirtualTreeview | Jim Kueneman | Mon 5/28/2001
2046 | Re: New file uploaded to VirtualTreeview | Mike Lischke | Mon 5/28/2001
2054 | Re: New file.. also RightExtent Calculation | Jim Kueneman | Mon 5/28/2001


Which version should I use?

From: [kvds@g...]
Date: Sat May 26, 2001 3:20 pm
Subject: Which version should I use?

Hello,

I'm new to VirtualTreeView, and I'm not sure whether I should start
using the version on the website (v1.31) or the one found in the
groups here, v2.4. Which one should I use?

Koen van de Sande

 | Replies | Author | Date
2020 | Re: Which version should I use? | Mike Lischke | Sun 5/27/2001


Why use HTMLHelp?

From: [youngpup_SH_@h...]
Date: Sat May 26, 2001 4:02 pm
Subject: Why use HTMLHelp?

Why is all the help (well, BOTH of the help files) in Compiled-HTML
Help format. Can Delphi link to context-sensitive HTMLHelp and i
don't know it?

 | Replies | Author | Date
2019 | Re: Why use HTMLHelp? | Mike Lischke | Sun 5/27/2001


Hidden nodes bug

From: "Cyril VELTER" [cyril.velter@l...]
Date: Sun May 27, 2001 2:39 am
Subject: Hidden nodes bug

Hi mike

I've tracked down a problem with the handling of Hidden nodes. Sometime
after expanding and collapsing nodes with hidden chidren the tree won't
redraw at all. The problem seems to happen only when the client area is
filled (ie the vertical scrollbar appear).

cyril

Here is the analysis I've done :

RootNodeCount=1
Node are Hidden in DoInitNode with IsVisible[Node]:=false;
Tree height can just contain 3 nodes

1 - Expand the root node chich contain 2 childs

2 - Expand the first child which contain 5 visible and 2 invisible
nodes

3 - Collapse the rootnode

4 - Nothing will redraw because :

in PaintTree, GetNodeAt(0, Window.Top, False, BaseOffset)
return nil
which is caused by FindInPositionCache(AbsolutePos, CurrentPos)
returning nil
High(FPositionCache)=2147483 ??? and only the first node is not
nil.
This is comming from DoValidateCache where
FVisibleCount=4294967295

Back to step 2 where FVisibleCount is updated :

in toggle node there is the following sequence :

AdjustTotalHeight(Node, NewHeight, True); -->
decrement FVisibleCount by 2
if FullyVisible[Node] then
Inc(FVisibleCount, CountVisibleChildren(Node)); --> Increment
FVisibleCount by 5

AdjustTotalHeight decrement FVisibleCount because VerticalScrollBar
is shown, which in turn Initialize Child nodes.
The child initialization cause the 2 decrement (for each invisible
node) and prevent CountVisibleChildren to count all nodes.

FVisibleNode before = 3
FVisibleNode after =3-2+5=6 instead of 8.

Moving AdjustTotalHeight after CountVisibleChildren solve the
problem, but I'm not sure of any other side effects.

if FullyVisible[Node] then
Inc(FVisibleCount, CountVisibleChildren(Node));
AdjustTotalHeight(Node, NewHeight, True);

instead of

AdjustTotalHeight(Node, NewHeight, True);
if FullyVisible[Node] then
Inc(FVisibleCount, CountVisibleChildren(Node));

 | Replies | Author | Date
2112 | Re: Hidden nodes bug | Mike Lischke | Sat 6/2/2001
2174 | Re: Hidden nodes bug | Cyril VELTER | Sun 6/3/2001
2184 | Re: Hidden nodes bug | Mike Lischke | Sun 6/3/2001


Subtract key expands nodes

From: Bohuslav Švancara [boh.svancara@q...]
Date: Sun May 27, 2001 2:00 pm
Subject: Subtract key expands nodes

Hi!

"Subtract" key expands nodes, just like "Add" key. (With shift key it is
OK.) I think it is error.

I also think, that after "Subtract" key and "Add" key must
expanded/collapsed node stay selected. Now VT scrolls one node down.

VTVersion = '2.4.16';
Options = [voExtendedFocus, voGridExtensions, voInitOnSave, voShowButtons,
voShowDropmark, voShowHorzGridLines, voShowRoot, voShowTreeLines,
voShowVertGridLines, voToggleOnDblClick]

Regards,

Bohuslav Svancara
[softprojekt@i...]

 | Replies | Author | Date
2024 | Re: Subtract key expands nodes | Mike Lischke | Sun 5/27/2001


re: Expanding Nodes

From: "Mike Lischke" [public@l...]
Date: Sun May 27, 2001 2:50 pm
Subject: RE: [VirtualTreeview] Expanding Nodes

> you should write a code like
>
> VirtualStringTree1.Expanded[Nodes]:=True;

Actually, Tree.ToggleNode(Nodes) does it too.

Ciao, Mike


re: Whistler

From: "Mike Lischke" [public@l...]
Date: Sun May 27, 2001 2:50 pm
Subject: RE: [VirtualTreeview] Whistler

Hi Paul,

> Btw: Do you remember my suggestion regarding buttons bellow vertical
> scrollbar?

Yes I remember, but I still have not found a way to manipulate the scroll bars
accordingly. I have
posted a message in the WinAPI newsgroup. Perhaps somebody has a hint for me
(but I doubt it).

Ciao, Mike


re: HasChildren flag not reading correctly?

From: "Mike Lischke" [public@l...]
Date: Sun May 27, 2001 2:50 pm
Subject: RE: [VirtualTreeview] HasChildren flag not reading correctly?

Hi Paul,

> Unfotunately HasChildren now seems to check to see if there are
> any actual nodes below the node, not whether or not the HasChildren
> flag has been set manually. If I set the HasChildren flag when there
> are no nodes below it, the '+' appears next to the node, but if I
> then try to read HasChildren, it reads as FALSE. Is this a bug or has
> something been changed?

You see me surprised that you encounter this problem at all. Look into the
source for GetHasChildren
and you'll see it does not check whether there are children.

Ciao, Mike


re: Small flaws

From: "Mike Lischke" [public@l...]
Date: Sun May 27, 2001 2:50 pm
Subject: RE: [VirtualTreeview] Small flaws

Hi Danil,

> Mike, in latest VT, then i enable voHideFocusRect, the captions
> are not drawn. To be more corectly, they are drawn as spaces :)

I cannot reproduce this problem.

> Also, there is some strange behavoir with hints. I have assigned
> Hint property, and fade hint animation, but the hint is displayed
> without any delay, then i move corsor to VT, and without any
> animation. I'm using win98, so is fade hint animation avaliable on
> win2k only?

No, faded and slided hints are available on all 32 bit Windows platforms (faded
hints are replaced
by slided hints if there is no MMX support). Check TBaseVirtualTree.Animate to
see if it is entered
and with what values.

> And a small suggestion: what about AutoHint property, which will
> automatically show hints for header columns and nodes' captions,
> which have shortened? This is a default behaviour in some
> WIndows controls, so i think, not only me want it :)

You are referring to tool tips. This is (for nodes) already built in. For the
header there is
usually no tool tip (I have not seen any) because of the complex layout. Here a
normal hint is
sufficient.

> And in some windows configuration (large icons), some custom
> check images are not fully drawn. I will post somewhere a
> screenshot (and custom images file :)) so you can see it yourself.

This is more than strange (and I cannot reproduce this problem). The icon
settings do not have any
influence on font sizes or general image list sizes. It is rather a feature of
the destop window.

Ciao, Mike


re: changing ttNormal Text...

From: "Mike Lischke" [public@l...]
Date: Sun May 27, 2001 2:50 pm
Subject: RE: [VirtualTreeview] changing ttNormal Text...

Hi Thorsten,

> I do have to change the ttNormal-Text programatically.
> The Problem:
> the new text is longer and overlaps now with the static text!
> I called VT.Invalidate(), but this does not seem to solve this...
> VST.InvalidateNode() seems do do it right, but do I really have to iterate
through the
> tree by myself? :)

The string tree caches the width of the text for the main column for quick
multiselection etc. If
you change the text of a node then VT needs to know that to recalculate this
width. Using
InvalidateNode is the correct way to accomplish that. And yes, if you change
the text of all nodes
in the tree then you also have to iterate through all of them and invalidate
them. This should not
create much extra effort since you already have a loop or something like that
to change the node
text's. Another option would be the IterateTree method.

Ciao, Mike


re: Re: need help with DoInitNode and DoInitChi ldre n

From: "Mike Lischke" [public@l...]
Date: Sun May 27, 2001 2:50 pm
Subject: RE: [VirtualTreeview] Re: need help with DoInitNode and DoInitChi ldre n

Moritz,

> i can imagine a lot of situations where the normal approach would be
> impossible or only not so nice (i mean that DoInitChildren only
> returns the ChildCount, and DoInitNode finds its data by the child
> index).
>
> one example could be that all children of a node are a result of a
> database query which is now in an ADORecordset. i dont want to make
> this query first to find out if there are any results (HasChildren),
> then later again to find the number of results (ChildCount) and then
> again to get result number 17.

This would not be the way to do this kind of initialization. What you usually
have is one query. Use this query to determine the number of child nodes
(RecordCount). If you are dealing with large data sets then it might be
beneficial to use a special query only to do a "select count(*) from ..." to
determine the count.

In OnInitNode you can then use the normal query to access individual records
and read the data you need. This is rather simple. The only problem I see here
is that it is difficult to address a certain record from an index. Paradox
supports this kind of addressing but SQL servers do not and that makes it
necessary to fill the nodes differently unless somebody comes up with another
indentification parameter for OnInitNode. Since almost all data of a node is
actually stored in the application's data structures it is difficulat for VT to
identify a particular node to be initialized. The ParentNode/Node.Index idea
was the best one I was able to find. Perhaps there is a better approach? For
SQL databases I have used the .First/.MoveBy combination to seek to a
particular record, but this is not optimal.

Ciao, Mike

 | Replies | Author | Date
2039 | Re: need help with DoInitNode and DoInitChi ldre | Moritz Franckenstein | Mon 5/28/2001
2040 | Re: need help with DoInitNode and DoInitChi ldre | Mike Lischke | Mon 5/28/2001


re: ChildCount[nil]

From: "Mike Lischke" [public@l...]
Date: Sun May 27, 2001 2:50 pm
Subject: RE: [VirtualTreeview] ChildCount[nil]

Moritz,

> suggestion to mike: allow ChildCount[nil] to get/set the
> rootnodecount.

Good idea, thank you. Done.

Ciao, Mike


re: strange behaviour of the '*' and '/' keys

From: "Mike Lischke" [public@l...]
Date: Sun May 27, 2001 2:50 pm
Subject: RE: [VirtualTreeview] strange behaviour of the '*' and '/' keys

Moritz,

> something went wrong with these shortcuts... they should make a full
> expand / collapse of the current node but also change the focused
> node to the next node or something...

This is a bug. The hot keys should not be used in incremental search (which
causes the advance). I
have taken this issue into my todo list.

Ciao, Mike


re: Whistler

From: "Mike Lischke" [public@l...]
Date: Sun May 27, 2001 2:50 pm
Subject: RE: [VirtualTreeview] Whistler

Werner,

> I am not sure why you want to remove an already built-in feature which is
> used at least by me and someone else.

The reason is that I suspect alone loading the FlatSB DLL causes already
trouble because it hooks
into the scroll bar processing of the system (for the particular application).

> And there is one more point: it seems that only the new flat scrollbar
> control allows more than 16 bit (signed) as range value. I just ran into
> the 32000 pixel range limit of a TScrollingWinControl descendant :(

This is strange. There is some measure to make it possible to scroll more than
this amount. See also
TControlScrollBar.ScrollMessage (which is used in TScrollingWinControl). I have
used similar code
for VT.

> Part of my UI is based on the encarta style (you may know the flatstyle
> components). This must not necessarily look black-on-brownish... If you
> say that "even if the original APIs were used", "scroll bars are totally
> different" I don't see the gain for this action...

Let me iterate: I will examine the OS further. I have currently only Beta 1
installed. Next week I
will install the second beta and try again. Unfortunately, I cannot get Delphi
running on the first
beta because the object inspector is nearly unusable for some reasons (only a
very small part of it
is shown). Let me see what the beta 2 brings for improvements and then I will
decide. If I can get
everything working even with the FlatSB APIs then I will keep'em otherwise they
will be fired.

Ciao, Mike


re: DragManager

From: "Mike Lischke" [public@l...]
Date: Sun May 27, 2001 2:50 pm
Subject: RE: [VirtualTreeview] DragManager

> I think that the compiler doesn't _AddRef/_Release an interface parameter is
> declared as "const", since the calling function is not supposed to modify
> (and release) the pointer.

Being defined as "const" has nothing to do with the reference counting scheme.
The reference is passed and if it is stored somewhere (as in RegisterDragDrop)
then the counter will be increased regardless of whether the interface
reference can be modified or not.

> But what if RegisterDragDrop did something like: AddRef/Release/Addref ?
> Wouldn't this cause a problem?

Why should this cause a problem? Indeed does RegisterDragDrop increase the
reference count. This is what it is supposed to do. Not VT uses the interface
but the OLE drag system and if it does no longer need the interface (e.g. when
RevokeDragDrop has been called) then the ref counter is decremented and if it
reaches 0 then the interface is released. There is no need at all for VT to
manipulate this mechanism.

> But i think that COM
> demands that you should never pass an interface pointer to an object with a
> RefCount of 0, actually an object should have a zero refcount only just
> prior to its destruction, without having any outstanding references.

You should think so that such an interface is never created without being used
somewhere (which will initially increase the ref counter).

> Sorry, call me purist (or any other name you like), but i've worked a lot
> with Delphi and COM interfaces (and shot myself in the foot many times)
> that's why i'm a little bit paranoid about them.

The problem with COM is (and that's what *I* had to find out) that you can
easily shot yourself by being too paranoid and try to duplicate the work Delphi
does already. You should not touch the ref count explicitely under Delphi. This
is the recommendation of Borland and I found this to be true.

Ciao, Mike


re: DragManager

From: "Mike Lischke" [public@l...]
Date: Sun May 27, 2001 2:50 pm
Subject: RE: [VirtualTreeview] DragManager

Hi Kostas,

> I am not feeling very comfortable with the idea of having a
> TInterfacedObject descendant constructor's result stored into an object
> pointer. If you do this you have a pointer to an interfaced object with a
> refcount of 0, which can self destruct at any time. This is OK if you use it
> by calling a property getter that creates it if it has been destroyed, but
> if there is an _AddRef/_Release pair inside code you don't control (like
> inside DoDragDrop) it would be possible for the object to go away right
> under your feet.

This stuff is something I have reworked many times until I found a reliable and
working version (the one used currently). COM and interfaces is something which
is not trivial. You have to consider many things (lifetime etc.) and with
Delphi also the actions going on behind the scenes (reference counting). This
was meant to ease the life of the programmer but causes often some extra
trouble.

The drag manager creation is always accompanied by some code which uses the
class. This code will ensure that the class has always a reference count of at
least 1. The creation code might look strange to you because the interface
still contains a reference count of 0 after creation. But this is not more
dangerous as any other class creation code. The problem with an extra
_AddRef/_Release (which Borland has not without good reasons "hidden" by
preceding the calls by underlines) is that the class persists where it should
be destroyed already. I cannot tell you all the ways I went through and why I
finally ended up where I am with the drag manager class, but you can be assured
it is exactly as it should be.

Ciao, Mike


re: Incremental Searching

From: "Mike Lischke" [public@l...]
Date: Sun May 27, 2001 2:50 pm
Subject: RE: [VirtualTreeview] Incremental Searching

Hi Werner,

> > ab.txt
> > abc.txt
> > abcd.txt
> > abcde.txt
> >
> > then of course abcd.txt will be selected (or abcde.txt if the selection is
> > already on abcd.txt).
>
> Well. This discussion is purely academically but I don't mind.

Huh? What is academical with this question? I want working incremental search
and try to make clear
that it is difficult to do the same like Explorer does, because MS used some
tricks for this
behaviour which in turn makes something else not working. This is IMO very
practical discussion and
important too.

> Assume s = old accumulated search text, c = new key code
>
> (1) check if any file matches s + c, beginning with the file after the focused
> one. if matching file found -> focus it, go to (4)
> (2) check if any file beginns with c, beginning with the file after the
focused
> one. if matching file found -> s := s + c, focus it, go to (4)
> (3) no matching file found, beep, maybe s := ''
> (4) ready

I also considered this simple algorithm but it has a main disadvantage: it
requires at times to
search all nodes twice. Another point is that the algo is too simple. It does
not reflect the
reality. Assume the case of the 5 files with names build of 'x' letters like:

x.txt
xx.txt
xxx.txt
xxxx.txt

and with the focus on the entry xxx.txt. The search buffer is empty and you
press 'x'. Now search
starts with xxxx.txt and finds this entry as new focused item. The buffer is
now 'x'.
Another 'x' key press starts search with x.txt but this entry does not match
buffer + key = 'xx' so
search should continue with next entry xx.txt and find it. Explorer however
will find x.txt and with
the third 'x' press xx.txt etc. This is totally wrong if I expect with e.g. the
third pressed 'x' to
find xxx.txt (in our example Explorer will find xx.txt).

Unfortunately the theory that Explorer first tries to find another file which
begins with the newly
pressed key is also wrong, so I have no idea what they actually do there for
the way Explorer works
(and whether it is necessary to mimic this behavior).

Ciao, Mike

 | Replies | Author | Date
2037 | Re: Incremental Searching | [ebolefeysot@b...] | Mon 5/28/2001


re: Background color in VT

From: "Mike Lischke" [public@l...]
Date: Sun May 27, 2001 2:51 pm
Subject: RE: [VirtualTreeview] Background color in VT

Hi Kent,

> I noticed a little anomaly with the background color in VT. The little "+"
and
> "-" boxes to the left of tree nodes that have children are always drawn with a
> background color of clWindow.

Yes, I know, but I needed it so (e.g. for the Object Inspector clone I wrote).
Is this really a
problem for you?

Ciao, Mike


re: Right mouse button in header

From: "Mike Lischke" [public@l...]
Date: Sun May 27, 2001 2:51 pm
Subject: RE: [VirtualTreeview] Right mouse button in header

Hi Cyril,

> It seems that the WM_NCRBUTTONDOWN message is not handled in
> TVTHeader.HandleMessage or do I miss something ?

You are right, thank you for pointing it out. This message has been forgotten.
Fixed.

Ciao, Mike


re: Background color in VT

From: "Mike Lischke" [public@l...]
Date: Sun May 27, 2001 2:51 pm
Subject: RE: [VirtualTreeview] Background color in VT

> I just came across another problem. The "+" and "-" characters inside the
buttons
> are drawn with the VT's main font color set a design time. However, if I
change the
> vt.font.color at run time, the buttons do not update with the new color.

Yes, there was a message handler missing. I have implemented CM_FONTCHANGED now.

Ciao, Mike


re: Why use HTMLHelp?

From: "Mike Lischke" [public@l...]
Date: Sun May 27, 2001 2:51 pm
Subject: RE: [VirtualTreeview] Why use HTMLHelp?

Hi Youngpup,

> Why is all the help (well, BOTH of the help files) in Compiled-HTML
> Help format. Can Delphi link to context-sensitive HTMLHelp and i
> don't know it?

HTML help is much more flexible than the old style Windows help and also the
only format supported
by any newer MS product. Borland has not yet done the switch to HTML help. So
you cannot get help
from compiled HTML from within the IDE. For programs however there are well
known solutions to use
chm files.

Ciao, Mike


re: Which version should I use?

From: "Mike Lischke" [public@l...]
Date: Sun May 27, 2001 2:51 pm
Subject: RE: [VirtualTreeview] Which version should I use?

Hi Koen,

> I'm new to VirtualTreeView, and I'm not sure whether I should start
> using the version on the website (v1.31) or the one found in the
> groups here, v2.4. Which one should I use?

I recommend version 2.4 from YG. This version is very stable and fixes a lot of
little bugs and
leaks of 1.31. Additonally, there is no sense to get used to the old version
and its event parameter
lists. I have changed some of them and will publish in a couple of weeks the
new version, so you
would have to change code you just wrote when starting with 1.31.

Ciao, Mike


re: Question about paint

From: "Mike Lischke" [public@l...]
Date: Sun May 27, 2001 2:51 pm
Subject: RE: [VirtualTreeview] Question about paint

Hi Kostas,

> Let's suppose that i wanted to paint formatted text (imagine RTF for
> instance) for a node/column.
> This involves 2 things:
>
> 1. Actually painting the text
> 2. Altering the rectangle that is considered "content rectangle" for the
> cell (especially the main column) so that it reflects the extent of the
> formatted text, which could be different than what it would be if the text
> was plain and that mouse clicks work correctly.

For such kind of output modifications it is better to derive a new control or
use TVirtualDrawTree.
The reason is that the string tree does already too much (including content
width calculation) which
you cannot simply override.

Ciao, Mike


re: Small bug and toggle animation

From: "Mike Lischke" [public@l...]
Date: Sun May 27, 2001 2:51 pm
Subject: RE: [VirtualTreeview] Small bug and toggle animation

Hi Werner,

> - the first is a bug. You can scroll up one page with ctrl+page-up but only
one
> node down with ctrl+page-down...

Not reproducable. Works fine and as it should in my demos.

> The problem went away when I added two checks for (FUpdateCount = 0) in
ToggleNode
> to the 'if' before collapse and expand animation. Man, was I relieved. Elvis
> entered the building again :) Can I have this in the distribution?

Yes, no problem. Fixed.

> I'd like to have no horz. scrolling on ctrl end/home if fullrowselect is on.

Changed as you wish :o)

Ciao, Mike


re: How to change a color?

From: "Mike Lischke" [public@l...]
Date: Sun May 27, 2001 2:51 pm
Subject: RE: [VirtualTreeview] How to change a color?

Hi Danil,

> Then i have static text enabled with grid mode, the static text is
> shown as black then the node is selected, making it almost
> unreadable. How can i change that color?

Use OnPaintText and check for ttStatic. Change the font color of the given
canvas.

Ciao, Mike


re: Subtract key expands nodes

From: "Mike Lischke" [public@l...]
Date: Sun May 27, 2001 2:53 pm
Subject: RE: [VirtualTreeview] Subtract key expands nodes

Hi Bohuslav,

> "Subtract" key expands nodes, just like "Add" key. (With shift key it is
> OK.) I think it is error.

Yes you are right. It has to do with the incremental search feature which does
not filter hotkeys. I
will fix this soon.

Ciao, Mike


re: New file uploaded to VirtualTreeview

From: "Mike Lischke" [public@l...]
Date: Sun May 27, 2001 2:56 pm
Subject: Re: New file uploaded to VirtualTreeview

> File : /VET_V1.1.17_Help.zip
> Uploaded by : [jimdk@m...]
> Description : Partially completed Help for VirtualExplorerTree

Jim,

the content of this file cannot be used as it is. I recommend that
you upload the chm file instead of the raw source files (without the
actual documentation files btw.).

Ciao, Mike

 | Replies | Author | Date
2026 | Re: New file uploaded to VirtualTreeview | Mike Lischke | Sun 5/27/2001
2045 | Re: New file uploaded to VirtualTreeview | Jim Kueneman | Mon 5/28/2001
2047 | Re: New file uploaded to VirtualTreeview | Mike Lischke | Mon 5/28/2001
2044 | Re: New file uploaded to VirtualTreeview | Jim Kueneman | Mon 5/28/2001
2046 | Re: New file uploaded to VirtualTreeview | Mike Lischke | Mon 5/28/2001
2054 | Re: New file.. also RightExtent Calculation | Jim Kueneman | Mon 5/28/2001


re: Re: New file uploaded to VirtualTreeview

From: "Mike Lischke" [public@l...]
Date: Sun May 27, 2001 3:24 pm
Subject: RE: [VirtualTreeview] Re: New file uploaded to VirtualTreeview

> the content of this file cannot be used as it is. I recommend that
> you upload the chm file instead of the raw source files (without the
> actual documentation files btw.).

Btw: what would you prefer: to have VET as integral part of the main
distribution or as a separate
distribution like the IBO and DB trees?

Ciao, Mike

 | Replies | Author | Date
2045 | Re: New file uploaded to VirtualTreeview | Jim Kueneman | Mon 5/28/2001
2047 | Re: New file uploaded to VirtualTreeview | Mike Lischke | Mon 5/28/2001


re: Incremental Searching

From: Werner Lehmann [wl@b...]
Date: Sun May 27, 2001 4:58 pm
Subject: Re: [VirtualTreeview] Incremental Searching

Hi Mike,

hope you have enjoyed your short vacation.

Mike Lischke wrote:
>
> > > ab.txt
> > > abc.txt
> > > abcd.txt
> > > abcde.txt
> > >
> > > then of course abcd.txt will be selected (or abcde.txt if the selection is
> > > already on abcd.txt).
> >
> > Well. This discussion is purely academically but I don't mind.
>
> Huh? What is academical with this question? I want working incremental search
and try to make clear
> that it is difficult to do the same like Explorer does, because MS used some
tricks for this
> behaviour which in turn makes something else not working. This is IMO very
practical discussion and
> important too.

Ok. Let me put it this way: you said something like you don't want to change the
current behaviour for the time being. And for me it's not exactly what I call a
top priority. Would say we have already something satisfactory.

> > Assume s = old accumulated search text, c = new key code
> >
> > (1) check if any file matches s + c, beginning with the file after the
focused
> > one. if matching file found -> focus it, go to (4)
> > (2) check if any file beginns with c, beginning with the file after the
focused
> > one. if matching file found -> s := s + c, focus it, go to (4)
> > (3) no matching file found, beep, maybe s := ''
> > (4) ready
>
> I also considered this simple algorithm but it has a main disadvantage: it
requires at times to
> search all nodes twice. Another point is that the algo is too simple. It does
not reflect the
> reality. Assume the case of the 5 files with names build of 'x' letters like:
>
> x.txt
> xx.txt
> xxx.txt
> xxxx.txt
>
> and with the focus on the entry xxx.txt. The search buffer is empty and you
press 'x'. Now search
> starts with xxxx.txt and finds this entry as new focused item. The buffer is
now 'x'.
> Another 'x' key press starts search with x.txt but this entry does not match
buffer + key = 'xx' so
> search should continue with next entry xx.txt and find it. Explorer however
will find x.txt and with
> the third 'x' press xx.txt etc. This is totally wrong if I expect with e.g.
the third pressed 'x' to
> find xxx.txt (in our example Explorer will find xx.txt).
>
> Unfortunately the theory that Explorer first tries to find another file which
begins with the newly
> pressed key is also wrong, so I have no idea what they actually do there for
the way Explorer works
> (and whether it is necessary to mimic this behavior).

I have the impression that the algorithm depends on the length of the buffer.
Specifically,
if less than two keys are in the buffer (0 or 1 chars) the algorithms prefers
to find the
next file beginning with the new key *iff* the new key is the same as the
single char already
in the buffer. If this condition is false a similar approach to the described
above seems to
be taken.

Whether to mimic this: I like being able to browse through all 'x'-files very
fast. But as I
said earlier the status quo is ok by me except you see a painless (quick) way
to implement it.
Furthermore I must admit that I was inspired by delphi's inc-search and
duplicated that behaviour
in my app. Ctrl+E, Text in Statusbar, Search anywhere in the node text...
nothing which can be
done solely on component level.

Werner

 | Replies | Author | Date
2117 | Re: Incremental Searching | Mike Lischke | Sat 6/2/2001


re: Whistler

From: Werner Lehmann [wl@b...]
Date: Sun May 27, 2001 5:30 pm
Subject: Re: [VirtualTreeview] Whistler

Mike Lischke wrote:
>
> > I am not sure why you want to remove an already built-in feature which is
> > used at least by me and someone else.
>
> The reason is that I suspect alone loading the FlatSB DLL causes already
trouble because it hooks
> into the scroll bar processing of the system (for the particular application).

Can you elaborate more what trouble this is? Has MS warned about the usage of
this?

> > And there is one more point: it seems that only the new flat scrollbar
> > control allows more than 16 bit (signed) as range value. I just ran into
> > the 32000 pixel range limit of a TScrollingWinControl descendant :(
>
> This is strange. There is some measure to make it possible to scroll more
than this amount. See also
> TControlScrollBar.ScrollMessage (which is used in TScrollingWinControl). I
have used similar code
> for VT.

Yes I saw that. You surely mean to use the FlatSB API to know the real
position when a WM_xSCROLL message arrives. But this involves the FlatSB
still. I had a component basically with a paintbox inside a
tscrollingwincontrol.
Late in the development of this component I noticed (or better said: someone
informed me about it) that the painted content was clipped at some point
with certain settings that made this content very large (scaling). On
further investigation it turned out that the scrolling range was limited to
32767. The solution was to switch to a TCustomControl. At first I had to
find out how the scrolling was handled at all and did not use FlatSB. I
may be at mistake here but I *believe* the problem surfaced even then.
Of course it was easy to switch to FlatSB which certainly does not show
this problem. I needed it anyway since I needed the flat appearance as
an option. To overcome this problem which is well known according to some
usenet articles I have implemented a new base class TScrollControl which
handles all the scrolling itself and only needs an overriden Paint method
(already with coordinate transformation built into the canvas parameter of
.Paint). Works very well now at scrolling ranges far over 32767.

> > Part of my UI is based on the encarta style (you may know the flatstyle
> > components). This must not necessarily look black-on-brownish... If you
> > say that "even if the original APIs were used", "scroll bars are totally
> > different" I don't see the gain for this action...
>
> Let me iterate: I will examine the OS further. I have currently only Beta 1
installed. Next week I
> will install the second beta and try again. Unfortunately, I cannot get
Delphi running on the first
> beta because the object inspector is nearly unusable for some reasons (only a
very small part of it
> is shown). Let me see what the beta 2 brings for improvements and then I will
decide. If I can get
> everything working even with the FlatSB APIs then I will keep'em otherwise
they will be fired.

This statement leaves not much room for an open-ended discussion. I have added
an user option for flat/regular scrollbar switching. Personally I must say the
regular style does not fit well. The main window is made up of flat
'subwindows',
similar to the one you see in Win2k explorer with a treeview in it (with a
caption
and a close-X at right top). While explorer itself uses the regular scrollbars I
find the flat (not hottrack) ones to fit much better.

If you decide to drop flatsb support I am more or less forced to stay with
latest
flatsb version. I regret that of course but most features are in it, most bugs
fixed...

Regards,
Werner

 | Replies | Author | Date
2119 | Re: Whistler | Mike Lischke | Sat 6/2/2001


re: Re: need help with DoInitNode and DoInitChi ldre n

From: Werner Lehmann [wl@b...]
Date: Sun May 27, 2001 5:36 pm
Subject: Re: [VirtualTreeview] Re: need help with DoInitNode and DoInitChi ldre n

Mike Lischke wrote:
>
> This would not be the way to do this kind of initialization. What you usually
have is one query. Use this query to determine the number of child nodes
(RecordCount). If you are dealing with large data sets then it might be
beneficial to use a special query only to do a "select count(*) from ..." to
determine the count.
>
> In OnInitNode you can then use the normal query to access individual records
and read the data you need. This is rather simple. The only problem I see here
is that it is difficult to address a certain record from an index. Paradox
supports this kind of addressing but SQL servers do not and that makes it
necessary to fill the nodes differently unless somebody comes up with another
indentification parameter for OnInitNode. Since almost all data of a node is
actually stored in the application's data structures it is difficulat for VT to
identify a particular node to be initialized. The ParentNode/Node.Index idea
was the best one I was able to find. Perhaps there is a better approach? For
SQL databases I have used the .First/.MoveBy combination to seek to a
particular record, but this is not optimal.

First+MoveBy is expensive (performancewise). MoveBy has no built-in magic,
it just iterates the dataset. While it is true that most SQL database do
not support a recordno like Paradox does there is at least for Oracle a
workaround: the virtual column ROWNUM which can be used for a Top-N query,
can also be used to number the rows of the result set. With this number
you can easily locate any needed record without superfluous operations
done with first and moveby.

A word of warning: for my taste it is dangerous to rely on a recordno,
in whatever flavour it comes. If records are re-ordered, inserted, deleted,
the recordno also changes. Whenever possible the primary key value should
be used to identify any record, not the recordno. You probably know that
but I wanted to point it out explicitly.

Werner


re: Small bug and toggle animation

From: Werner Lehmann [wl@b...]
Date: Sun May 27, 2001 5:41 pm
Subject: Re: [VirtualTreeview] Small bug and toggle animation

Mike Lischke wrote:
>
> > - the first is a bug. You can scroll up one page with ctrl+page-up but only
one
> > node down with ctrl+page-down...
>
> Not reproducable. Works fine and as it should in my demos.

Ok, I see that more steps are needed to reproduce: if I try it right away
it works. But if I select the last node, then ctrl+page-up (1 or more times)
I cannot get back with ctrl+page-down (no effect at all). If the second to
last node is selected ctrl+page-down will scroll one node down each time
instead.

> > I'd like to have no horz. scrolling on ctrl end/home if fullrowselect is on.
>
> Changed as you wish :o)

Thank you.

Regards,
Werner

 | Replies | Author | Date
2116 | Re: Small bug and toggle animation | Mike Lischke | Sat 6/2/2001


re: Background color in VT

From: Kent Briggs [kbriggs@b...]
Date: Sun May 27, 2001 6:07 pm
Subject: Re: [VirtualTreeview] Background color in VT

Mike Lischke wrote:

> Hi Kent,
>
> > I noticed a little anomaly with the background color in VT. The little "+"
and
> > "-" boxes to the left of tree nodes that have children are always drawn
with a
> > background color of clWindow.
>
> Yes, I know, but I needed it so (e.g. for the Object Inspector clone I
wrote). Is this really a
> problem for you?

No problem, I'm using the following workaround to fix the problem:

buttonstyle:=bstriangle;
buttonstyle:=bsrectangle;

--
Kent Briggs, [kbriggs@b...]
Briggs Softworks, http://www.briggsoft.com


adding grouping feature

From: [mdissel@h...]
Date: Sun May 27, 2001 7:34 pm
Subject: adding grouping feature

Hello

I want to make it possible to group by a column (like in Outlook
(Express) etc.). (and later group by multiple columns..)

Design:
- make grouping column the first column
- sort grouping column
- adjust the paint cycle:
. if value in grouping column is different than the previous one,
NEW GROUP:
insert temp node toplevel with 3d look
node = level + 1 (indent the node)
. if caption in grouping column is the same than the previous one,
node = level + 1 (indent the node)

what is the best approch/events/methods for the last step?

Regards,

Marco

 | Replies | Author | Date
2033 | Re: adding grouping feature | Werner Lehmann | Sun 5/27/2001
2034 | Re: adding grouping feature | =?iso-8859-1?q?Stefan=20Muell | Sun 5/27/2001
2049 | Re: adding grouping feature | [mdissel@h...] | Mon 5/28/2001
2051 | Re: adding grouping feature | [mdissel@h...] | Mon 5/28/2001
2055 | Re: adding grouping feature | Werner Lehmann | Tue 5/29/2001
2069 | Re: adding grouping feature | [mdissel@h...] | Wed 5/30/2001


re: adding grouping feature

From: Werner Lehmann [wl@b...]
Date: Sun May 27, 2001 8:17 pm
Subject: Re: [VirtualTreeview] adding grouping feature

Marco,

you have a lot of work in front of you if you really want to add
this feature. Looks like a job for a descendant of the virtual
stringtree. The problem is only, that the tree can not be virtual
anymore if this feature should work. The text for all nodes (at
least for the grouped columns) must be known. Ok this might not
be a real problem, currently I am using none of my VTrees in that
virtual sense. But there is another problem: usually this grouping
feature is only applied to flat lists, not trees. The grouping
itself builts the tree. Therefore you will have to deal with that
(tree within tree) or restrict usage to list only. Methods like
AddChild etc. must not be used anymore (except if the parent node
is nil). Since this method is public in the base tree already you
cannot hide it. The same is true for other methods.

[mdissel@h...] wrote:
>
> I want to make it possible to group by a column (like in Outlook
> (Express) etc.). (and later group by multiple columns..)
>
> Design:
> - make grouping column the first column
> - sort grouping column
> - adjust the paint cycle:
> . if value in grouping column is different than the previous one,
> NEW GROUP:
> insert temp node toplevel with 3d look
> node = level + 1 (indent the node)
> . if caption in grouping column is the same than the previous one,
> node = level + 1 (indent the node)
>
> what is the best approch/events/methods for the last step?

I would expect that this is not a job for the paint cycle. Especially
you should not add a (temp) toplevel node inside of Paint. I would
introduce a new method to add list items. In this method the value(s)
of the grouped column(s) have to be examined and the new node must
be inserted under the appropriate grouping value (the one with the
3D look).

Lots of discouraging words. If you still want to do it... would be
a nice addition to the VTree 'suite' :)

Werner

 | Replies | Author | Date
2034 | Re: adding grouping feature | =?iso-8859-1?q?Stefan=20Muell | Sun 5/27/2001
2049 | Re: adding grouping feature | [mdissel@h...] | Mon 5/28/2001
2051 | Re: adding grouping feature | [mdissel@h...] | Mon 5/28/2001


re: adding grouping feature

From: Stefan Mueller [muellers@s...]
Date: Sun May 27, 2001 11:26 pm
Subject: Re: [VirtualTreeview] adding grouping feature

... maybe you want to have a look at another component for this -
something like www.devexpress.com (db)tree which has such functionality
already built in (outlook style, drag&drop grouping/sorting and
customization of column headers, etc) ?!

cheers stefan

--- Werner Lehmann [wl@b...] wrote: > Marco,
>
> you have a lot of work in front of you if you really want to add
> this feature. Looks like a job for a descendant of the virtual
> stringtree. The problem is only, that the tree can not be virtual
> anymore if this feature should work. The text for all nodes (at
> least for the grouped columns) must be known. Ok this might not
> be a real problem, currently I am using none of my VTrees in that
> virtual sense. But there is another problem: usually this grouping
> feature is only applied to flat lists, not trees. The grouping
> itself builts the tree. Therefore you will have to deal with that
> (tree within tree) or restrict usage to list only. Methods like
> AddChild etc. must not be used anymore (except if the parent node
> is nil). Since this method is public in the base tree already you
> cannot hide it. The same is true for other methods.
>
> [mdissel@h...] wrote:
> >
> > I want to make it possible to group by a column (like in Outlook
> > (Express) etc.). (and later group by multiple columns..)
> >
> > Design:
> > - make grouping column the first column
> > - sort grouping column
> > - adjust the paint cycle:
> > . if value in grouping column is different than the previous one,
> > NEW GROUP:
> > insert temp node toplevel with 3d look
> > node = level + 1 (indent the node)
> > . if caption in grouping column is the same than the previous one,
> > node = level + 1 (indent the node)
> >
> > what is the best approch/events/methods for the last step?
>
> I would expect that this is not a job for the paint cycle. Especially
> you should not add a (temp) toplevel node inside of Paint. I would
> introduce a new method to add list items. In this method the value(s)
> of the grouped column(s) have to be examined and the new node must
> be inserted under the appropriate grouping value (the one with the
> 3D look).
>
> Lots of discouraging words. If you still want to do it... would be
> a nice addition to the VTree 'suite' :)
>
> Werner
>
>
>
> To unsubscribe from this group, send an email to:
> [VirtualTreeview-unsubscribe@egroups.com
>
>
>
> Your use of Yahoo! Groups is subject to
> http://docs.yahoo.com/info/terms/
>
>
>
>

_____________________________________________________________________________
http://messenger.yahoo.com.au - Yahoo! Messenger
- Voice chat, mail alerts, stock quotes and favourite news and lots more!

Replies Author Date


re: Drag N Drop from tree

From: Michael Leaver [MJLeaver@n...]
Date: Mon May 28, 2001 2:35 am
Subject: RE: [VirtualTreeview] Drag N Drop from tree

Hi, I'm getting a bit stuck on this. Appreciate it if you could
clear up a couple of things:

- Where does DragContainer (in RenderData) come from? Where is
it (and how is it) initialised?

- Where is GetPIDLForPath?

Thanks

-----Original Message-----
From: Teus de Jong [mailto:[teusjdejong@p...]]
Sent: Thursday, May 24, 2001 12:01 AM
To: VirtualTreeview@yahoogroups.com
Subject: Re: [VirtualTreeview] Drag N Drop from tree

> More importantly, could some kind person point me in the direction of
> source code to get drag and drop *to* the explorer working. I've
> looked in the messages, and in the files, but I cannot find any
> examples.
>

Here is a routine that I use in a sample component that will be on Mike's VT
Page in the near future.

The first is a general routine that can be called by overriding VT's
DORenderdata.

The other one's are routines that fill the memory structure with what is
requested.

You have to put the following statements in an initialization routine:
CF_IDLIST:=RegisterClipboardFormat(CFSTR_SHELLIDLIST);
CF_PrefDrop:=RegisterClipboardFormat(CFSTR_PREFERREDDROPEFFECT);
CF_Filename:=RegisterClipboardFormat(CFSTR_FILENAME);

Furthermore, make your own DragDropManager by overriding VT's one, somewhat
like this:

// DragDropmanager with FileOleFormats
// because we introduce no new things except a harmless array,
// it will be freed by VT
TVLDragDropManager=class(TVTDragDropmanager)
private
protected
public
FDropFormats: array[0..3] of UInt;
function RenderData(FormatEtc: TFormatEtc; var StgMedium: TStgMedium):
HResult; override;
procedure SetOLEFormats(Formats: TOLEFormats); override;
end;

{TVLDragDropManager}
function TVLDragDropManager.RenderData(FormatEtc: TFormatEtc; var StgMedium:
TStgMedium): HResult;
var
t: integer;
IsFileFormat: Boolean;
begin
// is it one of our file formats?
IsFileFormat:=false;
for t:=0 to Length(FDropFormats)-1 do
if formatetc.cfFormat=FDropFormats[t] then
begin
IsFileFormat:=true;
break;
end;
// if yes, then deliver the goods
if IsFileFormat and assigned(DragContainer.DragOwner)
and (DragContainer.DragOwner is TBaseFileViewer) then
result:=DoRenderdata(TVTFilelist(DragContainer.Dragowner), FormatEtc,
StgMedium)
// else let VT do it
else
result:=inherited renderdata(FormatEtc, StgMedium);
end;

// Add our own OLEFormats
procedure TVLDragDropManager.SetOLEFormats(Formats: TOLEFormats);
var
t: integer;
begin
inherited;
for t:=0 to Length(FDropFormats)-1 do
begin
FileOleFormat.cfFormat := FDropFormats[t];
FormatEtcList.Add(FileOleFormat);
end;
end;

Here are the other routines.

// function Renderdata
// overrides VT's Dorenderdata
function DoRenderdata(aTree: TBaseFileViewer; FormatEtc: TFormatEtc; var
StgMedium: TStgMedium): HResult;
var
pt: TPoint;
t: integer;
eff: UInt;
TheFormat: UINT;
begin
TheFormat:=0;
with aTree.FVLDragManager do
for t:=0 to Length(FDropFormats)-1 do
if formatetc.cfFormat=FDropFormats[t] then
begin
TheFormat:=formatetc.cfFormat;
break;
end;
if (TheFormat<>0) then
begin
// deliver the data in the requested format
StgMedium.hGlobal:=CreateHDrop(DragContainer, FormatEtc.cfFormat, eff,
pt, true);
if StgMedium.hGlobal = 0 then
result:=E_OUTOFMEMORY
else
begin
StgMedium.tymed := TYMED_HGLOBAL;
StgMedium.unkForRelease := nil;
result := S_OK;
end;
end
else
result := DV_E_FORMATETC;
end;
end;

{Drag Drop}
type
TFileRec=record
offset: UINT;
PIDL: PItemIDList;
Size: UINT;
end;
PFileRec=^TFileRec;

// make a idlist for drag/drop
procedure MakePidlList(Files: TStringList; PIDLList: TList);
var
Filerec, PrevFilerec: PFileRec;
StartPIDL: UINT;
t: integer;
begin
// StartPIDL: first PIDL; this is located after cidl and offsets
// cidl: 1 UINT; first offset=Directory pidl offset: 1 UINT
// offset for all files: file.count UINTs
StartPIDL:=SizeOf(UINT)*2+Files.Count*SizeOf(UINT);
// alloc FileRec for directory
New(FileRec);
FileRec^.PIDL:=GetPIDLForPath(ExtractFilePath(files[0]), true);
if FileRec^.PIDL=nil then
begin
Dispose(FileRec);
exit;
end;
FileRec^.offset:=StartPIDL;
FileRec^.Size:=GetPIDLSize(FileRec^.PIDL);
PIDLList.Add(FileRec);

// get FileRec's (PIDLs) for files}
for t:=0 to files.Count-1 do
begin
New(FileRec);
FileRec^.PIDL:=GetPIDLForPath(files[t], False);
if FileRec^.PIDL=nil then
begin
Dispose(Filerec);
exit;
end;
// offset = previous offset + previous size
// TList has one element more (the folder) then files,
// so t does the job
PrevFileRec:=PFileRec(PIDLList[t]);
FileRec^.offset:=PrevFileRec^.offset+PrevFileRec^.Size;
FileRec^.Size:=UINT(GetPIDLSize(FileRec^.PIDL));
PIDLList.Add(FileRec);
end;
end;

// clear a the Pidllist
procedure Clearpidllist(PidlList: TList);
var t: integer;
begin
for t:=0 to PIDLList.Count-1 do begin
FreePIDL(PFileRec(PIDLList[t]).PIDL);
// free pidl
Dispose(PFileRec(PIDLList[t]));
end;
end;

// CreateHdrop: make drag/drop object depending on the type requested
function CreateHDrop(Files: TStringList; dt, ef: UINT; pt: TPoint;
InClientArea: Boolean): HGlobal;
var
DropFiles : PDropFiles;
c: PChar;
Ida: PIDA;
PIDLList: TList;
Filerec: PFileRec;
TotalSize: UINT;
t, strlength: integer;
MyPtr: ^Byte;
p: PINT;
s: string;

begin
result := 0;
if dt = CF_filename then
begin
// a simple filename
s:=getShortFilename(Files[0]);
DragDropRoot:=getrootpath(Files[0]);
strlength:=Length(s)+1;
Result:=GlobalAlloc(GHND or GMEM_SHARE, strlength+1);
c:=GlobalLock(Result);
try
StrPCopy(c, s);
finally
GlobalUnlock(result);
end;
end
else
if dt=CF_HDROP then
begin
// standard dropfiles structure
strlength := 0;
DragDropRoot:=getrootpath(Files[0]);
for t := 0 to Files.Count-1 do
Inc(strlength, Length(Files[t])+1);
// alloocate memory
Result:=GlobalAlloc(GHND or GMEM_SHARE, SizeOf(TDropFiles)+strlength+1);
if Result=0 then
exit;
// lock memory handle
dropfiles:=GlobalLock(Result);
try
DropFiles.pFiles:=sizeof(TDropFiles);
DropFiles.pt:=pt;
DropFiles.fNC:=InClientArea;
DropFiles.fWide:=False;

// Copy file names to buffer; buffer starts at DropFiles +
DropFiles.pFiles..
c:=PChar(DropFiles)+SizeOf(TDropFiles);
for t := 0 to Files.Count-1 do
begin
StrPCopy (c, Files[t]);
c:=c+Length(Files[t])+1;
end;
finally
// unlock memory handle
GlobalUnlock(result);
end;
end
else
if dt=CF_IDLIST then
begin
// see Clipboard Formats for Shell Data Transfers and
// "Shell IDList Array" Format Win32Hlp
// | UINT size | Files.count+1 UINT offset | pidl for folder |
files.count pidl.s for files |
DragDropRoot:=getrootpath(Files[0]);
PIDLList:=TList.Create;
if PIDLList=nil then
exit;
try
MakePIDLLIst(files, PIDLLIst);
if PIDLList.Count=0 then
exit;
// Size to alloc
TotalSize:=PFileRec(PIDLList[PIDLList.Count-1])^.offset+
PFileRec(PIDLList[PIDLList.Count-1])^.Size;

// allocate
Result := GlobalAlloc(GHND or GMEM_SHARE, TotalSize);
if (Result = 0) then
exit;

// lock the handle
Ida:=GlobalLock(Result);
try
MyPtr:=pointer(Ida);

// plug files.count in cidl and inc offset
Ida^.cidl:=files.count;
Inc(MyPtr, SizeOf(UINT));

// plug in all offsets
for t:=0 to PIDLList.Count-1 do
begin
Move(PFileRec(PIDLList[t])^.offset, MyPtr^, SizeOf(UInt));
Inc(MyPtr, SizeOf(UINT));
end;

// plug in PIDL's
for t:=0 to PIDLList.count-1 do
begin
FileRec:=PFileRec(PIDLList[t]);
Move(FileRec^.PIDL^, MyPtr^, FileRec^.Size);
Inc(MyPtr, FileRec^.Size);
end;
finally
// unlock the handle
GlobalUnLock(Result);
end;
finally
// dispose of all records in Pidllist
ClearPidllist(PIDLLIst);
FreeAndNil(PidLList);
end;
end
else
if dt=CF_PrefDrop then
begin
Result:=GlobalAlloc(GHND or GMEM_SHARE, SizeOf(UInt));
p:=GlobalLock(Result);
try
p^:=ef;
finally
GlobalUnlock(Result);
end;
end;
end;

I hope this helps.

Teus de Jong.

To unsubscribe from this group, send an email to:
VirtualTreeview-unsubscribe@egroups.com

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/


re: Editors for BCB (for Ronald)

From: "Roland" [Beduerftig@S...]
Date: Mon May 28, 2001 7:06 am
Subject: Re: Editors for BCB (for Ronald)

Hi Alexander,

<snip>
> think you should delete FEdit in destructor (as Mike does)
>
> __fastcall TPropertyEdit::~TPropertyEdit(void)
> {
> // Release() will delete myself if counter == 0 !!!!!
> //Add this
> if(FEdit)
> delete FEdit;
> }

when I debug the demo you will stop twice, first in release() and
then in the destructor, Ok "if (FEdit) .. " would not produce an
error, because FEdit is NULL nothing happened.

> The second "bug" is when the last node is edited and you press
> VK_DOWN key the focus remains on the last node. Only after the
> second keypress it moves to the first node.

Ok I see it, the demo is too small, to handle this problems, I must
ask in the "Key-Handler" whether the last node is arrived.

have a good time
Roland


re: Incremental Searching

From: [ebolefeysot@b...]
Date: Mon May 28, 2001 7:28 am
Subject: Re: Incremental Searching

--- In [VirtualTreeview@y...], "Mike Lischke" [public@l...] wrote:

Hi

I did a search like explorer in my vtv class some month ago, and
assume that if the same char is pressed, it only count one. If you
press x, the buffer is filled with 'x'. Then if you press again 'x',
the buffer doesn't change, and the next file beginning with 'x' is
found.

You can look my implementation in a full freeware application at
www.romcenter.com. The incremental search is my own code, new vtv
search fonction is actually disabled.

--
Eric

> Hi Werner,
>
> > > ab.txt
> > > abc.txt
> > > abcd.txt
> > > abcde.txt
> > >
> > > then of course abcd.txt will be selected (or abcde.txt if the
selection is
> > > already on abcd.txt).
> >
> > Well. This discussion is purely academically but I don't mind.
>
> Huh? What is academical with this question? I want working
incremental search and try to make clear
> that it is difficult to do the same like Explorer does, because MS
used some tricks for this
> behaviour which in turn makes something else not working. This is
IMO very practical discussion and
> important too.
>
> > Assume s = old accumulated search text, c = new key code
> >
> > (1) check if any file matches s + c, beginning with the file
after the focused
> > one. if matching file found -> focus it, go to (4)
> > (2) check if any file beginns with c, beginning with the file
after the focused
> > one. if matching file found -> s := s + c, focus it, go to (4)
> > (3) no matching file found, beep, maybe s := ''
> > (4) ready
>
> I also considered this simple algorithm but it has a main
disadvantage: it requires at times to
> search all nodes twice. Another point is that the algo is too
simple. It does not reflect the
> reality. Assume the case of the 5 files with names build of 'x'
letters like:
>
> x.txt
> xx.txt
> xxx.txt
> xxxx.txt
>
> and with the focus on the entry xxx.txt. The search buffer is empty
and you press 'x'. Now search
> starts with xxxx.txt and finds this entry as new focused item. The
buffer is now 'x'.
> Another 'x' key press starts search with x.txt but this entry does
not match buffer + key = 'xx' so
> search should continue with next entry xx.txt and find it. Explorer
however will find x.txt and with
> the third 'x' press xx.txt etc. This is totally wrong if I expect
with e.g. the third pressed 'x' to
> find xxx.txt (in our example Explorer will find xx.txt).
>
> Unfortunately the theory that Explorer first tries to find another
file which begins with the newly
> pressed key is also wrong, so I have no idea what they actually do
there for the way Explorer works
> (and whether it is necessary to mimic this behavior).
>
> Ciao, Mike


How to tell if OLE drag drop is move, copy, etc.?

From: Michael Leaver [MJLeaver@n...]
Date: Mon May 28, 2001 7:47 am
Subject: How to tell if OLE drag drop is move, copy, etc.?

Having finally got dropping onto the explorer/desktop to work, I cannot
figure out how to tell what the drop effect was (move, copy, etc.). It
doesn't seem to be stored anywhere and I cannot see a method to
query it.

I tried using CFSTR_PERFORMEDDROPEFFECT but it was never
called.

Any ideas?

Thanks


re: need help with DoInitNode and DoInitChi ldre n

From: "Moritz Franckenstein" [franckenstein@a...]
Date: Mon May 28, 2001 8:49 am
Subject: Re: need help with DoInitNode and DoInitChi ldre n

mike,

> This would not be the way to do this kind of initialization. What
you usually have is one query. Use this query to determine the number
of child nodes (RecordCount). If you are dealing with large data sets
then it might be beneficial to use a special query only to do
a "select count(*) from ..." to determine the count.
>
> In OnInitNode you can then use the normal query to access
individual records and read the data you need. This is rather simple.
The only problem I see here is that it is difficult to address a
certain record from an index. Paradox supports this kind of
addressing but SQL servers do not and that makes it necessary to fill
the nodes differently unless somebody comes up with another
indentification parameter for OnInitNode. Since almost all data of a
>
but where to i hold the recordset between two OnInitNode calls? in
the parent node? that not so nice. and doing the request again and
again in every OnInitNode would also be much2slow.

-moritz

 | Replies | Author | Date
2040 | Re: need help with DoInitNode and DoInitChi ldre | Mike Lischke | Mon 5/28/2001


re: Re: need help with DoInitNode and DoInitChi ldre n

From: "Mike Lischke" [public@l...]
Date: Mon May 28, 2001 9:28 am
Subject: RE: [VirtualTreeview] Re: need help with DoInitNode and DoInitChi ldre n

Moritz,

> but where to i hold the recordset between two OnInitNode calls? in
> the parent node? that not so nice. and doing the request again and
> again in every OnInitNode would also be much2slow.

I know, I know, this is all only suboptimal. If I'd a better solution I would
have it implemented
already. Databases and other stuff which cannot quickly be indexed are the
worst case for VT.
Somewhere everything has its limits...

Ciao, Mike


re: DragManager

From: GIANNAKOPOULOS KOSTAS [kyan@s...]
Date: Mon May 28, 2001 9:32 am
Subject: RE: [VirtualTreeview] DragManager

> Why should this cause a problem? Indeed does RegisterDragDrop
> increase the reference count. This is what it is supposed to
> do. Not VT uses the interface but the OLE drag system and if
> it does no longer need the interface (e.g. when
> RevokeDragDrop has been called) then the ref counter is
> decremented and if it reaches 0 then the interface is
> released. There is no need at all for VT to manipulate this mechanism.

Try this code:

procedure DoSomething(const Unk: IUnknown); // Notice that parameter Unk is
passed as "const"
var
X, Y: IUnknown;
begin
// Suppose that Unk.RefCount = 0 upon
entry.
X := Unk; // Unk._AddRef, Unk.RefCount = 1
X := nil; // Unk._Release, Unk.RefCount = 0, object
gets destroyed
Unk.QueryInterface(IUnknown, X); // Unk._AddRef, this will raise an
exception
end;

procedure TForm1.Button1Click(Sender: TObject);
var
Obj: TInterfacedObject; // Object pointer, not interface
pointer
begin
Obj := TInterfacedObject.Create; // Obj.RefCount is 0
DoSomething(Obj);
end;

Do you agree with me that procedure DoSomething() though simplistic is
standard delphi code and that it doesn't do any fancy or illegal stuff with
reference counting? When i execute this it raises an "Invalid pointer
operation" exception at the 3rd line of DoSomething(). This is due to the
fact that Unk's RefCount was 0 when it was passed to DoSomething(), so the
object is destroyed after the line "X := nil".

> Being defined as "const" has nothing to do with the reference
> counting scheme. The reference is passed and if it is stored
> somewhere (as in RegisterDragDrop) then the counter will be
> increased regardless of whether the interface reference can
> be modified or not.

Now if you delete the "const" in the declaration of the Unk parameter the
behaviour changes: No exception is raised and local variable O is not freed
until procedure DoSomething() exits. This is because the compiler generates
code that copies the Unk parameter in a stack variable, so an _AddRef is
performed. To see this put a breakpoint on the line "begin" in DoSomething()
and when the debugger stops open a CPU window. If the Unk parameter is
declared by value (no const) you will see a "CALL @IntfAddRef" instruction.
If the parameter is by ref (const) the instruction is no longer there.
This means thet the reference counting scheme HAS CHANGED when you changed
parameter Unk from ByRef ("const") to ByVal.
However, in both cases the local variable "O" points to a destroyed object
after call to DoSomething() returns, and you have successfully shot yourself
in the foot. This is why one MUST NOT pass around interface pointers that
point to objects with a refcount of zero.

Further more this is a quote from the Delphi help topic group "Common
Programming Tasks", topic "Using Reference Counting":

----------------------
Quote from Delphi Help
----------------------

Using reference counting
------------------------

Delphi provides most of the IUnknown memory management for you by its
implementation of interface querying and reference counting. Therefore, if
you have an object that lives and dies by its interfaces, you can easily use
reference counting by deriving from these classes. TInterfacedObject is the
non-CoClass that provides this behavior. If you decide to use reference
counting, then you must be careful to only hold the object as an interface
reference, and to be consistent in your reference counting. For example:

procedure beep(x: ITest);
function test_func()

var
y: ITest;
begin
y := TTest.Create; // because y is of type ITest, the reference
count is one
beep(y); // the act of calling the beep function increments the reference
count
// and then decrements it when it returns
y.something; // object is still here with a reference count of one
end;

This is the cleanest and safest approach to memory management; and if you
use TInterfacedObject it is handled automatically. If you do not follow this
rule, your object can unexpectedly disappear, as demonstrated in the
following code:

function test_func()

var
x: TTest;
begin
x := TTest.Create; // no count on the object yet
beep(x as ITest); // count is incremented by the act of calling beep
// and decremented when it returns
x.something; // surprise, the object is gone
end;

Note: In the examples above, the beep procedure, as it is declared, will
increment the reference count (call AddRef) on the parameter, whereas either
of the following declarations:

procedure beep(const x: ITest);

or

procedure beep(var x: ITest);

will not. These declarations generate smaller, faster code.
One case where you cannot use reference counting, because it cannot be
consistently applied, is if your object is a component or a control owned by
another component. In that case, you can still use interfaces, but you
should not use reference counting because the lifetime of the object is not
dictated by its interfaces.

---------
End Quote
---------

I rest my case!!!

<KY>


BCB5 under Win2k

From: "Roland" [Beduerftig@S...]
Date: Mon May 28, 2001 12:16 pm
Subject: BCB5 under Win2k

Hi All,

normally I work with BCB5 under WinNT4 Sp5 and all is Ok, and 2 weeks
ago I installed parallel on an other computer Win2k Sp1 to check,
whether all is perfect now I have a problem, my own program works Ok,
but when I quit BCB5 the Icon in the taskbar will deleted and all
seems Ok, when I try to start BCB5 again some error occurs.

I had a look into task manager and I see that BCB5 is deleted in the
taskbar, but not in the tasklist, when I kill BCB5 manuell in the
tasklist all thing work normal and I can start BCB5 again.

I switch CodeGuard ON to see whether I have and memory leakage, but
also CodeGuard say nothing.

Have someone an idea what wrong with my Win2k-Installation ?

Roland

Note:

I have a common data fixdisk with the source and the library, I
installed only BCB5 and then installed VirtuelTree.BPL direct from
this data fixdisk, and use also the source from this fixdisk.

 | Replies | Author | Date
2048 | Re: BCB5 under Win2k | Alexander Egorushkin | Mon 5/28/2001
2052 | Re: BCB5 under Win2k | Mike Lischke | Mon 5/28/2001


re: Drag N Drop from tree

From: "Teus de Jong" [teusjdejong@p...]
Date: Mon May 28, 2001 12:24 pm
Subject: Re: [VirtualTreeview] Drag N Drop from tree

> Hi, I'm getting a bit stuck on this. Appreciate it if you could
> clear up a couple of things:
>
> - Where does DragContainer (in RenderData) come from? Where is
> it (and how is it) initialised?
>
> - Where is GetPIDLForPath?
>
> Thanks

Michael,

If you like I can send you all sample components; that's the only way I can
be sure not to leave somting out. Just give me you e-mail adress in the
forum or send it to [teusjdejong@p...]

Teus de Jong


re: Re: New file uploaded to VirtualTreeview

From: Jim Kueneman [jimdk@m...]
Date: Mon May 28, 2001 5:02 pm
Subject: Re: [VirtualTreeview] Re: New file uploaded to VirtualTreeview

At 02:56 PM 5/27/2001 +0000, you wrote:
>the content of this file cannot be used as it is. I recommend that
>you upload the chm file instead of the raw source files (without the
>actual documentation files btw.).

Oops, that file was for you. The CHM is now there instead.

Jim

 | Replies | Author | Date
2046 | Re: New file uploaded to VirtualTreeview | Mike Lischke | Mon 5/28/2001
2054 | Re: New file.. also RightExtent Calculation | Jim Kueneman | Mon 5/28/2001


re: Re: New file uploaded to VirtualTreeview

From: Jim Kueneman [jimdk@m...]
Date: Mon May 28, 2001 5:03 pm
Subject: RE: [VirtualTreeview] Re: New file uploaded to VirtualTreeview

At 05:24 PM 5/27/2001 +0200, you wrote:
> > the content of this file cannot be used as it is. I recommend that
> > you upload the chm file instead of the raw source files (without the
> > actual documentation files btw.).
>
>Btw: what would you prefer: to have VET as integral part of the main
>distribution or as a separate
>distribution like the IBO and DB trees?

Which ever you prefer, makes no difference to me.

Jim

 | Replies | Author | Date
2047 | Re: New file uploaded to VirtualTreeview | Mike Lischke | Mon 5/28/2001


re: Re: New file uploaded to VirtualTreeview

From: "Mike Lischke" [public@l...]
Date: Mon May 28, 2001 6:31 pm
Subject: RE: [VirtualTreeview] Re: New file uploaded to VirtualTreeview

Hi Jim,

> Oops, that file was for you. The CHM is now there instead.

I'm already happy with the UnitDoc file and additional images if you have some.

Ciao, Mike

 | Replies | Author | Date
2054 | Re: New file.. also RightExtent Calculation | Jim Kueneman | Mon 5/28/2001


re: Re: New file uploaded to VirtualTreeview

From: "Mike Lischke" [public@l...]
Date: Mon May 28, 2001 6:32 pm
Subject: RE: [VirtualTreeview] Re: New file uploaded to VirtualTreeview

> Which ever you prefer, makes no difference to me.

Ok, if you don't mind then I would like to bind both trees together into one
package (as it is now).
Thank you.

Ciao, Mike


re: BCB5 under Win2k

From: "Alexander Egorushkin" [egorushkin@m...]
Date: Mon May 28, 2001 7:36 pm
Subject: RE: [VirtualTreeview] BCB5 under Win2k

Hi, everybody!

I have Win2k RUS SP1 - and I cannot run setup.exe for Delphi5 nor for BCB5
from my CD's! It loads up to 99% (Delphi 5.5 Setup is preparing the
InstallShield(R) wizard...) and then disappears (terminates) :( Does anybody
have an idea why this happens? I've noticed that some applications with some
kind IShield setup do the same.

Alex.
> Hi All,
>
> normally I work with BCB5 under WinNT4 Sp5 and all is Ok, and 2 weeks
> ago I installed parallel on an other computer Win2k Sp1 to check,
> whether all is perfect now I have a problem, my own program works Ok,
> but when I quit BCB5 the Icon in the taskbar will deleted and all
> seems Ok, when I try to start BCB5 again some error occurs.
>
> I had a look into task manager and I see that BCB5 is deleted in the
> taskbar, but not in the tasklist, when I kill BCB5 manuell in the
> tasklist all thing work normal and I can start BCB5 again.
>
> I switch CodeGuard ON to see whether I have and memory leakage, but
> also CodeGuard say nothing.
>
> Have someone an idea what wrong with my Win2k-Installation ?
>
> Roland
>
> Note:
>
> I have a common data fixdisk with the source and the library, I
> installed only BCB5 and then installed VirtuelTree.BPL direct from
> this data fixdisk, and use also the source from this fixdisk.
>
>
>
>
> To unsubscribe from this group, send an email to:
> VirtualTreeview-unsubscribe@egroups.com
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>
>

 | Replies | Author | Date
2052 | Re: BCB5 under Win2k | Mike Lischke | Mon 5/28/2001


re: adding grouping feature

From: [mdissel@h...]
Date: Mon May 28, 2001 8:47 pm
Subject: Re: adding grouping feature

Thanks

I own that component already, but the grouping and sorting only works
when you load all the records in the list. The data is then double
loaded in memory (one for the data(base) and one in the list) and
that takes much memory.. (with 10.000 items around 40mb)

Regards,

Marco Dissel

--- In [VirtualTreeview@y...], Stefan Mueller [muellers@s...] wrote:
>
> ... maybe you want to have a look at another component for this -
> something like www.devexpress.com (db)tree which has such
functionality
> already built in (outlook style, drag&drop grouping/sorting and
> customization of column headers, etc) ?!
>
> cheers stefan
>
>
>
>
> --- Werner Lehmann [wl@b...] wrote: > Marco,
> >
> > you have a lot of work in front of you if you really want to add
> > this feature. Looks like a job for a descendant of the virtual
> > stringtree. The problem is only, that the tree can not be virtual
> > anymore if this feature should work. The text for all nodes (at
> > least for the grouped columns) must be known. Ok this might not
> > be a real problem, currently I am using none of my VTrees in that
> > virtual sense. But there is another problem: usually this grouping
> > feature is only applied to flat lists, not trees. The grouping
> > itself builts the tree. Therefore you will have to deal with that
> > (tree within tree) or restrict usage to list only. Methods like
> > AddChild etc. must not be used anymore (except if the parent node
> > is nil). Since this method is public in the base tree already you
> > cannot hide it. The same is true for other methods.
> >
> > [mdissel@h...] wrote:
> > >
> > > I want to make it possible to group by a column (like in Outlook
> > > (Express) etc.). (and later group by multiple columns..)
> > >
> > > Design:
> > > - make grouping column the first column
> > > - sort grouping column
> > > - adjust the paint cycle:
> > > . if value in grouping column is different than the previous
one,
> > > NEW GROUP:
> > > insert temp node toplevel with 3d look
> > > node = level + 1 (indent the node)
> > > . if caption in grouping column is the same than the previous
one,
> > > node = level + 1 (indent the node)
> > >
> > > what is the best approch/events/methods for the last step?
> >
> > I would expect that this is not a job for the paint cycle.
Especially
> > you should not add a (temp) toplevel node inside of Paint. I would
> > introduce a new method to add list items. In this method the value
(s)
> > of the grouped column(s) have to be examined and the new node must
> > be inserted under the appropriate grouping value (the one with the
> > 3D look).
> >
> > Lots of discouraging words. If you still want to do it... would be
> > a nice addition to the VTree 'suite' :)
> >
> > Werner
> >
> >
> >
> > To unsubscribe from this group, send an email to:
> > VirtualTreeview-unsubscribe@egroups.com
> >
> >
> >
> > Your use of Yahoo! Groups is subject to
> > http://docs.yahoo.com/info/terms/
> >
> >
> >
> >
>
>
>
______________________________________________________________________
_______
> http://messenger.yahoo.com.au - Yahoo! Messenger
> - Voice chat, mail alerts, stock quotes and favourite news and lots
more!


re: DragManager

From: "Mike Lischke" [public@l...]
Date: Mon May 28, 2001 8:51 pm
Subject: RE: [VirtualTreeview] DragManager

Hi Kostas,

> procedure DoSomething(const Unk: IUnknown); // Notice that parameter Unk is
> passed as "const"
> var
> X, Y: IUnknown;
> begin
> // Suppose that Unk.RefCount = 0 upon
> entry.
> X := Unk; // Unk._AddRef, Unk.RefCount = 1
> X := nil; // Unk._Release, Unk.RefCount = 0, object
> gets destroyed
> Unk.QueryInterface(IUnknown, X); // Unk._AddRef, this will raise an
> exception
> end;

Ok, I admit this is a bad situation. But I would not program it this way
either. It is in my opinion a problem of Delphi that it does not increase the
ref count for a const interface as it does for a non-const interface. The
workaround is clear and much easier than forcing a perhaps complex construct to
throw away every usual assumption about the interface's lifetime. This is again
a typical contract between different code parts and works only if both behave
nicely.

> This means thet the reference counting scheme HAS CHANGED when you changed
> parameter Unk from ByRef ("const") to ByVal.

As I wrote: bad behavior.

> However, in both cases the local variable "O" points to a destroyed object
> after call to DoSomething() returns, and you have successfully shot yourself
> in the foot. This is why one MUST NOT pass around interface pointers that
> point to objects with a refcount of zero.

Well, you have forgotten that COM interfaces should work so that they can be
freed at any time they are no longer needed. If you pass an interface to some
code without increasing its ref counter then you implicitly tell that you no
longer need the interface afterwards. If yet then take measures the interface
is not freed. When you generally increase the ref count to 1 regardless of
whether you need the interface in your own stuff or not then you lead the whole
allocation/deallocation concept of COM ad absurdum.

> Further more this is a quote from the Delphi help topic group "Common
> Programming Tasks", topic "Using Reference Counting":
> If you decide to use reference
> counting, then you must be careful to only hold the object as an interface
> reference, and to be consistent in your reference counting.

This is something totally different and I agree with you here. There is
explicitly recommended to use interfaces only for such constructs. I consider
to rework VT's internal drag manger handling again (need to write a
IVTDragManager interface, base functionality is already in there).

Ciao, Mike


re: adding grouping feature

From: [mdissel@h...]
Date: Mon May 28, 2001 8:55 pm
Subject: Re: adding grouping feature

Thanks,

but i believe it is not nessary to load all the data. If the data is
sorted, you can depend on the normal load mechanism of the
virtualtree. If the data in the grouping column is not sorted, you
just get a grouping header for each row.

Let's look at an example:
Name, City, Country
Marco, Rotterdam, Netherlands
Bart, Assen, Netherlands
Albert, Rotterdam, Netherlands

if you want to group by City, you order the data on that column, the
data order becomes:
City, Name, Country
Assen, Bart, Netherlands
Rotterdam, Marco, Netherlands
Rotterdam, Albert, Netherlands

The filling mechanism starts at the top and if the City value is
differt it adds an new row... But how can i add a new row (and make
in parent of the current node) in the GetText function for a specific
column?

Or am i wrong?

regards,

marco

--- In [VirtualTreeview@y...], Werner Lehmann [wl@b...] wrote:
> Marco,
>
> you have a lot of work in front of you if you really want to add
> this feature. Looks like a job for a descendant of the virtual
> stringtree. The problem is only, that the tree can not be virtual
> anymore if this feature should work. The text for all nodes (at
> least for the grouped columns) must be known. Ok this might not
> be a real problem, currently I am using none of my VTrees in that
> virtual sense. But there is another problem: usually this grouping
> feature is only applied to flat lists, not trees. The grouping
> itself builts the tree. Therefore you will have to deal with that
> (tree within tree) or restrict usage to list only. Methods like
> AddChild etc. must not be used anymore (except if the parent node
> is nil). Since this method is public in the base tree already you
> cannot hide it. The same is true for other methods.
>
> [mdissel@h...] wrote:
> >
> > I want to make it possible to group by a column (like in Outlook
> > (Express) etc.). (and later group by multiple columns..)
> >
> > Design:
> > - make grouping column the first column
> > - sort grouping column
> > - adjust the paint cycle:
> > . if value in grouping column is different than the previous one,
> > NEW GROUP:
> > insert temp node toplevel with 3d look
> > node = level + 1 (indent the node)
> > . if caption in grouping column is the same than the previous
one,
> > node = level + 1 (indent the node)
> >
> > what is the best approch/events/methods for the last step?
>
> I would expect that this is not a job for the paint cycle.
Especially
> you should not add a (temp) toplevel node inside of Paint. I would
> introduce a new method to add list items. In this method the value
(s)
> of the grouped column(s) have to be examined and the new node must
> be inserted under the appropriate grouping value (the one with the
> 3D look).
>
> Lots of discouraging words. If you still want to do it... would be
> a nice addition to the VTree 'suite' :)
>
> Werner


re: BCB5 under Win2k

From: "Mike Lischke" [public@l...]
Date: Mon May 28, 2001 8:54 pm
Subject: RE: [VirtualTreeview] BCB5 under Win2k

Hi Alex,

> I have Win2k RUS SP1 - and I cannot run setup.exe for Delphi5 nor for BCB5
> from my CD's! It loads up to 99% (Delphi 5.5 Setup is preparing the
> InstallShield(R) wizard...) and then disappears (terminates) :( Does anybody
> have an idea why this happens? I've noticed that some applications with some
> kind IShield setup do the same.

This is strange. Have you Outlook running in the background? Always close
Outlook before running
InstallShield installation programs. Try also to terminate other programs and
services. Try to
install one of the other things on the CD (e.g. the local interbase server).

Ciao, Mike


OnInitNode/OnFreeNode

From: "Vadim Sedulin" [wsntrl@o...]
Date: Mon May 28, 2001 9:01 pm
Subject: OnInitNode/OnFreeNode

Hello Mike!

I think we can simplify a bit work with the data, if you will add in VT a
code of initialization and finalization on the basis of the TypeInfo:

====
TVTGetNodeDataType = procedure (Sender: TBaseVirtualTree; var TypeInfo:
Pointer; var DataSize: Integer) of object;
TBaseVirtualTree = class(TCustomControl)
private
FNodesTypeInfo: Pointer;
FOnGetNodeDataType: TVTGetNodeDataType;
...
end;

procedure TBaseVirtualTree.DoInitNode(Parent, Node: PVirtualNode; var
InitStates: TVirtualNodeInitStates);
label
L1;
var
Data: Pointer;
begin
if FNodesTypeInfo <> nil then begin
Data := GetNodeData (Node);
asm
mov eax, Data
mov edx, FNodesTypeInfo
jmp L1-5 // Hack
end;
Initialize (String(Data));
L1:
end;

if Assigned(FOnInitNode) then
FOnInitNode(Self, Parent, Node, InitStates);
end;

procedure TBaseVirtualTree.DoFreeNode(Node: PVirtualNode);
label
L1;
var
Data: Pointer;
begin
if Node = FCurrentHotNode then
FCurrentHotNode := nil;
if (vsInitialized in Node.States) then begin
if Assigned(FOnFreeNode) then
FOnFreeNode(Self, Node);
if FNodesTypeInfo <> nil then begin
Data := GetNodeData (Node);
asm
mov eax, Data
mov edx, FNodesTypeInfo
jmp L1-5 // Hack
end;
Finalize (String(Data));
L1:
end;
end;
FreeMem(Node);
end;

procedure TBaseVirtualTree.ValidateNodeDataSize(var Size: Integer);
begin
Size := 0;
if Assigned(FOnGetNodeDataType) then
FOnGetNodeDataType (Self, FNodesTypeInfo, Size)
else if Assigned(FOnGetNodeDataSize) then
FOnGetNodeDataSize(Self, Size);
end;

====

Bye.

Vadim Sedulin
E-Mail: [wsntrl@o...]

 | Replies | Author | Date
2159 | Re: OnInitNode/OnFreeNode | Mike Lischke | Sun 6/3/2001
2185 | Re: OnInitNode/OnFreeNode | Vadim Sedulin | Sun 6/3/2001
2294 | Re: OnInitNode/OnFreeNode | Mike Lischke | Sat 6/9/2001
2305 | Re: OnInitNode/OnFreeNode | Vadim Sedulin | Sat 6/9/2001
2424 | Re: OnInitNode/OnFreeNode | Mike Lischke | Sat 6/16/2001


re: Re: New file.. also RightExtent Calculation

From: Jim Kueneman [jimdk@m...]
Date: Mon May 28, 2001 10:15 pm
Subject: RE: [VirtualTreeview] Re: New file.. also RightExtent Calculation

At 08:31 PM 5/28/2001 +0200, you wrote:

>I'm already happy with the UnitDoc file and additional images if you have
>some.

I have been making them as I need them. Anything special you are thinking of?

I have been meaning to ask about something I have noticed recently with
VET. I have one folder that has 16,000 items in it. Just for testing
VET. I have noticed that when I am expanding the parent to the
folder that contains all these items it takes a long time sometimes. I
tracked it down to the Scrollbar update code. GetNextVisibleNode, called
from GetMaxRightExtend, there is this line:

// The visible state can be removed during initialization so
init the node first.
if not (vsInitialized in Result.States) then
InitNode(Result);

It acts like it initializes the 16,000 nodes the in the folder when VT is
expanding the parent to this folder, is that right? I also see a method

function GetFirstVisibleNoInit: PVirtualNode;

What is the difference?

Jim


re: Re: adding grouping feature

From: Werner Lehmann [wl@b...]
Date: Tue May 29, 2001 12:10 am
Subject: Re: [VirtualTreeview] Re: adding grouping feature

[mdissel@h...] wrote:
>
> Thanks,
>
> but i believe it is not nessary to load all the data. If the data is
> sorted, you can depend on the normal load mechanism of the
> virtualtree. If the data in the grouping column is not sorted, you
> just get a grouping header for each row.
>
> Let's look at an example:
> Name, City, Country
> Marco, Rotterdam, Netherlands
> Bart, Assen, Netherlands
> Albert, Rotterdam, Netherlands
>
> if you want to group by City, you order the data on that column, the
> data order becomes:
> City, Name, Country
> Assen, Bart, Netherlands
> Rotterdam, Marco, Netherlands
> Rotterdam, Albert, Netherlands
>
> The filling mechanism starts at the top and if the City value is
> differt it adds an new row... But how can i add a new row (and make
> in parent of the current node) in the GetText function for a specific
> column?
>
> Or am i wrong?

Well. IMO this is still not something which should be done on paint
level. Nodes, whether grouped or not, should be added before that.

About keeping the virtual paradigm: you need to know the headers for
all groupings (or at minimum the number of these headings, this would
be equivalent to RootNodeCount). This information can be retrieved
with a distinct and order by query on the group column. If a node is
expanded (a grouped node that is) you would have to exec a new query
which retrieves the group children. Sounds reasonable. Performance
depends on your db server, network and how many nodes might be in
one group, at most.

The principle can also be stacked easily, to group after more than
one column. This leaves the question open how to show the grouping
visually. To simulate TdxDBGrid (or Outlook but I don't know that)
the NC area above the header must be painted. No idea how to integrate
this into the existing code (by means of class inheritance). Easier
may be an aggregate component...

Werner

 | Replies | Author | Date
2069 | Re: adding grouping feature | [mdissel@h...] | Wed 5/30/2001


re: DragManager

From: GIANNAKOPOULOS KOSTAS [kyan@s...]
Date: Tue May 29, 2001 7:48 am
Subject: RE: [VirtualTreeview] DragManager

> As I wrote: bad behavior.

Well, i have to admit that reference counting lifetime management is far
from easy to comprehend and has its drawbacks. Bornald did a very nice job
releasing us from this burden, maybe it is not perfect but if one took a
looc at C++ code handling intefaced objects they would see what they have to
gain.

> Well, you have forgotten that COM interfaces should work so
> that they can be freed at any time they are no longer needed.
> If you pass an interface to some code without increasing its
> ref counter then you implicitly tell that you no longer need
> the interface afterwards. If yet then take measures the
> interface is not freed. When you generally increase the ref
> count to 1 regardless of whether you need the interface in
> your own stuff or not then you lead the whole
> allocation/deallocation concept of COM ad absurdum.

Yes, but i don't think that any programmer writing a procedure with an
interface parameter will consciously write such defensive code as to protect
his procedure from an interfaced object with a refcount of 0 that can go
away any time. They will do it only by instinct, or the compiler they are
using will do it for them. That was my point to begin with. I didn't suggest
that the DragManager didn't work or had a bug.
>
> This is something totally different and I agree with you
> here. There is explicitly recommended to use interfaces only
> for such constructs. I consider to rework VT's internal drag
> manger handling again (need to write a IVTDragManager
> interface, base functionality is already in there).

Actually, you have no reason to do this; it works. As i said my intension
was not to find a "fault" in your code, which i think is great, just to
express my (academic maybe) concern about this issue.

Shall we call it a truce? :-)

<KY>


Can't select node with keyboard.

From: [SimonMoscrop@H...]
Date: Tue May 29, 2001 8:42 am
Subject: Can't select node with keyboard.

Hello Mike/All.

I have been experiencing a problem with keyboard selection in a
virtual string tree (version 2.4 (i think)). I have a tree with the
multi-select option turned on , and i process the used selections in
the 'OnFocusedChanged' event.

If i select a node with the mouse everything works ok. If i then
press the up or down arrow the focus shifts in the tree but the
Tree.SelectedCount drops to 0.

Is this a matter that needs fixing, or am i doing someting wrong?

Thanks in anticipation of your support.

- Simon Moscrop

 | Replies | Author | Date
2126 | Re: Can't select node with keyboard. | Mike Lischke | Sat 6/2/2001
2192 | Re: Can't select node with keyboard. | [SimonMoscrop@H...] | Mon 6/4/2001
2287 | Re: Can't select node with keyboard. | Mike Lischke | Sat 6/9/2001
2353 | Re: Can't select node with keyboard. | [SimonMoscrop@H...] | Mon 6/11/2001


Problems with flat scrollbars and WIndowsblind.

From: "Danil Galimov" [danil@o...]
Date: Tue May 29, 2001 8:49 am
Subject: Problems with flat scrollbars and WIndowsblind.

Hello all.
It was said, that flat scrollbars have conflict with windowsblind.
It'ss a tool that let you change the skins of Windows. It let you
make Windows98/2000 look like Apple Macintosh or Windows XP.
The official site
is: http://www.windowblinds.net/
Anyone have got this problem?

 | Replies | Author | Date
2179 | Re: Problems with flat scrollbars and WIndowsblin | Mike Lischke | Sun 6/3/2001


Resize uses a cache ???

From: [ebolefeysot@b...]
Date: Tue May 29, 2001 1:43 pm
Subject: Resize uses a cache ???

Hi

I've got this tiny problem in my app:
I use a virtuallistview and I dynamically change its layout to store
different datas. I change header number, caption, size...

When I do a ctrl + in it, all col are resized ok.

Then, I change the layout of the list, and put smaller items in it:
the resize function still resize on previous datas !

If I manually resize the first column, some items begin to be cut
before the column limit read them !

Another problem is when I hit several time ctrl +. The latest columns
are crunched as I press ctrl +. When I scroll down the list, the
column is drawn back correctly.

Anyway, great job for the least !

If you want to reproduce it, you can download my app
awww.romcenter.com

 | Replies | Author | Date
2123 | Re: Resize uses a cache ??? | Mike Lischke | Sat 6/2/2001


2 Q's about VET.

From: [tias@m...]
Date: Tue May 29, 2001 3:21 pm
Subject: 2 Q's about VET.

Hi Jim !

Two questions about VET :

1: When I'm calling VET->BrowseTo("a folder",true,true,true,true), I
find the GUI-feedback a little confusing :
First, since I've set CollapseAllFirst=true, I expect the whole
tree to collapse.
Second, the BrowseTo() method returns before the complete tree is
updated.
I can live with the first thing, just curious about it :)
The second thing is a little bit worse, considering the way I'm
using it :
(In a OnClick-event :)
I'm setting "numerous controls'"->Enabled = false.
Screen->Cursor = crHourGlass;
Application->ProcessMessages();
VET->BrowseTo(.....);
"Numerous controls'"->Enabled = true.
Screen->Cursor = crDefault;
Application->ProcessMessages();

Thus, when the controls are enabled and the cursor is normal again,
usually only half the VET is updated, but no controls are able to
react to user interaction yet. After about 1 to 1.5 seconds later, all
folder icons are shown.
I'm not using any Threads (UseThreadedImages &
ChangeChangeNotifierThread are both false).

Any idea what's causing this behaviour ?
Or is it possible to have a OnBrowseDone()-event implemented which
is called when VET is truly up to date ?

2: Trying to ->BrowseTo() a network path (eg:
\\RemoteMachine\RemFolder\) seems to work fine. (Can't test it here
since my laptop has no ethernet adapter, but it works for the guys in
Sweden where my s/w is supposed to be used...)
Although, testing it on my laptop, browsing to \\MyMachine\C$\
makes VET to open "Desktop->Network->Entire Network->Microsoft Windows
Network", no node selected.
I find this a little strange, since I'm perfectly able to issue a
"dir \\MyMachine\C$\" command from a MS-DOS prompt. (Note: To be
able to do this, I must be connected to the Internet, but that's my
normal state anyway...)

Any ideas ?

TIA,
Mathias Thorell

Ps. I'm using VET 1.1.17 and VT 2.4.16 Ds.

 | Replies | Author | Date
2061 | Re: 2 Q's about VET. | Jim Kueneman | Tue 5/29/2001
2062 | Re: 2 Q's about VET. | Jim Kueneman | Tue 5/29/2001
2073 | Re: 2 Q's about VET. | [tias@m...] | Wed 5/30/2001
2074 | Re: 2 Q's about VET. | Jim Kueneman | Wed 5/30/2001
2107 | Re: 2 Q's about VET. | Jim Kueneman | Sat 6/2/2001
2108 | Re: 2 Q's about VET. | [adembaba@e...] | Sat 6/2/2001
2109 | Re: 2 Q's about VET. | Jim Kueneman | Sat 6/2/2001
2142 | Checkboxes | Jim Kueneman | Sat 6/2/2001
2143 | Re: Checkboxes | Mike Lischke | Sat 6/2/2001


re: 2 Q's about VET.

From: "Jim Kueneman" [jimdk@m...]
Date: Tue May 29, 2001 5:58 pm
Subject: Re: 2 Q's about VET.

--- In [VirtualTreeview@y...], [tias@m...] wrote:

> 1: When I'm calling VET->BrowseTo("a folder",true,true,true,true), I
> find the GUI-feedback a little confusing :
> First, since I've set CollapseAllFirst=true, I expect the whole
> tree to collapse.

What this does is if the user has a lot of folders open it will
collapse them all so the only open folder is the BrowseTo folder, it
is all done within a Begin/End Update block so you will never see it.
I always hated how messy Explorer got after browsing around a while,
this allows tree to be "cleaned up a bit" first.

> Second, the BrowseTo() method returns before the complete tree is

> Screen->Cursor = crDefault;
> Application->ProcessMessages();
>
>
> Any idea what's causing this behaviour ?
> Or is it possible to have a OnBrowseDone()-event implemented
which
> is called when VET is truly up to date ?

When BrowseTo returns it has completed its work. It has enumerated and
expanded all necessary folders and found the path to the target. What
has not been done is allowed VT to processes any of the changes
visually (begin/end update pair). Is VT doing the update in the
background? I noticed today if I expand an entire directory VT has
seven threads before I expand and FOURTEEN threads after it is
expanded! I know 2 are mine the rest are VT's. I know I don't like
using the Application.ProcessMessages method for a number of reasons,
what happens if you remove that?

>
> Although, testing it on my laptop, browsing to \\MyMachine\C$\
> makes VET to open "Desktop->Network->Entire Network->Microsoft
Windows
> Network", no node selected.
> I find this a little strange, since I'm perfectly able to issue a
> "dir \\MyMachine\C$\" command from a MS-DOS prompt. (Note: To be
> able to do this, I must be connected to the Internet, but that's my
> normal state anyway...)

Hum, I see ....... (thinking cap on}

Jim

 | Replies | Author | Date
2062 | Re: 2 Q's about VET. | Jim Kueneman | Tue 5/29/2001
2073 | Re: 2 Q's about VET. | [tias@m...] | Wed 5/30/2001
2074 | Re: 2 Q's about VET. | Jim Kueneman | Wed 5/30/2001


re: 2 Q's about VET.

From: "Jim Kueneman" [jimdk@m...]
Date: Tue May 29, 2001 7:49 pm
Subject: Re: 2 Q's about VET.

--- In [VirtualTreeview@y...], "Jim Kueneman" [jimdk@m...] wrote:
> background? I noticed today if I expand an entire directory VT has
> seven threads before I expand and FOURTEEN threads after it is
> expanded! I know 2 are mine the rest are VT's. I know I don't like

Scratch that. These are network object namespaces that start new
threads attached to the application.

Jim


Tri-state checking

From: [youngpup_SH_@h...]
Date: Wed May 30, 2001 12:38 am
Subject: Tri-state checking

I set a node's CheckType to ctTriState, but it will not tri-state
check with the mouse. i assume this is by design - although i wish it
weren't.

Could you please add a (const OldValue: TCheckState) to OnChecking so
that i know what the value was before they checked it...so i can gray
it myself in code?

Ian

 | Replies | Author | Date
2122 | Re: Tri-state checking | Mike Lischke | Sat 6/2/2001
2147 | Re: Tri-state checking | [youngpup_SH_@h...] | Sat 6/2/2001


Visual garbage when sizing tree

From: [youngpup_SH_@h...]
Date: Wed May 30, 2001 12:44 am
Subject: Visual garbage when sizing tree

When i size the entire tree (i.e. resizing the form when the tree is
Align=alClient causes garbage to be left behind. i could this a bug
that the tree doesn't repaint itself as needed.

Additionally...can you supply an OnResize event when the tree IS
resizing (so i could call an Invalidate myself if needed).

 | Replies | Author | Date
2127 | Re: Visual garbage when sizing tree | Mike Lischke | Sat 6/2/2001


re: Problems with new nodes

From: Steffen Schemel [st_schemel@y...]
Date: Wed May 30, 2001 8:10 am
Subject: RE: [VirtualTreeview] Problems with new nodes

Hi!

I have checked this... and i think, there was really a
bug. When i insert a new rootnode (with whatever
method is not interested), and the inserted node is
not in the visible area from the tree, then the
oninitnode-event will be called only for the last
node!!!!! That means, all invisible nodes became the
same data, caption and text. When i do insert the
nodes before an existing node (i.e. in the visible
area), all works correctly.

i use for that:

insertnode(nil,amaddchildfirst)

have a nice day
Steffen

__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail - only $35
a year! http://personal.mail.yahoo.com/

 | Replies | Author | Date
2068 | Re: Problems with new nodes | Alexander Egorushkin | Wed 5/30/2001
2070 | Re: Problems with new nodes | Roland | Wed 5/30/2001


re: Problems with new nodes

From: Werner Lehmann [wl@b...]
Date: Wed May 30, 2001 9:23 am
Subject: Re: [VirtualTreeview] Problems with new nodes

Steffen,

if I understand you correctly you are complaining about
missing OnInitNode events for new nodes which are not in
the visible area of the tree. This is a feature and the
only way to add a million nodes in very short time (try
that with a TTreeview :). The OnInitNode event will only
fire when such a node is displayed (or sorted) for the
first time.

Werner

 | Replies | Author | Date
2067 | Re: Problems with new nodes | Steffen Schemel | Wed 5/30/2001
2071 | Re: Problems with new nodes | [youngpup_SH_@h...] | Wed 5/30/2001
2072 | Re: Problems with new nodes | Steffen Schemel | Wed 5/30/2001


re: Problems with new nodes

From: Steffen Schemel [st_schemel@y...]
Date: Wed May 30, 2001 11:04 am
Subject: Re: [VirtualTreeview] Problems with new nodes

Hi!

--- Werner Lehmann [wl@b...] wrote:
> Steffen,
>
> if I understand you correctly you are complaining
> about
> missing OnInitNode events for new nodes which are
> not in
> the visible area of the tree. This is a feature and
> the
> only way to add a million nodes in very short time
> (try
> that with a TTreeview :). The OnInitNode event will
> only
> fire when such a node is displayed (or sorted) for
> the
> first time.
>
> Werner
>
>
Yes, shure... What an event(s) will be fired when a
node is created, i need to set then the data,
text...???

Thanks
Steffen

__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail - only $35
a year! http://personal.mail.yahoo.com/

 | Replies | Author | Date
2071 | Re: Problems with new nodes | [youngpup_SH_@h...] | Wed 5/30/2001
2072 | Re: Problems with new nodes | Steffen Schemel | Wed 5/30/2001


re: Problems with new nodes

From: "Alexander Egorushkin" [egorushkin@m...]
Date: Wed May 30, 2001 11:04 am
Subject: RE: [VirtualTreeview] Problems with new nodes

Hi!
Try this code:
Node := AddChild(nil);
ValidateNode(Node);
//Other initializations to Node

Alex

>
> Hi!
>
> I have checked this... and i think, there was really a
> bug. When i insert a new rootnode (with whatever
> method is not interested), and the inserted node is
> not in the visible area from the tree, then the
> oninitnode-event will be called only for the last
> node!!!!! That means, all invisible nodes became the
> same data, caption and text. When i do insert the
> nodes before an existing node (i.e. in the visible
> area), all works correctly.
>
> i use for that:
>
> insertnode(nil,amaddchildfirst)
>
> have a nice day
> Steffen
>
>
> __________________________________________________
> Do You Yahoo!?
> Get personalized email addresses from Yahoo! Mail - only $35
> a year! http://personal.mail.yahoo.com/
>
> To unsubscribe from this group, send an email to:
> VirtualTreeview-unsubscribe@egroups.com
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>
>

 | Replies | Author | Date
2070 | Re: Problems with new nodes | Roland | Wed 5/30/2001


re: adding grouping feature

From: [mdissel@h...]
Date: Wed May 30, 2001 11:09 am
Subject: Re: adding grouping feature

Hello

Isn't it an option to hide/show nodes depeding on the previous value
of the node?

You only work with rootnodes, but for every record you have two
nodes, one grouping node with only one column and the next node with
all the values. The grouping node is only visible if the previous
real node (not the grouping node) grouping column value is different.
The groupnode painting is somewhat different (gray or whatever). the
other nodes are always indented a few pixels.

Could this be possible? if so..
- how can i indent (root)nodes independent
- how can i read the value of the previous node (grouping column)

Regards,

Marco

--- In [VirtualTreeview@y...], Werner Lehmann [wl@b...] wrote:
> [mdissel@h...] wrote:
> >
> > Thanks,
> >
> > but i believe it is not nessary to load all the data. If the data
is
> > sorted, you can depend on the normal load mechanism of the
> > virtualtree. If the data in the grouping column is not sorted, you
> > just get a grouping header for each row.
> >
> > Let's look at an example:
> > Name, City, Country
> > Marco, Rotterdam, Netherlands
> > Bart, Assen, Netherlands
> > Albert, Rotterdam, Netherlands
> >
> > if you want to group by City, you order the data on that column,
the
> > data order becomes:
> > City, Name, Country
> > Assen, Bart, Netherlands
> > Rotterdam, Marco, Netherlands
> > Rotterdam, Albert, Netherlands
> >
> > The filling mechanism starts at the top and if the City value is
> > differt it adds an new row... But how can i add a new row (and
make
> > in parent of the current node) in the GetText function for a
specific
> > column?
> >
> > Or am i wrong?
>
> Well. IMO this is still not something which should be done on paint
> level. Nodes, whether grouped or not, should be added before that.
>
> About keeping the virtual paradigm: you need to know the headers for
> all groupings (or at minimum the number of these headings, this
would
> be equivalent to RootNodeCount). This information can be retrieved
> with a distinct and order by query on the group column. If a node is
> expanded (a grouped node that is) you would have to exec a new query
> which retrieves the group children. Sounds reasonable. Performance
> depends on your db server, network and how many nodes might be in
> one group, at most.
>
> The principle can also be stacked easily, to group after more than
> one column. This leaves the question open how to show the grouping
> visually. To simulate TdxDBGrid (or Outlook but I don't know that)
> the NC area above the header must be painted. No idea how to
integrate
> this into the existing code (by means of class inheritance). Easier
> may be an aggregate component...
>
> Werner


re: Problems with new nodes

From: "Roland" [Beduerftig@S...]
Date: Wed May 30, 2001 11:28 am
Subject: Re: Problems with new nodes

Hi Alexander,

> Hi!
> Try this code:
> Node := AddChild(nil);
> ValidateNode(Node);
> //Other initializations to Node

but with this code Steffen cannot insert a "root" node between
existing nodes.

node A
node B
new node insert here
node C
node D

have a nice day
Roland


re: Problems with new nodes

From: [youngpup_SH_@h...]
Date: Wed May 30, 2001 11:34 am
Subject: Re: Problems with new nodes

Ignore the OnInitData event entirly, and add your data to the node
when you insert it.

You have to add SOMETHING to the node's data when you create it,
otherwise you can't identify it when you want to add the REAL data in
OnInitNode.

Might as well add the real data straight away.

Ian

--- In [VirtualTreeview@y...], Steffen Schemel [st_schemel@y...] wrote:
> Yes, shure... What an event(s) will be fired when a
> node is created, i need to set then the data,
> text...???

> > if I understand you correctly you are complaining about
> > missing OnInitNode events for new nodes which are not in
> > the visible area of the tree. This is a feature and the
> > only way to add a million nodes in very short time (try
> > that with a TTreeview :). The OnInitNode event will only
> > fire when such a node is displayed (or sorted) for the
> > first time.

 | Replies | Author | Date
2072 | Re: Problems with new nodes | Steffen Schemel | Wed 5/30/2001


re: Re: Problems with new nodes

From: Steffen Schemel [st_schemel@y...]
Date: Wed May 30, 2001 12:13 pm
Subject: Re: [VirtualTreeview] Re: Problems with new nodes

Hi!

OK, that is it...

i use now:

data := form1.vtpc.getnodedata(form1.vtpc.AddChild
(nil));
data.caption := text;

and it works. It works also for rootnodes, childnodes
and so on.

Thanks
Steffen
--- [youngpup_SH_@h...] wrote:
> Ignore the OnInitData event entirly, and add your
> data to the node
> when you insert it.
>
> You have to add SOMETHING to the node's data when
> you create it,
> otherwise you can't identify it when you want to add
> the REAL data in
> OnInitNode.
>
> Might as well add the real data straight away.
>
> Ian
>
> --- In [VirtualTreeview@y...], Steffen Schemel
> [st_schemel@y...] wrote:
> > Yes, shure... What an event(s) will be fired when
> a
> > node is created, i need to set then the data,
> > text...???
>
>
> > > if I understand you correctly you are
> complaining about
> > > missing OnInitNode events for new nodes which
> are not in
> > > the visible area of the tree. This is a feature
> and the
> > > only way to add a million nodes in very short
> time (try
> > > that with a TTreeview :). The OnInitNode event
> will only
> > > fire when such a node is displayed (or sorted)
> for the
> > > first time.
>
>
>

__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail - only $35
a year! http://personal.mail.yahoo.com/


re: 2 Q's about VET.

From: [tias@m...]
Date: Wed May 30, 2001 2:29 pm
Subject: Re: 2 Q's about VET.

--- In [VirtualTreeview@y...], "Jim Kueneman" [jimdk@m...] wrote:

> What this does is if the user has a lot of folders open it will
> collapse them all so the only open folder is the BrowseTo folder, it
> is all done within a Begin/End Update block so you will never see
it.
> I always hated how messy Explorer got after browsing around a while,
> this allows tree to be "cleaned up a bit" first.

Aha ! Well, I think that's a perfect behaviour, so don't change it ;-)

> When BrowseTo returns it has completed its work. It has enumerated
and
> expanded all necessary folders and found the path to the target.
What
> has not been done is allowed VT to processes any of the changes
> visually (begin/end update pair). Is VT doing the update in the
> background?

Seems like that since "half" (upper half of nodes) of the VET is
updated, then freezes for 1-1.5 seconds and then the complete tree is
up to date.

> I noticed today if I expand an entire directory VT has
> seven threads before I expand and FOURTEEN threads after it is
> expanded! I know 2 are mine the rest are VT's. I know I don't like
> using the Application.ProcessMessages method for a number of
reasons,
> what happens if you remove that?

Removing ->ProcessMessages() didn't change anything...

> Hum, I see ....... (thinking cap on}

Don't burn too many braincells on this one. This is a somewhat
"stupid" way to browse my own machine, but still, it's a little
peculiar anyway...

Thanks !

/Mathias

 | Replies | Author | Date
2074 | Re: 2 Q's about VET. | Jim Kueneman | Wed 5/30/2001


re: 2 Q's about VET.

From: "Jim Kueneman" [jimdk@m...]
Date: Wed May 30, 2001 3:01 pm
Subject: Re: 2 Q's about VET.

--- In [VirtualTreeview@y...], [tias@m...] wrote:
> --- In [VirtualTreeview@y...], "Jim Kueneman" [jimdk@m...] wrote:

> Seems like that since "half" (upper half of nodes) of the VET is
> updated, then freezes for 1-1.5 seconds and then the complete tree
> is up to date.

What VET has not done is load the images and text names yet. It waits
for VT to ask for the info. Use the image thread or no images to see
if it is Windows being a bit slow extracting an image. Are you using
the details? Try turning them off too.

My guess it is "waiting" on windows to extract a piece of information
to display.

Jim


2 problems (DDManager.RenderData and Hints)

From: "Paul Istrate" [istech@c...]
Date: Wed May 30, 2001 6:57 pm
Subject: 2 problems (DDManager.RenderData and Hints)

Hi Mike,

I want to report 2 problems (one is new and one is old) for version 2.4.16.

1. It seems that TRichEdit control accept OLE dd so when mouse is over the
TRichEdit the cursor indicate that control will accept droping.

The problem is that I use a VDT not a VST control so, when I release mouse
over the TRichEdit an 'Invalid class typecast' error occurs in line 4134.

This is in function TVTDragDropManager.RenderData function where you assume
that
control is TVirtualStrintTree.

"with FOwner as TCustomVirtualStringTree do
..."

OLEFormats for VDT are all set on True. Of course, if ofText is set to
False, the
problem does not occurs anymore.

2. Again then problem with splitter mark. The problem occurs also in this
version (when I report this problem I worked with 2.4.11 version) and, as an
answer to your question, when VDT is focused or not focused.

Regards,
Paul Istrate

 | Replies | Author | Date
2128 | Re: 2 problems (DDManager.RenderData and Hints) | Mike Lischke | Sat 6/2/2001
2178 | Re: 2 problems (DDManager.RenderData and Hints) | Paul Istrate | Sun 6/3/2001
2288 | Re: 2 problems (DDManager.RenderData and Hints) | Mike Lischke | Sat 6/9/2001


infinite painting problem

From: [ccdsystems@y...]
Date: Wed May 30, 2001 7:00 pm
Subject: infinite painting problem

I've got a problem with the root node of a tree endlessly looping
trying to paint itself, I think.

When the app opens, the tree loads fine. Above it are 2 dropdowns,
based on what choices are made in these dropdown, the tree changes.
There are 2 major types of view, Abstract and Patient, each of which
have sub types.

When the first dropdown is set to Abstract, all of the abstract views
chosen from the second dropdown work fine. When the first dropdown
is set to Patient, all views from the second dropdown endlessly
loop. Once the tree has been scrolled far enough that the first node
no longer appears, the looping stops. If the root is scrolled back
into view, everything is still fine.

I'm not even sure where to begin looking for what's happening, if
it's in my code (which is most likely) or in the VT code. This is
happening in 1.31, but I also tried it with 2.4.16 and the same thing
happens.

The Patient tree resembles this:

Patient1
Visit1
Record1
Visit2
Record2
Patient2
Visit2
Record2
Patient3
Visit3
Record3
...

Thanks for any help you can offer

Spencer Semkowich

 | Replies | Author | Date
2079 | Re: infinite painting problem NOT FIXED | [ccdsystems@y...] | Wed 5/30/2001
2084 | Re: infinite painting problem FIXED | [ccdsystems@y...] | Thu 5/31/2001


Bug in VT <= 2.4.16 - FullExpand

From: "Vadim Sedulin" [wsntrl@o...]
Date: Wed May 30, 2001 9:04 pm
Subject: Bug in VT <= 2.4.16 - FullExpand

Hello Mike!

procedure TBaseVirtualTree.FullExpand(Node: PVirtualNode = nil);
....
if Node = nil then
begin
Node := FRoot.FirstChild;
Stop := nil;
end
else
Stop := Node.NextSibling;
^^^^^^^^^^^^^^^^^^^^^^^^^
will be NIL for last sibling

Bye.

Vadim Sedulin
E-Mail: [wsntrl@o...]

[Non-text portions of this message have been removed]

 | Replies | Author | Date
2130 | Re: Bug in VT <= 2.4.16 - FullExpand | Mike Lischke | Sat 6/2/2001
2138 | Re: Bug in VT <= 2.4.16 - FullExpand | Vadim Sedulin | Sat 6/2/2001
2162 | Re: Bug in VT <= 2.4.16 - FullExpand | Mike Lischke | Sun 6/3/2001


re: infinite painting problem NOT FIXED

From: [ccdsystems@y...]
Date: Wed May 30, 2001 10:55 pm
Subject: Re: infinite painting problem NOT FIXED

I thought that I had it fixed, but I was wrong. The
Application.ProcessMessages hides the problem, making the app appear
to run fine. However, my CPU runs at 100% and my machine soon
crashes. If the tree is scrolled to the right until the first column
is no longer visible, then the processor drops right down. But as
soon as the first column is scrolled back into view, the CPU is back
at 100%.

I haven't got any idea where to look right now. Any ideas, anyone?

Thanks
Spencer

--- In [VirtualTreeview@y...], [ccdsystems@y...] wrote:
> I've got a problem with the root node of a tree endlessly looping
> trying to paint itself, I think.
>
> When the app opens, the tree loads fine. Above it are 2 dropdowns,
> based on what choices are made in these dropdown, the tree
changes.
> There are 2 major types of view, Abstract and Patient, each of
which
> have sub types.
>
> When the first dropdown is set to Abstract, all of the abstract
views
> chosen from the second dropdown work fine. When the first dropdown
> is set to Patient, all views from the second dropdown endlessly
> loop. Once the tree has been scrolled far enough that the first
node
> no longer appears, the looping stops. If the root is scrolled back
> into view, everything is still fine.
>
> I'm not even sure where to begin looking for what's happening, if
> it's in my code (which is most likely) or in the VT code. This is
> happening in 1.31, but I also tried it with 2.4.16 and the same
thing
> happens.
>
> The Patient tree resembles this:
>
> Patient1
> Visit1
> Record1
> Visit2
> Record2
> Patient2
> Visit2
> Record2
> Patient3
> Visit3
> Record3
> ...
>
> Thanks for any help you can offer
>
> Spencer Semkowich


re: Re: infinite painting problem NOT FIXED

From: Werner Lehmann [wl@b...]
Date: Wed May 30, 2001 11:03 pm
Subject: Re: [VirtualTreeview] Re: infinite painting problem NOT FIXED

[ccdsystems@y...] wrote:
>
> I haven't got any idea where to look right now. Any ideas, anyone?

If you suspect that the paint method is called over and over
again you could move/resize your app window so that it does
not overlap with any delphi window. Then when the problem
occurs (CPU at 100%) set a breakpoint in Paint. When it breaks,
look at the callstack (debugger windows). Try to understand
where this loop comes from... There should always be the same
methods called in a circle.

Werner


Design-time nodes - a problem, and a solution - and a question for Mike ;))

From: [dragan.juric@q...]
Date: Thu May 31, 2001 2:57 pm
Subject: Design-time nodes - a problem, and a solution - and a question for Mike ;))

Hi,

I had a problem with allocating nodes in design time.

I derived a control from your control (a tree from a tree), and I
made it so that it can display the actual data even in design mode,
like Borland data-aware components.

It is one of Delphi's cool features that we can see how the form
will look like - while we are designing it.

However, there is a function in TBaseVirtualTree

function TBaseVirtualTree.MakeNewNode: PVirtualNode;

var
Size: Cardinal;

begin

if csDesigning in ComponentState then
Size := SizeOf(TVirtualNode)
else
begin

// make sure FNodeDataSize is valid
if FNodeDataSize = -1 then
ValidateNodeDataSize(FNodeDataSize);

// take record alignment into account
if (SizeOf(TVirtualNode) mod 4) = 0 then
Size := SizeOf(TVirtualNode) + FNodeDataSize
else
Size := SizeOf(TVirtualNode) and not 3 + 4 + FNodeDataSize;
end;

// AllocMem clears the new memory, in opposition to New
Result := AllocMem(Size + InternalDataSize);
// fill in some default values
with Result^ do
begin
TotalCount := 1;
TotalHeight := FDefaultNodeHeight;
NodeHeight := FDefaultNodeHeight;
Align := 50;
end;
end;

Look at the top, this "if csDesigning in ComponentState" actually
makes a problem as it will cause that user-defined data is not
allocated in design mode. So my program crashed (along with the
entire Delphi, since my control was in a .bpl) when I tried to clear
the tree.

I don't see a reason for this "if" statement - sparing memory in
design time? Why? It will anyway be allocated at run-time. But this
entire piece of code looks as if written intentionally, it can't be a
but - yet, it is.

Note that this function is not even virtual, so I can't override
it :(((((

The solution is simple - remove "if" and always use "else" branch,
like this:

(*
if csDesigning in ComponentState then
Size := SizeOf(TVirtualNode)
else
begin
*)
// make sure FNodeDataSize is valid
if FNodeDataSize = -1 then
ValidateNodeDataSize(FNodeDataSize);

// take record alignment into account
if (SizeOf(TVirtualNode) mod 4) = 0 then
Size := SizeOf(TVirtualNode) + FNodeDataSize
else
Size := SizeOf(TVirtualNode) and not 3 + 4 + FNodeDataSize;
// end;

I did this and it doesn't crash any more. Of course, I don't like
changing the source code of libraries I use - every time you make a
new version I have to change it again.

So, the question for Mike: will you please consider introducing
this change in the next release?

Thanks,
Dragan

 | Replies | Author | Date
2087 | Re: Design-time nodes - a problem, and a solution | Jim Kueneman | Thu 5/31/2001
2120 | Re: Design-time nodes - a problem, and a solution | Mike Lischke | Sat 6/2/2001


ScrollIntoView

From: "Mark Austen" [markausten@y...]
Date: Thu May 31, 2001 5:11 pm
Subject: ScrollIntoView

My setup is giving me slightly odd behaviour with this function. If
the node in question is anywhere in the tree except right at the
bottom, then all is fine. However, if it is the very last node, then
calling ScrollIntoView doesn't give me the expected result, instead
the node I'm trying to scroll into view is just off the bottom of the
client area.

Any suggestions on how to get VT to show this properly? Or is it my
setup?

Thanks.

Mark

 | Replies | Author | Date
2118 | Re: ScrollIntoView | Mike Lischke | Sat 6/2/2001
2155 | Re: ScrollIntoView | Mark Austen | Sun 6/3/2001
2160 | Re: ScrollIntoView | Mike Lischke | Sun 6/3/2001
2175 | Re: ScrollIntoView | Mark Austen | Sun 6/3/2001
2291 | Re: ScrollIntoView | Mike Lischke | Sat 6/9/2001
3066 | ScrollIntoView | Jim Kueneman | Fri 7/13/2001
3084 | Re: ScrollIntoView | Mike Lischke | Sat 7/14/2001
3089 | Re: ScrollIntoView | Raymond Wilson | Sat 7/14/2001
3092 | Re: ScrollIntoView | Werner Lehmann | Sat 7/14/2001


re: infinite painting problem FIXED

From: [ccdsystems@y...]
Date: Thu May 31, 2001 5:49 pm
Subject: Re: infinite painting problem FIXED

I found what the problem was. Depending on what I wanted to display,
I was switching between 2 image lists to get the icon. This was
causing headaches for the tree view. Once I put all the icons in one
image list, things cleared up.

--- In [VirtualTreeview@y...], [ccdsystems@y...] wrote:
> I've got a problem with the root node of a tree endlessly looping
> trying to paint itself, I think.
>
> When the app opens, the tree loads fine. Above it are 2 dropdowns,
> based on what choices are made in these dropdown, the tree
changes.
> There are 2 major types of view, Abstract and Patient, each of
which
> have sub types.
>
> When the first dropdown is set to Abstract, all of the abstract
views
> chosen from the second dropdown work fine. When the first dropdown
> is set to Patient, all views from the second dropdown endlessly
> loop. Once the tree has been scrolled far enough that the first
node
> no longer appears, the looping stops. If the root is scrolled back
> into view, everything is still fine.
>
> I'm not even sure where to begin looking for what's happening, if
> it's in my code (which is most likely) or in the VT code. This is
> happening in 1.31, but I also tried it with 2.4.16 and the same
thing
> happens.
>
> The Patient tree resembles this:
>
> Patient1
> Visit1
> Record1
> Visit2
> Record2
> Patient2
> Visit2
> Record2
> Patient3
> Visit3
> Record3
> ...
>
> Thanks for any help you can offer
>
> Spencer Semkowich


diferents states in VET

From: "Ariel Selig" [asel98@y...]
Date: Thu May 31, 2001 6:46 pm
Subject: diferents states in VET

hi.
im trying to make it state support,.. but with 3 states and the
derivated.
so it will be:
Checked (when u want the files)
unchecked (u dont say nothing about the files, becasue theat files
are new, for example).
and Cross, (u DONT want the files... never).

and checked and cross with the grayed and not grayed way...

any tip?

i try to override the DetermineNextCheckState (i moved
DetermineNextCheckState to a public place), but it doesnt work.

thanks.

 | Replies | Author | Date
2153 | Re: diferents states in VET | Jim Kueneman | Sun 6/3/2001
2154 | Re: diferents states in VET | Ariel Selig | Sun 6/3/2001


Range Check Error

From: [ccdsystems@y...]
Date: Thu May 31, 2001 8:03 pm
Subject: Range Check Error

When I remove the last child from a node, I get a Range Check Error.
However, I do not get it everytime, in fact I get it less than half
the time. Does anyone know where I should look to find what this is?

Thanks,
Spencer

 | Replies | Author | Date
2089 | Re: Range Check Error | Werner Lehmann | Thu 5/31/2001
2124 | Re: Range Check Error | Mike Lischke | Sat 6/2/2001
2197 | Re: Range Check Error | [ccdsystems@y...] | Mon 6/4/2001


re: Design-time nodes - a problem, and a solution - and a question for Mike ;))

From: "Jim Kueneman" [jimdk@m...]
Date: Thu May 31, 2001 8:09 pm
Subject: Re: Design-time nodes - a problem, and a solution - and a question for Mike ;))

--- In [VirtualTreeview@y...], [dragan.juric@q...] wrote:
>
> Look at the top, this "if csDesigning in ComponentState" actually
> makes a problem as it will cause that user-defined data is not
> allocated in design mode. So my program crashed (along with the
> entire Delphi, since my control was in a .bpl) when I tried to clear
> the tree.

Be really careful when deriving from VT the following MUST be
overriden

function TDerivedVT.InternalData(Node: PVirtualNode): Pointer;
{ Does some pointer arithmatic to offset to our internal data.
}
begin
Result := PChar(inherited InternalData(Node)) + inherited
InternalDataSize;
end;

function TDerivedVT.TotalInternalDataSize: Cardinal;
{ Add our data structure size to the internal data size to calculate
the total }
{ internal data stored.
}
begin
Result := inherited TotalInternalDataSize + InternalDataSize;
end;

function TDerivedVT.InternalDataSize: Cardinal;
{ The size of our internal data structure.
}
begin
Result := SizeOf(TMyNewDataForDerivedVT);
end;

Then just use AddChild to add a new node. When wanting to get the
Internal data associated with the node use

NewNodeData := InternalData(SomeNode)

Look at VET for an example, it allows the tree to be filled during
design if the Active property is true.

Jim


Drag&Drop

From: Steffen Binas [steffen.binas@a...]
Date: Thu May 31, 2001 8:29 pm
Subject: Drag&Drop

Hi,

After updating from Version 1.3.1 to 2.4.9 drag&drop does not work anymore.
I tried many options but I did not found the one which enables drag&drop.
What do I have to do to make it work again?

Regards,
Steffen

 | Replies | Author | Date
2090 | Re: Drag&Drop | Werner Lehmann | Thu 5/31/2001
2093 | Re: Drag&Drop | Steffen Binas | Fri 6/1/2001
2095 | Re: Drag&Drop | Jim Kueneman | Fri 6/1/2001
2096 | Re: Drag&Drop | Steffen Binas | Fri 6/1/2001
4882 | Drag&Drop | GIANNAKOPOULOS KOSTAS | Wed 12/5/2001
4892 | Re: Drag&Drop | Mike Lischke | Sat 12/8/2001
4897 | Re: Drag&Drop | Werner Lehmann | Sat 12/8/2001


re: Range Check Error

From: Werner Lehmann [wl@b...]
Date: Thu May 31, 2001 9:14 pm
Subject: Re: [VirtualTreeview] Range Check Error

[ccdsystems@y...] wrote:
>
> When I remove the last child from a node, I get a Range Check Error.
> However, I do not get it everytime, in fact I get it less than half
> the time. Does anyone know where I should look to find what this is?

Make sure that you use the latest version from the file area of the
list (previous versions have had a known RC error). If the error still
happens, find out where (obvious to say but...). Usually the debugger
stops right where the range change error was raised. I guess that some
Cardinal variable is decremented below 0...

Werner


re: Drag&Drop

From: Werner Lehmann [wl@b...]
Date: Thu May 31, 2001 9:18 pm
Subject: Re: [VirtualTreeview] Drag&Drop

Steffen Binas wrote:
>
> After updating from Version 1.3.1 to 2.4.9 drag&drop does not work anymore.
> I tried many options but I did not found the one which enables drag&drop.
> What do I have to do to make it work again?

What properties have you set / changed? Right click your from, view as
text, and copy and paste the part which is about your VTree.

Also, what does that mean, it 'does not work anymore'? The dragging does
not start, is not accepted, the events do not fire or what?

Werner

 | Replies | Author | Date
2093 | Re: Drag&Drop | Steffen Binas | Fri 6/1/2001
2095 | Re: Drag&Drop | Jim Kueneman | Fri 6/1/2001
2096 | Re: Drag&Drop | Steffen Binas | Fri 6/1/2001


TVirtualStringTree with multiline nodes

From: [karak@h...]
Date: Fri Jun 1, 2001 8:17 am
Subject: TVirtualStringTree with multiline nodes

Hello!

How can I draw multiline node with TVirtualStringTree?
Please, see sample
http://groups.yahoo.com/group/VirtualTreeview/files/Bugs/MultiLinesNod
e.zip

Sorry my poor english :(.

Alexey.


re: Drag&Drop

From: Steffen Binas [steffen.binas@a...]
Date: Fri Jun 1, 2001 9:06 am
Subject: Re: [VirtualTreeview] Drag&Drop

At 23:18 31.05.2001, you wrote:
>Steffen Binas wrote:
> >
> > After updating from Version 1.3.1 to 2.4.9 drag&drop does not work anymore.
> > I tried many options but I did not found the one which enables drag&drop.
> > What do I have to do to make it work again?
>
>What properties have you set / changed? Right click your from, view as
>text, and copy and paste the part which is about your VTree.
Here is my tree:
DefaultNodeHeight = 16
DragMode = dmAutomatic
DragType = dtVCL
Header.AutoSizeIndex = 0
Header.Background = clBtnShadow
Header.Columns = <
item
Alignment = taLeftJustify
ImageIndex = 0
Layout = blGlyphLeft
Options = [coAllowClick, coEnabled, coParentBidiMode,
coResizable, coVisible]
Position = 0
Width = 147
end>
Header.Height = 16
Header.Options = [hoAutoResize, hoColumnResize, hoDrag,
hoShowImages]
Header.Style = hsPlates
HintAnimation = hatNone
HintMode = hmDefault
IncrementalSearch = isAll
IncrementalSearchDirection = sdForward
Options = [voAcceptOLEDrop, voAnimatedToggle,
voAutoDropExpand, voAutoScroll, voAutoSpanColumns, voAutoTristateTracking,
voExtendedFocus, voFullRowSelect, voInitOnSave, voShowButtons,
voShowDropmark, voShowTreeLines, voToggleOnDblClick]
ParentFont = False
ParentShowHint = False
PopupMenu = ClipboardPopupMenu
ShowHint = True
TabOrder = 1
OnDragAllowed = VirtualDrawTreeDragAllowed
OnDragDrop = VirtualDrawTreeDragDrop
OnDrawNode = VirtualDrawTreeDrawNode
OnFocusChanged = VirtualDrawTreeFocusChanged
OnFocusChanging = VirtualDrawTreeFocusChanging
OnGetNodeWidth = VirtualDrawTreeGetNodeWidth
OnMouseMove = VirtualDrawTreeMouseMove

>Also, what does that mean, it 'does not work anymore'? The dragging does
>not start
It does not start and no drag&drop-events are fired.

Regards,
Steffen

 | Replies | Author | Date
2095 | Re: Drag&Drop | Jim Kueneman | Fri 6/1/2001
2096 | Re: Drag&Drop | Steffen Binas | Fri 6/1/2001


PopupComponent

From: GIANNAKOPOULOS KOSTAS [kyan@s...]
Date: Fri Jun 1, 2001 9:12 am
Subject: PopupComponent

Good morning mike.

Please set TPopupMenu.PopupComponent to the VT self pointer before
popping-up a PopupMenu (like header popup or node popup).
This is helpful when a popupmenu is shared between mant VT's, you can
examine the value of PopupComponent in a TMenuItem.OnClick event handler to
find out which VT was right-clicked.

Thanks

<KY>

 | Replies | Author | Date
2121 | Re: PopupComponent | Mike Lischke | Sat 6/2/2001


re: Drag&Drop

From: "Jim Kueneman" [jimdk@m...]
Date: Fri Jun 1, 2001 2:18 pm
Subject: Re: Drag&Drop

--- In [VirtualTreeview@y...], Steffen Binas [steffen.binas@a...] wrote:

> DefaultNodeHeight = 16
> DragMode = dmAutomatic
> DragType = dtVCL

> OnDragAllowed = VirtualDrawTreeDragAllowed

It looks ok, you do realize that OnDragAllowed won't get called with
DragMode = dmAutomatic it must be dmManual.

There is a file on in the Files area called OLE.zip that demos D&D. It
is missing a resource for the RTF and needs to have the DoDragDrop
parameters updated but it works. It uses VCL and OLE D&D. I also
dropped a new VT on it and set RootsNodes = 5 and the drag drop
worked.

Jim

 | Replies | Author | Date
2096 | Re: Drag&Drop | Steffen Binas | Fri 6/1/2001


re: Re: Drag&Drop

From: Steffen Binas [steffen.binas@a...]
Date: Fri Jun 1, 2001 2:46 pm
Subject: Re: [VirtualTreeview] Re: Drag&Drop

At 16:18 01.06.2001, you wrote:
>--- In [VirtualTreeview@y...], Steffen Binas [steffen.binas@a...] wrote:
>
> > DefaultNodeHeight = 16
> > DragMode = dmAutomatic
> > DragType = dtVCL
>
> > OnDragAllowed = VirtualDrawTreeDragAllowed
>
>It looks ok, you do realize that OnDragAllowed won't get called with
>DragMode = dmAutomatic it must be dmManual.
Switching from dmAutomatic to dmManual made it work again. Thank you.

Regards,
Steffen


VirtualTreeview Demos

From: "Brian" [bghugg@a...]
Date: Fri Jun 1, 2001 3:11 pm
Subject: VirtualTreeview Demos

Hi,

Are there demos available for using the 2.4+ versions of
VirtualTreeview?

Thanks,
Brian

 | Replies | Author | Date
2129 | Re: VirtualTreeview Demos | Mike Lischke | Sat 6/2/2001
2157 | Re: VirtualTreeview Demos | [mdissel@h...] | Sun 6/3/2001
2227 | Re: VirtualTreeview Demos | Brian | Tue 6/5/2001
2257 | Re: VirtualTreeview Demos | Mike Lischke | Thu 6/7/2001


VET --Explorer Shell Extensions

From: [adembaba@e...]
Date: Fri Jun 1, 2001 4:20 pm
Subject: VET --Explorer Shell Extensions

Jim,

This is not strictly related to VET, but, the fact
that the need to ask this question arises from the
usage of VET... --phew, I should have been
a lawyer ;-)

Anyway, here is the question: Is it possible to
limit (i.e. enable/disable, show/not show) then
menu items when a user write clicks on an item
on VET?

If so, could you show us how, please.

Cheers,
Adem

 | Replies | Author | Date
2099 | Re: VET --Explorer Shell Extensions | Jim Kueneman | Fri 6/1/2001
2100 | Re: VET --Explorer Shell Extensions | [adembaba@e...] | Fri 6/1/2001
2101 | Re: VET --Explorer Shell Extensions | Jim Kueneman | Fri 6/1/2001


re: VET --Explorer Shell Extensions

From: "Jim Kueneman" [jimdk@m...]
Date: Fri Jun 1, 2001 5:38 pm
Subject: Re: VET --Explorer Shell Extensions

--- In [VirtualTreeview@y...], [adembaba@e...] wrote:
>
> Anyway, here is the question: Is it possible to
> limit (i.e. enable/disable, show/not show) then
> menu items when a user write clicks on an item
> on VET?

Not the way it is now. I ususally frown on apps that modify the way I
expect Windows to work.

Also other than the defined items with universal verbs like "copy" or
"open" it will be language dependant trying to find the item in
question to disable.

Jim

 | Replies | Author | Date
2100 | Re: VET --Explorer Shell Extensions | [adembaba@e...] | Fri 6/1/2001
2101 | Re: VET --Explorer Shell Extensions | Jim Kueneman | Fri 6/1/2001


re: VET --Explorer Shell Extensions

From: [adembaba@e...]
Date: Fri Jun 1, 2001 6:03 pm
Subject: Re: VET --Explorer Shell Extensions

OK, here is the scenario:

Dude finds VET to be a great component, and
attempts to come up with an MS Windows Explorer
replacement so that people on the network will
be given that new thing which will be faster
and more useful.

Dude realizes that not everyone on their MS WinNT
Terminal Server Ed OS knows how not to burn their
hands... Some menu items must be disabled.

Dude does not know how to do that...

Cheers,

--- In [VirtualTreeview@y...], "Jim Kueneman" [jimdk@m...] wrote:
> --- In [VirtualTreeview@y...], [adembaba@e...] wrote:
> >
> > Anyway, here is the question: Is it possible to
> > limit (i.e. enable/disable, show/not show) then
> > menu items when a user write clicks on an item
> > on VET?
>
>
> Not the way it is now. I ususally frown on apps that modify the
way I
> expect Windows to work.
>
>
> Also other than the defined items with universal verbs like "copy"
or
> "open" it will be language dependant trying to find the item in
> question to disable.
>
> Jim

 | Replies | Author | Date
2101 | Re: VET --Explorer Shell Extensions | Jim Kueneman | Fri 6/1/2001


re: VET --Explorer Shell Extensions

From: "Jim Kueneman" [jimdk@m...]
Date: Fri Jun 1, 2001 7:53 pm
Subject: Re: VET --Explorer Shell Extensions

--- In [VirtualTreeview@y...], [adembaba@e...] wrote:

> Dude realizes that not everyone on their MS WinNT
> Terminal Server Ed OS knows how not to burn their
> hands... Some menu items must be disabled.
>
> Dude does not know how to do that...

Does Dude currently somehow disable these items in Explorer?

Jim


New file uploaded to VirtualTreeview

From: [VirtualTreeview@yahoogroups.com>
Date: Sat Jun 2, 2001 3:12 am
Subject: New file uploaded to VirtualTreeview

Hello,

This email message is a notification to let you know that
a file has been uploaded to the Files area of the VirtualTreeview
group.

File : /VET_V1.1.18.zip
Uploaded by : [jimdk@m...]
Description : Virtual Explorer Tree version 1.1.18

You can access this file at the URL

http://groups.yahoo.com/group/VirtualTreeview/files/VET_V1.1.18.zip

To learn more about file sharing for your group, please visit

http://help.yahoo.com/help/us/groups/files

Regards,

jimdk@m...]


VET Version 1.1.18 with Explorer Shell Extensions

From: "Jim Kueneman" [jimdk@m...]
Date: Sat Jun 2, 2001 3:20 am
Subject: VET Version 1.1.18 with Explorer Shell Extensions

A new version of VET is up.

It includes, by popular demand, a hook into the Context Menu. It is
now possible to modify the menu before it is displayed. The demo has
been updated to show how to:

1) Disable menu items (this can be tricky depending on language some
are language independant such as Cut, Copy, Properties, Open etc.)
2) Add new custom menu items WITHOUT writing shell extensions!!!

also now VET includes an event that allows you to show help hints for
context menus as the user browses the menu, see the demo.

Enjoy Dude <g>

Jim

 | Replies | Author | Date
2104 | Re: VET Version 1.1.18 with Explorer Shell Extens | [adembaba@e...] | Sat 6/2/2001
2105 | Re: VET Version 1.1.18 with Explorer Shell Extens | Jim Kueneman | Sat 6/2/2001


re: VET Version 1.1.18 with Explorer Shell Extensions

From: [adembaba@e...]
Date: Sat Jun 2, 2001 4:23 am
Subject: Re: VET Version 1.1.18 with Explorer Shell Extensions

Dude wishes to be construed to represent
the silent majority of this forum and thereby
express gratitude as well as admiration for
the talent and applied knowledge that lead to
prompt delivery :-)

Cheers,
Adem

--- In [VirtualTreeview@y...], "Jim Kueneman" [jimdk@m...] wrote:
> A new version of VET is up.
>
> It includes, by popular demand, a hook into the Context Menu. It is
> now possible to modify the menu before it is displayed. The demo
has
> been updated to show how to:
>
> 1) Disable menu items (this can be tricky depending on language
some
> are language independant such as Cut, Copy, Properties, Open etc.)
> 2) Add new custom menu items WITHOUT writing shell extensions!!!
>
> also now VET includes an event that allows you to show help hints
for
> context menus as the user browses the menu, see the demo.
>
> Enjoy Dude <g>
>
>
> Jim

 | Replies | Author | Date
2105 | Re: VET Version 1.1.18 with Explorer Shell Extens | Jim Kueneman | Sat 6/2/2001


re: VET Version 1.1.18 with Explorer Shell Extensions

From: "Jim Kueneman" [jimdk@m...]
Date: Sat Jun 2, 2001 1:24 pm
Subject: Re: VET Version 1.1.18 with Explorer Shell Extensions

--- In [VirtualTreeview@y...], [adembaba@e...] wrote:
> Dude wishes to be construed to represent
> the silent majority of this forum and thereby
> express gratitude as well as admiration for
> the talent and applied knowledge that lead to
> prompt delivery :-)

If you keep talking like that I will reconcider any future changes
<g>.

Jim


VET 1.1.18 Bug

From: "Jim Kueneman" [jimdk@m...]
Date: Sat Jun 2, 2001 1:26 pm
Subject: VET 1.1.18 Bug

There was a bug in the ANSI version of the Context Menu Hint code. If
you downloaded 1.1.18 please download it again with this little bug
fixed.

Jim


re: 2 Q's about VET.

From: "Jim Kueneman" [jimdk@m...]
Date: Sat Jun 2, 2001 1:33 pm
Subject: Re: 2 Q's about VET.

--- In [VirtualTreeview@y...], [tias@m...] wrote:
Hi Mathias

> Second, the BrowseTo() method returns before the complete tree is
> updated.

Did you ever figure this out?

> 2: Trying to ->BrowseTo() a network path (eg:
> \\RemoteMachine\RemFolder\) seems to work fine. (Can't test it here
> since my laptop has no ethernet adapter, but it works for the guys

They must be using Win2k because it has a problem in NT 4. The
shell added a new level in the Network Neighborhood folder which
IShellFolder.ParseDisplayName was never updated to reflect this level
so the returned PIDL is missing this new folder!

> I find this a little strange, since I'm perfectly able to issue a
> "dir \\MyMachine\C$\" command from a MS-DOS prompt. (Note: To be
> able to do this, I must be connected to the Internet, but that's my
> normal state anyway...)

In NT 4 IShellFolder.ParseDisplayName (which is how you convert a path
to a PIDL) this seem to be broken or unimplemented. My guess the
latter.

Jim

 | Replies | Author | Date
2108 | Re: 2 Q's about VET. | [adembaba@e...] | Sat 6/2/2001
2109 | Re: 2 Q's about VET. | Jim Kueneman | Sat 6/2/2001
2142 | Checkboxes | Jim Kueneman | Sat 6/2/2001
2143 | Re: Checkboxes | Mike Lischke | Sat 6/2/2001
2144 | Re: Checkboxes | Jim Kueneman | Sat 6/2/2001


re: 2 Q's about VET.

From: [adembaba@e...]
Date: Sat Jun 2, 2001 1:56 pm
Subject: Re: 2 Q's about VET.

> In NT 4 IShellFolder.ParseDisplayName (which is how you
> convert a path to a PIDL) this seem to be broken or
> unimplemented. My guess the latter.

Jim,

I have no idea what you are both talking about, but I did
a quick Google search (for IShellFolder ParseDisplayName)
and found the link below

http://msdn.microsoft.com/library/psdk/shellcc/shell/IFaces/IShellFold
er/ParseDisplayName.htm

which says:

Requirements
Version 4.00 and later of Shell32.dll
Windows NT/2000: Requires Windows NT 4.0 or later.
Windows 95/98: Requires Windows 95 or later.
Header: Declared in shlobj.h.

Does this help?

Cheers,

 | Replies | Author | Date
2109 | Re: 2 Q's about VET. | Jim Kueneman | Sat 6/2/2001
2142 | Checkboxes | Jim Kueneman | Sat 6/2/2001
2143 | Re: Checkboxes | Mike Lischke | Sat 6/2/2001
2144 | Re: Checkboxes | Jim Kueneman | Sat 6/2/2001


re: Re: 2 Q's about VET.

From: Jim Kueneman [jimdk@m...]
Date: Sat Jun 2, 2001 2:10 pm
Subject: Re: [VirtualTreeview] Re: 2 Q's about VET.

At 01:56 PM 6/2/2001 +0000, you wrote:
> > In NT 4 IShellFolder.ParseDisplayName (which is how you
> > convert a path to a PIDL) this seem to be broken or
> > unimplemented. My guess the latter.
>
>Jim,
>
>I have no idea what you are both talking about, but I did
>
>Does this help?

No <g>. The shell has only really been well documented in the past few
years (since 2k) mainly, I think, because M$ still had not decided how the
shell should work. Because it was sort of a bunch of rebels writing
undocumented code a fair number of bugs / omissions occurred which Explorer
has overcome with hacks and patches. I read one article where insiders at
M$ admitted that fact.

Mathias,

Exactly what should

\\MyMachine\C$\

give you anyway? ( I am a bit Network illiterate )

Jim


re: DragManager

From: "Mike Lischke" [public@l...]
Date: Sat Jun 2, 2001 2:20 pm
Subject: RE: [VirtualTreeview] DragManager

Hi Kostas,

> Actually, you have no reason to do this; it works. As i said my intension
> was not to find a "fault" in your code, which i think is great, just to
> express my (academic maybe) concern about this issue.

I have no problems getting critics about my code. As long as they are
constructive (and your's was) then all is fine and well. And you are right too,
so I changed the implemented to use interfaces instead of the COM objects and
everything seems to be fine. Well, some test must still be made and Jim has to
make two small changes due my changes, but otherwise...

Ciao, Mike

 | Replies | Author | Date
2135 | Re: DragManager | Jim Kueneman | Sat 6/2/2001


re: Re: New file.. also RightExtent Calculation

From: "Mike Lischke" [public@l...]
Date: Sat Jun 2, 2001 2:20 pm
Subject: RE: [VirtualTreeview] Re: New file.. also RightExtent Calculation

Hi Jim,

> >I'm already happy with the UnitDoc file and additional images if you have
some.
> I have been making them as I need them. Anything special you are thinking of?

No, not really. I could imagine that you perhaps like to include a screen shot,
detail view or other graphic when explaining things.

> I have noticed that when I am expanding the parent to the
> folder that contains all these items it takes a long time sometimes. I
> tracked it down to the Scrollbar update code. GetNextVisibleNode, called
> from GetMaxRightExtend, there is this line:
>
> It acts like it initializes the 16,000 nodes the in the folder when VT is
> expanding the parent to this folder, is that right?

No, this is not the case. GetMaxRightExtend only initializes the nodes
currently in view (if necessary) to get the maximum width. This is only
necessary if there is no column used, because the horizontal scrollbar must be
updated.

> function GetFirstVisibleNoInit: PVirtualNode;
> What is the difference?

The *NoInit navigation functions do not initialize nodes as they come along.
This means they are faster but may skip nodes if they are not yet initialized
(child nodes!).

Ciao, Mike

 | Replies | Author | Date
2146 | Re: New file.. also RightExtent Calculation | Jim Kueneman | Sat 6/2/2001


re: Hidden nodes bug

From: "Mike Lischke" [public@l...]
Date: Sat Jun 2, 2001 2:20 pm
Subject: RE: [VirtualTreeview] Hidden nodes bug

Hi Cyril,

> I've tracked down a problem with the handling of Hidden nodes. Sometime
> after expanding and collapsing nodes with hidden chidren the tree won't
> redraw at all. The problem seems to happen only when the client area is
> filled (ie the vertical scrollbar appear).

Thank you very much for your precise analysis. Obviously there is a side effect
I have not
considered yet. By using your conclusions and doing some research on my own I
came up with a
solution which should solve your problem as well as other potential ones. There
is now no longer an
update of the vertical scroll bar in AdjustTotalHeight as this method is always
called from code
which adjusts the scroll bar finally (and is also a private method). Please
verify that it really
works with your stuff too as soon as I have uploaded a new build.

Ciao, Mike


re: IVTEditLink missing CanClose for valid a value

From: "Mike Lischke" [public@l...]
Date: Sat Jun 2, 2001 2:20 pm
Subject: RE: [VirtualTreeview] IVTEditLink missing CanClose for valid a value

Hi Roland,

> I use VT and the interface IVTEditLink to build a propertyeditor for
> device settings.
> The programs works fine, but I must validate the values of the edit-
> components, and now I miss a function like CanClose

Well, CanStop (or CanClose for that matter) are only more complex solutions of
what would be
possible. Why not let EditLink.EndEdit and EditLink.CancelEdit decide whether
or not to stop
editiing? I have changed VT now so that it uses these functions to determine
how to act.

Ciao, Mike


re: SaveToFile causes vsHasChildren state to be removed

From: "Mike Lischke" [public@l...]
Date: Sat Jun 2, 2001 2:20 pm
Subject: RE: [VirtualTreeview] SaveToFile causes vsHasChildren state to be removed

Hi Paul,

> When saving to a file, VT removes the vsHasChildren state from all
> nodes that don't have actual nodes below them.

Actually, I'm not aware that VT removes the vsHasChildren style on save. The
only places where this
happens is when a node gets deleted/disconnected. Additionally this style is
also removed when
InitChildren returns 0 child nodes. So perhaps this is the reason? You can
prevent this behavior by
removing voInitOnSave from Tree.Options.

Ciao, Mike


re: Miltiline node

From: "Mike Lischke" [public@l...]
Date: Sat Jun 2, 2001 2:20 pm
Subject: RE: [VirtualTreeview] Miltiline node

Alexey,

> How can I draw miltiline node with TVirtualStringTree?

As I already told you privately the string tree is able to draw multiple lines
but cannot position it correctly yet. I have taken this into the todo list. For
the time being use the draw tree and paint the text yourself.

Ciao, Mike


re: Small bug and toggle animation

From: "Mike Lischke" [public@l...]
Date: Sat Jun 2, 2001 2:20 pm
Subject: RE: [VirtualTreeview] Small bug and toggle animation

Hi Werner,

> Ok, I see that more steps are needed to reproduce: if I try it right away
> it works. But if I select the last node, then ctrl+page-up (1 or more times)
> I cannot get back with ctrl+page-down (no effect at all). If the second to
> last node is selected ctrl+page-down will scroll one node down each time
> instead.

You are right, there was actually too much handling in the key down handler for
the prior/next keys
with ctrl. Fixed :o)

Ciao, Mike


re: Incremental Searching

From: "Mike Lischke" [public@l...]
Date: Sat Jun 2, 2001 2:20 pm
Subject: RE: [VirtualTreeview] Incremental Searching

> I have the impression that the algorithm depends on the length of the buffer.
Specifically,
> if less than two keys are in the buffer (0 or 1 chars) the algorithms prefers
to find the
> next file beginning with the new key *iff* the new key is the same as the
single char already
> in the buffer. If this condition is false a similar approach to the described
above seems to
> be taken.

Mmh, this could well be, particularly as it works well for most of the cases. I
have implemented it
that way and it seems now to work no exactly as in Explorer.

Ciao, Mike


re: ScrollIntoView

From: "Mike Lischke" [public@l...]
Date: Sat Jun 2, 2001 2:19 pm
Subject: RE: [VirtualTreeview] ScrollIntoView

Hi Mark,

> My setup is giving me slightly odd behaviour with this function. If
> the node in question is anywhere in the tree except right at the
> bottom, then all is fine. However, if it is the very last node, then
> calling ScrollIntoView doesn't give me the expected result, instead
> the node I'm trying to scroll into view is just off the bottom of the
> client area.

Sorry, I don't understand your problem. This might be due to my limited
understanding of the english language. What I can reproduce is that if I scroll
the very last node into view the the tree is scroll so that the bottom border
of the last node is at the bottom border of the treeview. This is correct
behavior so what goes wrong in your case?

Ciao, Mike

 | Replies | Author | Date
2155 | Re: ScrollIntoView | Mark Austen | Sun 6/3/2001
2160 | Re: ScrollIntoView | Mike Lischke | Sun 6/3/2001
2175 | Re: ScrollIntoView | Mark Austen | Sun 6/3/2001
2291 | Re: ScrollIntoView | Mike Lischke | Sat 6/9/2001


re: Whistler

From: "Mike Lischke" [public@l...]
Date: Sat Jun 2, 2001 2:20 pm
Subject: RE: [VirtualTreeview] Whistler

> Can you elaborate more what trouble this is? Has MS warned about the usage of
> this?

No, no warnings I'm aware of, just conclusion of attempts I made with the first
beta. I have now
beta 2 installed and it seems to be better. I'm not fully through it but some
of the trees in the
demos show already the new scroll bars, so it seems to be possible to unify
both worlds.

>> If I can get everything working even with the FlatSB APIs then I will
keep'em otherwise they will
be fired.

> This statement leaves not much room for an open-ended discussion.

I should have added a smiley to my sentence. Of course there is always the
option to include flat
scroll bars conditionally.

Ciao, Mike


re: Design-time nodes - a problem, and a solution - and a question for Mike ;))

From: "Mike Lischke" [public@l...]
Date: Sat Jun 2, 2001 2:20 pm
Subject: RE: [VirtualTreeview] Design-time nodes - a problem, and a solution - and a question for Mike ;))

Hi Dragan,

> I derived a control from your control (a tree from a tree), and I
> made it so that it can display the actual data even in design mode,
> like Borland data-aware components.
>
> Look at the top, this "if csDesigning in ComponentState" actually
> makes a problem as it will cause that user-defined data is not
> allocated in design mode. So my program crashed (along with the
> entire Delphi, since my control was in a .bpl) when I tried to clear
> the tree.

Well, you still have an old version of VT. I have already redesigned this
method. Download the latest beta from this mailing list to get up-to-date
source code.

Ciao, Mike


re: PopupComponent

From: "Mike Lischke" [public@l...]
Date: Sat Jun 2, 2001 2:20 pm
Subject: RE: [VirtualTreeview] PopupComponent

Hi Kostas,

> Please set TPopupMenu.PopupComponent to the VT self pointer before
> popping-up a PopupMenu (like header popup or node popup).

This was already set for "normal" menus, only for the header I forgot to set
this property. Now this is fixed.

Ciao, Mike


re: Tri-state checking

From: "Mike Lischke" [public@l...]
Date: Sat Jun 2, 2001 2:20 pm
Subject: RE: [VirtualTreeview] Tri-state checking

Hi Ian,

> I set a node's CheckType to ctTriState, but it will not tri-state
> check with the mouse. i assume this is by design - although i wish it
> weren't.

If you want to have automatic updates then enable them with
voAutoTristateTracking in Tree.Options.

> Could you please add a (const OldValue: TCheckState) to OnChecking so
> that i know what the value was before they checked it...so i can gray
> it myself in code?

What about Node.CheckState?

Ciao, Mike

 | Replies | Author | Date
2147 | Re: Tri-state checking | [youngpup_SH_@h...] | Sat 6/2/2001


re: Resize uses a cache ???

From: "Mike Lischke" [public@l...]
Date: Sat Jun 2, 2001 2:20 pm
Subject: RE: [VirtualTreeview] Resize uses a cache ???

Hi,

> I've got this tiny problem in my app:
> I use a virtuallistview and I dynamically change its layout to store
> different datas. I change header number, caption, size...
>
> When I do a ctrl + in it, all col are resized ok.
>
> Then, I change the layout of the list, and put smaller items in it:
> the resize function still resize on previous datas !

My bet is you need to call InvalidateNode to reset also a nodes internally
stored width when changing the text.

Ciao, Mike


re: Range Check Error

From: "Mike Lischke" [public@l...]
Date: Sat Jun 2, 2001 2:20 pm
Subject: RE: [VirtualTreeview] Range Check Error

Spencer,

> When I remove the last child from a node, I get a Range Check Error.
> However, I do not get it everytime, in fact I get it less than half
> the time. Does anyone know where I should look to find what this is?

Can you make me a demo which shows this behavior?

Ciao, Mike

 | Replies | Author | Date
2197 | Re: Range Check Error | [ccdsystems@y...] | Mon 6/4/2001


re: Re: infinite painting problem FIXED

From: "Mike Lischke" [public@l...]
Date: Sat Jun 2, 2001 2:19 pm
Subject: RE: [VirtualTreeview] Re: infinite painting problem FIXED

Hi Spencer,

> I found what the problem was. Depending on what I wanted to display,
> I was switching between 2 image lists to get the icon. This was
> causing headaches for the tree view. Once I put all the icons in one
> image list, things cleared up.

Aaah, yes indeed. When switching images then a repaint is issued because the
tree must reflect the new images.

Ciao, Mike


re: Can't select node with keyboard.

From: "Mike Lischke" [public@l...]
Date: Sat Jun 2, 2001 2:20 pm
Subject: RE: [VirtualTreeview] Can't select node with keyboard.

Hi Simon,

> If i select a node with the mouse everything works ok. If i then
> press the up or down arrow the focus shifts in the tree but the
> Tree.SelectedCount drops to 0.

How do you determine the selection count and which version of VT do you use for
your tests?

Ciao, Mike

 | Replies | Author | Date
2192 | Re: Can't select node with keyboard. | [SimonMoscrop@H...] | Mon 6/4/2001
2287 | Re: Can't select node with keyboard. | Mike Lischke | Sat 6/9/2001
2353 | Re: Can't select node with keyboard. | [SimonMoscrop@H...] | Mon 6/11/2001


re: Visual garbage when sizing tree

From: "Mike Lischke" [public@l...]
Date: Sat Jun 2, 2001 2:20 pm
Subject: RE: [VirtualTreeview] Visual garbage when sizing tree

> When i size the entire tree (i.e. resizing the form when the tree is
> Align=alClient causes garbage to be left behind. i could this a bug
> that the tree doesn't repaint itself as needed.

Sounds like an older tree version. Try the latest beta (if you don't depend on
the demos as they are on my homepage).

> Additionally...can you supply an OnResize event when the tree IS
> resizing (so i could call an Invalidate myself if needed).

This is already there for a while (in the new source on YG).

Ciao, Mike


re: 2 problems (DDManager.RenderData and Hints)

From: "Mike Lischke" [public@l...]
Date: Sat Jun 2, 2001 2:21 pm
Subject: RE: [VirtualTreeview] 2 problems (DDManager.RenderData and Hints)

Hi Paul,

> This is in function TVTDragDropManager.RenderData function where you assume
> that control is TVirtualStrintTree.

Yes this was a bug. I have included a check now. Drawtrees cannot render text
to the clipboard.

> 2. Again then problem with splitter mark.

Please be so kind and reiterate what the problem was. I can't recall.

Ciao, Mike


re: VirtualTreeview Demos

From: "Mike Lischke" [public@l...]
Date: Sat Jun 2, 2001 2:21 pm
Subject: RE: [VirtualTreeview] VirtualTreeview Demos

Hi Brian,

> Are there demos available for using the 2.4+ versions of
> VirtualTreeview?

Not yet. I can upload to YG the stuff as I have it now if you like...

Ciao, Mike

 | Replies | Author | Date
2157 | Re: VirtualTreeview Demos | [mdissel@h...] | Sun 6/3/2001
2227 | Re: VirtualTreeview Demos | Brian | Tue 6/5/2001


re: Bug in VT <= 2.4.16 - FullExpand

From: "Mike Lischke" [public@l...]
Date: Sat Jun 2, 2001 2:21 pm
Subject: RE: [VirtualTreeview] Bug in VT <= 2.4.16 - FullExpand

Hi Vadim,

> else
> Stop := Node.NextSibling;
> ^^^^^^^^^^^^^^^^^^^^^^^^^
> will be NIL for last sibling

And? I cannot follow what the bug is. For the last node its next sibling is
nil, yes, but this is
the correct stop condition.

Ciao, Mike


New file uploaded to VirtualTreeview

From: [VirtualTreeview@yahoogroups.com>
Date: Sat Jun 2, 2001 2:23 pm
Subject: New file uploaded to VirtualTreeview

Hello,

This email message is a notification to let you know that
a file has been uploaded to the Files area of the VirtualTreeview
group.

File : /VirtualTree 2.4.20.zip
Uploaded by : [public@l...]
Description : Beta version

You can access this file at the URL

http://groups.yahoo.com/group/VirtualTreeview/files/VirtualTree%202.4.20.zip

To learn more about file sharing for your group, please visit

http://help.yahoo.com/help/us/groups/files

Regards,

public@l...]


re: New file uploaded to VirtualTreeview

From: Kent Briggs [kbriggs@b...]
Date: Sat Jun 2, 2001 2:57 pm
Subject: Re: [VirtualTreeview] New file uploaded to VirtualTreeview

> You can access this file at the URL
>
> http://groups.yahoo.com/group/VirtualTreeview/files/VirtualTree%202.4.20.zip

Mike,

By the way, we're still getting a "%20" (percent twenty) in the file name where
you are apparently putting a space character in front of the version number.
It's no big deal as I always remove it manually on the save but thought you'd
like to know. I'm using Netscape 4.7.

--
Kent Briggs, [kbriggs@b...]
Briggs Softworks, http://www.briggsoft.com

 | Replies | Author | Date
2133 | Re: New file uploaded to VirtualTreeview | Mike Lischke | Sat 6/2/2001


re: New file uploaded to VirtualTreeview

From: "Mike Lischke" [public@l...]
Date: Sat Jun 2, 2001 3:02 pm
Subject: RE: [VirtualTreeview] New file uploaded to VirtualTreeview

Hi Kent,

> By the way, we're still getting a "%20" (percent twenty) in the file name
where
> you are apparently putting a space character in front of the version number.
> It's no big deal as I always remove it manually on the save but thought you'd
> like to know. I'm using Netscape 4.7.

Thank you for letting me know. Well, I have no problems with IE and such names
and I hesitate to
cripple the file name just because NS cannot handle it. But if there is
somebody getting real
problems with this space character then I will remove it.

Ciao, Mike


New file uploaded to VirtualTreeview

From: [VirtualTreeview@yahoogroups.com>
Date: Sat Jun 2, 2001 3:07 pm
Subject: New file uploaded to VirtualTreeview

Hello,

This email message is a notification to let you know that
a file has been uploaded to the Files area of the VirtualTreeview
group.

File : /VET_V1.1.20.zip
Uploaded by : [jimdk@m...]
Description : Virtual Explorer Tree Version 1.4.20 (for VT 1.4.20)

You can access this file at the URL

http://groups.yahoo.com/group/VirtualTreeview/files/VET_V1.1.20.zip

To learn more about file sharing for your group, please visit

http://help.yahoo.com/help/us/groups/files

Regards,

jimdk@m...]


re: DragManager

From: "Jim Kueneman" [jimdk@m...]
Date: Sat Jun 2, 2001 3:18 pm
Subject: Re: DragManager

--- In [VirtualTreeview@y...], "Mike Lischke" [public@l...] wrote:

must still be made and Jim has to make two small changes due my
changes, but otherwise...

VET is updated and now carries the version 1.4.20 to keep it in line
with VT (I have added enough stuff to justify the increase the minor
version to 4 <g>)

I had an AV on closing VET the first time I compiled and ran it,
although lots of odd things were happening. It may have been because
I did not force a complete rebuild and it was using an old dcu for the
component or something.

Subsequent builds have been fine.

Jim


New file uploaded to VirtualTreeview

From: [VirtualTreeview@yahoogroups.com>
Date: Sat Jun 2, 2001 4:58 pm
Subject: New file uploaded to VirtualTreeview

Hello,

This email message is a notification to let you know that
a file has been uploaded to the Files area of the VirtualTreeview
group.

File : /VSTEdit.zip
Uploaded by : [Manfred@F...]
Description : Editors for VirtualStringTree V1.0.2 Beta

You can access this file at the URL

http://groups.yahoo.com/group/VirtualTreeview/files/VSTEdit.zip

To learn more about file sharing for your group, please visit

http://help.yahoo.com/help/us/groups/files

Regards,

Manfred@F...]


VST Editors

From: [Manfred@F...]
Date: Sat Jun 2, 2001 5:00 pm
Subject: VST Editors

I have added a new version of my editors for VirtualStringTree. No
changes, only compatible with version 2.4.20 of VST.

cu
Manfred

 | Replies | Author | Date
2139 | Re: VST Editors | Mike Lischke | Sat 6/2/2001


re: Bug in VT <= 2.4.16 - FullExpand

From: "Vadim Sedulin" [wsntrl@o...]
Date: Sat Jun 2, 2001 5:33 pm
Subject: Re: [VirtualTreeview] Bug in VT <= 2.4.16 - FullExpand

Hello Mike!

>> else
>> Stop := Node.NextSibling;
>> ^^^^^^^^^^^^^^^^^^^^^^^^^
>> will be NIL for last sibling
>
> And? I cannot follow what the bug is. For the last node its next sibling
is nil, yes, but this is
> the correct stop condition.

AFAIK GetNext (used in FullExpand) returns NIL after very last node in tree.
Right? So, if Node.Parent[.Parent...].NextSibling is not nil, it will be
full expanded too. Or I miss something?

Bye.

Vadim Sedulin
E-Mail: [wsntrl@o...]

 | Replies | Author | Date
2162 | Re: Bug in VT <= 2.4.16 - FullExpand | Mike Lischke | Sun 6/3/2001


re: VST Editors

From: "Mike Lischke" [public@l...]
Date: Sat Jun 2, 2001 5:34 pm
Subject: RE: [VirtualTreeview] VST Editors

> VET is updated and now carries the version 1.4.20 to keep it in line
> with VT (I have added enough stuff to justify the increase the minor
> version to 4 <g>)

...

> I have added a new version of my editors for VirtualStringTree. No
> changes, only compatible with version 2.4.20 of VST.

You are really fast, guys :o)

Ciao, Mike


re: InitNode VET

From: Jim Kueneman [jimdk@m...]
Date: Sat Jun 2, 2001 6:23 pm
Subject: Re: [VirtualTreeview] InitNode VET

At 06:02 PM 6/2/2001 +0000, you wrote:
>hello
>becasue i want to change all the checkstate of the childs of that
>node. and it seams that they are initialized "only" the nodes that
>are visible (?)

I am not sure if I know exactly what you are after but how about

procedure ReinitChildren(Node: PVirtualNode; Recursive: Boolean);
procedure ReinitNode(Node: PVirtualNode; Recursive: Boolean); ?

>by the way, i made a procedure that paints a header like WinXP, if u
>want i can send it to you? (by mail?)

Sure:

[jimdk@m...]

Jim


Checkboxes

From: Jim Kueneman [jimdk@m...]
Date: Sat Jun 2, 2001 6:39 pm
Subject: Checkboxes

At the risk of looking like and idiot, how the heck do you make the
checkboxes show up next to an item in VT. I have been trying to do this
for weeks on and off and I don't get it!

Jim

 | Replies | Author | Date
2143 | Re: Checkboxes | Mike Lischke | Sat 6/2/2001
2144 | Re: Checkboxes | Jim Kueneman | Sat 6/2/2001


re: Checkboxes

From: "Mike Lischke" [public@l...]
Date: Sat Jun 2, 2001 6:40 pm
Subject: RE: [VirtualTreeview] Checkboxes

Jim,

> At the risk of looking like and idiot, how the heck do you make the
> checkboxes show up next to an item in VT. I have been trying to do this
> for weeks on and off and I don't get it!

Just set voCheckSupport and a check type in a node (you can directly use the
node member, e.g. in
OnInitNode) or you can use Tree.CheckType/Tree.CheckState.

Ciao, Mike

 | Replies | Author | Date
2144 | Re: Checkboxes | Jim Kueneman | Sat 6/2/2001


re: Checkboxes

From: Jim Kueneman [jimdk@m...]
Date: Sat Jun 2, 2001 7:11 pm
Subject: RE: [VirtualTreeview] Checkboxes

At 08:40 PM 6/2/2001 +0200, you wrote:
>Just set voCheckSupport and a check type in a node (you can directly use
>the node member, e.g. in
>OnInitNode) or you can use Tree.CheckType/Tree.CheckState.

All I can say is dooh!

Thanks,
Jim


DoChecking Need a "var"

From: "Ariel Selig" [asel98@y...]
Date: Sat Jun 2, 2001 7:32 pm
Subject: DoChecking Need a "var"

function TBaseVirtualTree.DoChecking(Node: PVirtualNode;
NewCheckState: TCheckState): Boolean;

i think that function needs a "var" for the NewCheckState variable.
its the unique way to change the newchechstate. no?
if u look in code, it seams that.

tnx.

 | Replies | Author | Date
2156 | Re: DoChecking Need a "var" | Mike Lischke | Sun 6/3/2001


re: Re: New file.. also RightExtent Calculation

From: Jim Kueneman [jimdk@m...]
Date: Sat Jun 2, 2001 8:05 pm
Subject: RE: [VirtualTreeview] Re: New file.. also RightExtent Calculation

At 04:20 PM 6/2/2001 +0200, you wrote:
>Hi Jim,
>
> > I have noticed that when I am expanding the parent to the
> > folder that contains all these items it takes a long time sometimes. I
> > tracked it down to the Scrollbar update code. GetNextVisibleNode, called
> > from GetMaxRightExtend, there is this line:
> >
> > It acts like it initializes the 16,000 nodes the in the folder when VT is
> > expanding the parent to this folder, is that right?
>
>No, this is not the case. GetMaxRightExtend only initializes the nodes
>currently in view (if necessary) to get the maximum width. This is only
>necessary if there is no column used, because the horizontal scrollbar
>must be updated.

Now that I look at it more I actually I think this is Windows caching the
information. If I use Explorer to look at these files first then VET it
does not have this delay. Also the delay is only the first time I access
the folder.

Jim


re: Tri-state checking

From: [youngpup_SH_@h...]
Date: Sat Jun 2, 2001 8:25 pm
Subject: Re: Tri-state checking

--- In [VirtualTreeview@y...], "Mike Lischke" [public@l...] wrote:
> > I set a node's CheckType to ctTriState, but it will not tri-state
> > check with the mouse. i assume this is by design - although i
wish it
> > weren't.
>
> If you want to have automatic updates then enable them with
voAutoTristateTracking in Tree.Options.

But i want the clicking a checkbox to cycle through the three states
of THAT checkbox. AutoTriState tracking works on multiple levels, and
greys the parents based on how many of their children are checked.

> > Could you please add a (const OldValue: TCheckState) to
OnChecking so
> > that i know what the value was before they checked it...so i can
gray
> > it myself in code?
>
> What about Node.CheckState?

Doh! Thank you...didn't think to look there :)

Ian


hide first node in VET

From: "Ariel Selig" [asel98@y...]
Date: Sat Jun 2, 2001 9:12 pm
Subject: hide first node in VET

how can i hide the first node.
for example:

[C:]
--- dir1
--- dir2
--- windows

theres any way to dont show the "C:"?

 | Replies | Author | Date
2151 | Re: hide first node in VET | Jim Kueneman | Sat 6/2/2001


re: hide first node in VET

From: Jim Kueneman [jimdk@m...]
Date: Sat Jun 2, 2001 10:42 pm
Subject: Re: [VirtualTreeview] hide first node in VET

At 09:12 PM 6/2/2001 +0000, you wrote:
>how can i hide the first node.
>for example:

I am sorry, right now there is not. I have wanted this as well but have
not wanted it bad enough to go through the pain of doing it. I would have
to restructure a fair amout if VET to make this work cleanly. I have it on
my ToDo list.

Jim


Full Expand

From: "Jim Kueneman" [jimdk@m...]
Date: Sat Jun 2, 2001 10:48 pm
Subject: Full Expand

Mike,

Is there a "BeforeFullExpand" and "AfterFullExpand" that I can use
to set the cursor to an hourglass and then back to the pointer. I am
tired of the cursor flickering as each NodeExpand causes the cursor to
be set to the hourglass then back during a full expand.

If not how about adding one?

Jim

 | Replies | Author | Date
2161 | Re: Full Expand | Mike Lischke | Sun 6/3/2001
2164 | Re: Full Expand | Jim Kueneman | Sun 6/3/2001
2180 | Re: Full Expand | Mike Lischke | Sun 6/3/2001
2166 | Re: Full Expand | Jim Kueneman | Sun 6/3/2001
2181 | Re: Full Expand | Mike Lischke | Sun 6/3/2001


re: diferents states in VET

From: "Jim Kueneman" [jimdk@m...]
Date: Sun Jun 3, 2001 1:05 am
Subject: Re: diferents states in VET

--- In [VirtualTreeview@y...], "Ariel Selig" [asel98@y...] wrote:
> and checked and cross with the grayed and not grayed way...
>
> any tip?

I have just started understanding the checkboxes in VT. Is what you
are trying to do is have the files have 3 states:

When a new directory of files is shown they are all in an unknown
state, say a box with nothing in it.

When the user checks the box he/she can toggle it between either a
"want the file" state and a "don't want the file" state.

I think this can be accomplished by intializing the nodes in the
tristate mode then if the user clicks on them they will toggle to the
"normal" state and be either on or off. If new files are moved to the
folder they will be initialized to the tristate mode, ie empty box.

If this is what you are talking about I think I can do this in VET
rather easily.

Jim

 | Replies | Author | Date
2154 | Re: diferents states in VET | Ariel Selig | Sun 6/3/2001


re: diferents states in VET

From: "Ariel Selig" [asel98@y...]
Date: Sun Jun 3, 2001 1:23 am
Subject: Re: diferents states in VET

its ok, i made it. :)

thanks.


re: ScrollIntoView

From: "Mark Austen" [markausten@y...]
Date: Sun Jun 3, 2001 7:02 am
Subject: Re: ScrollIntoView

Hi Mike,

Sorry, I'll try to be more precise in future.

The behaviour I am seeing is that the TOP border of the very last node
is at the bottom border of the treeview.

However, it could be the bottom border of the next to last
(penultimate) node at the bottom border of the treeview, it's not easy
to see which.

The net result, however, is that the very last node is not shown.

I'm using an Acer TravelMate 7100TE Laptop with Win98SE on a pentium
2, 64Mb RAM and several utilities in the system tray:

ClipMate
FileEx
PGP Tray
WS_FTP
NetLaunch

Ciao

Mark

--- In [VirtualTreeview@y...], "Mike Lischke" [public@l...] wrote:
> Hi Mark,
>
> > My setup is giving me slightly odd behaviour with this function.
If
> > the node in question is anywhere in the tree except right at the
> > bottom, then all is fine. However, if it is the very last node,
then
> > calling ScrollIntoView doesn't give me the expected result,
instead
> > the node I'm trying to scroll into view is just off the bottom of
the
> > client area.
>
> Sorry, I don't understand your problem. This might be due to my
limited understanding of the english language. What I can reproduce is
that if I scroll the very last node into view the the tree is scroll
so that the bottom border of the last node is at the bottom border of
the treeview. This is correct behavior so what goes wrong in your
case?
>
> Ciao, Mike

 | Replies | Author | Date
2160 | Re: ScrollIntoView | Mike Lischke | Sun 6/3/2001
2175 | Re: ScrollIntoView | Mark Austen | Sun 6/3/2001
2291 | Re: ScrollIntoView | Mike Lischke | Sat 6/9/2001


re: DoChecking Need a "var"

From: "Mike Lischke" [public@l...]
Date: Sun Jun 3, 2001 7:48 am
Subject: RE: [VirtualTreeview] DoChecking Need a "var"

Hi Ariel,

> i think that function needs a "var" for the NewCheckState variable.
> its the unique way to change the newchechstate. no?

You are right. Somehow I forgot to include the var there. The event allows
already to change the new
check state and so was it intended.

Ciao, Mike


re: VirtualTreeview Demos

From: [mdissel@h...]
Date: Sun Jun 3, 2001 9:12 am
Subject: Re: VirtualTreeview Demos

I like to see some more demos... Thanks!!

Regards,

Marco

--- In [VirtualTreeview@y...], "Mike Lischke" [public@l...] wrote:
> Hi Brian,
>
> > Are there demos available for using the 2.4+ versions of
> > VirtualTreeview?
>
> Not yet. I can upload to YG the stuff as I have it now if you
like...
>
> Ciao, Mike


New file uploaded to VirtualTreeview

From: [VirtualTreeview@yahoogroups.com>
Date: Sun Jun 3, 2001 10:14 am
Subject: New file uploaded to VirtualTreeview

Hello,

This email message is a notification to let you know that
a file has been uploaded to the Files area of the VirtualTreeview
group.

File : /VirtualTree 2.4.21.zip
Uploaded by : [public@l...]
Description : Beta version

You can access this file at the URL

http://groups.yahoo.com/group/VirtualTreeview/files/VirtualTree%202.4.21.zip

To learn more about file sharing for your group, please visit

http://help.yahoo.com/help/us/groups/files

Regards,

public@l...]


re: OnInitNode/OnFreeNode

From: "Mike Lischke" [public@l...]
Date: Sun Jun 3, 2001 10:13 am
Subject: RE: [VirtualTreeview] OnInitNode/OnFreeNode

Hi Vadim,

> I think we can simplify a bit work with the data, if you will add in VT a
> code of initialization and finalization on the basis of the TypeInfo:

I have really tried to makes sense of what you wrote but I did not succeed.
Could please explain what you did in your code, particularly what advantage the
type info usage has?

Ciao, Mike


re: Re: ScrollIntoView

From: "Mike Lischke" [public@l...]
Date: Sun Jun 3, 2001 10:13 am
Subject: RE: [VirtualTreeview] Re: ScrollIntoView

Hi Mark,

> The behaviour I am seeing is that the TOP border of the very last node
> is at the bottom border of the treeview.

I'm sorry, but this is something I cannot reproduce. As I wrote, in my case all
is fine. Do you use
the latest source? When and how do you check that the last visible node is
really the last node in
the tree? Do you add new nodes asynchronly or something like that?

Ciao, Mike

 | Replies | Author | Date
2175 | Re: ScrollIntoView | Mark Austen | Sun 6/3/2001
2291 | Re: ScrollIntoView | Mike Lischke | Sat 6/9/2001


re: Full Expand

From: "Mike Lischke" [public@l...]
Date: Sun Jun 3, 2001 10:13 am
Subject: RE: [VirtualTreeview] Full Expand

Jim,

> Is there a "BeforeFullExpand" and "AfterFullExpand" that I can use
> to set the cursor to an hourglass and then back to the pointer. I am
> tired of the cursor flickering as each NodeExpand causes the cursor to
> be set to the hourglass then back during a full expand.
>
> If not how about adding one?

There is no event for full expand and collapse and I hesitate to add some
because of the usage/noise
ratio. It so seldomly be used that it does not justify the extra code.

I have however included a new event OnUpdating which is triggered whenever
BeginUpdate or EndUpdate
are called. This is also the case for FullExpand and FullCollapse. Additionally
the states
tsCollapsing and tsExpanding are set so you can use this new event to check for
these operations and
set the cursor accordingly.

Ciao, Mike

PS: There is a new feature in the tree: column based background colors. So you
can use, say, a light
gray for the main column as in WinXP.

 | Replies | Author | Date
2164 | Re: Full Expand | Jim Kueneman | Sun 6/3/2001
2180 | Re: Full Expand | Mike Lischke | Sun 6/3/2001
2166 | Re: Full Expand | Jim Kueneman | Sun 6/3/2001
2181 | Re: Full Expand | Mike Lischke | Sun 6/3/2001


re: Bug in VT <= 2.4.16 - FullExpand

From: "Mike Lischke" [public@l...]
Date: Sun Jun 3, 2001 10:13 am
Subject: RE: [VirtualTreeview] Bug in VT <= 2.4.16 - FullExpand

Hi Vadim,

> AFAIK GetNext (used in FullExpand) returns NIL after very last node in tree.
> Right? So, if Node.Parent[.Parent...].NextSibling is not nil, it will be
> full expanded too. Or I miss something?

Ah, finally I got it. Yes, you are right, this is a bug. I have already correct
code in
IterateSubtree which is similar to the full expand code but have not thought
about this problem.
Fixed. Thank you.

Ciao, Mike


New file uploaded to VirtualTreeview

From: [VirtualTreeview@yahoogroups.com>
Date: Sun Jun 3, 2001 10:30 am
Subject: New file uploaded to VirtualTreeview

Hello,

This email message is a notification to let you know that
a file has been uploaded to the Files area of the VirtualTreeview
group.

File : /VirtualTree Demos.zip
Uploaded by : [public@l...]
Description : Still not finished

You can access this file at the URL

http://groups.yahoo.com/group/VirtualTreeview/files/VirtualTree%20Demos.zip

To learn more about file sharing for your group, please visit

http://help.yahoo.com/help/us/groups/files

Regards,

public@l...]


re: Full Expand

From: Jim Kueneman [jimdk@m...]
Date: Sun Jun 3, 2001 12:45 pm
Subject: RE: [VirtualTreeview] Full Expand

At 12:13 PM 6/3/2001 +0200, you wrote:

>I have however included a new event OnUpdating which is triggered whenever
>BeginUpdate or EndUpdate
>are called. This is also the case for FullExpand and FullCollapse.
>Additionally the states
>tsCollapsing and tsExpanding are set so you can use this new event to
>check for these operations and
>set the cursor accordingly.

Worked perfectly.

There is still a problem with the full expand / collapse keys. Pressing *
causes a full expand but it also move the cursor to the next node. If the
nodes are all expanded it acts like an arrow down key!

Pressing / for full collapse also moves the cursor down one node, expanding
that branch if necessary after doing the full collapse.

Sorry if I am repeating something I recall someone else reporting this but
I don't remember your reply.

Jim

 | Replies | Author | Date
2180 | Re: Full Expand | Mike Lischke | Sun 6/3/2001


VET DoPaintText

From: "Ariel Selig" [asel98@y...]
Date: Sun Jun 3, 2001 3:56 pm
Subject: VET DoPaintText

procedure TCustomVirtualExplorerTree.DoPaintText(Node: PVirtualNode;
const Canvas: TCanvas; Column: Integer; TextType: TVSTTextType);

please change the inherited statment to the "end" of the function, so
we can change canvas properties before VET "paints" the nodes.

tnx


re: Full Expand

From: Jim Kueneman [jimdk@m...]
Date: Sun Jun 3, 2001 5:01 pm
Subject: RE: [VirtualTreeview] Full Expand

Mike,

>PS: There is a new feature in the tree: column based background colors. So
>you can use, say, a light
>gray for the main column as in WinXP.

Just one little request, when using AnimatedExpand the fill color is the
backgound color of the tree is it possible to fill this with the columm
color? If this was a straight ScrollWindow it would be difficult but since
you are doing a lot of double buffering it should be possible to draw a
rectange in the uncovered part of the right color before BitBlt'ing it to
the screen. Right?<g>

Jim

 | Replies | Author | Date
2181 | Re: Full Expand | Mike Lischke | Sun 6/3/2001


VET doesnt show vertical line

From: "Ariel Selig" [asel98@y...]
Date: Sun Jun 3, 2001 5:06 pm
Subject: VET doesnt show vertical line

using vertical lines (for each column),
VET isnt drawing it on the "folders" nodes.

 | Replies | Author | Date
2168 | Re: VET doesnt show vertical line | Jim Kueneman | Sun 6/3/2001


re: VET doesnt show vertical line

From: Jim Kueneman [jimdk@m...]
Date: Sun Jun 3, 2001 5:30 pm
Subject: Re: [VirtualTreeview] VET doesnt show vertical line

At 05:06 PM 6/3/2001 +0000, you wrote:
>using vertical lines (for each column),
>VET isnt drawing it on the "folders" nodes.

The lines between the columns using voShowVertGridLines? I am not seeing
that problem in the demo.

Jim


New file uploaded to VirtualTreeview

From: [VirtualTreeview@yahoogroups.com>
Date: Sun Jun 3, 2001 5:39 pm
Subject: New file uploaded to VirtualTreeview

Hello,

This email message is a notification to let you know that
a file has been uploaded to the Files area of the VirtualTreeview
group.

File : /VET_V1.1.21.zip
Uploaded by : [jimdk@m...]
Description : Virtual Explorer Tree Version 1.4.20 with Demo Executable

You can access this file at the URL

http://groups.yahoo.com/group/VirtualTreeview/files/VET_V1.1.21.zip

To learn more about file sharing for your group, please visit

http://help.yahoo.com/help/us/groups/files

Regards,

jimdk@m...]


VET 1.1.21

From: "Jim Kueneman" [jimdk@m...]
Date: Sun Jun 3, 2001 5:51 pm
Subject: VET 1.1.21

Yes folks, another new version.

Improvements:

Supports extended context menus; Shift-Right click gives you
different menu choices in explorer (didn't know that did ya <g>) VET
also does now.

Added color properties for columns to take advantage of the new
Column Color property in VT, you can now set the color of the Treeview
color to light grey (or anyother color) as Mike says WinXP does.

Does anyone find these update messages too much? Would you rather I
just upload quietly? I looked at the message log recently I am
running my mouth a lot lately!

Jim

 | Replies | Author | Date
2182 | Re: VET 1.1.21 | Mike Lischke | Sun 6/3/2001
2186 | Re: VET 1.1.21 | [adembaba@e...] | Sun 6/3/2001
2189 | Re: VET 1.1.21 | Jim Kueneman | Mon 6/4/2001
2205 | Re: VET 1.1.21 | Jim Kueneman | Tue 6/5/2001


Excel auto fill feature

From: Werner Lehmann [wl@b...]
Date: Sun Jun 3, 2001 3:01 pm
Subject: Excel auto fill feature

Hi,

I would like to have a grid feature similar to excel. To say
it right away: this is not of interest for everyone so I do not
ask to include it in the component. But maybe someone has an idea
how to accomplish it?

Suppose a VTree in rowselect and gridmode, with only top level
nodes (listview style).

Problem is: in excel selected grids cells have a black dot at the
right lower bottom. If you click on this dot and drag down (cells
below will be selected) and release the mouse button the selected
cells will be filled automatically (for instance by month names or
whatever is appropriate).

With manual dragging I can disallow a drag operation if it would
start on the black dot. The black dot itself could be custom painted.
But the selection takes only place if the selection rectangle (focus
rect) is drawn over the main column. In my case I would rather drag
over the second column.

Furthermore to resemble the excel style even more it would be nice
to have the selected cells only in this column be surrounded by a black
border (same line width as the black dot). Not very easy but if you have
any thoughts on this please let me know.

Regards,
Werner


Draw selection rectangle

From: Werner Lehmann [wl@b...]
Date: Sun Jun 3, 2001 2:59 pm
Subject: Draw selection rectangle

Hi (Mike :),

I have found a problem with drag and drop vs. marquee selection:
I have a listview rowselect manual drag VTree. If I selected a
node and then drag it (beginning in column 2 not on the node text)
the node is dragged ok. If I release the mouse button then the
drag image disappears but a marquee focus selection rectangle
appears and can be moved without any mouse button down.

In fact, the draw selection rectangle is already there before the
node dragging starts, only very small. This is probably due to
the drag threshold.

Also it would be nice if a node can be dragged without having to
be selected previously. At the time being I have to click on it,
release the mouse button (node is selected) then click again and
drag.

Regards,
Werner

 | Replies | Author | Date
2195 | Re: Draw selection rectangle | Werner Lehmann | Mon 6/4/2001
2289 | Re: Draw selection rectangle | Mike Lischke | Sat 6/9/2001
2298 | Re: Draw selection rectangle | Werner Lehmann | Sat 6/9/2001
2313 | Re: Draw selection rectangle | Mike Lischke | Sun 6/10/2001
2318 | Re: Draw selection rectangle | Werner Lehmann | Sun 6/10/2001
2320 | Re: Draw selection rectangle | Mike Lischke | Sun 6/10/2001
2326 | Re: Draw selection rectangle | Werner Lehmann | Sun 6/10/2001


VT Header and CustomDraw

From: "Ariel Selig" [asel98@y...]
Date: Sun Jun 3, 2001 6:22 pm
Subject: VT Header and CustomDraw

hello

i made a function to draw XP headers (by the way... did u recibe the
mail? cuz im having too much problems with my pop3), but when i
change properties to customdraw the headers, VT keeps drawing the
borders of the buttons..!!

how can i change this?

tnx

 | Replies | Author | Date
2183 | Re: VT Header and CustomDraw | Mike Lischke | Sun 6/3/2001


re: Hidden nodes bug

From: "Cyril VELTER" [cyril.velter@l...]
Date: Sun Jun 3, 2001 6:22 pm
Subject: Re: [VirtualTreeview] Hidden nodes bug

Hi Mike,

> > I've tracked down a problem with the handling of Hidden nodes.
Sometime
> > after expanding and collapsing nodes with hidden chidren the tree won't
> > redraw at all. The problem seems to happen only when the client area is
> > filled (ie the vertical scrollbar appear).
>
> Thank you very much for your precise analysis. Obviously there is a side
effect I have not
> considered yet. By using your conclusions and doing some research on my
own I came up with a
> solution which should solve your problem as well as other potential ones.
There is now no longer an
> update of the vertical scroll bar in AdjustTotalHeight as this method is
always called from code
> which adjusts the scroll bar finally (and is also a private method).
Please verify that it really
> works with your stuff too as soon as I have uploaded a new build.
>

Great !, 2.4.21 now works with my tree full of hidden nodes:=).

I've another litlle problem now (don't think it's related to the first
one but ...) : sometimes (it's very hard to reproduce but does happen), my
DoGetText is called with a nil node. The call comes from
DetermineHitPositionLTR calling DoGetNodeWidth with a HitInfo.HitNode=nil.
It happen when :
* In ListView mode (multicolumn, only root nodes, extendedgridmode).
* The tree have just been filled.
* not all nodes fit on screen
* Moving the mouse near the bottom scroll bar

I don't have any idea where this can come from. I've tried to reproduced
it under the debugger to get a better analysis, but this problem seem to
only want to show up when I'm not under the debugger :=(

cyril

 | Replies | Author | Date
2184 | Re: Hidden nodes bug | Mike Lischke | Sun 6/3/2001


re: ScrollIntoView

From: "Mark Austen" [markausten@y...]
Date: Sun Jun 3, 2001 7:37 pm
Subject: Re: ScrollIntoView

> I'm sorry, but this is something I cannot reproduce. As I wrote, in
my
> case all is fine. Do you use the latest source? When and how do you
check
> that the last visible node is really the last node in the tree? Do
you add
> new nodes asynchronly or something like that?

As I mentioned, it's probably something in my set up or, come to think
of it, something I'm doing, or not doing!

The source version I was doing this with is 2.4.16, I've just
downloaded 2.4.21 and it still exhibits the same behaviour.

The way I'm using this particular tree is in ListView mode, so, this
tree is a tree of root nodes only. I'm using a special object list
class to store the data objects [TFlexiSort] and everytime a new
object is added to the list, the VT is cleared and the number of root
nodes set to the number of items in the list. The index of the node is
used to reference the items in the object list.

Now, after the new object has been added I used the following code to
bring the last node into view:

var
oNode : PVirtualNode;
begin
with vtList do
begin
oNode := GetLast;
if Assigned( oNode ) then
begin
ScrollIntoView( oNode );
end; // if Assigned( oNode )
end; // with vtList
{ ... }
end;

So, I am relying on GetLast returning a reference to the very last
node in the tree as per your comments in the code.

By the way, FullRowSelect in 2.4.21 is not selecting the full row in
this VT which has 3 columns. The VT that only has one column works as
expected. I've only just seen this so I'll look into it further and
see if it's the columns that's the proble, or the fact that the
columns are not in default order, rather column[2] is in Position=0.

Ciao

Mark

References

[TFlexiSort] Baer, David, "Contain Yourself", The Delphi Magazine,
issue 55, p40

 | Replies | Author | Date
2291 | Re: ScrollIntoView | Mike Lischke | Sat 6/9/2001


FullRowSelect

From: "Mark Austen" [markausten@y...]
Date: Sun Jun 3, 2001 8:05 pm
Subject: FullRowSelect

The behaviour I'm getting with FullRowSupport set to True and with one
or more columns defined is that only the focus rectangle is being
drawn in a different colour and a small part of each of the other
columns, maybe 3 or 4 pixels wide, instead of the whole row across the
width of the VT.

If you click on any row it is selected as normal in that the focus
moves to the row clicked, but only the focus rectangle is coloured in
the highlight colour as described above.

This did not happen in the last version I was using which was 2.4.16.

Ciao

Mark

 | Replies | Author | Date
2177 | FullRowSelect suggestion | Franc v/d Westelaken | Sun 6/3/2001
2221 | Re: FullRowSelect suggestion | Mike Lischke | Tue 6/5/2001
2290 | Re: FullRowSelect | Mike Lischke | Sat 6/9/2001


FullRowSelect suggestion

From: "Franc v/d Westelaken" [F.vdwestelaken@c...]
Date: Sun Jun 3, 2001 8:24 pm
Subject: FullRowSelect suggestion

Hi,

one suggestion I would like to ask regarding fullrowselect is, if it's
possible to only draw to the selection to the rightmost side of the last
column when the total width of the columns is smaller than the width of VT.
Now, the selection is always drawn across the entire width of the treeview.

Franc.

[Non-text portions of this message have been removed]

 | Replies | Author | Date
2221 | Re: FullRowSelect suggestion | Mike Lischke | Tue 6/5/2001


re: 2 problems (DDManager.RenderData and Hints)

From: "Paul Istrate" [istech@c...]
Date: Sun Jun 3, 2001 8:33 pm
Subject: Re: [VirtualTreeview] 2 problems (DDManager.RenderData and Hints)

Hi Mike,

> > 2. Again then problem with splitter mark.
>
> Please be so kind and reiterate what the problem was. I can't recall.

I use a VDT (VirtualDrawTree) and I set/draw hints only for first column
(VDT has 2 columns). VDT is located on form left side. On right side of VDT
I have a splitter.

If I use the splitter to decrease VDT width, when mouse is over the first
column, splitter mark is not shown anymore, instead the VDT hint is painted.

I think VDT should not treat mouse move if mouse down was not in its area,
so mouse move is treated in another control, like splitter.

I doesn't tested with a VST so I don't know if have same behaviour.

The problems occurs in both cases: VDT have or have not focus.

Regards,
Paul Istrate

 | Replies | Author | Date
2288 | Re: 2 problems (DDManager.RenderData and Hints) | Mike Lischke | Sat 6/9/2001


re: Problems with flat scrollbars and WIndowsblind.

From: "Mike Lischke" [public@l...]
Date: Sun Jun 3, 2001 8:51 pm
Subject: RE: [VirtualTreeview] Problems with flat scrollbars and WIndowsblind.

Hi Danil,

> It was said, that flat scrollbars have conflict with windowsblind.
> It'ss a tool that let you change the skins of Windows. It let you
> make Windows98/2000 look like Apple Macintosh or Windows XP.

I installed it and found myself getting excited about its features. Very cool
stuff, no doubts. Unfortunatly, there will be an endless loop with flat scroll
bars, but this is not a reason to stop using flat scroll bars. It is rather a
problem with WindowBlinds (tool windows also will not be drawn correctly at
times and menu painting is occasionally a bit quirky).

I'm still not through evaluating flat sb on WinXP, as I have it only installed
on my office machine. However I was busy with products and inhouse tools lately
and did not find the time to run XP long enough (btw. Delphi 5 runs fine on
beta 2). Hence the decision is still open.

Ciao, Mike


re: Full Expand

From: "Mike Lischke" [public@l...]
Date: Sun Jun 3, 2001 8:56 pm
Subject: RE: [VirtualTreeview] Full Expand

Jim,

> There is still a problem with the full expand / collapse keys. Pressing *
> causes a full expand but it also move the cursor to the next node. If the
> nodes are all expanded it acts like an arrow down key!

This is due to the incremental search feature. Some keys must be filtered out.
I'm not sure yet how
to do it. Perhaps I keep a list of key recognized in WM_KEYDOWN and call the
key event for the case
the application wants to translate the key.

Ciao, Mike


re: Full Expand

From: "Mike Lischke" [public@l...]
Date: Sun Jun 3, 2001 8:58 pm
Subject: RE: [VirtualTreeview] Full Expand

> Just one little request, when using AnimatedExpand the fill color is the
> backgound color of the tree is it possible to fill this with the columm
> color? If this was a straight ScrollWindow it would be difficult but since
> you are doing a lot of double buffering it should be possible to draw a
> rectange in the uncovered part of the right color before BitBlt'ing it to
> the screen. Right?<g>

Of course I have realized this too, but unfortunately it is a bit more complex
to solve. The reason
is that I have to iterate visible columns in correct order to erase the
uncovered parts. This is
quite expensive too (see PaintTree) and I thought that asking for not animating
when using column
colors would be reasonable.

Ciao, Mike


re: VET 1.1.21

From: "Mike Lischke" [public@l...]
Date: Sun Jun 3, 2001 9:09 pm
Subject: RE: [VirtualTreeview] VET 1.1.21

> Added color properties for columns to take advantage of the new
> Column Color property in VT, you can now set the color of the Treeview
> color to light grey (or anyother color) as Mike says WinXP does.

Yep, the column with the file name in the system listview used in Explorer is
drawn on a very light
gray background. Quite useful visual improvement in my opinion.

> Does anyone find these update messages too much? Would you rather I
> just upload quietly? I looked at the message log recently I am
> running my mouth a lot lately!

No, no! I'm happy that somebody feels like helping and working, so keep
talking, Jim. The list is
not my auditorium where I talk and everyone just listens (although most people
lurking here stay
quite silence). Btw. we are quickly approaching 400 list members, so traffic
will likely grow
anyway. There are already ~90 messages in the first 3 days of June. This is
twice the rate we had
last month, which was the most busy ever.

Ciao, Mike


re: VT Header and CustomDraw

From: "Mike Lischke" [public@l...]
Date: Sun Jun 3, 2001 9:13 pm
Subject: RE: [VirtualTreeview] VT Header and CustomDraw

Ariel,

> i made a function to draw XP headers (by the way... did u recibe the
> mail?

Yes and I answered you 12:14 MET today.

>cuz im having too much problems with my pop3), but when i
> change properties to customdraw the headers, VT keeps drawing the
> borders of the buttons..!!

The problem is that for correct working your code must be directly included
into the header painting
(owner draw is not enough). There are a lot more things to consider (e.g. have
a look at the layout
calculation).

Ciao, Mike


re: Hidden nodes bug

From: "Mike Lischke" [public@l...]
Date: Sun Jun 3, 2001 9:16 pm
Subject: RE: [VirtualTreeview] Hidden nodes bug

Cyril,

> I've another litlle problem now (don't think it's related to the first
> one but ...) : sometimes (it's very hard to reproduce but does happen), my
> DoGetText is called with a nil node.

Mmh, very strange. This should of course never happen. I have made a notice and
will see what I can
do to prevent this.

Ciao, Mike


re: OnInitNode/OnFreeNode

From: "Vadim Sedulin" [wsntrl@o...]
Date: Sun Jun 3, 2001 10:41 pm
Subject: Re: [VirtualTreeview] OnInitNode/OnFreeNode

Hello Mike!

>> I think we can simplify a bit work with the data, if you will add in VT a
>> code of initialization and finalization on the basis of the TypeInfo:
>
> I have really tried to makes sense of what you wrote but I did not
succeed. Could please explain what you did in your code, particularly what
advantage the type info usage has?

No need to handle three different events (OnGetNodeDataSize, OnInitNode,
OnFreeNode). Right now I am using next code:

====
type
TNodeData = record
recID,
recUID: Int64;
recText: String;
recType: Byte;
end;
PNodeData = ^TNodeData;

...

procedure TViewFrame.TreeGetNodeDataSize(Sender: TBaseVirtualTree; var
NodeDataSize: Integer);
begin
NodeDataSize := SizeOf(TNodeData);
end;

procedure TViewFrame.TreeInitNode(Sender: TBaseVirtualTree; ParentNode,
Node: PVirtualNode; var InitialStates:
TVirtualNodeInitStates);
begin
Initialize (PNodeData(Tree.GetNodeData(Node))^);
end;

procedure TViewFrame.TreeFreeNode(Sender: TBaseVirtualTree; Node:
PVirtualNode);
begin
Finalize (PNodeData(Tree.GetNodeData(Node))^);
end;

...
Node := Tree.AddNode(Parent);
Tree.ReinitNode(Node);
with PNodeData(Tree.GetNodeData(Node))^ do begin
recID := IBSQL.Current. ....
end;
...

====

This code can be overwritten to:

====

procedure TViewFrame.OnGetNodeDataType(Sender: TBaseVirtualTree; var
ATypeInfo:Pointer; var DataSize: Integer);
begin
ATypeInfo := TypeInfo(TNodeData);
DataSize := SizeOf(TNodeData);
end;

====

I.e. no need to call or even think about initialize/finalize.

Bye.

Vadim Sedulin
E-Mail: [wsntrl@o...]

 | Replies | Author | Date
2294 | Re: OnInitNode/OnFreeNode | Mike Lischke | Sat 6/9/2001


re: VET 1.1.21

From: [adembaba@e...]
Date: Sun Jun 3, 2001 11:42 pm
Subject: Re: VET 1.1.21

Hi Jim,

> Supports extended context menus; Shift-Right click gives you
> different menu choices in explorer (didn't know that did ya <g>)
> VET also does now.

In what way is Shift-Right click is different from
plain right click?

Another thing; Explorer lets you right click on
unfocused nodes --which is the only way you can
format a floppy in explorer--, VET does not have
that as default behavior: Right ckick is only
allowed when a node is focused/selected.

> Does anyone find these update messages too much? Would
> you rather I just upload quietly? I looked at the message
> log recently I am running my mouth a lot lately!

I should be the last one to comment as it is implicit
that I do not.

Cheers,
Adem

 | Replies | Author | Date
2189 | Re: VET 1.1.21 | Jim Kueneman | Mon 6/4/2001
2205 | Re: VET 1.1.21 | Jim Kueneman | Tue 6/5/2001


New file uploaded to VirtualTreeview

From: [VirtualTreeview@yahoogroups.com>
Date: Mon Jun 4, 2001 12:41 am
Subject: New file uploaded to VirtualTreeview

Hello,

This email message is a notification to let you know that
a file has been uploaded to the Files area of the VirtualTreeview
group.

File : /VirtualTreeWinHelp11.zip
Uploaded by : [youngpup_SH_@h...]
Description : Virtual Treeview Help in WinHelp format - Release 1.1

You can access this file at the URL

http://groups.yahoo.com/group/VirtualTreeview/files/VirtualTreeWinHelp11.zip

To learn more about file sharing for your group, please visit

http://help.yahoo.com/help/us/groups/files

Regards,

youngpup_SH_@h...]


New file uploaded to VirtualTreeview

From: [VirtualTreeview@yahoogroups.com>
Date: Mon Jun 4, 2001 1:36 am
Subject: New file uploaded to VirtualTreeview

Hello,

This email message is a notification to let you know that
a file has been uploaded to the Files area of the VirtualTreeview
group.

File : /VET_V1.1.22.zip
Uploaded by : [jimdk@m...]
Description : Virtual Explorer Tree Version 1.4.22 with Demo Executable

You can access this file at the URL

http://groups.yahoo.com/group/VirtualTreeview/files/VET_V1.1.22.zip

To learn more about file sharing for your group, please visit

http://help.yahoo.com/help/us/groups/files

Regards,

jimdk@m...]


re: Re: VET 1.1.21

From: Jim Kueneman [jimdk@m...]
Date: Mon Jun 4, 2001 1:46 am
Subject: Re: [VirtualTreeview] Re: VET 1.1.21

At 11:42 PM 6/3/2001 +0000, you wrote:
>Hi Jim,
>
> > Supports extended context menus; Shift-Right click gives you
> > different menu choices in explorer (didn't know that did ya <g>)
> > VET also does now.
>
>In what way is Shift-Right click is different from
>plain right click?

M$ calls it "Extended" Context Menus. It is more subtle on a non-networked
computer. Select an executable or an item in the Control Panel and
Shift-RightClick. It adds a Run As... item which allows the process to be
run as a different user in Win2k. Some items add a fair number of items.

>Another thing; Explorer lets you right click on
>unfocused nodes --which is the only way you can
>format a floppy in explorer--, VET does not have
>that as default behavior: Right ckick is only
>allowed when a node is focused/selected.

You are right. Version 1.4.22 is up and "almost" like explorer. You don't
get the feedback on the mouse down it waits until it is released before it
changes focus then back to the original. Making it like Explorer was more
work than I want to do and I think it is close enough.

Jim

 | Replies | Author | Date
2205 | Re: VET 1.1.21 | Jim Kueneman | Tue 6/5/2001


Two suggestions

From: "Vadim Sedulin" [wsntrl@o...]
Date: Mon Jun 4, 2001 4:38 am
Subject: Two suggestions

Hello Mike!

First: function AddChildInit:
function AddChildInit (Parent: PVirtualNode): PVirtualNode;
begin
Result: = AddChild (Parent);
if Assigned (Result) then
InitNode (Result);
end;

Second: State of mouse buttons in parameter Shift of event OnDragDrop.

Thanks.

Bye.

Vadim Sedulin
E-Mail: [wsntrl@o...]

 | Replies | Author | Date
2295 | Re: Two suggestions | Mike Lischke | Sat 6/9/2001
2306 | Re: Two suggestions | Vadim Sedulin | Sat 6/9/2001


[no subject]

From: [F.vdwestelaken@c...]
Date: Mon Jun 4, 2001 7:01 am
Subject:

Jun 2001 22:25:27 +0200
To: [VirtualTreeview@yahoogroups.com>
Message-ID: [MMEBIEFEHHOLNALGMHDOIEJNDKAA.F.vdWestelaken@c...]
X-Priority: 3 (Normal)
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2911.0)
In-Reply-To: [9fe5a2+1032q@e...]
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2462.0000
Importance: Normal
From: "Franc v/d Westelaken" <F.vdwestelaken@c...]
MIME-Version: 1.0
Mailing-List: list VirtualTreeview@yahoogroups.com; contact
VirtualTreeview-owner@yahoogroups.com
Delivered-To: mailing list VirtualTreeview@yahoogroups.com
Precedence: bulk
List-Unsubscribe: <mailto:VirtualTreeview-unsubscribe@yahoogroups.com>
Date: Sun, 3 Jun 2001 22:24:36 +0200
Reply-To: VirtualTreeview@yahoogroups.com
Subject: [VirtualTreeview] FullRowSelect suggestion
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
X-UIDL: 1379
Status: U

Hi,

one suggestion I would like to ask regarding fullrowselect is, if it's
possible to only draw to the selection to the rightmost side of the last
column when the total width of the columns is smaller than the width of VT.
Now, the selection is always drawn across the entire width of the treeview.

Franc.

[Non-text portions of this message have been removed]

To unsubscribe from this group, send an email to:
VirtualTreeview-unsubscribe@egroups.com

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/

 | Replies | Author | Date
2193 | Re: (unknown) | Franc v/d Westelaken | Mon 6/4/2001


re: Can't select node with keyboard.

From: [SimonMoscrop@H...]
Date: Mon Jun 4, 2001 8:45 am
Subject: Re: Can't select node with keyboard.

--- In [VirtualTreeview@y...], "Mike Lischke" [public@l...] wrote:
> Hi Simon,
>
> > If i select a node with the mouse everything works ok. If i then
> > press the up or down arrow the focus shifts in the tree but the
> > Tree.SelectedCount drops to 0.
>
> How do you determine the selection count and which version of VT do
you use for your tests?
>
> Ciao, Mike

Mike,

Thanks for your reply...

I'm using version 2.4.16 of the Virtual String Tree.

The tree has the following options set
[voAutoSort,voDisableDrawSelection,voEditable,voGridExtensions,voInitO
nSave,voMultiSelect,voRightClickSelect,voPopupMode,voShowButtons,voSho
wHorzGridLines,voShowRoot,voShowTreeLines,voToggleOnDblClick].

and ... I'm interogating the SelectedCount property in a procedure
attached to the OnFocusChanged event.

I hope this gives you some further information to work on.. or to
tell me what i'm doing wrong.

Thanks again for you help.
Simon Moscrop

 | Replies | Author | Date
2287 | Re: Can't select node with keyboard. | Mike Lischke | Sat 6/9/2001
2353 | Re: Can't select node with keyboard. | [SimonMoscrop@H...] | Mon 6/11/2001


re: (unknown)

From: "Franc v/d Westelaken" [F.vdwestelaken@c...]
Date: Mon Jun 4, 2001 8:46 am
Subject: RE: [VirtualTreeview] (unknown)

Hi,

Today I noticed that my yesterdays message was posted again. Although I
didn't sent it for a second time. Also the layout of the message is a bit
wierd. All headers are included, a strange subject line and no 'to:' field.
Does anyone know why this is happening ? It's the second time this occurs
but I've posted several messages in this mailing list which got posted
without a problem.

Franc.
-----Original Message-----
From: [F.vdwestelaken@c...] [mailto:[F.vdwestelaken@c...]]
Sent: maandag 4 juni 2001 9:02
Subject: [VirtualTreeview] (unknown)

Jun 2001 22:25:27 +0200
To: [VirtualTreeview@yahoogroups.com>
Message-ID: [MMEBIEFEHHOLNALGMHDOIEJNDKAA.F.vdWestelaken@c...]
X-Priority: 3 (Normal)
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2911.0)
In-Reply-To: [9fe5a2+1032q@e...]
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2462.0000
Importance: Normal
From: "Franc v/d Westelaken" <F.vdwestelaken@c...]
MIME-Version: 1.0
Mailing-List: list VirtualTreeview@yahoogroups.com; contact
VirtualTreeview-owner@yahoogroups.com
Delivered-To: mailing list VirtualTreeview@yahoogroups.com
Precedence: bulk
List-Unsubscribe: <mailto:VirtualTreeview-unsubscribe@yahoogroups.com>
Date: Sun, 3 Jun 2001 22:24:36 +0200
Reply-To: VirtualTreeview@yahoogroups.com
Subject: [VirtualTreeview] FullRowSelect suggestion
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
X-UIDL: 1379
Status: U

Hi,

one suggestion I would like to ask regarding fullrowselect is, if it's
possible to only draw to the selection to the rightmost side of the last
column when the total width of the columns is smaller than the width of
VT.
Now, the selection is always drawn across the entire width of the
treeview.

Franc.

[Non-text portions of this message have been removed]


Hiding the node editor

From: Werner Lehmann [wl@b...]
Date: Mon Jun 4, 2001 12:56 pm
Subject: Hiding the node editor

Hi,

I have a node editor consisting of a TEdit and a dropdown form with
another VTree (among other controls). While this works fine I'd like
to hide it if the user selects the menu or switches tasks. Right now
I can alt+tab to a different app and switch back and the target editor
is still open and active. This is different from the usual combobox
behaviour and I would like to avoid that. Is there anything which I
can do on node editor level (not Mainform.OnDeactivate or something
like that)?

Werner

 | Replies | Author | Date
2200 | Re: Hiding the node editor | Jim Kueneman | Mon 6/4/2001
2203 | Re: Hiding the node editor | Werner Lehmann | Mon 6/4/2001
2204 | Re: Hiding the node editor | Jim Kueneman | Mon 6/4/2001
2210 | Re: Hiding the node editor | Mike Lischke | Tue 6/5/2001
2213 | Re: Hiding the node editor | GIANNAKOPOULOS KOSTAS | Tue 6/5/2001
2328 | Re: Hiding the node editor | Werner Lehmann | Sun 6/10/2001
2335 | Re: Hiding the node editor | Mike Lischke | Mon 6/11/2001
2341 | Re: Hiding the node editor | Werner Lehmann | Mon 6/11/2001


re: Draw selection rectangle

From: Werner Lehmann [wl@b...]
Date: Mon Jun 4, 2001 2:00 pm
Subject: Re: [VirtualTreeview] Draw selection rectangle

Werner Lehmann wrote:
>
> Also it would be nice if a node can be dragged without having to
> be selected previously. At the time being I have to click on it,
> release the mouse button (node is selected) then click again and
> drag.

My fault. I was checking the selected state in DragAllowed. Mea culpa!

The problem with the draw selection remains though. It just got worse
after I removed the selected state check out of DragAllowed. If I want
to draw select some nodes now a drag and drop operation begins with
the node being clicked on.

Mike, you had found the solution to enable the drag selection if it
starts not on a node text (with FullRowSelect). I suspect that this
is somehow broken. By the way, I am still using 2.4.16 because others
have reported problems with FullRowSelect mode.

Werner

 | Replies | Author | Date
2289 | Re: Draw selection rectangle | Mike Lischke | Sat 6/9/2001


Problem with autoscrolldelay in Drag and Drop

From: Werner Lehmann [wl@b...]
Date: Mon Jun 4, 2001 2:03 pm
Subject: Problem with autoscrolldelay in Drag and Drop

Hi,

it seems that AutoScrollDelay is not respected if something is dragged
into a VTree.

Situation: Two VTree A and B right beside each other. A is autoscrolling
with delay 1000 ms. Dragging from A to B works ok, A is not scrolled (if
the 1000 ms are not reached). Dragging from B to A instantly auto scrolls
A if the drag image reaches the clientarea of A.

Werner

 | Replies | Author | Date
2292 | Re: Problem with autoscrolldelay in Drag and Drop | Mike Lischke | Sat 6/9/2001
2299 | Re: Problem with autoscrolldelay in Drag and Drop | Werner Lehmann | Sat 6/9/2001
2308 | Re: Problem with autoscrolldelay in Drag and Drop | Werner Lehmann | Sat 6/9/2001
2312 | Re: Problem with autoscrolldelay in Drag and Drop | Mike Lischke | Sun 6/10/2001
2316 | Re: Problem with autoscrolldelay in Drag and Drop | Werner Lehmann | Sun 6/10/2001
2319 | Re: Problem with autoscrolldelay in Drag and Drop | Mike Lischke | Sun 6/10/2001


re: Range Check Error

From: [ccdsystems@y...]
Date: Mon Jun 4, 2001 2:31 pm
Subject: Re: Range Check Error

Mike,

I managed to track down the error, but I still don't know why I
didn't get it every time. After I would remove the node, I would
then try to set Selected to false. I'm not sure why this didn't
crash it always. It may be that the tree was setting focus to
another node after the remove and before setting Selected to false.

I'm not even sure I could get it to reproduce in a demo.

Sorry Mike

--- In [VirtualTreeview@y...], "Mike Lischke" [public@l...] wrote:
> Spencer,
>
> > When I remove the last child from a node, I get a Range Check
Error.
> > However, I do not get it everytime, in fact I get it less than
half
> > the time. Does anyone know where I should look to find what this
is?
>
> Can you make me a demo which shows this behavior?
>
> Ciao, Mike


its only me? (tree lines, doted)

From: "Ariel Selig" [asel98@y...]
Date: Mon Jun 4, 2001 5:25 pm
Subject: its only me? (tree lines, doted)

VT shows al ok, but when im using checksupport, and checkbuttons
(tilde, etc), when the mousedown event is called, the tree lines
change the aspect. i think the doted points change with not doted
points.
but its only on mousedown, when mouseup is called, it get again ok.

 | Replies | Author | Date
2199 | Re: its only me? (tree lines, doted) | Ariel Selig | Mon 6/4/2001
2286 | Re: its only me? (tree lines, doted) | Mike Lischke | Sat 6/9/2001
2293 | Re: its only me? (tree lines, doted) | Mike Lischke | Sat 6/9/2001


re: its only me? (tree lines, doted)

From: "Ariel Selig" [asel98@y...]
Date: Mon Jun 4, 2001 5:28 pm
Subject: Re: its only me? (tree lines, doted)

i found the problem...

when u set a defaultheightnode to 16, it works good.
but with 17, dont. try it, some nodes will have 3 points, and others
4.
but when u do a mousedown, it will use "always" 3.
so thats why it shows the diferents background (in doted).

so odd, even was the problem with the defaultheight.

if i found the exactly part of code that makes that, i will post a
msg.

tnx,
Ariel

 | Replies | Author | Date
2286 | Re: its only me? (tree lines, doted) | Mike Lischke | Sat 6/9/2001


re: Hiding the node editor

From: "Jim Kueneman" [jimdk@m...]
Date: Mon Jun 4, 2001 5:55 pm
Subject: Re: Hiding the node editor

--- In [VirtualTreeview@y...], Werner Lehmann [wl@b...] wrote:
> Hi,
>
> I have a node editor consisting of a TEdit and a dropdown form with
> another VTree (among other controls). While this works fine I'd like
> to hide it if the user selects the menu or switches tasks. Right now
> I can alt+tab to a different app and switch back and the target
editor
> is still open and active. This is different from the usual combobox
> behaviour and I would like to avoid that. Is there anything which I
> can do on node editor level (not Mainform.OnDeactivate or something
> like that)?

Werner,
Can you possibly catch the WM_KILLFOCUS message from the Edit
Control and post a message to itself to EndEdit? I am thinking it
could get into an shutting the door on it own foot if it is done
directly from the message handler.

Just a thought.

Jim


Problem with full row select

From: Kent Briggs [kbriggs@b...]
Date: Mon Jun 4, 2001 8:27 pm
Subject: Problem with full row select

Something changed between VT versions 2.4.16 and 2.4.21 that messed up my
full row selection. I have 6 columns and now the selection bar only fully
covers columns 0 and 2 through 5. In column 1, only the text is highlighted
while the white parts of the column are unselected. I don't know if this is
a bug or there was a new feature added that I need to set. I couldn't tell
from the history notes in the source file, however.

--
Kent Briggs, [kbriggs@b...]
Briggs Softworks, http://www.briggsoft.com

 | Replies | Author | Date
2216 | Re: Problem with full row select | Kent Briggs | Tue 6/5/2001
2218 | Re: Problem with full row select | Jim Kueneman | Tue 6/5/2001
2232 | Re: Problem with full row select | Roland | Wed 6/6/2001
2222 | Re: Problem with full row select | Kent Briggs | Tue 6/5/2001
2246 | Re: Problem with full row select, Solved-Bug? | Jim Kueneman | Thu 6/7/2001
2247 | Re: Problem with full row select, Solved-Bug? | Jim Kueneman | Thu 6/7/2001


Header click/move

From: Kent Briggs [kbriggs@b...]
Date: Mon Jun 4, 2001 8:32 pm
Subject: Header click/move

I noticed that when I disable header clicking, the columns can no longer be
moved even though the movable property was not changed from true. Is this
designed behavior? There are instances where I let the user click the header
to sort by that column but sometimes I need to disable that feature.
However, I always want them to be able to drag the column to a different
position even if clicking is disabled.

--
Kent Briggs, [kbriggs@b...]
Briggs Softworks, http://www.briggsoft.com

 | Replies | Author | Date
2206 | Re: Header click/move | Jim Kueneman | Tue 6/5/2001
2214 | Re: Header click/move | Kent Briggs | Tue 6/5/2001
2215 | Re: Header click/move | Jim Kueneman | Tue 6/5/2001
2220 | Re: Header click/move | Mike Lischke | Tue 6/5/2001


re: Re: Hiding the node editor

From: Werner Lehmann [wl@b...]
Date: Mon Jun 4, 2001 6:16 pm
Subject: Re: [VirtualTreeview] Re: Hiding the node editor

Jim Kueneman wrote:
>
> Can you possibly catch the WM_KILLFOCUS message from the Edit
> Control and post a message to itself to EndEdit? I am thinking it
> could get into an shutting the door on it own foot if it is done
> directly from the message handler.
>
> Just a thought.

Jim,

I am already using the OnExit of the TEdit. And this works: if I
click on another control on the form the node editor is hidden.
But this does not work with form deactivation, click on menus,
or click on controls which do not receive focus (any TGraphic-
Control for instance).

If I am not mistaken the combobox will close on any mouseclick
outside. A workaround might be to temporarily hook into the mainform
wndproc, provided that the owner of the VTree can safely be assumed
as the form it is sitting on. Still not very elegant.

Another idea might be to somehow hook or capture the mouse but I
am unsure how to do that. If I capture it it cannot move outside
of the capture rectangle afaik.

Werner

 | Replies | Author | Date
2204 | Re: Hiding the node editor | Jim Kueneman | Mon 6/4/2001


re: Hiding the node editor

From: "Jim Kueneman" [jimdk@m...]
Date: Mon Jun 4, 2001 11:46 pm
Subject: Re: Hiding the node editor

--- In [VirtualTreeview@y...], Werner Lehmann [wl@b...] wrote:

> If I am not mistaken the combobox will close on any mouseclick
> outside. A workaround might be to temporarily hook into the mainform
> wndproc, provided that the owner of the VTree can safely be assumed
> as the form it is sitting on. Still not very elegant.
>
> Another idea might be to somehow hook or capture the mouse but I
> am unsure how to do that. If I capture it it cannot move outside
> of the capture rectangle afaik.

Here is how I "rolldown" a TTreeview decendant like a combobox. It
starts is own message loop so it becomes "modal" then steals all the
messages that have to do with the mouse and keyboard. The
CM_DEACTIVATE is derived from WM_ACTIVATEAPP in the VCL.

Jim

procedure TCustomExplorerTreeview.InternalRollDown;
var
H, i: integer;
Msg: TMsg;
Done: Boolean;
begin
if UseAsDropDown then
begin
if not Visible then
Visible := True;
SetFocus;
Done := False;
{ Steal all mouse and key messages }
{ Order is important, after we flag Done if GetMessage is first it
will not }
{ return until some kind of message is avaiable. Causes strange
feeling }
{ delays.
}
while not Done and GetMessage(Msg, 0, 0, 0) do
begin
case Msg.message of
WM_MOUSEFIRST+1..WM_MOUSELAST,
WM_NCMOUSEMOVE+1..WM_NCMBUTTONDBLCLK:
begin
{ If User clicked outside of window were out of here }
if (WindowFromPoint(Msg.pt) <> Handle) then
Done := True
else
Msg.hwnd := Handle; // Steal the message
end;
WM_KEYFIRST..WM_KEYLAST:
begin
if Msg.message = WM_KeyDown then
Done := Msg.wParam = VK_ESCAPE;
if not Done then
Msg.hwnd := Handle
end;
CM_DEACTIVATE:
begin
Done := True
end;
end; // case
if not Done then
begin
TranslateMessage(Msg);
DispatchMessage(Msg);
end;

end;
Visible := False; // Hide it again
end;
end;


re: VET 1.1.21

From: "Jim Kueneman" [jimdk@m...]
Date: Tue Jun 5, 2001 2:38 am
Subject: Re: VET 1.1.21

--- In [VirtualTreeview@y...], Jim Kueneman [jimdk@m...] wrote:
> At 11:42 PM 6/3/2001 +0000, you wrote:

> You are right. Version 1.4.22 is up and "almost" like explorer.
You don't
> get the feedback on the mouse down it waits until it is released
before it
> changes focus then back to the original. Making it like Explorer
was more
> work than I want to do and I think it is close enough.

Hi Adem,

Try 1.4.23. It should now work JUST like explorer. You guilted me
into it. <g>

Jim


re: Header click/move

From: Jim Kueneman [jimdk@m...]
Date: Tue Jun 5, 2001 4:42 am
Subject: Re: [VirtualTreeview] Header click/move

At 03:32 PM 6/4/2001 -0500, you wrote:
>I noticed that when I disable header clicking, the columns can no longer be
>moved even though the movable property was not changed from true. Is this
>designed behavior? There are instances where I let the user click the header
>to sort by that column but sometimes I need to disable that feature.
>However, I always want them to be able to drag the column to a different
>position even if clicking is disabled.

How are you disabling the header clicking, I do not see an Option for that
in the latest release?

Jim


Setting font for each node

From: Wehofer Robert [wehofer@g...]
Date: Tue Jun 5, 2001 6:56 am
Subject: Setting font for each node

Hello!

Does anyone know how to set the font for a particular node?

Thanks in advance
Robert

 | Replies | Author | Date
2208 | Re: Setting font for each node | GIANNAKOPOULOS KOSTAS | Tue 6/5/2001
2209 | Re: Setting font for each node | Bender Heri | Tue 6/5/2001


re: Setting font for each node

From: GIANNAKOPOULOS KOSTAS [kyan@s...]
Date: Tue Jun 5, 2001 8:05 am
Subject: RE: [VirtualTreeview] Setting font for each node

> Does anyone know how to set the font for a particular node?

Use the OnPaintText event handler and modify the attributes of the passed
"Canvas" object like this:

procedure TRegistryForm.TreePaintText(Sender: TBaseVirtualTree;
const Canvas: TCanvas; Node: PVirtualNode; Column: Integer;
TextType: TVSTTextType);
var
Data: PMyNodeData;
begin
Data := Sender.GetNodeData(Node);
if <Some test that uses the Data of the node> then
with Canvas.Font do
begin
Color := clBlue;
Style := Style + [fsItalic];
end;
end;


re: Setting font for each node

From: Bender Heri [HBender@E...]
Date: Tue Jun 5, 2001 8:47 am
Subject: RE: [VirtualTreeview] Setting font for each node

Use OnPaintText.

Heri

> -----Original Message-----
> From: Wehofer Robert [mailto:[wehofer@g...]]
> Sent: Tuesday, June 05, 2001 8:56 AM
> To: 'VirtualTreeview@egroups.com'
> Subject: [VirtualTreeview] Setting font for each node
>
>
> Hello!
>
> Does anyone know how to set the font for a particular node?
>
> Thanks in advance
> Robert
>
> To unsubscribe from this group, send an email to:
> VirtualTreeview-unsubscribe@egroups.com
>
>
>
> Your use of Yahoo! Groups is subject to
> http://docs.yahoo.com/info/terms/
>
>


re: Re: Hiding the node editor

From: Mike Lischke [public@l...]
Date: Tue Jun 5, 2001 9:05 am
Subject: RE: [VirtualTreeview] Re: Hiding the node editor

> Here is how I "rolldown" a TTreeview decendant like a combobox.

And here are some hints from me. I can't give you all details (you know,
property of company etc.) but...

> procedure TCustomExplorerTreeview.InternalRollDown;
> var
> H, i: integer;
> Msg: TMsg;
> Done: Boolean;
> begin
> if UseAsDropDown then

There is the option voPopupMode particularly for this case so you don't need
your own flag. Additionally it changes some behavior like colors.

> if not Done then
> begin
> TranslateMessage(Msg);
> DispatchMessage(Msg);
> end;
>
> end;
> Visible := False; // Hide it again
> end;
> end;

An own message loop is one way another is TApplication.HookMainWindow:

constructor TCustomVirtualTreeComboBox.Create(AOwner: TComponent);

begin
inherited Create(AOwner);

FTreePopup := TTreePopup.Create(Self);
with FTreePopup do
begin
// Park the window far outside the screen to avoid it flashing.
Left := 100000;
ParentWindow := GetDesktopWindow;
Name := 'TreePopup';
Visible := False;
ShowWindow(Handle, SW_HIDE);
end;

FImageChangeLink := TChangeLink.Create;
FImageChangeLink.OnChange := ImageListChange;

FSeparator := ',';
FOptions := DefaultVirtualComboBoxOptions;

// The combo box has to hook the main window to get notified when the
application becomes inactive.
if not (csDesigning in ComponentState) then
Application.HookMainWindow(ApplicationMessageHook);
end;

destructor TCustomVirtualTreeComboBox.Destroy;

begin
if not (csDesigning in ComponentState) then
Application.UnhookMainWindow(ApplicationMessageHook);
FImageChangeLink.Free;
FTreePopup.Free;
inherited Destroy;
end;

function TCustomVirtualTreeComboBox.ApplicationMessageHook(var Msg:
TMessage): Boolean;

// Hides dropdown if user switches to another application.

begin
Result := False;
if DroppedDown then
begin
if ((Msg.Msg = WM_ACTIVATEAPP) and not TWMActivateApp(Msg).Active) then
begin
DroppedDown := False;
Result := True;
end;
end;
end;

Additionally you need to handle WM_KILLFOCUS (check what window gets the
focus!) and CM_CANCELMODE. Finally is some code to slide the popup:

procedure TCustomVirtualTreeComboBox.DoSetDroppedDown(Value: Boolean);

var
I, StepSize: Integer;
BackBitmap: TBitmap;
R: TRect;
ScreenDC: HDC;
Above: Boolean;

begin
inherited;

if Value then
begin
// Do an animated drop down.
Above := GetDropDownRect(R);
Include(FStates, cbsDroppedDownOnce);
with R do
begin
BackBitmap := TBitmap.Create;
ScreenDC := GetDC(0);
try
BackBitmap.Width := Right - Left;
BackBitmap.Height := Bottom - Top;
with FTreePopup do
begin
ScrollIntoView(FocusedNode);
Perform(WM_PRINT, wParam(BackBitmap.Canvas.Handle), PRF_NONCLIENT
or PRF_CLIENT);
end;
StepSize := BackBitmap.Height div 16;

if Above then
begin
for I := 1 to 16 do
begin
BitBlt(ScreenDC, Left, Top + BackBitmap.Height - I * StepSize,
BackBitmap.Width, I * StepSize,
BackBitmap.Canvas.Handle, 0, 0, SRCCOPY);
Sleep(1);
end;
end
else
begin
for I := 1 to 16 do
begin
BitBlt(ScreenDC, Left, Top, BackBitmap.Width, I * StepSize,
BackBitmap.Canvas.Handle, 0, BackBitmap.Height -
I * StepSize, SRCCOPY);
Sleep(1);
end;
end;
SetWindowPos(FTreePopup.Handle, 0, Left, Top, Right - Left, Bottom -
Top, SWP_SHOWWINDOW or SWP_NOACTIVATE);
SetCapture(FTreePopup.Handle);
finally
ReleaseDC(0, ScreenDC);
BackBitmap.Free;
end;
end;
end
else
begin
ReleaseCapture;
ShowWindow(FTreePopup.Handle, SW_HIDE);
ParseTree;
SelectAll;
end;
end;

HTH

Ciao, Mike


Strange mouse effect

From: GIANNAKOPOULOS KOSTAS [kyan@s...]
Date: Tue Jun 5, 2001 9:06 am
Subject: Strange mouse effect

Good morning, Mike.

I have noticed a strange behaviour in my Windows 2000 since i first began
working with VTree (version 01.31).

Sometimes when the mouse cursor is about to change when you move the mouse
from one window to another (especially a splitter) a black rectangle appears
momentarily and goes away immediately. It is so fast that you rarely have a
chance get a glimpse of it.
I don't know if it happens only in Delphi executables or in non-VCL windows
but ut DOES happen in apps that don't use VTree at all.

I'm not sure it has to do with VT at all, that's why i haven't told you yet,
maybe it is hardware dependant. I mention it just in case somebody else has
seen it too.

If you have seen this or if you have the faintest idea why it happens please
let me know.

Thanks

<KY>

 | Replies | Author | Date
2212 | Re: Strange mouse effect | Mike Lischke | Tue 6/5/2001
2266 | Re: Strange mouse effect | GIANNAKOPOULOS KOSTAS | Fri 6/8/2001
2673 | Re: Strange mouse effect | GIANNAKOPOULOS KOSTAS | Tue 6/26/2001


re: Strange mouse effect

From: Mike Lischke [public@l...]
Date: Tue Jun 5, 2001 9:14 am
Subject: RE: [VirtualTreeview] Strange mouse effect

Good morning Kostas,

> Sometimes when the mouse cursor is about to change when you
> move the mouse from one window to another (especially a splitter) a black
> rectangle appears momentarily and goes away immediately. It is so fast
that you
> rarely have a chance get a glimpse of it.

I think I have seen this behavior quite often (if it is what you mean) and
it is not directly related to VT applications. The problem seems to be the
shadow which is created on the fly for the mouse pointer on Win2K. This can
get interrupted sometimes depending on the graphics board driver. Do you
have an application which you can use to reproduce the problem often enough
on one machine and which does not show the effect on another machine with
another graphics board?

Ciao, Mike


re: Re: Hiding the node editor

From: GIANNAKOPOULOS KOSTAS [kyan@s...]
Date: Tue Jun 5, 2001 9:15 am
Subject: RE: [VirtualTreeview] Re: Hiding the node editor

> Finally is some code to slide the popup:
>
> procedure TCustomVirtualTreeComboBox.DoSetDroppedDown(Value: Boolean);
>
> var
> I, StepSize: Integer;
> BackBitmap: TBitmap;
> R: TRect;
> ScreenDC: HDC;
> Above: Boolean;
>
> begin
> inherited;
>
> if Value then
> begin
> // Do an animated drop down.

You can also use the AnimateWindow() API call

BOOL AnimateWindow(
HWND hwnd, // handle to window
DWORD dwTime, // duration of animation
DWORD dwFlags // animation type
);

Using AnimateWindow(Handle, 200, AW_SLIDE or AW_VER_POSITIVE) you get the
same effect as a combobox animation.

AnimateWindow() is avaliable in Windows 98 or Windows 2000 or later only, so
you might have to load it at runtime using GetProcAddress() or your
application will not run under Windows 95/NT.

<KY>


re: Header click/move

From: Kent Briggs [kbriggs@b...]
Date: Tue Jun 5, 2001 2:01 pm
Subject: Re: [VirtualTreeview] Header click/move

Jim Kueneman wrote:

> At 03:32 PM 6/4/2001 -0500, you wrote:
> >I noticed that when I disable header clicking, the columns can no longer be
> >moved even though the movable property was not changed from true. Is this
> >designed behavior? There are instances where I let the user click the header
> >to sort by that column but sometimes I need to disable that feature.
> >However, I always want them to be able to drag the column to a different
> >position even if clicking is disabled.
>
> How are you disabling the header clicking, I do not see an Option for that
> in the latest release?

There's a coAllowClick and coMovable under header.columns[i].options. The
problem
is that coMovable is ignored if I turn coAllowClick off.

--
Kent Briggs, [kbriggs@b...]
Briggs Softworks, http://www.briggsoft.com

 | Replies | Author | Date
2215 | Re: Header click/move | Jim Kueneman | Tue 6/5/2001


re: Header click/move

From: "Jim Kueneman" [jimdk@m...]
Date: Tue Jun 5, 2001 2:49 pm
Subject: Re: Header click/move

--- In [VirtualTreeview@y...], Kent Briggs [kbriggs@b...] wrote:
> Jim Kueneman wrote:

> There's a coAllowClick and coMovable under
header.columns[i].options. The problem
> is that coMovable is ignored if I turn coAllowClick off.

Why yes there is, Mike the voMovable option is never used! Concider
this:

In TVirtualTreeColumns.AdjustDownColumn replace

if (NewIndex > NoColumn) and (NewIndex <> FDownIndex) and
(coAllowClick in Items[NewIndex].FOptions) and
(coEnabled in Items[NewIndex].FOptions) then

with this:

if (NewIndex > NoColumn) and (NewIndex <> FDownIndex) and
((coAllowClick in Items[NewIndex].FOptions) or (coMovable in
Items[NewIndex].FOptions)) and
(coEnabled in Items[NewIndex].FOptions) then

it gives the appearance of it being clicked but does allow a drag.
This is a bit questionable from a users perspective it really should
have a new index flag for dragging and check the coMovable to set it.

I don't see any ill effects since this method is only called once from
WM_NCLBUTTONDOWN handler in the TVTHeader.HandleMessage method.

Jim


re: Problem with full row select

From: Kent Briggs [kbriggs@b...]
Date: Tue Jun 5, 2001 5:55 pm
Subject: Re: [VirtualTreeview] Problem with full row select

Kent Briggs wrote:

> Something changed between VT versions 2.4.16 and 2.4.21 that messed up my
> full row selection. I have 6 columns and now the selection bar only fully
> covers columns 0 and 2 through 5. In column 1, only the text is highlighted
> while the white parts of the column are unselected.

Nevermind. Somehow, the coParentColor property of header.columns[1].options got
flipped off in the upgrade. Now that I turned it back on, full row select is
working normal again.

--
Kent Briggs, [kbriggs@b...]
Briggs Softworks, http://www.briggsoft.com

 | Replies | Author | Date
2218 | Re: Problem with full row select | Jim Kueneman | Tue 6/5/2001
2232 | Re: Problem with full row select | Roland | Wed 6/6/2001


double clicking

From: [ccdsystems@y...]
Date: Tue Jun 5, 2001 6:15 pm
Subject: double clicking

The tree view that I've built has 8 top level nodes. If a child of
the bottom 7 nodes is double clicked, then the file loads on the
right of the screen. However, if a child of the top node is double
clicked, then it loads into the right of the screen and is deleted as
a child of the first node.

This is causing a problem for me. If any child of the first node is
double clicked except the bottom child, there's no problem. But if
the bottom child is double clicked, then after it loads, the next
parent node down (the second parent) will either open or close. I've
traced this to the fact that after the DblClick event is called, the
TBaseVirtualTree.WMLButtonDblClk event is called. This procedure
looks at where the double click was (hit test) and if it was a bottom
level node, it repaints, but if it is a parent, it toggles the node.

Since from the DblClick procedure I call a procedure that deletes the
selected node, by the time it gets to
TBaseVirtualTree.WMLButtonDblClk the hit test results point at the
next node down. This is why the second parent only expands when the
bottom child is double clicked and deleted.

My question is how do I keep it from doing this? I'm using version
1.31 right now. I don't want to modify the source code unless I have
to, since it makes upgrades tougher. Is this a bug, or is there a
way for me to code around it?

Thanks, Spencer

 | Replies | Author | Date
2219 | Re: double clicking | Werner Lehmann | Tue 6/5/2001
2302 | Re: double clicking | Mike Lischke | Sat 6/9/2001


re: Problem with full row select

From: "Jim Kueneman" [jimdk@m...]
Date: Tue Jun 5, 2001 6:38 pm
Subject: Re: Problem with full row select

--- In [VirtualTreeview@y...], Kent Briggs [kbriggs@b...] wrote:
> Nevermind. Somehow, the coParentColor property of
header.columns[1].options got
> flipped off in the upgrade. Now that I turned it back on, full row
select is
> working normal again.

Ok my turn for a question! I noticed in the last few versions my full
row select only hilights the area behind the text why? How do I get
it to draw a solid blue bar across the tree?

I tried changing the coParentColor for each column as you pointed out
with no success. It only is a problem if columns are used.

Jim


re: double clicking

From: Werner Lehmann [wl@b...]
Date: Tue Jun 5, 2001 6:42 pm
Subject: Re: [VirtualTreeview] double clicking

[ccdsystems@y...] wrote:
>
> My question is how do I keep it from doing this? I'm using version
> 1.31 right now. I don't want to modify the source code unless I have
> to, since it makes upgrades tougher. Is this a bug, or is there a
> way for me to code around it?

I have never experienced such a problem but I did not delete a node
in OnDblClick either. I suggest that you first check out the latest
version from the mailing list file area and if that does not help
post a message to yourself (the form's handle) and actually delete the
node only in that message handler.

Regards,
Werner


re: Re: Header click/move

From: "Mike Lischke" [public@l...]
Date: Tue Jun 5, 2001 7:35 pm
Subject: RE: [VirtualTreeview] Re: Header click/move

Jim,

> Mike the voMovable option is never used!

Yes indeed, this option is never checked anywhere. But using it the way you
have outlined means to allow a click effect even if a column is not allowed to
be clicked. There must be a better solution. I have taken this issue in my todo
list.

Ciao, Mike


re: FullRowSelect suggestion

From: "Mike Lischke" [public@l...]
Date: Tue Jun 5, 2001 7:39 pm
Subject: RE: [VirtualTreeview] FullRowSelect suggestion

Hi Franc,

> one suggestion I would like to ask regarding fullrowselect is, if it's
> possible to only draw to the selection to the rightmost side of the last
> column when the total width of the columns is smaller than the width of VT.

Taken in the todo list.

Ciao, MIke


re: Re: Problem with full row select

From: Kent Briggs [kbriggs@b...]
Date: Tue Jun 5, 2001 8:18 pm
Subject: Re: [VirtualTreeview] Re: Problem with full row select

Jim Kueneman wrote:

> --- In [VirtualTreeview@y...], Kent Briggs [kbriggs@b...] wrote:
> > Nevermind. Somehow, the coParentColor property of
> header.columns[1].options got
> > flipped off in the upgrade. Now that I turned it back on, full row
> select is
> > working normal again.
>
> Ok my turn for a question! I noticed in the last few versions my full
> row select only hilights the area behind the text why? How do I get
> it to draw a solid blue bar across the tree?
>
> I tried changing the coParentColor for each column as you pointed out
> with no success. It only is a problem if columns are used.

I can't duplicate that. Maybe Mike will know. Are you doing any color
changing in any of the events?

--
Kent Briggs, [kbriggs@b...]
Briggs Softworks, http://www.briggsoft.com

 | Replies | Author | Date
2246 | Re: Problem with full row select, Solved-Bug? | Jim Kueneman | Thu 6/7/2001
2247 | Re: Problem with full row select, Solved-Bug? | Jim Kueneman | Thu 6/7/2001


Full Collapse gives access violation

From: Kent Briggs [kbriggs@b...]
Date: Tue Jun 5, 2001 8:31 pm
Subject: Full Collapse gives access violation

Mike,

When I have a node selected that doesn't have any children, pressing / on the
keypad causes an access violation in the FullCollapse procedure.

On a related note, FullExpand does not work for me. Pressing * on the keypad
just removes all my + buttons. Probably the reason is because I populate my
tree on the fly inside the OnExpanding event and I delete child nodes when a
node is collapsed so that the data (disk directories) is always fresh. I
don't know if altering your FullExpand logic would be feasible. I may just
have to trap the * key and build my own recursive expand function.

--
Kent Briggs, [kbriggs@b...]
Briggs Softworks, http://www.briggsoft.com

 | Replies | Author | Date
2226 | Re: Full Collapse gives access violation | Jim Kueneman | Tue 6/5/2001
2228 | Re: Full Collapse gives access violation | Kent Briggs | Tue 6/5/2001
2243 | Re: Full Collapse gives access violation | Kent Briggs | Wed 6/6/2001


voPopupMenu and blended Icons

From: Werner Lehmann [wl@b...]
Date: Tue Jun 5, 2001 10:07 pm
Subject: voPopupMenu and blended Icons

Hi Mike,

a little glitch (it seems): option voPopupMenu lets selected
nodes appear as if the tree would have focus. But not for
their icons which appear a little bit grayed out as if the
tree would not have focus (which is the case but voPopupMenu... :)

BTW, this gray blending of selected nodes in unfocused trees
is a little bit... unexpected. All unselected nodes are painted
stronger (not blended) as the selected one. Maybe this can be
changed as well in order to emphasize the selected node?

Regards,
Werner

 | Replies | Author | Date
2255 | Re: voPopupMenu and blended Icons | Mike Lischke | Thu 6/7/2001
2260 | Re: voPopupMenu and blended Icons | Werner Lehmann | Fri 6/8/2001


BeginUpdate / EndUpdate

From: Werner Lehmann [wl@b...]
Date: Tue Jun 5, 2001 10:21 pm
Subject: BeginUpdate / EndUpdate

Hi,

While I am using BeginUpdate and EndUpdate quite often I
have one problem with it: after BU the tree does not paint
anything (but a clBtnFace colored space). This is a problem
if I must show a popup dialog during a lengthy operation to
query the user for some input or even show him a progress.

I would rather have the tree image 'frozen' in a buffer
bitmap which could be used for any paintings while updatecount
is >0. I know that this not the ideal solution, the buffer
image consumes resources, and the buffer cannot help if VTree
is resized meanwhile. Therefore it makes sense to have an
optional "UseBackBuffer: boolean = false" parameter for Begin-
Update. Resize is not an issue in the scenario that I described
as both dialogs would be application modal.

I expect that these changes are not difficult and may be of
interest to others. What do you say (Mike)? If you vote against
it the changes could be done in a descendant probably...

Regards,
Werner

PS: How do comctrls as TListBox behave after Items.BeginUpdate?

 | Replies | Author | Date
2256 | Re: BeginUpdate / EndUpdate | Mike Lischke | Thu 6/7/2001
2261 | Re: BeginUpdate / EndUpdate | Werner Lehmann | Fri 6/8/2001


re: Full Collapse gives access violation

From: "Jim Kueneman" [jimdk@m...]
Date: Tue Jun 5, 2001 10:23 pm
Subject: Re: Full Collapse gives access violation

--- In [VirtualTreeview@y...], Kent Briggs [kbriggs@b...] wrote:
> Mike,

>When I have a node selected that doesn't have any children, pressing
>/ on the keypad causes an access violation in the FullCollapse
> procedure.

Looks like a bug. In

FullCollapse

This line
Node := GetLast(Node);

returns nil if there are no children and there is no check for a nil
Node in the rest of the method.

>
> On a related note, FullExpand does not work for me. Pressing * on
the keypad
> just removes all my + buttons. Probably the reason is because I
populate my
> tree on the fly inside the OnExpanding event and I delete child

Did you use OnInitNode and set ivsHasChildren if it is a folder? Then
create the children in OnInitChildren using AddChild and set any
custom user data there. After which OnInitNode will be called for each
of the new children when VT decides it need information to display it.

Jim


re: VirtualTreeview Demos

From: "Brian" [bghugg@a...]
Date: Tue Jun 5, 2001 10:25 pm
Subject: Re: VirtualTreeview Demos

--- In [VirtualTreeview@y...], "Mike Lischke" [public@l...] wrote:
> Hi Brian,
>
> > Are there demos available for using the 2.4+ versions of
> > VirtualTreeview?
>
> Not yet. I can upload to YG the stuff as I have it now if you
like...
>
> Ciao, Mike

Mike,

I would appreciate that very much.

Thanks,
Brian Huggins


re: Re: Full Collapse gives access violation

From: Kent Briggs [kbriggs@b...]
Date: Tue Jun 5, 2001 11:40 pm
Subject: Re: [VirtualTreeview] Re: Full Collapse gives access violation

Jim Kueneman wrote:

> > On a related note, FullExpand does not work for me. Pressing * on the
> keypad
> > just removes all my + buttons. Probably the reason is because I populate
> my
> > tree on the fly inside the OnExpanding event and I delete child
>
> Did you use OnInitNode and set ivsHasChildren if it is a folder? Then
> create the children in OnInitChildren using AddChild and set any
> custom user data there. After which OnInitNode will be called for each
> of the new children when VT decides it need information to display it.

No, I haven't been using OnInitNode. I'll studying up on it and see if that
fixes my problem. Thanks.

--
Kent Briggs, [kbriggs@b...]
Briggs Softworks, http://www.briggsoft.com


ShellUtilities.ConvertLocalStrToTFileTime

From: Werner Lehmann [wl@b...]
Date: Tue Jun 5, 2001 10:27 pm
Subject: ShellUtilities.ConvertLocalStrToTFileTime

Hi Jim or Mike,

(at least) since 2.4.16 I get this warning at package compilation:

[Hint] Package 'VirtualTreesD5' does not use or export
'ShellUtilities.ConvertLocalStrToTFileTime'

Is it possible to avoid that? Thank you.

Regards,
Werner

 | Replies | Author | Date
2237 | Re: ShellUtilities.ConvertLocalStrToTFileTime | Jim Kueneman | Wed 6/6/2001


re: Incremental Searching

From: Werner Lehmann [wl@b...]
Date: Tue Jun 5, 2001 11:05 pm
Subject: Re: [VirtualTreeview] Incremental Searching

Mike Lischke wrote:
>
> Mmh, this could well be, particularly as it works well for most of the cases.
I have implemented it
> that way and it seems now to work no exactly as in Explorer.

Very well. This works really good now, thank you for all the effort you have
put into this
(HandleIncrementalSearch is now quite lengthy compared to its first version)
and the
patience that you have had (and still have :) with me.

Regards,
Werner


VT Version 2.4.20

From: "Jim Kueneman" [jimdk@m...]
Date: Wed Jun 6, 2001 5:30 am
Subject: VT Version 2.4.20

Mike,

Can you remember EXACTLY what you did to get to version 20? That
was when you implemented the different DragManager (new interface). I
have been trying to figure out why if I drag and drop a file using the
Control or Shift to modify it a menu pops up asking if I want to do
the action or cancel instead of just doing the action. I have a
version of VET that works correctly then the next version the only
thing I did to VET was to make the changes necessary for the new
implementation and it has exhibited this problem from that point on.

I have just spent 2 hours convincing myself it was not something I
did and have almost convinced myself that it is something to do with
the IDataObject. Since I am getting the IDataObject from the
namespace I have not touched the drag drop stuff for a long time so it
must be something that happened during the change to the DragManager.

Do you have any clues?

Hint: If I force the dwEffect in the IDropTarget.Drop call and do
NOT hold a modifier key down it works as expected. I then break on
this line and see that the KeyState is 0 and the dwEffect is what I
hard coded in. If I hard code a KeyState of 0 and the dwEffect BUT
hold down a modifier key it pops up the menu to verify the operation.
It appears it is looking at the key and not believing the KeyState
parameter.

This is driving me nuts.

Jim

 | Replies | Author | Date
2238 | Re: VT Version 2.4.20 | Jim Kueneman | Wed 6/6/2001
2245 | Re: VT Version 2.4.20 - Solved | Jim Kueneman | Thu 6/7/2001
2303 | Re: VT Version 2.4.20 - Solved | Mike Lischke | Sat 6/9/2001
2332 | It is worth it! | Jim Kueneman | Mon 6/11/2001
2333 | Re: It is worth it! | [adembaba@e...] | Mon 6/11/2001


re: Problem with full row select

From: "Roland" [Beduerftig@S...]
Date: Wed Jun 6, 2001 7:27 am
Subject: Re: Problem with full row select

> Kent Briggs wrote:
>
> > Something changed between VT versions 2.4.16 and 2.4.21 that
<snip>
>
> Nevermind. Somehow, the coParentColor property of
> header.columns[1].options got flipped off in the upgrade.
> Now that I turned it back on, full row select is
> working normal again.

Hi to all,

I had the same problem and at tuesday I send Mike some screenshots to
show this problem.
Today I try this tip to set the Property coParentColor to true, and
now my tree's works fine like as in version 2.4.16.

have a nice day
Roland


New file uploaded to VirtualTreeview

From: [VirtualTreeview@yahoogroups.com>
Date: Wed Jun 6, 2001 9:52 am
Subject: New file uploaded to VirtualTreeview

Hello,

This email message is a notification to let you know that
a file has been uploaded to the Files area of the VirtualTreeview
group.

File : /PropertyEditor.zip
Uploaded by : [Beduerftig@S...]
Description : for BCB5: show how to use IVTEditLink with VT 2.4.21

You can access this file at the URL

http://groups.yahoo.com/group/VirtualTreeview/files/PropertyEditor.zip

To learn more about file sharing for your group, please visit

http://help.yahoo.com/help/us/groups/files

Regards,

Beduerftig@S...]


for BCB5: show how to use IVTEditLink with VT 2.4.21

From: "Roland" [Beduerftig@S...]
Date: Wed Jun 6, 2001 9:55 am
Subject: for BCB5: show how to use IVTEditLink with VT 2.4.21

Hi to all BCB5-User,

I have updated the demo for the usage with VT 2.4.21.

The reason was:
2 methods in the interface are changed.

Roland


Struggling with upgrade 1.31 -> 2.4.21

From: "Will Watts" [willw@a...]
Date: Wed Jun 6, 2001 12:38 pm
Subject: Struggling with upgrade 1.31 -> 2.4.21

Hi,

I would like to upgrade my application from VT1.3x to the latest
version, but have come unstuck as follows.

1. The archive VirtualTree 2.4.21.zip seems incomplete (as well as
hard to download, by the way. My IE 5.5 seems no more able to
cope with the '%20' for space than Netscape, which I recall reading
here has trouble). The Dpk compilation fails because of references
to TVTDragDropManager, a class not included in the supplied files
AFAICS. I overcame this by deleting VirtualExplorerTree from
VirtualTreesD5.dpk (and ShellUtilities too, since it doesn't seem
relevant to what I am doing).

Is this a correct approach? I am not intersted in Explorer stuff at
the moment. But I would prefer to work with the 'official' code
unaltered.

2. I have wired the new version into an existing application that
uses TVirtualStringTree. However, the app now causes an Access
Violation on exit! This only seems to happen if I close it when one
of its leaf nodes has focus.

It dies in TBaseVirtualTree.GetDisplayRect (called from
InvalidateNode and WMKillFocus). It seems to be called very *very*
late in the day - after the Destroy has been called on the
TVirtualStringTree, and when lots of controls have been getting
Notification calls. I manually delete the root node - ie the node
created with TreeView.AddChild(nil) - before the owner form
destroys itself.

Suggestions from the panel warmly welcomed - I don't wish to
revert to an earlier version.

Regards

Will

Will Watts Direct Line +44 20 8400 6104
Applied Industrial Systems Ltd Main Voice +44 20 8400 6100
10 Barley Mow Passage Fax +44 20 8742 2456
Chiswick London W4 4PH Web http://www.applied.co.uk

 | Replies | Author | Date
2236 | Re: Struggling with upgrade 1.31 -> 2.4.21 | Jim Kueneman | Wed 6/6/2001


re: Struggling with upgrade 1.31 -> 2.4.21

From: Jim Kueneman [jimdk@m...]
Date: Wed Jun 6, 2001 1:26 pm
Subject: Re: [VirtualTreeview] Struggling with upgrade 1.31 -> 2.4.21

At 01:38 PM 6/6/2001 +0100, you wrote:
>Hi,
>1. The archive VirtualTree 2.4.21.zip seems incomplete (as well as
>hard to download, by the way. My IE 5.5 seems no more able to
>cope with the '%20' for space than Netscape, which I recall reading
>here has trouble). The Dpk compilation fails because of references
>to TVTDragDropManager, a class not included in the supplied files
>AFAICS. I overcame this by deleting VirtualExplorerTree from

The problems is VT still includes an older version of VET (which is in the
VirtualExplorerTree.pas file) I had to change the interface to keep it in
step with VT.

Mike can you include the latest version (not the one there now it contains
a serious bug if 2 VETs are used in one application I will upload a new
version when you answer my latest question <g>)

So, answer you question download the latest version of VET and replace
VirtualExplorerTree.pas and ShellUtilites.pas with the latest version, or
do what you did remove them.

Jim


re: ShellUtilities.ConvertLocalStrToTFileTime

From: Jim Kueneman [jimdk@m...]
Date: Wed Jun 6, 2001 1:27 pm
Subject: Re: [VirtualTreeview] ShellUtilities.ConvertLocalStrToTFileTime

At 12:27 AM 6/6/2001 +0200, you wrote:
>Hi Jim or Mike,
>
>Is it possible to avoid that? Thank you.

I will be fixed in the next version.

Jim


re: VT Version 2.4.20

From: "Jim Kueneman" [jimdk@m...]
Date: Wed Jun 6, 2001 1:40 pm
Subject: Re: VT Version 2.4.20

--- In [VirtualTreeview@y...], "Jim Kueneman" [jimdk@m...] wrote:
> Mike,
>
> Can you remember EXACTLY what you did to get to version 20? That
> was when you implemented the different DragManager (new interface).

Mike,

I just verified it but reverting back to VT 2.4.16 and only changing
my latest VET enought to make it compile it included the different
DragManager, removing the BeginUpdate event, and removing any
references to column colors. The drag and drop works like it should.
Before I look at the line by line I hope you have thought or two.

Jim

 | Replies | Author | Date
2245 | Re: VT Version 2.4.20 - Solved | Jim Kueneman | Thu 6/7/2001
2303 | Re: VT Version 2.4.20 - Solved | Mike Lischke | Sat 6/9/2001
2332 | It is worth it! | Jim Kueneman | Mon 6/11/2001
2333 | Re: It is worth it! | [adembaba@e...] | Mon 6/11/2001


re: Struggling with upgrade 1.31 -> 2.4.21

From: Mike Lischke [public@l...]
Date: Wed Jun 6, 2001 2:01 pm
Subject: RE: [VirtualTreeview] Struggling with upgrade 1.31 -> 2.4.21

Jim,

> Mike can you include the latest version (not the one there
> now it contains a serious bug if 2 VETs are used in one application I
will
> upload a new version when you answer my latest question <g>)

I have already updated both files last weekend. I'm sorry that I cannot take
part in the discussion currently. I will try to follow up the more than 20
messages I still have in my inbox at home but I cannot promise when I come
across your mail and can answer it. Of course at least next weekend
everything gets answered :o)

Ciao, Mike

 | Replies | Author | Date
2240 | Re: Struggling with upgrade 1.31 -> 2.4.21 | Jim Kueneman | Wed 6/6/2001
2241 | Re: Struggling with upgrade 1.31 -> 2.4.21 | Will Watts | Wed 6/6/2001
2242 | Re: Struggling with upgrade 1.31 -> 2.4.21 | Jim Kueneman | Wed 6/6/2001
2258 | Re: Struggling with upgrade 1.31 -> 2.4.21 | Mike Lischke | Thu 6/7/2001
2267 | Re: Struggling with upgrade 1.31 -> 2.4.21 | Will Watts | Fri 6/8/2001
2259 | Re: Struggling with upgrade 1.31 -> 2.4.21 | Mike Lischke | Thu 6/7/2001


re: Struggling with upgrade 1.31 -> 2.4.21

From: "Jim Kueneman" [jimdk@m...]
Date: Wed Jun 6, 2001 2:48 pm
Subject: Re: Struggling with upgrade 1.31 -> 2.4.21

--- In [VirtualTreeview@y...], Mike Lischke [public@l...] wrote:
> Jim,
>
> > Mike can you include the latest version (not the one there
> > now it contains a serious bug if 2 VETs are used in one
application I
> will
> > upload a new version when you answer my latest question <g>)

I stand corrected.

I have had problems with packages not staying in sync. Try going to
the $Delphi\Projects\BPL folder and delete the VirtualTreesDx.bpl and
.dcp files

Then recompile the package.

Jim

 | Replies | Author | Date
2241 | Re: Struggling with upgrade 1.31 -> 2.4.21 | Will Watts | Wed 6/6/2001
2242 | Re: Struggling with upgrade 1.31 -> 2.4.21 | Jim Kueneman | Wed 6/6/2001


re: Re: Struggling with upgrade 1.31 -> 2.4.21

From: "Will Watts" [willw@a...]
Date: Wed Jun 6, 2001 5:13 pm
Subject: Re: [VirtualTreeview] Re: Struggling with upgrade 1.31 -> 2.4.21

On 6 Jun 2001, at 13:40, Jim Kueneman wrote:

> So, answer you question download the latest version of VET and
> replace VirtualExplorerTree.pas and ShellUtilites.pas with the
> latest version, or do what you did remove them.

Thanks. I am a bit confused by the to-ing and fro-ing between
yourself and Mike; I think I'll stick to my own bodged version for the
time being.

Actually, even the cut down content of VirtualTreesD5.dpk has
been giving me trouble. I have found that with the module
VirtualTreesReg.pas included, I get funny problems when I do a
'build all'.

Surely it is more logical that VirtualTreesReg.pas lives in its own
design-time only package? And VirtualTreesD5.dpk is marked
runtime only? Then if one wanted to build an app using runtime
packages, one could thus avoid shipping the property editor code.
(I thought that was why the property editor and Register code was
moved out of the main .PAS.) I admit I am influenced by RxLib's
organisation.

Anyway, I have reorganised it along these lines here, and have got
rid of my funny build errors, and my AV too! Fingers crossed...

Will

Will Watts Direct Line +44 20 8400 6104
Applied Industrial Systems Ltd Main Voice +44 20 8400 6100
10 Barley Mow Passage Fax +44 20 8742 2456
Chiswick London W4 4PH Web http://www.applied.co.uk

 | Replies | Author | Date
2242 | Re: Struggling with upgrade 1.31 -> 2.4.21 | Jim Kueneman | Wed 6/6/2001


re: Struggling with upgrade 1.31 -> 2.4.21

From: "Jim Kueneman" [jimdk@m...]
Date: Wed Jun 6, 2001 5:43 pm
Subject: Re: Struggling with upgrade 1.31 -> 2.4.21

--- In [VirtualTreeview@y...], "Will Watts" [willw@a...] wrote:
> On 6 Jun 2001, at 13:40, Jim Kueneman wrote:
>
> > So, answer you question download the latest version of VET and
> > replace VirtualExplorerTree.pas and ShellUtilites.pas with the
> > latest version, or do what you did remove them.
>
> Thanks. I am a bit confused by the to-ing and fro-ing between
> yourself and Mike; I think I'll stick to my own bodged version for
the
> time being.

Sorry 'bout that.

It should work.

Try to

1 Save what you have!
2 Download VT 2.4.21 again
3 Delete any VirtualTreesDx.* files in the Delphi install folder under
\Projects\Bpl\
4 Open the VirtualTreesD5.pkg and recompile it.
5 Reopen you project and see if it works.

Jim


re: Re: Full Collapse gives access violation

From: Kent Briggs [kbriggs@b...]
Date: Wed Jun 6, 2001 6:17 pm
Subject: Re: [VirtualTreeview] Re: Full Collapse gives access violation

>
> > > On a related note, FullExpand does not work for me. Pressing * on the
> keypad
> > > just removes all my + buttons. Probably the reason is because I populate
> my
> > > tree on the fly inside the OnExpanding event and I delete child
> >
> > Did you use OnInitNode and set ivsHasChildren if it is a folder? Then
> > create the children in OnInitChildren using AddChild and set any
> > custom user data there. After which OnInitNode will be called for each
> > of the new children when VT decides it need information to display it.

I solved my problem with the * key. Since I use AddChild in the OnExpanding
event to populate my tree, all I needed to do was put these two lines in the
OnInitChildren event:

sender.expanded[node]:=true;
childcount:=node.childcount;

--
Kent Briggs, [kbriggs@b...]
Briggs Softworks, http://www.briggsoft.com


Another FullCollapse question

From: Kent Briggs [kbriggs@b...]
Date: Wed Jun 6, 2001 9:25 pm
Subject: Another FullCollapse question

This may have been discussed before but why does FullCollapse perform node
initiation? Why doesn't it just run down the tree and unexpand all the visible
nodes?

--
Kent Briggs, [kbriggs@b...]
Briggs Softworks, http://www.briggsoft.com

 | Replies | Author | Date
2301 | Re: Another FullCollapse question | Mike Lischke | Sat 6/9/2001


re: Re: VT Version 2.4.20 - Solved

From: Jim Kueneman [jimdk@m...]
Date: Thu Jun 7, 2001 1:14 am
Subject: Re: [VirtualTreeview] Re: VT Version 2.4.20 - Solved

At 01:40 PM 6/6/2001 +0000, you wrote:
>--- In [VirtualTreeview@y...], "Jim Kueneman" [jimdk@m...] wrote:
> > Mike,
> >
> > Can you remember EXACTLY what you did to get to version 20? That
> > was when you implemented the different DragManager (new interface).
>
>Mike,
>
> I just verified it but reverting back to VT 2.4.16 and only changing
>my latest VET enought to make it compile it included the different
>DragManager, removing the BeginUpdate event, and removing any

It appears the shell does not like you calling DragOver from within the
DragDrop call. If I filter this DragOver call out during the drop the
popup menu is not shown. I have no explination for why this is.

Jim

 | Replies | Author | Date
2303 | Re: VT Version 2.4.20 - Solved | Mike Lischke | Sat 6/9/2001
2332 | It is worth it! | Jim Kueneman | Mon 6/11/2001
2333 | Re: It is worth it! | [adembaba@e...] | Mon 6/11/2001


re: Problem with full row select, Solved-Bug?

From: "Jim Kueneman" [jimdk@m...]
Date: Thu Jun 7, 2001 5:24 am
Subject: Re: Problem with full row select, Solved-Bug?

--- In [VirtualTreeview@y...], Kent Briggs [kbriggs@b...] wrote:
> Jim Kueneman wrote:
> >
> > Ok my turn for a question! I noticed in the last few versions my
full
> > row select only hilights the area behind the text why? How do I
get
> > it to draw a solid blue bar across the tree?
> >
> > I tried changing the coParentColor for each column as you pointed
out
> > with no success. It only is a problem if columns are used.
>
> I can't duplicate that. Maybe Mike will know. Are you doing any
color
> changing in any of the events?

Yes I am and that is the problem.

Mike,
In the PrepareCell method concider this addition:

// Fill cell background if its color differs from tree background.
with FHeader.FColumns do
if IsValidColumn(Column) and not (coParentColor in
Items[Column].FOptions) then
begin
if vsSelected in Node.States then
begin
if Focused or (voPopupMode in FOptions) then
Brush.Color := FColors.FocusedSelectionColor
else
Brush.Color := FColors.UnfocusedSelectionColor
end else
Brush.Color := Items[Column].Color;
FillRect(CellRect);
end;

The new stuff is if coParentColor is NOT in the options, ie a custom
column color before just painting it the Column color check and make
sure the node is not selected and if so use the Selection colors.

Jim

 | Replies | Author | Date
2247 | Re: Problem with full row select, Solved-Bug? | Jim Kueneman | Thu 6/7/2001


re: Re: Problem with full row select, Solved-Bug?

From: Jim Kueneman [jimdk@m...]
Date: Thu Jun 7, 2001 5:58 am
Subject: Re: [VirtualTreeview] Re: Problem with full row select, Solved-Bug?

At 05:24 AM 6/7/2001 +0000, you wrote:
>--- In [VirtualTreeview@y...], Kent Briggs [kbriggs@b...] wrote:

Mike,

I jumped the gun on that fix. The DropTarget also is drawn with only
the text background for each column in the DropTargetColor. This fix will
cause the entire line to be hilighted in the DropTargetColor. I am not
sure if you want that or only the first column text background hilighted
(I did not find a quick solution to that scenerio) but here it is, just an
extension of the last fix.

Jim

// Fill cell background if its color differs from tree background.
with FHeader.FColumns do
if IsValidColumn(Column) and not (coParentColor in
Items[Column].FOptions) then
begin
if vsSelected in Node.States then
begin
if Focused or (voPopupMode in FOptions) then
Brush.Color := FColors.FocusedSelectionColor
else
Brush.Color := FColors.UnfocusedSelectionColor
end else
if Node = FCurrentTargetNode then
Brush.Color := FColors.DropTargetColor
else
Brush.Color := Items[Column].Color;
FillRect(CellRect);
end;


Expanding Nodes With '*'

From: [ian@k...]
Date: Thu Jun 7, 2001 11:18 am
Subject: Expanding Nodes With '*'

First of all, as a new user I have to say I'm enormously impressed by
both the VirtualTreeview control itself, and particularly the fact
it's freeware - big thanks and much kudos to Mike Lischke for
providing this.

That said, I've come across a very minor "issue" with it - I don't
think it can be called a bug, but for what it's worth it is a
difference in behaviour between VTV and the MS TreeView.

If you have a tree several levels deep, and select an expanded node
which has collapsed children, pressing the '*' key recursively
expands those children in the MS control but does nothing in the
VTV. If the selected node's initially collapsed, it gets fully
expanded in both cases.

Neither "expanded self, collapsed children" behaviour could be called
truly right or wrong, but I do have a slight preference for
the "expand everything in the branch whatever the selected node's
state" option.

I've trivially updated my copy of the TVT code to make this happen -
if anyone else is concerned about this it's just a question of going
to the TBaseVirtualTree.WMKeyDown method and removing the "Not
(vsExpanded...)" clause in the following line.

VK_MULTIPLY:
if Assigned(FFocusedNode) and Not (vsExpanded in
FFocusedNode.States)then
FullExpand(FFocusedNode);

Hope this is actually of interest to somebody (anybody!),
Ian Kirk

 | Replies | Author | Date
2249 | Re: Expanding Nodes With '*' | Jim Kueneman | Thu 6/7/2001
2250 | Re: Expanding Nodes With '*' | [ian@k...] | Thu 6/7/2001


re: Expanding Nodes With '*'

From: Jim Kueneman [jimdk@m...]
Date: Thu Jun 7, 2001 1:20 pm
Subject: Re: [VirtualTreeview] Expanding Nodes With '*'

At 11:18 AM 6/7/2001 +0000, you wrote:
>to the TBaseVirtualTree.WMKeyDown method and removing the "Not
>(vsExpanded...)" clause in the following line.
>
> VK_MULTIPLY:
> if Assigned(FFocusedNode) and Not (vsExpanded in
>FFocusedNode.States)then
> FullExpand(FFocusedNode);

What version are you using? The lastest beta version looks like you suggest:

VK_MULTIPLY:
if Assigned(FFocusedNode) then
FullExpand(FFocusedNode);

Beta version 2.4.21 is at http://groups.yahoo.com/group/VirtualTreeview/files/
It is beta but very stable and there are substantial changes to it from the
version on Mike's website. I would suggest before getting to far download
the latest version to minimize changes to your application later when this
become the released version

Jim

 | Replies | Author | Date
2250 | Re: Expanding Nodes With '*' | [ian@k...] | Thu 6/7/2001


re: Expanding Nodes With '*'

From: [ian@k...]
Date: Thu Jun 7, 2001 1:27 pm
Subject: Re: Expanding Nodes With '*'

--- In [VirtualTreeview@y...], Jim Kueneman [jimdk@m...] wrote:
> At 11:18 AM 6/7/2001 +0000, you wrote:
> >to the TBaseVirtualTree.WMKeyDown method and removing the "Not
> >(vsExpanded...)" clause in the following line.
> >
> > VK_MULTIPLY:
> > if Assigned(FFocusedNode) and Not (vsExpanded in
> >FFocusedNode.States)then
> > FullExpand(FFocusedNode);
>
> What version are you using? The lastest beta version looks like
you suggest:
>
> VK_MULTIPLY:
> if Assigned(FFocusedNode) then
> FullExpand(FFocusedNode);
>
>
> Beta version 2.4.21 is at
http://groups.yahoo.com/group/VirtualTreeview/files/
> It is beta but very stable and there are substantial changes to it
from the
> version on Mike's website. I would suggest before getting to far
download
> the latest version to minimize changes to your application later
when this
> become the released version

Jim, I've got v1.31 according to the comments at the top of
VirtualTrees.pas; wasn't aware of the beta version (or the Files
area, or even this Club, until this morning!), but now you've tipped
me off I'll make sure I look there first in future.

Thanks for the info,
Ian


Access Violation caused by FullExpand on empty tree (FIX?)

From: [SimonMoscrop@H...]
Date: Thu Jun 7, 2001 2:45 pm
Subject: Access Violation caused by FullExpand on empty tree (FIX?)

Hi Mike,

I have noticed that calling full expand on a Virtual Tree which is
empty { i know it sounds crazy :-) } causes an Access Violation.

I have detailed below the fix that i have used (My code is in
CAPITALS) I don't know if you want to use this as a fix or not.. but
here it is.

Cheers for your tree, and your time.

- Simon Moscrop

procedure TBaseVirtualTree.FullExpand(Node: PVirtualNode = nil);

// This routine expands all collapsed nodes in the subtree given by
Node or the whole tree if Node is FRoot or nil.
// All nodes on the way down are initialized so this procedure might
take a long time.
// Since all nodes are validated, the tree cannot make use of
optimatizations. Hence it is counter productive and you
// should consider avoiding its use.

var
Stop: PVirtualNode;

begin
Include(FStates, tsExpanding);
BeginUpdate;
try
if Node = nil then
begin
Node := FRoot.FirstChild;
Stop := nil;
end
else
begin
Stop := Node.NextSibling;
if Stop = nil then
begin
Stop := Node;
repeat
Stop := Stop.Parent;
until (Stop = FRoot) or Assigned(Stop.NextSibling);
if Stop = FRoot then
Stop := nil
else
Stop := Stop.NextSibling;
end;
end;

IF ASSIGNED(NODE) THEN // Begin fix.
BEGIN

// Initialize the start node. Others will be initialized in
GetNext.
if not (vsInitialized in Node.States) then
InitNode(Node);

repeat
if (vsHasChildren in Node.States) and (Node.ChildCount = 0)
then
InitChildren(Node);
if [vsHasChildren, vsExpanded] * Node.States =
[vsHasChildren] then
ToggleNode(Node);
Node := GetNext(Node);
until Node = Stop;

END; // End of fix
finally
EndUpdate;
Exclude(FStates, tsExpanding);
end;
end;

 | Replies | Author | Date
2253 | Re: Access Violation caused by FullExpand on empt | Mike Lischke | Thu 6/7/2001


Use of mrNone in v2.4.21 Enumeration

From: "Ian Kirk" [ian@k...]
Date: Thu Jun 7, 2001 4:49 pm
Subject: Use of mrNone in v2.4.21 Enumeration

Just switched to TVT 2.4.21 and had to make very few changes at all,
but ran up against a bit of a problem with the mrNone item defined as
a member of the TVTMoveRestriction enumeration.

This clashes with the global constant defined in Controls.pas,
useable when specifying a ModalResult for a form. Normally such a
clash would be resolved by adding the module name as a prefix -
Controls.mrNone - but as most places this will be needed in will be
member methods off the T[Custom]Form heirachy, the Controls prefix
itself clashes with the property of that name. There doesn't seem to
be any way of resolving that secondary clash.

The only workaround I could figure out was to add

const mrNone = Controls.mrNone ;

in the global section of any modules that want to use the ModalResult
form of mrNone; this then becomes the default form of the item, and
TVTMoveRestriction.mrNone can be used when the other form is required.

This is a bit hacky, though - can anyone suggest a tidier workaround,
or would changing the "mr" prefixes for the TVTMoveRestriction be a
sensible suggestion?

TIA for any feedback,
Ian

 | Replies | Author | Date
2270 | Re: Use of mrNone in v2.4.21 Enumeration | Vadim Sedulin | Fri 6/8/2001
2300 | Re: Use of mrNone in v2.4.21 Enumeration | Mike Lischke | Sat 6/9/2001
2340 | Re: Use of mrNone in v2.4.21 Enumeration | Ian Kirk | Mon 6/11/2001


re: Access Violation caused by FullExpand on empty tree (FIX?)

From: "Mike Lischke" [public@l...]
Date: Thu Jun 7, 2001 8:12 pm
Subject: RE: [VirtualTreeview] Access Violation caused by FullExpand on empty tree (FIX?)

Hi Simon,

> I have noticed that calling full expand on a Virtual Tree which is
> empty { i know it sounds crazy :-) } causes an Access Violation.

Thank you for pointing this out. Indeed this was a flaw in the implementation.
Fixed.

Ciao, Mike


Newbie questions about VET

From: [FRiviR2@a...]
Date: Thu Jun 7, 2001 8:16 pm
Subject: Newbie questions about VET

Hi Jim,

I've searched through the groups, but I didn't find about these...
(anyway, I hope that I've not missed an answer to one the following
questions ;o)

1) Is there a way to handle the creation of a new folder, the way MS
Explorer does : showing a new folder in the tree, in editing mode ?

2) when you drag a file using the right mouse button, a context menu
should be shown, to choose if you want to move or copy the file ?

3) I can't get work the ShowPropertySheet method. I get some kind of
message "Properties unavailiable" or get an empty properties dialog...
I run D4.03 standardon Windows 2000 Pro SP2. Will it be the cause of
this ? nevertheless, I can call the properties dialog using the
context menu of an item.

Thanks in advance for your answers.

François Rivierre

 | Replies | Author | Date
2263 | Re: Newbie questions about VET | Jim Kueneman | Fri 6/8/2001
2265 | New Version of VET 1.4.24 | Jim Kueneman | Fri 6/8/2001


re: voPopupMenu and blended Icons

From: "Mike Lischke" [public@l...]
Date: Thu Jun 7, 2001 8:20 pm
Subject: RE: [VirtualTreeview] voPopupMenu and blended Icons

Hi Werner,

> a little glitch (it seems): option voPopupMenu lets selected
> nodes appear as if the tree would have focus. But not for
> their icons which appear a little bit grayed out as if the
> tree would not have focus (which is the case but voPopupMenu... :)

Can it be that you are talking about voPopupMode :o]? If yes then I think I
have fixed what you meant.

> BTW, this gray blending of selected nodes in unfocused trees
> is a little bit... unexpected. All unselected nodes are painted
> stronger (not blended) as the selected one. Maybe this can be
> changed as well in order to emphasize the selected node?

This is the way the system listview paints it and my feeling is it makes sense.
I have howeve changed the blend color so that if an image is already ghosted
then it is not blended with the selection color.

Ciao, Mike


re: BeginUpdate / EndUpdate

From: "Mike Lischke" [public@l...]
Date: Thu Jun 7, 2001 8:38 pm
Subject: RE: [VirtualTreeview] BeginUpdate / EndUpdate

Werner,

> While I am using BeginUpdate and EndUpdate quite often I
> have one problem with it: after BU the tree does not paint
> anything (but a clBtnFace colored space). This is a problem
> if I must show a popup dialog during a lengthy operation to
> query the user for some input or even show him a progress.

I'm sorry, but this is the *meaning* of BeginUpdate/EndUpate that nothing
happens. The only way I can imagine is to ask the user *before* the lengthy
operation is started.

> I expect that these changes are not difficult and may be of
> interest to others. What do you say (Mike)? If you vote against
> it the changes could be done in a descendant probably...

I doubt this should really be implemented that way. It can easily be
circumvented without such (sometimes unreliable) support. I mean, if you really
want it then nobody will prevent you from doing so, but I think you would only
handle the symptoms not the cause.

> PS: How do comctrls as TListBox behave after Items.BeginUpdate?

As expected. The treewindow becomes unpainted (background erasing seems to come
through, though).

Ciao, Mike


re: Re: VirtualTreeview Demos

From: "Mike Lischke" [public@l...]
Date: Thu Jun 7, 2001 8:38 pm
Subject: RE: [VirtualTreeview] Re: VirtualTreeview Demos

Brian,

> I would appreciate that very much.

They are there. Look in the file area of YG.

Ciao, Mike


re: Struggling with upgrade 1.31 -> 2.4.21

From: "Mike Lischke" [public@l...]
Date: Thu Jun 7, 2001 8:44 pm
Subject: RE: [VirtualTreeview] Struggling with upgrade 1.31 -> 2.4.21

Hi Will,

> 1. The archive VirtualTree 2.4.21.zip seems incomplete (as well as
> hard to download, by the way.

I have quickly fixed the zip when I became aware of the wrong files. This
should already be ok.

>My IE 5.5 seems no more able to
> cope with the '%20' for space than Netscape, which I recall reading
> here has trouble).

This seems to be a specific problem of YG. I can neither get a file with IE 5,
5.5 nor 6b with a left click (an empty zip file arrives). I always have to
right-click/save first.

> Is this a correct approach? I am not intersted in Explorer stuff at
> the moment. But I would prefer to work with the 'official' code
> unaltered.

Yup, this is ok, but like I wrote, this should be fixed by now. If there are
still any problems just tell me.

> 2. I have wired the new version into an existing application that
> uses TVirtualStringTree. However, the app now causes an Access
> Violation on exit! This only seems to happen if I close it when one
> of its leaf nodes has focus.

Strange. Can you please elaborate more? I have never heard of such a problem.

> I manually delete the root node - ie the node
> created with TreeView.AddChild(nil) - before the owner form
> destroys itself.

Mmh, this could perhaps be the problem. Why do you destroy it manually and,
more important, what do you mean with "root node". Is it one of the top level
nodes or the hidden root node accessible by Tree.RootNode?

Ciao, Mike

 | Replies | Author | Date
2267 | Re: Struggling with upgrade 1.31 -> 2.4.21 | Will Watts | Fri 6/8/2001


re: Re: Struggling with upgrade 1.31 -> 2.4.21

From: "Mike Lischke" [public@l...]
Date: Thu Jun 7, 2001 8:50 pm
Subject: RE: [VirtualTreeview] Re: Struggling with upgrade 1.31 -> 2.4.21

> I have had problems with packages not staying in sync. Try going to
> the $Delphi\Projects\BPL folder and delete the VirtualTreesDx.bpl and
> .dcp files

Just a friendly hint: forget the BPL folder of Delphi or compile everything (!)
into it. In my company we had trouble since years with the packages until I
worked out a way which appears now very reliable. We have created an output
folder on all developer machines (always c:\temp\out) and compile all dcu, dcp
and bpl files into it. We have taken this path into the search path of Windows
as well as the library search path and since its introduction we never had any
more problems with packages (there is also a project group containing all
packages in dependency order from top to bottom, so setting up a new machine or
doing a full rebuild is now a piece of cake).

Btw: whenever you copy a new version of VT or VET into your library folder be
sure to do a "build all" and don't forget to rebuild packages :o)

Ciao, Mike


re: voPopupMenu and blended Icons

From: Werner Lehmann [wl@b...]
Date: Thu Jun 7, 2001 9:41 pm
Subject: Re: [VirtualTreeview] voPopupMenu and blended Icons

Mike,

Mike Lischke wrote:
>
> Can it be that you are talking about voPopupMode :o]? If yes then I think I
have fixed what you meant.

Indeed :) Thank you.

> This is the way the system listview paints it and my feeling is it makes
sense. I have howeve changed the blend color so that if an image is already
ghosted then it is not blended with the selection color.

I am not using the ghosting style as of now so it will not
make a difference for me. Anyhow it's ok, the issue is not
a matter of life and death :)

Werner


re: BeginUpdate / EndUpdate

From: Werner Lehmann [wl@b...]
Date: Thu Jun 7, 2001 9:47 pm
Subject: Re: [VirtualTreeview] BeginUpdate / EndUpdate

Mike,

Mike Lischke wrote:
>
> > While I am using BeginUpdate and EndUpdate quite often I
> > have one problem with it: after BU the tree does not paint
> > anything (but a clBtnFace colored space). This is a problem
> > if I must show a popup dialog during a lengthy operation to
> > query the user for some input or even show him a progress.
>
> I'm sorry, but this is the *meaning* of BeginUpdate/EndUpate that nothing
happens. The only way I can imagine is to ask the user *before* the lengthy
operation is started.

The user started that operation. The progress is shown in front of the VTree
which it changes. If Update is not suspended the operation is noticably slower.
If Update is suspended the user can 'draw' with the progress dialog the VTree
contents away, and if a confirmation dialog pops up meanwhile and is clicked
away it leaves a btnface rect behind.

I felt it would be the easiest to cache the 'before update contents' of the
VTree
in a backbuffer *if explicitly requested by that default param*.

> > I expect that these changes are not difficult and may be of
> > interest to others. What do you say (Mike)? If you vote against
> > it the changes could be done in a descendant probably...
>
> I doubt this should really be implemented that way. It can easily be
circumvented without such (sometimes unreliable) support. I mean, if you really
want it then nobody will prevent you from doing so, but I think you would only
handle the symptoms not the cause.

I am all ears if you have something better in mind :)

> > PS: How do comctrls as TListBox behave after Items.BeginUpdate?
>
> As expected. The treewindow becomes unpainted (background erasing seems to
come through, though).

I see. Probably because of WM_ERASEBKGND which is not influenced by internal
control update handling.

Werner


Will Kylix be Supported?

From: Rea Berryman [fberrym1@t...]
Date: Fri Jun 8, 2001 2:26 am
Subject: Will Kylix be Supported?

Just wondering if there are any plans to port to Kylix.

Rea

 | Replies | Author | Date
2275 | Re: Will Kylix be Supported? | Mike Lischke | Fri 6/8/2001
2283 | Re: Will Kylix be Supported? | Rea Berryman | Sat 6/9/2001


re: Newbie questions about VET

From: Jim Kueneman [jimdk@m...]
Date: Fri Jun 8, 2001 7:01 am
Subject: Re: [VirtualTreeview] Newbie questions about VET

At 08:16 PM 6/7/2001 +0000, you wrote:
>1) Is there a way to handle the creation of a new folder, the way MS
>Explorer does : showing a new folder in the tree, in editing mode ?

Download the new version there is a new method

CreateNewFolder(TargetPath: WideString)

Note the TargetPath is an existing path where you want the new folder
put. It creates it just like Explorer.

>2) when you drag a file using the right mouse button, a context menu
>should be shown, to choose if you want to move or copy the file ?

I was waiting for someone to notice that. Implemented in new version.

>3) I can't get work the ShowPropertySheet method. I get some kind of
>message "Properties unavailiable" or get an empty properties dialog...

My mistake, corrected in new version.

Jim


New file uploaded to VirtualTreeview

From: [VirtualTreeview@yahoogroups.com>
Date: Fri Jun 8, 2001 6:58 am
Subject: New file uploaded to VirtualTreeview

Hello,

This email message is a notification to let you know that
a file has been uploaded to the Files area of the VirtualTreeview
group.

File : /VET_V1.4.24.zip
Uploaded by : [jimdk@m...]
Description : Virtual Explorer Tree Version 1.4.24 with Demo Executable

You can access this file at the URL

http://groups.yahoo.com/group/VirtualTreeview/files/VET_V1.4.24.zip

To learn more about file sharing for your group, please visit

http://help.yahoo.com/help/us/groups/files

Regards,

jimdk@m...]


New Version of VET 1.4.24

From: Jim Kueneman [jimdk@m...]
Date: Fri Jun 8, 2001 7:10 am
Subject: New Version of VET 1.4.24

Like the subject says:

VirtualExplorerTree.pas VERSION 1.4.24

- Added a CreateNewFolder method. Pass the target folder where a new
folder
will be created in. The passed folder MUST exist. It will act
just like
Explorer creating a new folder named "New Folder" or "New Folder
(x)" then select it
for editing.

- Reworked the context menu/ right click again. Now the Right mouse
button
works just like Explorer with right dragging popping up a context
menu to
verify the operation or choose a different operation. Note it
works like explorer if
the voRightButtonSelect is OFF. The explorerTree does NOT support
Right Button
Select.

- Fixed potential bug in NotifyThread for syncronization of threads.

- Fixed bug calling Free instead of Release in a referenced counted
object, oops!

- Work around for confirmation dialog popuping up when drag + shift
is used to act on a
file. The Shell does not like VT's calling of DragOver from
within the
DragDrop method. Added Dragging flag so DragOver does not call the
shells
IDropTarget interfaces during this call to DragOver, the inherited
DragOver
is still called to preserve whatever VT was trying to do.

ShellUtilities.pas VERSION 1.4.22

- Fixed bug in ShowPropertySheet

- Reworked most methods that can use multiple namespaces as
parameters to
be consistant. This may break some code and I am sorry but I did not
realize how inconsistant it was. To call methods that take multiple
namespaces the passed namespaces MUST BE immediate CHILDREN of the
namespace
used to call the method. This means for instance to use the Delete
method
to delete a namespace you use the Parent propery of that namespace to
call the Delete method with the namespace to delete in the
TNamespaceArray paramter.
To only act on one namespace you call the method of the namespace
to be acted on.

- Reworked ShellDetailInteface property getter.

- Fixed DetailsOf() method. Returned information from nonexistant
item. (or crashed)

Enjoy,
Jim


re: Strange mouse effect

From: GIANNAKOPOULOS KOSTAS [kyan@s...]
Date: Fri Jun 8, 2001 8:40 am
Subject: RE: [VirtualTreeview] Strange mouse effect

> Do you have an application which you can use to reproduce the
> problem often enough
> on one machine and which does not show the effect on another
> machine with
> another graphics board?

No as i said the effect is very random and hard to reprocuce. It may happen,
say, when the mouse goes from one window to another, but if you try to do it
again it won't happen. You catch a glimpse of it at the corner of your eye
and then it's gone. As if it is cloaked with Douglas Adams' "Someone else's
problem" field, if you've read him.

I can't get my hands on other machines and i don't have time to play with
the mouse on them until i see the effect, but one of my colleagues has
noticed this effect too, and both of our machines have ATI 3D RAGE graphics
boards, so you could be right about this having to do with the graphics
board.

I'll try to find a newer version of the drivers for my board and tell you if
something changes.

<KY>


re: Struggling with upgrade 1.31 -> 2.4.21

From: "Will Watts" [willw@a...]
Date: Fri Jun 8, 2001 10:10 am
Subject: RE: [VirtualTreeview] Struggling with upgrade 1.31 -> 2.4.21

On 7 Jun 2001, at 22:44, Mike Lischke wrote:
> > I manually delete the root node - ie the node
> > created with TreeView.AddChild(nil) - before the owner form
> > destroys itself.
>
> Mmh, this could perhaps be the problem. Why do you destroy it manually

This is a hangover from when the program used the 'real'
TTreeView. I'm not boasting about this design ;-) but don't see why
it shouldn't work.

> and, more important, what do you mean with "root node". Is it one of
> the top level nodes or the hidden root node accessible by
> Tree.RootNode?

The top level node rather than the hidden root.

I made this problem go away by accident. The rearranging of
packages I outlined elsewhere (separation of design time and
runtime packages) made it go away. Yuck! But I'm content.

Thanks for your attention. I seem to be ok now.

W

Will Watts Direct Line +44 20 8400 6104
Applied Industrial Systems Ltd Main Voice +44 20 8400 6100
10 Barley Mow Passage Fax +44 20 8742 2456
Chiswick London W4 4PH Web http://www.applied.co.uk


Problems with autosort and initial RootNodeCount <> 0

From: "Martijn Brinkers" [brinkers@h...]
Date: Fri Jun 8, 2001 10:25 am
Subject: Problems with autosort and initial RootNodeCount <> 0

I just started using your fabulous treeview. I have found 1 (small) problem. I
experimented with the Minimal demo and tried setting AutoSort option to True.
It resulted in 'read of address 00000000'. The reason is that in InitNode the
following line

Data := GetNodeData(Node);

Results in Data := nil

It seems that InitNode is called (called for every node) before FormCreate is
called. The problem does not occur if you set the nr of initial nodes to 0 in
the inspector window.

I think it does not affect most uses but it was just something I found and
threfore report :)

Anyways Thanks for your wonderful tree

Martijn Brinkers

[Non-text portions of this message have been removed]

 | Replies | Author | Date
2273 | Re: Problems with autosort and initial RootNodeCo | Jim Kueneman | Fri 6/8/2001
2274 | Re: Problems with autosort and initial RootNodeCo | Mike Lischke | Fri 6/8/2001
2277 | Re: Problems with autosort and initial RootNodeCo | Martijn Brinkers | Fri 6/8/2001


[no subject]

From: [brinkers@h...]
Date: Fri Jun 8, 2001 10:23 am
Subject:

m>; Fri, 8 Jun 2001 12:23:57 +0200
Message-ID: [008001c0f005$64cb1f30$787ba8c0@m...]
To: [VirtualTreeView@yahoogroups.com>
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 5.50.4522.1200
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200
From: "Martijn Brinkers" <brinkers@h...]
MIME-Version: 1.0
Mailing-List: list VirtualTreeview@yahoogroups.com; contact
VirtualTreeview-owner@yahoogroups.com
Delivered-To: mailing list VirtualTreeview@yahoogroups.com
Precedence: bulk
List-Unsubscribe: <mailto:VirtualTreeview-unsubscribe@yahoogroups.com>
Date: Fri, 8 Jun 2001 12:25:52 +0200
Reply-To: VirtualTreeview@yahoogroups.com
Subject: [VirtualTreeview] Problems with autosort and initial RootNodeCount <> 0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
X-UIDL: 1471
Status: U

I just started using your fabulous treeview. I have found 1 (small) problem. I
experimented with the Minimal demo and tried setting AutoSort option to True.
It resulted in 'read of address 00000000'. The reason is that in InitNode the
following line

Data := GetNodeData(Node);

Results in Data := nil

It seems that InitNode is called (called for every node) before FormCreate is
called. The problem does not occur if you set the nr of initial nodes to 0 in
the inspector window.

I think it does not affect most uses but it was just something I found and
threfore report :)

Anyways Thanks for your wonderful tree

Martijn Brinkers

[Non-text portions of this message have been removed]

To unsubscribe from this group, send an email to:
VirtualTreeview-unsubscribe@egroups.com

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/


re: Use of mrNone in v2.4.21 Enumeration

From: "Vadim Sedulin" [wsntrl@o...]
Date: Fri Jun 8, 2001 12:09 pm
Subject: Re: [VirtualTreeview] Use of mrNone in v2.4.21 Enumeration

Hello Ian!

----- Original Message -----
From: Ian Kirk
To: [VirtualTreeview@yahoogroups.com
Sent: 7 ???? 2001 ?. 20:49
Subject: [VirtualTreeview] Use of mrNone in v2.4.21 Enumeration

... cut ...

> The only workaround I could figure out was to add
>
> const mrNone = Controls.mrNone ;

Move Controls after VirtualTrees in uses:
uses Windows, SysUtils, ... , VirtualTrees, Controls;

Bye.

Vadim Sedulin
E-Mail: wsntrl@o...]


Can somebody

From: Carlos Ortiz Quiros [carlosaortiz@y...]
Date: Fri Jun 8, 2001 1:14 pm
Subject: Can somebody

Can somebody explain me what is meaning of VET?
Thanks in advance

=====
Carlos Adolfo Ortiz Q
[carlosaortiz@y...]

__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail - only $35
a year! http://personal.mail.yahoo.com/

 | Replies | Author | Date
2272 | Re: Can somebody | Jim Kueneman | Fri 6/8/2001


re: Can somebody

From: Jim Kueneman [jimdk@m...]
Date: Fri Jun 8, 2001 1:24 pm
Subject: Re: [VirtualTreeview] Can somebody

At 06:14 AM 6/8/2001 -0700, you wrote:
>Can somebody explain me what is meaning of VET?
>Thanks in advance

V-irtual E-xplorer T-ree

Mike coined the acronym. I did not realize at the time it is also an
animal doctor <g>

Jim


re: Problems with autosort and initial RootNodeCount <> 0

From: "Jim Kueneman" [jimdk@m...]
Date: Fri Jun 8, 2001 6:12 pm
Subject: Re: Problems with autosort and initial RootNodeCount <> 0

--- In [VirtualTreeview@y...], "Martijn Brinkers" [brinkers@h...] wrote:
>
> Data := GetNodeData(Node);
>
> Results in Data := nil

Are you using the new Beta version 2.4.21 or so?

http://groups.yahoo.com/group/VirtualTreeview/files/

NOTE: None of the demos in V1.3 will work there are a number of
changes to be made.

Jim


re: Problems with autosort and initial RootNodeCount <> 0

From: "Mike Lischke" [public@l...]
Date: Fri Jun 8, 2001 8:36 pm
Subject: RE: [VirtualTreeview] Problems with autosort and initial RootNodeCount <> 0

Hi Martijn,

> I just started using your fabulous treeview. I have found 1 (small) problem.
> I experimented with the Minimal demo and tried setting AutoSort option to
> True. It resulted in 'read of address 00000000'.

Oh, you found a bug for a case I have not tested (auto sort which causes a Sort
in Tree.Loaded, but NodeDataSize is set in code instead of design time, but not
via event :o]). Thank you. This is fixed now. Wait for next upload to YG.

Ciao, Mike


re: Will Kylix be Supported?

From: "Mike Lischke" [public@l...]
Date: Fri Jun 8, 2001 8:36 pm
Subject: RE: [VirtualTreeview] Will Kylix be Supported?

Hi Rea,

> Just wondering if there are any plans to port to Kylix.

Well, I had plans but stopped any thinking about it. It would mean too much
work for nothing (because I will not use Linux in the foreseeable future). It
could be that other developer like to do the port, but there are some very
Windows specific things in the tree, like OLE drag'n drop and a lot of message
based handling which is so not supported on Linux.

Seems there will be a long delay if there is a port at all, sorry.

Ciao, Mike


New file uploaded to VirtualTreeview

From: [VirtualTreeview@yahoogroups.com>
Date: Fri Jun 8, 2001 8:42 pm
Subject: New file uploaded to VirtualTreeview

Hello,

This email message is a notification to let you know that
a file has been uploaded to the Files area of the VirtualTreeview
group.

File : /2.4.23.zip
Uploaded by : [public@l...]
Description : Beta version

You can access this file at the URL

http://groups.yahoo.com/group/VirtualTreeview/files/2.4.23.zip

To learn more about file sharing for your group, please visit

http://help.yahoo.com/help/us/groups/files

Regards,

public@l...]

 | Replies | Author | Date
2278 | Re: New file uploaded to VirtualTreeview..Almost | Jim Kueneman | Fri 6/8/2001


re: Re: Problems with autosort and initial RootNodeCount <> 0

From: "Martijn Brinkers" [brinkers@h...]
Date: Fri Jun 8, 2001 8:47 pm
Subject: RE: Re: Problems with autosort and initial RootNodeCount <> 0

>>
>> Data := GetNodeData(Node);
>>
>> Results in Data := nil

>Are you using the new Beta version 2.4.21 or so?

>NOTE: None of the demos in V1.3 will work there are a number of
>changes to be made.

>Jim

I use the latest (beta) version and the latest (beta) demos. It is easy to
reproduce the effect.
Create a new app and drop a VirtualStringTree. Set RootNodeCount > 0 e.g.
10. Set AutoSort to True (all with the object inspector).
Then add the following lines :

procedure TForm1.FormCreate(Sender: TObject);
begin
VirtualStringTree1.NodeDataSize := 1;
end;

procedure TForm1.VirtualStringTree1InitNode(Sender: TBaseVirtualTree;
ParentNode, Node: PVirtualNode;
var InitialStates: TVirtualNodeInitStates);
var
Ptr : Pointer;
begin
Ptr := VirtualStringTree1.GetNodeData(Node);
end;

Now InitNode gets called 10 times (if RootNodeCount =10) before FormCreate
is called with Ptr = Nil and it gets also called 10 times after FormCreate
is called but then Ptr <> Nil. I dont think this is intended behaviour....

Martijn Brinkers


re: New file uploaded to VirtualTreeview..Almost got it

From: "Jim Kueneman" [jimdk@m...]
Date: Fri Jun 8, 2001 9:08 pm
Subject: Re: New file uploaded to VirtualTreeview..Almost got it

Hi Mike,

Looks like the full row select problem is *almost* fixed <g>. Now in
non-Full Row Select the selected cell does not respect the column
color in the area that is not drawn in the hilighted color.

The drop target paints its cell correctly.

:)

Jim


re: New file uploaded to VirtualTreeview

From: Kent Briggs [kbriggs@b...]
Date: Fri Jun 8, 2001 9:54 pm
Subject: Re: [VirtualTreeview] New file uploaded to VirtualTreeview

[VirtualTreeview@yahoogroups.com wrote:

> You can access this file at the URL
>
> http://groups.yahoo.com/group/VirtualTreeview/files/2.4.23.zip

Looks like a bad link here.

--
Kent Briggs, kbriggs@b...]
Briggs Softworks, http://www.briggsoft.com

 | Replies | Author | Date
2280 | Re: New file uploaded to VirtualTreeview | Mike Lischke | Fri 6/8/2001


re: New file uploaded to VirtualTreeview

From: "Mike Lischke" [public@l...]
Date: Fri Jun 8, 2001 10:11 pm
Subject: RE: [VirtualTreeview] New file uploaded to VirtualTreeview

Kent,

> > http://groups.yahoo.com/group/VirtualTreeview/files/2.4.23.zip
>
> Looks like a bad link here.

This was only for one or two minutes until I fixed that. You must just have
been browsing there in
that minute :o] Please try again.

Ciao, Mike


re: New file uploaded to VirtualTreeview

From: Kent Briggs [kbriggs@b...]
Date: Fri Jun 8, 2001 11:42 pm
Subject: Re: [VirtualTreeview] New file uploaded to VirtualTreeview

Mike Lischke wrote:

> Kent,
>
> > > http://groups.yahoo.com/group/VirtualTreeview/files/2.4.23.zip
> >
> > Looks like a bad link here.
>
> This was only for one or two minutes until I fixed that. You must just have
been browsing there in
> that minute :o] Please try again.

It's still a bad link. The whole beginning of the file name is missing as you
can see above. It just
shows "2.4.23.zip" at the end of the url. I never saw another message with a
full url.

--
Kent Briggs, [kbriggs@b...]
Briggs Softworks, http://www.briggsoft.com

 | Replies | Author | Date
2282 | Re: New file uploaded to VirtualTreeview | Jim Kueneman | Sat 6/9/2001
2284 | Re: New file uploaded to VirtualTreeview | Mike Lischke | Sat 6/9/2001


re: New file uploaded to VirtualTreeview

From: Jim Kueneman [jimdk@m...]
Date: Sat Jun 9, 2001 12:21 am
Subject: Re: [VirtualTreeview] New file uploaded to VirtualTreeview

At 06:42 PM 6/8/2001 -0500, you wrote:
>Mike Lischke wrote:
>
> > Kent,
> >
> > > > http://groups.yahoo.com/group/VirtualTreeview/files/2.4.23.zip
> > >
> > > Looks like a bad link here.
> >
> > This was only for one or two minutes until I fixed that. You must just
> have been browsing there in
> > that minute :o] Please try again.
>
>It's still a bad link. The whole beginning of the file name is missing as
>you can see above. It just
>shows "2.4.23.zip" at the end of the url. I never saw another message
>with a full url.

Looks like Mike has finally also been bitten by the %20 space problem <g>

Jim

 | Replies | Author | Date
2284 | Re: New file uploaded to VirtualTreeview | Mike Lischke | Sat 6/9/2001


re: Will Kylix be Supported?

From: Rea Berryman [fberrym1@t...]
Date: Sat Jun 9, 2001 2:37 am
Subject: Re: [VirtualTreeview] Will Kylix be Supported?

Thanks for letting me know.

Rea
PS: You have a great product!!


re: New file uploaded to VirtualTreeview

From: "Mike Lischke" [public@l...]
Date: Sat Jun 9, 2001 9:26 am
Subject: RE: [VirtualTreeview] New file uploaded to VirtualTreeview

> >It's still a bad link. The whole beginning of the file name is missing as
> >you can see above. It just
> >shows "2.4.23.zip" at the end of the url. I never saw another message
> >with a full url.

> Looks like Mike has finally also been bitten by the %20 space problem <g>

Mmh, strange. I used spaces all the time. Well, I will use underlines too with
the next upload.

Ciao, Mike


VT Level count

From: Delph! [delph@h...]
Date: Sat Jun 9, 2001 11:59 am
Subject: VT Level count

Hi all,

how to get level count in VirtualTreeView?
I am looking for function etc.: VT.LevelCount:Integer

Can you help me?

D.

 | Replies | Author | Date
2296 | Re: VT Level count | Mike Lischke | Sat 6/9/2001
2297 | Re[2]: [VirtualTreeview] VT Level count | Delph! | Sat 6/9/2001
2310 | Re: VT Level count | Werner Lehmann | Sat 6/9/2001
2311 | Re: VT Level count | Jim Kueneman | Sun 6/10/2001
2315 | Re: VT Level count | Werner Lehmann | Sun 6/10/2001
2317 | Re: VT Level count | Jim Kueneman | Sun 6/10/2001
2323 | Zip Unzip Demo | Jim Kueneman | Sun 6/10/2001
2334 | Re: Zip Unzip Demo | [adembaba@e...] | Mon 6/11/2001


re: Re: its only me? (tree lines, doted)

From: "Mike Lischke" [public@l...]
Date: Sat Jun 9, 2001 12:03 pm
Subject: RE: [VirtualTreeview] Re: its only me? (tree lines, doted)

Ariel,

> when u set a defaultheightnode to 16, it works good.
> but with 17, dont. try it, some nodes will have 3 points, and others
> 4.

Also in this case I cannot see any difference.

> if i found the exactly part of code that makes that, i will post a
> msg.

Yes, do that. Would be fine to know if I have overlooked something and can
correct it.

Ciao, Mike


re: Re: Can't select node with keyboard.

From: "Mike Lischke" [public@l...]
Date: Sat Jun 9, 2001 12:03 pm
Subject: RE: [VirtualTreeview] Re: Can't select node with keyboard.

Hi Simon,

> and ... I'm interogating the SelectedCount property in a procedure
> attached to the OnFocusChanged event.

Mmh, this event can be triggered asynchronously to selection changes, so you
better use OnChange to
update your selection count.

Ciao, Mike

 | Replies | Author | Date
2353 | Re: Can't select node with keyboard. | [SimonMoscrop@H...] | Mon 6/11/2001


re: 2 problems (DDManager.RenderData and Hints)

From: "Mike Lischke" [public@l...]
Date: Sat Jun 9, 2001 12:03 pm
Subject: RE: [VirtualTreeview] 2 problems (DDManager.RenderData and Hints)

Hi Paul,

> If I use the splitter to decrease VDT width, when mouse is over the first
> column, splitter mark is not shown anymore, instead the VDT hint is painted.

Also this problem is fixed now.

Ciao, Mike


re: Draw selection rectangle

From: "Mike Lischke" [public@l...]
Date: Sat Jun 9, 2001 12:03 pm
Subject: RE: [VirtualTreeview] Draw selection rectangle

Hi Werner,

> The problem with the draw selection remains though. It just got worse
> after I removed the selected state check out of DragAllowed. If I want
> to draw select some nodes now a drag and drop operation begins with
> the node being clicked on.

This depends entirely on the hit position. If you hit the text area with the
mouse (or the small 8
pixel wide reserved area if there is no text) then dragging starts otherwise
draw selection (well,
there are other hit conditions, but this is the essence).

Ciao, Mike


re: FullRowSelect

From: "Mike Lischke" [public@l...]
Date: Sat Jun 9, 2001 12:03 pm
Subject: RE: [VirtualTreeview] FullRowSelect

> The behaviour I'm getting with FullRowSupport set to True and with one
> or more columns defined is that only the focus rectangle is being
> drawn in a different colour and a small part of each of the other
> columns, maybe 3 or 4 pixels wide, instead of the whole row across the
> width of the VT.

This should be fixed with the latest source.

Ciao, Mike


re: Re: ScrollIntoView

From: "Mike Lischke" [public@l...]
Date: Sat Jun 9, 2001 12:03 pm
Subject: RE: [VirtualTreeview] Re: ScrollIntoView

Mark,

> Now, after the new object has been added I used the following code to
> bring the last node into view:

I used the same code and still cannot reproduce the problem. The last node is
always shown as
iintended. I have also tried with only a few nodes (just as many as needed to
make the tree
scrolling) as well as larger amounts (> 20K). Can you write me a small problem
showing the problem?
This would help me to hammer out what's wrong.

Ciao, Mike


re: Problem with autoscrolldelay in Drag and Drop

From: "Mike Lischke" [public@l...]
Date: Sat Jun 9, 2001 12:03 pm
Subject: RE: [VirtualTreeview] Problem with autoscrolldelay in Drag and Drop

> it seems that AutoScrollDelay is not respected if something is dragged
> into a VTree.

Fixed. I only checked if the tree itself is dragging, not if it is perhaps the
drop target.

Ciao, Mike


re: its only me? (tree lines, doted)

From: "Mike Lischke" [public@l...]
Date: Sat Jun 9, 2001 12:03 pm
Subject: RE: [VirtualTreeview] its only me? (tree lines, doted)

Hi Ariel,

> VT shows al ok, but when im using checksupport, and checkbuttons
> (tilde, etc), when the mousedown event is called, the tree lines
> change the aspect. i think the doted points change with not doted
> points. but its only on mousedown, when mouseup is called, it get again ok.

It's only you :o] Well, I cannot see any difference while checking a node.
Perhaps the system is
guilty (Win95 first version)?

Ciao, Mike


re: OnInitNode/OnFreeNode

From: "Mike Lischke" [public@l...]
Date: Sat Jun 9, 2001 12:03 pm
Subject: RE: [VirtualTreeview] OnInitNode/OnFreeNode

Vadim,

> procedure TViewFrame.OnGetNodeDataType(Sender: TBaseVirtualTree; var
> ATypeInfo:Pointer; var DataSize: Integer);
> begin
> ATypeInfo := TypeInfo(TNodeData);
> DataSize := SizeOf(TNodeData);
> end;
>
> ====
>
> I.e. no need to call or even think about initialize/finalize.

Can you please be more precise. How can this code replace OnInitNode and
OnFreeNode? It seems to me
that you assume that init and free code always only work on the node data. I
can assure you this is
seldom the case. There is almost always some extra work to do which cannot be
solved using Delphi's
type system/RTTI info.

Ciao, Mike


re: Two suggestions

From: "Mike Lischke" [public@l...]
Date: Sat Jun 9, 2001 12:03 pm
Subject: RE: [VirtualTreeview] Two suggestions

Vadim,

> function AddChildInit (Parent: PVirtualNode): PVirtualNode;
> begin
> Result: = AddChild (Parent);
> if Assigned (Result) then
> InitNode (Result);
> end;

To be honest: I don't like such mini-nearly of no use-make even the simplest
things for the
application-methods. This will only blow the code of VT even more.

> State of mouse buttons in parameter Shift of event OnDragDrop.

Unfortunately, I cannot guarantee the mouse button states because they are e.g.
not part of the VCL
drag handling. There are also other manipulations (like mouse up messages for
the VCL dd) which make
it even harder to track the mouse buttons. Usually they aren't needed however
and if you depend on
them then simply record on mouse down events.

Ciao, Mike


re: VT Level count

From: "Mike Lischke" [public@l...]
Date: Sat Jun 9, 2001 12:04 pm
Subject: RE: [VirtualTreeview] VT Level count

Hi D.

> how to get level count in VirtualTreeView?
> I am looking for function etc.: VT.LevelCount:Integer

Use Tree.GetNodeLevel.

Ciao, Mike

 | Replies | Author | Date
2297 | Re[2]: [VirtualTreeview] VT Level count | Delph! | Sat 6/9/2001


Re[2]: VT Level count

From: Delph! [delph@h...]
Date: Sat Jun 9, 2001 2:30 pm
Subject: Re[2]: [VirtualTreeview] VT Level count

>> how to get level count in VirtualTreeView?
>> I am looking for function etc.: VT.LevelCount:Integer
ML> Use Tree.GetNodeLevel.
ML> Ciao, Mike

Ok..and how to get tree.MAXLevel ?

D.


re: Draw selection rectangle

From: Werner Lehmann [wl@b...]
Date: Sat Jun 9, 2001 3:12 pm
Subject: Re: [VirtualTreeview] Draw selection rectangle

Hi Mike,

Mike Lischke wrote:
>
> > The problem with the draw selection remains though. It just got worse
> > after I removed the selected state check out of DragAllowed. If I want
> > to draw select some nodes now a drag and drop operation begins with
> > the node being clicked on.
>
> This depends entirely on the hit position. If you hit the text area with the
mouse (or the small 8
> pixel wide reserved area if there is no text) then dragging starts otherwise
draw selection (well,
> there are other hit conditions, but this is the essence).

Yes, that's what I thought as well and which worked for a couple of versions.
But not anymore, it always starts a drag, regardless of where the click occurs.

The problem can be reproduced with the minimal demo (BTW: after loading the
demo the VTree was invisible. It could be selected but had no border, and the
content of clBtnFace. Changing the rootnodecount made it visible again. This
was reproducable if I reopened the project without saving previously. Some
designtime drawing problem?
(Additional note: changing the rootnode and saving did not remove the problem,
the next time the project was openend the symptoms showed again)).

Steps:
- set voFullRowSelect in Options.
- assign OnDragAllowed Handler:

procedure TMainForm.VSTDragAllowed(Sender: TBaseVirtualTree;
Node: PVirtualNode; Column: Integer; var Allowed: Boolean);
begin
Allowed := true;
end;

- select a node, try to select more nodes with mouse draw selection beginning
on the selected node, but not on the node text.
Effect: the node will be dragged immediately (a small selection rectangle
can be seen), if you let go of the mouse button the dragimage vanishes and
the selection rectangle will be drawn according to the current mouse position.

Because a node will always be selected on mouse down (which is good of course)
it is not possible to use draw selection without dragging at all (apart from
draw selecting from the area below the last node).

I must admit that I am a little bit confused about the manual drag handling.
It is VCL style to use a BeginDrag() call in MouseDown as far as I know. But
BeginDrag is protected in TBaseVirtualTree. And the drag starts anyway even
though I do not call BeginDrag and dragmode is dmManual.

Am I supposed to GetCursorPos in OnDragAllowed and check the HitPosition on
a node?

Regards,
Werner

 | Replies | Author | Date
2313 | Re: Draw selection rectangle | Mike Lischke | Sun 6/10/2001


re: Problem with autoscrolldelay in Drag and Drop

From: Werner Lehmann [wl@b...]
Date: Sat Jun 9, 2001 3:16 pm
Subject: Re: [VirtualTreeview] Problem with autoscrolldelay in Drag and Drop

Mike Lischke wrote:
>
> > it seems that AutoScrollDelay is not respected if something is dragged
> > into a VTree.
>
> Fixed. I only checked if the tree itself is dragging, not if it is perhaps
the drop target.

I am afraid this still does not work with v2.4.23, I mean the target
tree scrolls instantly if something is dragged from another tree into
it.

Werner


re: Use of mrNone in v2.4.21 Enumeration

From: "Mike Lischke" [public@l...]
Date: Sat Jun 9, 2001 5:07 pm
Subject: RE: [VirtualTreeview] Use of mrNone in v2.4.21 Enumeration

Hi Ian,

> const mrNone = Controls.mrNone ;
>
> in the global section of any modules that want to use the ModalResult
> form of mrNone; this then becomes the default form of the item, and
> TVTMoveRestriction.mrNone can be used when the other form is required.
>
> This is a bit hacky, though - can anyone suggest a tidier workaround,
> or would changing the "mr" prefixes for the TVTMoveRestriction be a
> sensible suggestion?

Yep, changing the prefix is the best solution because VT came later and has
therefore to respect
existing identifiers. Hence I changed this to:

TVTDragMoveRestriction = (
dmrNone,
dmrHorizontalOnly,
dmrVerticalOnly
);

Ciao, Mike

 | Replies | Author | Date
2340 | Re: Use of mrNone in v2.4.21 Enumeration | Ian Kirk | Mon 6/11/2001


re: Another FullCollapse question

From: "Mike Lischke" [public@l...]
Date: Sat Jun 9, 2001 5:07 pm
Subject: RE: [VirtualTreeview] Another FullCollapse question

Hi Kent,

> This may have been discussed before but why does FullCollapse perform node
> initiation? Why doesn't it just run down the tree and unexpand all the
visible
> nodes?

The meaning of this method is to collapse all nodes, so all nodes must be
touched (at least in the
considered branch).

Ciao, Mike


re: double clicking

From: "Mike Lischke" [public@l...]
Date: Sat Jun 9, 2001 5:07 pm
Subject: RE: [VirtualTreeview] double clicking

Hi Spencer,

> Since from the DblClick procedure I call a procedure that deletes the
> selected node...<snip>
>
> My question is how do I keep it from doing this?

Use OnExpanded instead (this event is also triggered for nodes which have no
children but are
expanded) and send yourself a message. In the message handler you can then
delete the node. This is
the most save procedure because you can asynchroniously free the node which is
important to avoid
mix up in the tree.

Ciao, Mike


re: Re: VT Version 2.4.20 - Solved

From: "Mike Lischke" [public@l...]
Date: Sat Jun 9, 2001 5:07 pm
Subject: RE: [VirtualTreeview] Re: VT Version 2.4.20 - Solved

Jim,

> It appears the shell does not like you calling DragOver from within the
> DragDrop call. If I filter this DragOver call out during the drop the
> popup menu is not shown. I have no explination for why this is.

So do I. The additional DoDragOver call is a workaround for the a bug in the
OLE dd because when the
tree is auto scrolling while dropping then the application is not asked about
the drop effect and
whether drop is allowed or not but it is simply assumed all effects are allowed
which results in a
desaster at times.

Ciao, Mike

 | Replies | Author | Date
2332 | It is worth it! | Jim Kueneman | Mon 6/11/2001
2333 | Re: It is worth it! | [adembaba@e...] | Mon 6/11/2001


how can i change background color of a cell, but in a dynamic way

From: "Ariel Selig" [asel98@y...]
Date: Sat Jun 9, 2001 5:51 pm
Subject: how can i change background color of a cell, but in a dynamic way


re: OnInitNode/OnFreeNode

From: "Vadim Sedulin" [wsntrl@o...]
Date: Sat Jun 9, 2001 7:41 pm
Subject: Re: [VirtualTreeview] OnInitNode/OnFreeNode

Hello Mike!

----- Original Message -----
From: Mike Lischke
To: [VirtualTreeview@yahoogroups.com
Sent: 9 ???? 2001 ?. 16:03
Subject: RE: [VirtualTreeview] OnInitNode/OnFreeNode

> Can you please be more precise. How can this code replace OnInitNode and
OnFreeNode? It seems to me
> that you assume that init and free code always only work on the node data.

No.

> I can assure you this is seldom the case.

Really? Most people will initialize node data right after the node creation
and will not use OnInitNode at all, but OnFreeNode will be, because it is
only place where node data can be finalized.

> There is almost always some extra work to do which cannot be solved using
Delphi's type system/RTTI info.

Like what?

Bye.

Vadim Sedulin
E-Mail: wsntrl@o...]

 | Replies | Author | Date
2424 | Re: OnInitNode/OnFreeNode | Mike Lischke | Sat 6/16/2001


re: Two suggestions

From: "Vadim Sedulin" [wsntrl@o...]
Date: Sat Jun 9, 2001 7:54 pm
Subject: Re: [VirtualTreeview] Two suggestions

Hello Mike!

----- Original Message -----
From: "Mike Lischke" [public@l...]
To: [VirtualTreeview@yahoogroups.com>
Sent: 9 ÉÀÎÑ 2001 Ç. 16:03
Subject: RE: [VirtualTreeview] Two suggestions

> To be honest: I don't like such mini-nearly of no use-make even the
simplest things for the
> application-methods. This will only blow the code of VT even more.

With 453K BPL?!! :)

Bye.

Vadim Sedulin
E-Mail: wsntrl@o...]


Little error

From: [boh.svancara@q...]
Date: Sat Jun 9, 2001 8:52 pm
Subject: Little error

Hi Mike,

I found a little error in VT version 2.4.23.

I get "Range check error" in procedure TVirtualTreeColumn.SaveToStream
(const Stream: TStream) in command: Dummy := Cardinal(FColor);

It must be: Dummy := Integer(FColor);

Regards,

Bohuslav Svancara
[softprojekt@i...]

 | Replies | Author | Date
2314 | Re: Little error | Mike Lischke | Sun 6/10/2001


re: Problem with autoscrolldelay in Drag and Drop

From: Werner Lehmann [wl@b...]
Date: Sat Jun 9, 2001 11:05 pm
Subject: Re: [VirtualTreeview] Problem with autoscrolldelay in Drag and Drop

Werner Lehmann wrote:
>
> Mike Lischke wrote:
> >
> > > it seems that AutoScrollDelay is not respected if something is dragged
> > > into a VTree.
> >
> > Fixed. I only checked if the tree itself is dragging, not if it is perhaps
the drop target.
>
> I am afraid this still does not work with v2.4.23, I mean the target
> tree scrolls instantly if something is dragged from another tree into
> it.

I think I can tell you something more now. The drop target / drag over VTree
never sets FDragScrollStart:

function TBaseVirtualTree.DetermineScrollDirections(X, Y: Integer):
TScrollDirections;
...
if Dragging and (Result <> []) then
begin
if FDragScrollStart = 0 then
FDragScrollStart := timeGetTime;
...

In this condition Dragging always returns false because...

function TBaseVirtualTree.Dragging: Boolean;

begin
// Check for both OLE drag'n drop as well as VCL drag'n drop.
Result := ([tsOLEDragPending, tsOLEDragging] * FStates <> []) or inherited
Dragging;
end;

...FStates is [] at that time. Hence DetermineScrollDirections returns sdRight
and the target tree scrolls right, instantantly. I see that tsOLEDragPending is
only set (ever) in BeginDrag. BeginDrag is only (ever) called in HandleMouseDown
which is probably not executed for the target tree during a drag over.

I am still uncertain if I should handle the BeginDrag myself in dmManual but
since it is protected and the dragging starts anyway (as I said) I cannot do
much (except from a crack descendant). This would not set the FState for the
drag over VTree anyway.

You have probably an idea now what went wrong, whether to set tsOLEPending
somewhere else or if some problem was on my side...

Regards,
Werner

 | Replies | Author | Date
2312 | Re: Problem with autoscrolldelay in Drag and Drop | Mike Lischke | Sun 6/10/2001


re: how can i change background color of a cell, but in a dynamic way

From: Werner Lehmann [wl@b...]
Date: Sat Jun 9, 2001 11:28 pm
Subject: Re: [VirtualTreeview] how can i change background color of a cell, but in a dynamic way

Example:

procedure TMain.TreeBeforeCellPaint(Sender: TBaseVirtualTree;
Canvas: TCanvas; Node: PVirtualNode; Column: Integer; CellRect: TRect);
begin
if Node.Parent = Sender.RootNode then
begin
Canvas.Brush.Color := clRed;
Canvas.FillRect(CellRect);
end;
end;

I am not sure what you mean with dynamic way. If you want to change the
background
more often than the tree paints the node you can just call RepaintNode.

Regards,
Werner


re: VT Level count

From: Werner Lehmann [wl@b...]
Date: Sat Jun 9, 2001 11:34 pm
Subject: Re: [VirtualTreeview] VT Level count

"Delph!" wrote:
>
> >> how to get level count in VirtualTreeView?
> >> I am looking for function etc.: VT.LevelCount:Integer
> ML> Use Tree.GetNodeLevel.
> ML> Ciao, Mike
>
> Ok..and how to get tree.MAXLevel ?

I don't see that this information is provided directly by the
tree (what do you need it for anyway?). If you need it only
once you could iterate the tree and simply count. IterateSubtree
in combination with GetNodeLevel would work but is not efficient
on large tree since GetNodeLevel itself just counts and would
have to count the level for each and every node again.

If you need the maxlevel all the time or frequently it would
be best to keep track of it yourself. OnStructureChange could
be helpful here.

Regards,
Werner

 | Replies | Author | Date
2311 | Re: VT Level count | Jim Kueneman | Sun 6/10/2001


re: VT Level count

From: Jim Kueneman [jimdk@m...]
Date: Sun Jun 10, 2001 1:25 am
Subject: Re: [VirtualTreeview] VT Level count

At 01:34 AM 6/10/2001 +0200, you wrote:
>"Delph!" wrote:
> >
> > >> how to get level count in VirtualTreeView?
> > >> I am looking for function etc.: VT.LevelCount:Integer
> > ML> Use Tree.GetNodeLevel.
> > ML> Ciao, Mike
> >
> > Ok..and how to get tree.MAXLevel ?
>
>I don't see that this information is provided directly by the
>tree (what do you need it for anyway?). If you need it only

Doesn't sort of destroy the point of *virtual* treeview? If the tree knew
what the deepest level was it would already know the entire data structure
. That is why VT is so fast it knows nothing about what it displays until
the user trys to manipulate it then it retrueves the data.

Jim


re: Problem with autoscrolldelay in Drag and Drop

From: "Mike Lischke" [public@l...]
Date: Sun Jun 10, 2001 11:32 am
Subject: RE: [VirtualTreeview] Problem with autoscrolldelay in Drag and Drop

> function TBaseVirtualTree.DetermineScrollDirections(X, Y: Integer):
TScrollDirections;
> ...
> if Dragging and (Result <> []) then
> begin
> if FDragScrollStart = 0 then
> FDragScrollStart := timeGetTime;

In build 23 I have extended this check. That's the reason why I wrote that I
have fixed it.

Ciao, Mike


re: Draw selection rectangle

From: "Mike Lischke" [public@l...]
Date: Sun Jun 10, 2001 11:32 am
Subject: RE: [VirtualTreeview] Draw selection rectangle

Hi Werner,

> Yes, that's what I thought as well and which worked for a couple of versions.
> But not anymore, it always starts a drag, regardless of where the click
occurs.

Ok, I found the problem and a solution. The IsCellHit check in HandleMouseDown
was missing for the
manual drag start.

> BTW: after loading the
> demo the VTree was invisible. It could be selected but had no border, and the
> content of clBtnFace.

This was a bug I introduced in build 23 and removed immediately. So it is
already solved.

> I must admit that I am a little bit confused about the manual drag handling.
> It is VCL style to use a BeginDrag() call in MouseDown as far as I know. But
> BeginDrag is protected in TBaseVirtualTree. And the drag starts anyway even
> though I do not call BeginDrag and dragmode is dmManual.

That the drag operation always started was a bug. That BeginDrag is protected
is the result of the
problems when using it in OnMouseDown because the VCL has a very own handling
which causes problems
in VT (don't recall all details, but is has also to do with posting a
WM_LBUTTONUP message).

> Am I supposed to GetCursorPos in OnDragAllowed and check the HitPosition on
> a node?

No.

Ciao, Mike


re: Little error

From: "Mike Lischke" [public@l...]
Date: Sun Jun 10, 2001 11:32 am
Subject: RE: [VirtualTreeview] Little error

Hi Bohuslav,

> I get "Range check error" in procedure TVirtualTreeColumn.SaveToStream
> (const Stream: TStream) in command: Dummy := Cardinal(FColor);
>
> It must be: Dummy := Integer(FColor);

Thank you. Fix included.

Ciao, Mike


re: VT Level count

From: Werner Lehmann [wl@b...]
Date: Sun Jun 10, 2001 11:18 am
Subject: Re: [VirtualTreeview] VT Level count

Jim Kueneman wrote:
>
> >I don't see that this information is provided directly by the
> >tree (what do you need it for anyway?). If you need it only
>
> Doesn't sort of destroy the point of *virtual* treeview? If the tree knew
> what the deepest level was it would already know the entire data structure
> . That is why VT is so fast it knows nothing about what it displays until
> the user trys to manipulate it then it retrueves the data.

I was wondering why he needed that info, too. But IMO the MaxLevel
has not much to do with the virtual concept. Adding childs "behind"
in OnExpanding is supported by the standard Win32 treeview as well
which is not virtual. To me virtual means that I can add as much
nodes as I like without a big slowdown and have to provide their
content only when needed.

The MaxLevel is not determined by the (virtual) node content but the
child structure. Which is not virtual, at least not more than in any
other treeview component (correct me if I'm wrong :).

Regards,
Werner

 | Replies | Author | Date
2317 | Re: VT Level count | Jim Kueneman | Sun 6/10/2001
2323 | Zip Unzip Demo | Jim Kueneman | Sun 6/10/2001
2334 | Re: Zip Unzip Demo | [adembaba@e...] | Mon 6/11/2001


re: Problem with autoscrolldelay in Drag and Drop

From: Werner Lehmann [wl@b...]
Date: Sun Jun 10, 2001 1:16 pm
Subject: Re: [VirtualTreeview] Problem with autoscrolldelay in Drag and Drop

Mike Lischke wrote:
>
> > function TBaseVirtualTree.DetermineScrollDirections(X, Y: Integer):
TScrollDirections;
> > ...
> > if Dragging and (Result <> []) then
> > begin
> > if FDragScrollStart = 0 then
> > FDragScrollStart := timeGetTime;
>
> In build 23 I have extended this check. That's the reason why I wrote that I
have fixed it.

Well. I don't want to bug you more than necessary here but if you refer to
v2.4.23 with 'build 23'... I have downloaded that version yesterday, tested
on it and copied and pasted from it.

Regards,
Werner

 | Replies | Author | Date
2319 | Re: Problem with autoscrolldelay in Drag and Drop | Mike Lischke | Sun 6/10/2001


re: VT Level count

From: Jim Kueneman [jimdk@m...]
Date: Sun Jun 10, 2001 1:26 pm
Subject: Re: [VirtualTreeview] VT Level count

At 01:18 PM 6/10/2001 +0200, you wrote:

>The MaxLevel is not determined by the (virtual) node content but the
>child structure. Which is not virtual, at least not more than in any
>other treeview component (correct me if I'm wrong :).

Agreed.

Jim


re: Draw selection rectangle

From: Werner Lehmann [wl@b...]
Date: Sun Jun 10, 2001 2:23 pm
Subject: Re: [VirtualTreeview] Draw selection rectangle

Mike,

Mike Lischke wrote:
>
> > Yes, that's what I thought as well and which worked for a couple of
versions.
> > But not anymore, it always starts a drag, regardless of where the click
occurs.
>
> Ok, I found the problem and a solution. The IsCellHit check in
HandleMouseDown was missing for the
> manual drag start.

Good.

> That the drag operation always started was a bug. That BeginDrag is protected
is the result of the
> problems when using it in OnMouseDown because the VCL has a very own handling
which causes problems
> in VT (don't recall all details, but is has also to do with posting a
WM_LBUTTONUP message).

I am still a little bit thick-witted (sorry :). There is a public BeginDrag
in TControl and a protected BeginDrag in TBaseVirtualTree. So if I do a
BeginDrag in OnMouseDown it will probably be the TControl one which starts
a VCL drag (without drag image). If I set a breakpoint at the tree begindrag
it is never reached. If I want to use the tree begindrag I'd have to use a
hack descendant (on a regular basis for all dmManual drags).

In my case I would not even mind automatic dragging. The only thing that stops
me from this is that OnDragAllowed is not fire for this (which seems strange to
me since the event is not called OnManualDragAllowed but this was already a
topic on this list and you said that this is by design).

Regards,
Werner

 | Replies | Author | Date
2320 | Re: Draw selection rectangle | Mike Lischke | Sun 6/10/2001


re: Problem with autoscrolldelay in Drag and Drop

From: "Mike Lischke" [public@l...]
Date: Sun Jun 10, 2001 2:57 pm
Subject: RE: [VirtualTreeview] Problem with autoscrolldelay in Drag and Drop

> Well. I don't want to bug you more than necessary here but if you refer to
> v2.4.23 with 'build 23'... I have downloaded that version yesterday, tested
> on it and copied and pasted from it.

Strange. Then I must have added it after I uploaded to YG. Anyway, there is a
fix :o]

Ciao, Mike


re: Draw selection rectangle

From: "Mike Lischke" [public@l...]
Date: Sun Jun 10, 2001 3:02 pm
Subject: RE: [VirtualTreeview] Draw selection rectangle

> I am still a little bit thick-witted (sorry :). There is a public BeginDrag
> in TControl and a protected BeginDrag in TBaseVirtualTree.

Well, I can't hide it. What shall I do? I can rename BeginDrag in VT if that
solves any problem...
We have to live with the fact that there is a BeginDrag method in TControl and
that's it. My
recommendation is not to use BeginDrag at all, regardless of where it comes
from, because it
conflicts with the drag implementation in VT which has to take care for two
totally different ways
to do dd. If anybody still wants to use it then (s)he must care about side
effects too.

Ciao, Mike


VET hidden items and [+]

From: "Ariel Selig" [asel98@y...]
Date: Sun Jun 10, 2001 5:37 pm
Subject: VET hidden items and [+]

hello

it seams that when u saw if a folder needs a "button" [+] [-]
and if u dont want to use hidden items, it shows the [+], and when u
click it, it disapear, because it dont have any item (well, it has
items, but they are hidden, so the [+] dont need to be displayed
before too... (?)

tnx

 | Replies | Author | Date
2322 | Re: VET hidden items and [+] | Jim Kueneman | Sun 6/10/2001
2325 | Re: VET hidden items and [+] | Ariel Selig | Sun 6/10/2001
2330 | New DataObject Implemenation Suggestions/Question | Jim Kueneman | Mon 6/11/2001
2347 | Re: New DataObject Implemenation Suggestions/Ques | Mike Lischke | Mon 6/11/2001
2351 | Re: New DataObject Implemenation Suggestions/Ques | Jim Kueneman | Mon 6/11/2001


re: VET hidden items and [+]

From: Jim Kueneman [jimdk@m...]
Date: Sun Jun 10, 2001 6:26 pm
Subject: Re: [VirtualTreeview] VET hidden items and [+]

At 05:37 PM 6/10/2001 +0000, you wrote:
>hello
>
>it seams that when u saw if a folder needs a "button" [+] [-]
>and if u dont want to use hidden items, it shows the [+], and when u
>click it, it disapear, because it dont have any item (well, it has
>items, but they are hidden, so the [+] dont need to be displayed
>before too... (?)

Hi,
VET mainly uses the IShellFolder.GetAttributes of to decide if it has
children. The folder responds if it MAY have items in it. This is the
documented way it should be implemented as if every folder actually checked
it could slow this check drasticlly. Even Explorer will show buttons then
not have any items in them. Does Explorer show the same behavior on the
folder in question? If this really bothers you I could implements a
VerifyFolderContainItems method but that is one more check in the code that
is critical for speed. I looked at the check I was using and found a
better way that is more efficent but I doublt if it will help your situation.

I will upload the new version in the next day or two and you can see if it
helps. If not and it bugs you let me know and I will concider adding
something to help you out if it not to expensinve to the enumeration.

Jim

 | Replies | Author | Date
2325 | Re: VET hidden items and [+] | Ariel Selig | Sun 6/10/2001
2330 | New DataObject Implemenation Suggestions/Question | Jim Kueneman | Mon 6/11/2001
2347 | Re: New DataObject Implemenation Suggestions/Ques | Mike Lischke | Mon 6/11/2001
2351 | Re: New DataObject Implemenation Suggestions/Ques | Jim Kueneman | Mon 6/11/2001


Zip Unzip Demo

From: Jim Kueneman [jimdk@m...]
Date: Sun Jun 10, 2001 7:00 pm
Subject: Zip Unzip Demo

Adem,

I am trying to check out the Zip VT demo. I wanted to recompile it so
I went to the website for the Zip component ( that is mainly what I am
after). You state it should be version 1.6 the websites(s) have 1.52M and
they have a lot of compiler errors. Mostty missing variables / properties
in the SFX unit(s).

Help!

Jim

 | Replies | Author | Date
2334 | Re: Zip Unzip Demo | [adembaba@e...] | Mon 6/11/2001


New file uploaded to VirtualTreeview

From: [VirtualTreeview@yahoogroups.com>
Date: Sun Jun 10, 2001 7:04 pm
Subject: New file uploaded to VirtualTreeview

Hello,

This email message is a notification to let you know that
a file has been uploaded to the Files area of the VirtualTreeview
group.

File : /VirtualTree_2.4.25.zip
Uploaded by : [public@l...]
Description : Beta version

You can access this file at the URL

http://groups.yahoo.com/group/VirtualTreeview/files/VirtualTree_2.4.25.zip

To learn more about file sharing for your group, please visit

http://help.yahoo.com/help/us/groups/files

Regards,

public@l...]


re: VET hidden items and [+]

From: "Ariel Selig" [asel98@y...]
Date: Sun Jun 10, 2001 9:41 pm
Subject: Re: VET hidden items and [+]

no, ... i think, it was just an "if". :)
its not a big problem.

 | Replies | Author | Date
2330 | New DataObject Implemenation Suggestions/Question | Jim Kueneman | Mon 6/11/2001
2347 | Re: New DataObject Implemenation Suggestions/Ques | Mike Lischke | Mon 6/11/2001
2351 | Re: New DataObject Implemenation Suggestions/Ques | Jim Kueneman | Mon 6/11/2001


re: Draw selection rectangle

From: Werner Lehmann [wl@b...]
Date: Sun Jun 10, 2001 8:39 pm
Subject: Re: [VirtualTreeview] Draw selection rectangle

Mike Lischke wrote:
>
> > I am still a little bit thick-witted (sorry :). There is a public BeginDrag
> > in TControl and a protected BeginDrag in TBaseVirtualTree.
>
> Well, I can't hide it. What shall I do? I can rename BeginDrag in VT if that
solves any problem...
> We have to live with the fact that there is a BeginDrag method in TControl
and that's it. My
> recommendation is not to use BeginDrag at all, regardless of where it comes
from, because it
> conflicts with the drag implementation in VT which has to take care for two
totally different ways
> to do dd. If anybody still wants to use it then (s)he must care about side
effects too.

Ok.

I don't know how to begin a drag dmManual with OLE dragging. But that's ok
because
the new version (25) does everything right (for me). Although unexpected since
the
dragging still starts automatically even though in dmManual mode (which as you
say
is a bug ("That the drag operation always started was a bug.)). But really,
it's
fine with me as long as DragAllowed is fired which is the case.

So we can close this chapter although I am not completely clear with it. I
don't want
to risk beating this to the same death as incremental searching among others :)

Regards,
Werner


IVTEditLink

From: Werner Lehmann [wl@b...]
Date: Sun Jun 10, 2001 9:42 pm
Subject: IVTEditLink

Hi Mike,

the interface method SetBounds conflicts with the VCL method of
that name if the interface is implemented on a form. I had to
use a method resolution clause. Wouldn't it be better to prefix
all interface methods with a capital 'I'?

procedure IVTEditLink.SetBounds = EditLinkSetBounds;
procedure EditLinkSetBounds(R: TRect); stdcall;

-->

procedure ISetBounds(R: TRect); stdcall;

Regards,
Werner

 | Replies | Author | Date
2336 | Re: IVTEditLink | Roland | Mon 6/11/2001
2346 | Re: IVTEditLink | Mike Lischke | Mon 6/11/2001


re: Re: Hiding the node editor

From: Werner Lehmann [wl@b...]
Date: Sun Jun 10, 2001 10:28 pm
Subject: Re: [VirtualTreeview] Re: Hiding the node editor

Thanks to you all, I have now a node editor which does almost all the things I
asked for.

I have redesigned it from scratch. Was a TEdit with seperate dropdown form
before and its
all on one form now. Hiding the node editor if the user activates the menu or
moves the main
application window all work now simply with OnDeactivate of that node editor
form.

Unfortunately OnDeactive is not fire if the whole app looses focus. This could
be overcome by
Mike's suggestion with Application.HookMainWindow. Sadly there is still a
problem with task
switching. Upon alt+tab (or via mouse) switch to another application the node
editor is hidden
(via CancelNodeEdit and finally a .Release of the node editor form). But if I
switch back to
the VTree app the VTree is drawn as if it had no focus (gray selection). I can
scroll it,
select nodes with the mouse but the selection is always gray. And I cannot open
a new editor
(by slow mouse clicks). Very odd. Any ideas on this (see code below)?

procedure TNodeEdit.FormCreate(Sender: TObject);
begin
...
if not (csDesigning in ComponentState) then
Application.HookMainWindow(ApplicationMessageHook);
end;

procedure TNodeEdit.FormDestroy(Sender: TObject);
begin
if not (csDesigning in ComponentState) then
Application.UnhookMainWindow(ApplicationMessageHook);
...
end;

function TNodeEdit.ApplicationMessageHook(var Msg: TMessage): Boolean;
begin
result := false;
if not Visible then
exit;

case Msg.Msg of
WM_ACTIVATEAPP:
if not TWMActivateApp(Msg).Active then
begin
result := true;
Tree.CancelEditNode;
end;
end;
end;

The sliding animation works very nice with AnimateWindow. This function has two
major drawbacks:
it requires that all controls on the window support WM_PRINT. All
TGraphicControls, even TPanel,
do not support it. But since 90% of the nodeeditor are made out of the VTree I
can live with that.
After the animation has ended the controls are still not visible thus I have to
force a repaint:

procedure TNodeEdit.FormShow(Sender: TObject);
begin
AnimateWindow(Handle, 200, AW_SLIDE or AW_ACTIVATE or AW_VER_POSITIVE);
Label1.Repaint;
Shape1.Repaint;
...
end;

procedure TNodeEdit.FormClose(Sender: TObject; var Action: TCloseAction);
begin
AnimateWindow(Handle, 200, AW_SLIDE or AW_HIDE or AW_VER_NEGATIVE);
...
end;

The other drawback of AnimateWindow is that it is only supported beginning with
98/2K. Well. I have
to use dynamic binding and 95/NT users will not see the animation. They're not
used to it anyway :)

Regards,
Werner

 | Replies | Author | Date
2335 | Re: Hiding the node editor | Mike Lischke | Mon 6/11/2001


Resizing the borderless node editor

From: Werner Lehmann [wl@b...]
Date: Mon Jun 11, 2001 12:25 am
Subject: Resizing the borderless node editor

Hi,

node editor and no end. I have simplified it so that I have only the edit
(alTop) and a
VTree (alClient, btw one or two pixel less wide than the edit). Two problems:

- After AnimateWindow the VTree has no border (to be exact the border is a two
pixel
left over in clBtnFace). Tree.Repaint does not help. The tree's border will be
painted eventually when I click on a node with the mouse. I see that WM_PRINT,
PRF_NONCLIENT, is supported by the VTree so I have no idea what's wrong.

- More annoying: the dropdown form is not resizable anymore now that the VTree
fills
it up to the bottom border. I am not receiving WM_NCHITTEST on form level.
Faking
WM_NCMOUSEMOVE in Tree.OnMouseMove did not help:

p := Tree.ClientToScreen(Point(x, y));
PostMessage(Handle, WM_NCMOUSEMOVE, HTBOTTOM, MAKELONG(p.x, p.y));

The manual way was not successful as well:

procedure TNodeEdit.MouseDown(Button: TMouseButton; Shift: TShiftState;
x, y: Integer);
begin
inherited;
if y >= ClientHeight - 4 then
Perform(WM_SYSCOMMAND, SC_SIZEBOTTOM, 0);
end;

procedure TNodeEdit.MouseMove(Shift: TShiftState; x, y: Integer);
begin
inherited;
if y < ClientHeight - 4 then
Cursor := crDefault
else
Cursor := crSizeNS;
end;

I do see the SizeNS cursor but the form cannot be resized. If I place the
WM_SYSCOMMAND
in MouseMove (regardless if on form or VTree level) the form resizes on mouse
move
ok. But not on mouse down.
This question would rather fit into the borland news forums but maybe anyone
of you
knows already more...

Regards,
Werner

 | Replies | Author | Date
2345 | Re: Resizing the borderless node editor | Mike Lischke | Mon 6/11/2001
2360 | Re: Resizing the borderless node editor | Werner Lehmann | Mon 6/11/2001
2422 | Re: Resizing the borderless node editor | Mike Lischke | Sat 6/16/2001
2435 | Re: Resizing the borderless node editor | Werner Lehmann | Sat 6/16/2001
2445 | Re: Resizing the borderless node editor | Mike Lischke | Sun 6/17/2001
2454 | Re: Resizing the borderless node editor | Werner Lehmann | Sun 6/17/2001


New DataObject Implemenation Suggestions/Questions

From: Jim Kueneman [jimdk@m...]
Date: Mon Jun 11, 2001 2:01 am
Subject: New DataObject Implemenation Suggestions/Questions

Hi Mike,

I have been pondering your new implementation of the DragManager and
how to use it. How did you envision decendents of IDataObject to be
implemented? I see SetOLEFormats is now private and the OLEFormats are
now set during the creation of the object. How do we now set the formats
on the fly? It will be necessary to destroy and recreate the object, also
the formats are only your defined formats in the enumerated type so what
about new formats?

I like the new way much better ( I have seen several implementation,
including a few of my own, using one class to implement all the interfaces
for drag drop and find them to be not the way to go a number of
reasons). With just a few minor adjustments it will be a very flexible way
to handle D&D.

I liked the way you implemented the DragManager by using the
DoCreateDragManager virtual method. Now that the DataObject is not part of
the DragManager that method becomes less useful. I would like to see a
similar design for the TTVDataObject class. Allow the program to be called
to create the desired IDataObject that is a decendant of TVTDataObject.

Also is there a reason to keeping a reference to the DataObject? Since
this is now a DataObject explicitly for dragging how about just before
calling ActiveX.DoDragDrop call a DoCreateDataObject virtual method to
allow the application to create a custom DataObject and hold it in a local
IDataObject reference, to increase the reference count, and when when
ActiveX..DoDragDrop returns and the method returns the DataObject will be
freed. I guess this is personal preference a COM point of view vs a Object
Pascal class point of view.

It would be nice to have some sort of event called just before the
AcitveX.DoDragDrop so that the Formats can be changed on the fly which the
above implementation would do by default since a new IDataObject is created
before every drag.

One last thing. Is it possible to make all the interface methods
virtual? I have not implemented the IDragHelper interface because the
image is handled in the IDataObject and I can't get to what I need. By
allowing a decendant to override any of the interfaces implementations one
could implement some of the more obscure IDataObject methods (I am not sure
if you can make an interface method virtual I have never tried it).

Sorry I am whining about this but VET needs to set custom clipboard formats
and changes those formats depending on the namespace that is selected.

Jim

 | Replies | Author | Date
2347 | Re: New DataObject Implemenation Suggestions/Ques | Mike Lischke | Mon 6/11/2001
2351 | Re: New DataObject Implemenation Suggestions/Ques | Jim Kueneman | Mon 6/11/2001


Does sorting change the nodes index?

From: [MJLeaver@n...]
Date: Mon Jun 11, 2001 4:17 am
Subject: Does sorting change the nodes index?

This may be a silly question, but does sorting change the Index
property of a node? Or is the index the same regardless of sorting,
so the sorting is purely visual?

 | Replies | Author | Date
2337 | Re: Does sorting change the nodes index? | Mike Lischke | Mon 6/11/2001


It is worth it!

From: Jim Kueneman [jimdk@m...]
Date: Mon Jun 11, 2001 4:57 am
Subject: It is worth it!

I just downloaded an FTP program to evaluate. It had a Treeview very
similar to VET (displays files and folders in the same tree) based on
TTreeview for sure. I have gotten so use to hitting "*" on an entire drive
using VET since it takes all of 1-3 seconds to enumerate ALL the files on
any of my drives. I hit the same key on this FTP program and waited..and
waited...and waited...and waited...... I finally killed the program after
about 2 MINUTES! It was still filling the tree. That just made it crystal
clear that VT is a great component and I feel quite proud of VET after
seeing this tree!

Sorry for the bandwidth but I have spent all afternoon trying to decide on
how to change VET to make it work best with the new VT and had a bad case
of the "is it really worth it Jim"s.

Jim

 | Replies | Author | Date
2333 | Re: It is worth it! | [adembaba@e...] | Mon 6/11/2001


re: It is worth it!

From: [adembaba@e...]
Date: Mon Jun 11, 2001 5:42 am
Subject: Re: It is worth it!

Jim,

Is it worth it, is it worth it? How
can you even contemplate such a question!

VET is the best there is, and will be
for a very very long time.

Of course, same goes for VT --luckily Mike
does not seem to have similar questions.

Cheers,
Adem

--- In [VirtualTreeview@y...], Jim Kueneman [jimdk@m...] wrote:
>
>
> I just downloaded an FTP program to evaluate. It had a Treeview
very
> similar to VET (displays files and folders in the same tree) based
on
> TTreeview for sure. I have gotten so use to hitting "*" on an
entire drive
> using VET since it takes all of 1-3 seconds to enumerate ALL the
files on
> any of my drives. I hit the same key on this FTP program and
waited..and
> waited...and waited...and waited...... I finally killed the
program after
> about 2 MINUTES! It was still filling the tree. That just made it
crystal
> clear that VT is a great component and I feel quite proud of VET
after
> seeing this tree!
>
> Sorry for the bandwidth but I have spent all afternoon trying to
decide on
> how to change VET to make it work best with the new VT and had a
bad case
> of the "is it really worth it Jim"s.
>
> Jim


re: Zip Unzip Demo

From: [adembaba@e...]
Date: Mon Jun 11, 2001 5:45 am
Subject: Re: Zip Unzip Demo

Jim,

That page is sort of odd, you have to scroll down
all the way to find v1.6N. And, even though it
might say it is beta, I am told by the author,
it is a release candidate.

BTW, that demo would benefit greatly from VET,
which was not available at the time and I have
not had time to incorporate since.

Cheers,
Adem

--- In [VirtualTreeview@y...], Jim Kueneman [jimdk@m...] wrote:
>
>
> Adem,
>
> I am trying to check out the Zip VT demo. I wanted to
recompile it so
> I went to the website for the Zip component ( that is mainly what I
am
> after). You state it should be version 1.6 the websites(s) have
1.52M and
> they have a lot of compiler errors. Mostty missing variables /
properties
> in the SFX unit(s).
>
> Help!
>
> Jim


re: Re: Hiding the node editor

From: "Mike Lischke" [public@l...]
Date: Mon Jun 11, 2001 6:27 am
Subject: RE: [VirtualTreeview] Re: Hiding the node editor

Werner,

> function TNodeEdit.ApplicationMessageHook(var Msg: TMessage): Boolean;
>...
> case Msg.Msg of
> WM_ACTIVATEAPP:
> if not TWMActivateApp(Msg).Active then
> begin
> result := true;
>...
> end;

If I'm not totally wrong then you should not return True here because this will
prevent the message
to reach the application. You do not want to take completely over. All you need
is to get notified.

Ciao, Mike


re: IVTEditLink

From: "Roland" [Beduerftig@S...]
Date: Mon Jun 11, 2001 6:46 am
Subject: Re: IVTEditLink

Hi Werner,

> the interface method SetBounds conflicts with the VCL method of
> that name if the interface is implemented on a form. I had to
> use a method resolution clause. Wouldn't it be better to prefix
> all interface methods with a capital 'I'?
>
> procedure IVTEditLink.SetBounds = EditLinkSetBounds;
> procedure EditLinkSetBounds(R: TRect); stdcall;
> -->
> procedure ISetBounds(R: TRect); stdcall;

I use this interface and I have no problems with this methodname.
I think capital "I" is for the interface, but this a method in the
interface declaration and not an interface.

Have a nice day
Roland


re: Does sorting change the nodes index?

From: "Mike Lischke" [public@l...]
Date: Mon Jun 11, 2001 6:59 am
Subject: RE: [VirtualTreeview] Does sorting change the nodes index?

> This may be a silly question, but does sorting change the Index
> property of a node? Or is the index the same regardless of sorting,
> so the sorting is purely visual?

The index of a node may indeed change. The node references are physically
resorted in Sort.

Ciao, Mike


[no subject]

From: [brinkers@h...]
Date: Mon Jun 11, 2001 7:00 am
Subject:

m>; Fri, 8 Jun 2001 22:45:30 +0200
Message-ID: [001701c0f05c$392f42f0$787ba8c0@m...]
To: [virtualTreeView@yahoogroups.com>
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 5.50.4522.1200
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200
From: "Martijn Brinkers" <brinkers@h...]
MIME-Version: 1.0
Mailing-List: list VirtualTreeview@yahoogroups.com; contact
VirtualTreeview-owner@yahoogroups.com
Delivered-To: mailing list VirtualTreeview@yahoogroups.com
Precedence: bulk
List-Unsubscribe: <mailto:VirtualTreeview-unsubscribe@yahoogroups.com>
Date: Fri, 8 Jun 2001 22:47:25 +0200
Reply-To: VirtualTreeview@yahoogroups.com
Subject: [VirtualTreeview] RE: Re: Problems with autosort and initial
RootNodeCount <> 0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
X-UIDL: 1480
Status: U

>>
>> Data := GetNodeData(Node);
>>
>> Results in Data := nil

>Are you using the new Beta version 2.4.21 or so?

>NOTE: None of the demos in V1.3 will work there are a number of
>changes to be made.

>Jim

I use the latest (beta) version and the latest (beta) demos. It is easy to
reproduce the effect.
Create a new app and drop a VirtualStringTree. Set RootNodeCount > 0 e.g.
10. Set AutoSort to True (all with the object inspector).
Then add the following lines :

procedure TForm1.FormCreate(Sender: TObject);
begin
VirtualStringTree1.NodeDataSize := 1;
end;

procedure TForm1.VirtualStringTree1InitNode(Sender: TBaseVirtualTree;
ParentNode, Node: PVirtualNode;
var InitialStates: TVirtualNodeInitStates);
var
Ptr : Pointer;
begin
Ptr := VirtualStringTree1.GetNodeData(Node);
end;

Now InitNode gets called 10 times (if RootNodeCount =10) before FormCreate
is called with Ptr = Nil and it gets also called 10 times after FormCreate
is called but then Ptr <> Nil. I dont think this is intended behaviour....

Martijn Brinkers

To unsubscribe from this group, send an email to:
VirtualTreeview-unsubscribe@egroups.com

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/


Version 2.4.21 => 2.4.25 new problems

From: "Roland" [Beduerftig@S...]
Date: Mon Jun 11, 2001 7:33 am
Subject: Version 2.4.21 => 2.4.25 new problems

Hi All,

at this morning I downloaded lastest version 2.4.25 from this side:

History:

I work with 2.4.21 and all are fine.
Now I unzip from lastest version 2.4.25 only the files
ShellUtilies.pas
VirtualExplorerTree.pas
VirtualTrees.pas
to my working area and compile the project:

[Pascal Fehler] VirtualExplorerTree.pas(651): Methode 'RenderData'
nicht in Basisklasse gefunden
[Pascal Fehler] VirtualExplorerTree.pas(652): Methode 'SetOLEFormats'
nicht in Basisklasse gefunden
[Pascal Fehler] VirtualExplorerTree.pas(3143): Undefinierter
Bezeichner: 'RenderData'
[Pascal Fehler] VirtualExplorerTree.pas(3164): Undefinierter
Bezeichner: 'FormatEtcList'
[Pascal Fehler] VirtualExplorerTree.pas(3164): Operator oder
Semikolon fehlt

Note: I work with BCB5

have I nice day
Roland

 | Replies | Author | Date
2348 | Re: Version 2.4.21 => 2.4.25 new problems | Mike Lischke | Mon 6/11/2001


re: Use of mrNone in v2.4.21 Enumeration

From: "Ian Kirk" [ian@k...]
Date: Mon Jun 11, 2001 10:02 am
Subject: Re: Use of mrNone in v2.4.21 Enumeration

--- In [VirtualTreeview@y...], "Mike Lischke" [public@l...] wrote:
> Hi Ian,
>
> > const mrNone = Controls.mrNone ;
> >
> > in the global section of any modules that want to use the
ModalResult
> > form of mrNone; this then becomes the default form of the item,
and
> > TVTMoveRestriction.mrNone can be used when the other form is
required.
> >
> > This is a bit hacky, though - can anyone suggest a tidier
workaround,
> > or would changing the "mr" prefixes for the TVTMoveRestriction be
a
> > sensible suggestion?
>
> Yep, changing the prefix is the best solution because VT came later
and has therefore to respect
> existing identifiers. Hence I changed this to:
>
> TVTDragMoveRestriction = (
> dmrNone,
> dmrHorizontalOnly,
> dmrVerticalOnly
> );
>
> Ciao, Mike

Thanks for the update Mike, and to Vadim also for your suggestion.

Cheers,
Ian


re: Re: Hiding the node editor

From: Werner Lehmann [wl@b...]
Date: Mon Jun 11, 2001 10:10 am
Subject: Re: [VirtualTreeview] Re: Hiding the node editor

Hi Mike,

> > function TNodeEdit.ApplicationMessageHook(var Msg: TMessage): Boolean;
> >...
> > case Msg.Msg of
> > WM_ACTIVATEAPP:
> > if not TWMActivateApp(Msg).Active then
> > begin
> > result := true;
> >...
> > end;
>
> If I'm not totally wrong then you should not return True here because this
will prevent the message
> to reach the application. You do not want to take completely over. All you
need is to get notified.

Sounds plausible but sadly no apparent change. The VTree is still not
'focussable'
after one task switch and switch back. Surely not the fault of the VTree. The
code
that I cited above was more or less a direct copy of yours, including the 'true
result'.
The only thing I did was replacing the 'if' by a 'case' because I experimented
with
more messages than WM_ACTIVATEAPP.

> function TCustomVirtualTreeComboBox.ApplicationMessageHook(var Msg:
> TMessage): Boolean;
>
> // Hides dropdown if user switches to another application.
>
> begin
> Result := False;
> if DroppedDown then
> begin
> if ((Msg.Msg = WM_ACTIVATEAPP) and not TWMActivateApp(Msg).Active) then
> begin
> DroppedDown := False;
> Result := True;
> end;
> end;
> end;

I should post this to the borland news forums probably as it is not directly
related
to VTree.

Regards,
Werner


re: Re: IVTEditLink

From: Werner Lehmann [wl@b...]
Date: Mon Jun 11, 2001 10:14 am
Subject: Re: [VirtualTreeview] Re: IVTEditLink

Hi Roland,

> > the interface method SetBounds conflicts with the VCL method of
> > that name if the interface is implemented on a form. I had to
> > use a method resolution clause. Wouldn't it be better to prefix
> > all interface methods with a capital 'I'?
> >
> > procedure IVTEditLink.SetBounds = EditLinkSetBounds;
> > procedure EditLinkSetBounds(R: TRect); stdcall;
> > -->
> > procedure ISetBounds(R: TRect); stdcall;
>
> I use this interface and I have no problems with this methodname.
> I think capital "I" is for the interface, but this a method in the
> interface declaration and not an interface.

Then try to implement the interface on a TForm descendant, you will
get said warning.

About the capital 'I': this is a convention at the company I work at.
It not only avoids those method name clashes (well in the most cases)
but also allows for easy identification of interface and other methods.

Regards,
Werner


re: New DataObject Implemenation Suggestions/Questions

From: Werner Lehmann [wl@b...]
Date: Mon Jun 11, 2001 10:15 am
Subject: Re: [VirtualTreeview] New DataObject Implemenation Suggestions/Questions

Jim,

> could implement some of the more obscure IDataObject methods (I am not sure
> if you can make an interface method virtual I have never tried it).

you can.

Werner

 | Replies | Author | Date
2344 | Re: New DataObject Implemenation Suggestions/Ques | Teus de Jong | Mon 6/11/2001
2359 | Re: New DataObject Implemenation Suggestions/Ques | Werner Lehmann | Mon 6/11/2001
2362 | Re: New DataObject Implemenation Suggestions/Ques | Jim Kueneman | Tue 6/12/2001


re: New DataObject Implemenation Suggestions/Questions

From: "Teus de Jong" [teusjdejong@p...]
Date: Mon Jun 11, 2001 10:35 am
Subject: Re: [VirtualTreeview] New DataObject Implemenation Suggestions/Questions

Hi Mike,

Jim Kueneman wrote:
>
> I liked the way you implemented the DragManager by using the
> DoCreateDragManager virtual method. Now that the DataObject is not part
of
> the DragManager that method becomes less useful. I would like to see a
> similar design for the TTVDataObject class. Allow the program to be
called
> to create the desired IDataObject that is a decendant of TVTDataObject.
>

...

> It would be nice to have some sort of event called just before the
> AcitveX.DoDragDrop so that the Formats can be changed on the fly which the
> above implementation would do by default since a new IDataObject is
created
> before every drag.

I'm strongly supporting Jim: I need to set my own formats also.

Groeten,

Teus de Jong


re: Resizing the borderless node editor

From: "Mike Lischke" [public@l...]
Date: Mon Jun 11, 2001 10:47 am
Subject: RE: [VirtualTreeview] Resizing the borderless node editor

> I do see the SizeNS cursor but the form cannot be resized. If I place the
WM_SYSCOMMAND
> in MouseMove (regardless if on form or VTree level) the form resizes on
mouse move
> ok. But not on mouse down.
> This question would rather fit into the borland news forums but maybe
anyone of you
> knows already more...

Seems to me as would there be no border for the form at all. The problem is
(and that's what I had
to figure out when I implemented the VT combo box) that you need a thick (!)
frame to be able to
resize the form with the mouse (I used WM_SIZEBOX in CreateParams).

Ciao, Mike


re: IVTEditLink

From: "Mike Lischke" [public@l...]
Date: Mon Jun 11, 2001 10:47 am
Subject: RE: [VirtualTreeview] IVTEditLink

Hi Werner,

> the interface method SetBounds conflicts with the VCL method of
> that name if the interface is implemented on a form. I had to
> use a method resolution clause. Wouldn't it be better to prefix
> all interface methods with a capital 'I'?

As already stated the letter I is already reserved as interface prefix and I
doubt an additional
prefix for methods will improve the usability.

> procedure IVTEditLink.SetBounds = EditLinkSetBounds;
> procedure EditLinkSetBounds(R: TRect); stdcall;

It seems you have used a TControl descentant which also implements the
IVTEditLink interface. Well,
it is not uncommon that such kinds of conflicts appear and your solution is
perfect. I'm happy that
such conflicts can be solved that way at all.

Ciao, Mike


re: New DataObject Implemenation Suggestions/Questions

From: "Mike Lischke" [public@l...]
Date: Mon Jun 11, 2001 10:47 am
Subject: RE: [VirtualTreeview] New DataObject Implemenation Suggestions/Questions

Hi Jim,

> I have been pondering your new implementation of the DragManager and
> how to use it. How did you envision decendents of IDataObject to be
> implemented? I see SetOLEFormats is now private and the OLEFormats are
> now set during the creation of the object. How do we now set the formats
> on the fly? It will be necessary to destroy and recreate the object, also
> the formats are only your defined formats in the enumerated type so what
> about new formats?

Well, you have hit a weak point in the current implementation which I was aware
of but did not know
how to solve better. I have now started to redesign this stuff similar to what
TPicture does. I have
included a unit-local ClipboardFormat list and a class procedure to
TBaseVirtualTree where one can
add own clipboard formats. TVTDataObject exclusively uses this list and asks
the registered classes
to render a particular format. I have not yet decided how to use existing trees
to render instead
creating new, but this is only a small problem I will quickly solve, I think.

The property OLEFormats will be removed entirely as it makes not much sense
this way and is quite
limited. For you this means you don't need to implement an IDataObject
interface but simply register
your supported clipboard formats with TBaseVirtualTree and your VET will be
called whenever one of
the formats must be rendered. I need to clarify some details yet but this is
the vision I have.

> I like the new way much better ( I have seen several implementation,
> including a few of my own, using one class to implement all the interfaces
> for drag drop and find them to be not the way to go a number of
> reasons). With just a few minor adjustments it will be a very flexible way
> to handle D&D.

Well, basically the idea is not bad (to have all interfaces in one class) but
it makes in my case
one aspect difficult: how to get notified when my own clipboard data has been
replaced by another
application? The docs say that when the IDataObject interface is released then
it has been replaced.
But with Delphi releasing the interfaces happens very frequently. The only
reliable way seems to be
to use the destruction of the interface, but this forced me to separate the
interface from the drag
manager. A nice side effect is that you can now have a clipboard operation and
a drag operation
simultanously, since the associated data object interfaces are different.

> I liked the way you implemented the DragManager by using the
> DoCreateDragManager virtual method. Now that the DataObject is not part of
> the DragManager that method becomes less useful. I would like to see a
> similar design for the TTVDataObject class. Allow the program to be called
> to create the desired IDataObject that is a decendant of TVTDataObject.

I think with the new design this will not be necessary because the clipboard
formats are handled by
the internal list. But wait, you will need to implement additional interfaces
in IDataObject, right?
So you need to be able to use your own interface. Or is it possible to return
the other interfaces
(which btw.?) directly from VET?

> Also is there a reason to keeping a reference to the DataObject?

You are right. I will consider this point in the new design. There is of course
no need to hold a
data object without a drag operation actually being happen.

> One last thing. Is it possible to make all the interface methods
> virtual? (I am not sure
> if you can make an interface method virtual I have never tried it).

Interface methods cannot be virtual because they do not exist. You can compare
them with abstract
methods of Delphi classes. To override a method simply implement it as I did
with _Release which
effectively has hidden the same method in TInterfacedObject.

> Sorry I am whining about this but VET needs to set custom clipboard formats
> and changes those formats depending on the namespace that is selected.

You don't need any apology. I have to thank you for your senseful and careful
critics about a
serious design flaw :o]

Ciao, Mike

 | Replies | Author | Date
2351 | Re: New DataObject Implemenation Suggestions/Ques | Jim Kueneman | Mon 6/11/2001


re: Version 2.4.21 => 2.4.25 new problems

From: "Mike Lischke" [public@l...]
Date: Mon Jun 11, 2001 10:51 am
Subject: RE: [VirtualTreeview] Version 2.4.21 => 2.4.25 new problems

Hi Roland,

> at this morning I downloaded lastest version 2.4.25 from this side:
> [Pascal Fehler] VirtualExplorerTree.pas(651): Methode 'RenderData'
> nicht in Basisklasse gefunden...

Generally, it takes of course a day or two until Jim can adjust VET to fit with
VT. This time
however I have made changes in VT which need more adjustments (not only in VET
but in again in VT).
Please stay away from build 25. I will upload a new build as soon as all
problems are clarified.

Ciao, Mike


re: It is worth it!

From: GIANNAKOPOULOS KOSTAS [kyan@s...]
Date: Mon Jun 11, 2001 11:19 am
Subject: RE: [VirtualTreeview] It is worth it!

> I feel quite proud of VET after seeing this tree!
>
> Sorry for the bandwidth but I have spent all afternoon trying
> to decide on
> how to change VET to make it work best with the new VT and
> had a bad case
> of the "is it really worth it Jim"s.

For what it's worth, coming from a person who has spent quite some time
trying to understand the shell stuff, you have every reason to be proud, as
well as Mike, not only for your splendid components but also for your
ability to maintain your code and to distinguish between good and not so
good (or not worth the while) ideas about new features.

Jim, a suggestion:

Consider using the IShellFolder2 interface (if available) to get column
information instead of IShellDetails. It provides much more columns that
IShellDetails. Please refer to file ShlObj2.pas i've sent you for a
translation of the relative interfaces/structures from the Platform SDK
header files.

A nice challenge for you would be to implement threaded displaying of column
values for columns that IShellFolder2.GetDefaultColumnState returns
SHCOLSTATE_SLOW, just like you do with images.

Now, because the number of columns IShellFolder2 can return is very large
(nearly 30) you might consider subclassing Mike's TVirtualTreeColumn class
to add a "ColumnID" property, instead of having a set property (something
like the "FieldName" property of a TDBGrid column). This would also make it
easier to setup the columns of the VET at design-time.

Of course, Mike would have to help you with this, making the classes
"subclassable".

One last thing..

Mike, i feel that i've put both Jim and you in trouble with my DragManager
nagging. For this i think i have to apoligize...

<KY>

 | Replies | Author | Date
2350 | Re: It is worth it! | Jim Kueneman | Mon 6/11/2001
2352 | Newbie questions | [ls@t...] | Mon 6/11/2001
2355 | Re: Newbie questions | Jim Kueneman | Mon 6/11/2001
2354 | Re: It is worth it! | GIANNAKOPOULOS KOSTAS | Mon 6/11/2001
2425 | Re: It is worth it! | Mike Lischke | Sat 6/16/2001


re: It is worth it!

From: Jim Kueneman [jimdk@m...]
Date: Mon Jun 11, 2001 12:10 pm
Subject: RE: [VirtualTreeview] It is worth it!

At 02:19 PM 6/11/2001 +0300, you wrote:
>well as Mike, not only for your splendid components but also for your
>ability to maintain your code and to distinguish between good and not so
>good (or not worth the while) ideas about new features.

:o) (blush)

>Consider using the IShellFolder2 interface (if available) to get column
>information instead of IShellDetails. It provides much more columns that
>IShellDetails. Please refer to file ShlObj2.pas i've sent you for a

Way ahead of you. The interfaces are all in VET right now and I am toying
with them and thinking about the best way to implement IShellFolder2 in VET.

>A nice challenge for you would be to implement threaded displaying of column
>values for columns that IShellFolder2.GetDefaultColumnState returns
>SHCOLSTATE_SLOW, just like you do with images.

Has crossed my mind too.

>Now, because the number of columns IShellFolder2 can return is very large
>(nearly 30) you might consider subclassing Mike's TVirtualTreeColumn class
>to add a "ColumnID" property, instead of having a set property (something
>like the "FieldName" property of a TDBGrid column). This would also make it
>easier to setup the columns of the VET at design-time.

I have NEVER used any of the database components so I will have to figure
out what you mean.

>Mike, i feel that i've put both Jim and you in trouble with my DragManager
>nagging. For this i think i have to apoligize...

Oh well. But I think it is for the best, I wanted the IDataObject to be a
bit more flexable anywhy <g>

Jim


re: New DataObject Implemenation Suggestions/Questions

From: Jim Kueneman [jimdk@m...]
Date: Mon Jun 11, 2001 12:23 pm
Subject: RE: [VirtualTreeview] New DataObject Implemenation Suggestions/Questions

At 12:47 PM 6/11/2001 +0200, you wrote:
>the internal list. But wait, you will need to implement additional
>interfaces in IDataObject, right?
>So you need to be able to use your own interface. Or is it possible to
>return the other interfaces
>(which btw.?) directly from VET?

What I have is the IDataObject that I query from IShellFolder. All I need
to do is override each method of TTVDataObject and return the result of the
same function as that DataObject? What did I just say?

An example will help:

function TMyNewDataObject.DUnadvise(dwConnection: Integer): HResult;
begin
Result := TargetNamespaceDataObject.DUndvise(dwConnection)
end;

I would like to do this for every IDataObject function.

>Interface methods cannot be virtual because they do not exist. You can
>compare them with abstract
>methods of Delphi classes. To override a method simply implement it as I
>did with _Release which
>effectively has hidden the same method in TInterfacedObject.

I really meant can TTVDataObject's implementation of IDataObject methods be
virtual. That way I can derive a new TTVDataObject decendant and still
call the the inherited method. It will be important since I need to be
able to still let VT inject the VirtualTreeView formats so the trees can
talk to one another. Werner says yes, and I am not sure.

Jim


Newbie questions

From: [ls@t...]
Date: Mon Jun 11, 2001 12:40 pm
Subject: Newbie questions

Hi,

I'm new to this group and of course new to VirtualTreeView (VT). Therefore
I have a two questions:
1)
I've found 2 different versions of VT: v1.31 from Mike's homepage and
the beta version 2.4.25.
Which version should I use to produce a stable application for my
company?
2)
I've played around with the VirtualStringTree (v1.31), filled it with
Database-Information and wondered about the following behavior:
situation: one tree with a few roots and only the first level
children; correctly connected Node-Data; every time I'll click on a
Node, I have to update some other things in my app. If I use the
events OnFocusChanged or -changing the event fires always two times. If
I use the event OnChange the event fires only one time.
What's the reason for this behavior?

Thanks a lot

Lars

----------------
Lars Söding
[soeding@w...]
----------------

//***********************\\
LIVE LONG AND PROSPER
\\***********************//

 | Replies | Author | Date
2355 | Re: Newbie questions | Jim Kueneman | Mon 6/11/2001


re: Can't select node with keyboard.

From: [SimonMoscrop@H...]
Date: Mon Jun 11, 2001 12:49 pm
Subject: Re: Can't select node with keyboard.

--- In [VirtualTreeview@y...], "Mike Lischke" [public@l...] wrote:
> Hi Simon,
>
> > and ... I'm interogating the SelectedCount property in a procedure
> > attached to the OnFocusChanged event.
>
> Mmh, this event can be triggered asynchronously to selection
changes, so you better use OnChange to
> update your selection count.
>
> Ciao, Mike

Cheers - I'll try that.


re: It is worth it!

From: GIANNAKOPOULOS KOSTAS [kyan@s...]
Date: Mon Jun 11, 2001 2:43 pm
Subject: RE: [VirtualTreeview] It is worth it!

> >Now, because the number of columns IShellFolder2 can return
> is very large
> >(nearly 30) you might consider subclassing Mike's
> TVirtualTreeColumn class
> >to add a "ColumnID" property, instead of having a set
> property (something
> >like the "FieldName" property of a TDBGrid column). This
> would also make it
> >easier to setup the columns of the VET at design-time.
>
> I have NEVER used any of the database components so I will
> have to figure
> out what you mean.

What i mean is this:

Consider that VET had the published property "Header" like
TVirtualStringTree. This would mean that the Columns would be visible during
design-time and the developer could manipulate them using the object
inspector. The thing that's missing is a way to specify which shell column
(filename, size, attrs etc.) a VT column represents so VET is able to draw
the correct string for every column.

Now. let's assume that VT had a virtual method, say GetColumnClass that
would define what column class the tree will instantiate:

function TBaseVirtualTree.GetColumnClass: TVirtualTreeColumnClass;
begin
Result := TVirtualTreeColumn;
end;

constructor TVirtualTreeColumns.Create(AOwner: TVTHeader);

begin
inherited Create(AOwner.GetColumnClass); // instead of inherited
Create(TVirtualTreeColumn);
FOwner := AOwner;
FHeaderBitmap := TBitmap.Create;
FHoverIndex := NoColumn;
FDownIndex := NoColumn;
FClickIndex := NoColumn;
FDropTarget := NoColumn;
end;

Which would mean that somebody who made a descendant of VT could create a
descendant class of TVirtualTreeColumn and have his Tree create columns of
this class instead of TVirtualTreeColumn. Then you could do something like:

type
TColumnID = (cidFileName, cidSize, ...);

TVirtualExplorerTreeColumn = class(TVirtualTreeColumn)
private
FColumnID: TColumnId;
protected
public
published
property ColumnID: string read FColumnID write SetColumnId;
end;

function TVirtualExplorerTree.GetColumnClass: TVirtualTreeColumnClass;
begin
Result := TVirtualExplorerTreeColumn;
end;

Now, when you decide what text to paint for a column:

procedure TCustomVirtualExplorerTree.DoGetText(Node: PVirtualNode;
Column: Integer; TextType: TVSTTextType; var Text: WideString);
var
NS: TNamespace;
Handled: Boolean;
begin
inherited;
Handled := False;
if ValidateNamespace(Node, NS) then
if Column = Header.MainColumn then
Text := NS.NameInFolder
else
begin
DoGetVETText(Column, Node, NS, Text, Handled);
if not Handled then
case TVirtualExplorerTreeColumn(Column).ColumnId of
cidFileSize:
case FileSizeFormat of
fsfExplorer: Text := NS.SizeOfFileKB;
fsfActual: Text := NS.SizeOfFile;
fsfDiskUsage: Text := NS.SizeOfFileDiskUsage;
end;
cidFileType: Text := NS.FileType;
cidLastWriteTime: Text := NS.LastWriteTime;
:
:
:
end;
end;
end;

I hope you get the picture...

<KY>


re: Newbie questions

From: "Jim Kueneman" [jimdk@m...]
Date: Mon Jun 11, 2001 3:05 pm
Subject: Re: Newbie questions

--- In [VirtualTreeview@y...], [ls@t...] wrote:
> Hi,
> I've found 2 different versions of VT: v1.31 from Mike's homepage
and
> the beta version 2.4.25.

Use 2.4.23 in the Museum folder. 25 has some issues with another
component in the package right now.

See if that fixs your problem.

Jim


VT - SetCheckImageKind

From: "Ariel Selig" [asel98@y...]
Date: Mon Jun 11, 2001 5:20 pm
Subject: VT - SetCheckImageKind

in proceudre: "SetCheckImageKind"

if (FUpdateCount = 0) and not (csLoading in ComponentState) then
InvalidateRect(Handle, nil, False);

needs a "if HandleAllocated then"
if u need change it on a OnCreate event... ?

 | Replies | Author | Date
2419 | Re: VT - SetCheckImageKind | Mike Lischke | Sat 6/16/2001


VET SetRootFolder

From: "Ariel Selig" [asel98@y...]
Date: Mon Jun 11, 2001 5:39 pm
Subject: VET SetRootFolder

dirExists('')
SetRootFolder(rfCustom)

procedure TCustomVirtualExplorerTree.SetRootFolder(
const Value: TRootFolder);
.
.
.
rfCustom:
begin
if DirExists(RootFolderCustomPath) then

if RootFolderCustomPath='', cuz the user didnt set it... it generate
an "Range Check Error".

it needs a if rootFolderCustomPath<>'' then

 | Replies | Author | Date
2361 | Re: VET SetRootFolder | Jim Kueneman | Tue 6/12/2001
2364 | Re: VET SetRootFolder | Jim Kueneman | Tue 6/12/2001


re: IVTEditLink

From: Werner Lehmann [wl@b...]
Date: Mon Jun 11, 2001 6:30 pm
Subject: Re: [VirtualTreeview] IVTEditLink

Mike Lischke wrote:
>
> As already stated the letter I is already reserved as interface prefix and I
doubt an additional
> prefix for methods will improve the usability.

Never mind, it was only a suggestion.

Werner


re: New DataObject Implemenation Suggestions/Questions

From: Werner Lehmann [wl@b...]
Date: Mon Jun 11, 2001 6:16 pm
Subject: Re: [VirtualTreeview] New DataObject Implemenation Suggestions/Questions

Hi Jim,

> >Interface methods cannot be virtual because they do not exist. You can
> >compare them with abstract
> >methods of Delphi classes. To override a method simply implement it as I
> >did with _Release which
> >effectively has hidden the same method in TInterfacedObject.
>
> I really meant can TTVDataObject's implementation of IDataObject methods be
> virtual. That way I can derive a new TTVDataObject decendant and still
> call the the inherited method. It will be important since I need to be
> able to still let VT inject the VirtualTreeView formats so the trees can
> talk to one another. Werner says yes, and I am not sure.

You made me wonder if I really was right :) I was talking about what this
little test program does. Its output is

ITest.WhoAmI = TestA
ITest.WhoAmI = TestA / TestB

program Project2;

{$APPTYPE CONSOLE}

uses
SysUtils;

type
ITest = interface
['{51BEFF7B-6A40-4838-B8CC-596A3F4E84A0}']
function WhoAmI: String;
end;

TTestA = class (TInterfacedObject, ITest)
function WhoAmI: String; virtual;
end;

TTestB = class (TTestA)
function WhoAmI: String; override;
end;

{ TTestA }

function TTestA.WhoAmI: String;
begin
result := 'TestA';
end;

{ TTestB }

function TTestB.WhoAmI: String;
begin
result := inherited WhoAmI + ' / ' + 'TestB';
end;

var
Test: ITest;

begin
Test := TTestA.Create;
WriteLn('ITest.WhoAmI = ' + Test.WhoAmI);
Test := nil;

Test := TTestB.Create;
WriteLn('ITest.WhoAmI = ' + Test.WhoAmI);
Test := nil;

ReadLn;
end.

Regards,
Werner

 | Replies | Author | Date
2362 | Re: New DataObject Implemenation Suggestions/Ques | Jim Kueneman | Tue 6/12/2001


re: Resizing the borderless node editor

From: Werner Lehmann [wl@b...]
Date: Mon Jun 11, 2001 6:30 pm
Subject: Re: [VirtualTreeview] Resizing the borderless node editor

Hi Mike,

> > I do see the SizeNS cursor but the form cannot be resized. If I place the
WM_SYSCOMMAND
> > in MouseMove (regardless if on form or VTree level) the form resizes on
mouse move
> > ok. But not on mouse down.
> > This question would rather fit into the borland news forums but maybe
anyone of you
> > knows already more...
>
> Seems to me as would there be no border for the form at all. The problem is
(and that's what I had
> to figure out when I implemented the VT combo box) that you need a thick (!)
frame to be able to
> resize the form with the mouse (I used WM_SIZEBOX in CreateParams).

You mean WS_SIZEBOX (*g*). Yes, resizing works with this style. But the form is
not
borderless anymore. Do you really have such a 3D border around your tree combo?

The problem must be somewhere else. Previously I had some radiobuttons at the
bottom
of the dropdown form which left some unobstructed (by any TWinControl) room on
the
form in the lower right corner. And I got WM_NCHITTEST messages for mouse moves
above
this. With the VTree (and probably any other control) filling up the whole
clientarea
of the form no WM_NCHITTEST arrive anymore. NB: WS_THICKFRAME was not needed at
that
time.

I think I am playing a little bit more with it and will finally post it to the
borland
forums. Saw already that some guy has had a similar problem, he wanted to move
his
borderless form which also was filled up with TWinControls. His solution was to
fake
WM_NCLBUTTONDOWN from the control's mousedown handler. Unfortunately the same
does
not work for WM_NCMOUSEMOVE.

Regards,
Werner

 | Replies | Author | Date
2422 | Re: Resizing the borderless node editor | Mike Lischke | Sat 6/16/2001


re: VET SetRootFolder

From: Jim Kueneman [jimdk@m...]
Date: Tue Jun 12, 2001 3:43 am
Subject: Re: [VirtualTreeview] VET SetRootFolder

At 05:39 PM 6/11/2001 +0000, you wrote:

>it needs a if rootFolderCustomPath<>'' then

That fixes the symptom. The cause is DirExists:

Replace DirExists in the ShellUtilities.pas with

function DirExists(FileName: string): Boolean;
var
ErrorCode: LongWord;
begin
if FileName <> '' then
begin
ErrorCode := GetFileAttributes(PChar( FileName));
Result := (Integer(ErrorCode) <> -1) and (FILE_ATTRIBUTE_DIRECTORY and
ErrorCode <> 0);
end
end;

FileCtrls.DirectoryExists has a bug as well!

There are some more Range Check errors in the Context Menu handlers too.

All (that I have found) will be fixed in the next version.

Thanks for finding this,
Jim

 | Replies | Author | Date
2364 | Re: VET SetRootFolder | Jim Kueneman | Tue 6/12/2001


re: New DataObject Implemenation Suggestions/Questions

From: Jim Kueneman [jimdk@m...]
Date: Tue Jun 12, 2001 4:03 am
Subject: Re: [VirtualTreeview] New DataObject Implemenation Suggestions/Questions

At 08:16 PM 6/11/2001 +0200, you wrote:

>You made me wonder if I really was right :) I was talking about what this
>little test program does. Its output is

Thanks for verifying it. If you actually read those funny things called
h*e*l*p files it says you can do it to <g>.

Jim


re: Was: It is worth it! - Now: Custom Column Classes

From: Jim Kueneman [jimdk@m...]
Date: Tue Jun 12, 2001 4:13 am
Subject: RE: [VirtualTreeview] Was: It is worth it! - Now: Custom Column Classes

At 05:43 PM 6/11/2001 +0300, you wrote:

>I hope you get the picture...

Got it crystal clear. It is really up to Mike to decide if he thinks it is
a useful addition to VT.

Jim


re: VET SetRootFolder

From: "Jim Kueneman" [jimdk@m...]
Date: Tue Jun 12, 2001 2:55 pm
Subject: Re: VET SetRootFolder

--- In [VirtualTreeview@y...], Jim Kueneman [jimdk@m...] wrote:
> At 05:39 PM 6/11/2001 +0000, you wrote:
>

Opps STILL wrong! New stuff in capitals.

function DirExists(FileName: string): Boolean;
var
ErrorCode: LongWord;
begin
if FileName <> '' then
begin
ErrorCode := GetFileAttributes(PChar( FileName));
Result := (Integer(ErrorCode) <> -1) and
(FILE_ATTRIBUTE_DIRECTORY and
ErrorCode <> 0);
end ELSE
RESULT := FALSE
end;

> >it needs a if rootFolderCustomPath<>'' then
>
> That fixes the symptom. The cause is DirExists:
>

>


VET won't compile with VT 2.4.25 ?!

From: [tias@m...]
Date: Tue Jun 12, 2001 3:14 pm
Subject: VET won't compile with VT 2.4.25 ?!

Hi !

I'm trying to compile VET (tried both ver 1.4.24 and 1.4.22 (included
with VT 2.4.25) but I get these errors :
[Pascal Error] VirtualExplorerTree.pas(651): Method 'RenderData' not
found in base class
[Pascal Error] VirtualExplorerTree.pas(652): Method 'SetOLEFormats'
not found in base class
[Pascal Error] VirtualExplorerTree.pas(3143): Undeclared identifier:
'RenderData'
[Pascal Error] VirtualExplorerTree.pas(3164): Undeclared identifier:
'FormatEtcList'

What's wrong ?!?
Am I the only one who's getting these errors ?
(I'm using BCB5 + path #1)

/Mathias Thorell

 | Replies | Author | Date
2366 | Re: VET won't compile with VT 2.4.25 ?! | Jim Kueneman | Tue 6/12/2001
2372 | Re: VET won't compile with VT 2.4.25 ?! | [tias@m...] | Tue 6/12/2001
2373 | Re: VET won't compile with VT 2.4.25 ?! | Jim Kueneman | Tue 6/12/2001
2418 | Re: VET won't compile with VT 2.4.25 ?! | Mike Lischke | Sat 6/16/2001


re: VET won't compile with VT 2.4.25 ?!

From: "Jim Kueneman" [jimdk@m...]
Date: Tue Jun 12, 2001 3:51 pm
Subject: Re: VET won't compile with VT 2.4.25 ?!

--- In [VirtualTreeview@y...], [tias@m...] wrote:
> Hi !
>
> What's wrong ?!?
> Am I the only one who's getting these errors ?

No stay away from VT 2.4.25. Read some of the posts from a few days
ago concerning "New DataObject Implementation ..."

Mike is working on it.

Jim

 | Replies | Author | Date
2372 | Re: VET won't compile with VT 2.4.25 ?! | [tias@m...] | Tue 6/12/2001
2373 | Re: VET won't compile with VT 2.4.25 ?! | Jim Kueneman | Tue 6/12/2001


Operation of node selection after edits take place

From: "Brian Huggins" [bghugg@a...]
Date: Tue Jun 12, 2001 4:05 pm
Subject: Operation of node selection after edits take place

Hi,

I have a question about how node selection works after an edit takes
place. I noticed this problem with my application and then I saw the
demo (Tree as grid) operates the same way. Here is how you can see
the problem. Run the advanced demo and go to the Tree as Grid
example.

Normally you can click on an entry of the 'grid' and it will be
highlighted in green. Now go to the Last Name column and make an edit
and hit return. The row will be set to bold. But after this edit,
the selection of nodes doesn't work the same. If you click on some
entry in the grid, that entry will be changed to a highlighted white
box and the contents can't be seen (sometimes an entry in another
column in the same row will have this highlight instead). After
clicking around for awhile, the behavior will usually correct itself.

Has anyone else seen this or know what causes it?

thanks,
brian Huggins

 | Replies | Author | Date
2423 | Re: Operation of node selection after edits take | Mike Lischke | Sat 6/16/2001


Cannot Download VET

From: [yahoo@j...]
Date: Tue Jun 12, 2001 4:58 pm
Subject: Cannot Download VET

I went to the "files" section, and tried to download VET. The file is
13Kb instead of 404kb. Is there anywhere else I can download it?

Regards

Peter

 | Replies | Author | Date
2374 | Re: Cannot Download VET | Stephen Quinn | Wed 6/13/2001
2375 | Re: Cannot Download VET | Jim Kueneman | Wed 6/13/2001


Poll results for VirtualTreeview

From: VirtualTreeview@yahoogroups.com
Date: Tue Jun 12, 2001 7:40 pm
Subject: Poll results for VirtualTreeview

The following VirtualTreeview poll is now closed. Here are the
final results:

POLL QUESTION: Flat scroll bars seem to create more
problems than they a worth. Under
Windows XP they also break the look and
feel of the new style. So I would like
to remove flat scroll bar support from
Virtual Treeview. What is your opinion?

CHOICES AND RESULTS
- Remove flat scroll bars., 23 votes, 82.14%
- Keep flat scroll bars., 5 votes, 17.86%

For more information about this group, please visit
http://groups.yahoo.com/group/VirtualTreeview

For help with Yahoo! Groups, please visit
http://help.yahoo.com/help/us/groups/

 | Replies | Author | Date
2370 | Re: Poll results for VirtualTreeview | Mike Lischke | Tue 6/12/2001
2371 | Re: Poll results for VirtualTreeview | Ariel Selig | Tue 6/12/2001


re: Poll results for VirtualTreeview

From: "Mike Lischke" [public@l...]
Date: Tue Jun 12, 2001 7:49 pm
Subject: RE: [VirtualTreeview] Poll results for VirtualTreeview

Hi all,

> CHOICES AND RESULTS
> - Remove flat scroll bars., 23 votes, 82.14%
> - Keep flat scroll bars., 5 votes, 17.86%

Although the votes are quite clear I still have not yet decided. I cannot
decide because I have the
strong feeling that there are some bugs regarding scroll bars with XP beta 2. I
have applications
which display both old style and luna style scroll bars (no flat scroll bars)
mixed for no obvious
reasons. The final decision is therefore deferred until I have a better version
of WinXP and the
current implementation stays as it is.

Ciao, Mike

 | Replies | Author | Date
2371 | Re: Poll results for VirtualTreeview | Ariel Selig | Tue 6/12/2001


re: Poll results for VirtualTreeview

From: "Ariel Selig" [asel98@y...]
Date: Tue Jun 12, 2001 8:13 pm
Subject: Re: Poll results for VirtualTreeview

dont remove them, check the windows version, and if its XP+ dont use
flat version sbars.
if u had an application with all flat style, u cant use other sbars.


re: VET won't compile with VT 2.4.25 ?!

From: [tias@m...]
Date: Tue Jun 12, 2001 9:07 pm
Subject: Re: VET won't compile with VT 2.4.25 ?!

--- In [VirtualTreeview@y...], "Jim Kueneman" [jimdk@m...] wrote:

> No stay away from VT 2.4.25. Read some of the posts from a few days
> ago concerning "New DataObject Implementation ..."
> Mike is working on it.

Ok, now it's working ! Thanks a lot !

Another issue; did you cahnge the behaviour of the
CollapseAllFirst-flag in the BrowseTo()function ?
If I set CollapseAllFirst = true, it takes about 4½ minutes to browse
to my "C:\" path... It's obvious that VET is browsing into every
folder on my C, D and F disk (checked with breakpoints and with my
ears, the F-disk is a PCMCIA-disk that's producing a distinctive
sound, so I know VET is digging into that one too :-).
Is that really supposed to happen ?
But it works fine if I set CollapseAllFirst = false...

/Mathias T.

 | Replies | Author | Date
2373 | Re: VET won't compile with VT 2.4.25 ?! | Jim Kueneman | Tue 6/12/2001


re: VET won't compile with VT 2.4.25 ?!

From: "Jim Kueneman" [jimdk@m...]
Date: Tue Jun 12, 2001 9:45 pm
Subject: Re: VET won't compile with VT 2.4.25 ?!

--- In [VirtualTreeview@y...], [tias@m...] wrote:
> --- In [VirtualTreeview@y...], "Jim Kueneman" [jimdk@m...] wrote:

> sound, so I know VET is digging into that one too :-).
> Is that really supposed to happen ?
> But it works fine if I set CollapseAllFirst = false...

No, VT changed in FullCollapse. It now comes with a warning that it
is slow and discourages using it.

Is there an alternative that is faster Mike? Why the change?

Jim


re: Cannot Download VET

From: "Stephen Quinn" [squinn@b...]
Date: Wed Jun 13, 2001 12:47 am
Subject: Re: [VirtualTreeview] Cannot Download VET

Peter

You need to right click and choose 'Save as' on the link.

Yahoo d/l has been stuffed for a while now - especially when using tools
like Getright for d/ling.

If you change the '.zip' to .html' on the 13K file - you can see the error
in your browser.

CYA
Steve Quinn
BRUTE Computer Services - Australia
Why doesn't glue stick to the inside of the bottle?
Why don't you ever see the headline "Psychic Wins Lottery"?
Why is "abbreviated" such a long word?

 | Replies | Author | Date
2375 | Re: Cannot Download VET | Jim Kueneman | Wed 6/13/2001


re: Cannot Download VET

From: Jim Kueneman [jimdk@m...]
Date: Wed Jun 13, 2001 1:28 am
Subject: Re: [VirtualTreeview] Cannot Download VET

At 10:47 AM 6/13/2001 +1000, you wrote:
>Peter
>
>You need to right click and choose 'Save as' on the link.
>
>Yahoo d/l has been stuffed for a while now - especially when using tools
>like Getright for d/ling.
>
>If you change the '.zip' to .html' on the 13K file - you can see the error
>in your browser.

If that does not work I can email it to you. I will have a new version up
soon with some bug fixes.

Jim


IB_VTree component install problems

From: Chuck Belanger [phytotech@l...]
Date: Wed Jun 13, 2001 6:19 pm
Subject: IB_VTree component install problems

Hello:

Just starting with VT and IB_VTree (using Interbase in a project) and
for that matter new to Delphi.

I installed VT v2.4.25 fine without VET, but ran into a problem with
installing IB_VTree v226.

Getting error when compiling package:
"IB_VTree.pas (88) declaration of DoGetImageIndex differs from previous
declaration."

As far as I can tell there is no previous declaration. Perhaps in one of
the USES components? Anyone know how to get passed this?

Thank you for any help,

Chuck Belanger, L.Ac.
(licensed acupuncturist)
Richmond, CA

 | Replies | Author | Date
2377 | Re: IB_VTree component install problems | Jim Kueneman | Wed 6/13/2001
2378 | Re: IB_VTree component install problems | Chuck Belanger | Wed 6/13/2001
2383 | Re: IB_VTree component install problems | Jim Kueneman | Thu 6/14/2001
2379 | Re: IB_VTree component install problems | Werner Lehmann | Wed 6/13/2001
2384 | Re: IB_VTree component install problems | Chuck Belanger | Thu 6/14/2001
2388 | Re: IB_VTree component install problems | Jim Kueneman | Thu 6/14/2001
2389 | Re: IB_VTree component install problems | Chuck Belanger | Thu 6/14/2001


re: IB_VTree component install problems

From: "Jim Kueneman" [jimdk@m...]
Date: Wed Jun 13, 2001 7:20 pm
Subject: Re: IB_VTree component install problems

--- In [VirtualTreeview@y...], Chuck Belanger [phytotech@l...] wrote:
> Hello:
> Getting error when compiling package:
> "IB_VTree.pas (88) declaration of DoGetImageIndex differs from
previous

That has not been updated for a while. VT added a Ghosted parameter.
Search VT for DoGetImageIndex then copy that declaration to ID_VTree.
both in the interface section and in the implementation section and
recompile.

If it uses overlays and such it may not show the images quite right as
the image code has changed quite a bit a while ago.

Jim


re: Re: IB_VTree component install problems

From: Chuck Belanger [phytotech@l...]
Date: Wed Jun 13, 2001 8:47 pm
Subject: Re: [VirtualTreeview] Re: IB_VTree component install problems

Jim:

Thanks for the quick reply.

What is a "Ghosted Parameter?"

Would I better off going in the museum and using an older VT?

Chuck

Jim Kueneman wrote:

> --- In [VirtualTreeview@y...], Chuck Belanger [phytotech@l...] wrote:
> > Hello:
> > Getting error when compiling package:
> > "IB_VTree.pas (88) declaration of DoGetImageIndex differs from
> previous
>
> That has not been updated for a while. VT added a Ghosted parameter.
> Search VT for DoGetImageIndex then copy that declaration to ID_VTree.
> both in the interface section and in the implementation section and
> recompile.
>
> If it uses overlays and such it may not show the images quite right as
> the image code has changed quite a bit a while ago.
>
> Jim
>
> To unsubscribe from this group, send an email to:
> VirtualTreeview-unsubscribe@egroups.com
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/

 | Replies | Author | Date
2383 | Re: IB_VTree component install problems | Jim Kueneman | Thu 6/14/2001


re: Re: IB_VTree component install problems

From: Werner Lehmann [wl@b...]
Date: Wed Jun 13, 2001 9:00 pm
Subject: Re: [VirtualTreeview] Re: IB_VTree component install problems

Chuck Belanger wrote:
>
> Jim:
>
> Thanks for the quick reply.
>
> What is a "Ghosted Parameter?"

A parameter whose name is 'Ghosted'.

> Would I better off going in the museum and using an older VT?

Not really. The IBTree has been developed with a rather old
VTree version, don't know which one and if it is in the museum.
The changes which have to be made should not be so hard, so
I would suggest to just fix it. Usually nothing but adjusting
to some new event signatures.

Regards,
Werner


VT vs VET; works with MS Access?

From: [msimcich@a...]
Date: Wed Jun 13, 2001 9:58 pm
Subject: VT vs VET; works with MS Access?

I've not even looked at the downloads yet... but can someone clear up
some fundementals for me?

[1] I see VT and VET spoken of here - are they the same?

[2] Will this work with Access 2000, esp. in conjunction with the
native tab control?

[3] I can program the MS treeview control fine; is VT or VET at about
the same level of programming or does it get involved with a bunch of
esoteric stuff? I've done some API stuff but would have to improve
considerably if that's what's required for VT/VET.

[4] If VT/VET is way more difficult to work with than the MS Treeview
control, does anyone know of an MS Access compatible tree control I
can work with, even for $$$?

Thanks

 | Replies | Author | Date
2381 | Re: VT vs VET; works with MS Access? | [adembaba@e...] | Wed 6/13/2001
2382 | Re: VT vs VET; works with MS Access? | [msimcich@a...] | Wed 6/13/2001
2421 | Re: VT vs VET; works with MS Access? | Mike Lischke | Sat 6/16/2001
2427 | Re: VT vs VET; works with MS Access? | Michael Simcich | Sat 6/16/2001
2434 | Re: VT vs VET; works with MS Access? | Michael Simcich | Sat 6/16/2001
2470 | Re: VT vs VET; works with MS Access? | Michael Simcich | Mon 6/18/2001
2471 | Re: VT vs VET; works with MS Access? | Michael Simcich | Mon 6/18/2001


re: VT vs VET; works with MS Access?

From: [adembaba@e...]
Date: Wed Jun 13, 2001 11:02 pm
Subject: Re: VT vs VET; works with MS Access?

> I've not even looked at the downloads yet...

But, why not. All it takes is to download 2 files and
run the demos in them to see what they do and whether
they are useful to you.

> but can someone clear up some fundementals for me?

> [1] I see VT and VET spoken of here - are they the same?

VT: VirtualTree
This is like TTreeView except much better and FASTER.

VET: VirtualTree
This is what you see in Windows Explorer's left pane
(as well as the right pane if you chose Detail View)
but is much better and FASTER

BTW, I am not in anyway employed by either of the developers
of the above VCLs :-))

> [2] Will this work with Access 2000, esp. in conjunction
> with the native tab control?

I suppose if you made them into ActiveX stuff they will;
I wonder if anyone has done that.

> [3] I can program the MS treeview control fine; is VT or VET at
> about the same level of programming or does it get involved
> with a bunch of esoteric stuff? I've done some API stuff
> but would have to improve considerably if that's what's
> required for VT/VET.

They are a lot simpler than that. Just look at the demos.

> [4] If VT/VET is way more difficult to work with than the
> MS Treeview control, does anyone know of an MS Access
> compatible tree control I can work with, even for $$$?

If you are after a TreeControl that is also DB aware and
also is MS Access compatible, you are narrowing the cone
down to zero. I'd write a standalone Delphi app instead of
doing that --but, it is aonly my opinion.

Cheers,
Adem

 | Replies | Author | Date
2382 | Re: VT vs VET; works with MS Access? | [msimcich@a...] | Wed 6/13/2001
2421 | Re: VT vs VET; works with MS Access? | Mike Lischke | Sat 6/16/2001
2427 | Re: VT vs VET; works with MS Access? | Michael Simcich | Sat 6/16/2001
2434 | Re: VT vs VET; works with MS Access? | Michael Simcich | Sat 6/16/2001
2470 | Re: VT vs VET; works with MS Access? | Michael Simcich | Mon 6/18/2001
2471 | Re: VT vs VET; works with MS Access? | Michael Simcich | Mon 6/18/2001


re: VT vs VET; works with MS Access?

From: [msimcich@a...]
Date: Wed Jun 13, 2001 11:13 pm
Subject: Re: VT vs VET; works with MS Access?

Thanks for the reply...

I've downloaded the files but I don't even have a copy of Delphi
(well, I do have the first version <g>). I know this is a Delphi
control, but also noted that it can work on Linux, so had hopes that
it was generally deployable on windows machines (ie without involving
Delhpi) until I remembered about Kylix... which may be why this works
on Linux.

I've since read in this list that there has been recent
experimentation with converting one or both of the controls to
ActiveX. But I don't think those efforts are finished or whatever.

Thanks for clearing up the VT/VET thing, sounds like I'd be using VT
if I can get it to work for me. The project has to be in Access,
Delphi is not an option.

Anyhoo, no matter what, it's great to see a control like this out
there with such an appreciative audience.

 | Replies | Author | Date
2421 | Re: VT vs VET; works with MS Access? | Mike Lischke | Sat 6/16/2001
2427 | Re: VT vs VET; works with MS Access? | Michael Simcich | Sat 6/16/2001
2434 | Re: VT vs VET; works with MS Access? | Michael Simcich | Sat 6/16/2001
2470 | Re: VT vs VET; works with MS Access? | Michael Simcich | Mon 6/18/2001
2471 | Re: VT vs VET; works with MS Access? | Michael Simcich | Mon 6/18/2001


re: Re: IB_VTree component install problems

From: Jim Kueneman [jimdk@m...]
Date: Thu Jun 14, 2001 6:12 am
Subject: Re: [VirtualTreeview] Re: IB_VTree component install problems

At 01:47 PM 6/13/2001 -0700, you wrote:
>Jim:
>
>Thanks for the quick reply.
>
>What is a "Ghosted Parameter?"

Sorry, it is a parameter to tell VT if the icon should be painted in a
"ghosted" manner. Basiclly aobut 50% gray fill to make it look dim. Like
hidden folders or files in the Explorer window.

Jim


re: Re: IB_VTree component install problems

From: Chuck Belanger [phytotech@l...]
Date: Thu Jun 14, 2001 10:46 am
Subject: Re: [VirtualTreeview] Re: IB_VTree component install problems

Hi, Jim:

Thanks again for your help. I got IB_VTree component installed ok now after
changing the declaration for DoGetImageIndex (copied from VT) and changing
the IB_VTree to "alway rebuild."

I'm seeing truncated folder images and wonder is this is the image display
problem you alluded to? How would I correct this.

Also, would it be possible (and easy for me as a Delphi newbie) to use VT
directly but with IBO datasets, rather than use IB_VTree?

At some point, I will need a popup/right click menu for nodes and perhaps
children. Is this possible with VT?

Thanks for your help,

Chuck Belanger

Jim Kueneman wrote:

> --- In [VirtualTreeview@y...], Chuck Belanger [phytotech@l...] wrote:
> > Hello:
> > Getting error when compiling package:
> > "IB_VTree.pas (88) declaration of DoGetImageIndex differs from
> previous
>
> That has not been updated for a while. VT added a Ghosted parameter.
> Search VT for DoGetImageIndex then copy that declaration to ID_VTree.
> both in the interface section and in the implementation section and
> recompile.
>
> If it uses overlays and such it may not show the images quite right as
> the image code has changed quite a bit a while ago.
>
> Jim
>
> To unsubscribe from this group, send an email to:
> VirtualTreeview-unsubscribe@egroups.com
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/

 | Replies | Author | Date
2388 | Re: IB_VTree component install problems | Jim Kueneman | Thu 6/14/2001


[no subject]

From: "Boris Semenko" [boriss@v...]
Date: Thu Jun 14, 2001 1:16 pm
Subject:

Could anybody tell me whereI can download VT v 2.4.25?

[Non-text portions of this message have been removed]

 | Replies | Author | Date
2387 | Re: [Virtually] | Jim Kueneman | Thu 6/14/2001
2420 | Re: <nothing> | Mike Lischke | Sat 6/16/2001


Header Assignment crash

From: [superfranknl@y...]
Date: Thu Jun 14, 2001 1:46 pm
Subject: Header Assignment crash

Hi to All,

I made a header with an empty column as the first visible one with
the Position option (like the Advanced demo on the Properties page).
Eg.
Columns.Add;
With Columns.Add Do Position := 0;

If you make a copy of the header (Header.Assign) then the PC will
crash.
Someone solved this problem already?

Thanks for your reply,

Frank van den Bergh.

 | Replies | Author | Date
2442 | Re: Header Assignment crash | Mike Lischke | Sun 6/17/2001
2450 | Re: Header Assignment crash | [frankvdbergh@y...] | Sun 6/17/2001
2634 | Re: Header Assignment crash | Mike Lischke | Mon 6/25/2001


re: [Virtually]

From: Jim Kueneman [jimdk@m...]
Date: Thu Jun 14, 2001 1:52 pm
Subject: Re: [Virtually]

At 03:16 PM 6/14/2001 +0200, you wrote:
>Could anybody tell me whereI can download VT v 2.4.25?

http://groups.yahoo.com/group/VirtualTreeview/files/

Note that VET, included in the package, will not compile with the new
version. Mike is going to change the next version considerably to make VT
easier to add their own OLE dragging objects.

Jim


re: Re: IB_VTree component install problems

From: Jim Kueneman [jimdk@m...]
Date: Thu Jun 14, 2001 2:11 pm
Subject: Re: [VirtualTreeview] Re: IB_VTree component install problems

At 03:46 AM 6/14/2001 -0700, you wrote:

>I'm seeing truncated folder images and wonder is this is the image display
>problem you alluded to? How would I correct this.

Where do the images come from? Truncated how? Is the cell height not high
enough?

>Also, would it be possible (and easy for me as a Delphi newbie) to use VT
>directly but with IBO datasets, rather than use IB_VTree?

I have NO idea, I have never done any database programming. Sorry.

>At some point, I will need a popup/right click menu for nodes and perhaps
>children. Is this possible with VT?

Easy. Drop a Popup Menu component on the form in the "Standard" component
pallet tab. Now use the OnGetPopupMenu event in VT. The parameters give
you the node and column thus you can figure out the cell. Fill in the menu
items as that cell requires and pass the menu back. You also get the X, Y
point and I am not sure what AskParent does, you will have to trace back
into VT to see.

Jim


re: Re: IB_VTree component install problems

From: Chuck Belanger [phytotech@l...]
Date: Thu Jun 14, 2001 5:26 pm
Subject: Re: [VirtualTreeview] Re: IB_VTree component install problems

Jim:

Thanks for the reply.

>
> Where do the images come from?

An Imagelist component. Its the conventional folder image.

> Truncated how? Is the cell height not high
> enough?

The images are truncated on the right. (So, without opening delphi and
checking) Am I missing a cell width property?

>
> I have NO idea, I have never done any database programming. Sorry.

Hmmm, that's all I've ever done. I'm a new convert from Visual FoxPro. (and
what a difference this world and Interbase is compared to that!)

My take on it, is that the component works with strings and one needs to take
the records and move it over to the strings in some way. So, the answer is: it
will be easier to stay with IB_Vtree and change it. Also, I was forgeting that
I should be able to access the VT methods and properties to do what I needed,
such as the popup menus. This up all night stuff can definitely affect
thinking.<s>

Thanks for your answer on the popup menu for the nodes.

Chuck, who is still in the hyperbolic portion of his learning curve.


Dragging and DrawSelection

From: [andersthomsen@h...]
Date: Thu Jun 14, 2001 9:32 pm
Subject: Dragging and DrawSelection

Hi,

There is a problem with a tree with FullrowSelect and seleveral
columns.
If I want to start draw selecting I click at an "empty space" in the
row of the node, it draws a little and then starts dragging the node.
This leaves the draw rectangle in the tree and is continued if I
return the mouse to the tree after dropping the dragged node outside
the tree.
I've looked at some prev. messages from late april, where you said
this should be fixed (draw selection if empty space is hit - dragging
if a caption is hit). I'm currently using Version 2.4.23, and it
doesn't seem to work that way for this version.

-Thomsen


Manually scrolling the tree

From: [andersthomsen@h...]
Date: Thu Jun 14, 2001 9:49 pm
Subject: Manually scrolling the tree

I'm about to create some graphical scrollbars to attatch to VT.
How do I manually scroll the tree?

I've tried sending WM_VSCROLL to the tree handle, but I can't get it
to work.

Any suggestions?

-Thomsen

 | Replies | Author | Date
2393 | Re: Manually scrolling the tree | Werner Lehmann | Thu 6/14/2001
2394 | Re: Manually scrolling the tree | [andersthomsen@h...] | Thu 6/14/2001


re: Dragging and DrawSelection

From: Werner Lehmann [wl@b...]
Date: Thu Jun 14, 2001 10:11 pm
Subject: Re: [VirtualTreeview] Dragging and DrawSelection

[andersthomsen@h...] wrote:
>
> I've looked at some prev. messages from late april, where you said
> this should be fixed (draw selection if empty space is hit - dragging
> if a caption is hit). I'm currently using Version 2.4.23, and it
> doesn't seem to work that way for this version.

Should be fixed with 25. Note that you have to remove the VET from
the package as it is not compatible in that version.

Werner


re: Manually scrolling the tree

From: Werner Lehmann [wl@b...]
Date: Thu Jun 14, 2001 10:14 pm
Subject: Re: [VirtualTreeview] Manually scrolling the tree

[andersthomsen@h...] wrote:
>
> I'm about to create some graphical scrollbars to attatch to VT.
> How do I manually scroll the tree?
>
> I've tried sending WM_VSCROLL to the tree handle, but I can't get it
> to work.

I would expect that this works, too. But you have the source, did you
set a breakpoint at the scroll message handler? Is it reached if you
PostMessage WM_VSCROLL?

BTW, do you want to replace the VT scrollbars by some fancy stuff?

Werner

 | Replies | Author | Date
2394 | Re: Manually scrolling the tree | [andersthomsen@h...] | Thu 6/14/2001


re: Manually scrolling the tree

From: [andersthomsen@h...]
Date: Thu Jun 14, 2001 11:37 pm
Subject: Re: Manually scrolling the tree

>BTW, do you want to replace the VT scrollbars by some fancy stuff?

Yes, I'm working on a Winamp plugin, and I would like to add
scrollbars similar to the ones on winamps playlist editor

--- In [VirtualTreeview@y...], Werner Lehmann [wl@b...] wrote:
> [andersthomsen@h...] wrote:
> >
> > I'm about to create some graphical scrollbars to attatch to VT.
> > How do I manually scroll the tree?
> >
> > I've tried sending WM_VSCROLL to the tree handle, but I can't get
it
> > to work.
>
> I would expect that this works, too. But you have the source, did
you
> set a breakpoint at the scroll message handler? Is it reached if you
> PostMessage WM_VSCROLL?
>
> BTW, do you want to replace the VT scrollbars by some fancy stuff?
>
> Werner


A bug in AutoSpanColumns

From: [andersthomsen@h...]
Date: Thu Jun 14, 2001 11:43 pm
Subject: A bug in AutoSpanColumns

Again, I'm using Version 2.4.23 : )

In a tree with voAutospanColumns and several columns, the tree has a
bug when text in a column that has Alignemt=RightJustify. The text in
this column is moved to the next right column, if this has no caption.

Example: (second node has no text in Col2)
Col1(rightAl.) Col2(leftAl.)
textCol1 textCol2
textCol1

-Thomsen

 | Replies | Author | Date
2417 | Re: A bug in AutoSpanColumns | Mike Lischke | Sat 6/16/2001
2430 | Re: A bug in AutoSpanColumns | [andersthomsen@h...] | Sat 6/16/2001
2433 | Re: A bug in AutoSpanColumns | Mike Lischke | Sat 6/16/2001


How to get parent data after move

From: "Frank van den Bergh" [superfranknl@y...]
Date: Fri Jun 15, 2001 10:04 am
Subject: How to get parent data after move

Hi to All,

I have a tree where the data of a node is dependent of the data of
its children.

After a move operation I have to update the former parent and the new
parent. For the new parent I can make use of the OnNodeMoved event
with the link Node.Parent, but I don't have any link to the previous
parent.

Any suggestions, except walking through the complete tree?

Thanks for your reply,

Frank van den Bergh.

 | Replies | Author | Date
2398 | Re: How to get parent data after move | Franz-Leo Chomse | Fri 6/15/2001
2399 | Scrolling questions | [ls@t...] | Fri 6/15/2001
2402 | Re: Scrolling questions | Jim Kueneman | Fri 6/15/2001
2466 | Re[2]: [VirtualTreeview] Scrolling questions | [ls@t...] | Mon 6/18/2001
2401 | Re: How to get parent data after move | Jim Kueneman | Fri 6/15/2001
2475 | Re: How to get parent data after move | [frankvdbergh@y...] | Mon 6/18/2001


Virtual Listview (little off-topic)

From: [mdissel@h...]
Date: Fri Jun 15, 2001 10:34 am
Subject: Virtual Listview (little off-topic)

Hello

I'm searching for a component that behaves just like the virtual
treeview, instead it's a listview... Is there already such a (open
source) component?

Virtual Treeview in grid-mode behaves very well, but i want my users
to choose the view (report, list, large, small) just like the
explorer. I think the Virtual Treeview is not capable to do that...

Regards,

Marco Dissel


re: How to get parent data after move

From: Franz-Leo Chomse [chomse@c...]
Date: Fri Jun 15, 2001 10:50 am
Subject: Re: [VirtualTreeview] How to get parent data after move

>Any suggestions, except walking through the complete tree?

Buffer the link inside the datablock of the child

Regards from Germany

Franz-Leo

 | Replies | Author | Date
2399 | Scrolling questions | [ls@t...] | Fri 6/15/2001
2402 | Re: Scrolling questions | Jim Kueneman | Fri 6/15/2001
2466 | Re[2]: [VirtualTreeview] Scrolling questions | [ls@t...] | Mon 6/18/2001


Scrolling questions

From: [ls@t...]
Date: Fri Jun 15, 2001 11:49 am
Subject: Scrolling questions

Hi,

VT works very fine for me. It's a great component.

However I have the following problem with scrolling:

If I expand the tree, while the item is at the bottom of the window,
with a click on the "plus", the child nodes become not visible and the
vertical scrollbar appears.

I want to prevent the user from scrolling manually down.
Is there a way to scroll them automatically in the visible area of the
VT?

Lars

--------------------------------------------------
tpm taberna pro medicum
Physik und Elektronik in der Medizintechnik GmbH

Dipl.-Ing. Lars Söding

eMail: [ls@t...]
--------------------------------------------------

 | Replies | Author | Date
2402 | Re: Scrolling questions | Jim Kueneman | Fri 6/15/2001
2466 | Re[2]: [VirtualTreeview] Scrolling questions | [ls@t...] | Mon 6/18/2001


problem displaying items in the Virtual Tree as a Stringgrid.

From: "Mark Dekker" [yourfantasy50@h...]
Date: Fri Jun 15, 2001 12:30 pm
Subject: problem displaying items in the Virtual Tree as a Stringgrid.

Hi,

I have a problem with the Virtual Treevieuw component. I 'd like to use the
Tree as a kind of stringgrid (see the Advanced Demo program). I 've studied
the source of this demo program and tried to implement it in my own
testprogram. I 've found out how to set en fill the headercolumns of the
Virtual (string) Tree dynamically, but i don 't know how to use the Node (of
the type PVirtualNode). I have got my own structure (array with records) and
i 'd like to use these for filling the Virtual Tree.
Does anybody know how to do this?
Thanx alreay!
Kind Regards,
Mark.
_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.

 | Replies | Author | Date
2403 | Re: problem displaying items in the Virtual Tree | Jim Kueneman | Fri 6/15/2001
2472 | Re: problem displaying items in the Virtual Tree | Mark Dekker | Mon 6/18/2001
2497 | Re: problem displaying items in the Virtual Tree | Vadim Sedulin | Mon 6/18/2001


re: How to get parent data after move

From: Jim Kueneman [jimdk@m...]
Date: Fri Jun 15, 2001 1:05 pm
Subject: Re: [VirtualTreeview] How to get parent data after move

At 10:04 AM 6/15/2001 +0000, you wrote:
>Hi to All,
>
>I have a tree where the data of a node is dependent of the data of
>its children.
>
>After a move operation I have to update the former parent and the new
>parent. For the new parent I can make use of the OnNodeMoved event
>with the link Node.Parent, but I don't have any link to the previous
>parent.

How about saving a reference to the Parent node through OnDragAllow the
same way, Node.Parent.

Jim

 | Replies | Author | Date
2475 | Re: How to get parent data after move | [frankvdbergh@y...] | Mon 6/18/2001


re: Scrolling questions

From: Jim Kueneman [jimdk@m...]
Date: Fri Jun 15, 2001 1:22 pm
Subject: Re: [VirtualTreeview] Scrolling questions

At 01:49 PM 6/15/2001 +0200, you wrote:
>Hi,
>
>VT works very fine for me. It's a great component.
>
>However I have the following problem with scrolling:
>
>If I expand the tree, while the item is at the bottom of the window,
>with a click on the "plus", the child nodes become not visible and the
>vertical scrollbar appears.
>
>I want to prevent the user from scrolling manually down.
>Is there a way to scroll them automatically in the visible area of the
>VT?

ScrollIntoView(NodeYouJustExpanded.LastChild)

Should work, maybe in the OnExpanded event?

Jim

 | Replies | Author | Date
2466 | Re[2]: [VirtualTreeview] Scrolling questions | [ls@t...] | Mon 6/18/2001


re: problem displaying items in the Virtual Tree as a Stringgrid.

From: Jim Kueneman [jimdk@m...]
Date: Fri Jun 15, 2001 2:08 pm
Subject: Re: [VirtualTreeview] problem displaying items in the Virtual Tree as a Stringgrid.

At 02:30 PM 6/15/2001 +0200, you wrote:
>Hi,
>Virtual (string) Tree dynamically, but i don 't know how to use the Node (of
>the type PVirtualNode). I have got my own structure (array with records) and
>i 'd like to use these for filling the Virtual Tree.
>Does anybody know how to do this?

Is the array critical? VT, as far as I can tell, is not intended to use a
data structure like an array or List to store the data like the
VirtualListview. In VT you never know, or it is very expensive to find,
the absolute index. VT intends each node to have a data structure assigned
to a node.

I am assuming each string in the list is to be displayed in a node. I
creating record type or class and associate a pointer to either with each node.

PMyData: ^TMyData;
TMyData = packed record
Caption: string
end;

procedure TForm1.VirtualStringTree1GetNodeDataSize(
Sender: TBaseVirtualTree; var NodeDataSize: Integer);
begin
NodeDataSize := SizeOf(PMyData)
end;

// Create the structure

procedure TForm1.VirtualStringTree1InitNode(Sender: TBaseVirtualTree;
ParentNode, Node: PVirtualNode;
var InitialStates: TVirtualNodeInitStates);
var
MyData: PMyData
begin
// Get the data associated with the node
MyData := PMyData( Sender.GetNodeData);
New(MyData); // using new saves some work when freeing the record that
contain dynamic strings.
if assigned(MyData) then
MyData.Caption := MyStringList[SomeIndex]
end;

// Free the structure
procedure TForm1.VirtualStringTree1FreeNode(Sender: TBaseVirtualTree;
Node: PVirtualNode);
var
MyData: PMyData
begin
MyData := PMyData( Sender.GetNodeData);
if assigned(MyData) then
Dispose(MyData);
end;

// Use the structure to display the text.

procedure TForm1.VirtualStringTree1GetText(Sender: TBaseVirtualTree;
Node: PVirtualNode; Column: Integer; TextType: TVSTTextType;
var Text: WideString);
var
MyData: PMyData
begin
MyData := PMyData( Sender.GetNodeData);
if assigned(MyData) then
Text := MyData.Caption
end;

Another possiblity is to store the index of the string in the node data and
use it to index the TStringList:

PMyData: ^TMyData;
TMyData = packed record
StringIndex: integer;
end;

procedure TForm1.VirtualStringTree1GetText(Sender: TBaseVirtualTree;
Node: PVirtualNode; Column: Integer; TextType: TVSTTextType;
var Text: WideString);
var
MyData: PMyData
begin
MyData := PMyData( Sender.GetNodeData);
if assigned(MyData) then
Text := MyStringList[MyData.StringIndex]
end;

Hope that was what you were after.

Jim


New file uploaded to VirtualTreeview

From: [VirtualTreeview@yahoogroups.com>
Date: Fri Jun 15, 2001 5:47 pm
Subject: New file uploaded to VirtualTreeview

Hello,

This email message is a notification to let you know that
a file has been uploaded to the Files area of the VirtualTreeview
group.

File : /VirtualTree_2.4.28.zip
Uploaded by : [public@l...]
Description : Beta version

You can access this file at the URL

http://groups.yahoo.com/group/VirtualTreeview/files/VirtualTree_2.4.28.zip

To learn more about file sharing for your group, please visit

http://help.yahoo.com/help/us/groups/files

Regards,

public@l...]

 | Replies | Author | Date
2405 | Re: New file uploaded to VirtualTreeview | Mike Lischke | Fri 6/15/2001
2407 | Re: New file ... Very nice with a few small issu | Jim Kueneman | Fri 6/15/2001
2443 | Re: New file ... Very nice with a few small issu | Mike Lischke | Sun 6/17/2001
2438 | Animate Collapse | Jim Kueneman | Sun 6/17/2001
2441 | Re: Animate Collapse | Mike Lischke | Sun 6/17/2001
2447 | Re: Animate Collapse | Jim Kueneman | Sun 6/17/2001
2452 | Re: Animate Collapse | Mike Lischke | Sun 6/17/2001
2451 | Re: Animate Collapse | Jim Kueneman | Sun 6/17/2001
2460 | Full Collapse Performance (or lack of <g>) | Jim Kueneman | Sun 6/17/2001


re: New file uploaded to VirtualTreeview

From: "Mike Lischke" [public@l...]
Date: Fri Jun 15, 2001 6:00 pm
Subject: RE: [VirtualTreeview] New file uploaded to VirtualTreeview

Hi all,

> This email message is a notification to let you know that
> a file has been uploaded to the Files area of the VirtualTreeview
> group.

The new version just uploaded fixes hopefully all problems and wishes regarding
OLE dd and clipboard
handling. Please keep in mind that Jim has to update VET first, before you can
fully install it. If
you still need the new version then take VET out for the moment.

After I removed OLEFormats which used enumerations there is now a string list
property called
ClipboardFormats. This is much more flexible when it comes to non-default
formats. Additionally
there is now an event to create an IDataObject interface by the application or
descentants.
Customizing this interface does not require to create an own drag manager
anymore. VT descentants
have now to register the formats they support and have to include a RenderData
method (if not
special processing is done via an own IDataObject interface) (see also
initialization section of
VirtualTrees.pas). Btw: I will perhaps soon get code for HTML and RTF clipboard
formats, so these
will then be supported too.

I still have a lot eMails to answer here, but will do this tomorrow. Have a
nice evening and

Ciao, Mike

 | Replies | Author | Date
2407 | Re: New file ... Very nice with a few small issu | Jim Kueneman | Fri 6/15/2001
2443 | Re: New file ... Very nice with a few small issu | Mike Lischke | Sun 6/17/2001
2438 | Animate Collapse | Jim Kueneman | Sun 6/17/2001
2441 | Re: Animate Collapse | Mike Lischke | Sun 6/17/2001
2447 | Re: Animate Collapse | Jim Kueneman | Sun 6/17/2001
2452 | Re: Animate Collapse | Mike Lischke | Sun 6/17/2001
2451 | Re: Animate Collapse | Jim Kueneman | Sun 6/17/2001
2460 | Full Collapse Performance (or lack of <g>) | Jim Kueneman | Sun 6/17/2001
2491 | Re: Full Collapse Performance (or lack of <g>) | Mike Lischke | Mon 6/18/2001


IB_VTree:No item/node caption/description display--Why?

From: Chuck Belanger [phytotech@l...]
Date: Fri Jun 15, 2001 8:32 pm
Subject: IB_VTree:No item/node caption/description display--Why?

Hi,

Well, I finally got a TestIBO.gdb compatible with IB5 and I still see:

the TreeView images truncated on the right, with no caption/description.

Could someone point me in the direction to look for why this would
occur? Apparently, this add on component to VT was created using VT
v2.1. So, maybe something has changed so the item/node descriptions
aren't displayed?

Thanks,

Chuck Belanger

 | Replies | Author | Date
2408 | Re: IB_VTree:No item/node caption/description dis | Jim Kueneman | Fri 6/15/2001


re: New file ... Very nice with a few small issues

From: Jim Kueneman [jimdk@m...]
Date: Fri Jun 15, 2001 9:19 pm
Subject: RE: [VirtualTreeview] New file ... Very nice with a few small issues

At 08:00 PM 6/15/2001 +0200, you wrote:

>The new version just uploaded fixes hopefully all problems and wishes
>regarding OLE dd and clipboard
>handling. Please keep in mind that Jim has to update VET first, before you
>can fully install it. If
>you still need the new version then take VET out for the moment.

Hi Mike,

Very nice. A excellent flexable implementation, I like it. I have
VET working quite easily. If I wanted to not let the VT's have any data in
the object it took me all of about 3 minutes to make the changes <g>
. But in order to keep VT's objects in the loop I had to derive a new
TVTDataObject. I have 1 problem and 2 reqests.

Problem: In order to override the interface methods like I showed you
earlier they MUST be virtual. Inteface methods are a bit
different. Eventhough they are virtual *almost* by default (since they are
COM interfaces) they do not contain an internal VMT so they are staticlly
bound at compile time. An example is easier.

type
IInteface1 = class(IUnknown)
procedure A;
end;

IInterface2 = class(IInterface2)
procedure A;
end;

now

var
I1: Interface1;
I2: Interface2;

I2 := IInterface2.Create;
I1 := I2;

If I now use

I2.A will call the procedure in Interface2
I1.A will call the procedure in Interface1 !!!!!!!

eventhough it is created as an IInterface2 object!

So you may see the problem, even though I create a TVETDataObject in the
OnCreateDataObject method the ONLY place that my reintroduced methods are
called are if I call them from a reference that is EXPLICITLY defined as an
TVETDataObject. Since you know nothing of TVETDataObjects in VT you
reference everything by TVTDataObject and hence call the methods that you
have defined, they will not get "forwarded" to decendant methods.

There is a good example of this in the D5 help somewhere and it is in
Delphi in a Nutshell.

To fix it you must make the methods virtual to override them

Like so:

function DUnadvise(dwConnection: Integer): HResult; virtual; stdcall;
function EnumDAdvise(out enumAdvise: IEnumStatData): HResult; virtual;
stdcall;.

I have done this to 2.4.28 and all is working great.

BTW the new implementation has fixed a LOT of wasted clock cycles during
node selection. The calling of BeginDrag on the selection of a new node
forced VET to create a new DataObject on every selection, drag intended or not!

Requests:

1) Make the FOwner a protected read only property. Recipents of the
dataObject will need to know where the data came from easily.
2) The same for ForClipboard, although in my case it is not necessary.

Thanks for changing all this. It like it much better.

Jim

 | Replies | Author | Date
2443 | Re: New file ... Very nice with a few small issu | Mike Lischke | Sun 6/17/2001


re: IB_VTree:No item/node caption/description display--Why?

From: Jim Kueneman [jimdk@m...]
Date: Fri Jun 15, 2001 9:34 pm
Subject: Re: [VirtualTreeview] IB_VTree:No item/node caption/description display--Why?

At 01:32 PM 6/15/2001 -0700, you wrote:
>Hi,
>
>the TreeView images truncated on the right, with no caption/description.
>
>Could someone point me in the direction to look for why this would

I would like to run this but I had no luck installing interbase from the D5
CD (mainly because I have no idea what is is asking/ doing). Are the
columns all 0 width except for the first one? Do you have a Header
property in the Object Inspector? If so go to Header.Columns and open the
Column editor. See what the widths are. The code does make use
of columns but it does not seem to set the width anywhere.

Jim


re: IB_VTree:No item/node caption/description display--Why?

From: Chuck Belanger [phytotech@l...]
Date: Fri Jun 15, 2001 10:35 pm
Subject: Re: [VirtualTreeview] IB_VTree:No item/node caption/description display--Why?

Jim:

Thanks for help and attempt at even loading IB to help me. I really appreciate
it.

I'll try to answer your questions based on what I can find and see. I am new to
all this.

> Are the
> columns all 0 width except for the first one?

I have no idea. From what I can see from the Object Inspector there is only one
column (the 0th) and it is set at 50.

> Do you have a Header
> property in the Object Inspector?

YES.

> If so go to Header.Columns and open the
> Column editor. See what the widths are.

only one entry, 0. with width set in TVTHeader.Columns[0] as Width 50

> The code does make use
> of columns but it does not seem to set the width anywhere.

Here's some code which might be attempting to do this:

in IB_VTree:

procedure TIB_CustomVTree.DoInitNode(Parent, Node: PVirtualNode; var
InitStates: TVirtualNodeInitStates);
.....
.....
i := Header.Columns.Count;

NOTE: he's using Header.Columns.Count to set the length of the ColumnText,
which seems wrong at first glance and based on reading Delphi help for
SetLength.

SetLength(NodeData.ColumnText, Header.Columns.Count);

For ii := 0 to i - 1 do
begin
j := Header.Columns[ii].Tag;
if J <= 10 then s := DataLink.Dataset.BufferFields[j].asstring else s :='';

NodeData.ColumnText[ii] := s;
end;

I'm wondering if below is more like what should be going on:

TProjectNodeData(NodeD.BasicND).SetHColumnsWidth(
TVirtualStringTree(Sender)
.Header.Columns.Items[Column].Width,Column);

Thanks for your continued help,

Chuck Belanger

>
>
> Jim
>
> To unsubscribe from this group, send an email to:
> VirtualTreeview-unsubscribe@egroups.com
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/

[Non-text portions of this message have been removed]

 | Replies | Author | Date
2410 | Re: IB_VTree:No item/node caption/description di | Chuck Belanger | Sat 6/16/2001
2411 | Re: IB_VTree:No item/node caption/description di | Jim Kueneman | Sat 6/16/2001
2412 | VET descendant | Jim Kueneman | Sat 6/16/2001
2440 | Re: VET descendant | Mike Lischke | Sun 6/17/2001
2603 | Re: VET descendant | Jim Kueneman | Sun 6/24/2001
2604 | Re: VET descendant | Mike Lischke | Sun 6/24/2001
2773 | Re: VET descendant | Mike Lischke | Fri 6/29/2001


re: IB_VTree:No item/node caption/description display--Why?

From: Chuck Belanger [phytotech@l...]
Date: Sat Jun 16, 2001 3:42 am
Subject: Re: [VirtualTreeview] IB_VTree:No item/node caption/description display--Why?

Jim:

I've been playing around with the source and the IB_VTree properties and
discovered:

1. The Query SQL needed to be modified so that the field used for description
should be listed first in the statement, i.e.

Select Description
, ID
, Parent
, Folder
, Images
from TableName

What was in the query had the ID first and this forced the 1st column which
should have been Description to be the record ID number instead.

2. In the Object Inspector for the IB_VTree component:
It appears that Header.Options.hoAutoResize needs to be set to TRUE for
everything beyond the first layer folder to display, including the full
caption.

Jim, where can I find documentation on the Header in the VirtualTree, since
this seems to be inherited from that place and I clearly need to find out more
about all these Options. Also, at some point I will need to institute drag and
drop.

Thanks for all your help,

Chuck

 | Replies | Author | Date
2411 | Re: IB_VTree:No item/node caption/description di | Jim Kueneman | Sat 6/16/2001
2412 | VET descendant | Jim Kueneman | Sat 6/16/2001
2440 | Re: VET descendant | Mike Lischke | Sun 6/17/2001
2603 | Re: VET descendant | Jim Kueneman | Sun 6/24/2001
2604 | Re: VET descendant | Mike Lischke | Sun 6/24/2001
2773 | Re: VET descendant | Mike Lischke | Fri 6/29/2001


re: IB_VTree:No item/node caption/description display--Why?

From: Jim Kueneman [jimdk@m...]
Date: Sat Jun 16, 2001 4:57 am
Subject: Re: [VirtualTreeview] IB_VTree:No item/node caption/description display--Why?

At 08:42 PM 6/15/2001 -0700, you wrote:
>1. The Query SQL needed to be modified so that the field used for description
>should be listed first in the statement, i.e.
>
>Select Description
> , ID
> , Parent
> , Folder
> , Images
>from TableName

Thats .... nice ..... whatever your talking about <g>

>2. In the Object Inspector for the IB_VTree component:
>It appears that Header.Options.hoAutoResize needs to be set to TRUE for
>everything beyond the first layer folder to display, including the full
>caption.

Ah-ha that makes sense. If the IB_VTree was not setting the column with and
just creating new columns they were all scrunched up since the widths were
never set. AutoSize must be set.

>Jim, where can I find documentation on the Header in the VirtualTree, since
>this seems to be inherited from that place and I clearly need to find out more
>about all these Options. Also, at some point I will need to institute drag and

Hello Mike <g>

Mike has been busy adding and improving VT and I have been working on VET
we both started to document but improving them is more fun. I am sorry but
for now there is very little documentation.

There is no better way to learn Delphi than by example and single stepping <g>

Jim


VET descendant

From: Jim Kueneman [jimdk@m...]
Date: Sat Jun 16, 2001 5:12 am
Subject: VET descendant

With Werners drop down form problems recently I started thinking about
creating a dropdown form for VET, to make a Addressbar like component. I
had wanted to do this for a while and this was enough push to get
started. I ended up with a custom form that is a drop down form. It can
be installed into the Object Repository and used like any other form. I
uploaded the exe (the source is REAL ugly right now) to see if there is any
interest in an Addressbar like component for VET and see if my dropdown
form works besides on my computer.

Werner, if you have a few I would appreciate a look see since you are
currently tuned into dropdown forms and the fun little quirks they
exhibit. Do you see anything I missed in making the form look and work
like a resizable dropdown combobox?

The animation is real cheesy but for now it works.

Mike would something like that be useful to include in VT? Or should I
start my own Virtual Explorer Control Pack <g>

I will most likely break the DropDown form off as a separate component and
put it somewhere (how is the Delphi component business doing these days <g>)

Any feedback good or bad is appreciated.

Jim

 | Replies | Author | Date
2440 | Re: VET descendant | Mike Lischke | Sun 6/17/2001
2603 | Re: VET descendant | Jim Kueneman | Sun 6/24/2001
2604 | Re: VET descendant | Mike Lischke | Sun 6/24/2001
2773 | Re: VET descendant | Mike Lischke | Fri 6/29/2001


New file uploaded to VirtualTreeview

From: [VirtualTreeview@yahoogroups.com>
Date: Sat Jun 16, 2001 5:13 am
Subject: New file uploaded to VirtualTreeview

Hello,

This email message is a notification to let you know that
a file has been uploaded to the Files area of the VirtualTreeview
group.

File : /Project1.zip
Uploaded by : [jimdk@m...]
Description : A early Beta version of a VET based DropDown Addressbar like
component. Demo only no source.

You can access this file at the URL

http://groups.yahoo.com/group/VirtualTreeview/files/Project1.zip

To learn more about file sharing for your group, please visit

http://help.yahoo.com/help/us/groups/files

Regards,

jimdk@m...]


re: New file uploaded to VirtualTreeview

From: Werner Lehmann [wl@b...]
Date: Sat Jun 16, 2001 2:40 pm
Subject: Re: [VirtualTreeview] New file uploaded to VirtualTreeview

Hi Mike,

> The new version just uploaded fixes hopefully all problems and wishes
regarding OLE dd and clipboard
> handling. Please keep in mind that Jim has to update VET first, before you
can fully install it. If
> you still need the new version then take VET out for the moment.

nice property editor for ClipboardFormats. I like the custom drawing and was
surprised to
see this effect :) Also nice idea to provide 'toggleable' strings from a
stringlist although
I was a little bit puzzled at first when I tried to add a string to the list :)

Werner

 | Replies | Author | Date
2444 | Re: New file uploaded to VirtualTreeview | Mike Lischke | Sun 6/17/2001
2455 | Re: New file ... Clipboard Formats | Jim Kueneman | Sun 6/17/2001
2457 | Re: New file ... Clipboard Formats | Mike Lischke | Sun 6/17/2001
2465 | Re: New file ... Clipboard Formats | Roland | Mon 6/18/2001
2482 | Re: New file ... Clipboard Formats | Jim Kueneman | Mon 6/18/2001


re: VET descendant

From: Werner Lehmann [wl@b...]
Date: Sat Jun 16, 2001 2:44 pm
Subject: Re: [VirtualTreeview] VET descendant

Jim Kueneman wrote:
>
> With Werners drop down form problems recently I started thinking about
> creating a dropdown form for VET, to make a Addressbar like component. I
> had wanted to do this for a while and this was enough push to get
> started. I ended up with a custom form that is a drop down form. It can
> be installed into the Object Repository and used like any other form. I
> uploaded the exe (the source is REAL ugly right now) to see if there is any
> interest in an Addressbar like component for VET and see if my dropdown
> form works besides on my computer.
>
> Werner, if you have a few I would appreciate a look see since you are
> currently tuned into dropdown forms and the fun little quirks they
> exhibit. Do you see anything I missed in making the form look and work
> like a resizable dropdown combobox?

Found only one of these little quirks: if I let the form drop down and choose
a folder by double clicking, the folder will be selected and the drop down
rolled up. Ok, but now the ellipsis button is grayed out (form is active),
if I click on the ellipsis button, the button changes to normal look but
the mainform becomes inactive. It takes a second click on the button to make
the drop down form show again. I believe that that button should never be
grayed out.

BTW, you may know that already but you can mimic the combobox button easily
with one of the symbols in the font Marlett. Or maybe use DrawFrameControl.

> The animation is real cheesy but for now it works.

Well, the slide effect appears too slow for my taste. Usual animation duration
is 200ms. Personally I prefer AnimateWindow. Even if this means dynamic linking
with GetProcAddress for pre-98/2k-Systems which do not support it.

The resizing leaves a trail of invalidated areas behind which get validated
a little bit late. No idea why. It even affects the standard controls on the
form behind the drop down.

> Any feedback good or bad is appreciated.

BTW, the windows address bar dropdown does not show expand buttons, and it
does not allow to navigate any deeper than one folder at once. Don't know if
this should be simulated or not.

How do you avoid that the mainform's caption bar is drawn inactive while the
dropdown is open? Do you catch WM_NCACTIVATE on mainform level? By subclassing
the calling form, given as owner?

The resizing, do you subclass the tree on the dropdown, trap WM_NCHITTEST and
return HTTRANSPARENT?

This all works for me now. The only (not so little and funny) quirk left is
this: I open the node editor. I press ctrl+esc to bring up the start menu. The
node editor is closed. I switch back to app. Now the selected nodes of that
tree on which the node editor was opened appear with a gray selection color.
The VTree has no focus. And I cannot give it focus back. If I click on the
Vtree the selection changes but is still drawn gray. Keypressed like F2 do
not arrive at the VTree's KeyDown.

The black magic comes to an end if I alt+tab away and back. The VTree looks
normal now and everything works again as expected.

Therefore I would appreciate if you could implement IVTEditLink and test this.
Or maybe you know already why and what to do :)

Regards,
Werner

PS: One more thought. The dropdown should drop up if there is not enough room
below. You can use this to get the screen size minus taskbar:

function GetDesktopSize: TRect;
begin
SystemParametersInfo(SPI_GETWORKAREA, 0, @Result, 0);
end;

And this to know whether the taskbar is hidden:

function IsTaskbarAutoHideOn: Boolean;
var
ABData : TAppBarData;
begin
ABData.cbSize := SizeOf(ABData);
result := (SHAppBarMessage(ABM_GETSTATE, ABData) and ABS_AUTOHIDE) > 0;
end;

 | Replies | Author | Date
2428 | Re: VET descendant | Jim Kueneman | Sat 6/16/2001
2436 | Re: VET descendant | Werner Lehmann | Sat 6/16/2001
2437 | Re: VET descendant | Jim Kueneman | Sun 6/17/2001
2449 | Re: VET descendant | Werner Lehmann | Sun 6/17/2001


re: Scrolling questions

From: "Mike Lischke" [public@l...]
Date: Sat Jun 16, 2001 3:52 pm
Subject: RE: [VirtualTreeview] Scrolling questions

Hi Lars,

> If I expand the tree, while the item is at the bottom of the window,
> with a click on the "plus", the child nodes become not visible and the
> vertical scrollbar appears.

I have included this feature in the latest build. Wait until next upload to YG.

Ciao, Mike


re: A bug in AutoSpanColumns

From: "Mike Lischke" [public@l...]
Date: Sat Jun 16, 2001 3:52 pm
Subject: RE: [VirtualTreeview] A bug in AutoSpanColumns

Hi Anders,

> In a tree with voAutospanColumns and several columns, the tree has a
> bug when text in a column that has Alignemt=RightJustify. The text in
> this column is moved to the next right column, if this has no caption.

This is not a bug but a feature :o] "Autospanning" does happen regardless of
the alignment in participating columns. Only a bidi mode change stops further
spanning. Alignment is always done in the determined node rectangle. You can
tweak the feature however by using nonvisible cell captions (spaces etc.).

Ciao, Mike

 | Replies | Author | Date
2430 | Re: A bug in AutoSpanColumns | [andersthomsen@h...] | Sat 6/16/2001
2433 | Re: A bug in AutoSpanColumns | Mike Lischke | Sat 6/16/2001


re: Re: VET won't compile with VT 2.4.25 ?!

From: "Mike Lischke" [public@l...]
Date: Sat Jun 16, 2001 3:54 pm
Subject: RE: [VirtualTreeview] Re: VET won't compile with VT 2.4.25 ?!

> No, VT changed in FullCollapse. It now comes with a warning that it
> is slow and discourages using it.
> Is there an alternative that is faster Mike? Why the change?

FullCollapse does now what its name implies. It collapses all nodes, just like
FullExpand but the opposite direction.

Ciao, Mike


re: VT - SetCheckImageKind

From: "Mike Lischke" [public@l...]
Date: Sat Jun 16, 2001 3:58 pm
Subject: RE: [VirtualTreeview] VT - SetCheckImageKind

Ariel,

> in proceudre: "SetCheckImageKind"
> needs a "if HandleAllocated then"
> if u need change it on a OnCreate event... ?

Thank you. The check is now there.

Ciao, Mike


re: <nothing>

From: "Mike Lischke" [public@l...]
Date: Sat Jun 16, 2001 3:58 pm
Subject: RE: [VirtualTreeview] <nothing>

Boris,

> Could anybody tell me whereI can download VT v 2.4.25?

There is a file area on www.yahoogroups.com for each mailing list. In the one
for VT you'll find a
lot of files one being the latest build of VT.

> [Non-text portions of this message have been removed]

Please do not attach anything to your message. There are more than 400 people
listening here and
most of them do not want to get attachments from unknown sources. Btw: please
use a self speaking
subject for your eMails, otherwise spam filters may take your eMail out so it
never reaches the
actual receiver. Thank you and

Ciao, Mike


re: Re: VT vs VET; works with MS Access?

From: "Mike Lischke" [public@l...]
Date: Sat Jun 16, 2001 3:58 pm
Subject: RE: [VirtualTreeview] Re: VT vs VET; works with MS Access?

Hi Michael,

> I've since read in this list that there has been recent
> experimentation with converting one or both of the controls to
> ActiveX. But I don't think those efforts are finished or whatever.

Indeed, these efforts are still not finished. I first want to have VT ready to
publish, then I will
add ActiveX controls too. There are simply too many changes which would require
a rebuild of the
ActiveX controls all the time.

> Thanks for clearing up the VT/VET thing, sounds like I'd be using VT
> if I can get it to work for me. The project has to be in Access,
> Delphi is not an option.

I have created an ActiveX version of VT and will send it to you privately as
reply to your private
mail.

Ciao, Mike

 | Replies | Author | Date
2427 | Re: VT vs VET; works with MS Access? | Michael Simcich | Sat 6/16/2001
2434 | Re: VT vs VET; works with MS Access? | Michael Simcich | Sat 6/16/2001
2470 | Re: VT vs VET; works with MS Access? | Michael Simcich | Mon 6/18/2001
2471 | Re: VT vs VET; works with MS Access? | Michael Simcich | Mon 6/18/2001


re: Resizing the borderless node editor

From: "Mike Lischke" [public@l...]
Date: Sat Jun 16, 2001 3:58 pm
Subject: RE: [VirtualTreeview] Resizing the borderless node editor

Hi Werner,

> Yes, resizing works with this style. But the form is not
> borderless anymore. Do you really have such a 3D border around your tree
combo?

Yes, I have a thick border, because I could not make resizing work otherwise.
IIRC there will be no
NC messages for small borders.

Ciao, Mike


re: Operation of node selection after edits take place

From: "Mike Lischke" [public@l...]
Date: Sat Jun 16, 2001 3:58 pm
Subject: RE: [VirtualTreeview] Operation of node selection after edits take place

Hi Brian,

> Has anyone else seen this or know what causes it?

I can confirm this to be a bug. I will work to remove it until the next update.

Ciao, Mike


re: OnInitNode/OnFreeNode

From: "Mike Lischke" [public@l...]
Date: Sat Jun 16, 2001 3:58 pm
Subject: RE: [VirtualTreeview] OnInitNode/OnFreeNode

Hi Vadim,

> > There is almost always some extra work to do which cannot be solved using
> Delphi's type system/RTTI info.
>
> Like what?

- Database initialization/query building/record localization
- preparation of extra structures (e.g. parsers for input data)
- file work necessary to load data
- network connection building (FTP, HTTP, LAN in general)
- initial enumerations like in VET
- ...

I could tell you many more things which are likely used in applications on node
setup and which
cannot be described by Delphi's RTTI. But before we loose even more time on
this subject I would
suggest that you think again about your proposal and try to convince me about
its usefulness. I
promise, if it is a significant improvement over the current solution then I
will also implement it.

Ciao, Mike


re: It is worth it!

From: "Mike Lischke" [public@l...]
Date: Sat Jun 16, 2001 3:58 pm
Subject: RE: [VirtualTreeview] It is worth it!

Hi Kostas,

> Consider that VET had the published property "Header" like
> TVirtualStringTree. This would mean that the Columns would be visible during
> design-time and the developer could manipulate them using the object
> inspector. The thing that's missing is a way to specify which shell column
> (filename, size, attrs etc.) a VT column represents so VET is able to draw
> the correct string for every column.

Although I have doubts that it is really worth the effort to derive an own
header or column class just for occasional modfications of predefined columns
for VET I can also see the benefits. For the time being however I would like to
minimize changes in the tree. You know, otherwise I will never publish a new
version :o]

Ciao, Mike


re: Newbie questions

From: "Mike Lischke" [public@l...]
Date: Sat Jun 16, 2001 3:58 pm
Subject: RE: [VirtualTreeview] Newbie questions

Hi Lars,

> Which version should I use to produce a stable application for my
> company?

Since Virtual Treeview is used in current projects of my company as well I
always try to have it as stable as possible. People here will confirm that I am
very careful when it comes to changes in the tree which may have impact on
compatibility.

> If I use the
> events OnFocusChanged or -changing the event fires always two times. If
> I use the event OnChange the event fires only one time.

OnFocusChanged is triggered for the newly focused node only. So I wonder where
the event is fired the second time. Can you please elaborate more? OnChange is
used for selection changes. Since changing the focused node in a tree usually
also changes the selected node (although not necessarily) it is also triggered
in conjuction with the OnFocusChanged event.

Ciao, Mike

 | Replies | Author | Date
2467 | Re[2]: [VirtualTreeview] Newbie questions | [ls@t...] | Mon 6/18/2001


re: Re: VT vs VET; works with MS Access?

From: "Michael Simcich" [msimcich@a...]
Date: Sat Jun 16, 2001 4:06 pm
Subject: RE: [VirtualTreeview] Re: VT vs VET; works with MS Access?

Outstanding! Thanks!

Michael Simcich
AccessTools

-----Original Message-----
From: Mike Lischke [mailto:[public@l...]]
Sent: Saturday, June 16, 2001 8:58 AM
To: VirtualTreeview@yahoogroups.com
Subject: RE: [VirtualTreeview] Re: VT vs VET; works with MS Access?

Hi Michael,

> I've since read in this list that there has been recent
> experimentation with converting one or both of the controls to
> ActiveX. But I don't think those efforts are finished or whatever.

Indeed, these efforts are still not finished. I first want to have VT
ready to publish, then I will add ActiveX controls too. There are simply
too many changes which would require a rebuild of the ActiveX controls
all the time.

> Thanks for clearing up the VT/VET thing, sounds like I'd be using VT
> if I can get it to work for me. The project has to be in Access,
> Delphi is not an option.

I have created an ActiveX version of VT and will send it to you
privately as reply to your private mail.

Ciao, Mike

To unsubscribe from this group, send an email to:
VirtualTreeview-unsubscribe@egroups.com

Your use of Yahoo! Groups is subject to
http://docs.yahoo.com/info/terms/


re: VET descendant

From: Jim Kueneman [jimdk@m...]
Date: Sat Jun 16, 2001 4:17 pm
Subject: Re: [VirtualTreeview] VET descendant

At 04:44 PM 6/16/2001 +0200, you wrote:

>Found only one of these little quirks: if I let the form drop down and choose
>a folder by double clicking, the folder will be selected and the drop down
>rolled up. Ok, but now the ellipsis button is grayed out (form is active),
>if I click on the ellipsis button, the button changes to normal look but
>the mainform becomes inactive. It takes a second click on the button to make
>the drop down form show again. I believe that that button should never be
>grayed out.

The disable was a last minute hack. If you have the form dropped down and
click the button again it rolls up but then rolls right back down. The
main goal was to get the dropdown form working.

>BTW, you may know that already but you can mimic the combobox button easily
>with one of the symbols in the font Marlett. Or maybe use DrawFrameControl.

I did not, thanks. Again the dropdown form was the main focus of the demo.

> > The animation is real cheesy but for now it works.
>
>Well, the slide effect appears too slow for my taste. Usual animation duration

Agreed, I was just playing around. it is done in a *very* simple loop that
just sets Width and Height.

>The resizing leaves a trail of invalidated areas behind which get validated
>a little bit late. No idea why. It even affects the standard controls on the
>form behind the drop down.

I noticed that too, I will try to figure it out. How do did you resize
your form? Are you using the window style that allows it or are you doing
it. I am using SetWindowPos during the MouseMove message.

> Any feedback good or bad is appreciated.
>
>BTW, the windows address bar dropdown does not show expand buttons, and it
>does not allow to navigate any deeper than one folder at once. Don't know if

Yes that can be a simple option. This will be more of a drop down VET that
will have various modes, AddressBar, dropdown file finder, ect.

>How do you avoid that the mainform's caption bar is drawn inactive while the
>dropdown is open? Do you catch WM_NCACTIVATE on mainform level? By subclassing
>the calling form, given as owner?

Exactly. I catch WM_NACTIVEATE but it does not work as advertised, or as I
remember in 3.x When the popup is opened I catch the first call to the
message (deactivate) and set the parameter back to 1 (draw an active)
border then call DefWindowProc then set a flag so the next time
(reactivate) I do nothing.

>The resizing, do you subclass the tree on the dropdown, trap WM_NCHITTEST and
>return HTTRANSPARENT?

No, I create a window like:

procedure TfmDropDown.CreateParams(var Params: TCreateParams);
begin
inherited;
Params.Style := WS_POPUP or WS_BORDER or WS_CLIPCHILDREN;
// Subtract of the caption which the VCL thinks we have
Height := Height - 2*(GetSystemMetrics(SM_CYSMCAPTION) -
GetSystemMetrics(SM_CXSIZEFRAME));
Params.Height := Height
end;

I look for WM_NCMOUSEMOVE then Capture the mouse and release capture if it
goes outside the dragging zone. In WM_NCLBUTTONDOWN I then Capture the
mouse and resize it through the WM_MOUSEMOVE message.

The VCL fakes many of the border styles so it is not suprising the NC_xxx
messages don't work as expected.

>Therefore I would appreciate if you could implement IVTEditLink and test this.
>Or maybe you know already why and what to do :)

I'll try it. It is my little girls 1st birthday so I have a date the rest
of the day.

Jim


IB_VTRee: giving up on it and VT, too slow

From: Chuck Belanger [phytotech@l...]
Date: Sat Jun 16, 2001 5:03 pm
Subject: IB_VTRee: giving up on it and VT, too slow

Hi, All:

Well, I gave it my best shot. I had some help and pointers from Jim and
in the end I got IB_Vree to "kind of" work.

IF:

you are using InterBase and want to load tables into a Treeview and

IF

your tables are around 1000 records or so or less (I really don't know
the upper limit, but at 33,000 records it went from about 6 seconds to
load the exe and bring up the sample app to something over 15 minutes,
at which point I ctrl-Alt-del and cancelled the program. I'm guessing
its a memory allocation issue, but for this Delphi newbie, that's out of
my league.)

THEN

it works great with the minor modifications that I posted:

1. Cut and past the declaration for DoGetImageIndex from VT in the
interface and implimentation sections.
2. Set the IB_VTree.Header.Options.hoAutosize to TRUE.
3. Make sure the query you use in the IB_Query component has the field
that you want to use as a caption first (in the sample it is simply
DESCRIPTION) in the SQL SELECT statement.

At this point it is easier to modify the application's source code that
I'm trying to modify (which already uses the TTreeView) than try to make
these two components work properly together.

Regards to all,

Chuck Belanger, L.Ac.
Richmond, CA


re: A bug in AutoSpanColumns

From: [andersthomsen@h...]
Date: Sat Jun 16, 2001 5:46 pm
Subject: Re: A bug in AutoSpanColumns

Hi Mike,

I think this should be changed.

In my project, I have a File Size column, which is Right Justified
since it displays numbers. The next column displays Comments, and if
the comment is = '', the file size is displayed in the Comments
column.

A logical solution would be to use autospanning of LeftJustified
columns with the following column(s) and RightJustified columns with
the previous columns.

-Thomsen

--- In [VirtualTreeview@y...], "Mike Lischke" [public@l...] wrote:
> Hi Anders,
>
> > In a tree with voAutospanColumns and several columns, the tree
has a
> > bug when text in a column that has Alignemt=RightJustify. The
text in
> > this column is moved to the next right column, if this has no
caption.
>
> This is not a bug but a feature :o] "Autospanning" does happen
regardless of the alignment in participating columns. Only a bidi
mode change stops further spanning. Alignment is always done in the
determined node rectangle. You can tweak the feature however by using
nonvisible cell captions (spaces etc.).
>
> Ciao, Mike

 | Replies | Author | Date
2433 | Re: A bug in AutoSpanColumns | Mike Lischke | Sat 6/16/2001


Scrolling manually

From: [andersthomsen@h...]
Date: Sat Jun 16, 2001 6:30 pm
Subject: Scrolling manually

Hi,

Sorry for asking about this again, but I can't really make it work.

I would like to make some graphical scroll bars and attatch them to
VT.
So far I've figured out how to scroll VT by sending messages:
with SI do
begin
cbSize := SizeOf(TScrollInfo);
fMask := SIF_POS;
FlatSB_getscrollinfo(tabel.handle,SB_VERT,SI);
nPos := MyVSCrollPos;
FlatSB_setscrollinfo
(tabel.handle,SB_VERT,SI,true);
end;
tabel.Perform(WM_VSCROLL,SB_THUMBPOSITION,0);
tabel.Perform(WM_VSCROLL,SB_ENDSCROLL,0)

But this only works when the scrollbars are shown.
If I set ScrollBarOptions.Scrollbars = ssNone, it doesn't work.
Is there something else I can do? (perhaps publish SetOffsetY/X)

- Thomsen

 | Replies | Author | Date
2432 | Re: Scrolling manually | Mike Lischke | Sat 6/16/2001


re: Scrolling manually

From: "Mike Lischke" [public@l...]
Date: Sat Jun 16, 2001 6:33 pm
Subject: RE: [VirtualTreeview] Scrolling manually

Anders,

> But this only works when the scrollbars are shown.
> If I set ScrollBarOptions.Scrollbars = ssNone, it doesn't work.
> Is there something else I can do? (perhaps publish SetOffsetY/X)

Just use the properties OffsetX, OffsetX and OffsetXY. See also the animation
page of the advanced
demo I uploaded to YG. There I have connected two VTs to act as one.

Ciao, Mike


re: Re: A bug in AutoSpanColumns

From: "Mike Lischke" [public@l...]
Date: Sat Jun 16, 2001 6:42 pm
Subject: RE: [VirtualTreeview] Re: A bug in AutoSpanColumns

> I think this should be changed.

I do not agree.

> In my project, I have a File Size column, which is Right Justified
> since it displays numbers. The next column displays Comments, and if
> the comment is = '', the file size is displayed in the Comments
> column.

I know, so don't use auto span of columns if this is not the result you want or
use a white space as
I already suggested.

> A logical solution would be to use autospanning of LeftJustified
> columns with the following column(s) and RightJustified columns with
> the previous columns.

Perhaps the logical solution but it is far from trivial in painting because it
would require to
paint columns backwards (I mean from right to left), not counted variations
like right-to-left bidi
mode and/or centered captions. I have completely reworked VT's painting 4 times
and about a dozen
times I did significant partial changes. Give me well working code and I'll
build it in, but don't
expect me to go through this most complex stuff again without important reason.

Ciao, Mike


re: Re: VT vs VET; works with MS Access?

From: "Michael Simcich" [msimcich@a...]
Date: Sat Jun 16, 2001 6:49 pm
Subject: RE: [VirtualTreeview] Re: VT vs VET; works with MS Access?

Thanks for sending the file. Right off the bat, it looks like it's going
to be a bit problematic, in the way that many ActiveX controls are, when
used with Access. There is something notoriously odd about the way MS
has Access managing it's windows and on-screen objects that makes it
difficult. The immediate consequence I've seen is that the control will
not retain the size I make it when in design mode - it reverts to it's
default size on the form at runtime. Even some of the MS ActiveX
controls act this way, ones that are perfectly well behaved in VB for
instance. Infragistics (Sheridan + Protoview) doesn't even try to make
their stuff work with Access, it's just too odd, or so they say. It is
doable though; some other firms say their stuff is fine with Access, but
I've not tried them yet.

On the other hand, maybe the difficulty I'm having is a result of some
other ActiveX issue and is not Access specific. I've not been able to
test it in VB 6; there seems to be a naming conflict (there, after
registration via regsvr32, it's presented as a component named "Project
1 Library". In Access it's listed as "VirtualStringTreeX Control").

I'll fool with it some more; but as my interest in using VT with Access
is likely to be unusual, getting it to work for my immediate use should
be a low priority. Maybe someone with more ActiveX chops than I can help
you get this working as an ActiveX control that works properly with (for
instance) VB; and then I can try it with Access, where it'll possibly
have it's own special issues.

Thanks again

Michael Simcich
AccessTools

-----Original Message-----
From: Mike Lischke [mailto:[public@l...]]
Sent: Saturday, June 16, 2001 8:58 AM
To: VirtualTreeview@yahoogroups.com
Subject: RE: [VirtualTreeview] Re: VT vs VET; works with MS Access?

Hi Michael,

> I've since read in this list that there has been recent
> experimentation with converting one or both of the controls to
> ActiveX. But I don't think those efforts are finished or whatever.

Indeed, these efforts are still not finished. I first want to have VT
ready to publish, then I will add ActiveX controls too. There are simply
too many changes which would require a rebuild of the ActiveX controls
all the time.

> Thanks for clearing up the VT/VET thing, sounds like I'd be using VT
> if I can get it to work for me. The project has to be in Access,
> Delphi is not an option.

I have created an ActiveX version of VT and will send it to you
privately as reply to your private mail.

Ciao, Mike

To unsubscribe from this group, send an email to:
VirtualTreeview-unsubscribe@egroups.com

Your use of Yahoo! Groups is subject to
http://docs.yahoo.com/info/terms/


re: Resizing the borderless node editor

From: Werner Lehmann [wl@b...]
Date: Sat Jun 16, 2001 10:57 pm
Subject: Re: [VirtualTreeview] Resizing the borderless node editor

Mike Lischke wrote:
>
> > Yes, resizing works with this style. But the form is not
> > borderless anymore. Do you really have such a 3D border around your tree
combo?
>
> Yes, I have a thick border, because I could not make resizing work otherwise.
IIRC there will be no
> NC messages for small borders.

Fortunately there is a way: you subclass the control which 'prevents'
WM_NCHITTEST
messages to arrive at your drop down form. Trap WM_NCHITTEST there and return
HTTRANSPARENT. That's all (apart from the usual hittest on form level).

Werner

 | Replies | Author | Date
2445 | Re: Resizing the borderless node editor | Mike Lischke | Sun 6/17/2001


re: VET descendant

From: Werner Lehmann [wl@b...]
Date: Sat Jun 16, 2001 11:12 pm
Subject: Re: [VirtualTreeview] VET descendant

Jim Kueneman wrote:
>
> I noticed that too, I will try to figure it out. How do did you resize
> your form? Are you using the window style that allows it or are you doing
> it. I am using SetWindowPos during the MouseMove message.

Well, I leave the resizing up to the usual windows mechanism. I wrote below
how (and also in a reply to a reply of Mike where originally I asked him how
to do it :)

> >How do you avoid that the mainform's caption bar is drawn inactive while the
> >dropdown is open? Do you catch WM_NCACTIVATE on mainform level? By
subclassing
> >the calling form, given as owner?
>
> Exactly. I catch WM_NACTIVEATE but it does not work as advertised, or as I
> remember in 3.x When the popup is opened I catch the first call to the
> message (deactivate) and set the parameter back to 1 (draw an active)
> border then call DefWindowProc then set a flag so the next time
> (reactivate) I do nothing.

Will try that. For the time being I do only this in the OnActivate handler of
the drop down form:

PostMessage(Application.Mainform.Handle, WM_NCACTIVATE, Integer(true), 0);

> >The resizing, do you subclass the tree on the dropdown, trap WM_NCHITTEST and
> >return HTTRANSPARENT?
>
> No, I create a window like:
>
> procedure TfmDropDown.CreateParams(var Params: TCreateParams);
> begin
> inherited;
> Params.Style := WS_POPUP or WS_BORDER or WS_CLIPCHILDREN;
> // Subtract of the caption which the VCL thinks we have
> Height := Height - 2*(GetSystemMetrics(SM_CYSMCAPTION) -
> GetSystemMetrics(SM_CXSIZEFRAME));
> Params.Height := Height
> end;
>
> I look for WM_NCMOUSEMOVE then Capture the mouse and release capture if it
> goes outside the dragging zone. In WM_NCLBUTTONDOWN I then Capture the
> mouse and resize it through the WM_MOUSEMOVE message.
>
> The VCL fakes many of the border styles so it is not suprising the NC_xxx
> messages don't work as expected.

Sounds considerably harder than the HTTRANSPARENT approach above (which does not
even require param changes).

> >Therefore I would appreciate if you could implement IVTEditLink and test
this.
> >Or maybe you know already why and what to do :)
>
> I'll try it. It is my little girls 1st birthday so I have a date the rest
> of the day.

Sure, we all have a life beyond VTree (yes!). I am not in a hurry.

Werner

 | Replies | Author | Date
2437 | Re: VET descendant | Jim Kueneman | Sun 6/17/2001


re: VET descendant

From: Jim Kueneman [jimdk@m...]
Date: Sun Jun 17, 2001 4:22 am
Subject: Re: [VirtualTreeview] VET descendant

At 01:12 AM 6/17/2001 +0200, you wrote:
>Well, I leave the resizing up to the usual windows mechanism. I wrote below
>how (and also in a reply to a reply of Mike where originally I asked him how
>to do it :)

So that requres you to subclass any control that is in the dropdown form
full screen. Kind of a pain.

>Will try that. For the time being I do only this in the OnActivate handler of
>the drop down form:
>
> PostMessage(Application.Mainform.Handle, WM_NCACTIVATE, Integer(true), 0);

So this does not work?

>Sounds considerably harder than the HTTRANSPARENT approach above (which
>does not
>even require param changes).

Yes but it was fun getting into the heart of a windows program again!

> > >Therefore I would appreciate if you could implement IVTEditLink and
> test this.
> > >Or maybe you know already why and what to do :)

I am assuming by opening the start menu the roll up is closing? I uploaded
a new version with a VT. I can start an edit with F2. hit Ctl-esc open the
startmenu, go back open the popup and all seem to be fine.

Again I am using my own message loop during the dropdown so the VCL is not
doing anything weird without me knowing about it.

I added AnimateWindow but that looks as bad as my implementations. The
problem is my main form can't update because my code is in the
AmimateWindow function. It looks bad until it is all rolled up and the
form can process a paint message.

Jim


Animate Collapse

From: Jim Kueneman [jimdk@m...]
Date: Sun Jun 17, 2001 4:48 am
Subject: Animate Collapse

Hi Mike,

I see you added the column color to animated expand. Looks good, but
it created a small bug. If you get the window just the right size you get
little "mouse droppings" as the collapse is animated. Most appear to come
for the horizonal dotted lines pointing to the node text on the level that
is collapsing but sometimes it appears the tip of a letter that extends
below the "line" in the string, for example a "g" or "j' Its appearance is
like a row of dots collapsing upwards.

Jim

 | Replies | Author | Date
2441 | Re: Animate Collapse | Mike Lischke | Sun 6/17/2001
2447 | Re: Animate Collapse | Jim Kueneman | Sun 6/17/2001
2452 | Re: Animate Collapse | Mike Lischke | Sun 6/17/2001
2451 | Re: Animate Collapse | Jim Kueneman | Sun 6/17/2001
2460 | Full Collapse Performance (or lack of <g>) | Jim Kueneman | Sun 6/17/2001
2491 | Re: Full Collapse Performance (or lack of <g>) | Mike Lischke | Mon 6/18/2001


Help needed

From: [basil@r...]
Date: Sun Jun 17, 2001 6:07 am
Subject: Help needed

Hi, Mike!

1.Under the new version 2.4.28 my incremental seaching doesn't work.
I have found that the tree object converts national letters to latins.
With the 2.4.23 version everything was OK. What seems to be a problem?

2.Here is an example of OnIncrementalSearch event of my own:

procedure TDBVirtualStringTree.dbIncrementalSearch(Sender:
TBaseVirtualTree;
Node: PVirtualNode; const Text: WideString; var Result: Integer);
var
s,d:WideString;
caption:WideString;
begin
result:= 1;
OnGetText(self, node, focusedColumn, ttNormal, caption);
s:= AnsiUpperCase(caption);
d:= AnsiUpperCase(text);
if (Pos(d,s) = 1) then result:= 0;
end;

It works for national letters only if I change the line

NewSearchText := FSearchBuffer + WideChar(CharCode);
to
NewSearchText := FSearchBuffer + Char(CharCode);

in your procedure TBaseVirtualTree.HandleIncrementalSearch(CharCode:
Word);

Can you put an example of OnIncrementalSearch event for national
letters?

Thank you.
Basil

 | Replies | Author | Date
2446 | Re: Help needed | Mike Lischke | Sun 6/17/2001


re: VET descendant

From: "Mike Lischke" [public@l...]
Date: Sun Jun 17, 2001 12:45 pm
Subject: RE: [VirtualTreeview] VET descendant

Jim,

> Mike would something like that be useful to include in VT? Or should I
> start my own Virtual Explorer Control Pack <g>

This is totally up to you. I think it would naturally fit into the VET unit and
would so be part of
the main package. But if you decide to use an own package then tell me. I have
no objections. The
only thing I would change is avoiding using a TForm for the drop down. This is
waste of resources.
VET is already a window control and I have already given you code how to slide
the window down/up (I
would not use animation for hiding the tree). Use WM_PRINT and a memory bitmap.
Additionally, set
the popup mode for VET, this will help you for display.

Ciao, Mike

 | Replies | Author | Date
2603 | Re: VET descendant | Jim Kueneman | Sun 6/24/2001
2604 | Re: VET descendant | Mike Lischke | Sun 6/24/2001
2773 | Re: VET descendant | Mike Lischke | Fri 6/29/2001


re: Animate Collapse

From: "Mike Lischke" [public@l...]
Date: Sun Jun 17, 2001 12:45 pm
Subject: RE: [VirtualTreeview] Animate Collapse

Jim,

> I see you added the column color to animated expand. Looks good, but
> it created a small bug. If you get the window just the right size you get
> little "mouse droppings" as the collapse is animated.

I have tried to find a window size which reproduces this bug but I did not see
any artifacts, sorry.
What I need to know is the size of the window when it happens as well as the
node size(s) and how
large the scroll area is during collapse.

Ciao, Mike

 | Replies | Author | Date
2447 | Re: Animate Collapse | Jim Kueneman | Sun 6/17/2001
2452 | Re: Animate Collapse | Mike Lischke | Sun 6/17/2001
2451 | Re: Animate Collapse | Jim Kueneman | Sun 6/17/2001
2460 | Full Collapse Performance (or lack of <g>) | Jim Kueneman | Sun 6/17/2001
2491 | Re: Full Collapse Performance (or lack of <g>) | Mike Lischke | Mon 6/18/2001


re: Header Assignment crash

From: "Mike Lischke" [public@l...]
Date: Sun Jun 17, 2001 12:45 pm
Subject: RE: [VirtualTreeview] Header Assignment crash

Hi Frank,

> I made a header with an empty column as the first visible one with
> the Position option (like the Advanced demo on the Properties page).
>
> If you make a copy of the header (Header.Assign) then the PC will
> crash.

I cannot reproduce the problem. In the "General Abilities" treeview I placed a
button and wrote:

var
T: TVirtualStringTree;

begin
T := TVirtualStringTree.Create(nil);
T.Header.Assign(VST2.Header);
T.Free;
end;

This works as expected and does not crash at all.

Ciao, Mike

 | Replies | Author | Date
2450 | Re: Header Assignment crash | [frankvdbergh@y...] | Sun 6/17/2001
2634 | Re: Header Assignment crash | Mike Lischke | Mon 6/25/2001


re: New file ... Very nice with a few small issues

From: "Mike Lischke" [public@l...]
Date: Sun Jun 17, 2001 12:45 pm
Subject: RE: [VirtualTreeview] New file ... Very nice with a few small issues

Hi Jim,

> Problem: In order to override the interface methods like I showed you
> earlier they MUST be virtual.

Oops, sorry. You requested this already and I forgot to add it. This is now
done.

> BTW the new implementation has fixed a LOT of wasted clock cycles during
> node selection. The calling of BeginDrag on the selection of a new node
> forced VET to create a new DataObject on every selection, drag intended or
not!

Additionally, data objects do only exist when they are needed (during dd and
for the clipboard).
Another plus is that you can now have both a pending clipboard operation and
drag'n drop going on.

> 1) Make the FOwner a protected read only property. Recipents of the
> dataObject will need to know where the data came from easily.
> 2) The same for ForClipboard, although in my case it is not necessary.

Done.

> Thanks for changing all this. It like it much better.

We get it all, resistance is futile ... :o]

Ciao, Mike


re: New file uploaded to VirtualTreeview

From: "Mike Lischke" [public@l...]
Date: Sun Jun 17, 2001 12:45 pm
Subject: RE: [VirtualTreeview] New file uploaded to VirtualTreeview

Hi Werner,

> nice property editor for ClipboardFormats. I like the custom drawing and was
surprised to
> see this effect :)

Well, when I wrote my Property Inspector (OI clone) I had also to reimplement
the property editor
concept for VT and got so some insight into the workings. The owner draw effect
is even more
impressive when painting a chinese or japanes text in bold along with an image
in the object
inspector, because nobody expects that :o] If I would have the time I would
also write a new
component/property editor which shows values in bold in OI which are not the
same as their default.
This would be a great help in the daily work.

>Also nice idea to provide 'toggleable' strings from a stringlist although
> I was a little bit puzzled at first when I tried to add a string to the list
:)

Well, IMO this is the true innovation. I have thought a while about how to
present available
clipboard formats to the user. An enumeration type is only partially useful,
because it is not very
flexible and difficult to handle for own formats. Additionally, clipboard
formats are essentially
described by strings not identifiers (which can vary from system to system).
Hence a string list is
the natural choice, but leaves open how to present the user with available
choices (not only those
already in the list). With help of an own property editor and a simple
registration scheme I made
this possible. Wait until Jim has registered all the other formats (and me for
the new rtf, html and
csv formats for the string tree). Then my idea will show its full potential.

Ciao, Mike

 | Replies | Author | Date
2455 | Re: New file ... Clipboard Formats | Jim Kueneman | Sun 6/17/2001
2457 | Re: New file ... Clipboard Formats | Mike Lischke | Sun 6/17/2001
2465 | Re: New file ... Clipboard Formats | Roland | Mon 6/18/2001
2482 | Re: New file ... Clipboard Formats | Jim Kueneman | Mon 6/18/2001


re: Resizing the borderless node editor

From: "Mike Lischke" [public@l...]
Date: Sun Jun 17, 2001 12:45 pm
Subject: RE: [VirtualTreeview] Resizing the borderless node editor

> Fortunately there is a way: you subclass the control which 'prevents'
WM_NCHITTEST
> messages to arrive at your drop down form. Trap WM_NCHITTEST there and return
> HTTRANSPARENT. That's all (apart from the usual hittest on form level).

I'm not sure I understand you. The drop down control I use is still a VT not a
form. I can set its
borders however I like but found odd things when trying to resize. Well, its
already been a while
since I did it and it could well be I made other things wrong so I have to
check back first before I
can make detailed statements (but it really has a very low priority).

Ciao, Mike


re: Help needed

From: "Mike Lischke" [public@l...]
Date: Sun Jun 17, 2001 12:45 pm
Subject: RE: [VirtualTreeview] Help needed

Hi Basil,

> 1.Under the new version 2.4.28 my incremental seaching doesn't work.
> I have found that the tree object converts national letters to latins.
> With the 2.4.23 version everything was OK. What seems to be a problem?

Fine. Now there is somebody who can try this side of the story too. Actually,
it is a bit difficult
due to the way keyboard input works on various systems (including Win9x). VT
needs the Unicode value
for IS and it was clear that the simple approach used so far won't suffice. But
since there is no
Unicode comparation function generally available I have deferred a better
solution for the time
being.

> It works for national letters only if I change the line
>
> NewSearchText := FSearchBuffer + WideChar(CharCode);
> to
> NewSearchText := FSearchBuffer + Char(CharCode);

The point here is that an ANSI character is assigned to a wide string what
Delphi will compile into
an implicit conversion from MBCS to wide char using the current user locale.
This works fine for you
since you have russian as the user locale but will make problems if you change
the current keyboard
for the application (IIRC this is only possible on WinNT). In this case the
current input locale is
not the same as the current user locale so the incoming characters are
converted by the system using
the current keyboard but the assignment from above would convert them back
using a different locale
which will produce trouble. The only reliable solution I have so far is to
determine the current
keyboard locale and do the conversion manually. This conversion is available in
my Unicode library
but it would be a huge waste of resources to add this large lib to VT at the
time being hence I will
have to copy the code from there unless I'll find a better solution.

Ciao, Mike


re: Animate Collapse

From: Jim Kueneman [jimdk@m...]
Date: Sun Jun 17, 2001 1:12 pm
Subject: RE: [VirtualTreeview] Animate Collapse

>I have tried to find a window size which reproduces this bug but I did not
>see any artifacts, sorry.
>What I need to know is the size of the window when it happens as well as
>the node size(s) and how
>large the scroll area is during collapse.

Great, now that I want it to neither can I. One other thing I noticed is
it is possible for the popup hint to be be open when the node is
expanded. This causes a weird "smearing" effect. Before expanding the
hint box should be hidden.

I'll keep tring to find a way to reproduce the dots.

Jim

 | Replies | Author | Date
2452 | Re: Animate Collapse | Mike Lischke | Sun 6/17/2001


Build 2.4.28 and Dr 'n dr

From: [teusjdejong@p...]
Date: Sun Jun 17, 2001 1:12 pm
Subject: Build 2.4.28 and Dr 'n dr

Mike,

I like the new way DnD is handled; it makes things a lot easier. But,
I couldn't get dragging to Windows / Explorer, etc working. I'm not a
great expert here, but if in TVTDataObject.EnumFormatetc after the
line

EnumFormatEtc := NewList as IEnumFormatEtc;

I add the line

NewList.UpdateList(FOwner);

everything works OK.

When I drag to one of the trees, the IEnumformatetc is filled in
Clone or Reset; apparently, Windows does not call those.

Or am I missing something here?

Teus de Jong

 | Replies | Author | Date
2453 | Re: Build 2.4.28 and Dr 'n dr | Mike Lischke | Sun 6/17/2001


re: VET descendant

From: Werner Lehmann [wl@b...]
Date: Sun Jun 17, 2001 1:17 pm
Subject: Re: [VirtualTreeview] VET descendant

Jim Kueneman wrote:
>
> At 01:12 AM 6/17/2001 +0200, you wrote:
> >Well, I leave the resizing up to the usual windows mechanism. I wrote below
> >how (and also in a reply to a reply of Mike where originally I asked him how
> >to do it :)
>
> So that requres you to subclass any control that is in the dropdown form
> full screen. Kind of a pain.

Well, subclassing does not necessarily mean deriving a descendant. If there is
only one such Control as the VTree in my case it is IMO the better alternative.
Less work, more windows standard routines.

> >Will try that. For the time being I do only this in the OnActivate handler of
> >the drop down form:
> >
> > PostMessage(Application.Mainform.Handle, WM_NCACTIVATE, Integer(true), 0);
>
> So this does not work?

Almost. The mainform caption is flashing shortly. You have to know where to look
to even recognize it but still...

> >Sounds considerably harder than the HTTRANSPARENT approach above (which
> >does not
> >even require param changes).
>
> Yes but it was fun getting into the heart of a windows program again!

:)

> > > >Therefore I would appreciate if you could implement IVTEditLink and
> > test this.
> > > >Or maybe you know already why and what to do :)
>
> I am assuming by opening the start menu the roll up is closing? I uploaded

Sure. That was what I meant with "The node editor is closed."

> a new version with a VT. I can start an edit with F2. hit Ctl-esc open the
> startmenu, go back open the popup and all seem to be fine.
>
> Again I am using my own message loop during the dropdown so the VCL is not
> doing anything weird without me knowing about it.

Too bad (for me). I'd rather avoid everything non-VCL where possible. Maybe
I can find out where the problem is. And if the cause is within VTree or not.

> I added AnimateWindow but that looks as bad as my implementations. The
> problem is my main form can't update because my code is in the
> AmimateWindow function. It looks bad until it is all rolled up and the
> form can process a paint message.

Hm. One problem with AnimateWindow is that it relies on WM_PRINT. Controls
which do not process this message, especially TGraphicControl's, will not
be visible during the animation. Again, this is annoying but not too much
to worry about for my case with only one VTree (which knows WM_PRINT).
Strange though: the border of the VTree is not drawn during animation and
not even after that. I had to force the drawing with

RedrawWindow(Tree.Handle, nil, 0, RDW_INVALIDATE or RDW_FRAME or
RDW_UPDATENOW);

I wonder why instead of WM_PRINT not WM_PAINT could have been used.

Regards,
Werner


re: Header Assignment crash

From: [frankvdbergh@y...]
Date: Sun Jun 17, 2001 2:55 pm
Subject: Re: Header Assignment crash

Thanks Mike for your reply,

In my case it crashes (I can recover it in Win2k).
I have a generic dialogbox with different views.
I start with BeginUpdate then Clear.
After that I make the columns (with columns.Add). For the second
column I change the position into 0 (to show it at the

start). After that I do the assign for a second view. Finally the
EndUpdate.

It goes wrong with the position. In the original view the second
added column is shown first, but in the copied view

the position is not taking into account (ie the showing sequence is
equal to the adding sequence). Probably that's the

reason everything goes wrong for me.

Hopes this gives you more clues to solve the problem.

Best regards,

frank.

 | Replies | Author | Date
2634 | Re: Header Assignment crash | Mike Lischke | Mon 6/25/2001


re: Animate Collapse

From: Jim Kueneman [jimdk@m...]
Date: Sun Jun 17, 2001 3:06 pm
Subject: RE: [VirtualTreeview] Animate Collapse

Mike,

>I have tried to find a window size which reproduces this bug but I did not
>see any artifacts, sorry.
>What I need to know is the size of the window when it happens as well as
>the node size(s) and how
>large the scroll area is during collapse.

I got some screen shots of this. They are in the Screenshots folder. It
can happen both directions. The collapsing one seems to be stuff left over
from a node that is partially shown on the bottom of the screen. The
expanding one I am not sure of since I don't know exactly how you are
implementing the animation.

Happy hunting <g>

Jim

 | Replies | Author | Date
2460 | Full Collapse Performance (or lack of <g>) | Jim Kueneman | Sun 6/17/2001
2491 | Re: Full Collapse Performance (or lack of <g>) | Mike Lischke | Mon 6/18/2001


re: Animate Collapse

From: "Mike Lischke" [public@l...]
Date: Sun Jun 17, 2001 3:45 pm
Subject: RE: [VirtualTreeview] Animate Collapse

> expanded. This causes a weird "smearing" effect. Before expanding the
> hint box should be hidden.

Fixed.

Ciao, Mike


re: Build 2.4.28 and Dr 'n dr

From: "Mike Lischke" [public@l...]
Date: Sun Jun 17, 2001 3:49 pm
Subject: RE: [VirtualTreeview] Build 2.4.28 and Dr 'n dr

Hi Teus,

> I add the line
>
> NewList.UpdateList(FOwner);
>
> everything works OK.

You are right, I forgot this one. It is fixed now, thank you. Please tell me if
you find other
oddities.

Ciao, Mike


re: Resizing the borderless node editor

From: Werner Lehmann [wl@b...]
Date: Sun Jun 17, 2001 1:47 pm
Subject: Re: [VirtualTreeview] Resizing the borderless node editor

Mike Lischke wrote:
>
> > Fortunately there is a way: you subclass the control which 'prevents'
WM_NCHITTEST
> > messages to arrive at your drop down form. Trap WM_NCHITTEST there and
return
> > HTTRANSPARENT. That's all (apart from the usual hittest on form level).
>
> I'm not sure I understand you. The drop down control I use is still a VT not
a form. I can set its
> borders however I like but found odd things when trying to resize. Well, its
already been a while
> since I did it and it could well be I made other things wrong so I have to
check back first before I
> can make detailed statements (but it really has a very low priority).

Okay I answer this right away although it is not your top priority. The reason
why I chose a
form as base for the node editor is twofold: I want to have a TEdit and the
VTree on it, not
the edit parented to the VTree and dropdown VTree separately. I was having this
design for
some time but I like the more centralized way in one form unit better. Also
this allows me
to use the events for the dropdown VTree more easily since I can use the object
inspector.
And have visual form inheritance if I need that anytime.

The other reason is that I could not make a TPanel based approach (again with
edit and tree)
to work. I have thought about making this a component but it is unclear how to
surface all the
tree options / events in a sensible manner. Anyhow I am not so concerned about
the resource
'wasting' of this dropdown form. It is no more waste than any messagedlg and
who thinks about
resources for this. Of course the form is not always there, it's created just
in time.

I show you what I meant with my NC-HitTest explanation above. Don't know if
this is can be
applied to a non-form based approach.

procedure TNodeEdit.FormCreate(Sender: TObject);
begin
...
FOldTreeWindowProc := Tree.WindowProc;
Tree.WindowProc := TreeWindowProc;
end;

procedure TNodeEdit.FormHide(Sender: TObject);
begin
Tree.WindowProc := FOldTreeWindowProc;
...
end;

// Let WM_NCHITTEST messages at the bottom of the tree pass through to the form.

procedure TNodeEdit.TreeWindowProc(var Msg: TMessage);
begin
FOldTreeWindowProc(Msg);
if Msg.Msg = WM_NCHITTEST then
with ScreenToClient(Point(LOWORD(Msg.lParam), HIWORD(Msg.lParam))) do
if (DropDirection = ddDown) and (y > ClientHeight - 10) then
Msg.Result := HTTRANSPARENT;
end;

// Convince the form to resize at the bottom. No THICKFRAME required.

procedure TNodeEdit.WMNCHitTest(var Msg: TMessage);
begin
with ScreenToClient(Point(LOWORD(Msg.lParam), HIWORD(Msg.lParam))) do
if (DropDirection = ddDown) and (y > ClientHeight - 10) then
Msg.Result := HTBOTTOM
else
inherited;
end;

Regards,
Werner


re: New file ... Clipboard Formats

From: Jim Kueneman [jimdk@m...]
Date: Sun Jun 17, 2001 4:31 pm
Subject: RE: [VirtualTreeview] New file ... Clipboard Formats

At 02:45 PM 6/17/2001 +0200, you wrote:

>already in the list). With help of an own property editor and a simple
>registration scheme I made
>this possible. Wait until Jim has registered all the other formats (and me
>for the new rtf, html and
>csv formats for the string tree). Then my idea will show its full potential.

I would have to do that as an aside. I really don't have to do anything
since I ask the IShellFolder for a data object then just use its
implementation through the overridden TTVDataObject (hence the virtual
interface methods) I don't have to register anything the shell namespace
has taken care of it for me.

I do have an old project that creates a IDataObject with shell objects. I
can dig that out and add it into a VT for a shell drag/drop aware tree.

I'll put it on my to do list.

Jim

 | Replies | Author | Date
2457 | Re: New file ... Clipboard Formats | Mike Lischke | Sun 6/17/2001
2465 | Re: New file ... Clipboard Formats | Roland | Mon 6/18/2001
2482 | Re: New file ... Clipboard Formats | Jim Kueneman | Mon 6/18/2001


Build 4.2.28 and D4

From: [teusjdejong@p...]
Date: Sun Jun 17, 2001 4:45 pm
Subject: Build 4.2.28 and D4

Hello Mike,

I just tried to compile my stuff with Delphi 4 and got some problems.
Apparently, Delphi 4 does not know 'SameText'. It is used in
VirtualTrees TClipboardFormatList.FindFormat and in VirtualTreesReg
TClipboardElement.SetValue. Also, it wines about not finding StrEdit
used in VirtualTreesReg and cannot work with the ClipboardFormats
property editor. (In delphi 5 all works fine).

Teus de Jong.

 | Replies | Author | Date
2458 | Re: Build 4.2.28 and D4 | Mike Lischke | Sun 6/17/2001
2459 | Re: Build 4.2.28 and D4 | Teus de Jong | Sun 6/17/2001
2490 | Re: Build 4.2.28 and D4 | Mike Lischke | Mon 6/18/2001


re: New file ... Clipboard Formats

From: "Mike Lischke" [public@l...]
Date: Sun Jun 17, 2001 5:18 pm
Subject: RE: [VirtualTreeview] New file ... Clipboard Formats

Jim,

> I would have to do that as an aside. I really don't have to do anything
> since I ask the IShellFolder for a data object then just use its
> implementation through the overridden TTVDataObject (hence the virtual
> interface methods) I don't have to register anything the shell namespace
> has taken care of it for me.
>
> I do have an old project that creates a IDataObject with shell objects. I
> can dig that out and add it into a VT for a shell drag/drop aware tree.

Well, I did not mean to have shell formats in the base tree but you need to
specify the formats VET
can generate (not accept). This could be customizable using the
ClipboardFormats property.

Ciao, Mike


re: Build 4.2.28 and D4

From: "Mike Lischke" [public@l...]
Date: Sun Jun 17, 2001 5:22 pm
Subject: RE: [VirtualTreeview] Build 4.2.28 and D4

Teus,

> I just tried to compile my stuff with Delphi 4 and got some problems.

Yes, I expected problems with the property editor.

> Apparently, Delphi 4 does not know 'SameText'. It is used in
> VirtualTrees TClipboardFormatList.FindFormat and in VirtualTreesReg
> TClipboardElement.SetValue.

Mmh, have to replace with CompareText or another case-insensitive comparation
routine.

>Also, it wines about not finding StrEdit
> used in VirtualTreesReg and cannot work with the ClipboardFormats
> property editor. (In delphi 5 all works fine).

About StrEdit: could you please try to find out how to launch the stringlist
editor? For the
property editor I already have put a conditional define around the property
draw code. I think we
have to exchange some more builds until this is fixed. I can imagine there are
also problems with
BCB.

Ciao, Mike


re: Build 4.2.28 and D4

From: "Teus de Jong" [teusjdejong@p...]
Date: Sun Jun 17, 2001 7:12 pm
Subject: Re: [VirtualTreeview] Build 4.2.28 and D4

Mike,

> About StrEdit: could you please try to find out how to launch the
stringlist editor? For the
> property editor I already have put a conditional define around the
property draw code. I think we
> have to exchange some more builds until this is fixed. I can imagine there
are also problems with
> BCB.

For the StringList editor you don't have to do anything. If I leave out the
property-editor, Delphi 4 lists a property TClipboardFormats with well known
three dots; click on it and you have the strings in an editor.

groeten

Teus.

 | Replies | Author | Date
2490 | Re: Build 4.2.28 and D4 | Mike Lischke | Mon 6/18/2001


Full Collapse Performance (or lack of <g>)

From: Jim Kueneman [jimdk@m...]
Date: Sun Jun 17, 2001 9:51 pm
Subject: Full Collapse Performance (or lack of <g>)

Hi Mike,

Me again <g>. I along with at least two others are rather disappointed
in the CollapseAll method. It is dog slow since about version
2.4.21. Also in VET it has the nasty side effect of trying to initialize
nodes that are on networks, jaz drives, floppies ect.

I just do not understand why nodes that have never be initialized must be
initialized to do a full collapse. If they never have been initialized
they can't contain anything to check. I replaced CollapseAll in VET with
the following.

Can you look it over and tell me why it won't work? My tests show it works
great with VET and is orders of magnitude ( this is not an exaggeration )
faster. Mathis said VET's BrowseTo method with CollapseAll before expand
checked went from an undetectable time to over 4 MINUTES because it was
accessing all his removable disks.

I added a lot of comments to make it quick and clear to look over if you
paste in in the IDE so the text colors separate the comments.

Jim

procedure TCustomVirtualExplorerTree.FullCollapse(Node: PVirtualNode = nil);

{ Recursive procedure to drill down into VT to collapse nodes. }
procedure CollapseDown(RootNode: PVirtualNode);
var
ChildNode: PVirtualNode;
begin
{ If the node has no children there is nothing to do it can't be
expanded }
if RootNode.ChildCount > 0 then
begin
{ Get the last child node of the target node without initializing
it. If }
{ it is not initialized it can't have children,
right? }
ChildNode := GetLastChildNoInit(RootNode);
{ Iterate though all the child nodes }
while Assigned(ChildNode) do
begin
{ If the HasChildren flag is set but it has not yet been
initialized }
{ there is no way it can have child nodes that need to be
collapsed. }
if (vsHasChildren in ChildNode.States) and (vsInitialized in
ChildNode.States) then
begin
{ Drill down into this initialized folder }
CollapseDown(ChildNode);
{ Returning from the subFolder see if it was really expanded and
collapse if necessary }
if vsExpanded in ChildNode.States then
Expanded[ChildNode] := False
end;
{ Get the child node next up in the list with out initializing it. }
ChildNode := ChildNode.PrevSibling;
end
end
end;

begin
BeginUpdate;
try
if not Assigned(Node) then
Node := GetFirst;
CollapseDown(Node);
if not (vsExpanded in Node.States) then
Expanded[Node] := False
finally
EndUpdate
end;
end;

 | Replies | Author | Date
2491 | Re: Full Collapse Performance (or lack of <g>) | Mike Lischke | Mon 6/18/2001


What to do when GetNodeData(Node) fails ?

From: [yahoo@s...]
Date: Sun Jun 17, 2001 10:54 pm
Subject: What to do when GetNodeData(Node) fails ?

Hi Group,

I am very new to both this group and the VST component and while i
have searched abundantly i cannot find an answer to this.

I think this is a very easy question but i cant for the life of me
make it work. I had a VST which i copied from the example that worked
like a charm but when i create a VST from scratch (a new one) it
seems my GetNodeData fails...

This is what i have :

First some procedure sets the vtArticlesDisplay.RootNodeCount to a
number and then the ini nodes get called (which i think is right).
Here is my init:

[code]
procedure TfrmMainApplication.vtArticlesDisplayInitNode(
Sender: TBaseVirtualTree; ParentNode, Node: PVirtualNode;
var InitialStates: TVirtualNodeInitStates);
var
Data : PArticlesData;
begin
Data := Sender.GetNodeData(Node);
[/code]

Now the problem here is that GetNodeData returns NIL. And i have no
clue why nor what to do about it.

Thanks for any help or pointers.

-Masial

 | Replies | Author | Date
2462 | Re: What to do when GetNodeData(Node) fails ? | Jim Kueneman | Mon 6/18/2001
2485 | Re: What to do when GetNodeData(Node) fails ? | [yahoo@s...] | Mon 6/18/2001
2486 | Re: What to do when GetNodeData(Node) fails ? | Mike Lischke | Mon 6/18/2001
2498 | Re: What to do when GetNodeData(Node) fails ? | Vadim Sedulin | Mon 6/18/2001
2545 | Re: What to do when GetNodeData(Node) fails ? | Mike Lischke | Wed 6/20/2001
2549 | Re: What to do when GetNodeData(Node) fails ? | Vadim Sedulin | Wed 6/20/2001
2656 | Re: What to do when GetNodeData(Node) fails ? | Mike Lischke | Mon 6/25/2001


re: What to do when GetNodeData(Node) fails ?

From: Jim Kueneman [jimdk@m...]
Date: Mon Jun 18, 2001 12:22 am
Subject: Re: [VirtualTreeview] What to do when GetNodeData(Node) fails ?

At 10:54 PM 6/17/2001 +0000, you wrote:

>Hi Group,
>
>I am very new to both this group and the VST component and while i
>have searched abundantly i cannot find an answer to this.
>
>I think this is a very easy question but i cant for the life of me
>make it work. I had a VST which i copied from the example that worked
>like a charm but when i create a VST from scratch (a new one) it
>seems my GetNodeData fails...

Hi Masial,

The most obvious thing I can think of is have you told VT how many bytes to
reserve for your data? Either through the NodeDataSize property (rather
inflexable and must remember to change it if the data size changes) or
through the OnGetDataNodeSize event where you can use SizeOf to extract the
size of the data at runtime (the best way).

Jim

 | Replies | Author | Date
2485 | Re: What to do when GetNodeData(Node) fails ? | [yahoo@s...] | Mon 6/18/2001
2486 | Re: What to do when GetNodeData(Node) fails ? | Mike Lischke | Mon 6/18/2001


Bug in "home"

From: [andersthomsen@h...]
Date: Mon Jun 18, 2001 1:18 am
Subject: Bug in "home"

There seems to be a minor bug in TBaseVirtualTree.WMKeyDown:
// Determine new focused node.
case CharCode of
VK_HOME, VK_END:
begin
if CharCode = VK_END then
....
Node := GetLastVisible;
end
else
begin
....
Node := FRoot.FirstChild;
//Shouldn't that be : Node := GetFirstVisible
...

BTW, how can I change the color of the header (the clsilver color of
the columns). I've tried using ownerdrag and OnDrawHeader, but I
can't figure out how to do it.

- Thomsen

 | Replies | Author | Date
2635 | Re: Bug in "home" | Mike Lischke | Mon 6/25/2001


One more question

From: [basil@r...]
Date: Mon Jun 18, 2001 7:11 am
Subject: One more question

Hi Mike,

Excuse my bothering you, but one more question.
I have written:

>Under the new version 2.4.28 my incremental seaching doesn't work.
>I have found that the tree object converts national letters to
latins.
>With the 2.4.23 version everything was OK. What seems to be a
problem?

May be the problem is that you have changed the key event habdling
from
onKeyPress to onKeyDown for Incremental searching? I have found that
onKeyDown produces scan code while onKeyPress produces the right code.

Thank you.
Basil.


re: New file ... Clipboard Formats

From: "Roland" [Beduerftig@S...]
Date: Mon Jun 18, 2001 7:26 am
Subject: Re: New file ... Clipboard Formats

Good morning Jim,

I download Project1.zip from file-area to show the news about our
formats, but I cannot run the program.

... cannot find entry point "Animate Window" in User32.dll ...

I work with WinNT4 Sp5.

Have a nice day
Roland

 | Replies | Author | Date
2482 | Re: New file ... Clipboard Formats | Jim Kueneman | Mon 6/18/2001


Re[2]: Scrolling questions

From: [ls@t...]
Date: Mon Jun 18, 2001 7:27 am
Subject: Re[2]: [VirtualTreeview] Scrolling questions

Hi Jim,

JK> ScrollIntoView(NodeYouJustExpanded.LastChild)
JK>
JK> Should work, maybe in the OnExpanded event?

Sorry, but I can't get it worked. But Mike wrote, that this feature
will be added to the next release.

Ciao

Lars

--------------------------------------------------
tpm taberna pro medicum
Physik und Elektronik in der Medizintechnik GmbH

Dipl.-Ing. Lars Söding

Im Dorf 15a
D-21335 Lüneburg
Germany

Tel. +49(0)4131-401555
Fax +49(0)4131-401755

eMail: [ls@t...]
[info@t...]

Internet: www.tpm-online.de
--------------------------------------------------


Re[2]: Newbie questions

From: [ls@t...]
Date: Mon Jun 18, 2001 7:27 am
Subject: Re[2]: [VirtualTreeview] Newbie questions

Hi Mike,

> OnFocusChanged is triggered for the newly focused node only. So I wonder
where the
> event is fired the second time. Can you please elaborate more? OnChange is
used for
> selection changes. Since changing the focused node in a tree usually also
changes the
> selected node (although not necessarily) it is also triggered in conjuction
with the
> OnFocusChanged event.

I don't know exactly what I've had done last time <g>, but now the
OnFocusChanged event work perfectly. (I'm using 2.4.28)

Ciao
Lars

--------------------------------------------------
tpm taberna pro medicum
Physik und Elektronik in der Medizintechnik GmbH

Dipl.-Ing. Lars Söding

eMail: [ls@t...]
--------------------------------------------------


re: Re: New file ... Clipboard Formats

From: "Stephen Quinn" [squinn@b...]
Date: Mon Jun 18, 2001 7:57 am
Subject: Re: [VirtualTreeview] Re: New file ... Clipboard Formats

Roland

> ... cannot find entry point "Animate Window" in User32.dll ...
Win2000 and (I think) WinME only

CYA
Steve Quinn
BRUTE Computer Services - Australia
Why doesn't glue stick to the inside of the bottle?
Why don't you ever see the headline "Psychic Wins Lottery"?
Why is "abbreviated" such a long word?

 | Replies | Author | Date
2501 | Re: New file ... Clipboard Formats | Peter Danich | Tue 6/19/2001
2505 | Re: New file ... Clipboard Formats | Jim Kueneman | Tue 6/19/2001


re: New file uploaded to VirtualTreeview

From: Kim Bracknell [kbracknell@f...]
Date: Mon Jun 18, 2001 8:29 am
Subject: RE: [VirtualTreeview] New file uploaded to VirtualTreeview

-----Original Message-----
From: [VirtualTreeview@yahoogroups.com
[mailto:[VirtualTreeview@yahoogroups.com]
Sent: Saturday, 16 June 2001 1:48 AM
To: VirtualTreeview@yahoogroups.com
Subject: [VirtualTreeview] New file uploaded to VirtualTreeview

Hello,

This email message is a notification to let you know that
a file has been uploaded to the Files area of the VirtualTreeview
group.

File : /VirtualTree_2.4.28.zip
Uploaded by : public@l...]
Description : Beta version

You can access this file at the URL

http://groups.yahoo.com/group/VirtualTreeview/files/VirtualTree_2.4.28.zip

To learn more about file sharing for your group, please visit

http://help.yahoo.com/help/us/groups/files

Regards,

public@l...]

To unsubscribe from this group, send an email to:
VirtualTreeview-unsubscribe@egroups.com

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/


re: Re: VT vs VET; works with MS Access?

From: "Michael Simcich" [msimcich@a...]
Date: Sat Jun 16, 2001 4:06 pm
Subject: RE: [VirtualTreeview] Re: VT vs VET; works with MS Access?

Outstanding! Thanks!

Michael Simcich
AccessTools

-----Original Message-----
From: Mike Lischke [mailto:[public@l...]]
Sent: Saturday, June 16, 2001 8:58 AM
To: VirtualTreeview@yahoogroups.com
Subject: RE: [VirtualTreeview] Re: VT vs VET; works with MS Access?

Hi Michael,

> I've since read in this list that there has been recent
> experimentation with converting one or both of the controls to
> ActiveX. But I don't think those efforts are finished or whatever.

Indeed, these efforts are still not finished. I first want to have VT
ready to publish, then I will add ActiveX controls too. There are simply
too many changes which would require a rebuild of the ActiveX controls
all the time.

> Thanks for clearing up the VT/VET thing, sounds like I'd be using VT
> if I can get it to work for me. The project has to be in Access,
> Delphi is not an option.

I have created an ActiveX version of VT and will send it to you
privately as reply to your private mail.

Ciao, Mike

To unsubscribe from this group, send an email to:
VirtualTreeview-unsubscribe@egroups.com

Your use of Yahoo! Groups is subject to
http://docs.yahoo.com/info/terms/

To unsubscribe from this group, send an email to:
VirtualTreeview-unsubscribe@egroups.com

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/


re: Re: VT vs VET; works with MS Access?

From: "Michael Simcich" [msimcich@a...]
Date: Sat Jun 16, 2001 6:49 pm
Subject: RE: [VirtualTreeview] Re: VT vs VET; works with MS Access?

Thanks for sending the file. Right off the bat, it looks like it's going
to be a bit problematic, in the way that many ActiveX controls are, when
used with Access. There is something notoriously odd about the way MS
has Access managing it's windows and on-screen objects that makes it
difficult. The immediate consequence I've seen is that the control will
not retain the size I make it when in design mode - it reverts to it's
default size on the form at runtime. Even some of the MS ActiveX
controls act this way, ones that are perfectly well behaved in VB for
instance. Infragistics (Sheridan + Protoview) doesn't even try to make
their stuff work with Access, it's just too odd, or so they say. It is
doable though; some other firms say their stuff is fine with Access, but
I've not tried them yet.

On the other hand, maybe the difficulty I'm having is a result of some
other ActiveX issue and is not Access specific. I've not been able to
test it in VB 6; there seems to be a naming conflict (there, after
registration via regsvr32, it's presented as a component named "Project
1 Library". In Access it's listed as "VirtualStringTreeX Control").

I'll fool with it some more; but as my interest in using VT with Access
is likely to be unusual, getting it to work for my immediate use should
be a low priority. Maybe someone with more ActiveX chops than I can help
you get this working as an ActiveX control that works properly with (for
instance) VB; and then I can try it with Access, where it'll possibly
have it's own special issues.

Thanks again

Michael Simcich
AccessTools

-----Original Message-----
From: Mike Lischke [mailto:[public@l...]]
Sent: Saturday, June 16, 2001 8:58 AM
To: VirtualTreeview@yahoogroups.com
Subject: RE: [VirtualTreeview] Re: VT vs VET; works with MS Access?

Hi Michael,

> I've since read in this list that there has been recent
> experimentation with converting one or both of the controls to
> ActiveX. But I don't think those efforts are finished or whatever.

Indeed, these efforts are still not finished. I first want to have VT
ready to publish, then I will add ActiveX controls too. There are simply
too many changes which would require a rebuild of the ActiveX controls
all the time.

> Thanks for clearing up the VT/VET thing, sounds like I'd be using VT
> if I can get it to work for me. The project has to be in Access,
> Delphi is not an option.

I have created an ActiveX version of VT and will send it to you
privately as reply to your private mail.

Ciao, Mike

To unsubscribe from this group, send an email to:
VirtualTreeview-unsubscribe@egroups.com

Your use of Yahoo! Groups is subject to
http://docs.yahoo.com/info/terms/

To unsubscribe from this group, send an email to:
VirtualTreeview-unsubscribe@egroups.com

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/


re: problem displaying items in the Virtual Tree as a Stringgrid.

From: "Mark Dekker" [m.dekker@a...]
Date: Mon Jun 18, 2001 10:13 am
Subject: Re: [VirtualTreeview] problem displaying items in the Virtual Tree as a Stringgrid.

Thanx a lot Jim,

For your quick and helpful response. I still have a problem, i don 't know
how to store the index of my record-structure or the item (which has to be
displayed) of my structure in the Virtual Tree. Is there any way to
manipulate or handle the events? Assume the following example:

PItems : ^TItems;
TItems = record
Name : string;
Address : string;
....
end;

Items : array [1..max] of TItems;

I 'd like to display these kind of records in the Virtual Treeview.

Column 1 contains all the names
Colomn 2 contains all the addresses.
And so on.

I understand your handling procedures, but the problem is that i don 't see
how to correctly store the index in the PVirtualNode and i don 't know when
to do this. Maybe VT is not so usefull for my implementation?
Perhaps, i need to find another component? I first used a ListView, but
scrolling with this component is very, very slow when you have large records
with many fields. That 's why i started searching for a better and faster
component than the Listview and i found the VT. Has anybody implemented the
VT as a stringgrid with different fields? (in the "Advanced demo", only the
columns where filled with different values, not the rows).

Thanx already.

Kind Regards,
Mark.

>From: Jim Kueneman [jimdk@m...]
>Reply-To: VirtualTreeview@yahoogroups.com
>To: VirtualTreeview@yahoogroups.com
>Subject: Re: [VirtualTreeview] problem displaying items in the Virtual Tree
as a Stringgrid.
>Date: Fri, 15 Jun 2001 07:08:52 -0700
>
>At 02:30 PM 6/15/2001 +0200, you wrote:
> >Hi,
> >Virtual (string) Tree dynamically, but i don 't know how to use the Node
(of
> >the type PVirtualNode). I have got my own structure (array with records)
and
> >i 'd like to use these for filling the Virtual Tree.
> >Does anybody know how to do this?
>
>Is the array critical? VT, as far as I can tell, is not intended to use a
>data structure like an array or List to store the data like the
>VirtualListview. In VT you never know, or it is very expensive to find,
>the absolute index. VT intends each node to have a data structure assigned
>to a node.
>
>I am assuming each string in the list is to be displayed in a node. I
>creating record type or class and associate a pointer to either with each
node.
>
>
>PMyData: ^TMyData;
>TMyData = packed record
> Caption: string
>end;
>
>
>procedure TForm1.VirtualStringTree1GetNodeDataSize(
> Sender: TBaseVirtualTree; var NodeDataSize: Integer);
>begin
> NodeDataSize := SizeOf(PMyData)
>end;
>
>
>// Create the structure
>
>procedure TForm1.VirtualStringTree1InitNode(Sender: TBaseVirtualTree;
> ParentNode, Node: PVirtualNode;
> var InitialStates: TVirtualNodeInitStates);
>var
> MyData: PMyData
>begin
> // Get the data associated with the node
> MyData := PMyData( Sender.GetNodeData);
> New(MyData); // using new saves some work when freeing the record
that
>contain dynamic strings.
> if assigned(MyData) then
> MyData.Caption := MyStringList[SomeIndex]
>end;
>
>
>// Free the structure
>procedure TForm1.VirtualStringTree1FreeNode(Sender: TBaseVirtualTree;
> Node: PVirtualNode);
>var
> MyData: PMyData
>begin
> MyData := PMyData( Sender.GetNodeData);
> if assigned(MyData) then
> Dispose(MyData);
>end;
>
>// Use the structure to display the text.
>
>procedure TForm1.VirtualStringTree1GetText(Sender: TBaseVirtualTree;
> Node: PVirtualNode; Column: Integer; TextType: TVSTTextType;
> var Text: WideString);
>var
> MyData: PMyData
>begin
> MyData := PMyData( Sender.GetNodeData);
> if assigned(MyData) then
> Text := MyData.Caption
>end;
>
>Another possiblity is to store the index of the string in the node data and
>use it to index the TStringList:
>
>
>PMyData: ^TMyData;
>TMyData = packed record
> StringIndex: integer;
>end;
>
>procedure TForm1.VirtualStringTree1GetText(Sender: TBaseVirtualTree;
> Node: PVirtualNode; Column: Integer; TextType: TVSTTextType;
> var Text: WideString);
>var
> MyData: PMyData
>begin
> MyData := PMyData( Sender.GetNodeData);
> if assigned(MyData) then
> Text := MyStringList[MyData.StringIndex]
>end;
>
>
>Hope that was what you were after.
>
>Jim
>
>
>
>


Property Editors

From: GIANNAKOPOULOS KOSTAS [kyan@s...]
Date: Mon Jun 18, 2001 9:16 am
Subject: Property Editors

Good morning everyone.

After taking a look at Mike's new property editor for ClipboardFormats i
couldn't resist uploading a small and simple design-time package i've
written (kyProps.bpl) that registers some nice looking property editors for
boolean/set and some enumerated properties that (i think) make the object
inspector more readable.

It hasn't much to do with VT, but it might give you some ideas on writing
your own property editors.

The zip file kyProps.zip contains the bpl and the source code.

<KY>

 | Replies | Author | Date
2633 | Re: Property Editors | Mike Lischke | Mon 6/25/2001
2639 | Re: Property Editors | GIANNAKOPOULOS KOSTAS | Mon 6/25/2001


re: IB_VTree

From: [markus.ohlenroth@p...]
Date: Mon Jun 18, 2001 9:44 am
Subject: Re: IB_VTree

hello,
I have installed the TIB_Vtree component for Delphi 5/CS.
I found the TESTIBO.GDB database but only a C-demo.
Does anybody know where to get hold of a delphi example for this
component or any other dataaware-Virtualtree examples for Delphi.
Thanks
Markus Ohlenroth

--- In [VirtualTreeview@y...], "Paul Gallagher" [paul@t...] wrote:
> I have uploaded a demo and the project files of the IB descendant
Virtual Tree control. I would appreciate any and all feedback from
anyone brave enough to try it. I have also included the project exe
file, in case you don't want to install the component, but want to
see what it looks like. Just copy the the TESTIBO.GDB file to
directory c:\IB_VTree.
>
> Paul Gallagher
>
>
> [Non-text portions of this message have been removed]


re: How to get parent data after move

From: [frankvdbergh@y...]
Date: Mon Jun 18, 2001 10:14 am
Subject: Re: How to get parent data after move

Thanks Franz-Leo and Jim for your reaction.
The suggestion below works excellent.
>
> How about saving a reference to the Parent node through OnDragAllow
the
> same way, Node.Parent.
>
>
> Jim


Small Bug?!

From: [zan.trajkov@s...]
Date: Mon Jun 18, 2001 10:22 am
Subject: Small Bug?!

Hi,

I'm looked over the code of VT 2.4.28 and i think i found a bug...

In constructor: Line 8209

{-------------------------------------------------------------------------------\
---------------}

constructor TVTColors.Create(AOwner: TBaseVirtualTree);

begin
FOwner := AOwner;
FColors[0] := clBtnShadow;
FColors[1] := clSilver;
FColors[2] := clHighLight;
FColors[3] := clHighLight;
FColors[4] := clBtnFace;
FColors[5] := clBtnShadow;
FColors[6] := clBtnFace;
FColors[7] := clBtnFace;
FColors[7] := clWindowText; {<-- BUG?!}
end;

{-------------------------------------------------------------------------------\
---------------}

I think the last 'ColorItem' has not the right index.
The index should be '8' not '7'

my 2ct to VT... :-)

v
Zan

PS.: Sorry for my poor english....

 | Replies | Author | Date
2487 | Re: Small Bug?! | Mike Lischke | Mon 6/18/2001


re: Re: New file ... Clipboard Formats

From: Werner Lehmann [wl@b...]
Date: Mon Jun 18, 2001 10:09 am
Subject: Re: [VirtualTreeview] Re: New file ... Clipboard Formats

Stephen Quinn wrote:
>
> Roland
>
> > ... cannot find entry point "Animate Window" in User32.dll ...
> Win2000 and (I think) WinME only

Win2k + 98 and above.

The api function must be linked dynamically. Jim, if you read this
and still want to use AnimateWindow:

type
TAnimateWindow = function(hWnd: HWND; dwTime: DWORD; dwFlags: DWORD): BOOL;
stdcall;

var
AnimateWindowProc: TAnimateWindow = nil;

...

var
Module: HMODULE;
begin
// AnimateWindow is not available on 95/NT4.
Module := GetModuleHandle('user32'); // LoadLibrary not needed, user32 is
always loaded.
if Module <> 0 then
AnimateWindowProc := GetProcAddress(Module, 'AnimateWindow');
...
end;

...

procedure TNodeEdit.FormShow(Sender: TObject);
begin
if assigned(AnimateWindowProc) then
begin
if DropDirection = ddDown then
AnimateWindowProc(Handle, 200, AW_SLIDE or AW_ACTIVATE or AW_VER_POSITIVE)
else
AnimateWindowProc(Handle, 200, AW_SLIDE or AW_ACTIVATE or
AW_VER_NEGATIVE);

// This may be needed to force redrawing of the tree borders, sadly only
after
// the animation was shown. But is hardly visible.
RedrawWindow(Tree.Handle, nil, 0, RDW_INVALIDATE or RDW_FRAME or
RDW_UPDATENOW);
end;
end;

procedure TNodeEdit.FormHide(Sender: TObject);
begin
if assigned(AnimateWindowProc) then
begin
if DropDirection = ddDown then
AnimateWindowProc(Handle, 100, AW_BLEND or AW_HIDE or AW_VER_NEGATIVE)
else
AnimateWindowProc(Handle, 100, AW_BLEND or AW_HIDE or AW_VER_POSITIVE);
end;
end;

Regards,
Werner


re: problem displaying items in the Virtual Tree as a Stringgrid.

From: Werner Lehmann [wl@b...]
Date: Mon Jun 18, 2001 10:28 am
Subject: Re: [VirtualTreeview] problem displaying items in the Virtual Tree as a Stringgrid.

Hi Mark,

> PItems : ^TItems;
> TItems = record
> Name : string;
> Address : string;
> ....
> end;
>
> Items : array [1..max] of TItems;
>
> I 'd like to display these kind of records in the Virtual Treeview.
>
> Column 1 contains all the names
> Colomn 2 contains all the addresses.
> And so on.
>
> I understand your handling procedures, but the problem is that i don 't see
> how to correctly store the index in the PVirtualNode and i don 't know when
> to do this. Maybe VT is not so usefull for my implementation?
> Perhaps, i need to find another component? I first used a ListView, but
> scrolling with this component is very, very slow when you have large records
> with many fields. That 's why i started searching for a better and faster
> component than the Listview and i found the VT. Has anybody implemented the
> VT as a stringgrid with different fields? (in the "Advanced demo", only the
> columns where filled with different values, not the rows).

You can keep your array and still use VT. You have to be careful though. Each
VT node needs some information which leads to the actual data to be displayed.
One possibility, this is the one that Jim suggested, means storing your records
directly into the data area of a TVirtualNode. I recommend this if your data
lives and dies with this single VTree and you only need access via the node
structure.

The other possibility is to only store a reference to your real data into the
virtual node. This can be an index to your array (= Pointer(4711) for example),
it can be the address of your record in the array (= @Items[4711]) or some
other code which can work as a hashing value.

If you use index or pointer you must be sure that both do not change. Especially
do not delete or insert records in the middle of the array. If you want to do
this anytime it'd be better to a TList or TObjectList to store your PItems and
then use pointers to them in the virtual node data area.

One last word about the TListview common control. You can put this into virtual
mode and make it display your array 'by index'. It will be much faster this way.
Please look at the demo for the virtual listview that came with delphi.

The same approach (as for the listview) should also work in the VTree. Each node
record has an index property which you can use to index into your array and
fetch
the data for display. This way you would not need the data field at all. I must
say though that I did not try this in practice and don't know how the
performance
would be. Index is a part of the record and must be calculated anyway, so this
does not slow down. But you may have to call .Invalidate if you insert or delete
or sort your array or .InvalidateNode if you change the data of one record.

Regards,
Werner


Q: Custom background (not Bitmap)

From: [zan.trajkov@s...]
Date: Mon Jun 18, 2001 10:38 am
Subject: Q: Custom background (not Bitmap)

Hi,

I have an problem with custom background.

Problem:

For my TV i need a gradient background.

There it's no problem giving each item the desired background
via BeforeCellPaint() - Event...

but, below the last item the TV is painted with TV.Color ...

Is it possible to access the 'nodefree' - area and fill it with a gradient?

I also tried OnBeforePaint() - Event but no success...

Thanx

v
Zan

 | Replies | Author | Date
2488 | Re: Q: Custom background (not Bitmap) | Mike Lischke | Mon 6/18/2001


Another Bug?!

From: [zan.trajkov@s...]
Date: Mon Jun 18, 2001 10:59 am
Subject: Another Bug?!

Hi,

In VirtualTrees.pas 2.4.28 LINE: 8388

constructor TBaseVirtualTree.Create(AOwner: TComponent);
...

8388: FClipboardFormats := TClipboardFormats.Create(Self);

....

OK, a new object was created, but not freed?!

In 'destructor TBaseVirtualTree.Destroy;'

there ist NO
FClipboardFormats.Free;

is this intended, or is that a BUG?

mfg

v
Zan

 | Replies | Author | Date
2481 | Re: Another Bug?! | Werner Lehmann | Mon 6/18/2001
2483 | Re: Another Bug?! | Teus de Jong | Mon 6/18/2001
2484 | Re: Another Bug?! | [wl@b...] | Mon 6/18/2001
2489 | Re: Another Bug?! | Mike Lischke | Mon 6/18/2001
2495 | Re: Another Bug?! | Teus de Jong | Mon 6/18/2001
2547 | Re: Another Bug?! | Mike Lischke | Wed 6/20/2001
2552 | Re: Another Bug?! | Thierry Parent | Thu 6/21/2001
2553 | Re: Another Bug?! | Teus de Jong | Thu 6/21/2001


re: Another Bug?!

From: Werner Lehmann [wl@b...]
Date: Mon Jun 18, 2001 11:35 am
Subject: Re: [VirtualTreeview] Another Bug?!

[zan.trajkov@s...] wrote:
>
> Hi,
>
> In VirtualTrees.pas 2.4.28 LINE: 8388
>
> constructor TBaseVirtualTree.Create(AOwner: TComponent);
> ...
>
> 8388: FClipboardFormats := TClipboardFormats.Create(Self);
>
> ....
>
> OK, a new object was created, but not freed?!
>
> In 'destructor TBaseVirtualTree.Destroy;'
>
> there ist NO
> FClipboardFormats.Free;
>
> is this intended, or is that a BUG?

The component owner takes care of that. The Free in Destroy is
optional.

Werner


re: Re: New file ... Clipboard Formats

From: Jim Kueneman [jimdk@m...]
Date: Mon Jun 18, 2001 12:45 pm
Subject: Re: [VirtualTreeview] Re: New file ... Clipboard Formats

At 07:26 AM 6/18/2001 +0000, you wrote:
>Good morning Jim,
>
>I download Project1.zip from file-area to show the news about our
>formats, but I cannot run the program.
>
>... cannot find entry point "Animate Window" in User32.dll ...
>
>I work with WinNT4 Sp5.

Sorry about that Roland, dumb mistake. I upload a version that dynamiclly
loads AnimateWindow.

Jim


re: Another Bug?!

From: "Teus de Jong" [teusjdejong@p...]
Date: Mon Jun 18, 2001 4:32 pm
Subject: Re: [VirtualTreeview] Another Bug?!

Werner, Mike,

> > In 'destructor TBaseVirtualTree.Destroy;'
> >
> > there ist NO
> > FClipboardFormats.Free;
> >
> > is this intended, or is that a BUG?
>
> The component owner takes care of that. The Free in Destroy is
> optional.

No, the component owner does not free them. The FClipboardFormats.free must
be in TBaseVirtualTree.Destroy. Could you put it there Mike?

Teus de Jong

 | Replies | Author | Date
2484 | Re: Another Bug?! | [wl@b...] | Mon 6/18/2001


re: Another Bug?!

From: [wl@b...]
Date: Mon Jun 18, 2001 5:16 pm
Subject: Re: Another Bug?!

> No, the component owner does not free them. The
FClipboardFormats.free must
> be in TBaseVirtualTree.Destroy. Could you put it there Mike?

Yes, you're right. I thought, without looking at the source,
that FClipboardFormats was a TComponent.

Werner


re: What to do when GetNodeData(Node) fails ?

From: [yahoo@s...]
Date: Mon Jun 18, 2001 5:33 pm
Subject: Re: What to do when GetNodeData(Node) fails ?

> The most obvious thing I can think of is have you told VT how many
> bytes to reserve for your data? Either through the NodeDataSize
> property (rather inflexable and must remember to change it if the
> data size changes) or through the OnGetDataNodeSize event where you
> can use SizeOf to extract the size of the data at runtime (the best
> way).

Hi Jim,

Thanks for taking the time to help me out here. While the VT clearly
owns very badly it has a tendency to confuse me big time. I just
double checked that i did assign the procedure to OnGetDataNodeSize
and sure enough i did do it, looks like this :

procedure TfrmMainApplication.vtArticlesDisplayGetNodeDataSize
(Sender: TBaseVirtualTree; var NodeDataSize: Integer);
begin
NodeDataSize := SizeOf(TArticlesData);
end;

One strange thing however, i put a breakpoint on the SizeOf line to
make sure it was executed and it seems its not called before it calls
the init node. Is that 'normal' ?

I will keep poking around the DataSize stuff and see what happens,
thanks for the pointer. If you have any other idea im all ears!

-Masial

 | Replies | Author | Date
2486 | Re: What to do when GetNodeData(Node) fails ? | Mike Lischke | Mon 6/18/2001


re: Re: What to do when GetNodeData(Node) fails ?

From: "Mike Lischke" [public@l...]
Date: Mon Jun 18, 2001 6:25 pm
Subject: RE: [VirtualTreeview] Re: What to do when GetNodeData(Node) fails ?

> One strange thing however, i put a breakpoint on the SizeOf line to
> make sure it was executed and it seems its not called before it calls
> the init node. Is that 'normal' ?

You have to assign the value -1 to NodeDataSize to cause VT to trigger
OnGetNodeDataSize. This will
be described in the new help file so others will not have the same trouble
(hopefully).

Ciao, Mike


re: Small Bug?!

From: "Mike Lischke" [public@l...]
Date: Mon Jun 18, 2001 6:28 pm
Subject: RE: [VirtualTreeview] Small Bug?!

Hi Zan,

> FColors[7] := clWindowText; {<-- BUG?!}
> end;

Oops :o] Fixed.

Ciao, Mike


re: Q: Custom background (not Bitmap)

From: "Mike Lischke" [public@l...]
Date: Mon Jun 18, 2001 6:31 pm
Subject: RE: [VirtualTreeview] Q: Custom background (not Bitmap)

Hi Zan,

> Is it possible to access the 'nodefree' - area and fill it with a gradient?

I'm afraid you have to do some tricky work around. VT uses internally a small
backbuffer so it is not possible to erase the real tree background in advance.

Ciao, Mike


re: Another Bug?!

From: "Mike Lischke" [public@l...]
Date: Mon Jun 18, 2001 6:33 pm
Subject: RE: [VirtualTreeview] Another Bug?!

> 8388: FClipboardFormats := TClipboardFormats.Create(Self);
> OK, a new object was created, but not freed?!

Ah, stupid me. Forgot to check this. Btw: can somebody please check with your
favourite memory checker for leaks etc. in the latest source? Thank you in
advance and

Ciao, Mike


re: Build 4.2.28 and D4

From: "Mike Lischke" [public@l...]
Date: Mon Jun 18, 2001 6:40 pm
Subject: RE: [VirtualTreeview] Build 4.2.28 and D4

Teus,

> For the StringList editor you don't have to do anything. If I leave out the
> property-editor, Delphi 4 lists a property TClipboardFormats with well known
> three dots; click on it and you have the strings in an editor.

Mmmh, seems I have to cover this code with a conditional define. :-(

Ciao, Mike


re: Full Collapse Performance (or lack of <g>)

From: "Mike Lischke" [public@l...]
Date: Mon Jun 18, 2001 6:53 pm
Subject: RE: [VirtualTreeview] Full Collapse Performance (or lack of <g>)

Hi Jim,

> I just do not understand why nodes that have never be initialized must be
> initialized to do a full collapse.

Because I have to go through all nodes since the semantic of FullCollapse is to
collapse all nodes
in the tree. It is not named
FullCollapseButWithoutInvisbleOrUnitinitializedNodes but FullCollapse.
You would also not expect FullExpand to touch only initialized nodes, would you?

It is simply so that there are some methods for convinience and backwards
compatibility which have a
large performance penalty. So if you want high performance do not use them (like
FullExpand/Collapse, ValidateNode(nil, True), etc.). Instead use IterateSubtree
and touch only the
nodes you are interested in.

Ciao, Mike


re: Full Collapse Performance (or lack of <g>)

From: Werner Lehmann [wl@b...]
Date: Mon Jun 18, 2001 7:16 pm
Subject: Re: [VirtualTreeview] Full Collapse Performance (or lack of <g>)

Hi Mike,

Mike Lischke wrote:
>
> > I just do not understand why nodes that have never be initialized must be
> > initialized to do a full collapse.
>
> Because I have to go through all nodes since the semantic of FullCollapse is
to collapse all nodes
> in the tree. It is not named
FullCollapseButWithoutInvisbleOrUnitinitializedNodes but FullCollapse.
> You would also not expect FullExpand to touch only initialized nodes, would
you?
>
> It is simply so that there are some methods for convinience and backwards
compatibility which have a
> large performance penalty. So if you want high performance do not use them
(like
> FullExpand/Collapse, ValidateNode(nil, True), etc.). Instead use
IterateSubtree and touch only the
> nodes you are interested in.

risking the danger of making you angry about me I second Jim's proposal,
although I
do not need FullCollapse. What I don't understand is how vsExpanded in the node
state
is related to vsInitialized. A node can be expanded but not initialized and
vice versa.
Therefore I don't get the reason why you call InitChildren(Node). I mean if the
condition
(vsHasChildren in Node.States) and (Node.ChildCount = 0) holds then one can
expect that
this node is not expanded, or am I wrong? And that it has no 'real' child nodes.

Regards,
Werner

 | Replies | Author | Date
2493 | Re: Full Collapse Performance (or lack of <g>) | Mike Lischke | Mon 6/18/2001
2494 | Re: Full Collapse Performance (or lack of <g>) | Jim Kueneman | Mon 6/18/2001
2500 | Re: Full Collapse Performance (or lack of <g>) | Werner Lehmann | Mon 6/18/2001
2548 | Re: Full Collapse Performance (or lack of <g>) | Mike Lischke | Wed 6/20/2001
2563 | Re: Full Collapse Performance (or lack of <g>) | Werner Lehmann | Thu 6/21/2001
2565 | Re: Full Collapse Performance (or lack of <g>) | Jim Kueneman | Fri 6/22/2001
2571 | Re: Full Collapse Performance (or lack of <g>) | Werner Lehmann | Fri 6/22/2001


re: Full Collapse Performance (or lack of <g>)

From: "Mike Lischke" [public@l...]
Date: Mon Jun 18, 2001 7:21 pm
Subject: RE: [VirtualTreeview] Full Collapse Performance (or lack of <g>)

Hi Werner,

> What I don't understand is how vsExpanded in the node state
> is related to vsInitialized.

This is not related. I have not said anything in this direction.

>A node can be expanded but not initialized and vice versa.

Indeed.

> Therefore I don't get the reason why you call InitChildren(Node). I mean if
the condition
> (vsHasChildren in Node.States) and (Node.ChildCount = 0) holds then one can
expect that
> this node is not expanded, or am I wrong? And that it has no 'real' child
nodes.

The point is not to have a node initialized because it is expanded or something
like this, but it is
initialized because it might have got child nodes which must be
expanded/collapsed too. The name of
the method is FullCollapse, not PartialCollapse ;o)

Ciao, Mike

 | Replies | Author | Date
2494 | Re: Full Collapse Performance (or lack of <g>) | Jim Kueneman | Mon 6/18/2001


re: Full Collapse Performance (or lack of <g>)

From: "Jim Kueneman" [jimdk@m...]
Date: Mon Jun 18, 2001 7:57 pm
Subject: Re: Full Collapse Performance (or lack of <g>)

--- In [VirtualTreeview@y...], "Mike Lischke" [public@l...] wrote:
> The point is not to have a node initialized because it is expanded
or something like this, but it is
> initialized because it might have got child nodes which must be
expanded/collapsed too. The name of
> the method is FullCollapse, not PartialCollapse ;o)

Mike,

Sorry, I guess I need to study how VT works a bit more, it is
obvious I am unclear about the relationship between and Initalized
Nodes, Visible Nodes, Nodes with ChildCount = 0, and Expanded Nodes.

Jim


re: Another Bug?!

From: "Teus de Jong" [teusjdejong@p...]
Date: Mon Jun 18, 2001 8:29 pm
Subject: Re: [VirtualTreeview] Another Bug?!

Mike,

> Ah, stupid me. Forgot to check this. Btw: can somebody please check with
your favourite memory checker for leaks etc. in the latest source? Thank you
in advance and

I tested the latest version with CodeWatcher and didn't find any other leaks
than the FClipboardformats. (But, of course, I don't use every corner of
VT.)

Teus de Jong.


OnStartDrag

From: "Vadim Sedulin" [wsntrl@o...]
Date: Mon Jun 18, 2001 3:49 pm
Subject: OnStartDrag

Hello Mike!

Where is OnStartDrag in OLE d&d?

Bye.

Vadim Sedulin
E-Mail: [wsntrl@o...]

 | Replies | Author | Date
2502 | Re: OnStartDrag | Jim Kueneman | Tue 6/19/2001
2507 | Re: OnStartDrag | Vadim Sedulin | Tue 6/19/2001
2508 | Re: OnStartDrag | Jim Kueneman | Tue 6/19/2001
2533 | Re: OnStartDrag | Vadim Sedulin | Tue 6/19/2001
2544 | Re: OnStartDrag | Mike Lischke | Wed 6/20/2001
2554 | Re: OnStartDrag | Teus de Jong | Thu 6/21/2001


re: problem displaying items in the Virtual Tree as a Stringgrid.

From: "Vadim Sedulin" [wsntrl@o...]
Date: Mon Jun 18, 2001 9:08 pm
Subject: Re: [VirtualTreeview] problem displaying items in the Virtual Tree as a Stringgrid.

Hello All!

----- Original Message -----
From: Jim Kueneman
To: [VirtualTreeview@yahoogroups.com
Sent: 15 ???? 2001 ?. 18:08
Subject: Re: [VirtualTreeview] problem displaying items in the Virtual Tree
as a Stringgrid.

At 02:30 PM 6/15/2001 +0200, you wrote:
>>Hi,
>>Virtual (string) Tree dynamically, but i don 't know how to use the Node
(of
>>the type PVirtualNode). I have got my own structure (array with records)
and
>>i 'd like to use these for filling the Virtual Tree.
>>Does anybody know how to do this?

[ skip ]

====

> PMyData: ^TMyData;
> TMyData = packed record
> Caption: string
> end;

> procedure TForm1.VirtualStringTree1GetNodeDataSize(
> Sender: TBaseVirtualTree; var NodeDataSize: Integer);
> begin

NodeDataSize := SizeOf(TMyData)

> end;
>
>
> // Create the structure
>
> procedure TForm1.VirtualStringTree1InitNode(Sender: TBaseVirtualTree;
> ParentNode, Node: PVirtualNode;
> var InitialStates: TVirtualNodeInitStates);
> var
> MyData: PMyData
> begin
> // Get the data associated with the node
> MyData := Sender.GetNodeData (Node);

Initialize(MyData^);

> MyData.Caption := MyStringList[SomeIndex]
> end;
>
>
> // Free the structure
> procedure TForm1.VirtualStringTree1FreeNode(Sender: TBaseVirtualTree;
> Node: PVirtualNode);
> begin

Finalize (PMyData(Sender.GetNodeData (Node))^);

> end;

> // Use the structure to display the text.
>
> procedure TForm1.VirtualStringTree1GetText(Sender: TBaseVirtualTree;
> Node: PVirtualNode; Column: Integer; TextType: TVSTTextType;
> var Text: WideString);
> begin

Text := PMyData(Sender.GetNodeData(Node))^.Caption;

> end;

==== OR ====

PMyData: ^TMyData;
TMyData = record
Caption: string
// Other data
end;

procedure TForm1.VirtualStringTree1GetNodeDataSize(
Sender: TBaseVirtualTree; var NodeDataSize: Integer);
begin
NodeDataSize := SizeOf(TMyData)
end;

procedure TForm1.VirtualStringTree1InitNode(Sender: TBaseVirtualTree;
ParentNode, Node: PVirtualNode;
var InitialStates: TVirtualNodeInitStates);
begin
Initialize(PMyData(Sender.GetNodeData (Node))^);
end;

procedure TForm1.VirtualStringTree1FreeNode(Sender: TBaseVirtualTree;
Node: PVirtualNode);
begin
Finalize (PMyData(Sender.GetNodeData (Node))^);
end;

procedure TForm1.VirtualStringTree1GetText(Sender: TBaseVirtualTree;
Node: PVirtualNode; Column: Integer; TextType: TVSTTextType;
var Text: WideString);
begin
Text := PMyData(Sender.GetNodeData(Node))^.Caption;
end;

procedure TForm1.AddNode (Parent: PVirtualNode; const Caption: String);
var
NewNode: PVirtualNode;
NewNodeData: PMyData
begin
NewNode := Tree.AddChild (Parent);
Tree.ReinitNode (NewNode, False);
NewNodeData := Tree.GetNodeData(NewNode);
NewNodeData^.Caption := Caption;
end;

====

Much better, isn't it?

Bye.

Vadim Sedulin
E-Mail: wsntrl@o...]


re: Re: What to do when GetNodeData(Node) fails ?

From: "Vadim Sedulin" [wsntrl@o...]
Date: Mon Jun 18, 2001 9:43 pm
Subject: Re: [VirtualTreeview] Re: What to do when GetNodeData(Node) fails ?

Hello Mike!

----- Original Message -----
From: Mike Lischke
To: [VirtualTreeview@yahoogroups.com
Sent: 18 ???? 2001 ?. 22:25
Subject: RE: [VirtualTreeview] Re: What to do when GetNodeData(Node) fails ?

>> One strange thing however, i put a breakpoint on the SizeOf line to
>> make sure it was executed and it seems its not called before it calls
>> the init node. Is that 'normal' ?
>
> You have to assign the value -1 to NodeDataSize to cause VT to trigger
OnGetNodeDataSize. This will
> be described in the new help file so others will not have the same trouble
(hopefully).

You had better change the default value to -1, i think.

Bye.

Vadim Sedulin
E-Mail: wsntrl@o...]


Using VT in DLL and ShowModal, Help appreciated

From: [d.lindsey@d...]
Date: Mon Jun 18, 2001 9:57 pm
Subject: Using VT in DLL and ShowModal, Help appreciated

Hi,
I have a series of DLLs. Each DLL is nearly exactly the same, the
exception being the data loaded. The DLL brings up a VTree of
reference data via ShowModal, user selects and DLL closes form via
ModalResult := mrOK; The VTree is in a frame so it can be used
elsewhere, the databases are almost the same just different data. All
DLLs close fine except one. This problematic DLL requires you to
click the close button twice to actually close the form. I tried to
follow the logic of VTree but it is too complicated, it just goes
through a number of cleanups and then back to my FormActivate
procedure - but only on the first click of the button, subsequent
click it behaves properly. The only differnece I can see is that the
data used in this DLL creates slightly more nodes. I don't know if it
VTree or not! I have tried clearing the tree before setting the
modalresult but this didn't help. Any suggestions would be
appreciated because I need to finish the system and this is a big
problem for a user.
Thanks in Advance
David Lindsey


re: Full Collapse Performance (or lack of <g>)

From: Werner Lehmann [wl@b...]
Date: Mon Jun 18, 2001 8:45 pm
Subject: Re: [VirtualTreeview] Full Collapse Performance (or lack of <g>)

Hi Mike,

> > What I don't understand is how vsExpanded in the node state
> > is related to vsInitialized.
>
> This is not related. I have not said anything in this direction.

Ok.

> >A node can be expanded but not initialized and vice versa.
>
> Indeed.
>
> > Therefore I don't get the reason why you call InitChildren(Node). I mean if
the condition
> > (vsHasChildren in Node.States) and (Node.ChildCount = 0) holds then one can
expect that
> > this node is not expanded, or am I wrong? And that it has no 'real' child
nodes.
>
> The point is not to have a node initialized because it is expanded or
something like this, but it is
> initialized because it might have got child nodes which must be
expanded/collapsed too. The name of
> the method is FullCollapse, not PartialCollapse ;o)

Ok. Let's assume we have a node which is not intialized and which has "child
nodes which must be
expanded/collapsed". Why can't we collapse these child nodes recursively
without prior initialization
of the node. As you confirmed initialized is not related to expanded.

It seems we are not getting anywhere on this topic, always the same question
and answer. Well, as
I said I am not using FullCollapse (and if so, all nodes are initialized
anyway). Therefore I will
stop hammering you with the same question over and over again :) I don't expect
a reply to this
if everything has been said already.

Regards,
Werner


re: Re: New file ... Clipboard Formats

From: "Peter Danich" [Support@d...]
Date: Tue Jun 19, 2001 2:16 am
Subject: Re: [VirtualTreeview] Re: New file ... Clipboard Formats

hi Jim,
I would also be very interested in this AnimateWindow solution. Will it be
similar to the lib 'Billenium Effects'?
...and will you upload it to the public area of this group?

Peter
----- Original Message -----
From: Jim Kueneman
To: VirtualTreeview@yahoogroups.com
Sent: Monday, June 18, 2001 2:45 PM
Subject: Re: [VirtualTreeview] Re: New file ... Clipboard Formats

At 07:26 AM 6/18/2001 +0000, you wrote:
>Good morning Jim,
>
>I download Project1.zip from file-area to show the news about our
>formats, but I cannot run the program.
>
>... cannot find entry point "Animate Window" in User32.dll ...
>
>I work with WinNT4 Sp5.

Sorry about that Roland, dumb mistake. I upload a version that dynamiclly
loads AnimateWindow.

Jim

Yahoo! Groups Sponsor

To unsubscribe from this group, send an email to:
VirtualTreeview-unsubscribe@egroups.com

Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.

[Non-text portions of this message have been removed]

 | Replies | Author | Date
2505 | Re: New file ... Clipboard Formats | Jim Kueneman | Tue 6/19/2001


re: OnStartDrag

From: Jim Kueneman [jimdk@m...]
Date: Tue Jun 19, 2001 2:31 am
Subject: Re: [VirtualTreeview] OnStartDrag

At 07:49 PM 6/18/2001 +0400, you wrote:
>Hello Mike!
>
>Where is OnStartDrag in OLE d&d?

Will OnDragAllowed work?

Jim


Correct VirtualTree/VET Match

From: Kim Bracknell [kbracknell@f...]
Date: Tue Jun 19, 2001 2:31 am
Subject: Correct VirtualTree/VET Match

Hi there,
The latest version of VET available for download is 1.4.24 - what version of
VirtualTree should this be installed with? 2.4.28 is available on site - I
have 2.4.21 and 2.4.25 already downloaded. 2.4.25 gives errors when I
attempt to compile. Is there a version 2.4.24 that matches the 1.4.24
version of VET? If so, could someone possibly provide me with a copy?
TIA,
Kim.

Kim Bracknell
Information Services Manager
Office of the Information Commissioner
Level 21 Exchange Plaza
2 The Esplanade
PERTH WA 6000
Ph: (618) 92207817
Fx: (618) 93252152
Email: mailto:[kbracknell@f...]

DISCLAIMER:
This page, and any accompanying document, contains confidential information
intended for a specific individual and purpose. This information is private
and protected by law. If you are not the intended recipient you are hereby
notified that any disclosure/copying or distribution, or the taking of any
action based on, or any other use of, the information contained in this
electronic mail transmission is strictly prohibited. If you are not the
intended recipient please: a) advise this office by return mail that an
electronic mail transmission has been received in error; and b) destroy the
transmission forthwith.

 | Replies | Author | Date
2504 | Re: Correct VirtualTree/VET Match | Kim Bracknell | Tue 6/19/2001
2506 | Re: Correct VirtualTree/VET Match | Jim Kueneman | Tue 6/19/2001


re: Correct VirtualTree/VET Match

From: Kim Bracknell [kbracknell@f...]
Date: Tue Jun 19, 2001 2:52 am
Subject: RE: [VirtualTreeview] Correct VirtualTree/VET Match

PS: The reason I ask is that whenever I run the VET demo and right-click on
a node the application gives an ErangeError followed by an AV.
Thanks,
Kim.

-----Original Message-----
From: Kim Bracknell [mailto:[kbracknell@f...]]
Sent: Tuesday, 19 June 2001 10:31 AM
To: [VirtualTreeview@yahoogroups.com
Subject: [VirtualTreeview] Correct VirtualTree/VET Match

Hi there,
The latest version of VET available for download is 1.4.24 - what version of
VirtualTree should this be installed with? 2.4.28 is available on site - I
have 2.4.21 and 2.4.25 already downloaded. 2.4.25 gives errors when I
attempt to compile. Is there a version 2.4.24 that matches the 1.4.24
version of VET? If so, could someone possibly provide me with a copy?
TIA,
Kim.

Kim Bracknell
Information Services Manager
Office of the Information Commissioner
Level 21 Exchange Plaza
2 The Esplanade
PERTH WA 6000
Ph: (618) 92207817
Fx: (618) 93252152
Email: mailto:kbracknell@f...]

DISCLAIMER:
This page, and any accompanying document, contains confidential information
intended for a specific individual and purpose. This information is private
and protected by law. If you are not the intended recipient you are hereby
notified that any disclosure/copying or distribution, or the taking of any
action based on, or any other use of, the information contained in this
electronic mail transmission is strictly prohibited. If you are not the
intended recipient please: a) advise this office by return mail that an
electronic mail transmission has been received in error; and b) destroy the
transmission forthwith.

To unsubscribe from this group, send an email to:
VirtualTreeview-unsubscribe@egroups.com

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/

 | Replies | Author | Date
2506 | Re: Correct VirtualTree/VET Match | Jim Kueneman | Tue 6/19/2001


re: Re: New file ... Clipboard Formats

From: Jim Kueneman [jimdk@m...]
Date: Tue Jun 19, 2001 3:18 am
Subject: Re: [VirtualTreeview] Re: New file ... Clipboard Formats

At 04:16 AM 6/19/2001 +0200, you wrote:
>hi Jim,
>I would also be very interested in this AnimateWindow solution. Will it be
>similar to the lib 'Billenium Effects'?
>...and will you upload it to the public area of this group?

First I had to see what that was! Second I doubt if it will be anything
close to the what that component can do! Yes I will most likely just put
it in the VET component unit.

It is not at the top of the list so don't hold you breath!

Jim


re: Correct VirtualTree/VET Match

From: Jim Kueneman [jimdk@m...]
Date: Tue Jun 19, 2001 3:32 am
Subject: RE: [VirtualTreeview] Correct VirtualTree/VET Match

At 10:52 AM 6/19/2001 +0800, you wrote:
>PS: The reason I ask is that whenever I run the VET demo and right-click on
>a node the application gives an ErangeError followed by an AV.
>Thanks,
>Kim.

Kim,

Currently VET only will work with 2.4.21 and yes I know about the
erangeError. I have this fixed but I need Mikes next release of VT with a
few changes to 2.4.28 to finally get the OLE drag/drop working again, VT
went through a major overhaul in this area and the kinks are still getting
worked out. The AV is suprising. Does it AV if you turn off the Range
Checking? It is my fault for develping the entire component without using
Range Checking. Shame on me.

Oops, never mind I see the AV problem, can't cast a WideString to a
PChar! Are you trying to use the filters? Will be fixed in the next version.

Jim


re: OnStartDrag

From: "Vadim Sedulin" [wsntrl@o...]
Date: Tue Jun 19, 2001 4:22 am
Subject: Re: [VirtualTreeview] OnStartDrag

Hello!

>> Where is OnStartDrag in OLE d&d?
>
> Will OnDragAllowed work?

I don't think so. I need both OnStartDrag and OnEndDrag, but AFAIK
OnDragAllowed does not guarantee start of the d&d operation even if Allowed
= true.

Bye.

Vadim Sedulin
E-Mail: [wsntrl@o...]

 | Replies | Author | Date
2508 | Re: OnStartDrag | Jim Kueneman | Tue 6/19/2001


re: OnStartDrag

From: Jim Kueneman [jimdk@m...]
Date: Tue Jun 19, 2001 4:48 am
Subject: Re: [VirtualTreeview] OnStartDrag

At 08:22 AM 6/19/2001 +0400, you wrote:

>I don't think so. I need both OnStartDrag and OnEndDrag, but AFAIK
>OnDragAllowed does not guarantee start of the d&d operation even if Allowed
>= true.

In the new version you can use OnCreateDataObject to trigger when the drag
starts (as VT creates this right at the call to ActiveX.DoDragDrop) and
return nil so VT will create its own DragObject.

To catch the DragEnd you can create your own Decendant of TTVDragObject,
and return it in the above, and override Destroy to signal when the object
is destroyed after returning from DoDragDrop.

It may work but it is not very pretty. There a tsOLEDragging state flag in
TreeStates.

Jim


Virtual Tree as a Stringgrid, one node = one cell?

From: "Mark Dekker" [yourfantasy50@h...]
Date: Tue Jun 19, 2001 7:25 am
Subject: Virtual Tree as a Stringgrid, one node = one cell?

Hello everybody!

Jim, Vadim, Werner and others (i won 't forget anyone(!)),
thanx for your great support and suggestions!I really appriciate that!
I think the VT is a great component and i have an idea how to implement it
as a kind of stringgrid. I still have some questions. In VT, you have to
specify the maximum amount of nodes, is this value the maximum amount of
root-nodes or is it the maximum amount of nodes that are in the Tree? As you
have already seen, i 'd like to use the VT as a kind of stringgrid. I can
add my own data in each node. So do i have to add my own data of one row in
the grid in each node? (if the nodes are root-nodes?)
Or am i thinking wrong and each node means one cell in the VT as a kind of
stringgrid. Another problem i have is the index of the list which i use in
my stringlist. How can i keep track of the index using the event handlers of
the VT? In the Initnode (see below) is the caption (which is the displayitem
of a cell in the VT as a stringgrid) mentioned and initialized with
SomeIndex. Do i need to use a global counter variable to keep track of the
index? I am wondering if that 's the correct solution. You don 't know when
the eventhandlers are called, they are called when the VT sends a message.
It 's difficult to understand that for me.

>From: "Vadim Sedulin" [wsntrl@o...]
>Reply-To: VirtualTreeview@yahoogroups.com
>To: <VirtualTreeview@yahoogroups.com>
>Subject: Re: [VirtualTreeview] problem displaying items in the Virtual Tree
>as a Stringgrid.
>Date: Tue, 19 Jun 2001 01:08:40 +0400
>
>Hello All!
>
>[ skip ]
>
>====
>
> > PMyData: ^TMyData;
> > TMyData = packed record
> > Caption: string
> > end;
>
> > procedure TForm1.VirtualStringTree1GetNodeDataSize(
> > Sender: TBaseVirtualTree; var NodeDataSize: Integer);
> > begin
>
> NodeDataSize := SizeOf(TMyData)
>
> > end;
> >
> >
> > // Create the structure
> >
> > procedure TForm1.VirtualStringTree1InitNode(Sender: TBaseVirtualTree;
> > ParentNode, Node: PVirtualNode;
> > var InitialStates: TVirtualNodeInitStates);
> > var
> > MyData: PMyData
> > begin
> > // Get the data associated with the node
> > MyData := Sender.GetNodeData (Node);
>
> Initialize(MyData^);
>
> > MyData.Caption := MyStringList[SomeIndex]
> > end;

>Much better, isn't it?
>
>Bye.
>
>Vadim Sedulin

I think your implementation is more convenient, thanx again, Vadim!

Kind Regards,
Mark Dekker.

_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.


dataaware VirtualTreeview examples

From: Markus Ohlenroth [markus.ohlenroth@p...]
Date: Tue Jun 19, 2001 8:11 am
Subject: dataaware VirtualTreeview examples

hello,
does anybody know of any examples of a dataaware-VT. It could be either IBO
or IBX.
Many thanks in advance
Markus
__________________________________________________

Dr. Markus Ohlenroth

EDV-Beratung Phil I/II
Universitaet Augsburg
Unversitaetsstr. 10

86159 Augsburg

 | Replies | Author | Date
2513 | Re: dataaware VirtualTreeview examples | Roland | Tue 6/19/2001
2516 | Re: dataaware VirtualTreeview examples | Markus Ohlenroth | Tue 6/19/2001
2518 | Re: dataaware VirtualTreeview examples | Jim Kueneman | Tue 6/19/2001


VET bug in D4 : wrong typecasting

From: [FRiviR2@a...]
Date: Tue Jun 19, 2001 10:31 am
Subject: VET bug in D4 : wrong typecasting

Hi Jim,

I can not install VET 1.4.24 in D4, I have to modify few lines to get
it works...

In VirtualExplorerTree.pas, you declare :

procedure MenuSelect(Msg, wParam, lParam: Longint; var Result:
LRESULT);

and in implementation, you have :

procedure TContextMenuManager.MenuSelect(Msg, wParam, lParam: Integer;
var Result: LRESULT);

but in code, you use :

if HiWord(wParam) and MF_POPUP <> 0 then
ChildMenu := GetSubMenu(lParam, LoWord(wParam))
else
ChildMenu := 0;
Owner.DoContextMenuSelect(NS, LoWord(wParam), ChildMenu,
HiWord(wParam) and MF_MOUSESELECT <> 0);

there is an error in range checking. In order to get it work, I have
replaced all occurences of "HiWord(wParam)" and "LoWord(wParam)" by
"HiWord(Word(wParam))" and "LoWord(Word(wParam))".

Can you check this out ? I don't know if this matter regarding the
other versions of Delphi...

FYI : I run VET with VT 1.4.23, and OLE drag'n'drop works fine, and
also context-menu handling.

Greetings,

rançois Rivierre

 | Replies | Author | Date
2517 | Re: VET bug in D4 : wrong typecasting | Jim Kueneman | Tue 6/19/2001


VET feature request

From: [FRiviR2@a...]
Date: Tue Jun 19, 2001 10:39 am
Subject: VET feature request

Hi Jim,

is it possible to add a property to manage the captions of columns ?
I want to add multiple langauges support to my app, and I think it
could be interesting to have an object property to do that...

This kind of stuff :

TVETConts
Columnfilename : string;
ColumnSize: string;
...
KBtext: string;

The last is because I don't know how to change the texte 'KB' in the
size column, without modifiying the source code :o(

What do you think about this ?

TIA

François Rivierre

 | Replies | Author | Date
2514 | Re: VET feature request | GIANNAKOPOULOS KOSTAS | Tue 6/19/2001
2515 | Re: VET feature request | Roland | Tue 6/19/2001
2520 | Re: VET feature request | Jim Kueneman | Tue 6/19/2001
2521 | Re: VET feature request | Jim Kueneman | Tue 6/19/2001
2523 | Re: VET feature request | GIANNAKOPOULOS KOSTAS | Tue 6/19/2001
2525 | Re: VET feature request | Mike Lischke | Tue 6/19/2001
2535 | Re: VET feature request | [FRiviR2@a...] | Tue 6/19/2001
2578 | Re: VET feature request | Mike Lischke | Fri 6/22/2001
2786 | Re: VET feature request | Jim Kueneman | Sat 6/30/2001


re: dataaware VirtualTreeview examples

From: "Roland" [Beduerftig@S...]
Date: Tue Jun 19, 2001 10:48 am
Subject: Re: dataaware VirtualTreeview examples

--- In [VirtualTreeview@y...], Markus Ohlenroth [markus.ohlenroth@p...]
wrote:
> hello,
> does anybody know of any examples of a dataaware-VT. It could be
either IBO
> or IBX.
> Many thanks in advance
> Markus
> __________________________________________________
>
> Dr. Markus Ohlenroth
>
> EDV-Beratung Phil I/II
> Universitaet Augsburg
> Unversitaetsstr. 10
>
> 86159 Augsburg

Hi,

look at files area.

Roland

 | Replies | Author | Date
2516 | Re: dataaware VirtualTreeview examples | Markus Ohlenroth | Tue 6/19/2001


re: VET feature request

From: GIANNAKOPOULOS KOSTAS [kyan@s...]
Date: Tue Jun 19, 2001 10:51 am
Subject: RE: [VirtualTreeview] VET feature request

> is it possible to add a property to manage the captions of columns ?
> I want to add multiple langauges support to my app, and I think it
> could be interesting to have an object property to do that...
>
> This kind of stuff :
>
> TVETConts
> Columnfilename : string;
> ColumnSize: string;
> ...

This would be better handled if you used my "TVirtualExplorerTreeColumn"
approach, don't you think Jim?

Maybe it's time to put some pressure on Mike to get the CreateColumn virtual
method? After all it's only 4-6 lines of code to be changed...

<KY>


re: VET feature request

From: "Roland" [Beduerftig@S...]
Date: Tue Jun 19, 2001 11:10 am
Subject: Re: VET feature request

> This kind of stuff :
>
> TVETConts
> Columnfilename : string;
> ColumnSize: string;
> ...
> KBtext: string;
>
> The last is because I don't know how to change the texte 'KB' in
the
> size column, without modifiying the source code :o(
>
> What do you think about this ?

Hi,

we discuss this things in message 1843, 1847 and 1848. I ask Steffen
how to add a column and modify the caption of this column.

The same way you can use to modify for the language support.

Bye
Roland


re: Re: dataaware VirtualTreeview examples

From: Markus Ohlenroth [markus.ohlenroth@p...]
Date: Tue Jun 19, 2001 10:40 am
Subject: Re: [VirtualTreeview] Re: dataaware VirtualTreeview examples

Roland,
thanks for the answer. Yes, I had taken a look there.
I only found one delphi example within the files example the one included
within the ibvtree226.zip
And that one, unfortunately, does not work. I wondered if there were any
other examples for delphi.
Mark

At 10:48 19.06.01 -0000, you wrote:
> <>
> wrote:
>> hello,
>> does anybody know of any examples of a dataaware-VT. It could be
> either IBO
>> or IBX.
>> Many thanks in advance
>> Markus
>> __________________________________________________
>>
>> Dr. Markus Ohlenroth
>>
>> EDV-Beratung Phil I/II
>> Universitaet Augsburg
>> Unversitaetsstr. 10
>>
>> 86159 Augsburg
>
> Hi,
>
> look at files area.
>
> Roland
>
>
> Yahoo! Groups Sponsor
> To unsubscribe from this group, send an email to:
> VirtualTreeview-unsubscribe@egroups.com
>
>
>
> Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
__________________________________________________

Dr. Markus Ohlenroth

EDV-Beratung Phil I/II
Universitaet Augsburg
Unversitaetsstr. 10

86159 Augsburg


re: VET bug in D4 : wrong typecasting

From: Jim Kueneman [jimdk@m...]
Date: Tue Jun 19, 2001 12:30 pm
Subject: Re: [VirtualTreeview] VET bug in D4 : wrong typecasting

At 10:31 AM 6/19/2001 +0000, you wrote:
>there is an error in range checking. In order to get it work, I have
>replaced all occurences of "HiWord(wParam)" and "LoWord(wParam)" by
>"HiWord(Word(wParam))" and "LoWord(Word(wParam))".

There are a number of stupid LongWord - Integer problem with the context
menu stuff. They should all be fixed in the next version.

>FYI : I run VET with VT 1.4.23, and OLE drag'n'drop works fine, and
>also context-menu handling.

Ok, then that is the highest version of VT that work with it then. Thanks,

Jim


re: Re: dataaware VirtualTreeview examples

From: Jim Kueneman [jimdk@m...]
Date: Tue Jun 19, 2001 12:34 pm
Subject: Re: [VirtualTreeview] Re: dataaware VirtualTreeview examples

At 12:40 PM 6/19/2001 +0200, you wrote:
>Roland,
>thanks for the answer. Yes, I had taken a look there.
>I only found one delphi example within the files example the one included
>within the ibvtree226.zip
>And that one, unfortunately, does not work. I wondered if there were any
>other examples for delphi.

Chuck Belanger has updated this to work with the new VT version maybe he
could be pursuaded to post his updated version if we say PLEASE nicely?

Jim


Antwort: RE: Q: Custom background (not Bitmap)

From: [zan.trajkov@s...]
Date: Tue Jun 19, 2001 12:44 pm
Subject: Antwort: RE: [VirtualTreeview] Q: Custom background (not Bitmap)

Hi,

I'm looks over the TBaseVirtualTree.PaintTree - procedure and found a
solution for me:

I'm simply introduce a new Event :

TVTBackgroundPaintEvent = procedure(ACanvas : TCanvas; R: TRect) of object;

In PaintTree both parameters are available and I only check, if the event
is assigned....

This occurs now in LINE: 17283ff (VT 2.4.28)

{---------------------------------------------------}
{MODIFIED}
if Assigned(FOnBackgroundPaint) then
begin
FOnBackgroundPaint(TargetCanvas, TargetRect);
end else
begin
{---------------------------------------------------}
//NORMAL Background-Code......
if UseBackground then
...
end;
{---------------------------------------------------}

if DrawSelectionRect then
....

If not assigned, then the normal Code below LINE: 17282 (VT 2.4.28) are
executed....

Is there any chance, to include such a event into the official
VT-Distribution?
I think other user may have similar needs.....

mfg

v
Zan

 | Replies | Author | Date
2632 | Re: Antwort: RE: [VirtualTreeview] Q: Custom back | Mike Lischke | Mon 6/25/2001


re: VET feature request

From: Jim Kueneman [jimdk@m...]
Date: Tue Jun 19, 2001 12:53 pm
Subject: Re: [VirtualTreeview] VET feature request

At 10:39 AM 6/19/2001 +0000, you wrote:
>Hi Jim,
>
>is it possible to add a property to manage the captions of columns ?
>I want to add multiple langauges support to my app, and I think it
>could be interesting to have an object property to do that...
>
>This kind of stuff :
>
> TVETConts
> Columnfilename : string;
> ColumnSize: string;
> ...
> KBtext: string;

The columns are a problem. I do like KY's solution but it would takes
Mikes cooporation. I am getting more reluctant to change much as a number
of people are already working around this (see Roland's post) and what I
would do may cause these folks code to break.

I need to think about it.

For the KB text just override OnGetVETText looking for the Size column
number (1) then use Namespace.SizeOfFileInt64 to get the file and format it
anyway you like, or use Namespace.SizeOfFileKB and change the "KB" on the end.

The ColumnText, and Column width can be set in code per Roland's post.

Jim


re: VET feature request

From: Jim Kueneman [jimdk@m...]
Date: Tue Jun 19, 2001 12:54 pm
Subject: RE: [VirtualTreeview] VET feature request

At 01:51 PM 6/19/2001 +0300, you wrote:

>Maybe it's time to put some pressure on Mike to get the CreateColumn virtual
>method? After all it's only 4-6 lines of code to be changed...

After the FullCollapse discussion I think I had better not push Mike much
right now <g>.

Jim


Save to Text File

From: "Ernest Fairchild" [efairchild@h...]
Date: Tue Jun 19, 2001 1:09 pm
Subject: Save to Text File

I hope this hasn't been asked a hundred times. I'm new to the list ;-).

Anyway, I need to save a VirtualStringTree to a text file. The SaveToFile()
method doesn't quite do it. I just need one line per node with the text. My
tree is a simple one-column thing. Any ideas, code examples? BTW, I'm using
Delphi 4.

Have a great day!

Ernest
([efairchild@h...])

_____________________
"Law -- a subject that seems to serve two purposes: two make lawyers rich
and to make more lawyers."

Visit my website at http://www.public.asu.edu/~ernestf

 | Replies | Author | Date
2531 | Re: Save to Text File | Werner Lehmann | Tue 6/19/2001
2532 | Re: Save to Text File | Ernest Fairchild | Tue 6/19/2001
2631 | Re: Save to Text File | Mike Lischke | Mon 6/25/2001


re: VET feature request

From: GIANNAKOPOULOS KOSTAS [kyan@s...]
Date: Tue Jun 19, 2001 1:18 pm
Subject: RE: [VirtualTreeview] VET feature request

> The columns are a problem. I do like KY's solution but it
> would takes
> Mikes cooporation. I am getting more reluctant to change
> much as a number
> of people are already working around this (see Roland's post)
> and what I
> would do may cause these folks code to break.

There is a solution to aviod breaking other people's code:
- Keep the data type TVisibleColumns.
- Override TComponent.DefineProperties in such a way that if there is a
"VisibleColumns" property in the stream read it (see TReader.ReadSet to see
how to do it) and create the appropriate columns. Do not specify a write
procedure in DefineProperty, so property VisibleColumns will not be saved
the next time the component is saved to a stream.

This way any previous version of VET will be automatically updated without
any stream read errors.

This is, of course, legacy code and you may choose to remove it after some
versions (i would).

Hope this helps.

<KY>


VT as a grid: problems building the tree....

From: "Mark Dekker" [yourfantasy50@h...]
Date: Tue Jun 19, 2001 1:50 pm
Subject: VT as a grid: problems building the tree....

Hi VT users,

I still have a problem using VT as a grid. It 's difficult for me to convert
the older structure in the program i am busy with for the use with the VT as
a grid. What i understand of VT, is that all the data, what you need, has to
be stored in each node and you can get this user data with the procedure
GetNodeData. That i understand. The problem is, that you don 't know when
you can initialize your own data and Add this to a specific Node. Assume i
am reading contents like name, adress, etc from a file. Is it possible to
store this information directly in the VT nodes? I have no idea. Vadim
Sedulin, you created a procedure AddNode, i tried to implement it, but i get
an error Acces Violation when i call the procedure with a Nodename and a
Caption. Normally one rootnode is initialized by the eventhandler
OnInitNode, is it possible to add subnodes, so that every item in the VT (as
a grid, one item per cell) consists of a node with user data? Is there a way
to manipulate the eventhandlers, or is it in the hands of VT to call these
eventhandlers and it isn 't possible for the programmer to force the
eventhandlers....
It 's a pity that the compiled html helpfile, doesn 't provide a lot of
information for the use of VT. I really hope that someone can help me!
Thanx a lot already for your interest and the helpfull messages i got from
you guys! Keep goin' on!

Kind Regards,
Mark Dekker.

_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.

 | Replies | Author | Date
2528 | Re: VT as a grid: problems building the tree.... | Jim Kueneman | Tue 6/19/2001
2529 | Re: VT as a grid: problems building the tree.... | Roland | Tue 6/19/2001
2534 | Re: VT as a grid: problems building the tree.... | Vadim Sedulin | Tue 6/19/2001


re: VET feature request

From: Mike Lischke [public@l...]
Date: Tue Jun 19, 2001 1:58 pm
Subject: RE: [VirtualTreeview] VET feature request

> After the FullCollapse discussion I think I had better not
> push Mike much right now <g>.

Ah, come on guys, I just want to keep changes at the lowest level as
possible to be able to publish the next official version this very year :o]

Ciao, Mike

 | Replies | Author | Date
2535 | Re: VET feature request | [FRiviR2@a...] | Tue 6/19/2001


re: VT as a grid: problems building the tree... .

From: Mike Lischke [public@l...]
Date: Tue Jun 19, 2001 2:08 pm
Subject: RE: [VirtualTreeview] VT as a grid: problems building the tree... .

Mark,

I'm sorry that you have so much trouble, but I'm not in the situation to
write lengthy eMails nor provide extensive help during business time. That's
the reason why I'm short with postings here (although I'm listening all the
time).

> It 's a pity that the compiled html helpfile, doesn 't
> provide a lot of information for the use of VT.

I strongly recommend that you download the latest help from YG. In this chm
I have included new chapters explaining inner details and how to get
started. Generally:

- yes, you can store data in each node record
- make sure Tree.NodeDataSize has a useful value (the size of the data you
want to store)
- use Tree.GetNodeData to get an address to the user area in the node record
and store this address in a pointer variable which you can use without
casting to access structure members
- use this data area to hold the captions of all columns for a particular
node (e.g. array of WideString)

Ciao, Mike


Somebody help a real newbie!

From: [jogador3@y...]
Date: Tue Jun 19, 2001 2:56 pm
Subject: Somebody help a real newbie!

Hello!

I´m a 22 years old trainee and I have to use VirtualTreeView in my
traineeship. The problem is a can´t! I already tried to look the
demos, html help file, code repository and previous messages in this
list. I just need an initial orientation about inserting a node and
putting my data on it.

Thank you very much!

Trevis

 | Replies | Author | Date
2530 | Re: Somebody help a real newbie! | Roland | Tue 6/19/2001
2538 | Re: Somebody help a real newbie! | [jogador3@y...] | Wed 6/20/2001
2539 | Re: Somebody help a real newbie! | Roland | Wed 6/20/2001
2630 | Re: Somebody help a real newbie! | Mike Lischke | Mon 6/25/2001


re: VT as a grid: problems building the tree....

From: "Jim Kueneman" [jimdk@m...]
Date: Tue Jun 19, 2001 3:14 pm
Subject: Re: VT as a grid: problems building the tree....

--- In [VirtualTreeview@y...], "Mark Dekker" [yourfantasy50@h...] wrote:

> to manipulate the eventhandlers, or is it in the hands of VT to call
these
> eventhandlers and it isn 't possible for the programmer to force the
> eventhandlers....

How about having one rootnode called, I don't know

Records
Record1
Record2
Record3

Now when VT loads you override the Loaded procedure (from TComponent
I think) and

procedure Form.Loaded;
begin
inhertied;
TV.Expanded[GetFirst] := True
end

Note: I don't have access to VT now so GetFirst may not be right it
maybe FirstNode or something.

Now when it expands it fires

OnInitChildren

Here you can

Read all your records, Add a New node for each record, Assign the
record information to the new node and return the total number of
nodes to the event.

To sort them call Sort after before returning from the event and use
the OnCompareNodes event to define the sort rules.

It will not be a flat TListview structure but you can set the Option
and hide the "+" infront of the root node so it looks flat.

If the records change then showing that in VT may be better done by
leaving the records in an array (TList?) and storing only an index to
the record in VT. The record can also have a field that points to the
node that represents it. That way a deletion of a record can quickly
remove it from the tree. The problem is what I believe Werner pointed
out what to do with insertions ect. Although as long as the record
array only got longer and no packing was done for deleted records,
only the node was deleted, and the record data was just orphaned at
that index that may not be a problem. If enough record were deleted
it may be best to clear the tree and create a new array. I may have
forgotten some details but it may give you and some ideas.

Jim

> It 's a pity that the compiled html helpfile, doesn 't provide a lot
of

If we would stop asking Mike for new features he could finish the help
(me too for VET).

Jim


re: VT as a grid: problems building the tree....

From: "Roland" [Beduerftig@S...]
Date: Tue Jun 19, 2001 3:25 pm
Subject: Re: VT as a grid: problems building the tree....

Hi Mark,

> be stored in each node and you can get this user data with the
> procedure GetNodeData.
.......
> Sedulin, you created a procedure AddNode,
.......
I think there is an easy way to do it:
1. set Tree.NodeDataSize := sizeof(integer);
2. do not use Tree.RootNodeCount or any OnInit-Events
3. in FormShow() you can fill the tree with a for-loop
under use of AddChild(), for example:
Node : PVirtualNode;
Tree.BeginUpdate;
for i := 0 to MaxNodes do
begin
Node := Tree.AddChild(NIL);
Tree.GetNodeData(Node)^ := i;
end;
Tree.EndUpdate;
4. now is the tree filled with the nodes and with the event
TreeGetText() you can set the caption
procedure Tree.TreeGetText(Sender, Node, Column, ... var Text);
begin
Row := (PInteger)Sender.GetNodeData(Node);
Text := your_caption[Row^,Column];
end;

I hope the short example will help you
Roland


re: Somebody help a real newbie!

From: "Roland" [Beduerftig@S...]
Date: Tue Jun 19, 2001 3:31 pm
Subject: Re: Somebody help a real newbie!

--- In [VirtualTreeview@y...], [jogador3@y...] wrote:
> Hello!
>
> I´m a 22 years old trainee and I have to use VirtualTreeView in my
> traineeship. The problem is a can´t! I already tried to look the
> demos, html help file, code repository and previous messages in
this
> list. I just need an initial orientation about inserting a node and
> putting my data on it.
>
> Thank you very much!
>
> Trevis

Hi Trevis,

look at file area there is "VirtualTree Demos.zip". In this zip-file
are some paths with demo source, for starting I think the best
is "Minimal".

Have fun with the demo
Roland

 | Replies | Author | Date
2538 | Re: Somebody help a real newbie! | [jogador3@y...] | Wed 6/20/2001
2539 | Re: Somebody help a real newbie! | Roland | Wed 6/20/2001


re: Save to Text File

From: Werner Lehmann [wl@b...]
Date: Tue Jun 19, 2001 4:26 pm
Subject: Re: [VirtualTreeview] Save to Text File

Ernest Fairchild wrote:
>
> I hope this hasn't been asked a hundred times. I'm new to the list ;-).
>
> Anyway, I need to save a VirtualStringTree to a text file. The SaveToFile()
> method doesn't quite do it. I just need one line per node with the text. My
> tree is a simple one-column thing. Any ideas, code examples? BTW, I'm using
> Delphi 4.

Why not just iterate through all nodes and write the text line for each?

procedure SaveAsText(VTree: TVirtualStringTree; Filename: string);
var
Node: PVirtualNode;
F: TextFile;
Text: WideString;
begin
AssignFile(F, Filename);
Rewrite(F);
try
Node := VTree.GetFirst;
while Node <> nil do
begin
// <- get your column strings
// something like:
// VTree.OnGetText(VTree, Node, 0, ttNormal, Text) <- from the top of my
head,
// probably different parameters, may have to respect
VTree.Header.Maincolumn
// if <> -1.
WriteLn(F, Text);
Node := VTree.GetNext(Node);
end;
finally
CloseFile(F);
end;
end;

Regards,
Werner


re: Save to Text File

From: "Ernest Fairchild" [efairchild@h...]
Date: Tue Jun 19, 2001 6:09 pm
Subject: Re: [VirtualTreeview] Save to Text File

Thanks, Werner. That looks like that would do it. I'm glad I found this
list. When I ask questions about VirtualTrees on the Delphi newsgroups, they
look at me like "Huh?" ;-).

Have a great day!

Ernest
([efairchild@h...])

_____________________
"Law -- a subject that seems to serve two purposes: two make lawyers rich
and to make more lawyers."

Visit my website at http://www.public.asu.edu/~ernestf

----- Original Message -----
From: "Werner Lehmann" [wl@b...]
To: <VirtualTreeview@yahoogroups.com>
Sent: Tuesday, June 19, 2001 09:26
Subject: Re: [VirtualTreeview] Save to Text File

>
> Why not just iterate through all nodes and write the text line for each?
>
> procedure SaveAsText(VTree: TVirtualStringTree; Filename: string);
> var
> Node: PVirtualNode;
> F: TextFile;
> Text: WideString;
> begin
> AssignFile(F, Filename);
> Rewrite(F);
> try
> Node := VTree.GetFirst;
> while Node <> nil do
> begin
> // <- get your column strings
> // something like:
> // VTree.OnGetText(VTree, Node, 0, ttNormal, Text) <- from the top
of my head,
> // probably different parameters, may have to respect
VTree.Header.Maincolumn
> // if <> -1.
> WriteLn(F, Text);
> Node := VTree.GetNext(Node);
> end;
> finally
> CloseFile(F);
> end;
> end;


re: OnStartDrag

From: "Vadim Sedulin" [wsntrl@o...]
Date: Tue Jun 19, 2001 7:23 pm
Subject: Re: [VirtualTreeview] OnStartDrag

Hello Jim!

> To catch the DragEnd you can create your own Decendant of TTVDragObject,
> and return it in the above, and override Destroy to signal when the object
> is destroyed after returning from DoDragDrop.

With the same success it is possible to inherit TBaseVirtualTree.

Bye.

Vadim Sedulin
E-Mail: [wsntrl@o...]


re: VT as a grid: problems building the tree....

From: "Vadim Sedulin" [wsntrl@o...]
Date: Tue Jun 19, 2001 7:45 pm
Subject: Re: [VirtualTreeview] VT as a grid: problems building the tree....

Hello Mark!

[skip]

> Vadim Sedulin, you created a procedure AddNode, i tried to implement it,
but i get
> an error Acces Violation when i call the procedure with a Nodename and a
> Caption.

NodeDataSize must be set to -1 at design time.

RootNode := AddNode (nil, 'Root node');
SubNode1 := AddNode (RootNode, 'Sub node 1');
SubNode2 := AddNode (RootNode, 'Sub node 2');
...etc...

Bye.

Vadim Sedulin
E-Mail: [wsntrl@o...]


re: VET feature request

From: [FRiviR2@a...]
Date: Tue Jun 19, 2001 8:30 pm
Subject: Re: VET feature request

--- In [VirtualTreeview@y...], Mike Lischke [public@l...] wrote:
> > After the FullCollapse discussion I think I had better not
> > push Mike much right now <g>.
>
> Ah, come on guys, I just want to keep changes at the lowest level as
> possible to be able to publish the next official version this very
year :o]
>
> Ciao, Mike

Hi all,

ok, I'm sorry, I didn't know about things that you all have explain
to me. I'll try to do it this way, it will be ok. With this, no needs
to modify the code ;o)

Thanks,

François Rivierre.


Finishing edit when user changes focus

From: "Brian Huggins" [bghugg@a...]
Date: Tue Jun 19, 2001 8:36 pm
Subject: Finishing edit when user changes focus

Hi,

What would be the best way of finishing an edit when the user changes
focus? For example, if a user starts editing a node, then clicks on
another node, I would like to close the edit with the information
currently in the node. I tried getting the current editor object from
the TGridEditLink, but I had problems casting it to the correct
TWinControl type. Is there another way to do this?

Thanks,
Brian Huggins

 | Replies | Author | Date
2655 | Re: Finishing edit when user changes focus | Mike Lischke | Mon 6/25/2001


[no subject]

From: [efairchild@h...]
Date: Wed Jun 20, 2001 7:00 am
Subject:

1 11:11:06 -0700
Message-ID: [000901c0f8eb$0a024da0$928cfea9@c...]
To: [VirtualTreeview@yahoogroups.com>
References: [006f01c0f8c1$05ce32f0$928cfea9@c...]
[3B2F7D18.99366985@b...]
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 5.50.4522.1200
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200
From: "Ernest Fairchild" [efairchild@h...]
MIME-Version: 1.0
Mailing-List: list [VirtualTreeview@yahoogroups.com; contact
VirtualTreeview-owner@yahoogroups.com
Delivered-To: mailing list VirtualTreeview@yahoogroups.com
Precedence: bulk
List-Unsubscribe: <mailto:VirtualTreeview-unsubscribe@yahoogroups.com>
Date: Tue, 19 Jun 2001 11:09:52 -0700
Reply-To: VirtualTreeview@yahoogroups.com
Subject: Re: [VirtualTreeview] Save to Text File
Content-Type: text/plain; charset=Windows-1252
Content-Transfer-Encoding: 7bit
X-UIDL: 1738
Status: U

Thanks, Werner. That looks like that would do it. I'm glad I found this
list. When I ask questions about VirtualTrees on the Delphi newsgroups, they
look at me like "Huh?" ;-).

Have a great day!

Ernest
(efairchild@h...])

_____________________
"Law -- a subject that seems to serve two purposes: two make lawyers rich
and to make more lawyers."

Visit my website at http://www.public.asu.edu/~ernestf

----- Original Message -----
From: "Werner Lehmann" <wl@b...]
To: <VirtualTreeview@yahoogroups.com>
Sent: Tuesday, June 19, 2001 09:26
Subject: Re: [VirtualTreeview] Save to Text File

>
> Why not just iterate through all nodes and write the text line for each?
>
> procedure SaveAsText(VTree: TVirtualStringTree; Filename: string);
> var
> Node: PVirtualNode;
> F: TextFile;
> Text: WideString;
> begin
> AssignFile(F, Filename);
> Rewrite(F);
> try
> Node := VTree.GetFirst;
> while Node <> nil do
> begin
> // <- get your column strings
> // something like:
> // VTree.OnGetText(VTree, Node, 0, ttNormal, Text) <- from the top
of my head,
> // probably different parameters, may have to respect
VTree.Header.Maincolumn
> // if <> -1.
> WriteLn(F, Text);
> Node := VTree.GetNext(Node);
> end;
> finally
> CloseFile(F);
> end;
> end;

To unsubscribe from this group, send an email to:
VirtualTreeview-unsubscribe@egroups.com

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/


re: Somebody help a real newbie!

From: [jogador3@y...]
Date: Wed Jun 20, 2001 8:21 am
Subject: Re: Somebody help a real newbie!

Sorry to bother again and thank you Roland for your help!
I just have one problem now: The InitNode event is never called! In
the "Minimal" demo works fine, but when I use in my progam the event
is not called.
Here is my code:

//*************************************************************
procedure TMainForm.Button6Click(Sender: TObject);
begin
VST.NodeDataSize := SizeOf(TNode);
VST.RootNodeCount := 10;
end;
//*************************************************************
procedure TMainForm.VSTGetText(Sender: TBaseVirtualTree; Node:
PVirtualNode; Column: Integer; TextType: TVSTTextType;
var Text: WideString);
var
Data: PNode;
begin
Data := Sender.GetNodeData(Node);
if Assigned(Data) then
Text := Data.Text;
end;
//*************************************************************
procedure TMainForm.VSTFreeNode(Sender: TBaseVirtualTree; Node:
PVirtualNode);
var
Data: PNode;
begin
Data := Sender.GetNodeData(Node);
if Assigned(Data) then
Data.text := '';
end;
//*************************************************************
procedure TMainForm.VSTInitNode(Sender: TBaseVirtualTree; ParentNode,
Node: PVirtualNode;
var InitialStates: TVirtualNodeInitStates);
var
Data: PNode;
begin
with Sender do
begin
Data := GetNodeData(Node);
Data.text := Format('Level %d, Index %d', [GetNodeLevel(Node),
Node.Index]);
end;
end;
//*************************************************************

> > Hello!
> >
> > I´m a 22 years old trainee and I have to use VirtualTreeView in
my
> > traineeship. The problem is a can´t! I already tried to look the
> > demos, html help file, code repository and previous messages in
> this
> > list. I just need an initial orientation about inserting a node
and
> > putting my data on it.
> >
> > Thank you very much!
> >
> > Trevis
>
> Hi Trevis,
>
> look at file area there is "VirtualTree Demos.zip". In this zip-
file
> are some paths with demo source, for starting I think the best
> is "Minimal".
>
> Have fun with the demo
> Roland

 | Replies | Author | Date
2539 | Re: Somebody help a real newbie! | Roland | Wed 6/20/2001


re: Somebody help a real newbie!

From: "Roland" [Beduerftig@S...]
Date: Wed Jun 20, 2001 9:48 am
Subject: Re: Somebody help a real newbie!

Hi,

> Sorry to bother again and thank you Roland for your help!
> I just have one problem now: The InitNode event is never called!
> In the "Minimal" demo works fine, but when I use in my progam
> the event is not called.

Sorry I cannot see the problem:

1. I open a new project in Delphi5
2. I drop a VirtualStringTree on the form
3. I drop a button on the form
4. I added
Type
PNode = ^TNode;
TNode = record
Text : WideString;
end;
5. doppleclick on the button and fill in your code
6. open event tab on VirtualStringTree in object inspector
7. doppleclick on OnFreeNode and fill in your code
8. doppleclick on OnGetText and fill in your code
9. doppleclick on OnInitNode and fill in your code

=> press run and the program works fine.

Bye
Roland


Two suggestions and a bug in VT

From: [milan_va@s...]
Date: Wed Jun 20, 2001 10:18 am
Subject: Two suggestions and a bug in VT

Hi to all.

I am trying to write a TRealTree, where every node has a pointer to a
user's object, and vice versa. Is goes fine, but I have found some
things in VT that I think are wrong:

1. a possible bug: In TBaseVirtualTree.PackArray; assembler; the
MOVSD is used, but no CLD. I think there should be one. (I already
posted this, but the message has been lost)

2. in TBaseVirtualTree.GetChildCount, there is no test for nil, like
this:

function TBaseVirtualTree.GetChildCount(Node: PVirtualNode): Cardinal;
begin
if (Node=nil) then Result:=RootNodeCount else //this line added
Result := Node.ChildCount;
end;

Changes list says it has been done, but the code isn't there.

3. In TBaseVirtualTree.InsertNode, there is a ScrollIntoView(Result),
but in TBaseVirtualTree.AddChild, there is none. I think it should be
in both (it can be avoided with BeginUpdate/EndUpdate), or even
better, it could be the tree's option hwther to call it.

I hope that the three lines of code I want won't take much of your
time...

Milan Vandrovec

 | Replies | Author | Date
2546 | Re: Two suggestions and a bug in VT | Mike Lischke | Wed 6/20/2001


New file uploaded to VirtualTreeview

From: [VirtualTreeview@yahoogroups.com>
Date: Wed Jun 20, 2001 10:34 am
Subject: New file uploaded to VirtualTreeview

Hello,

This email message is a notification to let you know that
a file has been uploaded to the Files area of the VirtualTreeview
group.

File : /Screen shots/treegridnew2.gif
Uploaded by : [franckenstein@a...]
Description : edited screenshot of a treeview with grid lines - maybe another
better way?

You can access this file at the URL

http://groups.yahoo.com/group/VirtualTreeview/files/Screen%20shots/treegridnew2.\
gif

To learn more about file sharing for your group, please visit

http://help.yahoo.com/help/us/groups/files

Regards,

franckenstein@a...]


Suggestion for a new event

From: [hj_schnorrenberg@y...]
Date: Wed Jun 20, 2001 12:31 pm
Subject: Suggestion for a new event

Sometimes, it would be nice, if the cursor can change in dependence
on the position (e.g. crHandPoint above a CheckBox, crDefault else).
However, in order to introduce such an option, it is actually
neccessary to define a descendent and to overwrite the WM_SETCURSOR
message.

In contrast, defining an event OnSetCursor and manipulating
WMSetCursor would yield this option:

type
TSetCursor = procedure(Sender: TObject; var Cursor: TCursor) of
object;

procedure TBaseVirtualTree.WMSetCursor(var Message: TWMSetCursor);
var
ActCursor: TCursor;
begin
with Message do
if (CursorWnd = Handle) and not (csDesigning in ComponentState)
then
begin
if not FHeader.HandleMessage(TMessage(Message)) and Assigned
(FCurrentHotNode) then
ActCursor:= FHotCursor
else
ActCursor:= Screen.Cursors[Cursor];
if Assigned(FOnSetCursor) then
FOnSetCursor(self, ActCursor);
Windows.SetCursor(Screen.Cursors[Cursor]);
end
else
inherited;
end;

 | Replies | Author | Date
4119 | Re: Suggestion for a new event | Mike Lischke | Sat 10/20/2001


re: New file uploaded to VirtualTreeview

From: "Mike Lischke" [lists@l...]
Date: Wed Jun 20, 2001 8:58 pm
Subject: RE: [VirtualTreeview] New file uploaded to VirtualTreeview

Moritz,

> Description : edited screenshot of a treeview with grid lines - maybe
> another better way?

Looks cool, if I only had an implementation already. Any volunteers?

Ciao, Mike


re: OnStartDrag

From: "Mike Lischke" [lists@l...]
Date: Wed Jun 20, 2001 8:58 pm
Subject: RE: [VirtualTreeview] OnStartDrag

Hi Vadim,

> Where is OnStartDrag in OLE d&d?

Sorry, I forgot to call it from DoDragging (DoEndDrag is triggered correctly).
Fixed now.

Ciao, Mike


re: Re: What to do when GetNodeData(Node) fails ?

From: "Mike Lischke" [lists@l...]
Date: Wed Jun 20, 2001 8:58 pm
Subject: RE: [VirtualTreeview] Re: What to do when GetNodeData(Node) fails ?

> > You have to assign the value -1 to NodeDataSize to cause VT to trigger
> OnGetNodeDataSize. This will
> > be described in the new help file so others will not have the same trouble
> (hopefully).
>
> You had better change the default value to -1, i think.

No, the default is 0 because this is useful for the minimal case (where you
don't need any data). -1 would always require to have an event handler.

Ciao, Mike


re: Two suggestions and a bug in VT

From: "Mike Lischke" [lists@l...]
Date: Wed Jun 20, 2001 8:58 pm
Subject: RE: [VirtualTreeview] Two suggestions and a bug in VT

Hi Milan,

> 1. a possible bug: In TBaseVirtualTree.PackArray; assembler; the
> MOVSD is used, but no CLD. I think there should be one. (I already
> posted this, but the message has been lost)

This is not a bug. The OH chapter "Parameter passing" clearly states:

--- quote
Register saving conventions

Procedures and functions must preserve the EBX, ESI, EDI, and EBP registers,
but can modify the EAX, EDX, and ECX registers. When implementing a constructor
or destructor in assembler, be sure to preserve the DL register. Procedures and
functions are invoked with the assumption that the CPU’s direction flag is
cleared (corresponding to a CLD instruction) and must return with the direction
flag cleared.
--- end of quote

> 2. in TBaseVirtualTree.GetChildCount, there is no test for nil, like
> this:

Changed. Thank you for letting me know.

> 3. In TBaseVirtualTree.InsertNode, there is a ScrollIntoView(Result),
> but in TBaseVirtualTree.AddChild, there is none.

Changed.

> I hope that the three lines of code I want won't take much of your
> time...

Thank you. It was only a matter of a couple of minutes. Writing this eMail took
most of the time :o]

Ciao, Mike


re: Another Bug?!

From: "Mike Lischke" [lists@l...]
Date: Wed Jun 20, 2001 8:58 pm
Subject: RE: [VirtualTreeview] Another Bug?!

> I tested the latest version with CodeWatcher and didn't find any other leaks
> than the FClipboardformats. (But, of course, I don't use every corner of
> VT.)

Excellent. Thank you Teus. I will try with Bounds Checker and (if it does not
crash again) with MemProof.

Ciao, Mike

 | Replies | Author | Date
2552 | Re: Another Bug?! | Thierry Parent | Thu 6/21/2001


re: Full Collapse Performance (or lack of <g>)

From: "Mike Lischke" [lists@l...]
Date: Wed Jun 20, 2001 8:58 pm
Subject: RE: [VirtualTreeview] Full Collapse Performance (or lack of <g>)

Werner,

> Ok. Let's assume we have a node which is not intialized and which has "child
> nodes which must be expanded/collapsed".

I'm astonished that this comes from you. A node can never have the
vsHasChildren flag set if it is not initialized. Determining this flag is one
of the three main tasks during initialization (the others are: setup of
external structures like databases and load of node specific data).

> It seems we are not getting anywhere on this topic, always the same question
> and answer.

Not really, I could imagine a flag as parameter determining to collapse/expand
all nodes, only initialized or only selected nodes. I thought however the need
would not justify the effort.

Ciao, Mike


re: Re: What to do when GetNodeData(Node) fails ?

From: "Vadim Sedulin" [wsntrl@o...]
Date: Wed Jun 20, 2001 9:15 pm
Subject: Re: [VirtualTreeview] Re: What to do when GetNodeData(Node) fails ?

Hello Mike!

----- Original Message -----
From: Mike Lischke
To: [VirtualTreeview@yahoogroups.com
Sent: 21 ???? 2001 ?. 0:58
Subject: RE: [VirtualTreeview] Re: What to do when GetNodeData(Node) fails ?

>> You had better change the default value to -1, i think.
>
> No, the default is 0 because this is useful for the minimal case (where
you don't need any data). -1 would always require to have an event handler.

Mike, Mike, Mike... Let's look at your code:

function TBaseVirtualTree.MakeNewNode: PVirtualNode;
....
if FNodeDataSize = -1 then
ValidateNodeDataSize(FNodeDataSize);
....

procedure TBaseVirtualTree.ValidateNodeDataSize(var Size: Integer);
begin
Size := 0;
if Assigned(FOnGetNodeDataSize) then
FOnGetNodeDataSize(Self, Size);
end;

In other words, NodeDataSize = 0 eq NodeDataSize = -1 without event handler.

Bye.

Vadim Sedulin
E-Mail: wsntrl@o...]

 | Replies | Author | Date
2656 | Re: What to do when GetNodeData(Node) fails ? | Mike Lischke | Mon 6/25/2001


Cannot get VirtualTree_2.4.28 to compile

From: [garycramblitt@e...]
Date: Thu Jun 21, 2001 3:01 am
Subject: Cannot get VirtualTree_2.4.28 to compile

When I attempt to compile VirtualTreesD5 I get

[Error] VirtualExplorerTree.pas(674): Method 'RenderData' not found
in base class

at this point in the code

{ Replaces the VT DragDropManager to handle the Shell type
IDataObject }
{ clipboard
formats. }
TShellDragDropManager = class(TVTDragManager)
protected
ShellFormats: TClipboardFormats;
ShellDataObject: IDataObject;
public
procedure ExtractClipboardFormats(DataObject: IDataObject);
function RenderData(FormatEtc: TFormatEtc; var StgMedium:
TStgMedium): HResult; override;
procedure SetOLEFormats(Formats: TOLEFormats); override; stdcall;
end;

Anyone know what is wrong? If I remove VirtualExplorerTree from the
package, it compiles, but of course, VET is not available. TIA

 | Replies | Author | Date
2551 | Re: Cannot get VirtualTree_2.4.28 to compile | Jim Kueneman | Thu 6/21/2001


re: Cannot get VirtualTree_2.4.28 to compile

From: Jim Kueneman [jimdk@m...]
Date: Thu Jun 21, 2001 4:01 am
Subject: Re: [VirtualTreeview] Cannot get VirtualTree_2.4.28 to compile

At 03:01 AM 6/21/2001 +0000, you wrote:
>When I attempt to compile VirtualTreesD5 I get
>
>[Error] VirtualExplorerTree.pas(674): Method 'RenderData' not found
>in base class

As of now what you have done is necessary. Mike has done a complete rework
of the OLE Drag and Drop / OLE clipboard IDataObject and it is not *quite*
compatible with VET. He is making (made) the changes and I am just waiting
for this next version to be uploaded. I have made the changes to VT and
have VET fully compatible with what VT will be so as soon as the next
version of VT is uploaded VET will be updated.

Sorry for the confusion.

Jim


re: Another Bug?!

From: "Thierry Parent" [tparent@c...]
Date: Thu Jun 21, 2001 6:09 am
Subject: RE: [VirtualTreeview] Another Bug?!

Can you give me reference to CodeWatcher ?
Thanks.

-----Original Message-----
From: Mike Lischke [mailto:[lists@l...]]
Sent: mercredi 20 juin 2001 22:58
To: VirtualTreeview@yahoogroups.com
Subject: RE: [VirtualTreeview] Another Bug?!

> I tested the latest version with CodeWatcher and didn't find any other
leaks
> than the FClipboardformats. (But, of course, I don't use every corner of
> VT.)

Excellent. Thank you Teus. I will try with Bounds Checker and (if it does
not crash again) with MemProof.

Ciao, Mike

To unsubscribe from this group, send an email to:
VirtualTreeview-unsubscribe@egroups.com

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/


re: Another Bug?!

From: "Teus de Jong" [teusjdejong@p...]
Date: Thu Jun 21, 2001 10:11 am
Subject: Re: [VirtualTreeview] Another Bug?!

Hi Thierry,

> Can you give me reference to CodeWatcher ?
> Thanks.

You will find CodeWatcher as one of the products of TurboPower
www.turbopower.com

Teus de Jong


re: OnStartDrag

From: "Teus de Jong" [teusjdejong@p...]
Date: Thu Jun 21, 2001 10:20 am
Subject: Re: [VirtualTreeview] OnStartDrag

Hi Mike,

> > Where is OnStartDrag in OLE d&d?
>
> Sorry, I forgot to call it from DoDragging (DoEndDrag is triggered
correctly). Fixed now.

You have

ActiveX.DoDragDrop(DragManager.GetDataObject , DragManager as
IDropSource, AllowedEffects, DragEffect);

and in GetDataObject there is

Result := FOwner.DoCreateDataObject;

which is overridable. So you can catch Begindrag there? That's what I have
done and it works fine.

Teus de Jong.


Common VET question

From: Marco Loos [NRYJGUSFSVEY@s...]
Date: Thu Jun 21, 2001 10:38 am
Subject: Common VET question

Hi,

I'm sorry I do not read all these VirtualTreeview group messages, they
are simply to confusing, I guess a real newsgroup would do better here.

But that's not my thread :).

I wanted to ask what VET is writting for. Many weeks ago, I read
something about "Explorer replacement". But because of the missing
directory/file splitting, I guess it's not that. Jim, are you intended
to include this feature some time?

I hate the Windows Explorer... much too slow on big drives under Windows
98 :(. And creating a new folder takes a minimum of 10 seconds and so on...

It would be fine if you could answer by personal email, because of the
first sentence I wrote in this mail ;).

Thanks in advance!

Marco Loos

--
NJ0Y - Marco Loos, 48165 Münster
http://nj0y.de
PWGen - Der Passwortverwalter: http://www.pwgen.de

Sie haben die Position des Mauszeigers verändert.
Starten Sie Windows neu, damit die Änderungen wirksam werden.

 | Replies | Author | Date
2556 | Re: Common VET question | Jim Kueneman | Thu 6/21/2001


re: Common VET question

From: Jim Kueneman [jimdk@m...]
Date: Thu Jun 21, 2001 12:38 pm
Subject: Re: [VirtualTreeview] Common VET question

>I hate the Windows Explorer... much too slow on big drives under Windows
>98 :(. And creating a new folder takes a minimum of 10 seconds and so on...

As do I.

I am now sure where this rumor came from <g> but for right now it is just a
rumor. I do have visions of someday doing just that but for now I am
afraid you will have to settle for Explorer.

Try GXExplorer which a few here have contributed to. John is very busy so
it has not had a new release is quite some time but is is a cool open
source project.

www.gxexplorer.org

I doubt if you will find it faster than Explorer but it can do a lot more.

Jim


Strange behaviour

From: "Zoltan Hubai" [hubaiz@e...]
Date: Thu Jun 21, 2001 5:09 pm
Subject: Strange behaviour

Hi Mike!

I'm working with VT and I'm very satisfied with it. I noticed some strange
behaviour.
In my project I use a TVirtualDrawTree with about 14000 nodes and with 8
columns. My nodes are structured in a tree. After I populate the tree I
recalculate the height of the nodes becouse in one column I have text with
multi lines, so I use the windows DrawTextEx function with the DT_CALCRECT
and DT_WORDBREAK flags to get the height for the node.
In the OnDrawNode event I use the same DrawTextEx function to display the
text in multiple lines.
Thats all working fine but at some stages my display going to wrong nodes.
When I use the GetNodeData function I got the right nodedata but on display
I got a wrong Node. I noticed that when I make a FullCollapse method with
some node and a FullExpand with the same node the strange behaviour is gone.
Do you have some idea why is it so?

With best regards, Zoltan

Sorry about my english.

 | Replies | Author | Date
2558 | Cannot select rootnode | Franc v/d Westelaken | Thu 6/21/2001
2559 | Re: Cannot select rootnode | Jim Kueneman | Thu 6/21/2001
2560 | Re: Cannot select rootnode | Franc v/d Westelaken | Thu 6/21/2001
2561 | Re: Cannot select rootnode | Jim Kueneman | Thu 6/21/2001
2577 | Re: Cannot select rootnode | Franc v/d Westelaken | Fri 6/22/2001
2579 | Re: Cannot select rootnode | Jim Kueneman | Fri 6/22/2001
2580 | Re: Cannot select rootnode | Franc v/d Westelaken | Fri 6/22/2001
2566 | Re: Cannot select rootnode | [ls@t...] | Fri 6/22/2001
2568 | Re: Cannot select rootnode | Roland | Fri 6/22/2001


Cannot select rootnode

From: "Franc v/d Westelaken" [F.vdwestelaken@c...]
Date: Thu Jun 21, 2001 7:54 pm
Subject: Cannot select rootnode

Hi,

Can anyone tell me why the code below for adding rootnodes doesn't work. The
following behaviour occurs: I cannot select any rootnodes by clicking with
the mouse. Only when clicking between de treeline and the nodetext the node
will be selected. Clicking on the node text itself doesn't work. Once the
node is selected this way after that I can select it the normal way.

The child node added to the first node is selectable with the mouse when the
tree is expanded, but it's parent node is not selectable.

Here's the code I use to add rootnodes:

My guess is that it occurs because I don't explicitly set rootnodecount, but
if that's the cause shouldn't VT raise an exception instead of providing
this 'strange' behaviour ?

Type
TpTestRec = ^TTestRec;
TTestRec = record
Name: string;
end;

var
TestRec: TpTestRec;

procedure TForm1.FormCreate(Sender: TObject);
Var
Node: PVirtualNode;
begin
Tree1.NodeDataSize := SizeOf(TTestRec);

Node := Tree1.AddChild(nil);
TestRec := Tree1.GetNodeData(Node);
TestRec.Name := 'RootNode 1';

Node := Tree1.AddChild(node);
TestRec := Tree1.GetNodeData(Node);
TestRec.Name := 'ChildNode 1';

Node := Tree1.AddChild(nil);
TestRec := Tree1.GetNodeData(Node);
TestRec.Name := 'RootNode 2';

Node := Tree1.AddChild(nil);
TestRec := Tree1.GetNodeData(Node);
TestRec.Name := 'RootNode 3';

end;

 | Replies | Author | Date
2559 | Re: Cannot select rootnode | Jim Kueneman | Thu 6/21/2001
2560 | Re: Cannot select rootnode | Franc v/d Westelaken | Thu 6/21/2001
2561 | Re: Cannot select rootnode | Jim Kueneman | Thu 6/21/2001
2577 | Re: Cannot select rootnode | Franc v/d Westelaken | Fri 6/22/2001
2579 | Re: Cannot select rootnode | Jim Kueneman | Fri 6/22/2001
2580 | Re: Cannot select rootnode | Franc v/d Westelaken | Fri 6/22/2001
2566 | Re: Cannot select rootnode | [ls@t...] | Fri 6/22/2001
2568 | Re: Cannot select rootnode | Roland | Fri 6/22/2001


re: Cannot select rootnode

From: "Jim Kueneman" [jimdk@m...]
Date: Thu Jun 21, 2001 8:09 pm
Subject: Re: Cannot select rootnode

--- In [VirtualTreeview@y...], "Franc v/d Westelaken"
[F.vdwestelaken@c...] wrote:
>
> My guess is that it occurs because I don't explicitly set
rootnodecount, but
> if that's the cause shouldn't VT raise an exception instead of
providing
> this 'strange' behaviour ?

I think your problem is elsewhere. I plugged your code into a test
program and it works as expected.

Jim

 | Replies | Author | Date
2560 | Re: Cannot select rootnode | Franc v/d Westelaken | Thu 6/21/2001
2561 | Re: Cannot select rootnode | Jim Kueneman | Thu 6/21/2001
2577 | Re: Cannot select rootnode | Franc v/d Westelaken | Fri 6/22/2001
2579 | Re: Cannot select rootnode | Jim Kueneman | Fri 6/22/2001
2580 | Re: Cannot select rootnode | Franc v/d Westelaken | Fri 6/22/2001


re: Re: Cannot select rootnode

From: "Franc v/d Westelaken" [F.vdwestelaken@c...]
Date: Thu Jun 21, 2001 8:11 pm
Subject: RE: [VirtualTreeview] Re: Cannot select rootnode

Jim,

I can send you the full test program so you can see the behaviour for
yourself ?

Franc.
-----Original Message-----
From: Jim Kueneman [mailto:[jimdk@m...]]
Sent: donderdag 21 juni 2001 22:10
To: [VirtualTreeview@yahoogroups.com
Subject: [VirtualTreeview] Re: Cannot select rootnode

--- In [VirtualTreeview@y...], "Franc v/d Westelaken"
<F.vdwestelaken@c...] wrote:
>
> My guess is that it occurs because I don't explicitly set
rootnodecount, but
> if that's the cause shouldn't VT raise an exception instead of
providing
> this 'strange' behaviour ?

I think your problem is elsewhere. I plugged your code into a test
program and it works as expected.

Jim

Yahoo! Groups Sponsor

www.

To unsubscribe from this group, send an email to:
VirtualTreeview-unsubscribe@egroups.com

Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.

[Non-text portions of this message have been removed]

 | Replies | Author | Date
2561 | Re: Cannot select rootnode | Jim Kueneman | Thu 6/21/2001
2577 | Re: Cannot select rootnode | Franc v/d Westelaken | Fri 6/22/2001
2579 | Re: Cannot select rootnode | Jim Kueneman | Fri 6/22/2001
2580 | Re: Cannot select rootnode | Franc v/d Westelaken | Fri 6/22/2001


re: Cannot select rootnode

From: "Jim Kueneman" [jimdk@m...]
Date: Thu Jun 21, 2001 9:59 pm
Subject: Re: Cannot select rootnode

--- In [VirtualTreeview@y...], "Franc v/d Westelaken"
[F.vdwestelaken@c...] wrote:
> Jim,
>
> I can send you the full test program so you can see the behaviour
for
> yourself ?

Sure post it in the files area
http://groups.yahoo.com/group/VirtualTreeview/files/
and I will look at it tonight.

Jim

 | Replies | Author | Date
2577 | Re: Cannot select rootnode | Franc v/d Westelaken | Fri 6/22/2001
2579 | Re: Cannot select rootnode | Jim Kueneman | Fri 6/22/2001
2580 | Re: Cannot select rootnode | Franc v/d Westelaken | Fri 6/22/2001


re: Cannot select rootnode

From: Werner Lehmann [wl@b...]
Date: Thu Jun 21, 2001 10:13 pm
Subject: Re: [VirtualTreeview] Cannot select rootnode

Franc v/d Westelaken wrote:
>
> Can anyone tell me why the code below for adding rootnodes doesn't work. The
> following behaviour occurs: I cannot select any rootnodes by clicking with
> the mouse. Only when clicking between de treeline and the nodetext the node
> will be selected. Clicking on the node text itself doesn't work. Once the
> node is selected this way after that I can select it the normal way.

Your problem sounds familiar. Probably the tree does not notice that your
node text has changed. It thinks the text is empty (at least the horizontal
text extent is cached for the empty text). Try to InvalidateNode explicitly:

> Node := Tree1.AddChild(nil);
> TestRec := Tree1.GetNodeData(Node);
> TestRec.Name := 'RootNode 1';
Tree1.InvalidateNode(Node);

>
> Node := Tree1.AddChild(node);
> TestRec := Tree1.GetNodeData(Node);
> TestRec.Name := 'ChildNode 1';
<- same here

> Node := Tree1.AddChild(nil);
> TestRec := Tree1.GetNodeData(Node);
> TestRec.Name := 'RootNode 2';
<- same here

> Node := Tree1.AddChild(nil);
> TestRec := Tree1.GetNodeData(Node);
> TestRec.Name := 'RootNode 3';
<- same here

Werner

 | Replies | Author | Date
2564 | Re: Cannot select rootnode | Vadim Sedulin | Thu 6/21/2001


re: Full Collapse Performance (or lack of <g>)

From: Werner Lehmann [wl@b...]
Date: Thu Jun 21, 2001 11:02 pm
Subject: Re: [VirtualTreeview] Full Collapse Performance (or lack of <g>)

Hi Mike :)

> > Ok. Let's assume we have a node which is not intialized and which has "child
> > nodes which must be expanded/collapsed".
>
> I'm astonished that this comes from you. A node can never have the
vsHasChildren flag set if it is not initialized. Determining this flag is one
of the three main tasks during initialization (the others are: setup of
external structures like databases and load of node specific data).

OMG, I have let you down :)

The meaning of this flag is:

vsHasChildren, // indicates the presence of child nodes without actually
setting them

No word of initialization. Furthermore, if I search through VirtualTrees.pas
and see
where the flag is set it turns out that it may be set in InitNode(). But also
in
SetHasChildren(). Which does neither require nor check initialization.

I can easily do this:

Node := AddChild(nil);
HasChildren[Node] := true;

and still do not have the node initialized if I don't have OnInitNode hooked
up. And
this is no nonsense code that I use in a similar way. Imagine I wanted to added
10000
top level nodes and each 10th should have a +-button indicating that it can be
expanded.

"A node can never have the vsHasChildren flag set if it is not initialized."

>From this follows that I have to (at least) initialize each 10th node. I do not
believe that this is true.

But lets come back to the original topic. From FullCollapse():

if (vsHasChildren in Node.States) and (Node.ChildCount = 0) then
InitChildren(Node);

Can a node which has vsHasChildren but no children (as of yet) be actually
expanded. I say no. Isn't it quite obvious? If the node could be expanded,
it would have to have real child nodes (not only the 'promise that there are
some' = vsHasChildren). Contradiction to ChildCount = 0.

FullExpand() is another story, without question. Initialization is required
here. But this is about FullCollapse().

> > It seems we are not getting anywhere on this topic, always the same question
> > and answer.
>
> Not really, I could imagine a flag as parameter determining to
collapse/expand all nodes, only initialized or only selected nodes. I thought
however the need would not justify the effort.

I agree on this although for VET it might be good to only collapse the
initialized
folders. If FullCollapse takes 4 min (that's the figure I had in mind) because
all
removable drives have to be checked it's clearly not acceptable.

BTW, I just see this condition:

if [vsHasChildren, vsExpanded] * Node.States = [vsHasChildren, vsExpanded]
then

This can also be written as

if Node.States >= [vsHasChildren, vsExpanded] then

Shorter & clearer IMO. Just a thought of course and semantically equivalent.

Regards,
Werner

PS: Jim, if you read this, please kick in, and comment one way or the other,
I am doing this for you! :))

 | Replies | Author | Date
2565 | Re: Full Collapse Performance (or lack of <g>) | Jim Kueneman | Fri 6/22/2001


re: Cannot select rootnode

From: "Vadim Sedulin" [wsntrl@o...]
Date: Thu Jun 21, 2001 11:11 pm
Subject: Re: [VirtualTreeview] Cannot select rootnode

Hello Franc!

> Node := Tree1.AddChild(nil);

Tree1.ReinitNode (Node, False);

> TestRec := Tree1.GetNodeData(Node);

Initialize (TestRec^);

> TestRec.Name := 'RootNode 1';

Bye.

Vadim Sedulin
E-Mail: [wsntrl@o...]

----- Original Message -----
From: "Franc v/d Westelaken" [F.vdwestelaken@c...]
To: <VirtualTreeview@yahoogroups.com>
Sent: 21 ???? 2001 ?. 23:54
Subject: [VirtualTreeview] Cannot select rootnode

> Hi,
>
> Can anyone tell me why the code below for adding rootnodes doesn't work.
The
> following behaviour occurs: I cannot select any rootnodes by clicking with
> the mouse. Only when clicking between de treeline and the nodetext the
node
> will be selected. Clicking on the node text itself doesn't work. Once the
> node is selected this way after that I can select it the normal way.

[skipped]


re: Full Collapse Performance (or lack of <g>)

From: Jim Kueneman [jimdk@m...]
Date: Fri Jun 22, 2001 1:49 am
Subject: Re: [VirtualTreeview] Full Collapse Performance (or lack of <g>)

At 01:02 AM 6/22/2001 +0200, you wrote:
>Hi Mike :)
>
>PS: Jim, if you read this, please kick in, and comment one way or the other,
> I am doing this for you! :))

"I have no opinion at the risk of Mike yelling at me <g>". Off the record
I tend to agree with you. VT allows you to do anything you want with node,
to a limit, so in theory I can ....sort of.... see why Mike wants to do it
the way he does. In practice I think the proposed change will work just fine.

It really does not matter since I defined my own reintroduced FullCollapse
and implemented my way for the next release. Since I know how I am
expanding the nodes I know what constitues a collapse.

I would rather bug him about implementing KY's small change so decent
classes of the column collection items can be created so I can "bind" the
Details to the column which would simplify some issues I have with
implementing the IShellFolder2 interface in Win2k.

Jim


re: Cannot select rootnode

From: [ls@t...]
Date: Fri Jun 22, 2001 6:17 am
Subject: Re: [VirtualTreeview] Cannot select rootnode

Hallo Franc,

FvdW> I cannot select any rootnodes by clicking with
FvdW> the mouse. Only when clicking between de treeline and the nodetext the
node
FvdW> will be selected. Clicking on the node text itself doesn't work. Once the
FvdW> node is selected this way after that I can select it the normal way.

I have the same problem and solved it with setting the option
FullRowSelect to true. But I don't think that's the "normal" way to
select a node...

My code to add root and child nodes looks like yours (except of some
extra database stuff).

Lars

--------------------------------------------------
tpm taberna pro medicum
Physik und Elektronik in der Medizintechnik GmbH

Dipl.-Ing. Lars Söding

eMail: [ls@t...]
--------------------------------------------------


[no subject]

From: [F.vdwestelaken@c...]
Date: Fri Jun 22, 2001 7:00 am
Subject:

1 Jun 2001 21:55:01 +0200
To: [VirtualTreeview@yahoogroups.com>
Message-ID: [MMEBIEFEHHOLNALGMHDOEEPDDKAA.F.vdWestelaken@c...]
X-Priority: 3 (Normal)
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2911.0)
In-Reply-To: [LAEOKCLMCGOCLLKHPOIJCEKNCDAA.hubaiz@e...]
Importance: Normal
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2462.0000
From: "Franc v/d Westelaken" <F.vdwestelaken@c...]
MIME-Version: 1.0
Mailing-List: list VirtualTreeview@yahoogroups.com; contact
VirtualTreeview-owner@yahoogroups.com
Delivered-To: mailing list VirtualTreeview@yahoogroups.com
Precedence: bulk
List-Unsubscribe: <mailto:VirtualTreeview-unsubscribe@yahoogroups.com>
Date: Thu, 21 Jun 2001 21:54:01 +0200
Reply-To: VirtualTreeview@yahoogroups.com
Subject: [VirtualTreeview] Cannot select rootnode
Content-Type: text/plain; charset=iso-8859-2
Content-Transfer-Encoding: 7bit
X-UIDL: 1765
Status: U

Hi,

Can anyone tell me why the code below for adding rootnodes doesn't work. The
following behaviour occurs: I cannot select any rootnodes by clicking with
the mouse. Only when clicking between de treeline and the nodetext the node
will be selected. Clicking on the node text itself doesn't work. Once the
node is selected this way after that I can select it the normal way.

The child node added to the first node is selectable with the mouse when the
tree is expanded, but it's parent node is not selectable.

Here's the code I use to add rootnodes:

My guess is that it occurs because I don't explicitly set rootnodecount, but
if that's the cause shouldn't VT raise an exception instead of providing
this 'strange' behaviour ?

Type
TpTestRec = ^TTestRec;
TTestRec = record
Name: string;
end;

var
TestRec: TpTestRec;

procedure TForm1.FormCreate(Sender: TObject);
Var
Node: PVirtualNode;
begin
Tree1.NodeDataSize := SizeOf(TTestRec);

Node := Tree1.AddChild(nil);
TestRec := Tree1.GetNodeData(Node);
TestRec.Name := 'RootNode 1';

Node := Tree1.AddChild(node);
TestRec := Tree1.GetNodeData(Node);
TestRec.Name := 'ChildNode 1';

Node := Tree1.AddChild(nil);
TestRec := Tree1.GetNodeData(Node);
TestRec.Name := 'RootNode 2';

Node := Tree1.AddChild(nil);
TestRec := Tree1.GetNodeData(Node);
TestRec.Name := 'RootNode 3';

end;

To unsubscribe from this group, send an email to:
VirtualTreeview-unsubscribe@egroups.com

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/


re: Cannot select rootnode

From: "Roland" [Beduerftig@S...]
Date: Fri Jun 22, 2001 7:22 am
Subject: Re: Cannot select rootnode

Good morning,

> My guess is that it occurs because I don't explicitly set
> rootnodecount, but
<snip>

try this:

procedure TForm1.FormCreate(Sender: TObject);
begin
Tree1.NodeDataSize := SizeOf(TTestRec);
end;

procedure TForm1.FormShow(Sender: TObject);
Var
Node: PVirtualNode;
begin
Tree1.BeginUpdate;

Node := Tree1.AddChild(nil);
....
..... your orginal code here

Tree1.EndUpdate;
end;

procedure TForm1.Tree1GetText(...., var Text: WideString);
begin
TestRec := Tree1.GetNodeData(Node);
Text := TestRec.Name;
end;

=> now you can expand the tree and see your own text at the nodes.

Have a nice day
Roland


interesting discussion with mike in german (!)

From: "Moritz Franckenstein" [franckenstein@a...]
Date: Fri Jun 22, 2001 7:42 am
Subject: interesting discussion with mike in german (!)

sorry, this is only for the german speaking part of the group:

i am having a very interesting mail discussion with mike about the
general structure of vt (the approach with OnInitNode and
OnInitChildren).

in my opinion there are ways to enhance it so that vt gets more
flexible regarding the user data structure and some other things
about invisible nodes and how to initialize children.

if someone wants to read this or take part, please send me an email.
i will then forward it to you or put it into the files area.

the discussion is in german and very long, so i dont want to
translate it, sorry.

-moritz

 | Replies | Author | Date
2575 | Re: interesting discussion with mike in german (! | Peter Danich | Fri 6/22/2001


re: interesting discussion with mike in german (!)

From: Bender Heri [HBender@E...]
Date: Fri Jun 22, 2001 8:10 am
Subject: RE: [VirtualTreeview] interesting discussion with mike in german (!)

Please, send it to me.

Heri

> -----Original Message-----
> From: Moritz Franckenstein [mailto:[franckenstein@a...]]
> Sent: Friday, June 22, 2001 9:43 AM
> To: [VirtualTreeview@yahoogroups.com
> Subject: [VirtualTreeview] interesting discussion with mike in german
> (!)
>
>
>
> sorry, this is only for the german speaking part of the group:
>
> i am having a very interesting mail discussion with mike about the
> general structure of vt (the approach with OnInitNode and
> OnInitChildren).
>
> in my opinion there are ways to enhance it so that vt gets more
> flexible regarding the user data structure and some other things
> about invisible nodes and how to initialize children.
>
> if someone wants to read this or take part, please send me an email.
> i will then forward it to you or put it into the files area.
>
> the discussion is in german and very long, so i dont want to
> translate it, sorry.
>
> -moritz
>
>
>
>
> To unsubscribe from this group, send an email to:
> VirtualTreeview-unsubscribe@egroups.com
>
>
>
> Your use of Yahoo! Groups is subject to
> http://docs.yahoo.com/info/terms/
>
>

Replies | Author | Date
2572 | Re: interesting discussion with mike in german ( | Moritz Franckenstein | Fri 6/22/2001


re: Full Collapse Performance (or lack of <g>)

From: Werner Lehmann [wl@b...]
Date: Fri Jun 22, 2001 9:19 am
Subject: Re: [VirtualTreeview] Full Collapse Performance (or lack of <g>)

Werner Lehmann wrote:
>
> "A node can never have the vsHasChildren flag set if it is not initialized."

While I still believe that this ("never") is not true I do *now* know what
you were up to. Again from FullCollapse():

if not (vsInitialized in Node.States) then
InitNode(Node);

repeat
if (vsHasChildren in Node.States) and (Node.ChildCount = 0) then
InitChildren(Node);

The first part about InitNode was never in question (by me). The second part
is what I do not understand. Only to clarify this.

Regards,
Werner


re: interesting discussion with mike in german (!)

From: "Moritz Franckenstein" [franckenstein@a...]
Date: Fri Jun 22, 2001 9:31 am
Subject: Re: interesting discussion with mike in german (!)

> Please, send it to me.
>
> Heri

i said: email. :)

yg hides your email address, please send me an email...

-moritz

 | Replies | Author | Date
2573 | Drag and Drop | [ls@t...] | Fri 6/22/2001


Drag and Drop

From: [ls@t...]
Date: Fri Jun 22, 2001 12:16 pm
Subject: Drag and Drop

Hi,

I've got some questions about Drag'n'Drop with VirtualTree:
I only want the users to move the child nodes to a root node and NOT
as a root node. Here is my code:

procedure TfrmMain.VSTImgDragOver(Sender: TBaseVirtualTree; Source: TObject;
Shift: TShiftState; State: TDragState; Pt: TPoint; Mode: TDropMode; var Effect:
Integer; var Accept: Boolean);
var
Trash: Integer;
begin
Accept := (PVSTData(Sender.GetNodeData(Sender.FocusedNode)).RootID =
UNKNOWN_ROOTID) and
(PVSTData(Sender.GetNodeData(Sender.GetNodeAt(Pt.x, Pt.y, True,
Trash))).PicID = UNKNOWN_PICID);
end;

procedure TfrmMain.VSTImgDragDrop(Sender: TBaseVirtualTree; Source: TObject;
DataObject: IDataObject; Formats: TFormatArray; Shift: TShiftState; Pt: TPoint;
var Effect: Integer; Mode: TDropMode);
var
i, Trash: Integer;
AttachMode : TVTNodeAttachMode;
begin
if Length(Formats) > 0 then begin
for i := 0 to High(Formats) do
if Formats[i] = CF_VIRTUALTREE then begin
// these 2 lines don't work
// if PVSTData(Sender.GetNodeData(Sender.GetNodeAt(Pt.x, Pt.y, True,
Trash))).RootID <> UNKNOWN_ROOTID then
// if not(Assigned(Sender.GetNodeAt(Pt.x, Pt.y, True, Trash))) then
AttachMode := amNowhere
else
case Mode of
dmAbove : AttachMode := amInsertBefore;
dmOnNode : AttachMode := amAddChildLast;
dmBelow : AttachMode := amInsertAfter;
else if Assigned(Source) and (Source is TBaseVirtualTree) and (Sender <>
Source) then
AttachMode := amInsertBefore
else
AttachMode := amNowhere;
end;//case
Sender.ProcessDrop(DataObject, Sender.DropTargetNode, Effect, AttachMode);
Break;
end;//if
end;//if
end;

Does anybody have a solution?

--------------------------------------------------
tpm taberna pro medicum
Physik und Elektronik in der Medizintechnik GmbH

Dipl.-Ing. Lars Söding
eMail: [ls@t...]
--------------------------------------------------


VET - Stackoverflow

From: Steffen Binas [steffen.binas@a...]
Date: Fri Jun 22, 2001 1:05 pm
Subject: VET - Stackoverflow

I found serious a bug in Version 1.1.7, maybe you already fixed it:

1. Option voAutoExpand is set
2. Browse to a directory:
VirtualTreeExplorer1.BrowseTo('c:\winnt\system32', True, True, False,
False);
3. Now Click on '+' at 'c:\winnt' (directory has to be min. 2 levels above)
to collapse it -> stack overflow

Regards
Steffen

 | Replies | Author | Date
2576 | Re: VET - Stackoverflow | Jim Kueneman | Fri 6/22/2001


re: interesting discussion with mike in german (!)

From: "Peter Danich" [Support@d...]
Date: Fri Jun 22, 2001 2:18 pm
Subject: Re: [VirtualTreeview] interesting discussion with mike in german (!)

Moritz, I am also interested in this e-mail discussion. Please be so kind and
let me also have a copy of it.
Thanks,
peter
----- Original Message -----
From: Moritz Franckenstein
To: VirtualTreeview@yahoogroups.com
Sent: Friday, June 22, 2001 9:42 AM
Subject: [VirtualTreeview] interesting discussion with mike in german (!)

sorry, this is only for the german speaking part of the group:

i am having a very interesting mail discussion with mike about the
general structure of vt (the approach with OnInitNode and
OnInitChildren).

in my opinion there are ways to enhance it so that vt gets more
flexible regarding the user data structure and some other things
about invisible nodes and how to initialize children.

if someone wants to read this or take part, please send me an email.
i will then forward it to you or put it into the files area.

the discussion is in german and very long, so i dont want to
translate it, sorry.

-moritz

Yahoo! Groups Sponsor

To unsubscribe from this group, send an email to:
VirtualTreeview-unsubscribe@egroups.com

Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.

[Non-text portions of this message have been removed]


re: VET - Stackoverflow

From: "Jim Kueneman" [jimdk@m...]
Date: Fri Jun 22, 2001 3:02 pm
Subject: Re: VET - Stackoverflow

--- In [VirtualTreeview@y...], Steffen Binas [steffen.binas@a...] wrote:
> 3. Now Click on '+' at 'c:\winnt' (directory has to be min. 2
levels above)
> to collapse it -> stack overflow

Steffen

Thanks, fixed.

Jim


re: Cannot select rootnode

From: "Franc v/d Westelaken" [F.vdwestelaken@c...]
Date: Fri Jun 22, 2001 6:57 pm
Subject: RE: [VirtualTreeview] Cannot select rootnode

Hi Jim,

> Sure post it in the files area a nd I will look at it tonight.

I took the liberty to create a folder called 'Test projects' and posted my
test program there under the name 'NoRootNodeSelect.zip'.

Franc.

 | Replies | Author | Date
2579 | Re: Cannot select rootnode | Jim Kueneman | Fri 6/22/2001
2580 | Re: Cannot select rootnode | Franc v/d Westelaken | Fri 6/22/2001


re: VET feature request

From: "Mike Lischke" [lists@l...]
Date: Fri Jun 22, 2001 7:30 pm
Subject: RE: [VirtualTreeview] VET feature request

Hi Kostas,

> This would be better handled if you used my "TVirtualExplorerTreeColumn"
> approach, don't you think Jim?
>
> Maybe it's time to put some pressure on Mike to get the CreateColumn virtual
> method? After all it's only 4-6 lines of code to be changed...

Well, I don't know if it only is 4-6 lines of code, but often it is forgotten
that I have to test such changes in a large context. With VT approaching
already the 24K lines mark it becomes more and more difficult to test all
possible cases. This is one reason why a control cannot grow endlessly. I will
however consider what you suggested :o]

Ciao, Mike


re: Cannot select rootnode

From: "Jim Kueneman" [jimdk@m...]
Date: Fri Jun 22, 2001 8:50 pm
Subject: Re: Cannot select rootnode

--- In [VirtualTreeview@y...], "Franc v/d Westelaken"
[F.vdwestelaken@c...] wrote:
> Hi Jim,
>
> > Sure post it in the files area a nd I will look at it tonight.
>
> I took the liberty to create a folder called 'Test projects' and
posted my
> test program there under the name 'NoRootNodeSelect.zip'.
>
> Franc.

Hi Franc,

The problem is VT is asking for the caption (calling GetText) during
the AddChild call and at that time your data is not yet filled in. I
believe Werner already guessed this.

His solution was to call InvalidateNode after you added your data. A
more efficent solution is to wrap your node additions with

Tree1.BeginUpdate

....Add nodes and fill in user data

Tree1.EndUpdate

That holds off GetText until after your nodes are fully initialized.

A second solution could be to use InitNode and fill your custom data
there.

Jim

 | Replies | Author | Date
2580 | Re: Cannot select rootnode | Franc v/d Westelaken | Fri 6/22/2001


re: Re: Cannot select rootnode

From: "Franc v/d Westelaken" [F.vdwestelaken@c...]
Date: Fri Jun 22, 2001 9:03 pm
Subject: RE: [VirtualTreeview] Re: Cannot select rootnode

Hi All,

thanks for your suggestions.I've implemented the changes you suggested and
everything works as it should.

Thanks again,
Franc.

[Non-text portions of this message have been removed]


OLE Drag and Drop (and a typo)

From: Werner Lehmann [wl@b...]
Date: Fri Jun 22, 2001 11:03 pm
Subject: OLE Drag and Drop (and a typo)

Hi Mike,

you have a typo here:

function GetDragManger: IVTDragManager;

(The same typo even in the comment to the implementation of the function :)

Now to my actual problem. Situation is that I want to use a VTree as a drop
source
for CF_HDROP (filenames). I have spent the last 1.5 hours with studying the
current
OLE drag and drop situation (and one afternoon yesterday to even find out how
OLE
DAD works at all). I am now 'quite' comfortable with it but have not written a
single
line implementing IDropSource, IDropTarget, IDataObject or IEnumFormatETC.

It occurs to me that I have to do this (once) to make VT offer CF_HDROP:

RegisterVTClipboardFormat(CF_HDROP, TVirtualStringTree, 0);

This is where the going gets (a little bit) tough. This alone does not suffice
to
make VTree actually offer the format. Or so it seems because the windows desktop
does not accept the drop. I can only imagine that windows call
IDataObject.GetData
right away which leads to the second problem: the tree only renders
CF_VTREFERENCE
(of course). How can I provide my CF_HDROP data?

I see three possibilities:

- inherit from TVirtualStringTree, override RenderOLEData, but I'd rather avoid
that because it means to create a limited-to-one-project component.

- handle the event OnCreateDataObject. I could inherit a descendant from
TVTDataObject
and re-implement GetData. Probably the best approach so far.

- handle the event OnCreateDragManager. This is basically a superset of the
previous
possibility and overkill.

What I am really looking for is something like an event:

TVTRenderOLEDataEvent = procedure(Sender: TBaseVirtualTree; const
FormatEtcIn: TFormatEtc;
out Medium: TStgMedium; ForClipboard: Boolean; var Result: HResult) of
object;

Or, even better since only TYMED_HGLOBAL is supported (which is ok by me):

TVTRenderOLEDataEvent = function(Sender: TBaseVirtualTree; const FormatEtcIn:
TFormatEtc;
out GlobalHandle: HGLOBAL; ForClipboard: Boolean): Boolean of object;

Is there a fourth and better possibility that I missed or can one of these
event be
implemented?

Regards,
Werner

 | Replies | Author | Date
2582 | Re: OLE Drag and Drop (and a typo) | Jim Kueneman | Fri 6/22/2001
2583 | Re: OLE Drag and Drop (and a typo) | Werner Lehmann | Sat 6/23/2001
2586 | Re: OLE Drag and Drop (and a typo) | Jim Kueneman | Sat 6/23/2001
2735 | Re: OLE Drag and Drop (and a typo) | Mike Lischke | Thu 6/28/2001
2588 | Re: OLE Drag and Drop (and a typo) | Teus de Jong | Sat 6/23/2001
2589 | Re: OLE Drag and Drop (and a typo) | Jim Kueneman | Sat 6/23/2001
2736 | Re: OLE Drag and Drop (and a typo) | Mike Lischke | Thu 6/28/2001
2591 | Re: OLE Drag and Drop (and a typo) | Werner Lehmann | Sat 6/23/2001
2592 | Re: OLE Drag and Drop (and a typo) | Werner Lehmann | Sat 6/23/2001


re: OLE Drag and Drop (and a typo)

From: "Jim Kueneman" [jimdk@m...]
Date: Fri Jun 22, 2001 11:36 pm
Subject: Re: OLE Drag and Drop (and a typo)

--- In [VirtualTreeview@y...], Werner Lehmann [wl@b...] wrote:
> Hi Mike,
>
> Now to my actual problem. Situation is that I want to use a VTree as
a drop source
> for CF_HDROP (filenames). I have spent the last 1.5 hours with
studying the current

Hi Werner,

In case you missed it there is problem with the following function. I
needs a call to UpdateList.

function TVTDataObject.EnumFormatEtc(Direction: Integer; out
EnumFormatEtc: IEnumFormatEtc): HResult;

var
NewList: TEnumFormatEtc;

begin
Result := E_FAIL;
if Direction = DATADIR_GET then
begin
NewList := TEnumFormatEtc.Create(FOwner);

THIS LINE IS ADDED *********
NewList.UpdateList(Owner);
***************************
EnumFormatEtc := NewList as IEnumFormatEtc;
Result := S_OK;
......
end

Also, I think Mike forgot to give us an event (or expected
TTVDataObject to be overridden evertime). Overriding the DataObjecct
is not that hard you only have to override GetData (you also have to
make GetData virtual in TTVDataObject, Mike is making all the methods
virtual in the next version)

Jim


re: Re: OLE Drag and Drop (and a typo)

From: Werner Lehmann [wl@b...]
Date: Sat Jun 23, 2001 12:22 am
Subject: Re: [VirtualTreeview] Re: OLE Drag and Drop (and a typo)

Hi Jim,

> In case you missed it there is problem with the following function. I
> needs a call to UpdateList.

thank you, I saw the message but did not recall it now that I am using
this stuff.

The desktop still does not accept my dragging, and a test drop target
reveals that these formats are offered (after the fix was applied):

Virtual Tree Reference
Virtual Tree Data
CF_UNICODETEXT
CF_TEXT

> Also, I think Mike forgot to give us an event (or expected
> TTVDataObject to be overridden evertime). Overriding the DataObjecct
> is not that hard you only have to override GetData (you also have to
> make GetData virtual in TTVDataObject, Mike is making all the methods
> virtual in the next version)

This is what I was up to, too. Apparently I did not make myself clear enough :)

I am not sure why GetData must be virtual. If I use OnCreateDataObject
I return an IDataObject which will/should be used instead. Therefore
VTree does not use a TVTDataObject (only my descendant whose GetData
is only available via its IDataObject interface, thus GetData should
lead to the latest implementation, virtual or not).

Regards,
Werner

 | Replies | Author | Date
2586 | Re: OLE Drag and Drop (and a typo) | Jim Kueneman | Sat 6/23/2001
2735 | Re: OLE Drag and Drop (and a typo) | Mike Lischke | Thu 6/28/2001


Please a newsgroup

From: "Jhon Doe" [maniac_n@h...]
Date: Sat Jun 23, 2001 1:58 am
Subject: Please a newsgroup

Please a newsgroup, HI mike I just want to tell you that I think that this
isnt the best way to handle the mailing list, I receive from 30 to 40 emails
from yahoogroups while some are interesting that doesn't happens to all, so
I would like to suggest you if possible to find a better way for communicate
like a newsgroup or something

good bye
_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.

 | Replies | Author | Date
2585 | Re: Please a newsgroup | Ariel Selig | Sat 6/23/2001
2590 | Re: Please a newsgroup | Werner Lehmann | Sat 6/23/2001
2733 | Re: Please a newsgroup | Mike Lischke | Thu 6/28/2001
2748 | Re: Please a newsgroup | Moritz Franckenstein | Thu 6/28/2001
2739 | Re: Please a newsgroup | Peter Danich | Thu 6/28/2001
2816 | Re: Please a newsgroup | Mike Lischke | Sun 7/1/2001
2743 | Re: Please a newsgroup | Werner Lehmann | Thu 6/28/2001
2746 | Re: Please a newsgroup | Peter Danich | Thu 6/28/2001
2747 | Re: Please a newsgroup | [tias@m...] | Thu 6/28/2001


re: Please a newsgroup

From: "Ariel Selig" [asel98@y...]
Date: Sat Jun 23, 2001 2:56 am
Subject: Re: Please a newsgroup

u can change settings to not recibe emails... like me :)
and then go to groups.yahoo.com and read the msgs when u want,
search, etc.


re: Re: OLE Drag and Drop (and a typo)

From: Jim Kueneman [jimdk@m...]
Date: Sat Jun 23, 2001 3:23 am
Subject: Re: [VirtualTreeview] Re: OLE Drag and Drop (and a typo)

At 02:22 AM 6/23/2001 +0200, you wrote:
>Virtual Tree Reference
>Virtual Tree Data
>CF_UNICODETEXT
>CF_TEXT

I don't understand how this registration is suppose to work. The problem
is the clipboard type must be displayed in the object inspector and set to
true. I thought if one typed in the string assiciated with the clipboard
format (in your case "File Name(s)" which Mike assigned to CF_HDROP) it
would be added to the list, this is not the case. If it did the OI would
have to be rebuilt to add the new boolean value to the expandable list (I
think). If it is not in this list when the property streams in it replaces
the contents of the internal clipboard format, which has the CF_DROP in it
from RegisterVTClipboardFormat, and replaces it with the strings selected
in the OI. If you put the RegisterVTClipboardFormat in the
VirtualTrees.pas then it appears in the OI and you can set it to
"true". After that CF_HDROP in in the OLE IEnumFormatEtc object will
return the CF_HDROP and the the desktop will accept it.

I am not sure how clipboard formats can be added, except by putting them in
the initialization section of VirtualTrees.pas and recompile the package.

Mike?

>I am not sure why GetData must be virtual. If I use OnCreateDataObject
>I return an IDataObject which will/should be used instead. Therefore
>VTree does not use a TVTDataObject (only my descendant whose GetData
>is only available via its IDataObject interface, thus GetData should
>lead to the latest implementation, virtual or not).

Try it. The debugger will not show any dots next to your new GetData
code! It is because it is an interface method. Somewhere in the D5
documentation there is an example of this which I alway have a hard time
finding but this is a quote from the documentation

"Descendant classes can change the way a specific interface method is
implemented by overriding the implementing method. This requires that the
implementing method be virtual or dynamic."

Jim

 | Replies | Author | Date
2735 | Re: OLE Drag and Drop (and a typo) | Mike Lischke | Thu 6/28/2001


german discussion: New YG...

From: "Moritz Franckenstein" [franckenstein@a...]
Date: Sat Jun 23, 2001 8:55 am
Subject: german discussion: New YG...

our german mail-discussion can now be continued here:

http://groups.yahoo.com/group/VirtualTreeview_de

-Moritz


re: Re: OLE Drag and Drop (and a typo)

From: "Teus de Jong" [teusjdejong@p...]
Date: Sat Jun 23, 2001 10:31 am
Subject: Re: [VirtualTreeview] Re: OLE Drag and Drop (and a typo)

Jim & Werner,

> I don't understand how this registration is suppose to work. The problem
> is the clipboard type must be displayed in the object inspector and set to
> true. I thought if one typed in the string assiciated with the clipboard
> format (in your case "File Name(s)" which Mike assigned to CF_HDROP) it
> would be added to the list, this is not the case. If it did the OI would
> have to be rebuilt to add the new boolean value to the expandable list (I
> think). If it is not in this list when the property streams in it
replaces
> the contents of the internal clipboard format, which has the CF_DROP in it
> from RegisterVTClipboardFormat, and replaces it with the strings selected
> in the OI. If you put the RegisterVTClipboardFormat in the
> VirtualTrees.pas then it appears in the OI and you can set it to
> "true". After that CF_HDROP in in the OLE IEnumFormatEtc object will
> return the CF_HDROP and the the desktop will accept it.
>
> I am not sure how clipboard formats can be added, except by putting them
in
> the initialization section of VirtualTrees.pas and recompile the package.

I think te easiest way is to add the formats in the initialization section.
But you can do it somewhere else. I have tested this and it works. After the
formats are registered you set your own drop formats something like:

for t:=0 to myFormats.Count-1 do
ClipBoardFormats.Add(GetVTClipboardFormatDescription(myFormats[t]));

The problem I had - and maybe that's the reason dragging to the desktop is
not working for Werner - is that you have to readd your own formats when the
handle of VT is recreated. Something like this:

procedure TMyTree.CreateWnd;
var
Isdroptarget: Boolean;
begin

IsDroptarget:= <some routine to check if your formats are there>

inherited;

if IsDroptarget then
Setmydroptargets; // some routine to add you droptargets.
end;

After this change, just override DoRenderData to deliver your own formats
and that's it. Everything works in my app.

Hope this helps a bit.

Teus de Jong

 | Replies | Author | Date
2589 | Re: OLE Drag and Drop (and a typo) | Jim Kueneman | Sat 6/23/2001
2736 | Re: OLE Drag and Drop (and a typo) | Mike Lischke | Thu 6/28/2001


re: Re: OLE Drag and Drop (and a typo)

From: Jim Kueneman [jimdk@m...]
Date: Sat Jun 23, 2001 12:44 pm
Subject: Re: [VirtualTreeview] Re: OLE Drag and Drop (and a typo)

At 12:31 PM 6/23/2001 +0200, you wrote:

Hi Teus,

I was hoping you would jump in since I knew you had got this working.

>formats are registered you set your own drop formats something like:
>
>for t:=0 to myFormats.Count-1 do
> ClipBoardFormats.Add(GetVTClipboardFormatDescription(myFormats[t]));
>
>After this change, just override DoRenderData to deliver your own formats
>and that's it. Everything works in my app.

Ok I see how you got it working but it was not as "RAD" as it should
be. It should not be necessary to create a decendant of VT to do
this. You also did not use the object inspector to add you new OLE
format. After looking at the implementation Mike has added a lot of great
features to make OLE dragging easy but I am either missing how to take
advantage of them or there is something missing.

I think only Mike can explain what he had in mind. "Help us O' great
creator of VT" <g>

Jim

 | Replies | Author | Date
2736 | Re: OLE Drag and Drop (and a typo) | Mike Lischke | Thu 6/28/2001


re: Please a newsgroup

From: Werner Lehmann [wl@b...]
Date: Sat Jun 23, 2001 12:11 pm
Subject: Re: [VirtualTreeview] Please a newsgroup

Dear John Doe,

I would prefer a newsgroup, too. But face it: YG provides a free service and
you can start right away. AFAIK a newsgroup requires some lengthy negotiation
and voting process and you have to find a news server which carries your group.

I suggest that you switch to digest mode or read the postings on the web as
Ariel said.

Werner


re: Re: OLE Drag and Drop (and a typo)

From: Werner Lehmann [wl@b...]
Date: Sat Jun 23, 2001 12:28 pm
Subject: Re: [VirtualTreeview] Re: OLE Drag and Drop (and a typo)

Teus,

> I think te easiest way is to add the formats in the initialization section.
> But you can do it somewhere else. I have tested this and it works. After the
> formats are registered you set your own drop formats something like:
>
> for t:=0 to myFormats.Count-1 do
> ClipBoardFormats.Add(GetVTClipboardFormatDescription(myFormats[t]));
>
> The problem I had - and maybe that's the reason dragging to the desktop is
> not working for Werner - is that you have to readd your own formats when the
> handle of VT is recreated. Something like this:
>
> procedure TMyTree.CreateWnd;
> var
> Isdroptarget: Boolean;
> begin
>
> IsDroptarget:= <some routine to check if your formats are there>
>
> inherited;
>
> if IsDroptarget then
> Setmydroptargets; // some routine to add you droptargets.
> end;
>
> After this change, just override DoRenderData to deliver your own formats
> and that's it. Everything works in my app.

DoRenderData? You must have an old version, this method only exists in the
help. RenderOLEData is the new name.

But my goal is not to get it to work in any possible way (for the time being).
I want to avoid having to create a descendant. You can present any node data
without creating a descendant. So why should I have to do that only to provide
clipboard formats?

I will keep your hint with CreateWnd in mind though in case I'll must do it
like this.

Regards,
Werner


re: Re: OLE Drag and Drop (and a typo)

From: Werner Lehmann [wl@b...]
Date: Sat Jun 23, 2001 12:52 pm
Subject: Re: [VirtualTreeview] Re: OLE Drag and Drop (and a typo)

Jim Kueneman wrote:
>
> At 02:22 AM 6/23/2001 +0200, you wrote:
> >Virtual Tree Reference
> >Virtual Tree Data
> >CF_UNICODETEXT
> >CF_TEXT
>
> I don't understand how this registration is suppose to work. The problem
> is the clipboard type must be displayed in the object inspector and set to
> true. I thought if one typed in the string assiciated with the clipboard
> format (in your case "File Name(s)" which Mike assigned to CF_HDROP) it
> would be added to the list, this is not the case. If it did the OI would
> have to be rebuilt to add the new boolean value to the expandable list (I
> think). If it is not in this list when the property streams in it replaces

I am not sure if it is even possible to make the OI rebuild the nested property
without recompiling the design time package.

> the contents of the internal clipboard format, which has the CF_DROP in it
> from RegisterVTClipboardFormat, and replaces it with the strings selected
> in the OI. If you put the RegisterVTClipboardFormat in the

This is a valid point. Currently I am registering my format in one init'
section of a different unit. This is probably before the VTree has .Loaded().
But sadly no difference if I register the format in FormShow of the form
that contains the VTree.

> VirtualTrees.pas then it appears in the OI and you can set it to
> "true". After that CF_HDROP in in the OLE IEnumFormatEtc object will
> return the CF_HDROP and the the desktop will accept it.
>
> I am not sure how clipboard formats can be added, except by putting them in
> the initialization section of VirtualTrees.pas and recompile the package.

Jim,

I believe that this is the way that Mike had in mind. AFAICS you are not
supposed to add strings to the property via object inspector property editor.
Instead Mike's approach provides a possibility to toggle the use of single
clipboard formats on/off (contained as name in the stringlist). By using a
'faked' nested property. Descendants do only have to care about the clipboard
formats stringlist and the items of this list are automagically 'toggleable' at
design time. If I am right it would be desirable to get rid of the ellipsis
button in OI which display the standard stringlist property editor.

> >I am not sure why GetData must be virtual. If I use OnCreateDataObject
> >I return an IDataObject which will/should be used instead. Therefore
> >VTree does not use a TVTDataObject (only my descendant whose GetData
> >is only available via its IDataObject interface, thus GetData should
> >lead to the latest implementation, virtual or not).
>
> Try it. The debugger will not show any dots next to your new GetData
> code! It is because it is an interface method. Somewhere in the D5
> documentation there is an example of this which I alway have a hard time
> finding but this is a quote from the documentation
>
> "Descendant classes can change the way a specific interface method is
> implemented by overriding the implementing method. This requires that the
> implementing method be virtual or dynamic."

You are right. I modified my little test project (you may remember that posting
1-2 weeks ago) and it clearly shows that the virtual directive is required
even though only interfaces are passed, not objects.

I will start with exactly this and try if my own GetData brings some success.

Regards,
Werner

PS: What I forgot to mention: the format registration is only valid for
whole tree classes, like this:

RegisterVTClipboardFormat(CF_HDROP, TVirtualStringTree, 0);

But not all of my TVirtualStringTrees provide that format. I would rather
specify an instance here.

Is it really correct and by design that I can display any node data in an
off-the-shelf VTree but in order to provide (equally specialized clipboard
formats) have to derive a new descendant (which will then be specialized as
well)?

 | Replies | Author | Date
2593 | Re: OLE Drag and Drop (and a typo) | Jim Kueneman | Sat 6/23/2001
2738 | Re: OLE Drag and Drop (and a typo) | Mike Lischke | Thu 6/28/2001
2737 | Re: OLE Drag and Drop (and a typo) | Mike Lischke | Thu 6/28/2001


re: Re: OLE Drag and Drop (and a typo)

From: Jim Kueneman [jimdk@m...]
Date: Sat Jun 23, 2001 1:26 pm
Subject: Re: [VirtualTreeview] Re: OLE Drag and Drop (and a typo)

At 02:52 PM 6/23/2001 +0200, you wrote:

>PS: What I forgot to mention: the format registration is only valid for
>whole tree classes, like this:
>
> RegisterVTClipboardFormat(CF_HDROP, TVirtualStringTree, 0);
>
>But not all of my TVirtualStringTrees provide that format. I would rather
>specify an instance here.
>
>Is it really correct and by design that I can display any node data in an
>off-the-shelf VTree but in order to provide (equally specialized clipboard
>formats) have to derive a new descendant (which will then be specialized as
>well)?

If you register the format in VirtualTree.pas so it appears in the OI you
simply turn off CF_HDROP for that. If you don't already have it Graham
Wideman has a great set of demo programs for OLE drag and drop that I use
all the time in debugging OLE problems:

http://www.wideman-one.com/gw/tech/Delphi/dragdrop/index.htm

by turning off the particular format that format is no longer valid when
the target window Querys the IDataObject so you get your instance by
instance selection though the OI. The target window decides if it can
accept a format then decides if it wants to accept that format, easily done
in the non-existent DoRenderData event :^)

My vision how this should work is to be able to enter new OLE clipboard
formats, either predefined in windows or my own custom formats, through the
OI which define what formats the VT can present. Then an event in to
Render the data when the target window asks for it.

I think we need to wait for Mike to explain how he envisioned it to work.

Jim

 | Replies | Author | Date
2738 | Re: OLE Drag and Drop (and a typo) | Mike Lischke | Thu 6/28/2001


How to print the complete tree ?

From: [tias@m...]
Date: Sat Jun 23, 2001 5:10 pm
Subject: How to print the complete tree ?

Hi !

Using VT version 2.4.23 (in BCB5), I seem to be unable to print the
complete tree. I'm trying to use PaintTo(Bitmap->Handle,Left,Top)
method.
This worked a long time ago (VT 1.31) but now when I'm trying the same
code again it gives me an "Out of resource exception".

This happens in a derived (from CustomVirtualStringTree) component as
in a "simple" VirtualStringTree as well.

The "Bitmap" I'm reffering to in the call to to PaintTo() is a temp.
Bitmap with this size :

Bm = new Graphics::TBitmap();
TRect tr = Tree->GetTreeRect();
Bm->Width = tr.Right - tr.Left; // TreeWidth;
Bm->Height = tr.Bottom - tr.Top; // TreeHeight;

Then it's drawn on the printer canvas.

Tracing into VirtualTrees.pas, I found that the Window Parameter in
TBaseVirtualTree.PaintTree() has a Right-value greater than 2100000
something...

Or is there better way to print the complete tree ?

TIA,
Mathias Thorell
Senior Flight Test Engineer
Saab Technologies AB

 | Replies | Author | Date
2772 | Re: How to print the complete tree ? | Mike Lischke | Fri 6/29/2001
2907 | Re: How to print the complete tree ? | Mathias Thorell | Thu 7/5/2001
2908 | Re: How to print the complete tree ? | Jim Kueneman | Thu 7/5/2001
2917 | Re: How to print the complete tree ? | Mathias Thorell | Fri 7/6/2001
2911 | Re: How to print the complete tree ? | Werner Lehmann | Fri 7/6/2001
2918 | Re: How to print the complete tree ? | Mathias Thorell | Fri 7/6/2001


re: Re: OLE Drag and Drop (and a typo)

From: "Teus de Jong" [teusjdejong@p...]
Date: Sat Jun 23, 2001 6:51 pm
Subject: Re: [VirtualTreeview] Re: OLE Drag and Drop (and a typo)

Hi Jim,

> Ok I see how you got it working but it was not as "RAD" as it should
> be. It should not be necessary to create a decendant of VT to do
> this. You also did not use the object inspector to add you new OLE
> format. After looking at the implementation Mike has added a lot of great
> features to make OLE dragging easy but I am either missing how to take
> advantage of them or there is something missing.

It is as RAD as it should be. I have all the OLE-formats in the object
inspector, for all VT's. I have put those lines in the initialization
section of my unit:

RegisterVTClipboardFormat(CF_HDROP, TBaseVirtualTree, 0);
CF_IDList:=RegisterVTClipboardFormat(CFSTR_SHELLIDLIST, TBaseVirtualTree,
1);
CF_PrefDrop:=RegisterVTClipboardFormat(CFSTR_PREFERREDDROPEFFECT,
TBaseVirtualTree, 2);
CF_Filename:=RegisterVTClipboardFormat(CFSTR_FILENAME, TBaseVirtualTree,
3);

So, now _all_ TBaseVirtualTrees and its descendants have those formats in
the object inspector. I said that in my component I use:

for t:=0 to myFormats.Count-1 do
ClipBoardFormats.Add(GetVTClipboardFormatDescription(myFormats[t]));

but when I don't do this and select the relevant formats in the object
inspector, it works also (with the caveat of RecreateWnd). If I drop a
standard VT on the form, it also has these formats in the object inspector.
The only reason you need a descendant is to add the rendering of the added
formats in DoRenderOledata. Surely, you can't expect Mike to render all
possible data?

greetings,

Teus de Jong

 | Replies | Author | Date
2598 | Re: OLE Drag and Drop (and a typo) | Jim Kueneman | Sat 6/23/2001


re: Re: OLE Drag and Drop (and a typo)

From: "Teus de Jong" [teusjdejong@p...]
Date: Sat Jun 23, 2001 6:55 pm
Subject: Re: [VirtualTreeview] Re: OLE Drag and Drop (and a typo)

Hi Werner,

> DoRenderData? You must have an old version, this method only exists in the
> help. RenderOLEData is the new name.

Sorry, I meant RenderOLEData.

> But my goal is not to get it to work in any possible way (for the time
being).
> I want to avoid having to create a descendant. You can present any node
data
> without creating a descendant. So why should I have to do that only to
provide
> clipboard formats?

See my answer to Jim. If you put

RegisterVTClipboardFormat(CF_HDROP, TBaseVirtualTree, 0);
CF_IDList:=RegisterVTClipboardFormat(CFSTR_SHELLIDLIST, TBaseVirtualTree,
1);
CF_PrefDrop:=RegisterVTClipboardFormat(CFSTR_PREFERREDDROPEFFECT,
TBaseVirtualTree, 2);
CF_Filename:=RegisterVTClipboardFormat(CFSTR_FILENAME, TBaseVirtualTree,
3);

in the Initialization section of your unit, _all_ VT's will have those
formats in the object inspector. The only reason I see to have a descendant
is to override RenderOLEData to render the formats you added. Maybe this can
be done by the DataObject. But in some way, you have to render the data you
added.

Teus de Jong.


re: Re: OLE Drag and Drop (and a typo)

From: "Teus de Jong" [teusjdejong@p...]
Date: Sat Jun 23, 2001 7:08 pm
Subject: Re: [VirtualTreeview] Re: OLE Drag and Drop (and a typo)

Hi Jim,

> My vision how this should work is to be able to enter new OLE clipboard
> formats, either predefined in windows or my own custom formats, through
the
> OI which define what formats the VT can present. Then an event in to
> Render the data when the target window asks for it.

I saw this after I sent my previous message. An event would make it possible
to avoid making a desendant (I think).

Teus de Jong.


re: Re: OLE Drag and Drop (and a typo)

From: Jim Kueneman [jimdk@m...]
Date: Sat Jun 23, 2001 9:28 pm
Subject: Re: [VirtualTreeview] Re: OLE Drag and Drop (and a typo)

At 08:51 PM 6/23/2001 +0200, you wrote:

> RegisterVTClipboardFormat(CF_HDROP, TBaseVirtualTree, 0);
> CF_IDList:=RegisterVTClipboardFormat(CFSTR_SHELLIDLIST, TBaseVirtualTree,
>1);
> CF_PrefDrop:=RegisterVTClipboardFormat(CFSTR_PREFERREDDROPEFFECT,
>TBaseVirtualTree, 2);
> CF_Filename:=RegisterVTClipboardFormat(CFSTR_FILENAME, TBaseVirtualTree,
>3);
>
>So, now _all_ TBaseVirtualTrees and its descendants have those formats in
>the object inspector. I said that in my component I use:

This is not working for me. I added

initialization
RegisterVTClipboardFormat(CF_HDROP, TCustomVirtualStringTree, 0);

in my unit and nothing in the object inspector. Does the IDE actually run
the program unit so this code is executed in design time? I am not very
knowledgable in the IDE and property editors.

So for the way you did this if there was an event to Render the data the
decendant VT is unnecessary?

Jim


re: Re: OLE Drag and Drop (and a typo)

From: "Teus de Jong" [teusjdejong@p...]
Date: Sat Jun 23, 2001 9:54 pm
Subject: Re: [VirtualTreeview] Re: OLE Drag and Drop (and a typo)

Hi Jim,

> This is not working for me. I added
>
> initialization
> RegisterVTClipboardFormat(CF_HDROP, TCustomVirtualStringTree, 0);
>
> in my unit and nothing in the object inspector. Does the IDE actually
run
> the program unit so this code is executed in design time? I am not very
> knowledgable in the IDE and property editors.

I experimented somewhat with it and discovered that I only get the new
formats in the IDE if the RegisterVTClipboardFormat statemaents are in the
initialization section of a component that is part of an installed package.
It does not work if you just put in in the initialization of a form. This
means that, to avoid a descendant, you have to add them to one of the
components of the VT package. In your case it could be done in the
initialization section of VirtualExplorerTree. In a 'worst case scenario' it
could be patched into Mike's initialization routine.

> So for the way you did this if there was an event to Render the data the
> decendant VT is unnecessary?

I think to deliver the rendered data, the answer is yes. I haven't tried
this though.

Teus de Jong.


re: Re: OLE Drag and Drop

From: Werner Lehmann [wl@b...]
Date: Sun Jun 24, 2001 12:34 am
Subject: Re: [VirtualTreeview] Re: OLE Drag and Drop

Hi,

I have now managed to make the desktop accept a CF_HDROP drag:

- in init' section of any unit:

RegisterVTClipboardFormat(CF_HDROP, TVirtualStringTree, 0);

(probably not a good idea since this must come after the init' section
of VirtualTrees.pas which does not seem to be guaranteed)

- in FormShow of MainForm (or any point after VTree.Loaded()):

VTree.ClipboardFormats.Add('File name(s)');

- make TVTDataObject.GetData virtual

- Override GetData in a descendant and return an instance of this in
OnCreateDataObject:

function TMyDataObject.GetData(const FormatEtcIn: TFormatEtc; out Medium:
TStgMedium): HResult;
begin
// Anything but CF_HDROP is always handled by the ancestor class.
if FormatEtcIn.cfFormat = CF_HDROP then
result := Root.GetData(Medium) // creates Medium with DROPFILES and tymed
HGLOBAL
else
result := inherited GetData(FormatEtcIn, Medium);
end;

That's it. Of course I have no design time OI choice whether CF_HDROP should
be supported or not but I can specify this in FormShow as shown above.

I can now drag a folder from my VTree to the desktop and have it copied to
this location. Unfortunately this was only step 1. I was not really up to
drag sth to the desktop but used it as a OLE drag and drop test. What I really
want (although this is nice so far) is to drop the folder on a toolbar. Instead
of implementing IDropTarget I am experimenting with Anders Melanders DragDrop
components. One of these, TDropTargetFile, can accept any CF_HDROP (among
others)
and can be associated with any TWinControl. I have set it to my toolbar and the
toolbar accepts files being dragged from explorer. But not from the VTree.

I have located the cause why the drag is not accepted.

function TVTDataObject.QueryGetData(const FormatEtc: TFormatEtc): HResult;
...
if FormatEtc.tymed = TYMED_HGLOBAL then
...

This condition is false although the cfFormat matches (FormatEtc.cfFormat =
Formats[I]).
FormatEtc.tymed is 5 while TYMED_HGLOBAL is 1. According to the win api help
there is no TYMED_* with value 5. On the other hand TYMED_GLOBAL + TYMED_ISTREAM
would be 5. Where is the problem, should the check above (in QueryGetData) be
a binary and operation or should the drop target component ask for
TYMED_HGLOBAL?
The online help is not quite clear about that...

Regards,
Werner

 | Replies | Author | Date
2602 | Re: OLE Drag and Drop | Jim Kueneman | Sun 6/24/2001
2607 | Re: OLE Drag and Drop | Werner Lehmann | Sun 6/24/2001
2608 | Re: OLE Drag and Drop | Jim Kueneman | Sun 6/24/2001
2610 | Re: OLE Drag and Drop | Werner Lehmann | Sun 6/24/2001


re: Re: OLE Drag and Drop (and a typo)

From: Werner Lehmann [wl@b...]
Date: Sun Jun 24, 2001 12:39 am
Subject: Re: [VirtualTreeview] Re: OLE Drag and Drop (and a typo)

Jim Kueneman wrote:
>
> If you register the format in VirtualTree.pas so it appears in the OI you
> simply turn off CF_HDROP for that. If you don't already have it Graham
> Wideman has a great set of demo programs for OLE drag and drop that I use
> all the time in debugging OLE problems:

Hopefully I will not have to modify the VirtualTrees.pas source or create
a dummy descendant. In Mike's "final" solution for this.

> http://www.wideman-one.com/gw/tech/Delphi/dragdrop/index.htm

Yes, I am using this already. Really great, he has put much effort in it
and wanted to make 100% sure that everyone understands how DnD works :)

> My vision how this should work is to be able to enter new OLE clipboard
> formats, either predefined in windows or my own custom formats, through the
> OI which define what formats the VT can present. Then an event in to
> Render the data when the target window asks for it.
>
> I think we need to wait for Mike to explain how he envisioned it to work.

Why not provide just all known formats in the OI? And if one is to be
rendered an event callback has to do the work. If I have a new format
I can create a descendant and have it in the OI or I register the format
manually after the VTree has loaded (or in another event).

Regards,
Werner


re: Re: OLE Drag and Drop

From: Jim Kueneman [jimdk@m...]
Date: Sun Jun 24, 2001 4:07 am
Subject: Re: [VirtualTreeview] Re: OLE Drag and Drop

At 02:34 AM 6/24/2001 +0200, you wrote:

>function TVTDataObject.QueryGetData(const FormatEtc: TFormatEtc): HResult;
>...
> if FormatEtc.tymed = TYMED_HGLOBAL then
>...
>
>This condition is false although the cfFormat matches (FormatEtc.cfFormat
>= Formats[I]).
>FormatEtc.tymed is 5 while TYMED_HGLOBAL is 1. According to the win api help
>there is no TYMED_* with value 5. On the other hand TYMED_GLOBAL +
>TYMED_ISTREAM
>would be 5. Where is the problem, should the check above (in QueryGetData) be
>a binary and operation or should the drop target component ask for
>TYMED_HGLOBAL?
>The online help is not quite clear about that...

Werner,

Something is wrong, TYMED is an enumeration. If you are dragging from
VT Windows calls EnumFormatEtc first to get a list of all supported
clipboard types and does it through

procedure TEnumFormatEtc.UpdateList(Tree: TBaseVirtualTree);

so you can see what TYMED is being set... always HGLOBAL.

The VT dataobject never supplies ISTREAM so it must be being corrupted
somewhere else.

I built a test program up to implementing HDrop structure which is past
where your problems are I believe.

function TMyDataObject.GetData(const FormatEtcIn: TFormatEtc; out Medium:
TStgMedium): HResult;
begin
if FormatEtcIn.cfFormat = CF_HDROP then

// Dropping on a Listbox associated with a TDropFileTarget
// makes it to here when TDropFileTarget asks for the files.
// If I return S_OK and an valid Medium structure then it would work fine.

result := E_UNEXPECTED

else
result := inherited GetData(FormatEtcIn, Medium);
end;

Jim


re: VET descendant

From: Jim Kueneman [jimdk@m...]
Date: Sun Jun 24, 2001 5:29 am
Subject: RE: [VirtualTreeview] VET descendant

Hi Mike,

I hope thing are going well, been fairly quiet on your side of the
world! I just want to let you know I implemented "KY"'s idea for creating
custom column classes and it works slick.

I have created a new TVETColumns class from TVirtualTreeColumn and
published the Header property in VET. Now it is easy to order, size, add
the header text, add new custom columns ect from within the IDE. A huge
difference in usability.

It also makes it easy for me to implement IShellFolder2 and IShellDetail
and have the columns change based on what it is displaying when VET is
emulating the Explorer Listview (like when you go into Printers or Control
Panel)

As KY suggested it was easy and should not have any effect on programs
already using VT. This is what I did:

********************************************************************************\
***
TVirtualTreeColumnClass = class of TVirtualTreeColumn;

constructor TVirtualTreeColumns.Create(AOwner: TVTHeader);
var
ColumnClass: TVirtualTreeColumnClass;
begin
ColumnClass := AOwner.FOwner.GetColumnClass;
if Assigned(ColumnClass) then
inherited Create(ColumnClass)
else
inherited Create(TVirtualTreeColumn); // Maybe this should be an
exception?
FOwner := AOwner;
FHeaderBitmap := TBitmap.Create;
FHoverIndex := NoColumn;
FDownIndex := NoColumn;
FClickIndex := NoColumn;
FDropTarget := NoColumn;
end;

// ----- TBaseVirtualTree
TBaseVirtualTree = class(TCustomControl)
.....
protected
function GetColumnClass: TVirtualTreeColumnClass; virtual;
.....
end;

// return the value currently hardcoded
// into the TVirtualTreeColumns constructor
// so legacy code will not know the difference

function TBaseVirtualTree.GetColumnClass: TVirtualTreeColumnClass;
begin
Result := TVirtualTreeColumn
end;

********************************************************************************\
*

The only other thing is it would be nice to make the Owners of
TVirtualTreeColumns and TVTHeader read only properties so when something
changes in the new TVirtualTreeColumns decendant VT can be updated. I
worked around it by using the casting trick to access the protected
GetOwner functions and did some nasty type casting:

TVirtualExplorerTree(
TVTHeaderCast(

TVirtualTreeColumnCast(Collection).GetOwner).GetOwner).Invalidate;

I hope you do concider this improvement, I can see no downside since it is
simple and should be completely transparent to existing users of VT. The
only danger comes from us who derive from VT and do something stupid. :^)

Jim

 | Replies | Author | Date
2604 | Re: VET descendant | Mike Lischke | Sun 6/24/2001
2773 | Re: VET descendant | Mike Lischke | Fri 6/29/2001


re: VET descendant

From: "Mike Lischke" [lists@l...]
Date: Sun Jun 24, 2001 8:30 am
Subject: RE: [VirtualTreeview] VET descendant

Hi Jim,

> I hope thing are going well, been fairly quiet on your side of the
> world! I just want to let you know I implemented "KY"'s idea for creating
> custom column classes and it works slick.

I'm sorry for being so silent but sometimes I have to be consequent and do
things step by step. My
real life was quite demanding lately so I could not finish the next build of
VT. This is however the
premise to answer many of the 60 message which are still in my inbox. I'll try
to answer at least a
couple messages per day but some of them cost me hours (!) to answer and they
keep me from working
on VT in the few hours I have per week.

To say at least one positive thing: I plan to have a new build ready this very
day. Then we can go
on regarding the columns and OLE clipboard/dd handling/formats.

Ciao, Mike


Bug List?

From: [hj_schnorrenberg@y...]
Date: Sun Jun 24, 2001 10:04 am
Subject: Bug List?

Does exists a buglist of the last release of VirtualTreeView?
Actually I cannot replace my VirtualtreeView by a beta release, but I
do not want to report bugs, which are already annouced.

E.G.

FullExpand(SomeNode) fails, if SomeNode has no NextSibling and a
ParentNode of SomeNode has a Sibling: then this Sibling will be
expanded, too, because GetNext yields this node!

Setting coVisible to false of then last ColumnHeader during runtime
can yield a infinite loop in painting procedure.

 | Replies | Author | Date
2774 | Re: Bug List? | Mike Lischke | Fri 6/29/2001
2792 | Re: Bug List? | Moritz Franckenstein | Sat 6/30/2001
2820 | Re: Bug List? | Mike Lischke | Sun 7/1/2001


re: Re: OLE Drag and Drop (and a typo)

From: "Teus de Jong" [teusjdejong@p...]
Date: Sun Jun 24, 2001 11:38 am
Subject: Re: [VirtualTreeview] Re: OLE Drag and Drop (and a typo)

Jim,

> >So, now _all_ TBaseVirtualTrees and its descendants have those formats in
> >the object inspector. I said that in my component I use:
>
> This is not working for me. I added
>
> initialization
> RegisterVTClipboardFormat(CF_HDROP, TCustomVirtualStringTree, 0);
>
> in my unit and nothing in the object inspector. Does the IDE actually
run
> the program unit so this code is executed in design time? I am not very
> knowledgable in the IDE and property editors.

> So for the way you did this if there was an event to Render the data the
> decendant VT is unnecessary?

As an experiment, I altered the initialization section. Instead of
registering-formats statements I added the line
{$INCLUDE VTClipboards.pas}

In this file I put

RegisterVTClipboardFormat(CF_TEXT, TCustomVirtualStringTree, 100);
RegisterVTClipboardFormat(CF_UNICODETEXT, TCustomVirtualStringTree, 95);
RegisterVTClipboardFormat(CF_HDROP, TBaseVirtualTree, 0);
RegisterVTClipboardFormat(CFSTR_SHELLIDLIST, TBaseVirtualTree, 1);
RegisterVTClipboardFormat(CFSTR_PREFERREDDROPEFFECT, TBaseVirtualTree, 2);
RegisterVTClipboardFormat(CFSTR_FILENAME, TBaseVirtualTree, 3);

Then I added an event:

TVTRenderOLEDataEvent = procedure(Sender: TBaseVirtualTree;
const FormatEtcIn: TFormatEtc; out Medium: TStgMedium;
ForClipboard: Boolean; var Res: Hresult) of object;

to VirtualTrees and to TBaseVirtualTree

private
...
FOnRenderOLEData: TVTRenderOLEDataEvent;
...
public
property OnRenderOLEData: TVTRenderOLEDataEvent read FOnRenderOLEData
write FOnRenderOLEData;

and published this property in TVirtualStringTree.

In TBaseVirtualTree.RenderOLEData at the end I added:

...
finally
Stream.Free;
end

else // <--
if assigned(FonRenderOLEData) then
FOnRenderOLEData(Self, FormatEtcIn, Medium, ForClipboard, Result);

After Recompiling the package, the formats are in the OI. and after putting
my own rendering in OnRenderData, it works. So it seems we only need an
event here.

Teus de Jong.


re: Re: OLE Drag and Drop

From: Werner Lehmann [wl@b...]
Date: Sun Jun 24, 2001 11:44 am
Subject: Re: [VirtualTreeview] Re: OLE Drag and Drop

Jim,

> Something is wrong, TYMED is an enumeration. If you are dragging from
> VT Windows calls EnumFormatEtc first to get a list of all supported
> clipboard types and does it through
>
> procedure TEnumFormatEtc.UpdateList(Tree: TBaseVirtualTree);
>
> so you can see what TYMED is being set... always HGLOBAL.
>
> The VT dataobject never supplies ISTREAM so it must be being corrupted
> somewhere else.
>
> I built a test program up to implementing HDrop structure which is past
> where your problems are I believe.
>
> function TMyDataObject.GetData(const FormatEtcIn: TFormatEtc; out Medium:
> TStgMedium): HResult;
> begin
> if FormatEtcIn.cfFormat = CF_HDROP then
>
> // Dropping on a Listbox associated with a TDropFileTarget
> // makes it to here when TDropFileTarget asks for the files.
> // If I return S_OK and an valid Medium structure then it would work fine.
>
> result := E_UNEXPECTED
>
> else
> result := inherited GetData(FormatEtcIn, Medium);
> end;

I have found the problem and am afraid it is on VTree's side. The drag target
component from Anders Melander uses IDataObject.QueryGetData with this value
as tymed:

TYMED_HGLOBAL or TYMED_ISTREAM (1 + 4 = 5)

The implementation in TVTDataObject checks for equality...

if FormatEtc.tymed = TYMED_HGLOBAL then

...and this fails. The win api help for IDataObject::EnumFormatEtc say this:

"The TYMED member of FORMATETC often indicates that more than one kind of
storage medium
is acceptable. You should always mask and test for this by using a Boolean OR
operator."

I don't know how the folks at MS test for a flag with the OR operator (I'd use
AND) but
clearly TYMED is used as a bit flag here. Therefore I suggest to change VTree
into this:

if FormatEtc.tymed and TYMED_HGLOBAL <> 0 then

Mike?

One more thing. Is there any way to show the drag image over the toolbar? I
recall
that Mike has disabled this explicitly to avoid redraw problems below the drag
image
if whatever is below changes during the drag. Well, my toolbar (=drop target)
does not
change. Is there any way to get the drag image without patching
VirtualTrees.pas?

Regards,
Werner

 | Replies | Author | Date
2608 | Re: OLE Drag and Drop | Jim Kueneman | Sun 6/24/2001


re: Re: OLE Drag and Drop

From: Jim Kueneman [jimdk@m...]
Date: Sun Jun 24, 2001 12:46 pm
Subject: Re: [VirtualTreeview] Re: OLE Drag and Drop

At 01:44 PM 6/24/2001 +0200, you wrote:
>Jim,

HI Werner,

Looks like we are beating another dead horse :^)

Are you using the version 4 Beta? Because version 3.7 does not include the
Or'd TYMED (although is does check TYMED using a bit test)

>...and this fails. The win api help for IDataObject::EnumFormatEtc say this:
>
>"The TYMED member of FORMATETC often indicates that more than one kind of
>storage medium
>is acceptable. You should always mask and test for this by using a Boolean
>OR operator."

Where did you read this? This is what I have for FormatEtc:

"tymed:

Specifies ONE of the TYMED enumeration constants which indicate the type of
storage medium used to transfer the object's data. Data can be transferred
using whatever medium makes sense for the object. For example, data can be
passed using global memory, a disk file, or structured storage objects. For
more information, see the TYMED enumeration."

Notice the ONE. ( capitalized it )

Looks like somewhere there is a failure to communicate!

I am not sure if VT is wrong but it appears there is enough contradicting
information on this subject that VT should use the bit test just in case.

>One more thing. Is there any way to show the drag image over the toolbar?
>I recall
>that Mike has disabled this explicitly to avoid redraw problems below the
>drag image
>if whatever is below changes during the drag. Well, my toolbar (=drop
>target) does not
>change. Is there any way to get the drag image without patching
>VirtualTrees.pas?

Do you mean the Taskbar? The drag image will only be shown over VT. You
can steal my implementation of IDragSourceHelper in VET on the next
release. In Win2000 the drag image works both into and out of VET as long
as the target windows supports IDragTargetHelper, which the desktop, IE,
Explorer and the Taskbar do. It looks really cool.

The only gotch is you have to implement SetData in the droptarget as that
is where the drag image is stored at the start of the drag. If you
integrate my shellutilities.pas and use the namespaces for the files you
can use the IDataObjects that the file namespace exposes through the shell
which already know how to handle this (in Win2k). I would also keep you
from having to deal with HDROP explicitly too as the shell IDataObject
already handles this.

All you really have to do is

var
NS: TNamespace;
P: PItemIDLIst;

P := ShellUtilites.PathToPIDL(FilePath);
NS := TNamespace.Create(P, nil)

then use the TNamespace properties to get a dataobject or DataObjectMulti
with an array of PIDLs from multiple calls to PathToPIDL. The file
represented by NS should be a sibling of the other files

If you want to do this let me know and I will show you in more detail.

Jim


Bold Nodes

From: "Ernest Fairchild" [efairchild@h...]
Date: Sun Jun 24, 2001 3:15 pm
Subject: Bold Nodes

Hi again, group. Another question I hope isn't too dumb <g>.

How would I go about making particular nodes bold when the rest aren't?
And/or make particular nodes non-bold when the rest are?

Have a great day!

Ernest
([efairchild@h...])

_____________________
"Law -- a subject that seems to serve two purposes: two make lawyers rich
and to make more lawyers."

Visit my website at http://www.public.asu.edu/~ernestf

 | Replies | Author | Date
2611 | Re: Bold Nodes | Werner Lehmann | Sun 6/24/2001


re: Re: OLE Drag and Drop

From: Werner Lehmann [wl@b...]
Date: Sun Jun 24, 2001 3:46 pm
Subject: Re: [VirtualTreeview] Re: OLE Drag and Drop

Hi Jim,

Jim Kueneman wrote:
>
> At 01:44 PM 6/24/2001 +0200, you wrote:
> >Jim,
>
> HI Werner,
>
> Looks like we are beating another dead horse :^)
>
> Are you using the version 4 Beta? Because version 3.7 does not include the
> Or'd TYMED (although is does check TYMED using a bit test)

yes, I have just started checking out these components. Looks as they can save
me from some interface implementation work. Therefore I began with the latest
version.

> >...and this fails. The win api help for IDataObject::EnumFormatEtc say this:
> >
> >"The TYMED member of FORMATETC often indicates that more than one kind of
> >storage medium
> >is acceptable. You should always mask and test for this by using a Boolean
> >OR operator."
>
> Where did you read this? This is what I have for FormatEtc:
>
> "tymed:
>
> Specifies ONE of the TYMED enumeration constants which indicate the type of
> storage medium used to transfer the object's data. Data can be transferred
> using whatever medium makes sense for the object. For example, data can be
> passed using global memory, a disk file, or structured storage objects. For
> more information, see the TYMED enumeration."
>
> Notice the ONE. ( capitalized it )
>
> Looks like somewhere there is a failure to communicate!

Not so IMO. As I said, go to IDataObject::EnumFormatEtc, scroll all the way down
and read the last full sentence. MSDN has the same info.

The numeric values of the TYMED enum indicate a use as bit flags, too.

I think in QueryGetData TYMED can contain a number of or'ed values to ask if
(for example) any of ISTREAM or HGLOBAL could be rendered. In GetData only
one TYMED makes sense.

> I am not sure if VT is wrong but it appears there is enough contradicting
> information on this subject that VT should use the bit test just in case.
>
> >One more thing. Is there any way to show the drag image over the toolbar?
> >I recall
> >that Mike has disabled this explicitly to avoid redraw problems below the
> >drag image
> >if whatever is below changes during the drag. Well, my toolbar (=drop
> >target) does not
> >change. Is there any way to get the drag image without patching
> >VirtualTrees.pas?
>
> Do you mean the Taskbar? The drag image will only be shown over VT. You
> can steal my implementation of IDragSourceHelper in VET on the next
> release. In Win2000 the drag image works both into and out of VET as long
> as the target windows supports IDragTargetHelper, which the desktop, IE,
> Explorer and the Taskbar do. It looks really cool.
>
> The only gotch is you have to implement SetData in the droptarget as that
> is where the drag image is stored at the start of the drag. If you
> integrate my shellutilities.pas and use the namespaces for the files you
> can use the IDataObjects that the file namespace exposes through the shell
> which already know how to handle this (in Win2k). I would also keep you
> from having to deal with HDROP explicitly too as the shell IDataObject
> already handles this.
>
> All you really have to do is
>
> var
> NS: TNamespace;
> P: PItemIDLIst;
>
> P := ShellUtilites.PathToPIDL(FilePath);
> NS := TNamespace.Create(P, nil)
>
> then use the TNamespace properties to get a dataobject or DataObjectMulti
> with an array of PIDLs from multiple calls to PathToPIDL. The file
> represented by NS should be a sibling of the other files
>
> If you want to do this let me know and I will show you in more detail.

Well at first this sounds like much work for
- getting a dragimage to show on my toolbar
- only have this working on win2k (+ xp)

You will probably object at the 'much work'. Right now I am using neither VET
nor ShellUtilities. It is on my todo list to browse through both but it will
take me a few days probably. Right now dragimages only on 2k do not justify
the effort and increase in EXE size. All I want to achieve is a kind of book-
mark / favorites toolbar and this taking already too long with all this OLE
drag and drop stuff, to be honest. Of course I learned a lot and that time is
not lost :)

Regards,
Werner


re: Bold Nodes

From: Werner Lehmann [wl@b...]
Date: Sun Jun 24, 2001 4:24 pm
Subject: Re: [VirtualTreeview] Bold Nodes

Ernest Fairchild wrote:
>
> Hi again, group. Another question I hope isn't too dumb <g>.

Not at all.

> How would I go about making particular nodes bold when the rest aren't?

Use event OnPaintText, add fsBold to the Canvas.Font.Style property for
all bold nodes.

> And/or make particular nodes non-bold when the rest are?

Set node font to bold, remove bold style in OnPaintText from non bold
nodes.

Regards,
Werner


Drag and Drop

From: "Frank van den Bergh" [frankvdbergh@y...]
Date: Sun Jun 24, 2001 7:37 pm
Subject: Drag and Drop

Hi Folks,

I want to implement a drag and drop from one VST into antother in the
same form, but with different data records.

From within a VST I use the OnLoadNode and OnSaveNode to transfer the
data (I use the command Sender.ProcessDrop(DataObject,
Sender.DropTargetNode, Effect, AttachMode); in the DragDrop function -
as in the help file).

However in the OnLoadNode I cannot see who the actual Sender is (the
stream is ok) and therefore I cannot load the stream correctly.

Any suggestions?
Thanks,

Frank van den Bergh.

 | Replies | Author | Date
2776 | Re: Drag and Drop | Mike Lischke | Fri 6/29/2001
2795 | Re: Drag and Drop | Frank van den Bergh | Sat 6/30/2001
2821 | Re: Drag and Drop | Mike Lischke | Sun 7/1/2001
3646 | Drag and Drop | [walter_falby@c...] | Tue 9/4/2001
3665 | Re: Drag and Drop | Mike Lischke | Sat 9/8/2001
3977 | Drag and Drop | Helge Jung (ECO-Logic) | Thu 10/11/2001
3978 | Re: Drag and Drop | Helge Jung (ECO-Logic) | Thu 10/11/2001
3979 | Re: Drag and Drop | Bender Heri | Thu 10/11/2001
3980 | Re: Drag and Drop | Helge Jung (ECO-Logic) | Thu 10/11/2001


New file uploaded to VirtualTreeview

From: [VirtualTreeview@yahoogroups.com>
Date: Sun Jun 24, 2001 8:24 pm
Subject: New file uploaded to VirtualTreeview

Hello,

This email message is a notification to let you know that
a file has been uploaded to the Files area of the VirtualTreeview
group.

File : /VirtualTree_2.4.34.zip
Uploaded by : [lists@l...]
Description : Beta version

You can access this file at the URL

http://groups.yahoo.com/group/VirtualTreeview/files/VirtualTree_2.4.34.zip

To learn more about file sharing for your group, please visit

http://help.yahoo.com/help/us/groups/files

Regards,

lists@l...]

 | Replies | Author | Date
2614 | Re: New file uploaded to VirtualTreeview | Mike Lischke | Sun 6/24/2001
2669 | Re: New file uploaded to VirtualTreeview | Jim Kueneman | Tue 6/26/2001
2688 | Re: New file uploaded to VirtualTreeview | Mike Lischke | Tue 6/26/2001


re: New file uploaded to VirtualTreeview

From: "Mike Lischke" [lists@l...]
Date: Sun Jun 24, 2001 8:39 pm
Subject: RE: [VirtualTreeview] New file uploaded to VirtualTreeview

Hi all,

> This email message is a notification to let you know that
> a file has been uploaded to the Files area of the VirtualTreeview
> group.

Here we are again :o] The main changes this time are various new clipboard
formats which the string
tree can supply now. Note that the RTF format still needs testing. HTML works
already quite well but
only Outlook accepts the result. Excel simply ignores it and Word crashes
(Office 2000). I do not
have other applications which accept HTML as clipboard format (at least I'm not
aware of any other).
So could anybody else check this a bit more? Btw: there is still code waiting
to output Excel
formats. The methods to render the new clipboard formats are public and can so
be used to save a
tree to a text file for instance. But be aware that indentation and column
separation both use the
same separator, hence if the main column is not the very first column you will
not be able to parse
the text file correctly because you cannot tell whether it a separator is a new
column or just the
indentation of the main column. Somehow I don't like to use two separators (and
it is sometimes also
not possible, e.g. for CF_CSV).

Jim, please download the latest build, replace your units and upload it again
without version change
of the main distribution.

All, the new file is also available from the beta folder on my homepage.

Having worked today nearly 10 hours in a row I want to stop now and relax a
bit. I'll try to follow
up all the open messages within the next days. Have a nice evening and

Ciao, Mike

 | Replies | Author | Date
2669 | Re: New file uploaded to VirtualTreeview | Jim Kueneman | Tue 6/26/2001
2688 | Re: New file uploaded to VirtualTreeview | Mike Lischke | Tue 6/26/2001


VirtualTree Doted Lines...

From: "Ariel Selig" [asel98@y...]
Date: Sun Jun 24, 2001 10:41 pm
Subject: VirtualTree Doted Lines...

hello

Mike, i tried to recomplie with the new version, and i have the
problem again... :(

i will install delphi in a new pc tomorrow, i will try in that pc
again. maybe i have diferents bpls in this one.

any other ppl is getting this problem with the draw of the tree?

tnx

 | Replies | Author | Date
2620 | Re: VirtualTree Doted Lines... | Mike Lischke | Mon 6/25/2001
2662 | Re: VirtualTree Doted Lines... | Ariel Selig | Tue 6/26/2001
2801 | Re: VirtualTree Doted Lines... | Mike Lischke | Sat 6/30/2001


Troubles with 2.4.34

From: Werner Lehmann [wl@b...]
Date: Sun Jun 24, 2001 11:45 pm
Subject: Troubles with 2.4.34

Hi Mike,

I have just checked out your new version. Plenty of new formats, I can see what
the 10
hours were used for :)

Unfortunately I have some problems here with that version. I face a big
performance
hit. Populating a flat list with ~7400 nodes (AddChild, all init'ed right away,
within
Begin/EndUpdate) takes now about 10-15s, before <1s. I have checked this
against 2.4.28
to be sure.

Furthermore, some AddChild() calls which caused no trouble before if I called an
InvalidateNode() right after it do now lead to (for instance) OnGetImageIndex
with
nil'ed data pointer (unless I enclose them by Begin/Endupdate, but this is quite
some overhead for a single AddChild and I hesitate to do so). Apparently the new

ScrollIntoView(Result);

in AddChild() is to be blamed here (callstack). And there is another reason why
this
troubles me: I am frequently adding child nodes to a parent node. If this node
is
expanded the tree will always scroll to the new child node. The selected node
(could
be the parent node or any other) gets out of view and the tree always jumps up
and down as new children are added (the parent is sorted). There must be a
better way
to do this even if Options is full. Sadly uncommenting the ScrollIntoView call
does not
remedy the performance problem. No effect on this. There must be a different
reason.

And there is a third problem which might be related. I can reproduce an AV in

procedure TBaseVirtualTree.WndProc(var Message: TMessage);

The AV is reported in module vcl50.bpl (which is my only runtime package) but
the
editor highlights the last line of WndProc ("end;"). No idea where the problem
really
lies. But something tries to read something at nil + offset $308. This is hard
to
debug. I have 2-3 interdependent VTrees on that form and setting breakpoints in
WndProc
is useless as they are hit too often and such a break (and switch to the IDE)
causes
other messages for WndProc. Maybe I can shed some more light on this but it
won't be
easy.

Regards,
Werner

 | Replies | Author | Date
2617 | Troubles with 2.4.34, too | Jim Kueneman | Mon 6/25/2001
2627 | Re: Troubles with 2.4.34, too | Mike Lischke | Mon 6/25/2001
2629 | Re: Troubles with 2.4.34, too | Mike Lischke | Mon 6/25/2001
2646 | Re: Troubles with 2.4.34, too | Jim Kueneman | Mon 6/25/2001
2778 | Re: Troubles with 2.4.34, too | Mike Lischke | Fri 6/29/2001
2644 | Re: Troubles with 2.4.34, too | Jim Kueneman | Mon 6/25/2001
2618 | More Troubles with 2.4.34 | Jim Kueneman | Mon 6/25/2001
2628 | Re: More Troubles with 2.4.34 | Mike Lischke | Mon 6/25/2001
2626 | Re: Troubles with 2.4.34 | Mike Lischke | Mon 6/25/2001


Troubles with 2.4.34, too

From: Jim Kueneman [jimdk@m...]
Date: Mon Jun 25, 2001 4:06 am
Subject: Troubles with 2.4.34, too

Hi Mike,

I have a few things to add too. It still does not appear that the hint
box is hidden before the node is expanded, again causing a smeared animated
expand.

Also the "droppings" are not fixed on animated expand ( Not sure if you
even looked at it but I have a new clue ). I did figure out if I make the
node height 1 pixel larget it is fixed. It must be your clip rectangle is
off by 1 pixel at times?

Jim

 | Replies | Author | Date
2627 | Re: Troubles with 2.4.34, too | Mike Lischke | Mon 6/25/2001
2629 | Re: Troubles with 2.4.34, too | Mike Lischke | Mon 6/25/2001
2646 | Re: Troubles with 2.4.34, too | Jim Kueneman | Mon 6/25/2001
2778 | Re: Troubles with 2.4.34, too | Mike Lischke | Fri 6/29/2001
2644 | Re: Troubles with 2.4.34, too | Jim Kueneman | Mon 6/25/2001


More Troubles with 2.4.34

From: Jim Kueneman [jimdk@m...]
Date: Mon Jun 25, 2001 6:07 am
Subject: More Troubles with 2.4.34

Hi Mike,

In

function TCustomVirtualStringTree.ContentToClipboard(Format: Word; Source:
TVSTTextSourceType): HGLOBAL;

You have this:

else
if Format = CF_CSV then
S := ContentToText(Source, ',') + #0
else
if (Format = CF_RTF) or (Format = CF_RTFNOOBS) then
S := ContentToRTF(Source) + #0
else
if Format = CF_HTML then
begin
S := ContentToHTML(Source);
// Build a valid HTML clipboard fragment.
MakeFragment(S);
with TStringList.Create do
begin
Text := S;
SaveToFile('c:\temp\test.html'); <<<<<<<<?????????????????????????
free;

Am I right in assuming this was a debugging fragment? It causes big
problems when you don't have a Temp directory on your C drive !

Jim

 | Replies | Author | Date
2628 | Re: More Troubles with 2.4.34 | Mike Lischke | Mon 6/25/2001


IsFolder()

From: "Ariel Selig" [asel98@y...]
Date: Mon Jun 25, 2001 6:29 am
Subject: IsFolder()

which is the best way to know if the current node is a folder?

i tried this: (but i get an error)

var
data:PNodeData;
begin
data := InternalData(Node);
result:=data.Namespace.folder;
end;

tnx

note: remember that a "folder" doesnt need to have subitems in VET.

 | Replies | Author | Date
2642 | Re: IsFolder() | Jim Kueneman | Mon 6/25/2001


re: VirtualTree Doted Lines...

From: "Mike Lischke" [lists@l...]
Date: Mon Jun 25, 2001 6:47 am
Subject: RE: [VirtualTreeview] VirtualTree Doted Lines...

Hi Ariel,

> Mike, i tried to recomplie with the new version, and i have the
> problem again... :(

What problem did you get? Can you recompile?

Ciao, Mike

 | Replies | Author | Date
2662 | Re: VirtualTree Doted Lines... | Ariel Selig | Tue 6/26/2001
2801 | Re: VirtualTree Doted Lines... | Mike Lischke | Sat 6/30/2001


[no subject]

From: [F.vdwestelaken@c...]
Date: Mon Jun 25, 2001 7:00 am
Subject:

2 Jun 2001 20:58:32 +0200
To: [VirtualTreeview@yahoogroups.com>
Message-ID: [MMEBIEFEHHOLNALGMHDOKEPGDKAA.F.vdWestelaken@c...]
X-Priority: 3 (Normal)
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2911.0)
In-Reply-To: [9gtqod+au5h@e...]
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2462.0000
Importance: Normal
From: "Franc v/d Westelaken" <F.vdwestelaken@c...]
MIME-Version: 1.0
Mailing-List: list VirtualTreeview@yahoogroups.com; contact
VirtualTreeview-owner@yahoogroups.com
Delivered-To: mailing list VirtualTreeview@yahoogroups.com
Precedence: bulk
List-Unsubscribe: <mailto:VirtualTreeview-unsubscribe@yahoogroups.com>
Date: Fri, 22 Jun 2001 20:57:31 +0200
Reply-To: VirtualTreeview@yahoogroups.com
Subject: RE: [VirtualTreeview] Cannot select rootnode
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
X-UIDL: 1784
Status: U

Hi Jim,

> Sure post it in the files area a nd I will look at it tonight.

I took the liberty to create a folder called 'Test projects' and posted my
test program there under the name 'NoRootNodeSelect.zip'.

Franc.

To unsubscribe from this group, send an email to:
VirtualTreeview-unsubscribe@egroups.com

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/


[no subject]

From: [F.vdwestelaken@c...]
Date: Mon Jun 25, 2001 7:00 am
Subject:

2 Jun 2001 23:04:43 +0200
To: [VirtualTreeview@yahoogroups.com>
Message-ID: [MMEBIEFEHHOLNALGMHDOOEPHDKAA.F.vdWestelaken@c...]
X-Priority: 3 (Normal)
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2911.0)
In-Reply-To: [9h0b21+it2q@e...]
Importance: Normal
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2462.0000
From: "Franc v/d Westelaken" <F.vdwestelaken@c...]
MIME-Version: 1.0
Mailing-List: list VirtualTreeview@yahoogroups.com; contact
VirtualTreeview-owner@yahoogroups.com
Delivered-To: mailing list VirtualTreeview@yahoogroups.com
Precedence: bulk
List-Unsubscribe: <mailto:VirtualTreeview-unsubscribe@yahoogroups.com>
Date: Fri, 22 Jun 2001 23:03:46 +0200
Reply-To: VirtualTreeview@yahoogroups.com
Subject: RE: [VirtualTreeview] Re: Cannot select rootnode
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
X-UIDL: 1787
Status: U

Hi All,

thanks for your suggestions.I've implemented the changes you suggested and
everything works as it should.

Thanks again,
Franc.

[Non-text portions of this message have been removed]

To unsubscribe from this group, send an email to:
VirtualTreeview-unsubscribe@egroups.com

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/


[no subject]

From: [wl@b...]
Date: Mon Jun 25, 2001 7:00 am
Subject:

[4.0.20010623203246.0278d928@m...]
From: Werner Lehmann [wl@b...]
MIME-Version: 1.0
Mailing-List: list [VirtualTreeview@yahoogroups.com; contact
VirtualTreeview-owner@yahoogroups.com
Delivered-To: mailing list VirtualTreeview@yahoogroups.com
Precedence: bulk
List-Unsubscribe: <mailto:VirtualTreeview-unsubscribe@yahoogroups.com>
Date: Sun, 24 Jun 2001 13:44:35 +0200
Reply-To: VirtualTreeview@yahoogroups.com
Subject: Re: [VirtualTreeview] Re: OLE Drag and Drop
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
X-UIDL: 1814
Status: U

Jim,

> Something is wrong, TYMED is an enumeration. If you are dragging from
> VT Windows calls EnumFormatEtc first to get a list of all supported
> clipboard types and does it through
>
> procedure TEnumFormatEtc.UpdateList(Tree: TBaseVirtualTree);
>
> so you can see what TYMED is being set... always HGLOBAL.
>
> The VT dataobject never supplies ISTREAM so it must be being corrupted
> somewhere else.
>
> I built a test program up to implementing HDrop structure which is past
> where your problems are I believe.
>
> function TMyDataObject.GetData(const FormatEtcIn: TFormatEtc; out Medium:
> TStgMedium): HResult;
> begin
> if FormatEtcIn.cfFormat = CF_HDROP then
>
> // Dropping on a Listbox associated with a TDropFileTarget
> // makes it to here when TDropFileTarget asks for the files.
> // If I return S_OK and an valid Medium structure then it would work fine.
>
> result := E_UNEXPECTED
>
> else
> result := inherited GetData(FormatEtcIn, Medium);
> end;

I have found the problem and am afraid it is on VTree's side. The drag target
component from Anders Melander uses IDataObject.QueryGetData with this value
as tymed:

TYMED_HGLOBAL or TYMED_ISTREAM (1 + 4 = 5)

The implementation in TVTDataObject checks for equality...

if FormatEtc.tymed = TYMED_HGLOBAL then

...and this fails. The win api help for IDataObject::EnumFormatEtc say this:

"The TYMED member of FORMATETC often indicates that more than one kind of
storage medium
is acceptable. You should always mask and test for this by using a Boolean OR
operator."

I don't know how the folks at MS test for a flag with the OR operator (I'd use
AND) but
clearly TYMED is used as a bit flag here. Therefore I suggest to change VTree
into this:

if FormatEtc.tymed and TYMED_HGLOBAL <> 0 then

Mike?

One more thing. Is there any way to show the drag image over the toolbar? I
recall
that Mike has disabled this explicitly to avoid redraw problems below the drag
image
if whatever is below changes during the drag. Well, my toolbar (=drop target)
does not
change. Is there any way to get the drag image without patching
VirtualTrees.pas?

Regards,
Werner

To unsubscribe from this group, send an email to:
VirtualTreeview-unsubscribe@egroups.com

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/

 | Replies | Author | Date
2624 | (no subject) | jimdk@m...] | Mon 6/25/2001
2775 | Re: OLE Drag and Drop | Mike Lischke | Fri 6/29/2001


[no subject]

From: [jimdk@m...]
Date: Mon Jun 25, 2001 7:00 am
Subject:

[4.0.20010623203246.0278d928@m...]
From: Jim Kueneman [jimdk@m...]
MIME-Version: 1.0
Mailing-List: list VirtualTreeview@yahoogroups.com; contact
VirtualTreeview-owner@yahoogroups.com
Delivered-To: mailing list VirtualTreeview@yahoogroups.com
Precedence: bulk
List-Unsubscribe: <mailto:VirtualTreeview-unsubscribe@yahoogroups.com>
Date: Sun, 24 Jun 2001 05:46:46 -0700
Reply-To: VirtualTreeview@yahoogroups.com
Subject: Re: [VirtualTreeview] Re: OLE Drag and Drop
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
X-UIDL: 1815
Status: U

At 01:44 PM 6/24/2001 +0200, you wrote:
>Jim,

HI Werner,

Looks like we are beating another dead horse :^)

Are you using the version 4 Beta? Because version 3.7 does not include the
Or'd TYMED (although is does check TYMED using a bit test)

>...and this fails. The win api help for IDataObject::EnumFormatEtc say this:
>
>"The TYMED member of FORMATETC often indicates that more than one kind of
>storage medium
>is acceptable. You should always mask and test for this by using a Boolean
>OR operator."

Where did you read this? This is what I have for FormatEtc:

"tymed:

Specifies ONE of the TYMED enumeration constants which indicate the type of
storage medium used to transfer the object's data. Data can be transferred
using whatever medium makes sense for the object. For example, data can be
passed using global memory, a disk file, or structured storage objects. For
more information, see the TYMED enumeration."

Notice the ONE. ( capitalized it )

Looks like somewhere there is a failure to communicate!

I am not sure if VT is wrong but it appears there is enough contradicting
information on this subject that VT should use the bit test just in case.

>One more thing. Is there any way to show the drag image over the toolbar?
>I recall
>that Mike has disabled this explicitly to avoid redraw problems below the
>drag image
>if whatever is below changes during the drag. Well, my toolbar (=drop
>target) does not
>change. Is there any way to get the drag image without patching
>VirtualTrees.pas?

Do you mean the Taskbar? The drag image will only be shown over VT. You
can steal my implementation of IDragSourceHelper in VET on the next
release. In Win2000 the drag image works both into and out of VET as long
as the target windows supports IDragTargetHelper, which the desktop, IE,
Explorer and the Taskbar do. It looks really cool.

The only gotch is you have to implement SetData in the droptarget as that
is where the drag image is stored at the start of the drag. If you
integrate my shellutilities.pas and use the namespaces for the files you
can use the IDataObjects that the file namespace exposes through the shell
which already know how to handle this (in Win2k). I would also keep you
from having to deal with HDROP explicitly too as the shell IDataObject
already handles this.

All you really have to do is

var
NS: TNamespace;
P: PItemIDLIst;

P := ShellUtilites.PathToPIDL(FilePath);
NS := TNamespace.Create(P, nil)

then use the TNamespace properties to get a dataobject or DataObjectMulti
with an array of PIDLs from multiple calls to PathToPIDL. The file
represented by NS should be a sibling of the other files

If you want to do this let me know and I will show you in more detail.

Jim

To unsubscribe from this group, send an email to:
VirtualTreeview-unsubscribe@egroups.com

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/

 | Replies | Author | Date
2775 | Re: OLE Drag and Drop | Mike Lischke | Fri 6/29/2001


[no subject]

From: [wl@b...]
Date: Mon Jun 25, 2001 7:00 am
Subject:

[4.0.20010623203246.0278d928@m...]
[5.1.0.14.0.20010624051708.027a5c30@m...]
From: Werner Lehmann [wl@b...]
MIME-Version: 1.0
Mailing-List: list VirtualTreeview@yahoogroups.com; contact
VirtualTreeview-owner@yahoogroups.com
Delivered-To: mailing list VirtualTreeview@yahoogroups.com
Precedence: bulk
List-Unsubscribe: <mailto:VirtualTreeview-unsubscribe@yahoogroups.com>
Date: Sun, 24 Jun 2001 17:46:08 +0200
Reply-To: VirtualTreeview@yahoogroups.com
Subject: Re: [VirtualTreeview] Re: OLE Drag and Drop
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
X-UIDL: 1817
Status: U

Hi Jim,

Jim Kueneman wrote:
>
> At 01:44 PM 6/24/2001 +0200, you wrote:
> >Jim,
>
> HI Werner,
>
> Looks like we are beating another dead horse :^)
>
> Are you using the version 4 Beta? Because version 3.7 does not include the
> Or'd TYMED (although is does check TYMED using a bit test)

yes, I have just started checking out these components. Looks as they can save
me from some interface implementation work. Therefore I began with the latest
version.

> >...and this fails. The win api help for IDataObject::EnumFormatEtc say this:
> >
> >"The TYMED member of FORMATETC often indicates that more than one kind of
> >storage medium
> >is acceptable. You should always mask and test for this by using a Boolean
> >OR operator."
>
> Where did you read this? This is what I have for FormatEtc:
>
> "tymed:
>
> Specifies ONE of the TYMED enumeration constants which indicate the type of
> storage medium used to transfer the object's data. Data can be transferred
> using whatever medium makes sense for the object. For example, data can be
> passed using global memory, a disk file, or structured storage objects. For
> more information, see the TYMED enumeration."
>
> Notice the ONE. ( capitalized it )
>
> Looks like somewhere there is a failure to communicate!

Not so IMO. As I said, go to IDataObject::EnumFormatEtc, scroll all the way down
and read the last full sentence. MSDN has the same info.

The numeric values of the TYMED enum indicate a use as bit flags, too.

I think in QueryGetData TYMED can contain a number of or'ed values to ask if
(for example) any of ISTREAM or HGLOBAL could be rendered. In GetData only
one TYMED makes sense.

> I am not sure if VT is wrong but it appears there is enough contradicting
> information on this subject that VT should use the bit test just in case.
>
> >One more thing. Is there any way to show the drag image over the toolbar?
> >I recall
> >that Mike has disabled this explicitly to avoid redraw problems below the
> >drag image
> >if whatever is below changes during the drag. Well, my toolbar (=drop
> >target) does not
> >change. Is there any way to get the drag image without patching
> >VirtualTrees.pas?
>
> Do you mean the Taskbar? The drag image will only be shown over VT. You
> can steal my implementation of IDragSourceHelper in VET on the next
> release. In Win2000 the drag image works both into and out of VET as long
> as the target windows supports IDragTargetHelper, which the desktop, IE,
> Explorer and the Taskbar do. It looks really cool.
>
> The only gotch is you have to implement SetData in the droptarget as that
> is where the drag image is stored at the start of the drag. If you
> integrate my shellutilities.pas and use the namespaces for the files you
> can use the IDataObjects that the file namespace exposes through the shell
> which already know how to handle this (in Win2k). I would also keep you
> from having to deal with HDROP explicitly too as the shell IDataObject
> already handles this.
>
> All you really have to do is
>
> var
> NS: TNamespace;
> P: PItemIDLIst;
>
> P := ShellUtilites.PathToPIDL(FilePath);
> NS := TNamespace.Create(P, nil)
>
> then use the TNamespace properties to get a dataobject or DataObjectMulti
> with an array of PIDLs from multiple calls to PathToPIDL. The file
> represented by NS should be a sibling of the other files
>
> If you want to do this let me know and I will show you in more detail.

Well at first this sounds like much work for
- getting a dragimage to show on my toolbar
- only have this working on win2k (+ xp)

You will probably object at the 'much work'. Right now I am using neither VET
nor ShellUtilities. It is on my todo list to browse through both but it will
take me a few days probably. Right now dragimages only on 2k do not justify
the effort and increase in EXE size. All I want to achieve is a kind of book-
mark / favorites toolbar and this taking already too long with all this OLE
drag and drop stuff, to be honest. Of course I learned a lot and that time is
not lost :)

Regards,
Werner

To unsubscribe from this group, send an email to:
VirtualTreeview-unsubscribe@egroups.com

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/


re: Troubles with 2.4.34

From: "Mike Lischke" [lists@l...]
Date: Mon Jun 25, 2001 7:28 am
Subject: RE: [VirtualTreeview] Troubles with 2.4.34

Hi Werner,

hopefully many of those who want just a little enhancement of VT which costs
only a couple of lines
read this message to learn what it is really about to change a bit here and a
bit there. There is
much more involved and one can easily make other things unusable showing
effects which appear days
or even weeks after the change has been made, so nobody can reproduce what it
was.

I wanted to answer eMails this morning, now I'm hunting bugs instead which are
totally unexpected.
:-(

> Unfortunately I have some problems here with that version. I face a big
performance
> hit.
>...
> Furthermore, some AddChild() calls which caused no trouble before if I called
an
> InvalidateNode() right after it do now lead to (for instance) OnGetImageIndex
with
> nil'ed data pointer (unless I enclose them by Begin/Endupdate, but this is
quite
> some overhead for a single AddChild and I hesitate to do so). Apparently the
new
>
> ScrollIntoView(Result);
>
> in AddChild() is to be blamed here (callstack).

I don't understand this. If you have BeginUpdate/EndUpdate around your AddChild
calls then
ScrollIntoView should never be called. Without BeginUpdate/EndUpdate however
the full work must be
done or do you want to introduce flags for every action the tree might do? The
semantic of
InsertNode and AddChild is that they allow to add single nodes in compatible
manner to TTreeView.
They do more than simply increasing the child count (you could easily do this
yourself by using
Tree.ChildCount[Node] += 1). They are simply not made to execute with high
performance. For this
task another approach is used.

> I am frequently adding child nodes to a parent node. If this node is
> expanded the tree will always scroll to the new child node.

You have several alternatives: BeginUpdate/EndUpdate, Tree.ChildCount,
OnInitNode/OnInitChildren.

> Sadly uncommenting the ScrollIntoView call does not
> remedy the performance problem. No effect on this. There must be a different
reason.

ScrollIntoView is the only code I added recently to AddChild. So if this is not
the reason for the
performance bottleneck then the problem must have already been there in
previous versions. Try to
find the offending part by using BeginUpdate/EndUpdate and disable sorting.

> And there is a third problem which might be related. I can reproduce an AV in
> procedure TBaseVirtualTree.WndProc(var Message: TMessage);
>

Well, this does not tell me very much. What are you doing to cause the AV?

Ciao, Mike


re: Troubles with 2.4.34, too

From: "Mike Lischke" [lists@l...]
Date: Mon Jun 25, 2001 7:32 am
Subject: RE: [VirtualTreeview] Troubles with 2.4.34, too

Hi Jim,

> I have a few things to add too. It still does not appear that the hint
> box is hidden before the node is expanded, again causing a smeared animated
> expand.

Strange. There is an explicit CancelHint call. Try an "UpdateWindow(Handle)"
call after the
CancelHint call in ToggleNode. Does this solve the problem.

> Also the "droppings" are not fixed on animated expand ( Not sure if you
> even looked at it but I have a new clue ). I did figure out if I make the
> node height 1 pixel larget it is fixed. It must be your clip rectangle is
> off by 1 pixel at times?

Aha, yes this could be. I have not had a chance to figure out what's going on.
Will do now...

Ciao, Mike

 | Replies | Author | Date
2629 | Re: Troubles with 2.4.34, too | Mike Lischke | Mon 6/25/2001
2646 | Re: Troubles with 2.4.34, too | Jim Kueneman | Mon 6/25/2001
2778 | Re: Troubles with 2.4.34, too | Mike Lischke | Fri 6/29/2001
2644 | Re: Troubles with 2.4.34, too | Jim Kueneman | Mon 6/25/2001


re: More Troubles with 2.4.34

From: "Mike Lischke" [lists@l...]
Date: Mon Jun 25, 2001 7:34 am
Subject: RE: [VirtualTreeview] More Troubles with 2.4.34

> SaveToFile('c:\temp\test.html');
<<<<<<<<?????????????????????????
> free;
>
> Am I right in assuming this was a debugging fragment? It causes big
> problems when you don't have a Temp directory on your C drive !

Yes, of course. I forgot to remove it. Stupid mistake from me...

Ciao, Mike


re: Troubles with 2.4.34, too

From: "Mike Lischke" [lists@l...]
Date: Mon Jun 25, 2001 7:48 am
Subject: RE: [VirtualTreeview] Troubles with 2.4.34, too

> > Also the "droppings" are not fixed on animated expand ( Not sure if you
> > even looked at it but I have a new clue ). I did figure out if I make the
> > node height 1 pixel larget it is fixed. It must be your clip rectangle is
> > off by 1 pixel at times?
>
> Aha, yes this could be. I have not had a chance to figure out what's going
on. Will do now...

Mmh, had a look and I think it has nothing to do with the clip rectangle. It is
the same as the
scroll rect. The same variable is used for both. But I have another idea.
Perhaps it has to do with
the fact that Windows often does not use bottom and right border of a rectangle
for a particular
operation. Please replace line 11711 (build 34, before the call to the local
function EraseLine) by:

Run := Rect(R.Left, R.Bottom - StepSize, R.Right, R.Bottom + 1);

Unfortunately I can neither with this nor with the last version recreate the
smear effect you
encounter.

Ciao, Mike

 | Replies | Author | Date
2646 | Re: Troubles with 2.4.34, too | Jim Kueneman | Mon 6/25/2001
2778 | Re: Troubles with 2.4.34, too | Mike Lischke | Fri 6/29/2001


re: Somebody help a real newbie!

From: "Mike Lischke" [lists@l...]
Date: Mon Jun 25, 2001 9:00 am
Subject: RE: [VirtualTreeview] Somebody help a real newbie!

Hi Trevis,

> The problem is a can´t! I already tried to look the
> demos, html help file, code repository and previous messages in this
> list. I just need an initial orientation about inserting a node and
> putting my data on it.

Download the demos pack from the file area and have a look into the Minimal
project. I think this is what you need.

Ciao, Mike


re: Save to Text File

From: "Mike Lischke" [lists@l...]
Date: Mon Jun 25, 2001 9:00 am
Subject: RE: [VirtualTreeview] Save to Text File

Hi Ernest,

> Anyway, I need to save a VirtualStringTree to a text file. The SaveToFile()
> method doesn't quite do it. I just need one line per node with the text. My
> tree is a simple one-column thing. Any ideas, code examples? BTW, I'm using
> Delphi 4.

Download the latest build of VT and use the methods ContentToText or
ContentToUnicode of the string tree.

Ciao, Mike


re: Antwort: RE: Q: Custom background (not Bitmap)

From: "Mike Lischke" [lists@l...]
Date: Mon Jun 25, 2001 8:59 am
Subject: RE: Antwort: RE: [VirtualTreeview] Q: Custom background (not Bitmap)

Hi Zan,

> I'm looks over the TBaseVirtualTree.PaintTree - procedure and found a
> solution for me:
>
> Is there any chance, to include such a event into the official
> VT-Distribution?

Implemented in a similar fashion. Wait for next upload.

Ciao, Mike


re: Property Editors

From: "Mike Lischke" [lists@l...]
Date: Mon Jun 25, 2001 9:00 am
Subject: RE: [VirtualTreeview] Property Editors

Hi Kostas,

> After taking a look at Mike's new property editor for ClipboardFormats i
> couldn't resist uploading a small and simple design-time package i've
> written (kyProps.bpl) ...
>
> It hasn't much to do with VT, but it might give you some ideas on writing
> your own property editors.

Thank you for your sources. Do you have an own homepage? If not would you like
to have it published on my site? I would prefer to keep the file area for the
mailing list only for VT related stuff. This is necessary because the room is
limited and it becomes more and more dfficult for others to find a particular
file.

Ciao, Mike


re: Re: Header Assignment crash

From: "Mike Lischke" [lists@l...]
Date: Mon Jun 25, 2001 9:00 am
Subject: RE: [VirtualTreeview] Re: Header Assignment crash

Hi Frank,

> After that I make the columns (with columns.Add). For the second
> column I change the position into 0 (to show it at the
> start). After that I do the assign for a second view. Finally the
> EndUpdate.
>
> It goes wrong with the position. In the original view the second
> added column is shown first, but in the copied view
> the position is not taking into account (ie the showing sequence is
> equal to the adding sequence). Probably that's the
> reason everything goes wrong for me.

Please call EndUpdate for the header before you assign it to another header
class. This is necessary
because some internal structures (particularly the position array) are updated
in EndUpdate.

Ciao, Mike


re: Bug in "home"

From: "Mike Lischke" [lists@l...]
Date: Mon Jun 25, 2001 9:00 am
Subject: RE: [VirtualTreeview] Bug in "home"

Hi Anders,

> //Shouldn't that be : Node := GetFirstVisible

Perfect. Yes, I had not realized that it is necessary to retrieve the first
visible node.

> BTW, how can I change the color of the header (the clsilver color of
> the columns). I've tried using ownerdrag and OnDrawHeader, but I
> can't figure out how to do it.

The only regular way (with some limitations too) is to do a custom draw. For a
common look and feel
you should however rather change the color settings of the system not create
your own set.

Ciao, Mike


Full expand

From: [tparent@c...]
Date: Mon Jun 25, 2001 9:10 am
Subject: Full expand

(Sorry for my english)

I don't want to discuss one more time on this subject,
but finally what is the solution ?

I need a faster function to full expand my 'Fast Treeview'

I used before simple TTreeview and switched to VirtualTreeView
to not to have to wait 10 sec.

I don't use OnInit event !!!
The Initialisation problem is then out of me. (certainly bad English)
I use a simple func to add node :

function TForm1.AddVSTChild (ParentNode : PVirtualNode ; str :
String) : PVirtualNode ;
var
nodeData: PTreeRec ;
begin
result := VST.AddChild (ParentNode);
nodeData := VST.GetNodeData(result);
nodeData.Text := str ;
//Vst.HasChildren[result] := true;
//Vst.Expanded [result] := true ;
end ;

Where is the advantage of VirtualTree if it is slower that MS Tree :)

Can Anybody give me a solution or a 'FullExpand' replacement
procedure ?

 | Replies | Author | Date
2641 | Re: Full expand | Jim Kueneman | Mon 6/25/2001
2648 | Re: Full expand | [tparent@c...] | Mon 6/25/2001
2668 | VET 1.4.34, finally available | Jim Kueneman | Tue 6/26/2001
2689 | Re: VET 1.4.34, finally available | Mike Lischke | Tue 6/26/2001
2692 | Re: VET 1.4.34, finally available | Jim Kueneman | Tue 6/26/2001
2798 | Re: VET 1.4.34, finally available | Mike Lischke | Sat 6/30/2001
2807 | Re: VET 1.4.34, finally available | Jim Kueneman | Sat 6/30/2001
2698 | Re: VET 1.4.34, finally available>> I Get it now | Jim Kueneman | Wed 6/27/2001
2803 | Re: VET 1.4.34, finally available>> I Get it now | Mike Lischke | Sat 6/30/2001


Antwort: Q: Custom background (not Bitmap)

From: [zan.trajkov@s...]
Date: Mon Jun 25, 2001 9:16 am
Subject: Antwort: [VirtualTreeview] Q: Custom background (not Bitmap)

Hi Mike,

thanks a lot....

Looking for the next release...

v
Zan

PS.:

Hope, this change isn't like the actual discussion "Only a few lines of
code.....":

"a small change now -> Bug later.... " ;-)


Delphi 6

From: [tparent@c...]
Date: Mon Jun 25, 2001 9:21 am
Subject: Delphi 6

For those that are interrested, VT work fine under delphi 6
Just some modifications on the use list and that work.
the problem is that I need to do that for each release.

For when is the delphi6 package ?


re: Property Editors

From: GIANNAKOPOULOS KOSTAS [kyan@s...]
Date: Mon Jun 25, 2001 9:36 am
Subject: RE: [VirtualTreeview] Property Editors

No, i don't have a homepage; i don't even have internet at home, so what do
i need it for?

I write delphi components as a hobby at my (limited) spare time, mostly
during weekends. At work i take part in developing a proprietary 3-tier
framework.

I think i'll just delete the file from your files area; it's no big deal
anyway. If someone wants it they could eMail me.

Sorry for using your space; i promise not to do it again.

<KY>

> Thank you for your sources. Do you have an own homepage? If
> not would you like to have it published on my site? I would
> prefer to keep the file area for the mailing list only for VT
> related stuff. This is necessary because the room is limited
> and it becomes more and more dfficult for others to find a
> particular file.


re: Troubles with 2.4.34

From: Werner Lehmann [wl@b...]
Date: Mon Jun 25, 2001 10:39 am
Subject: Re: [VirtualTreeview] Troubles with 2.4.34

Mike Lischke wrote:
>
> hopefully many of those who want just a little enhancement of VT which costs
only a couple of lines
> read this message to learn what it is really about to change a bit here and a
bit there. There is
> much more involved and one can easily make other things unusable showing
effects which appear days
> or even weeks after the change has been made, so nobody can reproduce what it
was.

Somehow I am feeling guilty now.

> I wanted to answer eMails this morning, now I'm hunting bugs instead which
are totally unexpected.
> :-(

I regret that too. When I downloaded the new version yesterday I had something
else in
mind than fixing/finding these problems as well. Most bugs are totally
unexpected :)
New code new bugs. A reality we have to live with as developers.

> > Unfortunately I have some problems here with that version. I face a big
performance
> > hit.
> >...
> > Furthermore, some AddChild() calls which caused no trouble before if I
called an
> > InvalidateNode() right after it do now lead to (for instance)
OnGetImageIndex with
> > nil'ed data pointer (unless I enclose them by Begin/Endupdate, but this is
quite
> > some overhead for a single AddChild and I hesitate to do so). Apparently
the new
> >
> > ScrollIntoView(Result);
> >
> > in AddChild() is to be blamed here (callstack).
>
> I don't understand this. If you have BeginUpdate/EndUpdate around your
AddChild calls then
> ScrollIntoView should never be called. Without BeginUpdate/EndUpdate however
the full work must be
> done or do you want to introduce flags for every action the tree might do?
The semantic of
> InsertNode and AddChild is that they allow to add single nodes in compatible
manner to TTreeView.
> They do more than simply increasing the child count (you could easily do this
yourself by using
> Tree.ChildCount[Node] += 1). They are simply not made to execute with high
performance. For this
> task another approach is used.
>
> > I am frequently adding child nodes to a parent node. If this node is
> > expanded the tree will always scroll to the new child node.
>
> You have several alternatives: BeginUpdate/EndUpdate, Tree.ChildCount,
OnInitNode/OnInitChildren.
>
> > Sadly uncommenting the ScrollIntoView call does not
> > remedy the performance problem. No effect on this. There must be a
different reason.
>
> ScrollIntoView is the only code I added recently to AddChild. So if this is
not the reason for the
> performance bottleneck then the problem must have already been there in
previous versions. Try to
> find the offending part by using BeginUpdate/EndUpdate and disable sorting.

Hm. Yesterday I have been switching between 28 and 34 and a modified 34 with
commented
ScrollIntoView. No performance problem with 28, 34 with/without ScrollIntoView
much
slower. There must be another difference. Maybe I'll have to use a diff and see
if I
can spot the problem somewhere in the ~33K that you added from 28 to 34. But
before
I am trying this I wanted to ask you.

Begin/EndUpdate for a single AddChild is overkill. As I take it EndUpdate
invalidates the
complete clientrect if UpdateCount is 0 (I have not checked this again with the
source).

I will experiment with Tree.ChildCount. But I must say that I still think it is
not a
good idea to always ScrollIntoView new children. Even if the tree is not
sorted. If some
node with 10000 children is expanded and selected and I add another child the
selection
gets out of view and the new child (not selected) will be scrolled into view.
The user
scrolls back up to see the selection and the tree will scroll down again when
the next
child has been added.

I believe that a node should only be scrolled into view if it is focused. Maybe
I am the
only one to think so. In that case I would have to build my own version of
AddChild.

I am also considering switching to OnInitNode. The data may be initialized
index based
since I hold a copy of the whole tree in my own data structure (the VTree is
only displaying
subtrees and I think that I should not exclusively bind data to a visual
control especially
if it is called 'virtual' :). The problem with the initnode approach is on the
other hand
that only the tree nodes get sorted not my data. Therefore I must be sure that
all nodes
are init'ed (and bound to the data objects) before they are sorted. I believe
that you init
them anyway before a sort is executed but I am feeling a little bit uncertain
here and it
is quite a code rewrite.

> > And there is a third problem which might be related. I can reproduce an AV
in
> > procedure TBaseVirtualTree.WndProc(var Message: TMessage);
> >
>
> Well, this does not tell me very much. What are you doing to cause the AV?

I knew that this report was not very enlightening. I cannot tell you much about
the cause,
in one tree a node gets deleted and in another tree a new child is added. I
have to sort
this out. This was just in case that someone else encounters the same problem.

Regards,
Werner

 | Replies | Author | Date
2643 | Re: Troubles with 2.4.34 | [Manfred@F...] | Mon 6/25/2001


re: Full expand

From: Jim Kueneman [jimdk@m...]
Date: Mon Jun 25, 2001 12:39 pm
Subject: Re: [VirtualTreeview] Full expand

At 09:10 AM 6/25/2001 +0000, you wrote:

>Where is the advantage of VirtualTree if it is slower that MS Tree :)
>
>Can Anybody give me a solution or a 'FullExpand' replacement
>procedure ?

Make sure you wrap the node additions with:

VST.BeginUpdate;

Add all your nodes here....

VST.EndUpdate;

Jim

 | Replies | Author | Date
2648 | Re: Full expand | [tparent@c...] | Mon 6/25/2001
2668 | VET 1.4.34, finally available | Jim Kueneman | Tue 6/26/2001
2689 | Re: VET 1.4.34, finally available | Mike Lischke | Tue 6/26/2001
2692 | Re: VET 1.4.34, finally available | Jim Kueneman | Tue 6/26/2001
2798 | Re: VET 1.4.34, finally available | Mike Lischke | Sat 6/30/2001
2807 | Re: VET 1.4.34, finally available | Jim Kueneman | Sat 6/30/2001
2698 | Re: VET 1.4.34, finally available>> I Get it now | Jim Kueneman | Wed 6/27/2001
2803 | Re: VET 1.4.34, finally available>> I Get it now | Mike Lischke | Sat 6/30/2001


re: IsFolder()

From: Jim Kueneman [jimdk@m...]
Date: Mon Jun 25, 2001 12:48 pm
Subject: Re: [VirtualTreeview] IsFolder()

At 06:29 AM 6/25/2001 +0000, you wrote:
>which is the best way to know if the current node is a folder?
> data:PNodeData;
>begin
> data := InternalData(Node);
> result:=data.Namespace.folder;
>end;

Try

function IsFolder(Node: PVirtualNode)
var
NS: TNamespace;

if VirtualExplorerTree1.ValidateNamespace(Node, NS) then
Result := NS.Folder
else
Result := False

end;

Just to make sure a Folder and a Directory are two different things. There
is a TNamespace.Directory property too.

Jim


re: Troubles with 2.4.34

From: [Manfred@F...]
Date: Mon Jun 25, 2001 12:49 pm
Subject: Re: Troubles with 2.4.34

--- In [VirtualTreeview@y...], Werner Lehmann [wl@b...] wrote:
>
> I believe that a node should only be scrolled into view if it is
focused. Maybe I am the
> only one to think so. In that case I would have to build my own
version of AddChild.
>

No. You're not alone. In my opinion ScrollIntoView is not always
acceptable. If one of my programms need it i manually add
ScrollIntoView() after AddChild(). Mike, please think it over.

cu
Manfred


re: Troubles with 2.4.34, too

From: Jim Kueneman [jimdk@m...]
Date: Mon Jun 25, 2001 1:02 pm
Subject: RE: [VirtualTreeview] Troubles with 2.4.34, too

At 09:32 AM 6/25/2001 +0200, you wrote:
>Hi Jim,
>
> > I have a few things to add too. It still does not appear that the hint
> > box is hidden before the node is expanded, again causing a smeared animated
> > expand.
>
>Strange. There is an explicit CancelHint call. Try an
>"UpdateWindow(Handle)" call after the
>CancelHint call in ToggleNode. Does this solve the problem.

No, the problem is the call is in the code for collapsing not
expanding! I added the same to the "else"

I think it really should be there for both expanding and collapsing, but
only the expanding seems to have trouble.

if vsExpanded in Node.States then
begin
if DoCollapsing(Node) then
begin
NeedUpdate := True;

if (FUpdateCount = 0) and (voAnimatedToggle in FOptions) and not
(tsCollapsing in FStates) then
begin
// animated collapsing
with ToggleData do
begin
Application.CancelHint; <<<<<<<<< Leave this
UpdateWindow(Handle); <<<<<<<< Add this
......
end
end else
begin
if DoExpanding(Node) then
begin
Application.CancelHint; <<<<<<<< Add this
UpdateWindow(Handle); <<<<<<<< Add this
.....
end
end


re: Re: Troubles with 2.4.34

From: Vandrovec Milan [milan_va@s...]
Date: Mon Jun 25, 2001 1:05 pm
Subject: RE: [VirtualTreeview] Re: Troubles with 2.4.34

Hi all.

I wrote:

>>In TBaseVirtualTree.InsertNode, there is a ScrollIntoView(Result),
>>but in TBaseVirtualTree.AddChild, there is none.

And many of you answered:

> No. You're not alone. In my opinion ScrollIntoView is not always
> acceptable. If one of my programms need it i manually add
> ScrollIntoView() after AddChild(). Mike, please think it over.

Sorry to have caused this, I just wanted to InsertNode and AddChild
to have the same behavior. Perhaps removing it from InsertNode
would have been better?

Milan Vandrovec


re: Troubles with 2.4.34, too

From: Jim Kueneman [jimdk@m...]
Date: Mon Jun 25, 2001 1:22 pm
Subject: RE: [VirtualTreeview] Troubles with 2.4.34, too

At 09:48 AM 6/25/2001 +0200, you wrote:
>operation. Please replace line 11711 (build 34, before the call to the
>local function EraseLine) by:
>
> Run := Rect(R.Left, R.Bottom - StepSize, R.Right, R.Bottom + 1);

Found part of it.... you were close:
Line 11694

if not FHeader.UseColumns then
FillRect(DC, Rect(R.Left, R.Top, R.Right, R.Top + StepSize), Brush)

Add 1 to Stepsize
FillRect(DC, Rect(R.Left, R.Top, R.Right, R.Top + StepSize + 1),
Brush)

That fixes the Expanding Droppings.

Found Collapsing
Line 11708

if not FHeader.UseColumns then
FillRect(DC, Rect(R.Left, R.Bottom - StepSize, R.Right,
R.Bottom), Brush)

Subtract 1 from Stepsize
FillRect(DC, Rect(R.Left, R.Bottom - StepSize - 1, R.Right, R.Bottom),
Brush)

Jim

 | Replies | Author | Date
2778 | Re: Troubles with 2.4.34, too | Mike Lischke | Fri 6/29/2001


Save/Load list

From: [duke_n5@h...]
Date: Mon Jun 25, 2001 1:37 pm
Subject: Save/Load list

How to save/load list correctly??

If I just call SaveToFile and LoadFromFile, then the captions are not
loaded(I did not check if other things are - but the node structure
is saved and loaded correctly).

 | Replies | Author | Date
2779 | Re: Save/Load list | Mike Lischke | Fri 6/29/2001
2791 | Re: Save/Load list | [duke_n5@h...] | Sat 6/30/2001
2793 | Re: Save/Load list | Werner Lehmann | Sat 6/30/2001
2794 | Re: Save/Load list | Jim Kueneman | Sat 6/30/2001
2865 | VET Version 1.5.1 | Jim Kueneman | Wed 7/4/2001


re: Full expand

From: [tparent@c...]
Date: Mon Jun 25, 2001 2:29 pm
Subject: Re: Full expand

I do it, adding thousand of nodes take only 100 ms.
It's the Fullexpand procedure that take 10 sec !
Putting Fullexpand betwenn Beginupdate and EndUpdate is same.

--- In [VirtualTreeview@y...], Jim Kueneman [jimdk@m...] wrote:
> At 09:10 AM 6/25/2001 +0000, you wrote:
>
> >Where is the advantage of VirtualTree if it is slower that MS
Tree :)
> >
> >Can Anybody give me a solution or a 'FullExpand' replacement
> >procedure ?
>
>
> Make sure you wrap the node additions with:
>
> VST.BeginUpdate;
>
> Add all your nodes here....
>
> VST.EndUpdate;
>
>
> Jim

 | Replies | Author | Date
2668 | VET 1.4.34, finally available | Jim Kueneman | Tue 6/26/2001
2689 | Re: VET 1.4.34, finally available | Mike Lischke | Tue 6/26/2001
2692 | Re: VET 1.4.34, finally available | Jim Kueneman | Tue 6/26/2001
2798 | Re: VET 1.4.34, finally available | Mike Lischke | Sat 6/30/2001
2807 | Re: VET 1.4.34, finally available | Jim Kueneman | Sat 6/30/2001
2698 | Re: VET 1.4.34, finally available>> I Get it now | Jim Kueneman | Wed 6/27/2001
2803 | Re: VET 1.4.34, finally available>> I Get it now | Mike Lischke | Sat 6/30/2001


speed problem using VT as a grid....

From: [m.dekker@a...]
Date: Mon Jun 25, 2001 2:30 pm
Subject: speed problem using VT as a grid....

Hello Everybody,

First I have to thank you all, very, very much for your help. I have
build and filled the VT with values, it works fine. But the way i
build it, isn 't the most convenient way. I build the VT as a grid at
once and display the whole stuff at once, which is crucial with many
records. Assume i have 400.000 rootnodes (rows), than displaying the
VT as a grid consumes too much time and that isn 't efficient. Is
there a way to display only the rows which are visible on the screen
and update the screen, row by row, if the user scrolls? There are
many events, but i don 't know which to use? Can i do this with
OnPainttext? And if so, how does it work?
Thanx already...!

Regards,
Mark Dekker.

 | Replies | Author | Date
2650 | Re: speed problem using VT as a grid.... | Werner Lehmann | Mon 6/25/2001


re: speed problem using VT as a grid....

From: Werner Lehmann [wl@b...]
Date: Mon Jun 25, 2001 3:40 pm
Subject: Re: [VirtualTreeview] speed problem using VT as a grid....

Hi Mark,

> First I have to thank you all, very, very much for your help. I have
> build and filled the VT with values, it works fine. But the way i
> build it, isn 't the most convenient way. I build the VT as a grid at
> once and display the whole stuff at once, which is crucial with many
> records. Assume i have 400.000 rootnodes (rows), than displaying the
> VT as a grid consumes too much time and that isn 't efficient. Is
> there a way to display only the rows which are visible on the screen
> and update the screen, row by row, if the user scrolls? There are
> many events, but i don 't know which to use? Can i do this with
> OnPainttext? And if so, how does it work?
> Thanx already...!

are you sure that you want to present 400000 nodes at once to your users?
Anyway with that dimension you have to utilize the virtual concept and
do not initialize all nodes when they are added. Set the rootnodecount to
400000 and use OnInitNode to add the data. This event will only fire for
those nodes that are to be displayed. The principle is similar to what you
suggested in your last sentences.

The problem is always how to find the correct data for the node which is
delivered in OnInitNode. You can base this on the node index. And you
should not sort your nodes as this will trigger a full init (AFAIR).

Werner


re: Troubles with 2.4.34

From: "Vadim Sedulin" [wsntrl@o...]
Date: Mon Jun 25, 2001 3:43 pm
Subject: Re: [VirtualTreeview] Troubles with 2.4.34

Hello All!

> I believe that a node should only be scrolled into view if it is focused.
Maybe I am the
> only one to think so. In that case I would have to build my own version of
AddChild.

Werner, I'm with you!

Mike, I think ScrollIntoView in AddChild/Insert partially breaks your
virtual paradigm:

"This allows to fill a treeview with only the top nodes and initialize only
those of them which are currently in view. Clearly this increases start up
times a lot for large trees."
(Virtual Tree.chm, "The virtual paradigm", "The paradigm")

Bye.

Vadim Sedulin
E-Mail: [wsntrl@o...]

 | Replies | Author | Date
2653 | Re: Troubles with 2.4.34 | Mike Lischke | Mon 6/25/2001
2659 | Data-aware VST | sugi | Tue 6/26/2001
2661 | Re: Data-aware VST | Ariel Selig | Tue 6/26/2001
3220 | Re: Data-aware VST | sugi | Sun 7/22/2001
3224 | Re: Data-aware VST | [adembaba@e...] | Mon 7/23/2001
3230 | Re: Data-aware VST | Moritz Franckenstein | Mon 7/23/2001


How to optimize the sorting ?

From: [yahoo@s...]
Date: Mon Jun 25, 2001 5:05 pm
Subject: How to optimize the sorting ?

Greets List,

I recently upgraded to a VST that supports the AutoSorting thinking
that it would be a panacea to many of the problems i had, however it
did not exactly turn out that way. Basicly, the sort works very well,
however, with a very large list it chokes and takes forever (of
course i'm using VST because it can handle large lists).

Now i'm thinking it might be my OnCompare that sucks however im
basicly just doing this :

Data1 := Sender.GetNodeData(Node1);
Data2 := Sender.GetNodeData(Node2);
Result := CompareText(Data1^.Subject,Data2^.Subject);

Sure the CompareText is lenghty but, that much?

Then i started asking myself what i could do to speed up this
process, one thing i tought of is to move nodes when they are
compared. I'm not sure this is a good idea however and this is why i
seek input from you guys on this.

What i want to do is basicly : if Node1 is equal (or almost) to
Node2, then take Node2 and move it as a child to Node1. That would
reduce the number of root nodes in total and i'm thinking that it
might speed up the sorting afterwards. But i'm not totally
comfortable with moving nodes in the compare (it sounds evil).

Eagerly awaiting input.

-Masial

 | Replies | Author | Date
2654 | Re: How to optimize the sorting ? | Mike Lischke | Mon 6/25/2001
2680 | Re: How to optimize the sorting ? | [yahoo@s...] | Tue 6/26/2001
2802 | Re: How to optimize the sorting ? | Mike Lischke | Sat 6/30/2001


re: Troubles with 2.4.34

From: "Mike Lischke" [lists@l...]
Date: Mon Jun 25, 2001 6:43 pm
Subject: RE: [VirtualTreeview] Troubles with 2.4.34

Hi all,

> > I believe that a node should only be scrolled into view if it is focused.
> Maybe I am the only one to think so. In that case I would have to build my
own version of
> AddChild.
>
> Werner, I'm with you!
>
> Mike, I think ScrollIntoView in AddChild/Insert partially breaks your
> virtual paradigm:

Your cite, Vadim, applies to the virtual approach (paradigm) not the
compatibility version ;-)

But I got the point and I have no objections to remove the ScrollIntoView calls
entirely (in both
InsertNode and AddChild). It was only for convinience anyway. Unfortunately it
is not the cause for
the performance problem Werner mentioned, so we have still to work out what the
actual problem is.

Ciao, Mike

 | Replies | Author | Date
2659 | Data-aware VST | sugi | Tue 6/26/2001
2661 | Re: Data-aware VST | Ariel Selig | Tue 6/26/2001
3220 | Re: Data-aware VST | sugi | Sun 7/22/2001
3224 | Re: Data-aware VST | [adembaba@e...] | Mon 7/23/2001
3230 | Re: Data-aware VST | Moritz Franckenstein | Mon 7/23/2001


re: How to optimize the sorting ?

From: "Mike Lischke" [lists@l...]
Date: Mon Jun 25, 2001 6:51 pm
Subject: RE: [VirtualTreeview] How to optimize the sorting ?

Hi Masial,

> I recently upgraded to a VST that supports the AutoSorting thinking
> that it would be a panacea to many of the problems i had, however it
> did not exactly turn out that way. Basicly, the sort works very well,
> however, with a very large list it chokes and takes forever (of
> course i'm using VST because it can handle large lists).
>
> Now i'm thinking it might be my OnCompare that sucks however im
> basicly just doing this :

Have you tried to simply compare the indices instead to test if the comparation
or the node
reordering takes so much time?

>
> Data1 := Sender.GetNodeData(Node1);
> Data2 := Sender.GetNodeData(Node2);
> Result := CompareText(Data1^.Subject,Data2^.Subject);
>
> Sure the CompareText is lenghty but, that much?

Could well be. Keep in mind this is Unicode (or do you have ANSI captions?).
But about how many
nodes are we talking? In one of the products of my company I have 20K+ nodes
which sort in 2-3
seconds on a 350MHZ PII.

> What i want to do is basicly : if Node1 is equal (or almost) to
> Node2, then take Node2 and move it as a child to Node1. That would
> reduce the number of root nodes in total and i'm thinking that it
> might speed up the sorting afterwards. But i'm not totally
> comfortable with moving nodes in the compare (it sounds evil).

It does not only sound so :o] The problem is the lists are partially isolated
from the tree in the
reorder process and held in local lists which can easily get corrupted if you
modify the structure
in OnCompareNode.

Ciao, Mike

 | Replies | Author | Date
2680 | Re: How to optimize the sorting ? | [yahoo@s...] | Tue 6/26/2001
2802 | Re: How to optimize the sorting ? | Mike Lischke | Sat 6/30/2001


re: Finishing edit when user changes focus

From: "Mike Lischke" [lists@l...]
Date: Mon Jun 25, 2001 7:11 pm
Subject: RE: [VirtualTreeview] Finishing edit when user changes focus

Hi Brian,

> What would be the best way of finishing an edit when the user changes
> focus? For example, if a user starts editing a node, then clicks on
> another node, I would like to close the edit with the information
> currently in the node. I tried getting the current editor object from
> the TGridEditLink, but I had problems casting it to the correct
> TWinControl type. Is there another way to do this?

Just start with the implementation in VirtualTrees.pas. There you'll find code
which handles the
case of loosing the focus.

Ciao, Mike


re: Re: What to do when GetNodeData(Node) fails ?

From: "Mike Lischke" [lists@l...]
Date: Mon Jun 25, 2001 7:16 pm
Subject: RE: [VirtualTreeview] Re: What to do when GetNodeData(Node) fails ?

Hi Vadim,

> >> You had better change the default value to -1, i think.
> >
> > No, the default is 0 because this is useful for the minimal case (where
> you don't need any data). -1 would always require to have an event handler.
>
> Mike, Mike, Mike... Let's look at your code:

Ok, ok, you are right. It is changed to 0 if there is no event handler.
Sometimes I get a bit
irritated in 24000 lines of code...

> In other words, NodeDataSize = 0 eq NodeDataSize = -1 without event handler.

Proposal accepted :o]

Ciao, Mike


re: Troubles with 2.4.34

From: "Teus de Jong" [teusjdejong@p...]
Date: Mon Jun 25, 2001 8:35 pm
Subject: Re: [VirtualTreeview] Troubles with 2.4.34

Hi Mike,

> Unfortunately it is not the cause for
> the performance problem Werner mentioned, so we have still to work out
what the actual problem is.

I had a strange experience. After installing the new build on my machine,
and recompiling all components, my app took almost 4 seconds to start om
Win2k, while it took about 600 ms with the old version. I didn't believe
this possible, so I restarted the machine and it was 600 ms again. I only
metion it for the case other experience the same; if not, it will have been
a strange glitch.

Back to normal and after reading about the permomace hit experienced by
Werner, I tested the speed of the old and the new version and could not
detect any difference anymore. I tested this on a drive with 90.000 files.
Displayed them in a flat list with 5 Columns (Name, size, date, time,
attribs - and even a ValidateNode(nil, true)) takes only 135 secs on my
machine (PIII 667 MHz). It could be important for you to know that not
everyone experiences Werners permormance problems.

Groeten,

Teus de Jong


re: Troubles with 2.4.34

From: Werner Lehmann [wl@b...]
Date: Mon Jun 25, 2001 11:14 pm
Subject: Re: [VirtualTreeview] Troubles with 2.4.34

Hi all,

> > Unfortunately it is not the cause for
> > the performance problem Werner mentioned, so we have still to work out
> what the actual problem is.
>
> I had a strange experience. After installing the new build on my machine,
> and recompiling all components, my app took almost 4 seconds to start om
> Win2k, while it took about 600 ms with the old version. I didn't believe
> this possible, so I restarted the machine and it was 600 ms again. I only
> metion it for the case other experience the same; if not, it will have been
> a strange glitch.
>
> Back to normal and after reading about the permomace hit experienced by
> Werner, I tested the speed of the old and the new version and could not
> detect any difference anymore. I tested this on a drive with 90.000 files.
> Displayed them in a flat list with 5 Columns (Name, size, date, time,
> attribs - and even a ValidateNode(nil, true)) takes only 135 secs on my
> machine (PIII 667 MHz). It could be important for you to know that not
> everyone experiences Werners permormance problems.

I tell you something: the performance problem is gone. Without me doing
anything about it. Yes.

I began with creating a small test project but could not duplicate the
behaviour. But it was still there in my real application. Eventually I
began with stepping through AddChild et al. Could not find a clue all looked
good. From this moment on everything went back to normal. Have only one
idea why: I was having a couple of breakpoints (about 10) most deactivated
but not all in VirtualTrees.pas. None of these made the program really break
because they were all in the drag and drop code. After I finished stepping
through the code with no further idea I removed all breakpoints. I don't know
if it was that. I only know that everything's ok now. With performance as on
'28 level. I have also switch back and forth to 28, the problem is gone.

No idea what the problem was but it looks as if I must apologize, Mike.

This is also true for the WndProc problem. After I compiled without vcl50
runtime package I got a more useful hint: the IDE highlighted a line in
System._IntfClear. Apparently some interface reference should be released
and was already freed. I could track this down to my IVTEditLink implementation
in 'no time'. I am calling TForm.Release at the End of CancelEdit and EndEdit.
Somehow this code frees the edit link form before the VTree sets its reference
to nil. And even if I don't use reference counting the compiler still wants to
call release. Not good on a freed object. Happens only under certain circum-
stances, maybe a ProcessMessages is involved which leads to earlier
form.release.

I have remove the TForm.Release calls and am using reference counting now.
Error is gone.

Regards,
Werner

 | Replies | Author | Date
2687 | Re: Troubles with 2.4.34 | Mike Lischke | Tue 6/26/2001


Data-aware VST

From: "sugi" [slim@c...]
Date: Tue Jun 26, 2001 12:23 am
Subject: Data-aware VST

Dear All,

I'm a fairly new VirtualTreeView user (2 weeks...;), and I'm
wondering whether this is the right place to ask support
questions. I had several correspondence with Mike earlier
but I'm sure that his current workload won't allow him to
answer my annoying little questions...:)

Anyway, I "found" the component approximately two weeks ago,
and went as far as writing a very simple data aware version
(read-only) of TVirtualStringTree for one of my applications.

Mike told me that he had posted a beta of data aware VSTs
in the yahoogroups files area, but I keep having trouble
accessing them, with yahoogroups complaining about wrong
password, etc, so I haven't got a chance to take a look
at them. I wonder if I can download it from somewhere?
It's not in the official VT homepage the last time I checked.

Has anyone else written any other data-aware classes for VT ??

Thanks in advance,
salam,
sugi.

 | Replies | Author | Date
2661 | Re: Data-aware VST | Ariel Selig | Tue 6/26/2001
3220 | Re: Data-aware VST | sugi | Sun 7/22/2001
3224 | Re: Data-aware VST | [adembaba@e...] | Mon 7/23/2001
3230 | Re: Data-aware VST | Moritz Franckenstein | Mon 7/23/2001


v2.4.34 - Still cannot compile

From: [garycramblitt@e...]
Date: Tue Jun 26, 2001 12:27 am
Subject: v2.4.34 - Still cannot compile

Latest beta 2.4.34 still cannot be compiled.

>>When I attempt to compile VirtualTreesD5 I get
>>[Error] VirtualExplorerTree.pas(674): Method 'RenderData' not found
>>in base class

>As of now what you have done is necessary. Mike has done a complete
>rework
>of the OLE Drag and Drop / OLE clipboard IDataObject and it is not
>*quite*
>compatible with VET. He is making (made) the changes and I am just
>waiting
>for this next version to be uploaded. I have made the changes to VT
>and
>have VET fully compatible with what VT will be so as soon as the
>next
>version of VT is uploaded VET will be updated.

>Sorry for the confusion.

>Jim

 | Replies | Author | Date
2663 | Re: v2.4.34 - Still cannot compile | Ariel Selig | Tue 6/26/2001


re: Data-aware VST

From: "Ariel Selig" [asel98@y...]
Date: Tue Jun 26, 2001 12:25 am
Subject: Re: Data-aware VST

wrong password?
if u can post, read msgs, then u can get files too... :)
but the dataaware version is for IB. (well, i think... i didnt use it)
i dont think there are other sites, cuz the update files are posted
here (in groups.yahoo).
try using getright, flashget, or something like that.

--- In [VirtualTreeview@y...], "sugi" [slim@c...] wrote:
> Dear All,
>
> I'm a fairly new VirtualTreeView user (2 weeks...;), and I'm
> wondering whether this is the right place to ask support
> questions. I had several correspondence with Mike earlier
> but I'm sure that his current workload won't allow him to
> answer my annoying little questions...:)
>
> Anyway, I "found" the component approximately two weeks ago,
> and went as far as writing a very simple data aware version
> (read-only) of TVirtualStringTree for one of my applications.
>
> Mike told me that he had posted a beta of data aware VSTs
> in the yahoogroups files area, but I keep having trouble
> accessing them, with yahoogroups complaining about wrong
> password, etc, so I haven't got a chance to take a look
> at them. I wonder if I can download it from somewhere?
> It's not in the official VT homepage the last time I checked.
>
> Has anyone else written any other data-aware classes for VT ??
>
> Thanks in advance,
> salam,
> sugi.

 | Replies | Author | Date
3220 | Re: Data-aware VST | sugi | Sun 7/22/2001
3224 | Re: Data-aware VST | [adembaba@e...] | Mon 7/23/2001
3230 | Re: Data-aware VST | Moritz Franckenstein | Mon 7/23/2001


re: VirtualTree Doted Lines...

From: "Ariel Selig" [asel98@y...]
Date: Tue Jun 26, 2001 12:29 am
Subject: Re: VirtualTree Doted Lines...

i was talking about the treelines (that changes when u move the mouse
over each node, using hottrack). or when u "mousedown" over a
checkstate area. ican recompile all the files without any error.

thanks

--- In [VirtualTreeview@y...], "Mike Lischke" [lists@l...] wrote:
> Hi Ariel,
>
> > Mike, i tried to recomplie with the new version, and i have the
> > problem again... :(
>
> What problem did you get? Can you recompile?
>
> Ciao, Mike

 | Replies | Author | Date
2801 | Re: VirtualTree Doted Lines... | Mike Lischke | Sat 6/30/2001


re: v2.4.34 - Still cannot compile

From: "Ariel Selig" [asel98@y...]
Date: Tue Jun 26, 2001 1:19 am
Subject: Re: v2.4.34 - Still cannot compile

u can compile VT. u cant compile VET with that version of VT.
if u need to use VET, then use 2.4.23 it works with VET.

--- In [VirtualTreeview@y...], [garycramblitt@e...] wrote:
> Latest beta 2.4.34 still cannot be compiled.
>
> >>When I attempt to compile VirtualTreesD5 I get
> >>[Error] VirtualExplorerTree.pas(674): Method 'RenderData' not
found
> >>in base class
>
>
> >As of now what you have done is necessary. Mike has done a
complete
> >rework
> >of the OLE Drag and Drop / OLE clipboard IDataObject and it is not
> >*quite*
> >compatible with VET. He is making (made) the changes and I am
just
> >waiting
> >for this next version to be uploaded. I have made the changes to
VT
> >and
> >have VET fully compatible with what VT will be so as soon as the
> >next
> >version of VT is uploaded VET will be updated.
>
> >Sorry for the confusion.
>
> >Jim


changing background color VET (i dont know if in VT too)

From: "Ariel Selig" [asel98@y...]
Date: Tue Jun 26, 2001 1:25 am
Subject: changing background color VET (i dont know if in VT too)

i think the best place is using OnPaintText no?
but now, with the columnColor thing, once u change the brush.color,
Vt change that for the columnColor.

now, i cant change the back color.

any idea?

other thing, in VET, in DoPaintText(...)

the "inherited" statment needs to be at the bottom of the procedure.
if not, when u change canvas properties (like font color), VET change
that again when goes back from OnPaintText.

thanks

 | Replies | Author | Date
2665 | Re: changing background color VET (i dont know if | Jim Kueneman | Tue 6/26/2001


re: changing background color VET (i dont know if in VT too)

From: Jim Kueneman [jimdk@m...]
Date: Tue Jun 26, 2001 3:06 am
Subject: Re: [VirtualTreeview] changing background color VET (i dont know if in VT too)

At 01:25 AM 6/26/2001 +0000, you wrote:
>i think the best place is using OnPaintText no?
>but now, with the columnColor thing, once u change the brush.color,
>Vt change that for the columnColor.

No the best thing is to have yours truely publish the Color property from
VT, which I neglected to do. The next verion will have it published.

>now, i cant change the back color.
>
>any idea?

I am not sure exactly what you tried to do.

>the "inherited" statment needs to be at the bottom of the procedure.
>if not, when u change canvas properties (like font color), VET change
>that again when goes back from OnPaintText.

That is true but since OnPaintText is not published it does not matter
;^) I changed it.

Jim


New file uploaded to VirtualTreeview

From: [VirtualTreeview@yahoogroups.com>
Date: Tue Jun 26, 2001 3:54 am
Subject: New file uploaded to VirtualTreeview

Hello,

This email message is a notification to let you know that
a file has been uploaded to the Files area of the VirtualTreeview
group.

File : /VirtualTree_2.4.34.zip
Uploaded by : [jimdk@m...]
Description : Beta version / with Updated VET

You can access this file at the URL

http://groups.yahoo.com/group/VirtualTreeview/files/VirtualTree_2.4.34.zip

To learn more about file sharing for your group, please visit

http://help.yahoo.com/help/us/groups/files

Regards,

jimdk@m...]


New file uploaded to VirtualTreeview

From: [VirtualTreeview@yahoogroups.com>
Date: Tue Jun 26, 2001 4:05 am
Subject: New file uploaded to VirtualTreeview

Hello,

This email message is a notification to let you know that
a file has been uploaded to the Files area of the VirtualTreeview
group.

File : /VET_V1.4.34.zip
Uploaded by : [jimdk@m...]
Description : Virtual Explorer Tree Version 1.4.34 with Demo Executable

You can access this file at the URL

http://groups.yahoo.com/group/VirtualTreeview/files/VET_V1.4.34.zip

To learn more about file sharing for your group, please visit

http://help.yahoo.com/help/us/groups/files

Regards,

jimdk@m...]


VET 1.4.34, finally available

From: Jim Kueneman [jimdk@m...]
Date: Tue Jun 26, 2001 4:15 am
Subject: VET 1.4.34, finally available

There are still some issues with VET and VT but this release will compile
and work with VT 2.4.34.

If you want to use VET please do the following to VT 2.4.34 and recompile:

1) Line 23360

Remove the following:

with TStringList.Create do
begin
Text := S;
SaveToFile('c:\temp\test.html');
free;
end;

This is a debugging aid which was inadvertantly left in and the desktop
seems to query for the HTML format? ActiveDesktop???

2) Animated expand/collapse leave some reminants behind. I found the
problem and a proposed fix; look at Message (2646) "Re: Troubles with
2.4.34, too " from me if you want to include my fix for now.

3) There is a lot of mystery code in VET this time. There is a new
component for a drop down VET window still in VERY early develpment. It
will NOT show up in the component tool bar yet. I suggest forget it is
there for now ( I really don't want to try to keep separate versions of VET
in sync so .... ). There a bit of code commented out waiting to
negotiate an improvement with Mike <g>. When done it will make column
management much easier.

******************************************************
So whats new
******************************************************

The biggies are:

Reimplemented a lot of the internal logic of the property
setters/getters. VET use to re-enumerate the desktop a number of times
during loading of the component. Now it holds off till after loading then
fills the tree. I could easily have missed a situation where changing a
property should rebuild the tree to reflect the change and it does
not. Please let me know if you find one.

If you have Win2k drag something out of VET and onto the
desktop/Explorer or IE. Cool Huh? This is not using Mikes drag image this
is the built in drag image capability of Win2k, IDragSourceHelper.

I have added a Listview property. The tree does not need a parent
folder with children, it can now show just one level if you like.

Mathis, I implemented a faster FullCollapse using the fact I know how
I expanded the nodes so I know the minimum necessary to collapse
them. BrowseTo's full collapse parameter should not take 4 minutes anymore!

The Range Check errors dealing with Context Menus should be
gone. Please let me know if they are not.

Fixed AV from stupid mistake in ContextMenu.GetCommandString.

Added another method to create new folders that is more
generic CreateNewFolderByNode. Pass a node and a new folder will be
created in it, the node must represent a folder.

A few simple bugs fixed in ShellUtilities.pas.

I hope I included everything. Trying to deal with the new implementation
of the DragDrop stuff and having enough time to try to implement new stuff
based on thinking I can force Mike into some changes <g> I am a bit
confused as to what is what but I really wanted to get a version out that
will work with the latest VT.

If there are issues please let me know.

BTW if you now download VT (2.4.34) the latest version of VET (1.4.34) is
included.

Jim

 | Replies | Author | Date
2689 | Re: VET 1.4.34, finally available | Mike Lischke | Tue 6/26/2001
2692 | Re: VET 1.4.34, finally available | Jim Kueneman | Tue 6/26/2001
2798 | Re: VET 1.4.34, finally available | Mike Lischke | Sat 6/30/2001
2807 | Re: VET 1.4.34, finally available | Jim Kueneman | Sat 6/30/2001
2698 | Re: VET 1.4.34, finally available>> I Get it now | Jim Kueneman | Wed 6/27/2001
2803 | Re: VET 1.4.34, finally available>> I Get it now | Mike Lischke | Sat 6/30/2001


re: New file uploaded to VirtualTreeview

From: Jim Kueneman [jimdk@m...]
Date: Tue Jun 26, 2001 4:06 am
Subject: RE: [VirtualTreeview] New file uploaded to VirtualTreeview

At 10:39 PM 6/24/2001 +0200, you wrote:

>Jim, please download the latest build, replace your units and upload it
>again without version change
>of the main distribution.

Done.

Jim

 | Replies | Author | Date
2688 | Re: New file uploaded to VirtualTreeview | Mike Lischke | Tue 6/26/2001


Incremental searching

From: [basil@r...]
Date: Tue Jun 26, 2001 5:18 am
Subject: Incremental searching

Hi Mike,

While testing incremental searching I have found out that:

1. Local letters are still not handled. To my mind this is because
of you have moved HandleIncrementalSearch procedure to
onKeDown event where CharCode means virtual code not character.

2. When I inserted the following line

CharCode:= MapVirtualKey(CharCode,2);
before
NewChar := KeyUnicode(Char(CharCode));
than everything became ok.

Thanks.
Basil.

 | Replies | Author | Date
2800 | Re: Incremental searching | Mike Lischke | Sat 6/30/2001


Access Violation in Paint method under Windows 2000

From: [andrekh@i...]
Date: Tue Jun 26, 2001 8:02 am
Subject: Access Violation in Paint method under Windows 2000

Hello!

Long time use Virtual TreeView and have no problem. But afetr
migration to Win2000 some time (float error) got access violation in
paint method. I use VT on dinamic created form and load tree from
file. When I try to show form I got AV and incorrect painted VT.

I made small changes for resolve this problem but in general will be
good to found and resolve it correct. After AV I can show this form
again without any problem.

My changes:

procedure TBaseVirtualTree.Paint;

// Window paint routine. Used when the tree window needs to be
updated.
var
Window: TRect;
Target: TPoint;
begin
// Determine area of the entire tree to be displayed in the control.
Window := Canvas.ClipRect;
Target := Window.TopLeft;

// The clipping rectangle is given in client coordinates of the
window. We have to convert it into
// a sliding window of the tree image.
try // I add this
OffsetRect(Window, -FOffsetX, -FOffsetY);
PaintTree(Canvas, Window, Target, [poBackground, poColumnColor,
poDrawFocusRect, poDrawDropMark, poDrawSelection, poGridLines]);
except // I add this
Self.Invalidate; // I add this
end; // I add this
end;

Any one have this problem?

Thanks,

Andriy Khoruzhenko

 | Replies | Author | Date
2799 | Re: Access Violation in Paint method under Window | Mike Lischke | Sat 6/30/2001


BCB5 - VT2.4.34/VET1.2.34 - CF_RTF

From: "Roland" [Beduerftig@S...]
Date: Tue Jun 26, 2001 11:25 am
Subject: BCB5 - VT2.4.34/VET1.2.34 - CF_RTF

Hi All,

I take VT 2.4.34 and VET 1.4.34 and replace the *.pas files in the
existing running version.

Now the complet project can compile with BCB5, remember the problem
with renderdata().

When I compile my actual project then an error happened because there
is a duplicate definition.

VirtualTrees.pas 2.4.34 line 188

var
...
CF_RTF,
...
CF_CSV: Word;

the compiler create a *.hpp

.....
extern PACKAGE Word CF_VTREFERENCE;
extern PACKAGE Word CF_RTF;
.....

and in richedit.h there is also defined

/* Clipboard formats - use as parameter to
RegisterClipboardFormat() */
#define CF_RTF TEXT("Rich Text Format")
#define CF_RTFNOOBJS TEXT("Rich Text Format Without Objects")

this is created from richedit.pas

const
{$EXTERNALSYM CF_RTF}
CF_RTF = 'Rich Text Format';
{$EXTERNALSYM CF_RTFNOOBJS}
CF_RTFNOOBJS = 'Rich Text Format Without Objects';

Note:
This are system resources from ..\programs\borland\cbuilder\source\vcl

Workaround:
I comment the line in VirtualTrees.hpp out !
=> All works fine !

For Release:
I think the orginal define in VirtualTrees.pas must changed, for
example to: CF_VTRTF.

Bye
Roland

 | Replies | Author | Date
2676 | Re: BCB5 - VT2.4.34/VET1.2.34 - CF_RTF | [tias@m...] | Tue 6/26/2001
2678 | Re: BCB5 - VT2.4.34/VET1.2.34 - CF_RTF | Jim Kueneman | Tue 6/26/2001
2683 | Re: BCB5 - VT2.4.34/VET1.2.34 - CF_RTF | [tias@m...] | Tue 6/26/2001
2690 | Re: BCB5 - VT2.4.34/VET1.2.34 - CF_RTF | Mike Lischke | Tue 6/26/2001
2707 | Re: BCB5 - VT2.4.34/VET1.2.34 - CF_RTF | Roland | Wed 6/27/2001
2720 | Re: BCB5 - VT2.4.34/VET1.2.34 - CF_RTF | [tias@m...] | Wed 6/27/2001
2805 | Re: BCB5 - VT2.4.34/VET1.2.34 - CF_RTF | Mike Lischke | Sat 6/30/2001
2835 | Re: BCB5 - VT2.4.34/VET1.2.34 - CF_RTF | Roland | Mon 7/2/2001
2935 | Re: BCB5 - VT2.4.34/VET1.2.34 - CF_RTF | Mike Lischke | Sat 7/7/2001


re: Strange mouse effect

From: GIANNAKOPOULOS KOSTAS [kyan@s...]
Date: Tue Jun 26, 2001 12:34 pm
Subject: RE: [VirtualTreeview] Strange mouse effect

> > Sometimes when the mouse cursor is about to change when you
> > move the mouse from one window to another (especially a
> splitter) a black
> > rectangle appears momentarily and goes away immediately. It
> is so fast
> that you
> > rarely have a chance get a glimpse of it.
>
> I think I have seen this behavior quite often (if it is what
> you mean) and
> it is not directly related to VT applications. The problem
> seems to be the
> shadow which is created on the fly for the mouse pointer on
> Win2K. This can
> get interrupted sometimes depending on the graphics board
> driver. Do you
> have an application which you can use to reproduce the
> problem often enough
> on one machine and which does not show the effect on another
> machine with
> another graphics board?

Well, i've downloaded and installed the latest driver for my graphics board
from ATI's site and the "black rectangle" went away. I've been using the new
driver for 2-3 weeks now and i haven't seen it.

I think it is safe to assume that it was a bug in the driver that may have
been brought up by the VT's MMX code.

<KY>


update VT as a grid.

From: [m.dekker@a...]
Date: Tue Jun 26, 2001 12:56 pm
Subject: update VT as a grid.

Hi VT-users,

Does anybody know how to tell VT (implemented as a grid) to update
the screen if a part (cell) has changed?

Thanx already,

Mark Dekker

 | Replies | Author | Date
2686 | Re: update VT as a grid. | Werner Lehmann | Tue 6/26/2001
2701 | Re: update VT as a grid. | [m.dekker@a...] | Wed 6/27/2001


Something is buggy in VET 1.4.34 D&D

From: Vandrovec Milan [milan_va@s...]
Date: Tue Jun 26, 2001 1:05 pm
Subject: Something is buggy in VET 1.4.34 D&D

Hi, Jim.

> If you have Win2k drag something out of VET and onto the
> desktop/Explorer or IE. Cool Huh?

I don't use any of the clipboard/OLE features, but I gave your exe-demo a
try and found something weird: run the demo, take anything with the mouse,
and drag it to a free area on the taskbar (next to applications' buttons).
It causes all applications, including the demo, to minimize (hide), and
problems start from here.

1. The application does not restore when hovering the mouse (still dragging
the file) over it's button on the taskbar (same holds for Windows Explorer).
2. Drag something from VET, hide the demo as described, and put the file on
the desktop. The taskbar hides somewhere, requiring ctrl+esc or alt+tab to
show back. I don't use auto-hiding, btw. Explorer works well.

I am not very familiar with d&d, OLE, and such things, possibly the problem
is at M$'s side. Just wanted you to know it doesn't work in the case you
have nothing to do :-) I have Win2k, of course.

P.S.: I tried to recompile the demo, but I couldn't find something like
D:\Program Data\Delphi Projects\Sample
Code\DragDrop\Components\DropSource.pas and ...\DropTarget.pas. After
removing them from uses list, I got Delphi Internal Error L1496 and lost my
patience... sorry. If you have trouble recreating the bug, tell me.

Milan Vandrovec

 | Replies | Author | Date
2677 | Re: Something is buggy in VET 1.4.34 D&D | Jim Kueneman | Tue 6/26/2001
2682 | Re: Something is buggy in VET 1.4.34 D&D | Vandrovec Milan | Tue 6/26/2001
2697 | Re: Something is buggy in VET 1.4.34 D&D | Jim Kueneman | Wed 6/27/2001


re: BCB5 - VT2.4.34/VET1.2.34 - CF_RTF

From: [tias@m...]
Date: Tue Jun 26, 2001 1:44 pm
Subject: Re: BCB5 - VT2.4.34/VET1.2.34 - CF_RTF

--- In [VirtualTreeview@y...], "Roland" [Beduerftig@S...] wrote:
> Hi All,

<snip>

> CF_RTF,
> ...
> CF_CSV: Word;
> Workaround:
> I comment the line in VirtualTrees.hpp out !
> => All works fine !

But you have to do this every time your package is recompiled (= the
.hpp file is recreated.)

Simply just put
{$EXTERNALSYM CF_RTF}
before the Pascal definition of the CF_RTF.
Repeat it for every single definition in the .pas file that causes a
duplicate definition error in BCB. Jim did that for some constants in
ShellUtilities.pas, CSIDL_*, IEIFLAG_* and some more stuff...

> For Release:
> I think the orginal define in VirtualTrees.pas must changed, for
> example to: CF_VTRTF.

The EXTERNALSYM keyword was intruduced by Borland (?) to solve exactly
this, so maybe we can hope that Jim will add those lines ?
I know that it's not possible for him to know which constants/vars
that BCB will find in other .h/.hpp files, so he has to get feedback
from us who're using VT/VET in a BCB5 environment.

HTH,
Mathias Thorell

 | Replies | Author | Date
2678 | Re: BCB5 - VT2.4.34/VET1.2.34 - CF_RTF | Jim Kueneman | Tue 6/26/2001
2683 | Re: BCB5 - VT2.4.34/VET1.2.34 - CF_RTF | [tias@m...] | Tue 6/26/2001
2690 | Re: BCB5 - VT2.4.34/VET1.2.34 - CF_RTF | Mike Lischke | Tue 6/26/2001
2707 | Re: BCB5 - VT2.4.34/VET1.2.34 - CF_RTF | Roland | Wed 6/27/2001
2720 | Re: BCB5 - VT2.4.34/VET1.2.34 - CF_RTF | [tias@m...] | Wed 6/27/2001
2805 | Re: BCB5 - VT2.4.34/VET1.2.34 - CF_RTF | Mike Lischke | Sat 6/30/2001
2835 | Re: BCB5 - VT2.4.34/VET1.2.34 - CF_RTF | Roland | Mon 7/2/2001
2935 | Re: BCB5 - VT2.4.34/VET1.2.34 - CF_RTF | Mike Lischke | Sat 7/7/2001


re: Something is buggy in VET 1.4.34 D&D

From: Jim Kueneman [jimdk@m...]
Date: Tue Jun 26, 2001 1:51 pm
Subject: Re: [VirtualTreeview] Something is buggy in VET 1.4.34 D&D

At 03:05 PM 6/26/2001 +0200, you wrote:

>1. The application does not restore when hovering the mouse (still dragging
>the file) over it's button on the taskbar (same holds for Windows Explorer).

Confirmed, looks like a M$ bug. Older version of VET do it as well has
Explorer.

>2. Drag something from VET, hide the demo as described, and put the file on
>the desktop. The taskbar hides somewhere, requiring ctrl+esc or alt+tab to
>show back. I don't use auto-hiding, btw. Explorer works well.

I don't see this problem. Do you have SP2 installed for Win2k?

>P.S.: I tried to recompile the demo, but I couldn't find something like
>D:\Program Data\Delphi Projects\Sample
>Code\DragDrop\Components\DropSource.pas and ...\DropTarget.pas. After
>removing them from uses list, I got Delphi Internal Error L1496 and lost my
>patience... sorry. If you have trouble recreating the bug, tell me.

Yea I was playing with Anders Melander Drag and Drop Component Suite. I
sure wish Delphi was as smart about removing units as it is about adding them!

Fixed.

Thanks,
Jim


re: BCB5 - VT2.4.34/VET1.2.34 - CF_RTF

From: "Jim Kueneman" [jimdk@m...]
Date: Tue Jun 26, 2001 1:59 pm
Subject: Re: BCB5 - VT2.4.34/VET1.2.34 - CF_RTF

--- In [VirtualTreeview@y...], [tias@m...] wrote:

> The EXTERNALSYM keyword was intruduced by Borland (?) to solve
exactly
> this, so maybe we can hope that Jim will add those lines ?

Hey I have enough trouble keeping VET up to date without fixing Mikes
code too <vbg> (that is in VT not VET)

Jim

 | Replies | Author | Date
2683 | Re: BCB5 - VT2.4.34/VET1.2.34 - CF_RTF | [tias@m...] | Tue 6/26/2001


Problem with 2.4.34

From: [F.vdwestelaken@c...]
Date: Tue Jun 26, 2001 2:11 pm
Subject: Problem with 2.4.34

Hi,

after updating to 2.4.34 my program didn't fill my tree correct any
more. In the OnExpanding event I fill my nodes. The problem however
is that when calling AddChild in the OnExpand event, the OnExpand
event is called again. I tracked this down to the ScrollIntoView
statement that was added in AddChild. In previous versions this call
wasn't there. It was fixed by adding BeginUpdate and EndUpdate in the
OnExpand event.

Franc.

 | Replies | Author | Date
2684 | Re: Problem with 2.4.34 | Werner Lehmann | Tue 6/26/2001
2693 | Re: Problem with 2.4.34 | Franc v/d Westelaken | Tue 6/26/2001
2696 | Re: Problem with 2.4.34 | Werner Lehmann | Tue 6/26/2001


re: How to optimize the sorting ?

From: [yahoo@s...]
Date: Tue Jun 26, 2001 2:18 pm
Subject: Re: How to optimize the sorting ?

Hey Mike,

> Have you tried to simply compare the indices instead to test if the
comparation or the node
> reordering takes so much time?
>
> >
> > Data1 := Sender.GetNodeData(Node1);
> > Data2 := Sender.GetNodeData(Node2);
> > Result := CompareText(Data1^.Subject,Data2^.Subject);
> >
> > Sure the CompareText is lenghty but, that much?
>
> Could well be. Keep in mind this is Unicode (or do you have ANSI
captions?). But about how many
> nodes are we talking? In one of the products of my company I have
20K+ nodes which sort in 2-3
> seconds on a 350MHZ PII.
>

Actually the comparing does take about 2-3 secs, i traced around to
see where it was eating time and it seems to be 'ValidateChildren'
that takes forever to complete. Theres a While there that goes tru
every node with .nextSibling and does a ValidateNode
(Child,Recursive). That really chokes the performance. I think (but
im not certain) thats the place where it calls the OnInitNode.
However, this is not THAT long when I turn AutoSort off.

Any reason why the node init would be longer with AutoSort on?

Thanks

-Masial

 | Replies | Author | Date
2802 | Re: How to optimize the sorting ? | Mike Lischke | Sat 6/30/2001


Header Columns behave strange.

From: [m.dekker@a...]
Date: Tue Jun 26, 2001 2:54 pm
Subject: Header Columns behave strange.

Hi everyone,

I have a strange problem with dynamically creating the Columns.
I use the following code for the first 2 headercolumns.

NewColumn := VirtualTree.Header.Columns.Add;
NewColumn.Text := '';
NewColumn.Width := 20;

The other columns i create are in a loop filled by some arrayvalues.
I tried to simulate a border like the stringgrid (see the advanced
demo). The first time i ran my program, the first column isn't
visible and the second contains the border. The second time, reading
new data, the first column is also shown, which is very strange. I
cleared the headers by using

VirtualTree.Clear;
VirtualTree.Header.Columns.Clear;

to make sure the tree is cleared at all.

Any suggestions?

Regards,
Mark Dekker.

 | Replies | Author | Date
2685 | Re: Header Columns behave strange. | Werner Lehmann | Tue 6/26/2001
2834 | Re: Header Columns behave strange. | [m.dekker@a...] | Mon 7/2/2001
2909 | Re: Header Columns behave strange. | Werner Lehmann | Fri 7/6/2001


re: Something is buggy in VET 1.4.34 D&D

From: Vandrovec Milan [milan_va@s...]
Date: Tue Jun 26, 2001 3:00 pm
Subject: RE: [VirtualTreeview] Something is buggy in VET 1.4.34 D&D

Hi again.

>>2. Drag something from VET, hide the demo as described, and put the file
on
>>the desktop. The taskbar hides somewhere, requiring ctrl+esc or alt+tab to
>>show back. I don't use auto-hiding, btw. Explorer works well.

>I don't see this problem. Do you have SP2 installed for Win2k?

No, it STILL isn't available for the Czech release. But I have rebooted, and
it once worked fine, once it hided and from then it is OK. We'll have to
catch this bug later... But I have found something else you can try.
Open two VETs above each other like this:
+----+
+--| |
| |1 |
| 2|3 |
| +----+
+----+

and drag quickly a few files from 1 to 2 to 3. You have to be quite fast,
but the more files you take, the easier. The transparent image of files will
remain hovering over the left VET. It looks like the left one owns the
image, since closing it will destroy the image.

I have to stop experimenting... and thank you all for your time.

Milan Vandrovec

 | Replies | Author | Date
2697 | Re: Something is buggy in VET 1.4.34 D&D | Jim Kueneman | Wed 6/27/2001


re: BCB5 - VT2.4.34/VET1.2.34 - CF_RTF

From: [tias@m...]
Date: Tue Jun 26, 2001 3:16 pm
Subject: Re: BCB5 - VT2.4.34/VET1.2.34 - CF_RTF

--- In [VirtualTreeview@y...], "Jim Kueneman" [jimdk@m...] wrote:

<snip>

> Hey I have enough trouble keeping VET up to date without fixing
Mikes
> code too <vbg> (that is in VT not VET)

Ooopss... Sorry, I'm too sleepy right now to be able to read things
correctly. Ok, so let's hope Mike reads the previous message from me
and that he's got time to put the {$EXTERNALSYM} stuff into
VirtualTrees.pas :-)

/MT


re: Problem with 2.4.34

From: Werner Lehmann [wl@b...]
Date: Tue Jun 26, 2001 3:53 pm
Subject: Re: [VirtualTreeview] Problem with 2.4.34

[F.vdwestelaken@c...] wrote:
>
> Hi,
>
> after updating to 2.4.34 my program didn't fill my tree correct any
> more. In the OnExpanding event I fill my nodes. The problem however
> is that when calling AddChild in the OnExpand event, the OnExpand
> event is called again. I tracked this down to the ScrollIntoView
> statement that was added in AddChild. In previous versions this call
> wasn't there. It was fixed by adding BeginUpdate and EndUpdate in the
> OnExpand event.

I believe you can safely comment that ScrollIntoView line. As I take it
it will be gone in the next version. Although I am not sure why a
ScrollIntoView could possibly cause an OnExpand event.

Werner

 | Replies | Author | Date
2693 | Re: Problem with 2.4.34 | Franc v/d Westelaken | Tue 6/26/2001


re: Header Columns behave strange.

From: Werner Lehmann [wl@b...]
Date: Tue Jun 26, 2001 3:57 pm
Subject: Re: [VirtualTreeview] Header Columns behave strange.

[m.dekker@a...] wrote:
>
> The other columns i create are in a loop filled by some arrayvalues.
> I tried to simulate a border like the stringgrid (see the advanced
> demo). The first time i ran my program, the first column isn't
> visible and the second contains the border. The second time, reading
> new data, the first column is also shown, which is very strange. I
> cleared the headers by using

Just guessing, but did you set MainColumn to 0 and hide it? IIRC that's
the way the advanced demo grid does it, according to the comment label
and my memory :)

Werner

 | Replies | Author | Date
2834 | Re: Header Columns behave strange. | [m.dekker@a...] | Mon 7/2/2001


re: update VT as a grid.

From: Werner Lehmann [wl@b...]
Date: Tue Jun 26, 2001 3:44 pm
Subject: Re: [VirtualTreeview] update VT as a grid.

[m.dekker@a...] wrote:
>
> Hi VT-users,
>
> Does anybody know how to tell VT (implemented as a grid) to update
> the screen if a part (cell) has changed?

InvalidateNode() for a cell/node
Invalidate for whole client area
UpdateWindow() for immediate update of client area (usually Invalidate suffices)

Werner

 | Replies | Author | Date
2701 | Re: update VT as a grid. | [m.dekker@a...] | Wed 6/27/2001


re: Troubles with 2.4.34

From: "Mike Lischke" [lists@l...]
Date: Tue Jun 26, 2001 6:42 pm
Subject: RE: [VirtualTreeview] Troubles with 2.4.34

> I tell you something: the performance problem is gone. Without me doing
> anything about it. Yes.

Love to hear such news :o] I think it is no bad that I cannot answer as fast as
before. Some
problems disappear for various reasons not directly related to VT.

Ciao, Mike


re: New file uploaded to VirtualTreeview

From: "Mike Lischke" [lists@l...]
Date: Tue Jun 26, 2001 6:47 pm
Subject: RE: [VirtualTreeview] New file uploaded to VirtualTreeview

> >Jim, please download the latest build, replace your units and upload it
> >again without version change
> >of the main distribution.
> Done.

Excellent Jim. Thank you.

Ciao, Mike


re: VET 1.4.34, finally available

From: "Mike Lischke" [lists@l...]
Date: Tue Jun 26, 2001 6:53 pm
Subject: RE: [VirtualTreeview] VET 1.4.34, finally available

Jim,

> If you have Win2k drag something out of VET and onto the
> desktop/Explorer or IE. Cool Huh? This is not using Mikes drag image this
> is the built in drag image capability of Win2k, IDragSourceHelper.

This is very slow on one machine (W2K, PII 2 * 350Mhz). Despite it is at least
twice as slow as the
Explorer it works excellent.

> If there are issues please let me know.

I tried VET today in an application and was surprised no to find a property
like VET.CurrentPath. I
found then ValidateNamespace and accessed the various properties, but it would
be much simpler if
there were such a property. Could you also somewhere document what which Name*
property is for.
There are so much I feel somwhat confused :o]

Another point, when I have selected a folder and create a file in it with other
means than VET (e.g.
by a file stream) then the tree is not updated automatically (notifications are
on of course). The
neUpdateFolder message is silently skipped without doing anything. Is this a
bug or a feature?

Ciao, Mike

 | Replies | Author | Date
2692 | Re: VET 1.4.34, finally available | Jim Kueneman | Tue 6/26/2001
2798 | Re: VET 1.4.34, finally available | Mike Lischke | Sat 6/30/2001
2807 | Re: VET 1.4.34, finally available | Jim Kueneman | Sat 6/30/2001
2698 | Re: VET 1.4.34, finally available>> I Get it now | Jim Kueneman | Wed 6/27/2001
2803 | Re: VET 1.4.34, finally available>> I Get it now | Mike Lischke | Sat 6/30/2001


re: Re: BCB5 - VT2.4.34/VET1.2.34 - CF_RTF

From: "Mike Lischke" [lists@l...]
Date: Tue Jun 26, 2001 7:01 pm
Subject: RE: [VirtualTreeview] Re: BCB5 - VT2.4.34/VET1.2.34 - CF_RTF

> Simply just put
> {$EXTERNALSYM CF_RTF}
> before the Pascal definition of the CF_RTF.

Yup, thanks, did it.

Ciao, Mike

 | Replies | Author | Date
2707 | Re: BCB5 - VT2.4.34/VET1.2.34 - CF_RTF | Roland | Wed 6/27/2001
2720 | Re: BCB5 - VT2.4.34/VET1.2.34 - CF_RTF | [tias@m...] | Wed 6/27/2001
2805 | Re: BCB5 - VT2.4.34/VET1.2.34 - CF_RTF | Mike Lischke | Sat 6/30/2001
2835 | Re: BCB5 - VT2.4.34/VET1.2.34 - CF_RTF | Roland | Mon 7/2/2001
2935 | Re: BCB5 - VT2.4.34/VET1.2.34 - CF_RTF | Mike Lischke | Sat 7/7/2001


re: Strange behaviour

From: "Mike Lischke" [lists@l...]
Date: Tue Jun 26, 2001 7:21 pm
Subject: RE: [VirtualTreeview] Strange behaviour

Hi Zoltan,

> Thats all working fine but at some stages my display going to wrong nodes.
> When I use the GetNodeData function I got the right nodedata but on display
> I got a wrong Node. I noticed that when I make a FullCollapse method with
> some node and a FullExpand with the same node the strange behaviour is gone.

I have no idea what could be wrong. Have you tried the latest build? If this
still does not help can
you please create a very simple demo which shows the effect so I can step
through the code?

Ciao, Mike


re: VET 1.4.34, finally available

From: "Jim Kueneman" [jimdk@m...]
Date: Tue Jun 26, 2001 7:45 pm
Subject: Re: VET 1.4.34, finally available

--- In [VirtualTreeview@y...], "Mike Lischke" [lists@l...] wrote:
> Jim,
>
> > If you have Win2k drag something out of VET and onto the
> > desktop/Explorer or IE. Cool Huh? This is not using Mikes drag
image this
> > is the built in drag image capability of Win2k,
IDragSourceHelper.
>
> This is very slow on one machine (W2K, PII 2 * 350Mhz). Despite it
is at least twice as slow as the
> Explorer it works excellent.

Twice as slow in what respect? Initial start of the drag? All during
the drag? Maybe this should be an option since it does seem to
present a problem for some.

> I tried VET today in an application and was surprised no to find a
property like VET.CurrentPath. I
> found then ValidateNamespace and accessed the various properties,
but it would be much simpler if
> there were such a property.

Agreed, it shall be done.

> Could you also somewhere document what
which Name* property is for.
> There are so much I feel somwhat confused :o]

There is a BIG explanation of the NameXXXX properties in the help
file, which no one has yet ;^)

The problem is it is necessary to understand the shell a little bit to
understand the various "Names" for a namespace. I decided to keep
them keyed to the IShellFolder.GetDisplayNameOf SHGNO_xxx constants.

> Another point, when I have selected a folder and create a file in it
with other means than VET (e.g.
> by a file stream) then the tree is not updated automatically
(notifications are on of course). The
> neUpdateFolder message is silently skipped without doing anything.
Is this a bug or a feature?

No it is a conciquence of playing in the realm of undocumented
functions. It depends on how a program creates a file if the shell
sees it and generates a notification.

Applications are SUPPOSE to use SHChangeNotify after creating a file,
but do they? No.

I have to add an FindCloseChangeNotification thread to find these
rebels.

Jim

 | Replies | Author | Date
2798 | Re: VET 1.4.34, finally available | Mike Lischke | Sat 6/30/2001
2807 | Re: VET 1.4.34, finally available | Jim Kueneman | Sat 6/30/2001


re: Problem with 2.4.34

From: "Franc v/d Westelaken" [F.vdwestelaken@c...]
Date: Tue Jun 26, 2001 8:10 pm
Subject: RE: [VirtualTreeview] Problem with 2.4.34

Wener,

> I believe you can safely comment that ScrollIntoView line. As I take it
> it will be gone in the next version. Although I am not sure why a
> ScrollIntoView could possibly cause an OnExpand event.

The following line of code in ScrolIntoView causes the AutoExpand event to
fire:

if not (vsExpanded in Run.States) then
ToggleNode(Run);

Could well be that my way of adding a child in the OnExpand event causes
this behaviour but I'm not sure.

Franc.


re: Re: VET 1.4.34, finally available

From: "Teus de Jong" [teusjdejong@p...]
Date: Tue Jun 26, 2001 8:38 pm
Subject: Re: [VirtualTreeview] Re: VET 1.4.34, finally available

Hi Jim,

> Applications are SUPPOSE to use SHChangeNotify after creating a file,
> but do they? No.
>
> I have to add an FindCloseChangeNotification thread to find these
> rebels.

:o]

Groetjes,

Teus de Jong

 | Replies | Author | Date
2695 | Re: VET 1.4.34, finally available | Jim Kueneman | Tue 6/26/2001
2704 | Re: VET 1.4.34, finally available | GIANNAKOPOULOS KOSTAS | Wed 6/27/2001
2705 | Re: VET 1.4.34, finally available | Teus de Jong | Wed 6/27/2001
2706 | Re: VET 1.4.34, finally available | GIANNAKOPOULOS KOSTAS | Wed 6/27/2001
2708 | Re: VET 1.4.34, finally available | Teus de Jong | Wed 6/27/2001
2711 | Re: VET 1.4.34, finally available | Jim Kueneman | Wed 6/27/2001
2712 | Re: VET 1.4.34, finally available | Teus de Jong | Wed 6/27/2001
2715 | Re: VET 1.4.34, finally available | Jim Kueneman | Wed 6/27/2001
2713 | Re: VET 1.4.34, finally available | GIANNAKOPOULOS KOSTAS | Wed 6/27/2001


re: VET 1.4.34, finally available

From: "Jim Kueneman" [jimdk@m...]
Date: Tue Jun 26, 2001 10:30 pm
Subject: Re: VET 1.4.34, finally available

--- In [VirtualTreeview@y...], "Teus de Jong" [teusjdejong@p...] wrote:
> Hi Jim,
>
> > Applications are SUPPOSE to use SHChangeNotify after creating a
file,
> > but do they? No.
> >
> > I have to add an FindCloseChangeNotification thread to find these
> > rebels.
>

Oops, meant FindFirstChangeNotification

> :o]
>
> Groetjes,

Translation = "You idiot"? <g>

Jim


re: Problem with 2.4.34

From: Werner Lehmann [wl@b...]
Date: Tue Jun 26, 2001 9:27 pm
Subject: Re: [VirtualTreeview] Problem with 2.4.34

Franc v/d Westelaken wrote:
>
> Wener,
>
> > I believe you can safely comment that ScrollIntoView line. As I take it
> > it will be gone in the next version. Although I am not sure why a
> > ScrollIntoView could possibly cause an OnExpand event.
>
> The following line of code in ScrolIntoView causes the AutoExpand event to
> fire:
>
> if not (vsExpanded in Run.States) then
> ToggleNode(Run);

IC. I did not have a delphi ready when I answered the posting. Sounds logical
to expand all parent nodes of the scroll-into-view node. But if you add nodes
in OnExpandind the parent node (of the new child) is of course not expanded
and will be expanded. Well, lets forget it, ScrollIntoView will be removed from
AddChild and InsertNode.

> Could well be that my way of adding a child in the OnExpand event causes
> this behaviour but I'm not sure.

Nope, these are the usual things that are done in OnExpanding. BTW, if you init
manually (not via OnInitNode) and use AddChild: you can speed up the operation
if many nodes must be added and you know how many. Just set the ChildCount
property of that node and after that initialize manually (start with the first
child and iterate through all children with Child.NextSibling) or via
OnInitNode,
probably index based.

Werner


re: Something is buggy in VET 1.4.34 D&D

From: Jim Kueneman [jimdk@m...]
Date: Wed Jun 27, 2001 1:42 am
Subject: RE: [VirtualTreeview] Something is buggy in VET 1.4.34 D&D

At 05:00 PM 6/26/2001 +0200, you wrote:

>No, it STILL isn't available for the Czech release. But I have rebooted, and
>it once worked fine, once it hided and from then it is OK. We'll have to
>catch this bug later... But I have found something else you can try.
>Open two VETs above each other like this:
> +----+
> +--| |
> | |1 |
> | 2|3 |
> | +----+
> +----+

Still don't see anything, has anyone else experienced this? Did the drag
actually abort or is still actually executing the drag?

>I have to stop experimenting... and thank you all for your time.

PLEASE DO. All these problems have burst my bubble enought <g>

Jim


re: VET 1.4.34, finally available>> I Get it now Mike!

From: Jim Kueneman [jimdk@m...]
Date: Wed Jun 27, 2001 2:26 am
Subject: RE: [VirtualTreeview] VET 1.4.34, finally available>> I Get it now Mike!

At 08:53 PM 6/26/2001 +0200, you wrote:

>Another point, when I have selected a folder and create a file in it with
>other means than VET (e.g.
>by a file stream) then the tree is not updated automatically
>(notifications are on of course). The
>neUpdateFolder message is silently skipped without doing anything. Is this
>a bug or a feature?

Now I get it! You threw me with neUpdateFolder, it is really sneUpdateDir
(or SHCNE_UPDATEDIR)

Yes, it was an oversight on my part. Fixed.

Jim

 | Replies | Author | Date
2803 | Re: VET 1.4.34, finally available>> I Get it now | Mike Lischke | Sat 6/30/2001


re: New file uploaded to VirtualTreeview

From: "Ernest Fairchild" [efairchild@h...]
Date: Wed Jun 27, 2001 4:41 am
Subject: Re: [VirtualTreeview] New file uploaded to VirtualTreeview

Allright. So if I wanted to upgrade, what do I do? How do I uninstall the
old version?

Have a great day!

Ernest
([efairchild@h...])

_____________________
"Law -- a subject that seems to serve two purposes: to make lawyers rich and
to make more lawyers."

Visit my website at http://www.public.asu.edu/~ernestf

----- Original Message -----
From: [VirtualTreeview@yahoogroups.com>
To: <VirtualTreeview@yahoogroups.com>
Sent: Monday, June 25, 2001 20:54
Subject: [VirtualTreeview] New file uploaded to VirtualTreeview

>
> Hello,
>
> This email message is a notification to let you know that
> a file has been uploaded to the Files area of the VirtualTreeview
> group.
>
> File : /VirtualTree_2.4.34.zip
> Uploaded by : jimdk@m...]
> Description : Beta version / with Updated VET
>
> You can access this file at the URL
>
> http://groups.yahoo.com/group/VirtualTreeview/files/VirtualTree_2.4.34.zip

 | Replies | Author | Date
2709 | Re: New file uploaded to VirtualTreeview | Jim Kueneman | Wed 6/27/2001


Fullexpand with '*'

From: [F.vdwestelaken@c...]
Date: Wed Jun 27, 2001 6:09 am
Subject: Fullexpand with '*'

Hi,

when pressing the '*' key the tree is supposed to fully expand.
However, it looks like that when pressing '*' only already
initialized nodes are being displayed. Childnodes which aren't yet
initialized don't appear in the tree. I've to fully reinitialize the
tree (that means, restarting my program) to get the tree working
again. I'm using 2.4.34.

Franc.

 | Replies | Author | Date
2710 | Re: Fullexpand with '*' | Jim Kueneman | Wed 6/27/2001
2723 | Re: Fullexpand with '*' | Franc v/d Westelaken | Wed 6/27/2001
2726 | Re: Fullexpand with '*' | Jim Kueneman | Thu 6/28/2001
2751 | Re: Fullexpand with '*' | Franc v/d Westelaken | Thu 6/28/2001
2761 | Re: Fullexpand with '*' | Jim Kueneman | Thu 6/28/2001
2804 | Re: Fullexpand with '*' | Mike Lischke | Sat 6/30/2001
2806 | Re: Fullexpand with '*' | Franc v/d Westelaken | Sat 6/30/2001


re: update VT as a grid.

From: [m.dekker@a...]
Date: Wed Jun 27, 2001 6:52 am
Subject: Re: update VT as a grid.

Thanx a lot Werner for your suggestions!
I really appreciate that!
Kind Regards,
Mark Dekker.

--- In [VirtualTreeview@y...], Werner Lehmann [wl@b...] wrote:
> [m.dekker@a...] wrote:
> >
> > Hi VT-users,
> >
> > Does anybody know how to tell VT (implemented as a grid) to update
> > the screen if a part (cell) has changed?
>
> InvalidateNode() for a cell/node
> Invalidate for whole client area
> UpdateWindow() for immediate update of client area (usually
Invalidate suffices)
>
> Werner


[no subject]

From: [F.vdwestelaken@c...]
Date: Wed Jun 27, 2001 7:00 am
Subject:

6 Jun 2001 22:11:13 +0200
To: [VirtualTreeview@yahoogroups.com>
Message-ID: [MMEBIEFEHHOLNALGMHDOGEANDLAA.F.vdWestelaken@c...]
X-Priority: 3 (Normal)
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2911.0)
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2479.0006
Importance: Normal
In-Reply-To: [3B38AFE1.C072A4FB@b...]
From: "Franc v/d Westelaken" <F.vdwestelaken@c...]
MIME-Version: 1.0
Mailing-List: list VirtualTreeview@yahoogroups.com; contact
VirtualTreeview-owner@yahoogroups.com
Delivered-To: mailing list VirtualTreeview@yahoogroups.com
Precedence: bulk
List-Unsubscribe: <mailto:VirtualTreeview-unsubscribe@yahoogroups.com>
Date: Tue, 26 Jun 2001 22:10:04 +0200
Reply-To: VirtualTreeview@yahoogroups.com
Subject: RE: [VirtualTreeview] Problem with 2.4.34
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
X-UIDL: 1900
Status: U

Wener,

> I believe you can safely comment that ScrollIntoView line. As I take it
> it will be gone in the next version. Although I am not sure why a
> ScrollIntoView could possibly cause an OnExpand event.

The following line of code in ScrolIntoView causes the AutoExpand event to
fire:

if not (vsExpanded in Run.States) then
ToggleNode(Run);

Could well be that my way of adding a child in the OnExpand event causes
this behaviour but I'm not sure.

Franc.

To unsubscribe from this group, send an email to:
VirtualTreeview-unsubscribe@egroups.com

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/


[no subject]

From: [efairchild@h...]
Date: Wed Jun 27, 2001 7:00 am
Subject:

1 21:46:20 -0700
Message-ID: [03fe01c0fec3$7197b760$928cfea9@c...]
To: [VirtualTreeview@yahoogroups.com>
References: [993527644.83828.70732.q3@yahoogroups.com>
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 5.50.4522.1200
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200
From: "Ernest Fairchild" [efairchild@h...]
MIME-Version: 1.0
Mailing-List: list VirtualTreeview@yahoogroups.com; contact
VirtualTreeview-owner@yahoogroups.com
Delivered-To: mailing list VirtualTreeview@yahoogroups.com
Precedence: bulk
List-Unsubscribe: <mailto:VirtualTreeview-unsubscribe@yahoogroups.com>
Date: Tue, 26 Jun 2001 21:41:34 -0700
Reply-To: VirtualTreeview@yahoogroups.com
Subject: Re: [VirtualTreeview] New file uploaded to VirtualTreeview
Content-Type: text/plain; charset=Windows-1252
Content-Transfer-Encoding: 7bit
X-UIDL: 1906
Status: U

Allright. So if I wanted to upgrade, what do I do? How do I uninstall the
old version?

Have a great day!

Ernest
(efairchild@h...])

_____________________
"Law -- a subject that seems to serve two purposes: to make lawyers rich and
to make more lawyers."

Visit my website at http://www.public.asu.edu/~ernestf

----- Original Message -----
From: <VirtualTreeview@yahoogroups.com>
To: <VirtualTreeview@yahoogroups.com>
Sent: Monday, June 25, 2001 20:54
Subject: [VirtualTreeview] New file uploaded to VirtualTreeview

>
> Hello,
>
> This email message is a notification to let you know that
> a file has been uploaded to the Files area of the VirtualTreeview
> group.
>
> File : /VirtualTree_2.4.34.zip
> Uploaded by : jimdk@m...]
> Description : Beta version / with Updated VET
>
> You can access this file at the URL
>
> http://groups.yahoo.com/group/VirtualTreeview/files/VirtualTree_2.4.34.zip

To unsubscribe from this group, send an email to:
VirtualTreeview-unsubscribe@egroups.com

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/


re: VET 1.4.34, finally available

From: GIANNAKOPOULOS KOSTAS [kyan@s...]
Date: Wed Jun 27, 2001 7:32 am
Subject: RE: [VirtualTreeview] VET 1.4.34, finally available

> Another point, when I have selected a folder and create a
> file in it with other means than VET (e.g.
> by a file stream) then the tree is not updated automatically
> (notifications are on of course). The
> neUpdateFolder message is silently skipped without doing
> anything. Is this a bug or a feature?

About shell notifications:

There are situations where you create/modify/delete an item and you don't
get the corresponding SHCNE_XXX event about the item, you get a
SHCNE_UPDATEDIR event for its the parent folder instead. For instance when
you use a command prompt to delete files. I found this when i was working
with my TCustomTreeView-descendant shell tree.

This means that the SHCNE_UPDATEDIR MUST be handled (despite the fact that
it costs) because sometimes it is the only event you get.

How i did it:
1. Get an enumeration of all the items of the folder.
2. Find the corresponding node. if it hasn't been fetched or hasn't been
expanded then leave.
2. Compare the enum with the contents of the node.
2a. Delete from the node any subnodes that are not in the enum.
2b. Refresh the remaining nodes.
2c. Insert (uninitialized/collapsed) any items that are in the enum and
were not in the node.

<KY>


re: Re: VET 1.4.34, finally available

From: "Teus de Jong" [teusjdejong@p...]
Date: Wed Jun 27, 2001 10:07 am
Subject: Re: [VirtualTreeview] Re: VET 1.4.34, finally available

Jim,

> Oops, meant FindFirstChangeNotification
>
> > :o]
> >
> > Groetjes,
>
> Translation = "You idiot"? <g>

Of course not! I consider your VirtualTreeView to be a fantastic component
and even contemplated throwing my own efforts in the recycle bin after
seeing what you made. But after some thought I concluded that it are two
different approaches.

'Groetjes' means 'Greetings', 'Ciao', etc. What I ment by the smile is that
you need the FindFirstChangeNotification too.

You will find my thread with FindFirstChangeNotification for TVTFilelist in
flist.pas. In the comment I say

// WatchThread looks if something changes in the folder displayed
// in the filelist. This is also done by SHChangeNotify, but at the
// moment only about 20% of all programs notify the shell of changes

Maybe that's too pessimistic, but it will not be much more. This means that
you will have the same problem I have, I'm afraid: you get a double check.
And AFAIK FindFirstChangeNotification is very generic: it only means
something has changed.

Giannokoulos Kostas suggested you can handle them with SHCNE_UPDATEDIR. I
experimented with that, but I think a lot of changes are not catched by that
too.

Teus de Jong.


re: Re: VET 1.4.34, finally available

From: GIANNAKOPOULOS KOSTAS [kyan@s...]
Date: Wed Jun 27, 2001 10:23 am
Subject: RE: [VirtualTreeview] Re: VET 1.4.34, finally available

Teus,

Can you tell me please how you've managed to make a change to the file
system that does not trigger SHCNE_UPDATEDIR? What program/code did you use
and in which version of Windows?

The reason i'm asking is that i think i've tried everything (a delphi
TFileStream, command prompt, bare API calls, even an operation from another
machine to my file system) and i always got SHCNE_UPDATEDIR in my Win2K.

I'm counting on this behaviour, so, if you know something i don't, please
let me know.

Thank you.

<KY>

> Giannokoulos Kostas suggested you can handle them with
> SHCNE_UPDATEDIR. I
> experimented with that, but I think a lot of changes are not
> catched by that too.


re: BCB5 - VT2.4.34/VET1.2.34 - CF_RTF

From: "Roland" [Beduerftig@S...]
Date: Wed Jun 27, 2001 11:12 am
Subject: Re: BCB5 - VT2.4.34/VET1.2.34 - CF_RTF

--- In [VirtualTreeview@y...], "Mike Lischke" [lists@l...] wrote:
> > Simply just put
> > {$EXTERNALSYM CF_RTF}
> > before the Pascal definition of the CF_RTF.
>
> Yup, thanks, did it.
>
> Ciao, Mike

Hi Mathias, Mike,

I have copied both source the *.hpp form VT and the *.h Orginal
RichText from Borland, I think the basic problem is:

in VT is CF_RTF a word
and in RichText is CF_RTF a TEXT

this also a difference in define and not only a double declaration.

Bye
Roland

 | Replies | Author | Date
2720 | Re: BCB5 - VT2.4.34/VET1.2.34 - CF_RTF | [tias@m...] | Wed 6/27/2001
2805 | Re: BCB5 - VT2.4.34/VET1.2.34 - CF_RTF | Mike Lischke | Sat 6/30/2001
2835 | Re: BCB5 - VT2.4.34/VET1.2.34 - CF_RTF | Roland | Mon 7/2/2001
2935 | Re: BCB5 - VT2.4.34/VET1.2.34 - CF_RTF | Mike Lischke | Sat 7/7/2001


re: Re: VET 1.4.34, finally available

From: "Teus de Jong" [teusjdejong@p...]
Date: Wed Jun 27, 2001 11:40 am
Subject: Re: [VirtualTreeview] Re: VET 1.4.34, finally available

Giannokoulos,

> Can you tell me please how you've managed to make a change to the file
> system that does not trigger SHCNE_UPDATEDIR? What program/code did you
use
> and in which version of Windows?
>
> The reason i'm asking is that i think i've tried everything (a delphi
> TFileStream, command prompt, bare API calls, even an operation from
another
> machine to my file system) and i always got SHCNE_UPDATEDIR in my Win2K.
>
> I'm counting on this behaviour, so, if you know something i don't, please
> let me know.

Maybe you are doing things differently. I would be very glad if I could get
rid of the double check and retire FindFirstChangeNotification.

I have the following examples. The most obvious example is a file made or
deleted by an old MS-DOS program: I don't get any notification there.
Second, when I'm going to a DOS-prompt and copy or move files, I don't get
any notification (you say you get them; maybe we use different parameters?)
When I distill a file with Acrobat Distiller, I don't get any notification.

Teus de Jong

 | Replies | Author | Date
2711 | Re: VET 1.4.34, finally available | Jim Kueneman | Wed 6/27/2001


re: New file uploaded to VirtualTreeview

From: Jim Kueneman [jimdk@m...]
Date: Wed Jun 27, 2001 12:30 pm
Subject: Re: [VirtualTreeview] New file uploaded to VirtualTreeview

At 09:41 PM 6/26/2001 -0700, you wrote:
>Allright. So if I wanted to upgrade, what do I do? How do I uninstall the
>old version?

Close any project you have open in Delphi and uninstall the "Virtual
Treeview" package from the Component>Install Packages menu. Unzip the new
version over top of the old. I highly recommend deleting any *.dcu files
associated with VT or VET (VirtualTrees.dcu, ShellUtilites.dcu,
VirtualExplorerTree.dcu, etc.) and then deleting the VirtualTreesD5.bpl (or
VirtualTreesD4.bpl) which by default is in the $Delphi\Projects\BPL folder.

Open the VirtualTreesD5.dpk (or D4) from the IDE, compile the package then
hit Install and reopen you project.

This may seem like overkill but I have had a lot of problems with the *.bpl
file being out of sync with things causing all kinds of weird problems
(like entry points not being found, Error L10xx during compile, IDE
crashing among other things)

Jim


re: Fullexpand with '*'

From: Jim Kueneman [jimdk@m...]
Date: Wed Jun 27, 2001 12:33 pm
Subject: Re: [VirtualTreeview] Fullexpand with '*'

At 06:09 AM 6/27/2001 +0000, you wrote:
>Hi,
>
>when pressing the '*' key the tree is supposed to fully expand.
>However, it looks like that when pressing '*' only already
>initialized nodes are being displayed. Childnodes which aren't yet
>initialized don't appear in the tree. I've to fully reinitialize the
>tree (that means, restarting my program) to get the tree working
>again. I'm using 2.4.34.

I don't see a problem in VET. How are you adding child nodes?

Jim

 | Replies | Author | Date
2723 | Re: Fullexpand with '*' | Franc v/d Westelaken | Wed 6/27/2001
2726 | Re: Fullexpand with '*' | Jim Kueneman | Thu 6/28/2001
2751 | Re: Fullexpand with '*' | Franc v/d Westelaken | Thu 6/28/2001
2761 | Re: Fullexpand with '*' | Jim Kueneman | Thu 6/28/2001


re: Re: VET 1.4.34, finally available

From: Jim Kueneman [jimdk@m...]
Date: Wed Jun 27, 2001 12:40 pm
Subject: Re: [VirtualTreeview] Re: VET 1.4.34, finally available

At 01:40 PM 6/27/2001 +0200, you wrote:

>Maybe you are doing things differently. I would be very glad if I could get
>rid of the double check and retire FindFirstChangeNotification.
>
>I have the following examples. The most obvious example is a file made or
>deleted by an old MS-DOS program: I don't get any notification there.
>Second, when I'm going to a DOS-prompt and copy or move files, I don't get
>any notification (you say you get them; maybe we use different parameters?)
>When I distill a file with Acrobat Distiller, I don't get any notification.

What version of Acrobat are you using? Version 4 creates the pdf and a
log file, both of which seem to send a shell notification. Also doing a
delete or copy through the dos prompt seems to send a notification too?

I am using Win2k SP2

Jim


re: Re: VET 1.4.34, finally available

From: "Teus de Jong" [teusjdejong@p...]
Date: Wed Jun 27, 2001 2:14 pm
Subject: Re: [VirtualTreeview] Re: VET 1.4.34, finally available

Hi Jim,

> What version of Acrobat are you using? Version 4 creates the pdf and a
> log file, both of which seem to send a shell notification. Also doing a
> delete or copy through the dos prompt seems to send a notification too?
>
> I am using Win2k SP2

I am also using Win2k SP2 (International English). After this message I
thought I must have done something wrong. But the latest version of VET also
does not update the list in the following cases:

I copy a file from a DOS-prompt to the directory VET is showing.
I distill a file in the directory VET is showing (Distiller 4 and 5).

I'm baffled by this different behaviour of the same Widows. Am I missing
something?

Teus de Jong.

 | Replies | Author | Date
2715 | Re: VET 1.4.34, finally available | Jim Kueneman | Wed 6/27/2001


re: Re: VET 1.4.34, finally available

From: GIANNAKOPOULOS KOSTAS [kyan@s...]
Date: Wed Jun 27, 2001 2:26 pm
Subject: RE: [VirtualTreeview] Re: VET 1.4.34, finally available

> I copy a file from a DOS-prompt to the directory VET is showing.
> I distill a file in the directory VET is showing (Distiller 4 and 5).

Just out of curiosity:

Does explorer manage to synchronize itself with the changes?
If not, i don't think that we can do anything better that they (M$) have
done, so we'll have to live with it.

<KY>


re: Re: VET 1.4.34, finally available

From: "Teus de Jong" [teusjdejong@p...]
Date: Wed Jun 27, 2001 2:38 pm
Subject: Re: [VirtualTreeview] Re: VET 1.4.34, finally available

Hi Giannokoulos,

> Does explorer manage to synchronize itself with the changes?
> If not, i don't think that we can do anything better that they (M$) have
> done, so we'll have to live with it.

Interesting question, but the answer is not so obvious. When Explorer is
displaying the directory where I am copying to, the update is done. But this
could be done with FindFirstChangeNotification. When I create a subdirectory
in a DOS box in a folder that is expanded in Explorer, Explorer does not
update the tree. Even worse: if I select this folder in Explorer, the
subfolder is displayed in the file list, but the Foldertree is not updated.

Teus de Jong


re: VET 1.4.34, finally available

From: "Jim Kueneman" [jimdk@m...]
Date: Wed Jun 27, 2001 3:06 pm
Subject: Re: VET 1.4.34, finally available

--- In [VirtualTreeview@y...], "Teus de Jong" [teusjdejong@p...] wrote:
> Hi Jim,
>
I copy a file from a DOS-prompt to the directory VET is showing.
> I distill a file in the directory VET is showing (Distiller 4 and
5).

Before saying that go into the source and on Line 4688'ish add
sneUpdateDir to the list of case identifiers, right after sneRmdir
then retry your experiment.

Jim


re: Re: VET 1.4.34, finally available

From: GIANNAKOPOULOS KOSTAS [kyan@s...]
Date: Wed Jun 27, 2001 3:20 pm
Subject: RE: [VirtualTreeview] Re: VET 1.4.34, finally available

> Interesting question, but the answer is not so obvious. When
> Explorer is
> displaying the directory where I am copying to, the update is
> done. But this
> could be done with FindFirstChangeNotification. When I create
> a subdirectory
> in a DOS box in a folder that is expanded in Explorer,
> Explorer does not
> update the tree. Even worse: if I select this folder in Explorer, the
> subfolder is displayed in the file list, but the Foldertree
> is not updated.

Well, the "ListView" part of the explorer window is not a generic ListView
control that has to rely on shell notifications (like the explorer tree);
it's a COM object (IShellView) that is returned by the
IShellFolder.GetUIObjectOf() function, so i would expect that it has access
to the internals of the folder object that created it and might behave
differently (not rely on shell events). The explorer tree is what we have to
compare VET with.

I think that if Jim achieves the same behaviour as the explorer tree
(although inperfect) he can be satisfied. Having two ways of detecting shell
changes (Shell events and FileChangeNotifications) will cause more problems
than it will solve, i'm afraid, so i think you or Jim should not do anything
about it.

<KY>


re: Re: VET 1.4.34, finally available

From: "Teus de Jong" [teusjdejong@p...]
Date: Wed Jun 27, 2001 3:21 pm
Subject: Re: [VirtualTreeview] Re: VET 1.4.34, finally available

Hi Jim,

> Before saying that go into the source and on Line 4688'ish add
> sneUpdateDir to the list of case identifiers, right after sneRmdir
> then retry your experiment.

I added the line, no difference. (I had set a breakpoint on the first line
of TNotifyEventThread.WMShellNotify, so I already knew no message came in.)

Teus de Jong

 | Replies | Author | Date
2718 | Re: VET 1.4.34, finally available | Jim Kueneman | Wed 6/27/2001


re: VET 1.4.34, finally available

From: "Jim Kueneman" [jimdk@m...]
Date: Wed Jun 27, 2001 3:46 pm
Subject: Re: VET 1.4.34, finally available

--- In [VirtualTreeview@y...], "Teus de Jong" [teusjdejong@p...] wrote:
> Hi Jim,
>
> > Before saying that go into the source and on Line 4688'ish add
> > sneUpdateDir to the list of case identifiers, right after sneRmdir
> > then retry your experiment.
>
> I added the line, no difference. (I had set a breakpoint on the
first line
> of TNotifyEventThread.WMShellNotify, so I already knew no message
came in.)

Weird, in Win2k when WinZip creates a new zip file VET missed it but
in NT 4 it saw it. NT4 also sees Distiller and Dos prompt changes.

I don't know, hit F5 <g>

Jim


re: Re: VET 1.4.34, finally available

From: "Teus de Jong" [teusjdejong@p...]
Date: Wed Jun 27, 2001 5:37 pm
Subject: Re: [VirtualTreeview] Re: VET 1.4.34, finally available

Hi Jim,

> Weird, in Win2k when WinZip creates a new zip file VET missed it but
> in NT 4 it saw it. NT4 also sees Distiller and Dos prompt changes.
>
> I don't know, hit F5 <g>

I decided to keep the FindFirstChangeNotification, but - as it already was -
only for the selected Folder. The changes in this folder are ignored by
ChangeNotify: they will be captured by FindFirstChangeNotification. I also
reinstalled from a previous version of my app a check if all the folders in
the filelist are in the subtree of the selectednode in the Foldertree (if
this node is expanded). In this way, changes are not handled twice (I think
and hope). Maybe you could follow the same policy. But of course you just
could forget about it and let the user hit F5. After all, your app does the
same as Explorer.

Teus de Jong.


re: BCB5 - VT2.4.34/VET1.2.34 - CF_RTF

From: [tias@m...]
Date: Wed Jun 27, 2001 6:58 pm
Subject: Re: BCB5 - VT2.4.34/VET1.2.34 - CF_RTF

--- In [VirtualTreeview@y...], "Roland" [Beduerftig@S...] wrote:

> Hi Mathias, Mike,
>
> I have copied both source the *.hpp form VT and the *.h Orginal
> RichText from Borland, I think the basic problem is:
>
> in VT is CF_RTF a word
> and in RichText is CF_RTF a TEXT
>
> this also a difference in define and not only a double declaration.

Hmmm. That means that it's a real naming conflict, perhaps Mike can
change his defs to VTCF_* or something ?

/MT


VCL Drag and Drop problems

From: "Will Watts" [willw@a...]
Date: Wed Jun 27, 2001 7:11 pm
Subject: VCL Drag and Drop problems

I am using VCL Drag and Drop both to move items in between
VirtualStringTrees and also onto other Delphi controls- the latter are
not OLE Drag and drop capable. I should like to show the nodes as
they are dragged in some form.

The OLE scheme for showing nodes being dragged seems to cut
out as soon as one sets the drag mode to 'VCL'. To get around this,
I made the StartDrag event create an object derived from
TDragControlObject. The new class overrides GetDragImages, and
supplies a suitable 'dragging' picture.

This works - except for the behaviour of selection drawing in
VirtualStringTree. When I click on any node, it 'whites out' an area
the size of dragging picture. If I wave a dragged object over a
VirtualStringTree for a few seconds, I rapidly end up with a mess of
things drawn in the selected and non-selected colour.

Therefore my questions to the panel are:
1) Is there anything I can do in terms of setting grid options to
prevent this from happening
and
2) Is there any way I can use the OLE Drag and Drop display with
VCL Drag and Drop? I looked at the code, but I couldn't understand
what the classes did.

TIA

Will

Will Watts Direct Line +44 20 8400 6104
Applied Industrial Systems Ltd Main Voice +44 20 8400 6100
10 Barley Mow Passage Fax +44 20 8742 2456
Chiswick London W4 4PH Web http://www.applied.co.uk

 | Replies | Author | Date
2813 | Re: VCL Drag and Drop problems | Mike Lischke | Sun 7/1/2001
2837 | Re: VCL Drag and Drop problems | Will Watts | Mon 7/2/2001
2881 | Re: VCL Drag and Drop problems | Mike Lischke | Wed 7/4/2001
2841 | Re: VCL Drag and Drop problems | Werner Lehmann | Mon 7/2/2001


ne1 could compile .34 in Delphi6?

From: "Ariel Selig" [asel98@y...]
Date: Wed Jun 27, 2001 7:23 pm
Subject: ne1 could compile .34 in Delphi6?

how?

thanks


re: Fullexpand with '*'

From: "Franc v/d Westelaken" [F.vdwestelaken@c...]
Date: Wed Jun 27, 2001 8:17 pm
Subject: RE: [VirtualTreeview] Fullexpand with '*'

Jim,

>when pressing the '*' key the tree is supposed to fully expand.
>However, it looks like that when pressing '*' only already
>initialized nodes are being displayed. Childnodes which aren't yet
>initialized don't appear in the tree.

> I don't see a problem in VET. How are you adding child nodes?

I'm adding child-nodes in the OnExpanding event. I've uploaded a test
project to the files area (FullExpand.zip) which demonstrates the problem.
Select rootnode 1 and press the '*' key, it doesn't expand. It expands only
using the '*' key if you expanded it first by double clicking on it.

Franc.

 | Replies | Author | Date
2726 | Re: Fullexpand with '*' | Jim Kueneman | Thu 6/28/2001
2751 | Re: Fullexpand with '*' | Franc v/d Westelaken | Thu 6/28/2001
2761 | Re: Fullexpand with '*' | Jim Kueneman | Thu 6/28/2001


Advice sought using VET in new app

From: [garycramblitt@e...]
Date: Wed Jun 27, 2001 9:55 pm
Subject: Advice sought using VET in new app

I want to develop a file/folder explorer application with a twist.
In the e-book world, most people follow a rough "standard" of naming
their e-book files like this:

Isaac Asimov - I, Robot.txt

but some users name it

Asimov, Isaac - I, Robot.txt

or

i robot - isaac asimov.txt

or

asimov, i. - i robot.txt

and you also see things like

Isaac Asimov - I, Robot (txt).zip

So what I want to do is use VET as the basis of a utility for viewing
and renaming my e-book files using an intelligent renaming function.
The function knows how to "parse" the file name, recognizing the
author last name, first name, middle intitial, book title, and type.
Then applies a user-chosen standard format and renames the files so
that all follow the standard. (This is useful for identifying
duplicates and allows one to find all the books for a single author
quickly and easily.)

A feature I'd like to offer is the ability for the user to preview
the renamed filenames, or at least an Undo, so that if users aren't
happy with the renaming, they can restore the original names.

So I need some way to attach additional information to each node in
the VET, for example, the original name. Can someone give me tips on
how to do this with VET and get me started. Does VET offer a UserData
property, similar to the TreeView? Suggestions? TIA

 | Replies | Author | Date
2727 | VET 1.4.34 fixes major AV | Jim Kueneman | Thu 6/28/2001
2815 | Re: VET 1.4.34 fixes major AV | Mike Lischke | Sun 7/1/2001
2822 | Re: VET 1.4.34 fixes major AV | Jim Kueneman | Sun 7/1/2001
2824 | Re: VET 1.4.34 fixes major AV | Mike Lischke | Sun 7/1/2001
2728 | Re: Advice sought using VET in new app | Jim Kueneman | Thu 6/28/2001
2759 | Re: Advice sought using VET in new app | [garycramblitt@e...] | Thu 6/28/2001
2762 | Re: Advice sought using VET in new app | Jim Kueneman | Thu 6/28/2001


New file uploaded to VirtualTreeview

From: [VirtualTreeview@yahoogroups.com>
Date: Thu Jun 28, 2001 2:51 am
Subject: New file uploaded to VirtualTreeview

Hello,

This email message is a notification to let you know that
a file has been uploaded to the Files area of the VirtualTreeview
group.

File : /VET_V1.4.35.zip
Uploaded by : [jimdk@m...]
Description : Virtual Explorer Tree Version 1.4.35 with Demo Executable

You can access this file at the URL

http://groups.yahoo.com/group/VirtualTreeview/files/VET_V1.4.35.zip

To learn more about file sharing for your group, please visit

http://help.yahoo.com/help/us/groups/files

Regards,

jimdk@m...]


re: Fullexpand with '*'

From: Jim Kueneman [jimdk@m...]
Date: Thu Jun 28, 2001 3:01 am
Subject: RE: [VirtualTreeview] Fullexpand with '*'

Hi Franc

At 10:17 PM 6/27/2001 +0200, you wrote:
>I'm adding child-nodes in the OnExpanding event. I've uploaded a test
>project to the files area (FullExpand.zip) which demonstrates the problem.
>Select rootnode 1 and press the '*' key, it doesn't expand. It expands only
>using the '*' key if you expanded it first by double clicking on it.

I uploaded a framework for how you can implement your tree so it takes full
advantage of its "Virtual" nature. The question is does your data fit his
why of thinking.

What the main problem was is that when FullExpand happens VT call
InitChildren for any node that has the HasChildren flag set but does not
have any children yet. If that returns 0 then it assumes there are no
children, so at a minimum you have to return something from that event.

Jim

 | Replies | Author | Date
2751 | Re: Fullexpand with '*' | Franc v/d Westelaken | Thu 6/28/2001
2761 | Re: Fullexpand with '*' | Jim Kueneman | Thu 6/28/2001


VET 1.4.34 fixes major AV

From: Jim Kueneman [jimdk@m...]
Date: Thu Jun 28, 2001 3:11 am
Subject: VET 1.4.34 fixes major AV

I suggest anyone using VET 1.4.34 download VET 1.4.35. There is a big bug
(I warned about the potential) if Listview mode is used and a rootfolder is
chosen that does not exist on the system. Big AV.

Speaking of that I will not win any points but I changed the name of
Listview Mode to HideRootFolder to more accurately reflect what it
does. As an earlier email recommends delete all *.dcu's and the .bpl and
recompile the package. I kept getting internal compiler error L1290
something because I ignored my own recommendation.

Mike, the Shell Notify is fixed and VET now has 4 new properties (not
published)

SelectedPath - Path of the currently selected node
SelectedPaths - Paths of all currently selected nodes (TStrings)
SelectedFile - Filename of the currently selected node
SelectedFiles - FileNames of all currently selected nodes (TStrings)

Jim

 | Replies | Author | Date
2815 | Re: VET 1.4.34 fixes major AV | Mike Lischke | Sun 7/1/2001
2822 | Re: VET 1.4.34 fixes major AV | Jim Kueneman | Sun 7/1/2001
2824 | Re: VET 1.4.34 fixes major AV | Mike Lischke | Sun 7/1/2001


re: Advice sought using VET in new app

From: Jim Kueneman [jimdk@m...]
Date: Thu Jun 28, 2001 3:44 am
Subject: Re: [VirtualTreeview] Advice sought using VET in new app

Hi Gary,

Easy (almost). The only thing is go into the VET source and look for

TCustomVirtualExplorerTree.DoInitNode

method. Move the inherited keyword to the bottom of the method so the
Namespace is associated with the node before it calls the InitNode
event. I think it should be there anyway and the next release will have
this done.

Jim

Type
PVETRec = ^TVETRec;
TVETRec = record
TitleName: string;
end;

var
Form1: TForm1;

implementation

{$R *.DFM}

procedure TForm1.FormCreate(Sender: TObject);
begin
VirtualExplorerTree1.NodeDataSize := SizeOf(PVETRec)
end;

procedure TForm1.VirtualExplorerTree1InitNode(Sender: TBaseVirtualTree;
ParentNode, Node: PVirtualNode;
var InitialStates: TVirtualNodeInitStates);
var
MyData: PVETRec;
NS: TNamespace;
begin
MyData := PVETRec( Sender.GetNodeData(Node));
if Assigned(MyData) then
begin
Initialize(MyData^); // Initialize strings, VT does not use New()
{ Get the namespace associated with the node to extract the name or path }
if VirtualNamespace1.ValidateNamespace(Node, NS) then
MyData.TitleName := ModifyTitleName( NS.NameNormal);
end
end;

procedure TForm1.VirtualExplorerTree1FreeNode(Sender: TBaseVirtualTree;
Node: PVirtualNode);
var
MyData: PVETRec;
begin
MyData := PVETRec( Sender.GetNodeData(Node));
if Assigned(MyData) then
Finalize(MyData^); // Free the strings, VT does not use Dispose()
end;

Now where every you need to access the data use:

var
MyData: PVETRec;
begin
MyData := PVETRec( Sender.GetNodeData(Node));
MyData.TitleName ...........

 | Replies | Author | Date
2759 | Re: Advice sought using VET in new app | [garycramblitt@e...] | Thu 6/28/2001
2762 | Re: Advice sought using VET in new app | Jim Kueneman | Thu 6/28/2001


Huston, we have problem

From: "Ariel Selig" [asel98@y...]
Date: Thu Jun 28, 2001 4:50 am
Subject: Huston, we have problem

PropDrawName() doesnt exists in Delphi6. :(
i can compile it now. but i cant get the new name that this function
use in D6.

any one?

 | Replies | Author | Date
2730 | Re: Huston, we have problem | [adembaba@e...] | Thu 6/28/2001
2732 | Re: Huston, we have problem | Ariel Selig | Thu 6/28/2001


re: Huston, we have problem

From: [adembaba@e...]
Date: Thu Jun 28, 2001 6:17 am
Subject: Re: Huston, we have problem

But, it does. Check

\Source\ToolsAPI\VCLEditors.pas

HTH,

Adem

--- In [VirtualTreeview@y...], "Ariel Selig" [asel98@y...] wrote:
> PropDrawName() doesnt exists in Delphi6. :(
> i can compile it now. but i cant get the new name that this
function
> use in D6.
>
> any one?

 | Replies | Author | Date
2732 | Re: Huston, we have problem | Ariel Selig | Thu 6/28/2001


re: OLE Drag and Drop (and a typo)

From: "Mike Lischke" [lists@l...]
Date: Thu Jun 28, 2001 7:43 am
Subject: RE: [VirtualTreeview] OLE Drag and Drop (and a typo)

Hi Werner,

> you have a typo here:
>
> function GetDragManger: IVTDragManager;
> (The same typo even in the comment to the implementation of the function :)

Oops, thank you :-)

> Now to my actual problem. Situation is that I want to use a VTree as a drop
source
> for CF_HDROP (filenames). I have spent the last 1.5 hours with studying the
current
> OLE drag and drop situation (and one afternoon yesterday to even find out how
OLE
> DAD works at all). I am now 'quite' comfortable with it but have not written
a single
> line implementing IDropSource, IDropTarget, IDataObject or IEnumFormatETC.

I guess you are now much further but let me still answer your mails and work
through all of them
with respect to the OLE issue.

Actually, the idea is (very similar to the TPicture registration scheme) that
for each format a tree
class is responsible to handle it. E.g. the native format is handled by the
base tree (because it
only requires information which is there already at that level) and the string
tree handles various
string clipboard formats like ANSI and Unicode text, RTF, CSV and HTML text.

> What I am really looking for is something like an event:
>
> TVTRenderOLEDataEvent = procedure(Sender: TBaseVirtualTree; const
FormatEtcIn: TFormatEtc;
> out Medium: TStgMedium; ForClipboard: Boolean; var Result: HResult) of
object;

I don't see any problem adding an event for application defined formats, but
they will of course not
appear at design time because they are not registered at design time. For
clarity and
understandibility I would like to keep this strictly separate:

- registeration of clipboard formats to be available at design time and to have
a responsible tree
class handling this format
- specifying user/application defined formats and rendering them in an event

This requires however two events, one to specify the format and another one to
render it (because
the tree always uses the resource friendly delayed rendering). I see the
importance of this but I
hesitate more and more to add even more events or properties. We really should
keep this enhancing
at a minimum level.

Ciao, Mike


re: Huston, we have problem

From: "Ariel Selig" [asel98@y...]
Date: Thu Jun 28, 2001 8:08 am
Subject: Re: Huston, we have problem

yes, but it isnt from TStringListProperty
so, u cannot override it.

which (D6) packages do u add in your VT package?

when i try... it says PropDrawName isnt in base.

thanks :)

--- In [VirtualTreeview@y...], [adembaba@e...] wrote:
> But, it does. Check
>
> \Source\ToolsAPI\VCLEditors.pas
>
> HTH,
>
> Adem
>
> --- In [VirtualTreeview@y...], "Ariel Selig" [asel98@y...] wrote:
> > PropDrawName() doesnt exists in Delphi6. :(
> > i can compile it now. but i cant get the new name that this
> function
> > use in D6.
> >
> > any one?


re: Please a newsgroup

From: "Mike Lischke" [lists@l...]
Date: Thu Jun 28, 2001 8:08 am
Subject: RE: [VirtualTreeview] Please a newsgroup

> Please a newsgroup, HI mike I just want to tell you that I think that this
> isnt the best way to handle the mailing list, I receive from 30 to 40 emails
> from yahoogroups while some are interesting that doesn't happens to all, so
> I would like to suggest you if possible to find a better way for communicate
> like a newsgroup or something

I thought about this too, but I have no idea where to get a group for free. I
know of a service
which would host a news group for me but I cannot expect it to be free. On the
other hand why should
I pay for a newsgroup? I don't get this money back and VT is an open source
control. If you know of
somebody who would host a newsgroup for free then tell me.

Ciao, Mike

 | Replies | Author | Date
2748 | Re: Please a newsgroup | Moritz Franckenstein | Thu 6/28/2001


[no subject]

From: [F.vdwestelaken@c...]
Date: Thu Jun 28, 2001 8:14 am
Subject:

7 Jun 2001 22:18:09 +0200
To: [VirtualTreeview@yahoogroups.com>
Message-ID: [MMEBIEFEHHOLNALGMHDOCEBEDLAA.F.vdWestelaken@c...]
X-Priority: 3 (Normal)
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2911.0)
Importance: Normal
In-Reply-To: [5.1.0.14.0.20010627053223.028cf118@m...]
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2479.0006
From: "Franc v/d Westelaken" <F.vdwestelaken@c...]
MIME-Version: 1.0
Mailing-List: list VirtualTreeview@yahoogroups.com; contact
VirtualTreeview-owner@yahoogroups.com
Delivered-To: mailing list VirtualTreeview@yahoogroups.com
Precedence: bulk
List-Unsubscribe: <mailto:VirtualTreeview-unsubscribe@yahoogroups.com>
Date: Wed, 27 Jun 2001 22:17:27 +0200
Reply-To: VirtualTreeview@yahoogroups.com
Subject: RE: [VirtualTreeview] Fullexpand with '*'
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
X-UIDL: 293661427
Status: U

Jim,

>when pressing the '*' key the tree is supposed to fully expand.
>However, it looks like that when pressing '*' only already
>initialized nodes are being displayed. Childnodes which aren't yet
>initialized don't appear in the tree.

> I don't see a problem in VET. How are you adding child nodes?

I'm adding child-nodes in the OnExpanding event. I've uploaded a test
project to the files area (FullExpand.zip) which demonstrates the problem.
Select rootnode 1 and press the '*' key, it doesn't expand. It expands only
using the '*' key if you expanded it first by double clicking on it.

Franc.

To unsubscribe from this group, send an email to:
VirtualTreeview-unsubscribe@egroups.com

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/


re: Re: OLE Drag and Drop (and a typo)

From: "Mike Lischke" [lists@l...]
Date: Thu Jun 28, 2001 8:15 am
Subject: RE: [VirtualTreeview] Re: OLE Drag and Drop (and a typo)

Hi Jim,

> I don't understand how this registration is suppose to work. The problem
> is the clipboard type must be displayed in the object inspector and set to
> true.

If you want to have a format displayed in the OI then you have to register it
with the internal
clipboard formats list at design time. This means you have to rebuild the
package.

>I thought if one typed in the string assiciated with the clipboard
> format (in your case "File Name(s)" which Mike assigned to CF_HDROP) it
> would be added to the list, this is not the case.

Of course not. The list strictly takes care that only formats might be entered
which this particular
tree instance can handle (the formats which are registered for this tree class
or one of its
ancestors).

> I am not sure how clipboard formats can be added, except by putting them in
> the initialization section of VirtualTrees.pas and recompile the package.

Exactly. This is the purpose of the registration scheme (beside providing a
mean to determine which
tree can deliver which clipboard format).

Ciao, Mike


re: Re: OLE Drag and Drop (and a typo)

From: "Mike Lischke" [lists@l...]
Date: Thu Jun 28, 2001 8:20 am
Subject: RE: [VirtualTreeview] Re: OLE Drag and Drop (and a typo)

> Ok I see how you got it working but it was not as "RAD" as it should
> be. It should not be necessary to create a decendant of VT to do
> this.

The keypoint is a bit different. You can create a tree descentant and *also*
register new clipboard
formats with it. It does not make much sense to say a string tree can suddenly
render CF_HDROP. This
is not the case and should never handled by the string tree. Hence there should
also not be a
registration of this format for the string tree.

>You also did not use the object inspector to add you new OLE
> format. After looking at the implementation Mike has added a lot of great
> features to make OLE dragging easy but I am either missing how to take
> advantage of them or there is something missing.

The list in the OI is not to add new formats but to pick some from a list. The
point is that you
cannot use enumeration values due to the way how those formats are registered
with the OLE system. I
thought it would be nice to have a list of formats which can be rendered by
that tree and pick
easily one or more (but still to be able to write their
registration/description strings just in
case).

Ciao, Mike


re: Re: OLE Drag and Drop (and a typo)

From: "Mike Lischke" [lists@l...]
Date: Thu Jun 28, 2001 8:43 am
Subject: RE: [VirtualTreeview] Re: OLE Drag and Drop (and a typo)

> I am not sure if it is even possible to make the OI rebuild the nested
property
> without recompiling the design time package.

The sub properties list is retrieved from the internal clipboard list whenever
asked by the OI
(which happens for instances when displaying the clipboard formats property or
expanding it). So
when you can manage to add a new format at design time (e.g. by a component
editor) then it will
also show up in the sub property list.

> I believe that this is the way that Mike had in mind. AFAICS you are not
> supposed to add strings to the property via object inspector property editor.
> Instead Mike's approach provides a possibility to toggle the use of single
> clipboard formats on/off (contained as name in the stringlist).

Exactly. There is a list and the user can pick from it.

>By using a
> 'faked' nested property. Descendants do only have to care about the clipboard
> formats stringlist and the items of this list are automagically 'toggleable'
at
> design time. If I am right it would be desirable to get rid of the ellipsis
> button in OI which display the standard stringlist property editor.

Why? It is a nice addition to allow a list of strings to be displayed (maybe to
copy it to the
clipboard) and to manipulate it. It is simply built in, so why not use it?

Ciao, Mike


re: Re: OLE Drag and Drop (and a typo)

From: "Mike Lischke" [lists@l...]
Date: Thu Jun 28, 2001 8:49 am
Subject: RE: [VirtualTreeview] Re: OLE Drag and Drop (and a typo)

> My vision how this should work is to be able to enter new OLE clipboard
> formats, either predefined in windows or my own custom formats, through the
> OI which define what formats the VT can present. Then an event in to
> Render the data when the target window asks for it.

I'm not sure I like that idea. The events are meanwhile there but defining own
formats at design
time circumvents checks whether they are allowed (because they are not
registered with the internal
list).

Ciao, Mike


re: Please a newsgroup

From: "Peter Danich" [Support@d...]
Date: Thu Jun 28, 2001 10:10 am
Subject: Re: [VirtualTreeview] Please a newsgroup

hi Mike,
if you want to wait for abour 4 to 6 weeks then I can offer you a free
newsgroup which will be specialized for the programmers´ needs.
It will contain extended functionality for workgroups as we ll as standard
users. Multiple assignments to topics of interest, flexible multiple search
cretaria, reports, rich text formatted Unicode editors with embeded objects
like your VirtualTree, hyperlinks to internal related objects, etc, etc.
A full list of featues I will place here for discussion.

Interested???
rgds,
Peter
----- Original Message -----
From: Mike Lischke
To: VirtualTreeview@yahoogroups.com
Sent: Thursday, June 28, 2001 10:08 AM
Subject: RE: [VirtualTreeview] Please a newsgroup

> Please a newsgroup, HI mike I just want to tell you that I think that this
> isnt the best way to handle the mailing list, I receive from 30 to 40 emails
> from yahoogroups while some are interesting that doesn't happens to all, so
> I would like to suggest you if possible to find a better way for communicate
> like a newsgroup or something

I thought about this too, but I have no idea where to get a group for free. I
know of a service
which would host a news group for me but I cannot expect it to be free. On
the other hand why should
I pay for a newsgroup? I don't get this money back and VT is an open source
control. If you know of
somebody who would host a newsgroup for free then tell me.

Ciao, Mike

Yahoo! Groups Sponsor

To unsubscribe from this group, send an email to:
VirtualTreeview-unsubscribe@egroups.com

Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.

[Non-text portions of this message have been removed]

 | Replies | Author | Date
2816 | Re: Please a newsgroup | Mike Lischke | Sun 7/1/2001


Couldn't compile VT 2.4.34 under D4.03 standard

From: [FRiviR2@a...]
Date: Thu Jun 28, 2001 10:56 am
Subject: Couldn't compile VT 2.4.34 under D4.03 standard

Hi Mike,

as I say in the title, there is an error : "couldn't find SameText
function". Is this D5 specific ?

I assume it would be somethig like that

funcion SameText(string1, string2 : string): boolean;
begin
Result := string1 = string2;
end;

Am I right ?

François Rivierre

 | Replies | Author | Date
2742 | Re: Couldn't compile VT 2.4.34 under D4.03 standa | Roland | Thu 6/28/2001
2744 | Re: Couldn't compile VT 2.4.34 under D4.03 standa | Werner Lehmann | Thu 6/28/2001
2756 | Re: Couldn't compile VT 2.4.34 under D4.03 standa | [FRiviR2@a...] | Thu 6/28/2001


re: DBVT - a short description

From: [jopeking@y...]
Date: Thu Jun 28, 2001 11:31 am
Subject: Re: DBVT - a short description

> > Could you not write in Delphi? Please :-)
> Pascal is not my native language :) But I think I have to do it :
( - 2000
> lines :((

I would be very interested to use DBTreeView with Delphi. When do you
plan to translate it?

Regards,
Jo


re: Couldn't compile VT 2.4.34 under D4.03 standard

From: "Roland" [Beduerftig@S...]
Date: Thu Jun 28, 2001 11:33 am
Subject: Re: Couldn't compile VT 2.4.34 under D4.03 standard

--- In [VirtualTreeview@y...], [FRiviR2@a...] wrote:
> Hi Mike,
>
> as I say in the title, there is an error : "couldn't find SameText
> function". Is this D5 specific ?
>
> I assume it would be somethig like that
>
> funcion SameText(string1, string2 : string): boolean;
> begin
> Result := string1 = string2;
> end;
>
> Am I right ?
>
> François Rivierre

function SameText(const S1, S2: string): Boolean; assembler;
asm
CMP EAX,EDX
JZ @1
OR EAX,EAX
JZ @2
OR EDX,EDX
JZ @3
MOV ECX,[EAX-4]
CMP ECX,[EDX-4]
JNE @3
CALL CompareText
TEST EAX,EAX
JNZ @3
@1: MOV AL,1
@2: RET
@3: XOR EAX,EAX
end;

function AnsiSameText(const S1, S2: string): Boolean;
begin
Result := CompareString(LOCALE_USER_DEFAULT, NORM_IGNORECASE,
PChar(S1), Length(S1), PChar(S2), Length(S2)) = 2;
end;

regards
Roland


re: Please a newsgroup

From: Werner Lehmann [wl@b...]
Date: Thu Jun 28, 2001 12:24 pm
Subject: Re: [VirtualTreeview] Please a newsgroup

Peter Danich wrote:
>
> hi Mike,
> if you want to wait for abour 4 to 6 weeks then I can offer you a free
newsgroup which will be specialized for the programmers´ needs.
> It will contain extended functionality for workgroups as we ll as standard
users. Multiple assignments to topics of interest, flexible multiple search
cretaria, reports, rich text formatted Unicode editors with embeded objects
like your VirtualTree, hyperlinks to internal related objects, etc, etc.
> A full list of featues I will place here for discussion.
>
> Interested???

In other words, proprietary technology, not compatible to current nntp protocol
and news clients?

Regards,
Werner


re: Couldn't compile VT 2.4.34 under D4.03 standard

From: Werner Lehmann [wl@b...]
Date: Thu Jun 28, 2001 12:26 pm
Subject: Re: [VirtualTreeview] Couldn't compile VT 2.4.34 under D4.03 standard

[FRiviR2@a...] wrote:
>
> I assume it would be somethig like that
>
> funcion SameText(string1, string2 : string): boolean;
> begin
> Result := string1 = string2;
> end;

From the top of my head it is more like

result := CompareText(string1, string2) = 0;

The difference is case insensitivity. And there are also Ansi variations.

Werner

 | Replies | Author | Date
2756 | Re: Couldn't compile VT 2.4.34 under D4.03 standa | [FRiviR2@a...] | Thu 6/28/2001


Delphi 6 support

From: [andrekh@i...]
Date: Thu Jun 28, 2001 12:37 pm
Subject: Delphi 6 support

Hello!

Where will be available version of VT with Delphi 6 support?

Thanks

Andriy

 | Replies | Author | Date
2812 | Re: Delphi 6 support | Mike Lischke | Sun 7/1/2001
2836 | Re: Delphi 6 support | GIANNAKOPOULOS KOSTAS | Mon 7/2/2001
2880 | Re: Delphi 6 support | Mike Lischke | Wed 7/4/2001
2842 | Re: Delphi 6 support | Werner Lehmann | Mon 7/2/2001
2884 | Re: Delphi 6 support | Mike Lischke | Wed 7/4/2001
2844 | Re: Delphi 6 support | Vadim Sedulin | Mon 7/2/2001


re: Please a newsgroup

From: "Peter Danich" [Support@d...]
Date: Thu Jun 28, 2001 1:40 pm
Subject: Re: [VirtualTreeview] Please a newsgroup

hi Werner,
YES, of course, you are absolutely right!!!! -NOT compatible with the current
nntp protocol and clients!!. Is there anything about it wworth being
mentioned???
The current newsgroup is very limited in functionality. It was better than
nothing by when it was developed and released. It was something like a quick
start.

We should expect more than that. And if it is not there then we have to develop
it ourselves. There is one target: making everybody´s life easier and more
efficient. And use all the knowledge and tools we have available today. - And I
believe that the result should be something else than what the current
newsgroup system can provide.
Right now I have to handle all these messages manually, and this is not
sadisfying. So let´s try to change things and see where we get.

Regards,
Peter
----- Original Message -----
From: Werner Lehmann
To: [VirtualTreeview@yahoogroups.com
Sent: Thursday, June 28, 2001 2:24 PM
Subject: Re: [VirtualTreeview] Please a newsgroup

Peter Danich wrote:
>
> hi Mike,
> if you want to wait for abour 4 to 6 weeks then I can offer you a free
newsgroup which will be specialized for the programmers´ needs.
> It will contain extended functionality for workgroups as we ll as standard
users. Multiple assignments to topics of interest, flexible multiple search
cretaria, reports, rich text formatted Unicode editors with embeded objects
like your VirtualTree, hyperlinks to internal related objects, etc, etc.
> A full list of featues I will place here for discussion.
>
> Interested???

In other words, proprietary technology, not compatible to current nntp
protocol and news clients?

Regards,
Werner

Yahoo! Groups Sponsor

To unsubscribe from this group, send an email to:
VirtualTreeview-unsubscribe@egroups.com

Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.

[Non-text portions of this message have been removed]

Replies Author Date


re: Please a newsgroup

From: [tias@m...]
Date: Thu Jun 28, 2001 4:58 pm
Subject: Re: Please a newsgroup

--- In [VirtualTreeview@y...], "Peter Danich" [Support@d...] wrote:

> YES, of course, you are absolutely right!!!! -NOT compatible with
the current nntp protocol and clients!!. Is there anything about it
wworth being mentioned???
> The current newsgroup is very limited in functionality. It was
better than nothing by when it was developed and released. It was
something like a quick start.

I really don't see why this group is so bad, as long as you turn off
the auto e-mail feature.
It's working real good for me, not to mention that NG's in general are
completly blocked by my companys' FireWall. And no, (grmbl) there's no
way they're gonna open the NNTP-protocol/port in our FireWall, I've
been fighting about it for 2-3 years now...

> We should expect more than that. And if it is not there then we have
to develop it ourselves. There is one target: making everybody´s life

<snip>

Heh, why not make a new NG-reader based on VT ? ;---) Catch 22
perhaps...

Regards,
Mathias Thorell


re: Please a newsgroup

From: "Moritz Franckenstein" [franckenstein@a...]
Date: Thu Jun 28, 2001 5:21 pm
Subject: Re: Please a newsgroup

> somebody who would host a newsgroup for free then tell me.
>
> Ciao, Mike

... i like yahoo groups. i think its good enough.

-moritz


re: Re: Please a newsgroup

From: Kent Briggs [kbriggs@b...]
Date: Thu Jun 28, 2001 5:31 pm
Subject: Re: [VirtualTreeview] Re: Please a newsgroup

Moritz Franckenstein wrote:

> > somebody who would host a newsgroup for free then tell me.
> >
> > Ciao, Mike
>
> ... i like yahoo groups. i think its good enough.

The only change I'd like to see is to separate VET and other peripheral
components into a separate group. I'm only interested in the main VT
component.

--
Kent Briggs, [kbriggs@b...]
Briggs Softworks, http://www.briggsoft.com

 | Replies | Author | Date
2750 | Re: Please a newsgroup | Will Watts | Thu 6/28/2001
2814 | OT: list organizaton (was: Please a newsgroup) | Mike Lischke | Sun 7/1/2001
2823 | New Group for VET | Jim Kueneman | Sun 7/1/2001
2825 | Re: New Group for VET | Mike Lischke | Sun 7/1/2001
2760 | Re: Please a newsgroup | Jim Kueneman | Thu 6/28/2001


re: Re: Please a newsgroup

From: "Will Watts" [willw@a...]
Date: Thu Jun 28, 2001 5:47 pm
Subject: Re: [VirtualTreeview] Re: Please a newsgroup

On 28 Jun 2001, at 12:31, Kent Briggs wrote:

> > ... i like yahoo groups. i think its good enough.
>
> The only change I'd like to see is to separate VET and other
> peripheral components into a separate group. I'm only interested in
> the main VT component.

I endorse both the views above. Yahoo groups are pretty good; and
the anti-attachment and digest features are handy, keeping the
number and size of messages under control.

It would be useful to split off the VET stuff though - perhaps to
another list in the same group?

W.

Will Watts Direct Line +44 20 8400 6104
Applied Industrial Systems Ltd Main Voice +44 20 8400 6100
10 Barley Mow Passage Fax +44 20 8742 2456
Chiswick London W4 4PH Web http://www.applied.co.uk

 | Replies | Author | Date
2814 | OT: list organizaton (was: Please a newsgroup) | Mike Lischke | Sun 7/1/2001
2823 | New Group for VET | Jim Kueneman | Sun 7/1/2001
2825 | Re: New Group for VET | Mike Lischke | Sun 7/1/2001


re: Fullexpand with '*'

From: "Franc v/d Westelaken" [F.vdwestelaken@c...]
Date: Thu Jun 28, 2001 8:10 pm
Subject: RE: [VirtualTreeview] Fullexpand with '*'

Hi Jim,

> I uploaded a framework for how you can implement your tree so it takes
full
> advantage of its "Virtual" nature. The question is does your data fit his
> why of thinking.

> What the main problem was is that when FullExpand happens VT call
> InitChildren for any node that has the HasChildren flag set but does not
> have any children yet.

Thanks for the framework. I've moved my code for adding childs to
OnInitChildren and everything is working now. However, I'm still a bit
puzzled, I'm quite sure that it once worked when you added childs in the
OnExpanding event. I don't exactly know from which version it stopped
working though. But, I assume you should always add children in the
OnInitchildren event ? If that the case, whats use is the onexpanding even
then nowadays ?

Franc.

 | Replies | Author | Date
2761 | Re: Fullexpand with '*' | Jim Kueneman | Thu 6/28/2001


re: OLE Drag and Drop (and a typo)

From: Werner Lehmann [wl@b...]
Date: Thu Jun 28, 2001 6:36 pm
Subject: Re: [VirtualTreeview] OLE Drag and Drop (and a typo)

Hi Mike,

> Actually, the idea is (very similar to the TPicture registration scheme) that
for each format a tree
> class is responsible to handle it. E.g. the native format is handled by the
base tree (because it
> only requires information which is there already at that level) and the
string tree handles various
> string clipboard formats like ANSI and Unicode text, RTF, CSV and HTML text.

I see what you mean but I think that there were different needs for the
TPicture approach. TPicture
renders completely different data to a canvas, and it would be ridiculous to
surface this via event.

The VirtualStringTree on the other hand is a tree of strings which can
represent many different
formats although node and string handling and string presentation remain the
same. Especially file
names as in my case do not really need a dedicated descendant. The data is
already there in the
StringTree 'ancestor'. And the rendering can easily be done in an event.

This tree is project specific. If I had to derive a descendant to provide the
CF_HDROP format I
can still use it only in this project (unless I do a lot more abstraction work
and I don't know
if this is ever needed, surely this should not be the standard requirement).

What I am trying to say and probably confused you more with is: not every
format requires a new
descendant. Some formats may require this and there should still be the
possibility to register
new formats in new descendants. But this could be easily achieved with the
usual virtual delphi
do*** event methods IMO if there are render and format enum events.

Descendants can still provide their own and very specific formats list in the
OI.

> > TVTRenderOLEDataEvent = procedure(Sender: TBaseVirtualTree; const
FormatEtcIn: TFormatEtc;
> > out Medium: TStgMedium; ForClipboard: Boolean; var Result: HResult) of
object;
>
> I don't see any problem adding an event for application defined formats, but
they will of course not
> appear at design time because they are not registered at design time. For
clarity and
> understandibility I would like to keep this strictly separate:
>
> - registeration of clipboard formats to be available at design time and to
have a responsible tree
> class handling this format
> - specifying user/application defined formats and rendering them in an event

Sounds very good to me.

> This requires however two events, one to specify the format and another one
to render it (because
> the tree always uses the resource friendly delayed rendering). I see the
importance of this but I
> hesitate more and more to add even more events or properties. We really
should keep this enhancing
> at a minimum level.

Ok. The first time I saw a component with so many events that they filled two
OI pages I was
somehow 'shocked'. But they are all optional (by design) and if the naming of
the events sorts
them not only alphabetically but also semantically I see no problem. A powerful
component should
surface them and make this power available to its component users. Hiding
functionality just
because there are so many events is not strong enough a reason IMO. Of course
it would be even
better if Delphi allowed to nest events as it does with class properties.

Regards,
Werner


re: Re: OLE Drag and Drop (and a typo)

From: Werner Lehmann [wl@b...]
Date: Thu Jun 28, 2001 6:38 pm
Subject: Re: [VirtualTreeview] Re: OLE Drag and Drop (and a typo)

Mike Lischke wrote:
>
> > Ok I see how you got it working but it was not as "RAD" as it should
> > be. It should not be necessary to create a decendant of VT to do
> > this.
>
> The keypoint is a bit different. You can create a tree descentant and *also*
register new clipboard
> formats with it. It does not make much sense to say a string tree can
suddenly render CF_HDROP. This
> is not the case and should never handled by the string tree. Hence there
should also not be a
> registration of this format for the string tree.

This is why suggested a registration (runtime, not designtime) based on tree
instances. Even a string
tree can be used to present filenames and it makes sense to offer CF_HDROP in
this case.

Regards,
Werner


re: Re: OLE Drag and Drop (and a typo)

From: Werner Lehmann [wl@b...]
Date: Thu Jun 28, 2001 6:43 pm
Subject: Re: [VirtualTreeview] Re: OLE Drag and Drop (and a typo)

Mike Lischke wrote:
>
> > I am not sure if it is even possible to make the OI rebuild the nested
property
> > without recompiling the design time package.
>
> The sub properties list is retrieved from the internal clipboard list
whenever asked by the OI
> (which happens for instances when displaying the clipboard formats property
or expanding it). So
> when you can manage to add a new format at design time (e.g. by a component
editor) then it will
> also show up in the sub property list.

Hm, this makes only sense if I would also supply a rendering method for the new
format. Hardly
possible with a property editor unless I am using some scripting editor :)

> >By using a
> > 'faked' nested property. Descendants do only have to care about the
clipboard
> > formats stringlist and the items of this list are automagically
'toggleable' at
> > design time. If I am right it would be desirable to get rid of the ellipsis
> > button in OI which display the standard stringlist property editor.
>
> Why? It is a nice addition to allow a list of strings to be displayed (maybe
to copy it to the
> clipboard) and to manipulate it. It is simply built in, so why not use it?

Well, both me and Jim misinterpreted the list at first and thought we could add
some strings
there. Because this is the standard functionality of the strings property
editor. I suppose
others fall in the same 'trap'. It is simply unexpected that the strings which
you add at
designtime are removed when you close the editor.

Don't get me wrong, this is really not very important to me. Just let the
ellipsis button
in and it'll be fine with me.

Regards,
Werner


re: Please a newsgroup

From: Werner Lehmann [wl@b...]
Date: Thu Jun 28, 2001 6:52 pm
Subject: Re: [VirtualTreeview] Please a newsgroup

Hi Peter,

> YES, of course, you are absolutely right!!!! -NOT compatible with the current
nntp protocol and clients!!. Is there anything about it wworth being
mentioned???
> The current newsgroup is very limited in functionality. It was better than
nothing by when it was developed and released. It was something like a quick
start.
>
> We should expect more than that. And if it is not there then we have to
develop it ourselves. There is one target: making everybody´s life easier and
more efficient. And use all the knowledge and tools we have available today. -
And I believe that the result should be something else than what the current
newsgroup system can provide.
> Right now I have to handle all these messages manually, and this is not
sadisfying. So let´s try to change things and see where we get.

I am sorry but I have to disagree. I have no need for RTF or embedded objects
in my postings. Even HTML
postings are too much overhead for my taste. Call me a purist but I share tips
and opinions via usenet
and it is so mighty because millions of users participate and hundreds of
clients including the one that
I am used to are compatible.

A standard group could also be indexed by tamaracka and google.

Regards,
Werner


re: Couldn't compile VT 2.4.34 under D4.03 standard

From: [FRiviR2@a...]
Date: Thu Jun 28, 2001 8:34 pm
Subject: Re: Couldn't compile VT 2.4.34 under D4.03 standard

Hi all,

Thanks Roland and Werner !

I've got another problem : it can't compile now because of
TStringListProperty (VirtualTreesReg.pas, line 54). It is unknown in
D4.03 standard...

Is this also D5 specific ?

Any suggestion ?

Regards,

François Rivierre


re: Re: Couldn't compile VT 2.4.34 under D4.03 standard

From: Werner Lehmann [wl@b...]
Date: Thu Jun 28, 2001 9:33 pm
Subject: Re: [VirtualTreeview] Re: Couldn't compile VT 2.4.34 under D4.03 standard

[FRiviR2@a...] wrote:
>
> I've got another problem : it can't compile now because of
> TStringListProperty (VirtualTreesReg.pas, line 54). It is unknown in
> D4.03 standard...
>
> Is this also D5 specific ?

Seems so.

> Any suggestion ?

Comment the class, the methods and the RegisterPropertyEditor call at the
bottom. You will loose the ability to toggle clipboard and OLE drag and
drop formats in design time. If this is not relevant to you you have no
problem. Otherwise you can still set these at runtime.

I don't know if there is a D4 compatible solution...

Werner

 | Replies | Author | Date
2780 | Re: Couldn't compile VT 2.4.34 under D4.03 stand | [FRiviR2@a...] | Fri 6/29/2001


VT & Delphi 6: How to

From: "Vadim Sedulin" [wsntrl@o...]
Date: Thu Jun 28, 2001 11:02 pm
Subject: VT & Delphi 6: How to

Hello All!

==== DFS.INC ====
....
{$IFDEF WIN32}
{$DEFINE DFS_WIN32}
{$ELSE}
{$DEFINE DFS_WIN16}
{$ENDIF}

{$IFDEF VER140}
{$DEFINE DFS_COMPILER_6}
{$DEFINE DFS_DELPHI}
{$DEFINE DFS_DELPHI_6}
{$ENDIF}

{$IFDEF VER130}
....
{$IFDEF DFS_COMPILER_5}
{$DEFINE DFS_COMPILER_1_UP}
{$DEFINE DFS_COMPILER_2_UP}
{$DEFINE DFS_COMPILER_3_UP}
{$DEFINE DFS_COMPILER_4_UP}
{$DEFINE DFS_COMPILER_5_UP}
{$ENDIF}

{$IFDEF DFS_COMPILER_6}
{$DEFINE DFS_COMPILER_1_UP}
{$DEFINE DFS_COMPILER_2_UP}
{$DEFINE DFS_COMPILER_3_UP}
{$DEFINE DFS_COMPILER_4_UP}
{$DEFINE DFS_COMPILER_5_UP}
{$DEFINE DFS_COMPILER_6_UP}
{$ENDIF}

{$IFDEF DFS_DELPHI_2}
....
{$IFDEF DFS_DELPHI_5}
{$DEFINE DFS_DELPHI_2_UP}
{$DEFINE DFS_DELPHI_3_UP}
{$DEFINE DFS_DELPHI_4_UP}
{$DEFINE DFS_DELPHI_5_UP}
{$ENDIF}

{$IFDEF DFS_DELPHI_6}
{$DEFINE DFS_DELPHI_2_UP}
{$DEFINE DFS_DELPHI_3_UP}
{$DEFINE DFS_DELPHI_4_UP}
{$DEFINE DFS_DELPHI_5_UP}
{$DEFINE DFS_DELPHI_6_UP}
{$ENDIF}

{$IFDEF DFS_CPPB_3}
....
========

==== VirtualTreesReg.pas ====
....
interface

{$I DFS.inc}

uses
Windows, Classes,
{$ifdef DFS_COMPILER_6_UP}
DesignIntf,
DesignEditors,
VCLEditors,
{$else}
Dsgnintf,
{$endif}
{$ifndef BCB}
ColnEdit,
{$endif}
VirtualTrees;
....
TClipboardFormatsProperty = class(TStringListProperty{$ifdef
DFS_COMPILER_6_UP}, ICustomPropertyDrawing{$endif})
public
function GetAttributes: TPropertyAttributes; override;
{$ifdef DFS_COMPILER_6_UP}
procedure GetProperties(Proc: TGetPropProc); override;
procedure PropDrawName(ACanvas: TCanvas; const ARect: TRect; ASelected:
Boolean);
procedure PropDrawValue(ACanvas: TCanvas; const ARect: TRect;
ASelected: Boolean);
{$else}
procedure GetProperties(Proc: TGetPropEditProc); override;
procedure PropDrawName(ACanvas: TCanvas; const ARect: TRect; ASelected:
Boolean); override;
{$endif}
end;
....
{$ifdef DFS_COMPILER_6_UP}
procedure TClipboardFormatsProperty.PropDrawValue(ACanvas: TCanvas; const
ARect: TRect; ASelected: Boolean);
begin
end;
{$endif}
....
========

Bye.

Vadim Sedulin
E-Mail: [wsntrl@o...]

[Non-text portions of this message have been removed]

 | Replies | Author | Date
2763 | Re: VT & Delphi 6: How to | Ariel | Fri 6/29/2001
2767 | Re: VT & Delphi 6: How to | Vadim Sedulin | Fri 6/29/2001
2769 | Re: VT & Delphi 6: How to | Will Watts | Fri 6/29/2001
2784 | Re: VT & Delphi 6: How to | Ariel | Sat 6/30/2001
2797 | Re: VT & Delphi 6: How to | Vadim Sedulin | Sat 6/30/2001
2818 | Re: VT & Delphi 6: How to | Mike Lischke | Sun 7/1/2001


re: Advice sought using VET in new app

From: [garycramblitt@e...]
Date: Thu Jun 28, 2001 11:36 pm
Subject: Re: Advice sought using VET in new app

Thanks Jim! I had to make a few changes to get what you suggest
working.

--- In [VirtualTreeview@y...], Jim Kueneman [jimdk@m...] wrote:
> procedure TForm1.FormCreate(Sender: TObject);
> begin
> VirtualExplorerTree1.NodeDataSize := SizeOf(PVETRec)
> end;

In order to do this I had to add

property NodeDataSize;

to the Published section of TVirtualExplorerTree.

>
> procedure TForm1.VirtualExplorerTree1InitNode(Sender:
TBaseVirtualTree;
> ParentNode, Node: PVirtualNode;
> var InitialStates: TVirtualNodeInitStates);
> var
> MyData: PVETRec;
> NS: TNamespace;
> begin
> MyData := PVETRec( Sender.GetNodeData(Node));
> if Assigned(MyData) then
> begin
> Initialize(MyData^); // Initialize strings, VT does not use
New()
> { Get the namespace associated with the node to extract the
name or path }
> if VirtualNamespace1.ValidateNamespace(Node, NS) then
> MyData.TitleName := ModifyTitleName( NS.NameNormal);
> end
> end;

I couldn't figure out what VirtualNamespace1 is so I coded as

if VirtualExplorerTree1.ValidateNamespace(Node, NS) then

Thanks again,
Gary

 | Replies | Author | Date
2762 | Re: Advice sought using VET in new app | Jim Kueneman | Thu 6/28/2001


re: Re: Please a newsgroup

From: Jim Kueneman [jimdk@m...]
Date: Thu Jun 28, 2001 11:52 pm
Subject: Re: [VirtualTreeview] Re: Please a newsgroup

At 12:31 PM 6/28/2001 -0500, you wrote:
>The only change I'd like to see is to separate VET and other peripheral
>components into a separate group. I'm only interested in the main VT
>component.

Not yet <g>. I was thinking the same after the discussions about the
ShellNotification. I bet only a handful really cared. I am not opposed to
it but it is Mike's call.

Jim


re: Fullexpand with '*'

From: Jim Kueneman [jimdk@m...]
Date: Thu Jun 28, 2001 11:55 pm
Subject: RE: [VirtualTreeview] Fullexpand with '*'

At 10:10 PM 6/28/2001 +0200, you wrote:
>OnInitchildren event ? If that the case, whats use is the onexpanding even
>then nowadays ?

Not for FullExpand <g>. It useful if a program need to know when a node
expands if you want to select a node or something.

Jim


re: Re: Advice sought using VET in new app

From: Jim Kueneman [jimdk@m...]
Date: Fri Jun 29, 2001 12:03 am
Subject: Re: [VirtualTreeview] Re: Advice sought using VET in new app

At 11:36 PM 6/28/2001 +0000, you wrote:
>Thanks Jim! I had to make a few changes to get what you suggest
>working.
>
>--- In [VirtualTreeview@y...], Jim Kueneman [jimdk@m...] wrote:
> > procedure TForm1.FormCreate(Sender: TObject);
> > begin
> > VirtualExplorerTree1.NodeDataSize := SizeOf(PVETRec)
> > end;
>
>In order to do this I had to add
>
> property NodeDataSize;
>
>to the Published section of TVirtualExplorerTree.

Oops, meant to tell you that. The next release will have that published.

Also

VirtualExplorerTree1.NodeDataSize := SizeOf(PVETRec)

should be:

VirtualExplorerTree1.NodeDataSize := SizeOf(TVETRec)

It works because the string is a pointer so

SizeOf(PVETRec) = SizeOf(TVETRec) = SizeOf(PointerReturnedFromVT)

until you add something else to the record!

> > { Get the namespace associated with the node to extract the
>name or path }
> > if VirtualNamespace1.ValidateNamespace(Node, NS) then
> > MyData.TitleName := ModifyTitleName( NS.NameNormal);

Don't know where that came from you are right.

Jim


re: VT & Delphi 6: How to

From: "Ariel" [asel98@y...]
Date: Fri Jun 29, 2001 12:45 am
Subject: Re: VT & Delphi 6: How to

i made the same changes, just delete PropDrawName.
but... is that ok? (i asked in other msg, because i think no...)

other thing, i noticed that u include (in uses) VCLEditors...
i read a msg in the borland forums (from TeamB) that says to NOT
include the toolsAPI directory in compiler. u need to include
only .bpl in your packages.
(is because for example u cant compile proxies.dcu)

thanks. :)


[no subject]

From: [F.vdwestelaken@c...]
Date: Fri Jun 29, 2001 7:00 am
Subject:

Jun 2001 22:12:03 +0200
To: [VirtualTreeview@yahoogroups.com>
Message-ID: [MMEBIEFEHHOLNALGMHDOMEBKDLAA.F.vdWestelaken@c...]
X-Priority: 3 (Normal)
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2911.0)
Importance: Normal
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2479.0006
In-Reply-To: [5.1.0.14.0.20010627195736.02493c90@m...]
From: "Franc v/d Westelaken" <F.vdwestelaken@c...]
MIME-Version: 1.0
Mailing-List: list VirtualTreeview@yahoogroups.com; contact
VirtualTreeview-owner@yahoogroups.com
Delivered-To: mailing list VirtualTreeview@yahoogroups.com
Precedence: bulk
List-Unsubscribe: <mailto:VirtualTreeview-unsubscribe@yahoogroups.com>
Date: Thu, 28 Jun 2001 22:10:53 +0200
Reply-To: VirtualTreeview@yahoogroups.com
Subject: RE: [VirtualTreeview] Fullexpand with '*'
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
X-UIDL: 293661456
Status: U

Hi Jim,

> I uploaded a framework for how you can implement your tree so it takes
full
> advantage of its "Virtual" nature. The question is does your data fit his
> why of thinking.

> What the main problem was is that when FullExpand happens VT call
> InitChildren for any node that has the HasChildren flag set but does not
> have any children yet.

Thanks for the framework. I've moved my code for adding childs to
OnInitChildren and everything is working now. However, I'm still a bit
puzzled, I'm quite sure that it once worked when you added childs in the
OnExpanding event. I don't exactly know from which version it stopped
working though. But, I assume you should always add children in the
OnInitchildren event ? If that the case, whats use is the onexpanding even
then nowadays ?

Franc.

To unsubscribe from this group, send an email to:
VirtualTreeview-unsubscribe@egroups.com

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/


re: OLE Drag and Drop (and a typo)

From: GIANNAKOPOULOS KOSTAS [kyan@s...]
Date: Fri Jun 29, 2001 7:36 am
Subject: RE: [VirtualTreeview] OLE Drag and Drop (and a typo)

> Ok. The first time I saw a component with so many events that
> they filled two OI pages I was
> somehow 'shocked'. But they are all optional (by design) and
> if the naming of the events sorts
> them not only alphabetically but also semantically I see no
> problem. A powerful component should
> surface them and make this power available to its component
> users. Hiding functionality just
> because there are so many events is not strong enough a
> reason IMO. Of course it would be even
> better if Delphi allowed to nest events as it does with class
> properties.

Oh, but it does. I mean that in a collection item descendant you can easily
add published event properties that WILL appear in the OI when you select
the item in the collection editor.

The only thing you have to do to show the nested TPersistent Descendant's
event handlers is somehow "Select" it in the IDE (that's what collection
editor does).

So, what if someone wrote a property editor for TPersistent that would have
a "..." button that would select the nested TPersistent in the IDE.

Just "food for thought"...

<KY>


Save + Load the tree correctly

From: [duke_n5@h...]
Date: Fri Jun 29, 2001 9:05 am
Subject: Save + Load the tree correctly

Hello.
I still use 1.31 because I somewhy cannot install the latest ver (it
does not want to compile - I am on d5)

How can I properly save and load all my nodes (including data) to
file????

when I call Savetofile, it creates a file, and when I call
LoadFromFile, it loads the nodes in the right hierarchy structure,
but they are totally empty of data.

I also tried to handle OnLoadNode and OnSaveNode but without success.

please help me.


re: Re: VT & Delphi 6: How to

From: "Vadim Sedulin" [wsntrl@o...]
Date: Fri Jun 29, 2001 10:07 am
Subject: Re: [VirtualTreeview] Re: VT & Delphi 6: How to

Hello Ariel!

> i made the same changes, just delete PropDrawName.

Why?

> but... is that ok? (i asked in other msg, because i think no...)

> other thing, i noticed that u include (in uses) VCLEditors...
> i read a msg in the borland forums (from TeamB) that says to NOT
> include the toolsAPI directory in compiler. u need to include
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
What do you mean by that?

> only .bpl in your packages.
> (is because for example u cant compile proxies.dcu)

All works fine.

Bye.

Vadim Sedulin
E-Mail: [wsntrl@o...]

 | Replies | Author | Date
2769 | Re: VT & Delphi 6: How to | Will Watts | Fri 6/29/2001
2784 | Re: VT & Delphi 6: How to | Ariel | Sat 6/30/2001


re: OLE Drag and Drop (and a typo)

From: Werner Lehmann [wl@b...]
Date: Fri Jun 29, 2001 10:16 am
Subject: Re: [VirtualTreeview] OLE Drag and Drop (and a typo)

GIANNAKOPOULOS KOSTAS wrote:
>
> > Ok. The first time I saw a component with so many events that
> > they filled two OI pages I was
> > somehow 'shocked'. But they are all optional (by design) and
> > if the naming of the events sorts
> > them not only alphabetically but also semantically I see no
> > problem. A powerful component should
> > surface them and make this power available to its component
> > users. Hiding functionality just
> > because there are so many events is not strong enough a
> > reason IMO. Of course it would be even
> > better if Delphi allowed to nest events as it does with class
> > properties.
>
> Oh, but it does. I mean that in a collection item descendant you can easily
> add published event properties that WILL appear in the OI when you select
> the item in the collection editor.
>
> The only thing you have to do to show the nested TPersistent Descendant's
> event handlers is somehow "Select" it in the IDE (that's what collection
> editor does).
>
> So, what if someone wrote a property editor for TPersistent that would have
> a "..." button that would select the nested TPersistent in the IDE.
>
> Just "food for thought"...

Hm, ok, thanks for the food. But its not the effect I was up to. Even if
I would implement it this way we would still have the need to have some
'event bundling' properties on the property page of the OI. And if we
want to assign an event we would have to switch to the properties tab click
on the ellipsis have a new floating window which regularly is overlapped
by the source editor and only then can switch to the events OI tab. Too
many clicks required, too... 'messy'.

I believe only the real deal could satisfy me here. Real nested events
presented as a (mostly) two level tree without treelines in the OI. Grouping
clipboard & drag and drop, customdraw, initialization, mouse & keyboard
together. I am not even sure how this should look like in code, as I don't
want to see a persistent property for each group in the properties page and
I don't want to know this persistent property to assign event handlers at
runtime. Just fantasizing :)

BTW, we should not continue this off-topic thread here...

Regards,
Werner


re: Re: VT & Delphi 6: How to

From: "Will Watts" [willw@a...]
Date: Fri Jun 29, 2001 1:48 pm
Subject: Re: [VirtualTreeview] Re: VT & Delphi 6: How to

On 29 Jun 2001, at 14:07, Vadim Sedulin wrote:

> > other thing, i noticed that u include (in uses) VCLEditors...
> > i read a msg in the borland forums (from TeamB) that says to NOT
> > include the toolsAPI directory in compiler. u need to include
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> What do you mean by that?

I think this is perhaps a reference to a message from
borland.public.delphi.vcl.components.writing
which I have quoted below.

I'd draw attention to the issue of seperate runtime and design time packages.
This is how I use VT here, as I found it solved some build problems I was
having.

W.

----------------------------------------------------

Silver,

Here's what to do:

1) Split your component into two units. One unit should contain all the
runtime code, and the other all the designtime code. The runtime unit should
not
contain any reference to any of the designers or design-time modules.

2) Make sure that the delphi6\source\toolsapi folder is not in any of your
library/search paths. Also make sure that any designtime .dcus you may have
created in your experiments are deleted. The source in the toolsapi folder is
for reference purposes only and should not be compiled into your code.

3) Add the designide.dcp package to the "requires" section of your package.

4) Add the designers you require to the design-time unit (for a list of all the
designer units, you can double-click on the designide.dcp package in the
package
editor). Some designer units have undergone a name change from Delphi 5 to
6,
e.g. dsgnint is now designintf.

If you follow these steps your package should compile. When you add your
component to a form, Delphi will also not go looking for the designers
(including proxies.pas), since there are no designers in the run-time unit.

Note that an even better solution would be to create a separate runtime
package and designtime package. One package contains all the designers and
registers the components, while the other conatins all the rest. This way
you won't be compiling any design-time code into your application, making
the .EXE smaller, and as a bonus you will also be complying with your
Borland license agreement (you're not supposed to ship their designtime code
with your .EXEs).

Hope this helps.

Regards,
Pierre le Riche
Professional Software Development
South Africa

"Silver" [silverio.dicandilo@p...] wrote in message
news:[3b3b69c4$1_2@d...]
> Hallo,
> Thank you in advance for you help.
>
> Here is my problem...
> I've just tried to import a package from Delphi 5 to Delphi 6 and I also
> added in the "requires" section "designide.dcp". I've also created an
> application with the components from my package.
> Unfortunatly, while compiling Delphi hasn't found the same "proxies.dcu".
>
> Is there anybody who could help me at all?!?!?
>
> Please, give me advices... I'm really despered!
>
> Ciao,
> Silver
>
>

Will Watts Direct Line +44 20 8400 6104
Applied Industrial Systems Ltd Main Voice +44 20 8400 6100
10 Barley Mow Passage Fax +44 20 8742 2456
Chiswick London W4 4PH Web http://www.applied.co.uk


Delete key handling

From: "Will Watts" [willw@a...]
Date: Fri Jun 29, 2001 2:30 pm
Subject: Delete key handling

Between 2.4.21 and 2.4.34, handling of the Delete key seems to
have changed, in rather an odd way.

My app handles OnKeyUp; specifically it deletes the focused node
wjen it sees VK_DELETE.

In 2.4.21 this worked.

In 2.4.34, the focus moved down one node first.

Setting 'IncrementalSearch' to 'isNone' solved my problem, but I
wondered if this behaviour is intended?

W

Will Watts Direct Line +44 20 8400 6104
Applied Industrial Systems Ltd Main Voice +44 20 8400 6100
10 Barley Mow Passage Fax +44 20 8742 2456
Chiswick London W4 4PH Web http://www.applied.co.uk


DeleteNode bug?

From: "Will Watts" [willw@a...]
Date: Fri Jun 29, 2001 3:27 pm
Subject: DeleteNode bug?

Mike,

If you call DeleteNode() on the node that has focus, then the
OnFocusChanging event is called. I think this is a bug. With code like this

procedure TForm1.tvMainFocusChanging(Sender: TBaseVirtualTree;
OldNode, NewNode: PVirtualNode; OldColumn, NewColumn: Integer;
var Allowed: Boolean);
begin
// In reality there'd be some logic here,
// in practice this can happen
Allowed := False;
end;

then the shift of focus away from the node that is being deleted doesn't
happen. Bewildering AVs follow rapidly.

I notice that DoFocusNode has a parameter 'Ask' which would appear to apply
to this situation - but which isn't used here.

W

Will Watts Direct Line +44 20 8400 6104
Applied Industrial Systems Ltd Main Voice +44 20 8400 6100
10 Barley Mow Passage Fax +44 20 8742 2456
Chiswick London W4 4PH Web http://www.applied.co.uk

 | Replies | Author | Date
2819 | Re: DeleteNode bug? | Mike Lischke | Sun 7/1/2001
2839 | Re: DeleteNode bug? | Will Watts | Mon 7/2/2001
2936 | Re: DeleteNode bug? | Mike Lischke | Sat 7/7/2001


re: How to print the complete tree ?

From: "Mike Lischke" [lists@l...]
Date: Fri Jun 29, 2001 4:45 pm
Subject: RE: [VirtualTreeview] How to print the complete tree ?

Hi Mathias,

> Using VT version 2.4.23 (in BCB5), I seem to be unable to print the
> complete tree. I'm trying to use PaintTo(Bitmap->Handle,Left,Top)
> method.
> This worked a long time ago (VT 1.31) but now when I'm trying the same
> code again it gives me an "Out of resource exception".

Hmmm, in the meantime I have switched to an own implementation, because PaintTo
is too unspecific
and also does some ugly things (like painting parts of the non-client area but
often leaving out the
client area).

> Tracing into VirtualTrees.pas, I found that the Window Parameter in
> TBaseVirtualTree.PaintTree() has a Right-value greater than 2100000
> something...
> Or is there better way to print the complete tree ?

Currently I have no implicit way to print the tree. Have you tried to use
PaintTree directly instead
of PaintTo?

Ciao, Mike

 | Replies | Author | Date
2907 | Re: How to print the complete tree ? | Mathias Thorell | Thu 7/5/2001
2908 | Re: How to print the complete tree ? | Jim Kueneman | Thu 7/5/2001
2917 | Re: How to print the complete tree ? | Mathias Thorell | Fri 7/6/2001


re: VET descendant

From: "Mike Lischke" [lists@l...]
Date: Fri Jun 29, 2001 5:00 pm
Subject: RE: [VirtualTreeview] VET descendant

Hi Jim,

> I have created a new TVETColumns class from TVirtualTreeColumn and
> published the Header property in VET. Now it is easy to order, size, add
> the header text, add new custom columns ect from within the IDE. A huge
> difference in usability.

This has convinced me to include the change (and it was easy anyway). Thank you
for laying out the
details so clear. This helped me to include it within a couple of minutes.

> The only other thing is it would be nice to make the Owners of
> TVirtualTreeColumns and TVTHeader read only properties

Yep, did so. Wait for next upload.

Ciao, Mike


re: Bug List?

From: "Mike Lischke" [lists@l...]
Date: Fri Jun 29, 2001 5:19 pm
Subject: RE: [VirtualTreeview] Bug List?

Hi E.G.,

> Does exists a buglist of the last release of VirtualTreeView?
> Actually I cannot replace my VirtualtreeView by a beta release, but I
> do not want to report bugs, which are already annouced.

Well, until now there was no public bug list. I thought about this a while
because it would also
show what has been done with VT during all the time. So I just created a Bug
List table in the
database section of YG and ask you and anybody else who encounters a bug to
report it there. The
interface is very simple. Since the normal bug assignment does not make much
sense I left out a
column to whom the bug has been assigned to fix but everything else is there
(hope I did not forget
something). The columns are:

- #: a running number
- Category: general, painting, OLE etc.
- Applies to version: tree class and version including build number
- Description: a short description what is wrong
- How to reproduce: detailed description how to make the bug appear (NOTE:
always write what you
expected to happen and what happend instead!)
- Reported by: the name of the one who's reporting the bug
- Report date: when has the bug been reported
- Status: open, not reproducible, fixed, not a bug of VT
- When fixed: the date when the bug has been fixed

> Setting coVisible to false of then last ColumnHeader during runtime
> can yield a infinite loop in painting procedure.

This has been fixed already.

Ciao, Mike

 | Replies | Author | Date
2792 | Re: Bug List? | Moritz Franckenstein | Sat 6/30/2001
2820 | Re: Bug List? | Mike Lischke | Sun 7/1/2001


re: Re: OLE Drag and Drop

From: "Mike Lischke" [lists@l...]
Date: Fri Jun 29, 2001 5:23 pm
Subject: RE: [VirtualTreeview] Re: OLE Drag and Drop

> "tymed:
>
> Specifies ONE of the TYMED enumeration constants which indicate the type of
> storage medium used to transfer the object's data. Data can be transferred
> using whatever medium makes sense for the object. For example, data can be
> passed using global memory, a disk file, or structured storage objects. For
> more information, see the TYMED enumeration."
> Notice the ONE. ( capitalized it )
>
> Looks like somewhere there is a failure to communicate!

I agree. I read the description on my MSDN DVD and did not find a note that
there can be more than
one flag. I did not search further because I thought I had all information I
need. Well, I will
change the check to use a mask.

Ciao, Mike


re: Drag and Drop

From: "Mike Lischke" [lists@l...]
Date: Fri Jun 29, 2001 5:26 pm
Subject: RE: [VirtualTreeview] Drag and Drop

Hi Frank,

> I want to implement a drag and drop from one VST into antother in the
> same form, but with different data records.
> However in the OnLoadNode I cannot see who the actual Sender is (the
> stream is ok) and therefore I cannot load the stream correctly.

Hmm, did you see the Sender parameter in the event?

Ciao, Mike

 | Replies | Author | Date
2795 | Re: Drag and Drop | Frank van den Bergh | Sat 6/30/2001
2821 | Re: Drag and Drop | Mike Lischke | Sun 7/1/2001


re: Full expand

From: "Mike Lischke" [lists@l...]
Date: Fri Jun 29, 2001 5:36 pm
Subject: RE: [VirtualTreeview] Full expand

Hi tparent,

> I need a faster function to full expand my 'Fast Treeview'
> I used before simple TTreeview and switched to VirtualTreeView
> to not to have to wait 10 sec.

Totally understandable. And if there is not an implementor (like me) who does
not see all
implications a change has then VT stays rock solid and extremely fast. The
reason for this delay was
that I have to determine the display rect for every node when expanding and
doing this animated.
When doing a full expand this is not necessary however. I have no moved the
retrival to the
appropriate place and VT expands now like hell again :o]

Wait for next upload.

Ciao, Mike


re: Troubles with 2.4.34, too

From: "Mike Lischke" [lists@l...]
Date: Fri Jun 29, 2001 5:40 pm
Subject: RE: [VirtualTreeview] Troubles with 2.4.34, too

> Found part of it.... you were close:
> Line 11694
>
> if not FHeader.UseColumns then
> FillRect(DC, Rect(R.Left, R.Top, R.Right, R.Top + StepSize), Brush)
>
> Add 1 to Stepsize
> FillRect(DC, Rect(R.Left, R.Top, R.Right, R.Top + StepSize + 1),
> Brush)
....

Thank you Jim. You are one of the greates help here for me.

Ciao, Mike


re: Save/Load list

From: "Mike Lischke" [lists@l...]
Date: Fri Jun 29, 2001 5:42 pm
Subject: RE: [VirtualTreeview] Save/Load list

Hi duke_n5,

> How to save/load list correctly??
>
> If I just call SaveToFile and LoadFromFile, then the captions are not
> loaded(I did not check if other things are - but the node structure
> is saved and loaded correctly).

You have to assign OnSaveNode and OnLoadNode handlers to store and retrieve
your own data. If you
only want the caption per node then enable this in StringOptions and write an
OnNewText handler
which gets called during load.

Ciao, Mike

 | Replies | Author | Date
2791 | Re: Save/Load list | [duke_n5@h...] | Sat 6/30/2001


re: Couldn't compile VT 2.4.34 under D4.03 standard

From: [FRiviR2@a...]
Date: Fri Jun 29, 2001 8:23 pm
Subject: Re: Couldn't compile VT 2.4.34 under D4.03 standard

> Comment the class, the methods and the RegisterPropertyEditor call
at the
> bottom. You will loose the ability to toggle clipboard and OLE drag
and
> drop formats in design time. If this is not relevant to you you
have no
> problem. Otherwise you can still set these at runtime.
>
> I don't know if there is a D4 compatible solution...
>
> Werner

Thanks a lot, Werner. It works fine now.

Regards,

François Rivierre


Constructing, sorting, etc.

From: [MJLeaver@n...]
Date: Fri Jun 29, 2001 10:21 pm
Subject: Constructing, sorting, etc.

I'm interested to know how other people handle data from a DB to
show in VT.

At present, I rely on the index value in a dataset to relate to the
index value of a node. That is the only way I can think of to tie
a node to a row before it is initialised. Is there any other way?

The problem is now that I have to sort the data. I cannot sort the
data itself (trust me, I can't), but I can sort it in the tree. But
if I sort it in the tree I lose the index relationship, e.g. the
node at index 1 will no longer relate to the row at index 1 in the
dataset. This is important for when I do a drag & drop within the
tree (the data move is done elsewhere, so after a move/copy I need
to manually insert it into a branch).

Perhaps I'm not doing things the right way?

 | Replies | Author | Date
2782 | Re: Constructing, sorting, etc. | Werner Lehmann | Fri 6/29/2001
2783 | Re: Constructing, sorting, etc. | Ariel | Sat 6/30/2001
2788 | Re: Constructing, sorting, etc. | Michael Leaver | Sat 6/30/2001


re: Constructing, sorting, etc.

From: Werner Lehmann [wl@b...]
Date: Fri Jun 29, 2001 11:43 pm
Subject: Re: [VirtualTreeview] Constructing, sorting, etc.

[MJLeaver@n...] wrote:
>
> I'm interested to know how other people handle data from a DB to
> show in VT.
>
> At present, I rely on the index value in a dataset to relate to the
> index value of a node. That is the only way I can think of to tie
> a node to a row before it is initialised. Is there any other way?
>
> The problem is now that I have to sort the data. I cannot sort the
> data itself (trust me, I can't), but I can sort it in the tree. But

I trust you, but why can't you? :)

> if I sort it in the tree I lose the index relationship, e.g. the
> node at index 1 will no longer relate to the row at index 1 in the
> dataset. This is important for when I do a drag & drop within the
> tree (the data move is done elsewhere, so after a move/copy I need
> to manually insert it into a branch).
>
> Perhaps I'm not doing things the right way?

Short answer: if you want to sort the nodes you have to init them before.

I have found that it makes sense to get two or three tree levels at
once and let the client fetch the data. In OnExpanding you have the
data in your local structures and simply init all children first, then
sort them. Of course this makes only sense if you don't have nodes
with 1000's of children frequently. This approach is good for rather
deep / small and not wide trees.

But you want to sort your nodes so you have to get and init all children
of a node at once anyway (if you cannot sort them on the server as you
say). The point is only to invest the overhead which is bound to executing
a query into more than only the currently needed node data.

Maybe you don't know that Oracle 7+8 support a nested tree query ("connect
by"), other servers have something similar probably. This allows you to
easily retrieve any given number of tree levels under a node and read the
data recursively.

I just read your last sentence again and it seems that you rely on some dataset
and always retrieve node data on the fly when needed. Must be awfully slow.
Suggest you copy the data to local data structures.

Regards,
Werner


re: Constructing, sorting, etc.

From: "Ariel" [asel98@y...]
Date: Sat Jun 30, 2001 12:35 am
Subject: Re: Constructing, sorting, etc.

when u create a node, then use the .data to hold the "id" of your
database. .data is a pointer (4 bytes). u can use it for a longint
too (AutoInc=longint).
when the user wants to sort by a field, use a database index
[parent,sort_field], and collapse all the nodes. then in
OnInitChildren, create each .data getting it from the database index
(setRange([parent],[parent])). they will be sorted. then u will be
sorting on the fly.

but as Werner said, is more faster if u use local data. but i think u
are using paradox or something like that, that makes finds really
fast. and if u are using small databases... windows will keep it in
memory for you.

--- In [VirtualTreeview@y...], [MJLeaver@n...] wrote:
> I'm interested to know how other people handle data from a DB to
> show in VT.
>
> At present, I rely on the index value in a dataset to relate to the
> index value of a node. That is the only way I can think of to tie
> a node to a row before it is initialised. Is there any other way?
>
> The problem is now that I have to sort the data. I cannot sort the
> data itself (trust me, I can't), but I can sort it in the tree. But
> if I sort it in the tree I lose the index relationship, e.g. the
> node at index 1 will no longer relate to the row at index 1 in the
> dataset. This is important for when I do a drag & drop within the
> tree (the data move is done elsewhere, so after a move/copy I need
> to manually insert it into a branch).
>
> Perhaps I'm not doing things the right way?


re: VT & Delphi 6: How to

From: "Ariel" [asel98@y...]
Date: Sat Jun 30, 2001 12:46 am
Subject: Re: VT & Delphi 6: How to

if u dont override PropDrawName. is that function called?

i thought that it was only called when it comes from the same
compiler level.

i will change them, :)
thanks

--- In [VirtualTreeview@y...], "Vadim Sedulin" [wsntrl@o...] wrote:
> Hello Ariel!
>
> > i made the same changes, just delete PropDrawName.
>
> Why?
>
> > but... is that ok? (i asked in other msg, because i think no...)
>
> > other thing, i noticed that u include (in uses) VCLEditors...
> > i read a msg in the borland forums (from TeamB) that says to NOT
> > include the toolsAPI directory in compiler. u need to include
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> What do you mean by that?
>
> > only .bpl in your packages.
> > (is because for example u cant compile proxies.dcu)
>
> All works fine.
>
> Bye.
>
> Vadim Sedulin
> E-Mail: [wsntrl@o...]


VT - Header Draw

From: "Ariel" [asel98@y...]
Date: Sat Jun 30, 2001 2:08 am
Subject: VT - Header Draw

procedure TVirtualTreeColumns.PaintHeader(DC: HDC; R: TRect; HOffset:
Integer);

can u add an option to dont call "DrawEdge"?
i change it, but maybe u want to do that too. is the unique change it
needs to draw the header like WinXP. (with the function i sended).

thanks.

 | Replies | Author | Date
2817 | Re: VT - Header Draw | Mike Lischke | Sun 7/1/2001


re: VET feature request

From: Jim Kueneman [jimdk@m...]
Date: Sat Jun 30, 2001 2:19 am
Subject: RE: [VirtualTreeview] VET feature request

Hi Again,

Looks like Mike is implementing the Column idea! I am looking into your
suggestion and I have a few questions. (I have never used DefineProperties)

>There is a solution to aviod breaking other people's code:
>- Keep the data type TVisibleColumns.

Ok.

>- Override TComponent.DefineProperties in such a way that if there is a
>"VisibleColumns" property in the stream read it (see TReader.ReadSet to see
>how to do it) and create the appropriate columns. Do not specify a write
>procedure in DefineProperty, so property VisibleColumns will not be saved
>the next time the component is saved to a stream.

Ok, now I am scratching my head. I found ReadSet. When I override

procedure TCustomVirtualExplorerTree.DefineProperties(Filer: TFiler);
begin
inherited;
Filer.DefineProperty('??????????, ReadColumn, nil, False);
end;

I don't understand what is happening when DefineProperties is called
(Actually I don't understand the RTTI ? at all) and I don't understand the
significance of the string expecially if I did not write a custom property
of the same name (maybe that is the key? define a property the same name as
VisibleColumns, so 'VisibleColumns' would go in for the string). It is
only called once and the PropName in TFiler is ''.

I will dig out Delphi in a Nutshell and do some reading as well.

Jim

 | Replies | Author | Date
2787 | Re: VET feature request | Jim Kueneman | Sat 6/30/2001


re: VET feature request

From: Jim Kueneman [jimdk@m...]
Date: Sat Jun 30, 2001 2:21 am
Subject: RE: [VirtualTreeview] VET feature request

At 07:19 PM 6/29/2001 -0700, you wrote:

>Hi Again,
>
>Looks like Mike is implementing the Column idea! I am looking into your
>suggestion and I have a few questions. (I have never used DefineProperties)
>
>
> >There is a solution to aviod breaking other people's code:
> >- Keep the data type TVisibleColumns.

Crap that was not to go to the list, sorry.

Jim


re: Re: Constructing, sorting, etc.

From: Michael Leaver [MJLeaver@n...]
Date: Sat Jun 30, 2001 3:35 am
Subject: RE: [VirtualTreeview] Re: Constructing, sorting, etc.

I'm actually using an application server (using Midas).

I do cache the data in a structure in the tree nodes already.
Its only retrieved/refreshed when required.

The more I think about it, the more I think I've got something
basically wrong. The index relationship problem only occurs in
two areas: drag & drop, and initialising nodes.

Root nodes are a problem as I have a list, which can change
(new root nodes can be added, and root nodes can be removed).
In this case I really do link the index to the index in the
list. This is also handled in OnInitNode.

For child nodes each time OnInitNode is called I add a child
node, and the one I add is based on the index. Is there a way
to simply add all the (child) nodes in one go instead of having
OnInitNode called repeatedly? If so, that would go a long way
to solving this problem.

For drag & drop (and creating folders - i.e. nodes with
children) I have to work out the index position to put the node
into, so that it doesn't get plonked in the wrong place (i.e.
the last child). Thinking about it, surely I could just refresh
all the child nodes and let OnInitNode put it in the correct
place?

Thanks

-----Original Message-----
From: Ariel [mailto:[asel98@y...]]
Sent: 30 June 2001 08:36
To: [VirtualTreeview@yahoogroups.com
Subject: [VirtualTreeview] Re: Constructing, sorting, etc.

when u create a node, then use the .data to hold the "id" of your
database. .data is a pointer (4 bytes). u can use it for a longint
too (AutoInc=longint).
when the user wants to sort by a field, use a database index
[parent,sort_field], and collapse all the nodes. then in
OnInitChildren, create each .data getting it from the database index
(setRange([parent],[parent])). they will be sorted. then u will be
sorting on the fly.

but as Werner said, is more faster if u use local data. but i think u
are using paradox or something like that, that makes finds really
fast. and if u are using small databases... windows will keep it in
memory for you.

--- In [VirtualTreeview@y...], MJLeaver@n...] wrote:
> I'm interested to know how other people handle data from a DB to
> show in VT.
>
> At present, I rely on the index value in a dataset to relate to the
> index value of a node. That is the only way I can think of to tie
> a node to a row before it is initialised. Is there any other way?
>
> The problem is now that I have to sort the data. I cannot sort the
> data itself (trust me, I can't), but I can sort it in the tree. But
> if I sort it in the tree I lose the index relationship, e.g. the
> node at index 1 will no longer relate to the row at index 1 in the
> dataset. This is important for when I do a drag & drop within the
> tree (the data move is done elsewhere, so after a move/copy I need
> to manually insert it into a branch).
>
> Perhaps I'm not doing things the right way?

To unsubscribe from this group, send an email to:
VirtualTreeview-unsubscribe@egroups.com

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/


Announcement (about Newsgroups)

From: "Ernest Fairchild" [efairchild@h...]
Date: Sat Jun 30, 2001 5:11 am
Subject: Announcement (about Newsgroups)

If you want a place to hang out (Hi, group) I asked a friend of mine with a
private newsserver to make a group dedicated to the VirtualTreeView
controls. It's at nntp://4.33.81.200/tech.virtualtreeview . Hope to see you
all there <g>.

Have a great day!

Ernest
([efairchild@h...])

_____________________
"RTFM!"

Visit my website at http://www.public.asu.edu/~ernestf

 | Replies | Author | Date
2796 | Re: Announcement (about Newsgroups) | Kent Briggs | Sat 6/30/2001


VT Database Component for Delphi ?

From: "Gate" [x_gate@h...]
Date: Mon Jul 30, 2001 5:48 am
Subject: VT Database Component for Delphi ?

Hi,
Is there any Delphi Databatase component using VT ?
I found only for C++ Builder in the files section ...

Thanks!

[Non-text portions of this message have been removed]


re: Save/Load list

From: [duke_n5@h...]
Date: Sat Jun 30, 2001 6:42 am
Subject: Re: Save/Load list

--- In [VirtualTreeview@y...], "Mike Lischke" [lists@l...] wrote:
> Hi duke_n5,
>
> You have to assign OnSaveNode and OnLoadNode handlers to store and
retrieve your own data. If you
> only want the caption per node then enable this in StringOptions
and write an OnNewText handler
> which gets called during load.
>
> Ciao, Mike

NO, I do not need to write text but rather more complicated data.
Here is how it looks roughly:

PNodeData = ^TNodeData;
TNodeData = record
DirName:String;
FileList:TList;
InfoType:TNDInfoType;
end;

......
procedure TMainForm.DirTreeSaveNode(Sender: TBaseVirtualTree;
Node: PVirtualNode; Stream: TStream);
var
Data:PNodeData;
begin
Data:=Sender.GetNodeData(Node);
Stream.Write(Data,SizeOf(TNodeData));
end;
........
procedure TMainForm.DirTreeLoadNode(Sender: TBaseVirtualTree;
Node: PVirtualNode; Stream: TStream);
Var
Data:PNodeData;
begin
Data:=Sender.GetNodeData(Node);
Stream.Read(Data,SizeOf(TNodeData));
end;
........

as I said, when I call LoadFromFile it returns the nodes
arranged "The right way" , but their data is empty or invalid(I think
empty).


re: Bug List?

From: "Moritz Franckenstein" [franckenstein@a...]
Date: Sat Jun 30, 2001 7:10 am
Subject: Re: Bug List?

> database section of YG and ask you and anybody else who encounters

cool idea. but what about changing the table into a todo list, where
not only bugs but also feature requests and other things can be
posted? then there should be a field "type" that indicates if this is
a bug or what else.
i would also include a "priority" field. or maybe two fields for
that: one field where the author of the record inserts his opinion
about the priority and one where you indicate at what priority you
are really working on it... so everyone can see what you think about
the bug/suggestion. i.e. 0=if you wont do it, -1 if its nonsense, -2
if its perfect nonsense. *g* :)
another suggestion for a field: "expense"...

last suggestion: mike, if you like, i can make a more user-friendly
version (drop down fields, a bigger description field, auto-id,
security) of this todo-list table on our webserver. i would only need
15 mins for this, so its no problem.

maybe we should wait until we see if anyone is using it :)

-moritz

 | Replies | Author | Date
2820 | Re: Bug List? | Mike Lischke | Sun 7/1/2001


re: Re: Save/Load list

From: Werner Lehmann [wl@b...]
Date: Sat Jun 30, 2001 9:10 am
Subject: Re: [VirtualTreeview] Re: Save/Load list

[duke_n5@h...] wrote:
>
> PNodeData = ^TNodeData;
> TNodeData = record
> DirName:String;
> FileList:TList;
> InfoType:TNDInfoType;
> end;
>
> ......
> procedure TMainForm.DirTreeSaveNode(Sender: TBaseVirtualTree;
> Node: PVirtualNode; Stream: TStream);
> var
> Data:PNodeData;
> begin
> Data:=Sender.GetNodeData(Node);
> Stream.Write(Data,SizeOf(TNodeData));
> end;
> ........
> procedure TMainForm.DirTreeLoadNode(Sender: TBaseVirtualTree;
> Node: PVirtualNode; Stream: TStream);
> Var
> Data:PNodeData;
> begin
> Data:=Sender.GetNodeData(Node);
> Stream.Read(Data,SizeOf(TNodeData));
> end;

You cannot stream out records with long string so easily. Make a short
string of it (strings[255] for instance) and see if that helps. If so,
stream out your record manually and use this for the string streaming:

unit uStreamUtils;

interface

uses
Classes;

function ReadStringFromStream(Stream: TStream): string;
procedure WriteStringToStream(Stream: TStream; str: string);

implementation

procedure WriteStringToStream(Stream: TStream; str: string);
var
len: Integer;
begin
len := Length(str);
with Stream do
begin
WriteBuffer(len, SizeOf(len));
WriteBuffer(PChar(str)^, len);
end;
end;

function ReadStringFromStream(Stream: TStream): string;
var
len: Integer;
begin
with Stream do
begin
ReadBuffer(len, SizeOf(len));
SetLength(result, len);
ReadBuffer(PChar(result)^, len);
end;
end;

end.

Regards,
Werner

 | Replies | Author | Date
2794 | Re: Save/Load list | Jim Kueneman | Sat 6/30/2001
2865 | VET Version 1.5.1 | Jim Kueneman | Wed 7/4/2001


re: Re: Save/Load list

From: Jim Kueneman [jimdk@m...]
Date: Sat Jun 30, 2001 12:29 pm
Subject: Re: [VirtualTreeview] Re: Save/Load list

At 11:10 AM 6/30/2001 +0200, you wrote:
>[duke_n5@h...] wrote:
> >
> > PNodeData = ^TNodeData;
> > TNodeData = record
> > DirName:String;
> > FileList:TList;
> > InfoType:TNDInfoType;
> > end;
> >
> > ......
> > procedure TMainForm.DirTreeSaveNode(Sender: TBaseVirtualTree;
> > Node: PVirtualNode; Stream: TStream);
> > var
> > Data:PNodeData;
> > begin
> > Data:=Sender.GetNodeData(Node);
> > Stream.Write(Data,SizeOf(TNodeData));
> > end;
> > ........
> > procedure TMainForm.DirTreeLoadNode(Sender: TBaseVirtualTree;
> > Node: PVirtualNode; Stream: TStream);
> > Var
> > Data:PNodeData;
> > begin
> > Data:=Sender.GetNodeData(Node);
> > Stream.Read(Data,SizeOf(TNodeData));
> > end;
>
>You cannot stream out records with long string so easily. Make a short
>string of it (strings[255] for instance) and see if that helps. If so,
>stream out your record manually and use this for the string streaming:

For that matter the TList won't stream anything either, except its address
which is meaningless on the load. What is stored in TList more long
strings? You will have to iterate through each item and do what Werner
suggests. In the read you have to Create() a new list then populate it by
reading each string then Add() it to the list.

Jim


re: Drag and Drop

From: "Frank van den Bergh" [frankvdbergh@y...]
Date: Sat Jun 30, 2001 2:07 pm
Subject: Re: Drag and Drop

Hi Mike,

Thanks for your response.

If I drag from tree1 to tree2 first OnSave event from tree1 is
triggered. I store the data on the stream. The Sender is Tree1.
After that the OnLoad event of tree2 is triggered. The Sender here is
tree2.

So I tried at Tree2.OnLoad:

If Sender.DragManager.DragSource=Tree1
then begin
Data1 := Sender.GetNodeData(Node);
...
end;

Now the data is correctly read from the stream. The drag is accepted
(MOVE in my case). You can see a + at the start of the dropped node
and the source node is removed from the tree1. When I click on the +
it appears no child is added and the tree collapse inmediately.

Shall I send you a demo project?

Best regards,

Frank.

"Mike Lischke" [lists@l...] wrote:
> Hi Frank,
>
> > I want to implement a drag and drop from one VST into antother in
the
> > same form, but with different data records.
> > However in the OnLoadNode I cannot see who the actual Sender is
(the
> > stream is ok) and therefore I cannot load the stream correctly.
>
> Hmm, did you see the Sender parameter in the event?
>
> Ciao, Mike

 | Replies | Author | Date
2821 | Re: Drag and Drop | Mike Lischke | Sun 7/1/2001


re: Announcement (about Newsgroups)

From: Kent Briggs [kbriggs@b...]
Date: Sat Jun 30, 2001 2:10 pm
Subject: Re: [VirtualTreeview] Announcement (about Newsgroups)

Ernest Fairchild wrote:

> If you want a place to hang out (Hi, group) I asked a friend of mine with a
> private newsserver to make a group dedicated to the VirtualTreeView
> controls. It's at nntp://4.33.81.200/tech.virtualtreeview . Hope to see you
> all there <g>.

To get that url to work in Netscape, it should be:

news://4.33.81.200/tech.virtualtreeview

--
Kent Briggs, [kbriggs@b...]
Briggs Softworks, http://www.briggsoft.com


re: Re: VT & Delphi 6: How to

From: "Vadim Sedulin" [wsntrl@o...]
Date: Sat Jun 30, 2001 2:33 pm
Subject: Re: [VirtualTreeview] Re: VT & Delphi 6: How to

Hello Ariel!

> if u dont override PropDrawName. is that function called?
>
> i thought that it was only called when it comes from the same
> compiler level.

It is now interface function.

Bye.

Vadim Sedulin
E-Mail: [wsntrl@o...]


re: Re: VET 1.4.34, finally available

From: "Mike Lischke" [lists@l...]
Date: Sat Jun 30, 2001 7:29 pm
Subject: RE: [VirtualTreeview] Re: VET 1.4.34, finally available

Hi Jim,

> Twice as slow in what respect? Initial start of the drag? All during
> the drag? Maybe this should be an option since it does seem to
> present a problem for some.

Well, only during drag. I don't know how large the drag image is (because it
dissolves to the
borders) but with my implementation I have a similar problem when setting the
drag image size to say
500x500 or up.

Ciao, Mike

 | Replies | Author | Date
2807 | Re: VET 1.4.34, finally available | Jim Kueneman | Sat 6/30/2001


re: Access Violation in Paint method under Windows 2000

From: "Mike Lischke" [lists@l...]
Date: Sat Jun 30, 2001 7:29 pm
Subject: RE: [VirtualTreeview] Access Violation in Paint method under Windows 2000

Hi Andriy,

> Long time use Virtual TreeView and have no problem. But afetr
> migration to Win2000 some time (float error) got access violation in
> paint method. I use VT on dinamic created form and load tree from
> file. When I try to show form I got AV and incorrect painted VT.

This is very strange. I have never heard about this problem nor can I reproduce
it (VT is being
developed on Win2K).

> I made small changes for resolve this problem but in general will be
> good to found and resolve it correct. After AV I can show this form
> again without any problem.

Well, your changes handle only the symptoms not the cause. It would be much
better to know what is
the reason for your problem. Perhaps I have to consider some special
circumstances?

Ciao, Mike


re: Incremental searching

From: "Mike Lischke" [lists@l...]
Date: Sat Jun 30, 2001 7:29 pm
Subject: RE: [VirtualTreeview] Incremental searching

Hi Basil,

> CharCode:= MapVirtualKey(CharCode,2);
> before
> NewChar := KeyUnicode(Char(CharCode));
> than everything became ok.

Thank your for giving this little trick. Fixed now.

Ciao, Mike


re: Re: VirtualTree Doted Lines...

From: "Mike Lischke" [lists@l...]
Date: Sat Jun 30, 2001 7:29 pm
Subject: RE: [VirtualTreeview] Re: VirtualTree Doted Lines...

Hi Ariel,

> i was talking about the treelines (that changes when u move the mouse
> over each node, using hottrack). or when u "mousedown" over a
> checkstate area. ican recompile all the files without any error.

Thank you for reminding me about this problem. This was really tough to solve
but I have it finally.
The main reason why my last solution worked only partially was that I have to
use a TCanvas class
passed in a TVTPaintInfo structure through all paint routines (which might also
call application
events), but due to the way the VCL manages canvases it happens often that its
handle is recreated
without restoring all properties. This behaviour resulted in the brush origin
being reset all the
time.

Just in case you or anybody here is interested in the details.

Ciao, Mike


re: Re: How to optimize the sorting ?

From: "Mike Lischke" [lists@l...]
Date: Sat Jun 30, 2001 7:29 pm
Subject: RE: [VirtualTreeview] Re: How to optimize the sorting ?

Hi Masial,

> Actually the comparing does take about 2-3 secs, i traced around to
> see where it was eating time and it seems to be 'ValidateChildren'
> that takes forever to complete. Theres a While there that goes tru
> every node with .nextSibling and does a ValidateNode
> (Child,Recursive). That really chokes the performance. I think (but
> im not certain) thats the place where it calls the OnInitNode.
> However, this is not THAT long when I turn AutoSort off.
>
> Any reason why the node init would be longer with AutoSort on?

Well, the semantic of AutoSort is to sort the entire tree and this needs a full
validation (which
takes time, yes). With only very few extra work you can however sort much
quicker. Turn off auto
sorting and call the sort method manually in the header click event. This will
sort only the given
node instead of the entire tree.

Ciao, Mike


re: VET 1.4.34, finally available>> I Get it now Mike!

From: "Mike Lischke" [lists@l...]
Date: Sat Jun 30, 2001 7:29 pm
Subject: RE: [VirtualTreeview] VET 1.4.34, finally available>> I Get it now Mike!

> Now I get it! You threw me with neUpdateFolder, it is really sneUpdateDir
> (or SHCNE_UPDATEDIR)

Ooops, wrote it out of my head. Sorry for that :o]

Ciao, Mike


re: Fullexpand with '*'

From: "Mike Lischke" [lists@l...]
Date: Sat Jun 30, 2001 7:29 pm
Subject: RE: [VirtualTreeview] Fullexpand with '*'

Hi Franc,

> when pressing the '*' key the tree is supposed to fully expand.
> However, it looks like that when pressing '*' only already
> initialized nodes are being displayed. Childnodes which aren't yet
> initialized don't appear in the tree. I've to fully reinitialize the
> tree (that means, restarting my program) to get the tree working
> again. I'm using 2.4.34.

Sorry, but I cannot reproduce this problem. Can you please step into WMKeyDown
to find what's wrong?

Ciao, Mike

 | Replies | Author | Date
2806 | Re: Fullexpand with '*' | Franc v/d Westelaken | Sat 6/30/2001


re: Re: BCB5 - VT2.4.34/VET1.2.34 - CF_RTF

From: "Mike Lischke" [lists@l...]
Date: Sat Jun 30, 2001 7:29 pm
Subject: RE: [VirtualTreeview] Re: BCB5 - VT2.4.34/VET1.2.34 - CF_RTF

Hi Roland,

> I have copied both source the *.hpp form VT and the *.h Orginal
> RichText from Borland, I think the basic problem is:
>
> in VT is CF_RTF a word
> and in RichText is CF_RTF a TEXT
>
> this also a difference in define and not only a double declaration.

Yes this is a stupid mistake (likely from Microsoft) which used the CF_xxx form
all the time to
describe the identifier of the clipboard format and CFSTR_xxxx for the
registration string. This is
different for RTF however and I thought I can simply ignore this as it is very
inconsistent. If I
use another name for the RTF identifier variable then other confusions are
programmed. So what shall
I do?

Ciao, Mike

 | Replies | Author | Date
2835 | Re: BCB5 - VT2.4.34/VET1.2.34 - CF_RTF | Roland | Mon 7/2/2001
2935 | Re: BCB5 - VT2.4.34/VET1.2.34 - CF_RTF | Mike Lischke | Sat 7/7/2001


re: Fullexpand with '*'

From: "Franc v/d Westelaken" [F.vdwestelaken@c...]
Date: Sat Jun 30, 2001 10:03 pm
Subject: RE: [VirtualTreeview] Fullexpand with '*'

Hi Mike,

> when pressing the '*' key the tree is supposed to fully expand.
> However, it looks like that when pressing '*' only already
> initialized nodes are being displayed. Childnodes which aren't yet
> initialized don't appear in the tree. I've to fully reinitialize the
> tree (that means, restarting my program) to get the tree working
> again. I'm using 2.4.34.

> Sorry, but I cannot reproduce this problem. Can you please step into
WMKeyDown to find what's wrong?

as Jim suggested this week I moved my code for adding children from the
OnExpanding event to the InitChildren event and now everything works. I
added childs in the OnExpanding event and that was not correct. I have to do
it in the OnInitchildren event.

Franc.


re: Re: VET 1.4.34, finally available

From: Jim Kueneman [jimdk@m...]
Date: Sat Jun 30, 2001 10:30 pm
Subject: RE: [VirtualTreeview] Re: VET 1.4.34, finally available

At 09:29 PM 6/30/2001 +0200, you wrote:
>Hi Jim,
>
> > Twice as slow in what respect? Initial start of the drag? All during
> > the drag? Maybe this should be an option since it does seem to
> > present a problem for some.
>
>Well, only during drag. I don't know how large the drag image is (because
>it dissolves to the
>borders) but with my implementation I have a similar problem when setting
>the drag image size to say
>500x500 or up.

Actually the image is your image I copy from TVTDragImage so it is the same
size. Must be your code is better :^)

Jim


New poll for VirtualTreeview

From: VirtualTreeview@yahoogroups.com
Date: Sun Jul 1, 2001 12:11 am
Subject: New poll for VirtualTreeview

Enter your vote today! A new poll has been created for the
VirtualTreeview group:

Usenet or yahoo.groups??

* usenet: a personal computer (adsl),
google (?), files (attach?)

* yahoo.groups: well.. u know; (very
bad search cap).

o Usenet
o groups.Yahoo

To vote, please visit the following web page:

http://groups.yahoo.com/group/VirtualTreeview/polls

Note: Please do not reply to this message. Poll votes are
not collected via email. To vote, you must go to the Yahoo! Groups
web site listed above.

Thanks!

 | Replies | Author | Date
2810 | Re: New poll for VirtualTreeview | Mike Lischke | Sun 7/1/2001


a Poll

From: "Ariel" [asel98@y...]
Date: Sun Jul 1, 2001 12:15 am
Subject: a Poll

Mike, theres ppl using groups, and others using usenet...
i create a poll. (i dont know what u think...).

 | Replies | Author | Date
2811 | Re: a Poll | Mike Lischke | Sun 7/1/2001


re: New poll for VirtualTreeview

From: "Mike Lischke" [lists@l...]
Date: Sun Jul 1, 2001 7:44 am
Subject: RE: [VirtualTreeview] New poll for VirtualTreeview

Hi all,

> Enter your vote today! A new poll has been created for the
> VirtualTreeview group: Usenet or yahoo.groups??

To add some thoughts to this poll: You should keep in mind that many people
will have no real choice
other than mailing lists. I also prefer usenet but the current solution has
some drawbacks:

- often access to news groups is blocked or not available for other reasons
- it is not an official server, so Google will not index it
- it is a private machine and may disappear every minute
- not searchable

> * yahoo.groups: well.. u know; (very
> bad search cap).

Well the search capability is much better than that of the private news group
server which has
nothing.

Ciao, Mike


re: a Poll

From: "Mike Lischke" [lists@l...]
Date: Sun Jul 1, 2001 7:46 am
Subject: RE: [VirtualTreeview] a Poll

Ariel,

> Mike, theres ppl using groups, and others using usenet...
> i create a poll. (i dont know what u think...).

A short question in advance would have been good. Imagine only 20% of the 460
subscribers of this
list would create a poll on their own...

Ciao, Mike


re: Delphi 6 support

From: "Mike Lischke" [lists@l...]
Date: Sun Jul 1, 2001 8:41 am
Subject: RE: [VirtualTreeview] Delphi 6 support

Andriy,

> Where will be available version of VT with Delphi 6 support?

As soon as I get my D6 copy I will make VT D6 compatible. There should really
not be much to do for
the new Delphi version...

Ciao, Mike


re: VCL Drag and Drop problems

From: "Mike Lischke" [lists@l...]
Date: Sun Jul 1, 2001 8:41 am
Subject: RE: [VirtualTreeview] VCL Drag and Drop problems

Hi Will,

> The OLE scheme for showing nodes being dragged seems to cut
> out as soon as one sets the drag mode to 'VCL'. To get around this,
> I made the StartDrag event create an object derived from
> TDragControlObject. The new class overrides GetDragImages, and
> supplies a suitable 'dragging' picture.

Aside the drawing problems, did you get reasonable performance? Using a large
drag image in an image
list was one of my first trials and I gave it up quickly because it was
terribly slow.

> 1) Is there anything I can do in terms of setting grid options to
> prevent this from happening

No, unfortunately not. The interaction between a blended drag image and the
underlying window is
very complex which is the reason why I disabled the image when the mouse is not
over a VT window.
Jim has in his VET implementation managed to use layered windows for this task
which works very
nice, but is limited to W2K+ and also slower than my direct solution which does
not have to care
about other system related tasks.

> 2) Is there any way I can use the OLE Drag and Drop display with
> VCL Drag and Drop? I looked at the code, but I couldn't understand
> what the classes did.

It is on my todo list to allow a blended drag image for VCL dd too. My advice
however is to use OLE
dd instead (if possible), it is much more flexible.

Ciao, Mike

 | Replies | Author | Date
2837 | Re: VCL Drag and Drop problems | Will Watts | Mon 7/2/2001
2881 | Re: VCL Drag and Drop problems | Mike Lischke | Wed 7/4/2001


OT: list organizaton (was: Please a newsgroup)

From: "Mike Lischke" [lists@l...]
Date: Sun Jul 1, 2001 8:41 am
Subject: OT: list organizaton (was: Please a newsgroup)

> I endorse both the views above. Yahoo groups are pretty good; and
> the anti-attachment and digest features are handy, keeping the
> number and size of messages under control.
>
> It would be useful to split off the VET stuff though - perhaps to
> another list in the same group?

This is a good idea IMO. For me it would not make any difference (just one
mailing list more in a
dozen) but for those interested only in VT or only VET this will decrease the
message load. Jim,
what do you think? I mean you are already moderator here so it makes not much
difference to have an
own list. On the other hand you would then also have to care for maintainance
(bouncing messages
etc.) but this is also not much.

Personally I have no preference for either solution. Decide how you like it,
Jim. The same is valid
for other future off-springs.

Ciao, Mike

 | Replies | Author | Date
2823 | New Group for VET | Jim Kueneman | Sun 7/1/2001
2825 | Re: New Group for VET | Mike Lischke | Sun 7/1/2001


re: VET 1.4.34 fixes major AV

From: "Mike Lischke" [lists@l...]
Date: Sun Jul 1, 2001 8:41 am
Subject: RE: [VirtualTreeview] VET 1.4.34 fixes major AV

Hi Jim,

> Mike, the Shell Notify is fixed and VET now has 4 new properties (not
> published)

Great.

> SelectedPath - Path of the currently selected node
> SelectedPaths - Paths of all currently selected nodes (TStrings)
> SelectedFile - Filename of the currently selected node
> SelectedFiles - FileNames of all currently selected nodes (TStrings)

I'm curious about the VET help file :o] Why two versions (path and folders)? A
node can only be
either a file or a folder, not both.

Ciao, Mike

 | Replies | Author | Date
2822 | Re: VET 1.4.34 fixes major AV | Jim Kueneman | Sun 7/1/2001
2824 | Re: VET 1.4.34 fixes major AV | Mike Lischke | Sun 7/1/2001


re: Please a newsgroup

From: "Mike Lischke" [lists@l...]
Date: Sun Jul 1, 2001 8:41 am
Subject: RE: [VirtualTreeview] Please a newsgroup

Hi Peter,

> if you want to wait for abour 4 to 6 weeks then I can offer you a free
newsgroup which
> will be specialized for the programmers´ needs.
> It will contain extended functionality for workgroups as we ll as standard
users.
> Multiple assignments to topics of interest, flexible multiple search
cretaria, reports,
> rich text formatted Unicode editors with embeded objects like your
VirtualTree,
> hyperlinks to internal related objects, etc, etc.

Thank you very much for your offer, but as already discussed I would much
prefer a solution which is
compatible with exiting Usenet. I do not consider the current incarnation as
too limited. The only
real flaw of Usenet is the missing search feature but this was provided instead
by Dejanews and now,
after Google took over, it is even better (I found one of my oldest news
messages back in November
1995 with Google).

Ciao, Mike


re: VT - Header Draw

From: "Mike Lischke" [lists@l...]
Date: Sun Jul 1, 2001 11:34 am
Subject: RE: [VirtualTreeview] VT - Header Draw

Ariel,

> procedure TVirtualTreeColumns.PaintHeader(DC: HDC; R: TRect; HOffset:
> Integer);
>
> can u add an option to dont call "DrawEdge"?
> i change it, but maybe u want to do that too. is the unique change it
> needs to draw the header like WinXP. (with the function i sended).

Will do this when I implement your XP header draw stuff.

Ciao, Mike


re: VT & Delphi 6: How to

From: "Mike Lischke" [lists@l...]
Date: Sun Jul 1, 2001 11:34 am
Subject: RE: [VirtualTreeview] VT & Delphi 6: How to

Hi Vadim,

> uses
> Windows, Classes,
> {$ifdef DFS_COMPILER_6_UP}
> DesignIntf,
> DesignEditors,
> VCLEditors,
> {$else}
> Dsgnintf,
> {$endif}
> {$ifndef BCB}
> ColnEdit,
> {$endif}
> VirtualTrees;
> ....

Thank you very much for providing the necessary changes to make VT D6
compilable.

To all:

In future versions of VT I will provide a new include file called Compilers.inc
which is similar to
Brad Stowers DFS.inc but provides checks for Kylix too and does not include
symbols which are only
related to Brad's stuff.

I'm thinking of publishing it also separately (for free of course). Any
opinions?

Ciao, Mike


re: DeleteNode bug?

From: "Mike Lischke" [lists@l...]
Date: Sun Jul 1, 2001 11:34 am
Subject: RE: [VirtualTreeview] DeleteNode bug?

Hi Will,

> If you call DeleteNode() on the node that has focus, then the
> OnFocusChanging event is called. I think this is a bug.

Not really. It is a feature. Consider the case where you need to be notified
when the currently
focused node is deleted and you have to remove stuff if there is no node
focused.

> procedure TForm1.tvMainFocusChanging(Sender: TBaseVirtualTree;
> OldNode, NewNode: PVirtualNode; OldColumn, NewColumn: Integer;
> var Allowed: Boolean);
> begin
> // In reality there'd be some logic here,
> // in practice this can happen
> Allowed := False;
> end;
>
> then the shift of focus away from the node that is being deleted doesn't
> happen. Bewildering AVs follow rapidly.

Well, this is then a bug of your code not VT's. How can you disallow the focus
to switch when you
are removing the node which currently has the focus? It would have quite a lot
of implications when
suddenly DeleteNode would not be executed because the application does not
allow to set the focus to
another node (or nil). Additionally, not only DeleteNode sets the current focus
to nil if necessary.
Whenever a node is disconnected (e.g. in MoveTo) the check for the focused node
is done. I would
come into serious trouble if it wouldn't be allowed to switch the focus
somewhere within the move
operation.

> I notice that DoFocusNode has a parameter 'Ask' which would appear to apply
> to this situation - but which isn't used here.

Let me think about this. It would be an option to just tell the app the focus
changed without asking
it if this allowed. On the other hand apps. may rely on the feature being asked
in this case. So
what's the lesser of two evils? Other options?

Ciao, Mike

 | Replies | Author | Date
2839 | Re: DeleteNode bug? | Will Watts | Mon 7/2/2001
2936 | Re: DeleteNode bug? | Mike Lischke | Sat 7/7/2001


re: Re: Bug List?

From: "Mike Lischke" [lists@l...]
Date: Sun Jul 1, 2001 11:34 am
Subject: RE: [VirtualTreeview] Re: Bug List?

Hi Moritz,

> cool idea. but what about changing the table into a todo list, where
> not only bugs but also feature requests and other things can be
> posted?

Why changing the bug list table? I can (and will) simply create a new table for
a Todo list.

> last suggestion: mike, if you like, i can make a more user-friendly
> version (drop down fields, a bigger description field, auto-id,
> security) of this todo-list table on our webserver. i would only need
> 15 mins for this, so its no problem.

Mmmh, thanks for the offer. The only problem I see is that people have to visit
another web site to
add an todo item or view what is being suggested already. Let's first see how
the YG database is
used.

Ciao, Mike


re: Re: Drag and Drop

From: "Mike Lischke" [lists@l...]
Date: Sun Jul 1, 2001 11:34 am
Subject: RE: [VirtualTreeview] Re: Drag and Drop

Frank,

> Shall I send you a demo project?

Yes, please do that.

Ciao, Mike


re: VET 1.4.34 fixes major AV

From: Jim Kueneman [jimdk@m...]
Date: Sun Jul 1, 2001 1:17 pm
Subject: RE: [VirtualTreeview] VET 1.4.34 fixes major AV

At 10:41 AM 7/1/2001 +0200, you wrote:
> > SelectedPath - Path of the currently selected node
> > SelectedPaths - Paths of all currently selected nodes (TStrings)
> > SelectedFile - Filename of the currently selected node
> > SelectedFiles - FileNames of all currently selected nodes (TStrings)
>
>I'm curious about the VET help file :o] Why two versions (path and
>folders)? A node can only be
>either a file or a folder, not both.

I am not sure what you are talking about here Mike, can you elaborate a bit
more.

Jim

 | Replies | Author | Date
2824 | Re: VET 1.4.34 fixes major AV | Mike Lischke | Sun 7/1/2001


New Group for VET

From: Jim Kueneman [jimdk@m...]
Date: Sun Jul 1, 2001 1:49 pm
Subject: New Group for VET

At 10:41 AM 7/1/2001 +0200, you wrote:

>This is a good idea IMO. For me it would not make any difference (just one
>mailing list more in a
>dozen) but for those interested only in VT or only VET this will decrease
>the message load. Jim,
>what do you think? I mean you are already moderator here so it makes not
>much difference to have an
>own list. On the other hand you would then also have to care for
>maintainance (bouncing messages
>etc.) but this is also not much.

Ok I started another group for VET at

http://groups.yahoo.com/group/VirtualExplorerTree

everyone is welcome.

Jim

 | Replies | Author | Date
2825 | Re: New Group for VET | Mike Lischke | Sun 7/1/2001


re: VET 1.4.34 fixes major AV

From: "Mike Lischke" [lists@l...]
Date: Sun Jul 1, 2001 2:48 pm
Subject: RE: [VirtualTreeview] VET 1.4.34 fixes major AV

> I am not sure what you are talking about here Mike, can you elaborate a bit
> more.

Well, I have the strong feeling I mixed something here. Are those properties
part of the tree or the
namespaces? I guess it's the first, right? So just ignore my comment :o]

Ciao, Mike


re: New Group for VET

From: "Mike Lischke" [lists@l...]
Date: Sun Jul 1, 2001 2:48 pm
Subject: RE: [VirtualTreeview] New Group for VET

> Ok I started another group for VET at
>
> http://groups.yahoo.com/group/VirtualExplorerTree
>
> everyone is welcome.

Hey, another 20MB to fill up :o]

Ciao, Mike


New file uploaded to VirtualTreeview

From: [VirtualTreeview@yahoogroups.com>
Date: Sun Jul 1, 2001 3:00 pm
Subject: New file uploaded to VirtualTreeview

Hello,

This email message is a notification to let you know that
a file has been uploaded to the Files area of the VirtualTreeview
group.

File : /VirtualTree_2.5.1.zip
Uploaded by : [lists@l...]
Description : Beta version

You can access this file at the URL

http://groups.yahoo.com/group/VirtualTreeview/files/VirtualTree_2.5.1.zip

To learn more about file sharing for your group, please visit

http://help.yahoo.com/help/us/groups/files

Regards,

lists@l...]

 | Replies | Author | Date
2827 | Re: New file uploaded to VirtualTreeview | Mike Lischke | Sun 7/1/2001
2830 | Re: New file uploaded to VirtualTreeview | Jim Kueneman | Sun 7/1/2001
2831 | Re: New file uploaded to VirtualTreeview | Mike Lischke | Sun 7/1/2001


re: New file uploaded to VirtualTreeview

From: "Mike Lischke" [lists@l...]
Date: Sun Jul 1, 2001 3:05 pm
Subject: RE: [VirtualTreeview] New file uploaded to VirtualTreeview

Hi all,

> This email message is a notification to let you know that
> a file has been uploaded to the Files area of the VirtualTreeview
> group.

Changes in this build:

- switched to minor version 2.5
- a new include file is there which is used to determine the compiler
- adjustments in VirtualTreesReg.pas for Delphi 6
- rounded selection rectangles, property SelectionCurveRadius
- selection border and colors
- hatSystemDefault, DoGetAnimationType
- brush alignment bug for dotted lines fixed
- test for TYMED_HGLOBAL is now done using a mask instead of direct comparation
- tree column classes can now be changed by descentants, see
TBaseVirtualTree.GetColumnClass
- TVTRenderOLEDataEvent, property OnRenderOLEData, DoRenderOLEData,
- TVTGetUserClipboardFormats, DoGetUserClipboardFormats, property
OnGetUserClipboardFormats
- removed ScrollIntoView from AddChild and InsertNode
- property OnPaintBackground, DoPaintBackground
- ContentToRTF improvements
- other small changes
- bug fixes

Ciao, Mike


re: Please a newsgroup

From: "Peter Danich" [Support@d...]
Date: Sun Jul 1, 2001 3:31 pm
Subject: Re: [VirtualTreeview] Please a newsgroup

Hi Mike (...and all who replied),
first of all I want to thank you for all the help I reveiced from your libs. Up
to now I could already learn a lot.
As I read in one of the messages that free facilities are needed for running a
newsgroup for VT I took this opportunity to offer some sort of help.

I still think that a specialized solution for software developers would serve a
lot better than the general purpose newsgroup. Anyway, once released, everybody
interested in will be welcomed to try it out and use it as long as it will be
of sadifactory.

Again, many thanks to you and all others for replying with your opinions in
this matter.
Regards and have a nice weekend,
Peter

----- Original Message -----
From: Mike Lischke
To: VirtualTreeview@yahoogroups.com
Sent: Sunday, July 01, 2001 10:41 AM
Subject: RE: [VirtualTreeview] Please a newsgroup

Hi Peter,

> if you want to wait for abour 4 to 6 weeks then I can offer you a free
newsgroup which
> will be specialized for the programmers´ needs.
> It will contain extended functionality for workgroups as we ll as standard
users.
> Multiple assignments to topics of interest, flexible multiple search
cretaria, reports,
> rich text formatted Unicode editors with embeded objects like your
VirtualTree,
> hyperlinks to internal related objects, etc, etc.

Thank you very much for your offer, but as already discussed I would much
prefer a solution which is
compatible with exiting Usenet. I do not consider the current incarnation as
too limited. The only
real flaw of Usenet is the missing search feature but this was provided
instead by Dejanews and now,
after Google took over, it is even better (I found one of my oldest news
messages back in November
1995 with Google).

Ciao, Mike

To unsubscribe from this group, send an email to:
VirtualTreeview-unsubscribe@egroups.com

Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.

[Non-text portions of this message have been removed]


re: New file uploaded to VirtualTreeview

From: Werner Lehmann [wl@b...]
Date: Sun Jul 1, 2001 4:22 pm
Subject: Re: [VirtualTreeview] New file uploaded to VirtualTreeview

Hi Mike,

Mike Lischke wrote:
>
> Changes in this build:
>
> - switched to minor version 2.5
> - a new include file is there which is used to determine the compiler
> - adjustments in VirtualTreesReg.pas for Delphi 6
> - rounded selection rectangles, property SelectionCurveRadius

Cute. Is this XP style? Two 'problems' though. Should better be switched off
with
full row select since each cell and not the whole row has a rounded selection
rect.
But this is ok by me. I did not check but if you draw each cell selection
separately
a change would require to draw the selection row-wise not cell-wise. To say it
again: I am not asking for this.

Maybe the droptarget node can also be drawn with a round rect selection?

The focus rect does not match the selection anymore. Can't we just use our own
DrawFocusRect? Setting the line style and then roundrect'ing it should do the
trick
probably.

> - selection border and colors

Also very cute. I can just use voHideFocusRect and set the
FocusedSelectionBorder.
I like it very much. Forget what I said about the DrawFocusRect.

While testing this I noticed again that when a tree receives focus (tab'bed in)
and
no node is selected or focused it will not automatically focus the first node. I
would expect however (as a user) that the first node get focus. Currently there
is
no indication that the tree has focus unless a arrow key is used or the user
clicks
with the mouse on the (already focused) tree. What do you think?

Another issue about incremental search. If I have no inc search handler
attached but
inc search is set to isAll then each keypress will advance the focus one node
even if
no node text begins with this character.

> - hatSystemDefault, DoGetAnimationType
> - brush alignment bug for dotted lines fixed
> - test for TYMED_HGLOBAL is now done using a mask instead of direct
comparation

Thank you.

> - tree column classes can now be changed by descentants, see
TBaseVirtualTree.GetColumnClass
> - TVTRenderOLEDataEvent, property OnRenderOLEData, DoRenderOLEData,
> - TVTGetUserClipboardFormats, DoGetUserClipboardFormats, property
OnGetUserClipboardFormats

Thanks again. There was a small bug at getuserclipboardformats, the new format
was not
available somehow. It turned out that the formats array was passed by value
here:

procedure TBaseVirtualTree.DoGetUserClipboardFormats(Formats: TFormatArray);

This needs a 'var' directive. Except from this all works good now.

> - removed ScrollIntoView from AddChild and InsertNode

Fine.

> - property OnPaintBackground, DoPaintBackground
> - ContentToRTF improvements
> - other small changes
> - bug fixes

One more thing about FullExpand. I ran into the same problem that Franc already
had. I
am not using the init events but just in OnExpanding I set the childcount and
init all
nodes manually (I want to keep the add and init code together). This does not
work if I
select a node and press * to full expand the sub tree, the node will just loose
its plus
button and appear to have no children. Jim has already worked out why this is
the case
in FullExpand but do you see a chance to remove this FullExpand <-> OnInitNode
requirement?

Regards,
Werner

 | Replies | Author | Date
2832 | Re: New file uploaded to VirtualTreeview | Mike Lischke | Sun 7/1/2001


re: New file uploaded to VirtualTreeview

From: Jim Kueneman [jimdk@m...]
Date: Sun Jul 1, 2001 3:44 pm
Subject: Re: [VirtualTreeview] New file uploaded to VirtualTreeview

Hi Mike,

I just downloaded the new version. All looks good except for the
"droppings" on collapse

Line 11825

if not FHeader.UseColumns then
FillRect(DC, Rect(R.Left, R.Bottom - StepSize, R.Right,
R.Bottom), Brush)

Still needs 1 subtracted from StepSize

if not FHeader.UseColumns then
FillRect(DC, Rect(R.Left, R.Bottom - StepSize - 1, R.Right,
R.Bottom), Brush)

Jim

 | Replies | Author | Date
2831 | Re: New file uploaded to VirtualTreeview | Mike Lischke | Sun 7/1/2001


re: New file uploaded to VirtualTreeview

From: "Mike Lischke" [lists@l...]
Date: Sun Jul 1, 2001 7:03 pm
Subject: RE: [VirtualTreeview] New file uploaded to VirtualTreeview

Hi Jim,

> Still needs 1 subtracted from StepSize
>
> if not FHeader.UseColumns then
> FillRect(DC, Rect(R.Left, R.Bottom - StepSize - 1, R.Right,
> R.Bottom), Brush)

I overlooked this somehow. Thank you for pointing that out.

Ciao, Mike


re: New file uploaded to VirtualTreeview

From: "Mike Lischke" [lists@l...]
Date: Sun Jul 1, 2001 7:03 pm
Subject: RE: [VirtualTreeview] New file uploaded to VirtualTreeview

Hi Werner,

> Cute. Is this XP style?

No :o] I went to MSDN online today to search for the values for
SPI_GETTOOLTIPFADE etc. and saw
their new layout which is quite cool. And since drawing a border around a
rectangle is a matter of 5
minutes I implemented that. And while I was changing the few lines I thought
about giving the
opportunity for rounded rectangles. Implementing this was another 5-10 minutes
so I quickly made the
necessary changes. See also in the screen shot folder on YG for a shoot of my
demo app.

>Two 'problems' though. Should better be switched off with
> full row select since each cell and not the whole row has a rounded selection
rect.

Well, this is up to the user. The can set the curve radius to 0 which results
in a normal rectangle.

> Maybe the droptarget node can also be drawn with a round rect selection?

Oops, forgot that. Is changed now.

> While testing this I noticed again that when a tree receives focus (tab'bed
in) and
> no node is selected or focused it will not automatically focus the first
node. I
> would expect however (as a user) that the first node get focus.

Mmmh, would you really force *every* VT user to have the first node focused on
enter? I'd say that
if you want it you can easily set it explicitely in your app.

> Another issue about incremental search. If I have no inc search handler
attached but
> inc search is set to isAll then each keypress will advance the focus one node
even if
> no node text begins with this character.

Yes, therefore it should be switched off if there is no handler (and it is off
by default).

> Thanks again. There was a small bug at getuserclipboardformats, the new
format was not
> available somehow. It turned out that the formats array was passed by value
here:
> procedure TBaseVirtualTree.DoGetUserClipboardFormats(Formats: TFormatArray);

Stupid me. I bet my son was distracting me when I wrote the parameter list :o]
Well, also fixed now.

> button and appear to have no children. Jim has already worked out why this is
the case
> in FullExpand but do you see a chance to remove this FullExpand <->
OnInitNode requirement?

Well, well, well, so be it then. I'm not very happy with this because it allows
even more to avoid
the virtual approach but if it increases VT's value then be it so...

Ciao, Mike


[no subject]

From: [F.vdwestelaken@c...]
Date: Mon Jul 2, 2001 7:00 am
Subject:

Jul 2001 00:04:51 +0200
To: [VirtualTreeview@yahoogroups.com>
Message-ID: [MMEBIEFEHHOLNALGMHDOAECEDLAA.F.vdWestelaken@c...]
X-Priority: 3 (Normal)
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2911.0)
Importance: Normal
In-Reply-To: [NABBLOKFMDBHOGNKKJHEEECBCOAA.public@l...]
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2479.0006
From: "Franc v/d Westelaken" <F.vdwestelaken@c...]
MIME-Version: 1.0
Mailing-List: list VirtualTreeview@yahoogroups.com; contact
VirtualTreeview-owner@yahoogroups.com
Delivered-To: mailing list VirtualTreeview@yahoogroups.com
Precedence: bulk
List-Unsubscribe: <mailto:VirtualTreeview-unsubscribe@yahoogroups.com>
Date: Sun, 1 Jul 2001 00:03:37 +0200
Reply-To: VirtualTreeview@yahoogroups.com
Subject: RE: [VirtualTreeview] Fullexpand with '*'
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
X-UIDL: 293661511
Status: U

Hi Mike,

> when pressing the '*' key the tree is supposed to fully expand.
> However, it looks like that when pressing '*' only already
> initialized nodes are being displayed. Childnodes which aren't yet
> initialized don't appear in the tree. I've to fully reinitialize the
> tree (that means, restarting my program) to get the tree working
> again. I'm using 2.4.34.

> Sorry, but I cannot reproduce this problem. Can you please step into
WMKeyDown to find what's wrong?

as Jim suggested this week I moved my code for adding children from the
OnExpanding event to the InitChildren event and now everything works. I
added childs in the OnExpanding event and that was not correct. I have to do
it in the OnInitchildren event.

Franc.

To unsubscribe from this group, send an email to:
VirtualTreeview-unsubscribe@egroups.com

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/


re: Header Columns behave strange.

From: [m.dekker@a...]
Date: Mon Jul 2, 2001 7:27 am
Subject: Re: Header Columns behave strange.

--- In [VirtualTreeview@y...], Werner Lehmann [wl@b...] wrote:
> [m.dekker@a...] wrote:
> >
> > The other columns i create are in a loop filled by some
arrayvalues.
> > I tried to simulate a border like the stringgrid (see the advanced
> > demo). The first time i ran my program, the first column isn't
> > visible and the second contains the border. The second time,
reading
> > new data, the first column is also shown, which is very strange. I
> > cleared the headers by using
>
> Just guessing, but did you set MainColumn to 0 and hide it? IIRC
that's
> the way the advanced demo grid does it, according to the comment
label
> and my memory :)
>

> Werner

Werner, is this the only solution, i mean, is it necesary to hide the
first column, because it 's more efficient for the use of the memory?

Mark


re: BCB5 - VT2.4.34/VET1.2.34 - CF_RTF

From: "Roland" [Beduerftig@S...]
Date: Mon Jul 2, 2001 7:42 am
Subject: Re: BCB5 - VT2.4.34/VET1.2.34 - CF_RTF

Hi Mike,

> Yes this is a stupid mistake (likely from Microsoft) which used the
> CF_xxx form all the time to describe the identifier of the
> clipboard format and CFSTR_xxxx for the registration string. This is
> different for RTF however and I thought I can simply ignore this as
> it is very inconsistent. If I use another name for the RTF
> identifier variable then other confusions are programmed. So what
> shall I do?

I think this is a problem, when an user use RTF, normally the user
will also use richtext.h from microsoft, we can try:

1. rename the define in VT
2. use a namespace with VT, for example Virtualtrees::CF_RTF

bye
Roland

 | Replies | Author | Date
2935 | Re: BCB5 - VT2.4.34/VET1.2.34 - CF_RTF | Mike Lischke | Sat 7/7/2001


re: Delphi 6 support

From: GIANNAKOPOULOS KOSTAS [kyan@s...]
Date: Mon Jul 2, 2001 7:43 am
Subject: RE: [VirtualTreeview] Delphi 6 support

> As soon as I get my D6 copy I will make VT D6 compatible.
> There should really not be much to do for
> the new Delphi version...

Actually i've tried it and the only thing you need to do is to replace
"RaiseLastWin32Error" with "RaiseLastOSError" so that the "deprecated
symbol" compiler warning about "RaiseLastWin32Error" is eliminated.

Also, the changes Vadim Sedulin proposed for the property editor WILL make
VirtualTreesReg.pas compatible with D6.

Other than that, the only issue is that you get a warning about the unit
being specific to a platform (probably because of the drag&drop stuff) which
i don't think is an issue at all.

<KY>

 | Replies | Author | Date
2880 | Re: Delphi 6 support | Mike Lischke | Wed 7/4/2001


re: VCL Drag and Drop problems

From: "Will Watts" [willw@a...]
Date: Mon Jul 2, 2001 9:11 am
Subject: RE: [VirtualTreeview] VCL Drag and Drop problems

On 1 Jul 2001, at 10:41, Mike Lischke wrote:

> Aside the drawing problems, did you get reasonable performance? Using
> a large drag image in an image list was one of my first trials and I
> gave it up quickly because it was terribly slow.

It seems ok. If I drag an image I guess about 200 pixels square, I
can get CPU usage up to 88% by wiggling, but it isn't getting 'jerky'
or missing frames as some animations do when they are struggling.
This on a 500 MHz PIII running W2k and a not particularly clever
graphics card (an old Diamond).

> > 2) Is there any way I can use the OLE Drag and Drop display with VCL
> > Drag and Drop? I looked at the code, but I couldn't understand what
> > the classes did.
>
> It is on my todo list to allow a blended drag image for VCL dd too.

Ah well - I'm grateful for this crumb of comfort ;-)

> My advice however is to use OLE dd instead (if possible), it is much more
> flexible.

Noted. I would like to but this particular job won't stand it: I'd have to
create OLE dd for other VCL components, and I have no more time.

Regards

Will

Will Watts Direct Line +44 20 8400 6104
Applied Industrial Systems Ltd Main Voice +44 20 8400 6100
10 Barley Mow Passage Fax +44 20 8742 2456
Chiswick London W4 4PH Web http://www.applied.co.uk

 | Replies | Author | Date
2881 | Re: VCL Drag and Drop problems | Mike Lischke | Wed 7/4/2001


Saving/Loading VT

From: TC Lai [lai_tc@y...]
Date: Mon Jul 2, 2001 9:25 am
Subject: Saving/Loading VT

Hi, I am new here, and very green as far as
programming is concerned.

Though I can save a tree to file, and reload it
correctly, I can only use the method which I used with
the standard treeview. I just can't figure out how to
do it correctly using the OnSaveNode and OnLoadNode
handlers.

I have looked at some of the past postings on
saving/loading but it has not helped much.

Using SaveToFile/LoadFromFile together with
OnSaveNode/OnLoadNode handlers, it takes about 26
seconds on my 166 MHz machine to load a tree with 3000
nodes from file. This does not include user data, as I
can't figure out how to do it.

Whereas, when I do not use the OnSaveNode/OnLoadNode
handlers, the time is only about 6 seconds. And this
includes loading user data consisting of a short text
passage for each node, displayed in a richedit when a
node is clicked.

With a standard treeview, it takes about 10 seconds.

The virtual treeview is obviously faster. But I am
sure if I used it correctly, it can be faster than
that. I must be using the virtual treeview
incorrectly. Does anyone have a small demo to show how
to load/save a tree from/to file? I will appreciate it
if I can have a copy.

Regards,

TC

__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail
http://personal.mail.yahoo.com/

 | Replies | Author | Date
2882 | Re: Saving/Loading VT | Mike Lischke | Wed 7/4/2001
2898 | Re: Saving/Loading VT | TC Lai | Thu 7/5/2001
2900 | Re: Saving/Loading VT | Jim Kueneman | Thu 7/5/2001
2901 | Re: Saving/Loading VT | Jim Kueneman | Thu 7/5/2001
2940 | Re: Saving/Loading VT | Mike Lischke | Sat 7/7/2001
2915 | Re: Saving/Loading VT | TC Lai | Fri 7/6/2001
2925 | Re: Saving/Loading VT | Jim Kueneman | Sat 7/7/2001
2934 | Re: Saving/Loading VT | [ltchoong@s...] | Sat 7/7/2001
2945 | Re: Saving/Loading VT | Jim Kueneman | Sat 7/7/2001


re: DeleteNode bug?

From: "Will Watts" [willw@a...]
Date: Mon Jul 2, 2001 9:42 am
Subject: RE: [VirtualTreeview] DeleteNode bug?

On 1 Jul 2001, at 13:34, Mike Lischke wrote:

> Not really. It is a feature. Consider the case where you need to be
> notified when the currently focused node is deleted and you have to
> remove stuff if there is no node focused.

Yes, that is true, but...

> Well, this is then a bug of your code not VT's.

I concede that it was a bug in my code that led me to this - but I
think that it is a bug in VT as well. My code might say

'User: are you sure you wish to abandon your changes to this
node?'

and when the user says 'No' it prohibits the loss of focus. This
strikes me as reasonable behaviour for application code. The fact
that the user has just deleted this node, and now wants to save his
changes, is peculiar behaviour by a user - which we know never
happens ;-)

I think that the component writer's contract to the application writer
says that the application writer should not be able to put the
component into an inconsistent state. And that VT violates the
contract in this case.

> Let me think about this. It would be an option to just tell the
> app the focus changed without asking it if this allowed. On the
> other hand apps. may rely on the feature being asked in this case.
> So what's the lesser of two evils? Other options?

It could call OnFocusChanging, but then ignore the Allowed result
and go ahead in this particular situation. Yuck. That involves telling a
lie - always comes back to bite you.

How about this - my favourite idea so far. You can detect this
situation within VT (denied permission to switch focus when you
MUST switch focus). If this happens, *don't* delete the node and
raise an exception. Something like: 'Attempt to delete node that
could not lose focus'.

This leaves the tree in a self-consistent state, *and* won't break any
existing working code. And it might clear up a few mysterious AVs
you see on this list - I suspect the one I reported some weeks ago
was caused by this, and I got rid of it through (bad) luck.

The one thing I'd say is that code in OnFocusChanging should be
able to detect this condition (where it doesn't really have a choice
about 'Allowed'). Is there a state flag that indicates the node is being
deleted at this point? My impression was not, but I haven't looked
very carefully.

Regards

Will

Will Watts Direct Line +44 20 8400 6104
Applied Industrial Systems Ltd Main Voice +44 20 8400 6100
10 Barley Mow Passage Fax +44 20 8742 2456
Chiswick London W4 4PH Web http://www.applied.co.uk

 | Replies | Author | Date
2936 | Re: DeleteNode bug? | Mike Lischke | Sat 7/7/2001


re: New file uploaded to VirtualTreeview

From: "Teus de Jong" [teusjdejong@p...]
Date: Mon Jul 2, 2001 10:50 am
Subject: Re: [VirtualTreeview] New file uploaded to VirtualTreeview

Hi Mike,

First, I like the changes.
I've got one minor issue: in design mode I get several Clipboardformats
twice (or even more) times in the dropdownlist (not in the string list when
accessed by ...). This is fixed if I add one line to
TClipboardFormatsProperty.GetProperties in VirtualTreesReg.pas:

List := TStringList.Create;
List.duplicates := dupIgnore; <--

Teus de Jong

 | Replies | Author | Date
2883 | Re: New file uploaded to VirtualTreeview | Mike Lischke | Wed 7/4/2001


re: VCL Drag and Drop problems

From: Werner Lehmann [wl@b...]
Date: Mon Jul 2, 2001 11:12 am
Subject: Re: [VirtualTreeview] VCL Drag and Drop problems

Will Watts wrote:
>
> > My advice however is to use OLE dd instead (if possible), it is much more
> > flexible.
>
> Noted. I would like to but this particular job won't stand it: I'd have to
> create OLE dd for other VCL components, and I have no more time.

Will,

you may want to take a look on the drag and drop components from Anders Melander
(and one Australian whose name I forgot) on www.melander.dk. You can turn any
VCL component with a window handle (everything derived from TWinControl) into
an OLE drop target or drop source. It's quite easy, set one or two properties
and write an event handler to provide or handle drag data.

Unfortunately even then there is no drag image while dragging over that control,
only on the VTree itself.

Werner


re: Delphi 6 support

From: Werner Lehmann [wl@b...]
Date: Mon Jul 2, 2001 9:04 am
Subject: Re: [VirtualTreeview] Delphi 6 support

GIANNAKOPOULOS KOSTAS wrote:
>
> Other than that, the only issue is that you get a warning about the unit
> being specific to a platform (probably because of the drag&drop stuff) which
> i don't think is an issue at all.

I have no D6 but read in one posting that there is a compiler switch to turn
off these platform warnings. Sadly it must be applied to each unit separately
(according to the posting).

Werner

 | Replies | Author | Date
2884 | Re: Delphi 6 support | Mike Lischke | Wed 7/4/2001


Aligning problem.

From: "Mark Dekker" [m.dekker@a...]
Date: Mon Jul 2, 2001 1:20 pm
Subject: Aligning problem.

Hi VT-users,

I am using the VT as a grid and it works very well, but i have a problem
with the alignment. Sometimes a column is aligned to the left and sometimes
it is right-aligned or centered. I tried several, but still haven 't any
idea if it is possible to set the aligment. VT is a great component, so such
thing as aligning has to be possible...
Does anybody know which property controls the aligment or where to do this?
Thanx a lot already!

Kind Regards,
Mark.

 | Replies | Author | Date
2847 | Re: Aligning problem. | Roland | Mon 7/2/2001
2885 | Re: Aligning problem. | Mike Lischke | Wed 7/4/2001


re: Delphi 6 support

From: "Vadim Sedulin" [wsntrl@o...]
Date: Mon Jul 2, 2001 12:44 pm
Subject: Re: [VirtualTreeview] Delphi 6 support

Hello Werner!

>> Other than that, the only issue is that you get a warning about the unit
>> being specific to a platform (probably because of the drag&drop stuff)
which
>> i don't think is an issue at all.
>
> I have no D6 but read in one posting that there is a compiler switch to
turn
> off these platform warnings.

Yes. It is {$WARN SYMBOL_DEPRECATED OFF} and {$WARN SYMBOL_PLATFORM OFF}.

Bye.

Vadim Sedulin
E-Mail: [wsntrl@o...]


Multi-line columns

From: GIANNAKOPOULOS KOSTAS [kyan@s...]
Date: Mon Jul 2, 2001 1:33 pm
Subject: Multi-line columns

Is it possible to have one or more columns of a VT draw multiple line text
correctly?

I've tried setting node height upon node initialization to the height of the
multiline text but the text in the multi-line cell always starts from the
center of the cell instead of the its top.

has anyone done this? Do you know how it is done?

Thanks.

<KY>

 | Replies | Author | Date
2848 | Re: Multi-line columns | Werner Lehmann | Mon 7/2/2001
2855 | Re: Multi-line columns | [pdagosta@c...] | Tue 7/3/2001
2886 | Re: Multi-line columns | Mike Lischke | Wed 7/4/2001


[no subject]

From: [agallero@n...]
Date: Mon Jul 2, 2001 3:03 pm
Subject:

Hello,
Just reporting 3 leaks detected with memproof

1)----------------------------------------------
procedure TBaseVirtualTree.GetNativeClipboardFormats(var Formats:
TFormatArray);
.
.
.
begin
.
.
.
List := TStringList.Create; // Missing List.Free!!!
.
.
.
end;

2)------------------------------------------------
The procedure TClipboardFormatList.Clear

should call finalize or set PClipboardFormatListEntry(FList
[I]).Description='' before disposing. If not the long
string "Description" doesn't free.

3)-------------------------------------------------
This one I can not find out where is, because I really dont know the
internals of the clipboard handling, but report it just in case
someone wants to give a look

In the procedure TVTDataObject.GetData, sometimes the line

Medium.hGlobal := GlobalAlloc(GHND or GMEM_SHARE, SizeOf
(TVTReference));

reports as getting memory that is not freed. Sorry I cant help more,
but its impossible for me now.

Thats it.
Best regards and thanks for everything,
Adrian.

 | Replies | Author | Date
2887 | Re: (unknown) | Mike Lischke | Wed 7/4/2001


re: Aligning problem.

From: "Roland" [Beduerftig@S...]
Date: Mon Jul 2, 2001 4:36 pm
Subject: Re: Aligning problem.

Hi Mark,

> Does anybody know which property controls the aligment or where to
> do this?

click on object-inspector at
- "+" Header
- dopple-click at columns
- choise a column
and how you see in the top "Alignment" as a combobox, and this is
seperat for each column.

Roland


re: Multi-line columns

From: Werner Lehmann [wl@b...]
Date: Mon Jul 2, 2001 11:42 pm
Subject: Re: [VirtualTreeview] Multi-line columns

GIANNAKOPOULOS KOSTAS wrote:
>
> Is it possible to have one or more columns of a VT draw multiple line text
> correctly?
>
> I've tried setting node height upon node initialization to the height of the
> multiline text but the text in the multi-line cell always starts from the
> center of the cell instead of the its top.
>
> has anyone done this? Do you know how it is done?

There is an alignment field in the virtual node record and a property
NodeAlignment.
Maybe this is what you are looking for. Although I am not sure how you would
make
VTree draw multiline text without drawing it youself (if you did that you would
have
full control about the text position anyway).

Werner


re: Next Version of VET Change Feedback

From: "Jim Kueneman" [jimdk@m...]
Date: Tue Jul 3, 2001 12:42 am
Subject: RE: Next Version of VET Change Feedback

Hi Kostas,

t is important that NO published property with the name "X" appears in
the
component. If there is it will be streamed by the standard mechanism
and
your "DefineProperties" will do nothing.

Dooh! That is what I was blanking out on. I read a few reference
books and started to understand but I kept thinking "but the VCL
already knows how to read that property why would it call
DefineProperties?" That is the piece I was missing, UNpublish the
property.

I am still struggling if I should go to the trouble. Maybe I will put
it to a vote?

Will anyone be too mad if :

1) VisibleColumns property vanishes and after a few error messages
you have to rebuild the columns through the Header.Columns editor
(like in VT)
2) The VETColumnColors vanishes and again after a few error messages
the colors will need to be reset as the above.
3) The OnGetVETText for custom columns changes a bit (it will be
clear why when you see the new Column decendant that is used in the
Column editor).

I think the replies should be put on the VET group

http://groups.yahoo.com/group/VirtualExplorerTree/messages

to keep from cluttering this one (besides it looks so empty over
there <g>).

As Kostas has shown me I could read in the two properties and build
the columns and then not write them back so it will be a
semi-transparent upgrade (the event will change) but it I can't see
putting the time and effort (remember it is my free time <g>) in if it
will only benifit a few.

Thanks,
Jim


IsVisible

From: [MJLeaver@n...]
Date: Tue Jul 3, 2001 4:58 am
Subject: IsVisible

I have nodes that relate to the same information in the database, so
that when one is updated I go through the tree and apply updates to
the others (I guess I could have the Node Data point to same address?
Not sure how easy it is to implement it that way though).

I use IsVisible to check if I need to update a node. Is there such a
thing as IsInitialised without forcing a node to be initialised? i.e.
if its not initialised already then I don't update the node.

 | Replies | Author | Date
2851 | Re: IsVisible | Werner Lehmann | Tue 7/3/2001


re: IsVisible

From: Werner Lehmann [wl@b...]
Date: Tue Jul 3, 2001 6:22 am
Subject: Re: [VirtualTreeview] IsVisible

[MJLeaver@n...] wrote:
>
> I have nodes that relate to the same information in the database, so
> that when one is updated I go through the tree and apply updates to
> the others (I guess I could have the Node Data point to same address?
> Not sure how easy it is to implement it that way though).

Absolutely. You would only have to call Invalidate after you changed
the data *once*. They way to go IMO.

> I use IsVisible to check if I need to update a node. Is there such a
> thing as IsInitialised without forcing a node to be initialised? i.e.

if vsInitialized in Node.States then

> if its not initialised already then I don't update the node.

You may also want to take a look at GetNextNoInit().

Werner


re: (unknown)

From: GIANNAKOPOULOS KOSTAS [kyan@s...]
Date: Tue Jul 3, 2001 9:23 am
Subject: RE: [VirtualTreeview] (unknown)

> 2)------------------------------------------------
> The procedure TClipboardFormatList.Clear
>
> should call finalize or set PClipboardFormatListEntry(FList
> [I]).Description='' before disposing. If not the long
> string "Description" doesn't free.

This is not true according to Borland Help. It is clearly stated that
Finalize() WILL be called when memory is deallocated with a call to
Dispose(). A look in magic function _Dispose in unit System.pas will
convince you.

I think that memproof has gotten this wrong.

<KY>

 | Replies | Author | Date
2876 | Re: (unknown) | [agallero@n...] | Wed 7/4/2001


Deleting underlynig data

From: "Boris Semenko" [boriss@v...]
Date: Tue Jul 3, 2001 9:48 am
Subject: Deleting underlynig data

Hi,

When I delete a node all its children are deleted automatically. How can I
delete underlying databse data of children?

[Non-text portions of this message have been removed]

 | Replies | Author | Date
2857 | Re: Deleting underlynig data | Werner Lehmann | Tue 7/3/2001


dynamic aligning problem & freeing memory

From: "Mark Dekker" [m.dekker@a...]
Date: Tue Jul 3, 2001 1:06 pm
Subject: dynamic aligning problem & freeing memory

Hi Roland & others,

I don 't want to create the columns at designtime, but i 'd like to create
these columnheaders dynamically. I tried to change the Layout property of
the columns (blGlyphLeft, blGlyphBottom, blGlyphRight, blGlyphTop), but that
didn 't change the columns that much. I am using the VT as a grid and i 'd
like to align the numeric values most right in the column and alphanumerical
values to the left. Each rootnode contains the data for one row in the VT as
a grid. It works perfect, but the aligment is a mess. Some columns are left
aligned, some right or centered. Is there a property / function / event of
the VT, which sets the aligment of the columns?
I add my own data in each node, do i also have to free this data when the VT
has been cleared? Or does VT arrange this memory free-ing?

Thanx already again...
This mailinglist is awesome!

Kind Regards,

Mark Dekker.

 | Replies | Author | Date
2859 | Re: dynamic aligning problem & freeing memory | Teus de Jong | Tue 7/3/2001
2868 | Re: dynamic aligning problem & freeing memory | Roland | Wed 7/4/2001
2888 | Re: dynamic aligning problem & freeing memory | Mike Lischke | Wed 7/4/2001


re: Multi-line columns

From: [pdagosta@c...]
Date: Tue Jul 3, 2001 12:11 pm
Subject: Re: [VirtualTreeview] Multi-line columns

Is it possible to have one or more columns of a VT draw multiple line text
correctly?

has anyone done this? Do you know how it is done?

I created a descendant class of TCustomStringTree that allows for *simple*
multi-row nodes.
In essence I added an event to fetch the number of rows for the current
node to be painted. I also added an event to get multi-row text (same as
OnGetText but with a row parameter). Overriding the paint events I added
a for loop to process each row by modifying the Text Rectangle (NodeHeight
div RowCount). There are limitations to this approach. I don't have
editable fields, so i didn't even look at how to incorporate this with
anything other than displaying.

I personally would like to see future built-in support for multi-line
nodes in VT

******************************************************************
This communication is for informational purposes only. It is not
intended as an offer or solicitation for the purchase or sale of
any financial instrument or as an official confirmation of any
transaction, unless specifically agreed otherwise. All market
prices, data and other information are not warranted as to
completeness or accuracy and are subject to change without
notice. Any comments or statements made herein do not
necessarily reflect the views or opinions of Capital Institutional
Services, Inc. Capital Institutional Services, Inc. accepts no
liability for any errors or omissions arising as a result of
transmission. Use of this communication by other than intended
recipients is prohibited.
******************************************************************


Focus problems

From: [rkarpin1@i...]
Date: Tue Jul 3, 2001 2:11 pm
Subject: Focus problems

Hello,

I want to write about two problems with focus changing:

1. If I write 'FocusedNode := nodeF;' then focus of nodeF is not good
displaying: focus frame is set on nodefF but blue background not. I
think it should be call OnChange event.

2. After OnFocusChanging, if I write 'Allowed := False;' (in service
function) then focus is disappear.

 | Replies | Author | Date
2866 | Re: Focus problems | Bender Heri | Wed 7/4/2001
2867 | Re: Focus problems | Roland | Wed 7/4/2001


re: Deleting underlynig data

From: Werner Lehmann [wl@b...]
Date: Tue Jul 3, 2001 2:46 pm
Subject: Re: [VirtualTreeview] Deleting underlynig data

Boris Semenko wrote:
>
> Hi,
>
> When I delete a node all its children are deleted automatically. How can I
delete underlying databse data of children?

Use OnFreeNode or remove/free the data before you delete the parent node.

Werner


VSTEdit Error

From: "Frank van den Bergh" [frankvdbergh@y...]
Date: Tue Jul 3, 2001 2:43 pm
Subject: VSTEdit Error

Hi Manfred, ???,

When you use a dropdown list, click on it (so it will pop up) and
then do a tree collapse, the dropdown list remains visible.

When you do a hide command inmediately after the collapse, than it
will function ok.

Good luck,

Frank van den Bergh.


re: dynamic aligning problem & freeing memory

From: "Teus de Jong" [teusjdejong@p...]
Date: Tue Jul 3, 2001 8:41 pm
Subject: Re: [VirtualTreeview] dynamic aligning problem & freeing memory

Hi Mark,

> I don 't want to create the columns at designtime, but i 'd like to create
> these columnheaders dynamically. I tried to change the Layout property of
> the columns (blGlyphLeft, blGlyphBottom, blGlyphRight, blGlyphTop), but
that
> didn 't change the columns that much. I am using the VT as a grid and i 'd
> like to align the numeric values most right in the column and
alphanumerical
> values to the left. Each rootnode contains the data for one row in the VT
as
> a grid. It works perfect, but the aligment is a mess. Some columns are
left
> aligned, some right or centered. Is there a property / function / event of
> the VT, which sets the aligment of the columns?

You can align columns with:

Header.Columns[x].Alignment:=taRightJustify;

> I add my own data in each node, do i also have to free this data when the
VT
> has been cleared? Or does VT arrange this memory free-ing?

If you store your data in the tree, you have to free them in the
OnFreeNode-event;

Teus de Jong.

 | Replies | Author | Date
2868 | Re: dynamic aligning problem & freeing memory | Roland | Wed 7/4/2001


VET bug in CreateNewFolder method ?

From: [FRiviR2@a...]
Date: Tue Jul 3, 2001 8:55 pm
Subject: VET bug in CreateNewFolder method ?

Hi Jim,

with VET 1.4.35, I've got a bug when I create a new folder using the
(old) method CreateNewFolder : the new folder is created right, but
it doesn't toggle to the edit mode automatically to change its name,
like it did in the previous version... It stays with the built-in
name "New folder x", and gone selected, and that's all.

Any suggestions ?

Thanks,

François Rivierre


Change Header Color ?

From: [x_gate@h...]
Date: Tue Jul 3, 2001 11:02 pm
Subject: Change Header Color ?

Hi!
Is it possible to change the header color ? (not the background of
the header).

Thanks

 | Replies | Author | Date
2889 | Re: Change Header Color ? | Mike Lischke | Wed 7/4/2001
2894 | Re: Change Header Color ? | [x_gate@h...] | Wed 7/4/2001
2938 | Re: Change Header Color ? | Mike Lischke | Sat 7/7/2001
2951 | Re: Change Header Color ? | [x_gate@h...] | Sun 7/8/2001


Drag & Drop in 2.5.1

From: [MJLeaver@n...]
Date: Wed Jul 4, 2001 3:17 am
Subject: Drag & Drop in 2.5.1

After spending a *long* time and a lot of effort getting drag & drop
to work in VT 2.4.21, I'm now struggling to get it working in 2.5.1.

I want to drag from the tree to the desktop, using the
CFSTR_SHELLIDLIST format.

In OnGetUserClipboardFormats I add the registered clipboard value to
the end of the Formats array. Is this correct?

I've a dummy OnRenderOLEData that never gets called, which is
probably why its not working.

In OnCreateDragManager I create a descendant TVTDragManager object.
Problem is I had two overloaded functions in there (RenderData and
SetOLEFormats), neither of which can now compile (because TOLEFormats
does not exist, and RenderData is not found in the base class). The
SetOLEFormats is now (I guess) handlded by OnGetUserClipboardFormats.
I guess RenderData is handled by OnRenderOLEData.

Two questions. One, how do I now get it to work in this new version.
Two, can we please stop changing the drag & drop interface in VT!

 | Replies | Author | Date
2863 | Re: Drag & Drop in 2.5.1 > ATTN: Mike a Bug | Jim Kueneman | Wed 7/4/2001


re: Drag & Drop in 2.5.1 > ATTN: Mike a Bug

From: "Jim Kueneman" [jimdk@m...]
Date: Wed Jul 4, 2001 4:36 am
Subject: Re: Drag & Drop in 2.5.1 > ATTN: Mike a Bug

--- In [VirtualTreeview@y...], [MJLeaver@n...] wrote:
>
> Two questions. One, how do I now get it to work in this new version.
> Two, can we please stop changing the drag & drop interface in VT!

It is super simple now the next change would make it so we would not
have to code anything! Toss out all of the IDragManager stuff.

Now, if Mike would not insert bugs into the code!

Jim

;;;;;;;;;;;;;;;;;;;;;

Find

{ START BUG FIX }
procedure TBaseVirtualTree.DoGetUserClipboardFormats(Formats:
TFormatArray);

in the VirtualTrees.pas file.

make it a var parameter

procedure TBaseVirtualTree.DoGetUserClipboardFormats(var Formats:
TFormatArray);

{ END BUG FIX }

Then:

var
CF_SHELLIDLIST = Word;

procedure TForm1.VirtualStringTree1.GetUserClipboardFormats(
Sender: TBaseVirtualTree; var Formats: TFormatArray);
var
i: integer;
begin
i := Length(Formats);
SetLength(Formats, i + 1);
Formats[i] := CF_SHELLIDLIST;
end;

procedure TForm1.VirtualStringTree1RenderOLEData(Sender:
TBaseVirtualTree;
const FormatEtcIn: tagFORMATETC; out Medium: tagSTGMEDIUM;
ForClipboard: Boolean; var Result: HRESULT);
begin
if FormatEtcIn.cfFormat = CF_SHELLIDLIST then
begin
{Create the Shell ID List array here and set up the Medium to the
global memory handle}
end;
end;

initialization
CF_SHELLIDLIST = RegisterClipboardFormat(CFSTR_SHELLIDLIST);

// ALTERNATIVE METHOD

This is how Mike initially wanted to do this (GetUserClipboardFormats
is brand new this release, thank you Mike)

Add this to the VirtualTree.pas initialization section:

var
CF_SHELLIDLIST = Word;

initialization

CF_SHELLIDLIST := RegisterVTClipboardFormat(CFSTR_SHELLIDLIST,
TCustomVirtualStringTree, 0);

Now recompile the package. You now have the format in the Object
Inspector to turn on or off.

I don't like this because you have to rememeber to do it after every
VT update.


New file uploaded to VirtualTreeview

From: [VirtualTreeview@yahoogroups.com>
Date: Wed Jul 4, 2001 5:01 am
Subject: New file uploaded to VirtualTreeview

Hello,

This email message is a notification to let you know that
a file has been uploaded to the Files area of the VirtualTreeview
group.

File : /VET_V1.5.1.zip
Uploaded by : [jimdk@m...]
Description : Virtual Explorer Tree Version 1.5.1 with Demo Executable

You can access this file at the URL

http://groups.yahoo.com/group/VirtualTreeview/files/VET_V1.5.1.zip

To learn more about file sharing for your group, please visit

http://help.yahoo.com/help/us/groups/files

Regards,

jimdk@m...]


VET Version 1.5.1

From: Jim Kueneman [jimdk@m...]
Date: Wed Jul 4, 2001 5:14 am
Subject: VET Version 1.5.1

Hi All,

The big thing here is that columns are now supported through the object
inspector, and some bug fixes.

You will get stream errors when forms with VET are opened due to the
missing properties. Sorry but I think the ease of the Column Property
editor will make the pain of changing over quickly fade.

- Enough changes to increment the minor version number.
- Auto Edit Select for CreateNewFolder broken with last VT release -
fixed.
- Implemented the Columns using the new mechinism in VT which
allows decendants of TVirtualColumn to be created. because of this Header
is now published and it is possible to manipulate the Column Details in
the the Object Inspector!!!!!!

- EFFECTS TO CURRENT VET USERS
1) The VET Column Colors properties under VETColors is gone, it can be done
through the Header property like VT.
2) The VisibleColumns property is gone. Use the Column Editor through the
Header Property to create new columns and assign what detail required
through the ColumnDetails property in each column.
3) Custom Columns are a bit different. The ONLY time OnGetVETText is called
is if the ColumnDetails is set to cdCustom. To do this at runtime you will
have to cast the TVirtualColumn to a TVETColumn:

(VirtualExplorerTree.Header.Columns[0] as TVETColumn).ColumnDetails :=
cdCustom;

As a result of this the Handled parameter has been removed so it is
necessary to change the Event declaration.

- Updated the Demo to reflect the new changes to the Columns.
- Fixed another bug with Views and HideRootNode mode,
WalkPIDLToNode should not return the RootNode
- Published NodeDataSize so apps can attach custom data to a node.

Enjoy
Jim


re: Focus problems

From: Bender Heri [HBender@E...]
Date: Wed Jul 4, 2001 8:14 am
Subject: RE: [VirtualTreeview] Focus problems

> 1. If I write 'FocusedNode := nodeF;' then focus of nodeF is not good
> displaying: focus frame is set on nodefF but blue background not. I
> think it should be call OnChange event.

I had the same problem. You must set also selected to have the blue
background. Focus only draws the rectangle, the selction draws the blue
background.

Heri

 | Replies | Author | Date
2867 | Re: Focus problems | Roland | Wed 7/4/2001


re: Focus problems

From: "Roland" [Beduerftig@S...]
Date: Wed Jul 4, 2001 9:19 am
Subject: Re: Focus problems

> > 1. If I write 'FocusedNode := nodeF;' then focus of nodeF is
> > not good displaying: focus frame is set on nodefF but blue
> > background not. I think it should be call OnChange event.
>
> I had the same problem. You must set also selected to have the blue
> background. Focus only draws the rectangle, the selction draws the
> blue background.

I write following small functions:

void SetFirstNodeActive(TBaseVirtualTree* Tree) {
Tree->SetFocus();
TVirtualNode* Node = Tree->GetFirst();
if (Node != NULL) {
Tree->FocusedNode = Node;
Tree->Selected[Node] = true;
}
}
//--------------------------------------------------------

void SetNodeActive(TBaseVirtualTree* Tree, TVirtualNode* Node) {
if (Node == NULL) return;
Tree->SetFocus();
Tree->FocusedNode = Node;
Tree->Selected[Node] = true;
}
//--------------------------------------------------------

Bye
Roland


re: dynamic aligning problem & freeing memory

From: "Roland" [Beduerftig@S...]
Date: Wed Jul 4, 2001 9:25 am
Subject: Re: dynamic aligning problem & freeing memory

Hi Mark,

> > I don 't want to create the columns at designtime, but i 'd like
> > to create these columnheaders dynamically. I tried to change the
> > Layout property of
> > ......
> > like to align the numeric values most right in the column and
> > alphanumerical values to the left. Each rootnode contains the
> > data for one row in the VT as a grid. It works perfect, but the
> > aligment is a mess. Some columns are left
> > aligned, some right or centered. Is there a property / function /
> > event of the VT, which sets the aligment of the columns?
>
> You can align columns with:
>
> Header.Columns[x].Alignment:=taRightJustify;

You can use OnPaintEvent to modify your output, and have a look to
source of VT, to understand the following code:

procedure TForm1.Tree1PaintText(Sender: TBaseVirtualTree;
const Canvas: TCanvas; Node: PVirtualNode; Column: Integer;
TextType: TVSTTextType);
var R: TRect; DrawFormat: Cardinal; Text: WideString;
begin
R := Canvas.ClipRect;
TestRec := Tree1.GetNodeData(Node);
DrawFormat := DT_SINGLELINE OR DT_LEFT;
Text := TestRec.Name;
DrawTextW(Canvas.Handle, PWideChar(Text), Length(Text), R,
DrawFormat, False);
end;

this is only an idea not a full fixed code !

Bye
Roland


Small bug in VT 2.5.1 -> ContentTo...

From: "Ralf Melles" [rmelles@g...]
Date: Wed Jul 4, 2001 12:38 pm
Subject: Small bug in VT 2.5.1 -> ContentTo...

Hi Mike,

I´ve found a small bug (Virtual Tree 2.5.1)
in "TCustomVirtualStringTree.GetRenderStartValues" (Line: 22828). For
tstAll you have to use:

Node := GetFirst;
NextNodeProc := GetNext;

I love this Component, it´s so exiting...

 | Replies | Author | Date
2890 | Re: Small bug in VT 2.5.1 -> ContentTo... | Mike Lischke | Wed 7/4/2001


re: problems with icons

From: [ian.yahoogroups@a...]
Date: Wed Jul 4, 2001 2:25 pm
Subject: Re: problems with icons

--- In [VirtualTreeview@y...], "Mike Lischke" [public@l...] wrote:
> Moritz,
>
> > i have moved from 1.31 to 2.4, and now all icons with index >= 4
are
> > overlapped with icon 0 !?
>
> I bet you have an OnGetImageIndex event handler which does not
check the type of the image to
> return. This can be ikNormal, ikSelected and ikState.
>
> Ciao, Mike

What does this mean? i want it to draw the image i specified - no
matter what type of image it wants. i set the ImageIndex to something
greater than 4 in for all kinds - it still won't draw the one i say.

i've tried checking the Kind it wants, but it doesn't fix it

procedure TForm.VirtualTreeViewGetImageIndex(...);
var
ImageIndexToReallyUse: integer;
begin
ImageIndexToReallyUse := 10;

case Kind of
ikNormal: Index := ImageIndexToReallyUse;
ikSelected: Index := ImageIndexToReallyUse;
ikState: Index := ImageIndexToReallyUse;
ikOverlay: Index := ImageIndexToReallyUse;
else
Index := ImageIndexToReallyUse;
end;

 | Replies | Author | Date
2872 | Re: problems with icons | Jim Kueneman | Wed 7/4/2001


Strange behaviour by scrolling the tree

From: "Zoltan Hubai" [hubaiz@e...]
Date: Wed Jul 4, 2001 2:45 pm
Subject: Strange behaviour by scrolling the tree

Hi Mike!

I write once but you not answered my question, please this time answere me.
I use the TVirtualDrawTree component to display my data in a grid like
form. I have about 13000 records and 8 columns. My data is mostly text. In
one column I have text with more lines - wordwrap - so I use the
TVirtualDrawTree and the windows DrawTextEx function to display my text in
more then a one line. When I load the data I use the AddChild(nil) function
to add the node, after adding the node and loading the node data I use the
DrawTextEx function with the CALCRECT flag to calculate the node height and
I set it with the NodeHeight[Node] property.
Ok, thats all works fine but at some stages when I scroll the data (cursor,
pagedn/up, scrollbars) when i use the FocusedNode property I got the right
node but on display I have somthing else. When I make on any node with
childs a Colapse and right after that an Expand this strange behaviour is
gone, FocusedNode = node displayed on the grid.
Can you help me?

Zoltan

Sorry about poor english.

 | Replies | Author | Date
2873 | Re: Strange behaviour by scrolling the tree | Jim Kueneman | Wed 7/4/2001
2874 | Re: Strange behaviour by scrolling the tree | [hubaiz@e...] | Wed 7/4/2001
2875 | Re: Strange behaviour by scrolling the tree | Jim Kueneman | Wed 7/4/2001
2891 | Re: Strange behaviour by scrolling the tree | Mike Lischke | Wed 7/4/2001


re: Re: problems with icons

From: Jim Kueneman [jimdk@m...]
Date: Wed Jul 4, 2001 2:51 pm
Subject: Re: [VirtualTreeview] Re: problems with icons

At 02:25 PM 7/4/2001 +0000, you wrote:
>--- In [VirtualTreeview@y...], "Mike Lischke" [public@l...] wrote:
> > Moritz,
> >
> > > i have moved from 1.31 to 2.4, and now all icons with index >= 4
>are
> > > overlapped with icon 0 !?
> >
> > I bet you have an OnGetImageIndex event handler which does not
>check the type of the image to
> > return. This can be ikNormal, ikSelected and ikState.
> >
> > Ciao, Mike
>
>What does this mean? i want it to draw the image i specified - no
>matter what type of image it wants. i set the ImageIndex to something
>greater than 4 in for all kinds - it still won't draw the one i say.
> case Kind of
> ikNormal: Index := ImageIndexToReallyUse;
> ikSelected: Index := ImageIndexToReallyUse;
> ikState: Index := ImageIndexToReallyUse;
> ikOverlay: Index := ImageIndexToReallyUse;
> else
> Index := ImageIndexToReallyUse;
> end;

Only respond to ikNormal and ikSelected;

case Kind of
ikNormal, ikSelected: Index := ImageIndexToReallyUse;
end;

else don't change the value (expecially overlay, an image list can only
have 3 or 4 overlays)

Jim


re: Strange behaviour by scrolling the tree

From: Jim Kueneman [jimdk@m...]
Date: Wed Jul 4, 2001 2:53 pm
Subject: Re: [VirtualTreeview] Strange behaviour by scrolling the tree

At 04:45 PM 7/4/2001 +0200, you wrote:
>Hi Mike!
>childs a Colapse and right after that an Expand this strange behaviour is
>gone, FocusedNode = node displayed on the grid.
> Can you help me?

What version of VT are you using?

Jim

 | Replies | Author | Date
2874 | Re: Strange behaviour by scrolling the tree | [hubaiz@e...] | Wed 7/4/2001
2875 | Re: Strange behaviour by scrolling the tree | Jim Kueneman | Wed 7/4/2001


re: Strange behaviour by scrolling the tree

From: [hubaiz@e...]
Date: Wed Jul 4, 2001 3:51 pm
Subject: Re: Strange behaviour by scrolling the tree

--- In [VirtualTreeview@y...], Jim Kueneman [jimdk@m...] wrote:
> At 04:45 PM 7/4/2001 +0200, you wrote:
> >Hi Mike!
> >childs a Colapse and right after that an Expand this strange
behaviour is
> >gone, FocusedNode = node displayed on the grid.
> > Can you help me?
>
> What version of VT are you using?
>
> Jim

I try it with 2.5.1 but I got the same results

 | Replies | Author | Date
2875 | Re: Strange behaviour by scrolling the tree | Jim Kueneman | Wed 7/4/2001


re: Re: Strange behaviour by scrolling the tree

From: Jim Kueneman [jimdk@m...]
Date: Wed Jul 4, 2001 4:09 pm
Subject: Re: [VirtualTreeview] Re: Strange behaviour by scrolling the tree

At 03:51 PM 7/4/2001 +0000, you wrote:
>--- In [VirtualTreeview@y...], Jim Kueneman [jimdk@m...] wrote:
> > At 04:45 PM 7/4/2001 +0200, you wrote:
> > >Hi Mike!
> > >childs a Colapse and right after that an Expand this strange
>behaviour is
> > >gone, FocusedNode = node displayed on the grid.
> > > Can you help me?
> >
> > What version of VT are you using?
> >
> > Jim
>
>I try it with 2.5.1 but I got the same results

Can you reduce it to a small sample program that reproduces the problem and
post it to the files area?

Jim


re: (unknown)

From: [agallero@n...]
Date: Wed Jul 4, 2001 3:33 pm
Subject: Re: (unknown)

Opps.. my mistake. The undeallocated strings are the same that are
created in the stringlist I mention in first place.

The problem was that those strings were allocated in the
TClipboardFormatList.Create, but their reference count didnt decrease
to 0, not because the dispose, but because the stringlist.

Thanks,
adrian

> This is not true according to Borland Help. It is clearly stated
that
> Finalize() WILL be called when memory is deallocated with a call to
> Dispose(). A look in magic function _Dispose in unit System.pas will
> convince you.
>
> I think that memproof has gotten this wrong.
>
> <KY>


CustomStringTree descendant with Datasource...

From: "S%ffbastien Morin" [smsisko@s...]
Date: Wed Jul 4, 2001 5:17 pm
Subject: CustomStringTree descendant with Datasource...

I've tried to create a StringTree descendant that is associated with
a datasource, but I've run into a problem.

At first I mad myself a test project with a dataset and when I turned
the dataset active I would, initialize the columns of the and set the
RootNodeCount of the tree to the number of row of my dataset, and in
the OnGetText event I went and took the data from the right row in my
Dataset... And this worked really good.

But now I'm trying to do it in a component so basicaly I do the same
thing using a datalink descendant for my datasource and when I
activate the datasource I initialize the columns and RootNodeCount
just as I did before. For the text of the node I overrided the
DoGetText procedure and it kind of works... I have some problem when
I scroll horizontaly or when I resize the data the text is not
redrawn until I click in a row, then everything goes back to normal.

I don't understand, why it should do that... I tried to change the
DoGetText for a OnGetText event, but the problems stays...

Anybody as an idea ?

Thanks

Sebastien Morin
[smsisko@s...]

 | Replies | Author | Date
2878 | Re: CustomStringTree descendant with Datasource.. | Jim Kueneman | Wed 7/4/2001
2879 | Re: CustomStringTree descendant with Datasource.. | S%ffbastien Morin | Wed 7/4/2001
2903 | Re: CustomStringTree descendant with Datasource.. | Jim Kueneman | Thu 7/5/2001
2906 | Re: CustomStringTree descendant with Datasource.. | S%ffbastien Morin | Thu 7/5/2001


re: CustomStringTree descendant with Datasource...

From: Jim Kueneman [jimdk@m...]
Date: Wed Jul 4, 2001 7:29 pm
Subject: Re: [VirtualTreeview] CustomStringTree descendant with Datasource...

At 05:17 PM 7/4/2001 +0000, you wrote:

>I don't understand, why it should do that... I tried to change the
>DoGetText for a OnGetText event, but the problems stays...

Make sure you are calling inherited on any method you are overriding.

Jim

 | Replies | Author | Date
2879 | Re: CustomStringTree descendant with Datasource.. | S%ffbastien Morin | Wed 7/4/2001
2903 | Re: CustomStringTree descendant with Datasource.. | Jim Kueneman | Thu 7/5/2001
2906 | Re: CustomStringTree descendant with Datasource.. | S%ffbastien Morin | Thu 7/5/2001


re: CustomStringTree descendant with Datasource...

From: "S%ffbastien Morin" [smsisko@s...]
Date: Wed Jul 4, 2001 7:38 pm
Subject: Re: CustomStringTree descendant with Datasource...

--- In [VirtualTreeview@y...], Jim Kueneman [jimdk@m...] wrote:
> At 05:17 PM 7/4/2001 +0000, you wrote:
>
> >I don't understand, why it should do that... I tried to change the
> >DoGetText for a OnGetText event, but the problems stays...
>
> Make sure you are calling inherited on any method you are
overriding.
>
> Jim

That doesn't seem the bo the problem, but thanks

Sebastien Morin
[smsisko@s...]

 | Replies | Author | Date
2903 | Re: CustomStringTree descendant with Datasource.. | Jim Kueneman | Thu 7/5/2001
2906 | Re: CustomStringTree descendant with Datasource.. | S%ffbastien Morin | Thu 7/5/2001


re: Delphi 6 support

From: "Mike Lischke" [lists@l...]
Date: Wed Jul 4, 2001 8:19 pm
Subject: RE: [VirtualTreeview] Delphi 6 support

> Also, the changes Vadim Sedulin proposed for the property editor WILL make
> VirtualTreesReg.pas compatible with D6.
>
> Other than that, the only issue is that you get a warning about the unit
> being specific to a platform (probably because of the drag&drop stuff) which
> i don't think is an issue at all.

Thank Vadim VT has now checked compatibility to D6 including design and runtime
packages. I will
split the D5 package too and would like to do this also for the D4 package.
Unfortunately I have no
Delphi 4 so could anybody please do this for me and send me both dpk files
([public@l...])?

Ciao, Mike


re: VCL Drag and Drop problems

From: "Mike Lischke" [lists@l...]
Date: Wed Jul 4, 2001 8:22 pm
Subject: RE: [VirtualTreeview] VCL Drag and Drop problems

Will,

> It seems ok. If I drag an image I guess about 200 pixels square, I
> can get CPU usage up to 88% by wiggling, but it isn't getting 'jerky'
> or missing frames as some animations do when they are struggling.
> This on a 500 MHz PIII running W2k and a not particularly clever
> graphics card (an old Diamond).

Mmh, I made my test about 1,5 years ago on a NT4 machine. Could well be the W2K
image list is now
much faster. Still I love the blended image and will stay with the current
implemention for the time
being :o]

Ciao, Mike


re: Saving/Loading VT

From: "Mike Lischke" [lists@l...]
Date: Wed Jul 4, 2001 8:24 pm
Subject: RE: [VirtualTreeview] Saving/Loading VT

Hi TC,

> Hi, I am new here, and very green as far as
> programming is concerned.

Oh fine, then I congratulate you for your decision to use Delphi :o]

> Whereas, when I do not use the OnSaveNode/OnLoadNode
> handlers, the time is only about 6 seconds. And this
> includes loading user data consisting of a short text
> passage for each node, displayed in a richedit when a
> node is clicked.

Can I please see some code fragments of your load and save event handlers?

Ciao, Mike

 | Replies | Author | Date
2898 | Re: Saving/Loading VT | TC Lai | Thu 7/5/2001
2900 | Re: Saving/Loading VT | Jim Kueneman | Thu 7/5/2001
2901 | Re: Saving/Loading VT | Jim Kueneman | Thu 7/5/2001
2940 | Re: Saving/Loading VT | Mike Lischke | Sat 7/7/2001
2915 | Re: Saving/Loading VT | TC Lai | Fri 7/6/2001
2925 | Re: Saving/Loading VT | Jim Kueneman | Sat 7/7/2001
2934 | Re: Saving/Loading VT | [ltchoong@s...] | Sat 7/7/2001
2945 | Re: Saving/Loading VT | Jim Kueneman | Sat 7/7/2001
2955 | Re: Saving/Loading VT | TC Lai | Sun 7/8/2001


re: New file uploaded to VirtualTreeview

From: "Mike Lischke" [lists@l...]
Date: Wed Jul 4, 2001 8:25 pm
Subject: RE: [VirtualTreeview] New file uploaded to VirtualTreeview

Hi Teus,

> I've got one minor issue: in design mode I get several Clipboardformats
> twice (or even more) times

Can only be if a clipboard format is registered several times...

> List := TStringList.Create;
> List.duplicates := dupIgnore; <--

OK, included.

Ciao, Mike


re: Delphi 6 support

From: "Mike Lischke" [lists@l...]
Date: Wed Jul 4, 2001 8:27 pm
Subject: RE: [VirtualTreeview] Delphi 6 support

Werner,

> I have no D6 but read in one posting that there is a compiler switch to turn
> off these platform warnings. Sadly it must be applied to each unit separately
> (according to the posting).

I guess an include file does the job very well. I recommend to use the new
Compilers.inc include
file from VT which is a neutral and generic compiler checker (similar to Brad
Stowers DFS.inc as
used in earlier versions of VT, but with some extra support for Kylix).

Ciao, Mike


re: Aligning problem.

From: "Mike Lischke" [lists@l...]
Date: Wed Jul 4, 2001 8:29 pm
Subject: RE: [VirtualTreeview] Aligning problem.

Hi Mark,

> VT is a great component, so such
> thing as aligning has to be possible...

Of course it has and of course it does :o] Use the Alignment property of the
columns. Keep in mind
to leave the Bidi mode alone if you don't need to have right-to-left text. If
you set RTL bidi mode
with left alignment you will actually get right alignment.

Ciao, Mike


re: Multi-line columns

From: "Mike Lischke" [lists@l...]
Date: Wed Jul 4, 2001 8:32 pm
Subject: RE: [VirtualTreeview] Multi-line columns

Hi Kostas,

> Is it possible to have one or more columns of a VT draw multiple line text
> correctly?

Basically yes, but not generally. The problem is the edit mode and the correct
word wrap which
requires some extra effort for Unicode text.

> I've tried setting node height upon node initialization to the height of the
> multiline text but the text in the multi-line cell always starts from the
> center of the cell instead of the its top.

Currently vertical alignment is set to center (search for DT_VCENTER) which
however does only
correctly work with single line text. But allowing multi-line text is on my
todo list.

Ciao, Mike


re: (unknown)

From: "Mike Lischke" [lists@l...]
Date: Wed Jul 4, 2001 8:34 pm
Subject: RE: [VirtualTreeview] (unknown)

Hi Agallero,

> Just reporting 3 leaks detected with memproof

Thank you, these checks are very important.

> List := TStringList.Create; // Missing List.Free!!!

Oops, how could I forget this?

The other two errors have already been discussed and turned out not to be leaks
in VT.

Ciao, Mike


re: dynamic aligning problem & freeing memory

From: "Mike Lischke" [lists@l...]
Date: Wed Jul 4, 2001 8:43 pm
Subject: RE: [VirtualTreeview] dynamic aligning problem & freeing memory

Mark,

> I don 't want to create the columns at designtime, but i 'd like to create
> these columnheaders dynamically. I tried to change the Layout property of
> the columns (blGlyphLeft, blGlyphBottom, blGlyphRight, blGlyphTop), but that
> didn 't change the columns that much.

The layout describes only how to order text, glyph and sort glyph depending on
bidi mode and
alignment. It does not change the alignment of the column.

>I am using the VT as a grid and i 'd
> like to align the numeric values most right in the column and alphanumerical
> values to the left. Each rootnode contains the data for one row in the VT as
> a grid. It works perfect, but the aligment is a mess. Some columns are left
> aligned, some right or centered. Is there a property / function / event of
> the VT, which sets the aligment of the columns?

I don't understand how this can be a mess. On creation all columns have left
alignment and if you
don't change things then they keep this alinment until earth breaks and hell
opens. Set the column
alignment (TVirtualTreeColumn.Alignment) to taRightJustify for right aligned
content.

> Thanx already again...
> This mailinglist is awesome!

It's exploding. Currently there are 474 members in this list which grows by 3-5
new members every
day. There were days with 20+ new subscriptions and the message flow is
sometimes overwhelming.
Excellent people can be found here like Jim and Werner (both also moderators of
this list) as well
as other really good programmers (some BCB experts among them).

Ciao, Mike


re: Change Header Color ?

From: "Mike Lischke" [lists@l...]
Date: Wed Jul 4, 2001 8:45 pm
Subject: RE: [VirtualTreeview] Change Header Color ?

Hi x_gate,

> Is it possible to change the header color ? (not the background of
> the header).

Only by using owner draw. You can each column header individually either let
draw by the header or
do it in your own code.

Ciao, Mike

 | Replies | Author | Date
2894 | Re: Change Header Color ? | [x_gate@h...] | Wed 7/4/2001
2938 | Re: Change Header Color ? | Mike Lischke | Sat 7/7/2001
2951 | Re: Change Header Color ? | [x_gate@h...] | Sun 7/8/2001


re: Small bug in VT 2.5.1 -> ContentTo...

From: "Mike Lischke" [lists@l...]
Date: Wed Jul 4, 2001 8:46 pm
Subject: RE: [VirtualTreeview] Small bug in VT 2.5.1 -> ContentTo...

Hi Ralf,

> I´ve found a small bug (Virtual Tree 2.5.1)
> in "TCustomVirtualStringTree.GetRenderStartValues" (Line: 22828). For
> tstAll you have to use:
> Node := GetFirst;
> NextNodeProc := GetNext;

Ah yes, this was not changed when I took in the tstVisible flag. Fixed.

> I love this Component, it´s so exiting...

:o] Great to hear. Spread the word ...

Ciao, Mike


re: Strange behaviour by scrolling the tree

From: "Mike Lischke" [lists@l...]
Date: Wed Jul 4, 2001 8:49 pm
Subject: RE: [VirtualTreeview] Strange behaviour by scrolling the tree

Hi Zoltan,

> I write once but you not answered my question, please this time answere me.

I'm sorry. Your last message must have been undergone in the daily load I have.

> Ok, thats all works fine but at some stages when I scroll the data (cursor,
> pagedn/up, scrollbars) when i use the FocusedNode property I got the right
> node but on display I have somthing else. When I make on any node with
> childs a Colapse and right after that an Expand this strange behaviour is
> gone, FocusedNode = node displayed on the grid.

Mmh, difficulat to say what this could be. Can you make me very simple program
which shows the
strange effect nicely and send it to me ([public@l...])?

Ciao, Mike


TopNode and EndUpdate

From: "Jim Kueneman" [jimdk@m...]
Date: Wed Jul 4, 2001 8:54 pm
Subject: TopNode and EndUpdate

Hi Mike,

I have noticed that it is not possible to set the TopNode within a
Begin/EndUpdate block and have it work. Is this by design? I have
stepped through it and see why but I am not sure how to change it
without messing something else up.

I tends to make this call "slow" (it is tough to call anything VT does
slow) expecially if Animate Expand it on and the TopNode is collapsed.

Jim

 | Replies | Author | Date
2937 | Re: TopNode and EndUpdate | Mike Lischke | Sat 7/7/2001
2948 | Re: TopNode and EndUpdate | Jim Kueneman | Sat 7/7/2001
2971 | Re: TopNode and EndUpdate | Mike Lischke | Sun 7/8/2001


ManualSpanColumns?

From: [duke_n5@h...]
Date: Wed Jul 4, 2001 9:06 pm
Subject: ManualSpanColumns?

I need to do the thingy that the voAutoSpanColumns does, but I need
to do it only to a few nodes - not all of them.

How to?

 | Replies | Author | Date
2895 | Re: ManualSpanColumns? | Werner Lehmann | Thu 7/5/2001
2896 | Re[2]: ManualSpanColumns? | [duke_n5@h...] | Thu 7/5/2001


re: Change Header Color ?

From: [x_gate@h...]
Date: Wed Jul 4, 2001 10:18 pm
Subject: Re: Change Header Color ?

> Only by using owner draw. You can each column header individually
either let draw by the header or
> do it in your own code.

Hi Mike,
Thanks it worked!
Now is it possible to add another style to be flat(2D) at all ? I
mean you have an option to be flat(2D) but when you move the mouse
over the header it changes to "Flat Button" ... I want to stay flat
instead putting a "soft border" around it ... Is it possible to
override the border with the "ownerdraw" event ?

Also i if it's possible to a new property to change the cursor over
the headers ...

Thanks a lot!

 | Replies | Author | Date
2938 | Re: Change Header Color ? | Mike Lischke | Sat 7/7/2001
2951 | Re: Change Header Color ? | [x_gate@h...] | Sun 7/8/2001


re: ManualSpanColumns?

From: Werner Lehmann [wl@b...]
Date: Wed Jul 4, 2001 10:12 pm
Subject: Re: [VirtualTreeview] ManualSpanColumns?

[duke_n5@h...] wrote:
>
> I need to do the thingy that the voAutoSpanColumns does, but I need
> to do it only to a few nodes - not all of them.
>
> How to?

To avoid auto spanning where it would be done set the text of the
next most column to a blank.

Werner

 | Replies | Author | Date
2896 | Re[2]: ManualSpanColumns? | [duke_n5@h...] | Thu 7/5/2001


Re[2]: ManualSpanColumns?

From: [duke_n5@h...]
Date: Thu Jul 5, 2001 8:16 am
Subject: Re[2]: ManualSpanColumns?

--- In [VirtualTreeview@y...], Werner Lehmann [wl@b...] wrote:
> [duke_n5@h...] wrote:
> >
> > I need to do the thingy that the voAutoSpanColumns does, but I
need
> > to do it only to a few nodes - not all of them.
> >
> > How to?
>
> To avoid auto spanning where it would be done set the text of the
> next most column to a blank.
>
> Werner

No, maybe you misunderstood my question.
OK, I will explain more.
I have 2 columns and only 2 levels. 0-level nodes have text only in
first column, and therefore their long text SHOULD be continued on
the next empty column. 1-level nodes have text in both columns, and
their text should not be spanned.

Did I clear things up or only messed them up?
:)


re: Re[2]: ManualSpanColumns?

From: GIANNAKOPOULOS KOSTAS [kyan@s...]
Date: Thu Jul 5, 2001 8:23 am
Subject: RE: [VirtualTreeview] Re[2]: ManualSpanColumns?

> No, maybe you misunderstood my question.
> OK, I will explain more.
> I have 2 columns and only 2 levels. 0-level nodes have text only in
> first column, and therefore their long text SHOULD be continued on
> the next empty column. 1-level nodes have text in both columns, and
> their text should not be spanned.

What Werner means is that you should change your OnGetText handler so that
for 1-level nodes and Column 1 it returns a space ' ' instead of an empty
string '' when there is one. VT will not span the 0th column then since it
does it only if subsequent columns have an empty text ('').

<KY>


re: Saving/Loading VT

From: TC Lai [lai_tc@y...]
Date: Thu Jul 5, 2001 12:45 pm
Subject: RE: [VirtualTreeview] Saving/Loading VT

Mike,

Thanks for attending personally to the problem of a
greenhorn like me.

Below are the Save and Load procedures I use without
the OnSaveNode and OnLoadNode handlers. I have removed
irrelevant code to save space.

procedure TForm1.btnSaveClick(Sender: TObject);
var
tvList : TStringList;
ms : TMemoryStream;
i : Integer;
idx,
idxa : string;
Data : PNodeData;

begin

// Saves the tree structure to HKStream,
// with 'vst' as identifier.
// HKS (THKStreams) is a component that handles
// multiple streams.
ms := TMemoryStream.Create;
vst.SaveToStream(ms);
HKS.AddStream('vst', ms);
ms.Clear;

// Create a TStringList to hold the node data
tvList := TStringList.Create;
tvList.Capacity := SizeOf(PNodeData(Data));

// Step through all the nodes from the first node.
// Add the node data to the list, then to a stream,
// then add the stream to the HKStream,
// with idx as the stream identifier.
node := vst.GetFirst;
for i := 0 to (vst.TotalCount) -1 do
begin
Data := vst.GetNodeData(Node);
idx := IntToStr(i);
tvList.Add(Data.Caption);
tvList.Add(IntToStr(Data.Level));
tvList.SaveToStream(ms);
HKS.AddStream(idx, ms);
ms.Clear;
tvList.Clear;

// Save the contents in the RichEdit to a stream,
// then add it to the HKStream.
// Data.Note is a TMemoryStream.
(Data.Note).SaveToStream(ms);
idxa := IntToStr(i) + 'Note';
HKS.AddStream(idxa, ms);
ms.Clear;

node := vst.GetNext(Node) ;
end;

// Save the final HKStream to file.
HKS.SaveToFile('vtNote.vtf');
HKS.ClearStreams;
tvList.Free;
ms.Free;

end;

procedure TForm1.btnOpenClick(Sender: TObject);
var
tvList : TStringList;
ms,
ss : TMemoryStream;
i : Integer;
idx,
idxa : string;
Data : PNodeData;

begin

HKS.LoadFromFile('vtNote.vtf');
ms := TMemoryStream.Create;
HKS.GetStream('vst', ms);
vst.LoadFromStream(ms);
ms.Clear;

tvList := TStringList.Create;
tvList.Capacity := SizeOf(PNodeData(Data));
node := vst.GetFirst;
for i := 0 to (vst.TotalCount) -1 do
begin
idx := IntToStr(i);
HKS.GetStream(idx, ms);
tvList.LoadFromStream(ms);
Data := vst.GetNodeData(Node);
Data.Caption := tvList[0];
Data.Level := StrToInt(tvList[1]);
tvList.Clear;
ms.Clear;

idxa := IntToStr(i) + 'Note';
HKS.GetStream(idxa, ms);
ss := TMemoryStream.Create;
ss.LoadFromStream(ms);
Data.Note := ss;
ss.Position := 0;
ms.Clear;

node := vst.GetNext(Node) ;
end;

HKS.ClearStreams;
tvList.Free;
ms.Free;
Node := vst.GetFirst;

end;

When I transfered the portion for handling the node
data and user data to the OnSaveNode and OnLoadNode
handlers, it did not work. It worked when I saved only
the node data, but it was very slow.

After refering to the help file
(VirtualTreeWinHelp11.zip), I have changed my code as
follows according to the example, and the time to load
3000 nodes has improved from about 26 seconds to about
11 seconds, but still slower than using the above
code, and I still could not save and load the user
data.

procedure TForm1.vstSaveNode(Sender: TBaseVirtualTree;
Node: PVirtualNode; Stream: TStream);
var
Data : PNodeData;
size : Integer;

begin

Data := vst.GetNodeData(Node);

Size := Length(Data.Caption) + 1;
Stream.Write(Size, SizeOf(Size));
Stream.Write(PChar(Data.Caption)^, Size);
Stream.Write(Data.Level, SizeOf(Data.Level));

end;

Please show me where I have gone wrong so that I can
achieve the speed that VT is capable of. Please also
suggest how I can save my user data using the
OnSaveNode and OnLoadNode handlers. The user data in
my current program consists of rtf text, embeded
objects, and images (I use standard treeview and
RxRichEdit).

Thanks and regards,

TC

__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail
http://personal.mail.yahoo.com/

 | Replies | Author | Date
2900 | Re: Saving/Loading VT | Jim Kueneman | Thu 7/5/2001
2901 | Re: Saving/Loading VT | Jim Kueneman | Thu 7/5/2001
2940 | Re: Saving/Loading VT | Mike Lischke | Sat 7/7/2001
2915 | Re: Saving/Loading VT | TC Lai | Fri 7/6/2001
2925 | Re: Saving/Loading VT | Jim Kueneman | Sat 7/7/2001
2934 | Re: Saving/Loading VT | [ltchoong@s...] | Sat 7/7/2001
2945 | Re: Saving/Loading VT | Jim Kueneman | Sat 7/7/2001
2955 | Re: Saving/Loading VT | TC Lai | Sun 7/8/2001


Static text on left of the node caption

From: GORTSILAS ANDREAS [agorts@s...]
Date: Thu Jul 5, 2001 12:46 pm
Subject: Static text on left of the node caption

Hello,

I would like to show the static text before the caption. How can I do this?

Thank you

Andreas Gortsilas

 | Replies | Author | Date
2939 | Re: Static text on left of the node caption | Mike Lischke | Sat 7/7/2001


re: Saving/Loading VT

From: "Jim Kueneman" [jimdk@m...]
Date: Thu Jul 5, 2001 2:06 pm
Subject: Re: Saving/Loading VT

--- In [VirtualTreeview@y...], TC Lai [lai_tc@y...] wrote:
> Mike,
>
> Thanks for attending personally to the problem of a
> greenhorn like me.
>
> Below are the Save and Load procedures I use without
> the OnSaveNode and OnLoadNode handlers. I have removed
> irrelevant code to save space.

Hi TC,

I am a little confused as to which was faster than which. When
using the OnSaveNode/OnLoadNode handler were these used from
VST.SaveToFile/LoadFromFile or Save/LoadFromStream? It may be faster
to use memory stream then TMemoryStream.SaveToFile due to the way VT
uses the stream (it explicitly moves the stream (file) pointer). I
would bet the file stream is buffered so it is not really forcing the
file pointer to move (extra overhead) but it is worth a try.

Also if you are not loading your data into the node until VT asks for
it, ie. your data is loaded and stored in OnInitNode (which is should
since not doing so sort of ruins the value of a virtual tree <g>) you
have to make sure the voInitOnSave option is set (the default) so your
data is valid for all nodes.

Also can you show us what your Data structure looks like.

Data : PNodeData;
TNodeData = ???

Jim

 | Replies | Author | Date
2901 | Re: Saving/Loading VT | Jim Kueneman | Thu 7/5/2001
2940 | Re: Saving/Loading VT | Mike Lischke | Sat 7/7/2001
2915 | Re: Saving/Loading VT | TC Lai | Fri 7/6/2001
2925 | Re: Saving/Loading VT | Jim Kueneman | Sat 7/7/2001
2934 | Re: Saving/Loading VT | [ltchoong@s...] | Sat 7/7/2001
2945 | Re: Saving/Loading VT | Jim Kueneman | Sat 7/7/2001
2955 | Re: Saving/Loading VT | TC Lai | Sun 7/8/2001


re: Re: Saving/Loading VT

From: Jim Kueneman [jimdk@m...]
Date: Thu Jul 5, 2001 2:14 pm
Subject: Re: [VirtualTreeview] Re: Saving/Loading VT

At 02:06 PM 7/5/2001 +0000, you wrote:

>Also if you are not loading your data into the node until VT asks for
>it, ie. your data is loaded and stored in OnInitNode (which is should
>since not doing so sort of ruins the value of a virtual tree <g>) you
>have to make sure the voInitOnSave option is set (the default) so your
>data is valid for all nodes.

Which brings up another point here. If you are using the "virtual" aspect
using OnInitNode don't forget any node that has not been shown to the user
has uninitialized data, so before you can write it to a file VT must
initialize all the nodes before it can write your user data, which
depending on your data could take a fair amout of time.

Jim

 | Replies | Author | Date
2940 | Re: Saving/Loading VT | Mike Lischke | Sat 7/7/2001


VT 2.5.1 + Notification + AV problem

From: "Will Watts" [willw@a...]
Date: Thu Jul 5, 2001 2:19 pm
Subject: VT 2.5.1 + Notification + AV problem

Hi Mike,

I seem to have a funny with VT 2.5.1. I have been getting occasional
AV's on shutdown of the owning form. Tracking them down, they
seem to be caused by TBaseVirtualTree.Notification.

The problem seems to be that a VT somehow gets a notification link
to itself, so Notification gets called during the call to the inherited
destructor with AComponent set to itself. The lines

if AComponent = FHeader.FImages then
FHeader.Images := nil;

seem to cause the damage. Presumably because by the time we get
here, FHeader has been destroyed.

I have got rid of my AVs by changing the first line

if Operation = opRemove then
...

to read

if (AComponent <> Self) and (Operation = opRemove) then
...

but I feel this is a bodge. Why do VirtualTrees get notified of their
own destruction? Surely this is not normal?

Or have I got this all wrong?

Regards

Will

PS: Still hoping for a ruling on the OnFocusChanging issue.

Will Watts Direct Line +44 20 8400 6104
Applied Industrial Systems Ltd Main Voice +44 20 8400 6100
10 Barley Mow Passage Fax +44 20 8742 2456
Chiswick London W4 4PH Web http://www.applied.co.uk

 | Replies | Author | Date
2941 | Re: VT 2.5.1 + Notification + AV problem | Mike Lischke | Sat 7/7/2001
2999 | Re: VT 2.5.1 + Notification + AV problem | Will Watts | Mon 7/9/2001
3058 | Re: VT 2.5.1 + Notification + AV problem | Mike Lischke | Thu 7/12/2001
3062 | VT 2.5.1 + Notification + AV problem | Will Watts | Thu 7/12/2001
3083 | Re: VT 2.5.1 + Notification + AV problem | Mike Lischke | Sat 7/14/2001


re: CustomStringTree descendant with Datasource...

From: "Jim Kueneman" [jimdk@m...]
Date: Thu Jul 5, 2001 6:22 pm
Subject: Re: CustomStringTree descendant with Datasource...

--- In [VirtualTreeview@y...], "S%ffbastien Morin" [smsisko@s...] wrote:
>
> That doesn't seem the bo the problem, but thanks

Can you make a simple test case (maybe using constant strings for the
database info) that duplicates this and email it?

Jim

 | Replies | Author | Date
2906 | Re: CustomStringTree descendant with Datasource.. | S%ffbastien Morin | Thu 7/5/2001


AV in DoValidateCache

From: [alshovk@n...]
Date: Thu Jul 5, 2001 6:38 pm
Subject: AV in DoValidateCache

Hi Mike,

The program that uses TVirtualStringTree crashes on start once in a
while. Dr. Watson indicates the point of failure at line 15678 of
VirtualTrees.pas (v.2.5.1):

Inc(CurrentTop, CurrentNode.NodeHeight);

- or, more specifically, at this instruction:

mov eax,[ebp+0xec]
FAULT -> movzx eax,word ptr [eax+0x8]
add [ebp+0xf4],eax

EAX is reported to be 0, i.e., CurrentNode = nil.

It looks like TWorkerThread.Execute -> DoValidateCache somehow gets
called before the tree is initialized.

How can this be fixed?

Regards,
Alex Shovkoplyas

 | Replies | Author | Date
2905 | Fixed column | Franc v/d Westelaken | Thu 7/5/2001
2943 | Re: Fixed column | Mike Lischke | Sat 7/7/2001
2944 | Re: AV in DoValidateCache | Mike Lischke | Sat 7/7/2001


Fixed column

From: "Franc v/d Westelaken" [F.vdwestelaken@c...]
Date: Thu Jul 5, 2001 7:01 pm
Subject: Fixed column

Hi,

Is it possible with VT to have a fixed column when using grid mode so that
for example the left most column doesn't scroll of the screen when moving
the scroll bar to the right ?

Franc.

[Non-text portions of this message have been removed]

 | Replies | Author | Date
2943 | Re: Fixed column | Mike Lischke | Sat 7/7/2001


re: CustomStringTree descendant with Datasource...

From: "S%ffbastien Morin" [smsisko@s...]
Date: Thu Jul 5, 2001 8:17 pm
Subject: Re: CustomStringTree descendant with Datasource...

--- In [VirtualTreeview@y...], "Jim Kueneman" [jimdk@m...] wrote:
> --- In [VirtualTreeview@y...], "S%ffbastien Morin" [smsisko@s...]
wrote:
> >
> > That doesn't seem the bo the problem, but thanks
>
> Can you make a simple test case (maybe using constant strings for
the
> database info) that duplicates this and email it?
>

I've seen to have found the part of the reason, it occured when the
Text that I returned in the DoGetText function was an empty string...

If I put a space in the string then the problem does not occur...

Thanks

Sebastien Morin
[smsisko@s...]


re: How to print the complete tree ?

From: "Mathias Thorell" [tias@m...]
Date: Thu Jul 5, 2001 9:22 pm
Subject: Re: How to print the complete tree ?

--- In [VirtualTreeview@y...], "Mike Lischke" [lists@l...] wrote:

> Hmmm, in the meantime I have switched to an own implementation,
because PaintTo is too unspecific
> and also does some ugly things (like painting parts of the
non-client area but often leaving out the
> client area).
> Currently I have no implicit way to print the tree. Have you tried
to use PaintTree directly instead
> of PaintTo?

Yep, same "Out of resource" exception there also. (Stopd on the last
"end;" line in TBaseVirtualTree.WndProc()... :-(

(Sorry it took so long time before I could answer, had too much to do
the last couple of days).

Cheers,
/Mathias

 | Replies | Author | Date
2908 | Re: How to print the complete tree ? | Jim Kueneman | Thu 7/5/2001
2917 | Re: How to print the complete tree ? | Mathias Thorell | Fri 7/6/2001


re: How to print the complete tree ?

From: "Jim Kueneman" [jimdk@m...]
Date: Thu Jul 5, 2001 9:57 pm
Subject: Re: How to print the complete tree ?

--- In [VirtualTreeview@y...], "Mathias Thorell" [tias@m...] wrote:
> --- In [VirtualTreeview@y...], "Mike Lischke" [lists@l...] wrote:

> Yep, same "Out of resource" exception there also. (Stopd on the last
> "end;" line in TBaseVirtualTree.WndProc()... :-(

Mathias,

I saw this a few days ago when trying to get a form to print to a
bitmap. Are you using TBitmap? Try locking the canvas first

Bitmap.Canvas.Lock;
try
PaintTo(....);
finally
Bitmap.Canvas.Unlock;
end;

This fixed it. Look at TCustomForm.GetFormImage which is what I was
trying to duplicate and removed the canvas locking, bang "Out of
Resource" exception. I did not try to understand why.

Jim

 | Replies | Author | Date
2917 | Re: How to print the complete tree ? | Mathias Thorell | Fri 7/6/2001


re: Re: Header Columns behave strange.

From: Werner Lehmann [wl@b...]
Date: Thu Jul 5, 2001 8:26 am
Subject: Re: [VirtualTreeview] Re: Header Columns behave strange.

[m.dekker@a...] wrote:
>
> Werner, is this the only solution, i mean, is it necesary to hide the
> first column, because it 's more efficient for the use of the memory?

No idea if there is another way but if you only care about memory
efficiency: I don't see why this would be a problem and even then
I cannot imagine that there is a noticeable difference.

Werner


re: Fixed column

From: Werner Lehmann [wl@b...]
Date: Thu Jul 5, 2001 9:41 pm
Subject: Re: [VirtualTreeview] Fixed column

Hi Franc,

> Is it possible with VT to have a fixed column when using grid mode so that
> for example the left most column doesn't scroll of the screen when moving
> the scroll bar to the right ?

<quote>

Hi Alex,

> Is it possible to make a column fixed in the tree (as in grids)? If not,
> could you implement this property (if it doesn't take much time, of course)?

Currently I see no way to implement a real fixed column. Main problem, as
already pointed out, is to
avoid that it gets scrolled with the rest of the client area. I have also no
plans to implement this
feature soon. Sorry, but the feature freeze was already a long time ago and now
is documentation
time (aside bug fixes).

Ciao, Mike

</quote>

Regards,
Werner

 | Replies | Author | Date
2928 | Re: Fixed column | Franc v/d Westelaken | Sat 7/7/2001


re: Re: How to print the complete tree ?

From: Werner Lehmann [wl@b...]
Date: Thu Jul 5, 2001 9:36 pm
Subject: Re: [VirtualTreeview] Re: How to print the complete tree ?

Mathias Thorell wrote:
>
> Yep, same "Out of resource" exception there also. (Stopd on the last
> "end;" line in TBaseVirtualTree.WndProc()... :-(

By any chance, did you compile with runtime packages? I had an AV on
that same line, too. When compiler without runtime vcl50.bpl I could
see where the AV really happened (mine was about a stale interface
reference, probably not the same problem as you have).

Werner

 | Replies | Author | Date
2918 | Re: How to print the complete tree ? | Mathias Thorell | Fri 7/6/2001


Knowing node is last painted?

From: [MJLeaver@n...]
Date: Fri Jul 6, 2001 9:49 am
Subject: Knowing node is last painted?

Is it possible, when a node is initialised, to know
that it is the last one actually painted into the
control, i.e. the last physically visible node in
the tree, i.e. the one at the bottom of the control,
i.e. I hope you know what I mean by now :)

I ask because I want to sort the tree (root nodes)
when the user scrolls down the tree, and not when
the trees root nodes are added to the tree (otherwise
I would have to init all the root nodes, and that
would take a long time).

So when a root node is initialsied, if it knows no
more are going to be initialised (because its the
last one) then the initialised nodes in the tree
can then be sorted. If the user scrolls down some
more then we sort again etc.

 | Replies | Author | Date
2921 | Re: Knowing node is last painted? | Werner Lehmann | Fri 7/6/2001
2942 | Re: Knowing node is last painted? | Mike Lischke | Sat 7/7/2001


In-place editing

From: "Greg" [greg@k...]
Date: Fri Jul 6, 2001 10:39 am
Subject: In-place editing

Hi

I'm having trouble creating an in-placed editor. I have two columns
and would like to be able to edit them in an in-place TEdit-derived
editor (like in a string grid.) Not too hard, so far...

I need the control to capture things like the DEL key, ESCAPE key,
etc. I have a menu item whose shortcut is the DEL key, but whenever I
hit del inside the in-place editor, the menu item is fired instead of
the in-place editor handling it.

I'm not sure why the handling of special keys inside the editor isn't
working properly (ie. like they would if the TEdit was placed on the
form as per normal.)

Any tips, anyone? Maybe a fully working in place editor could be
included in the next release? One that handles escape nicely, etc.

Thanks

Greg

 | Replies | Author | Date
2914 | Re: In-place editing | Roland | Fri 7/6/2001
2916 | Re: In-place editing | [Manfred@F...] | Fri 7/6/2001
2920 | Re: In-place editing | Werner Lehmann | Fri 7/6/2001


re: In-place editing

From: "Roland" [Beduerftig@S...]
Date: Fri Jul 6, 2001 11:07 am
Subject: Re: In-place editing

Hi Greg,

> Any tips, anyone? Maybe a fully working in place editor could be
> included in the next release? One that handles escape nicely, etc.

have a look in file area, there are 2 demo with source, VST and
Property-Editor.

You can download the packages and look for the first step at the EXE-
Files in this packages, and then in the source how to do an inplace
Editor.

Use Event OnCreateEditor and install a class from the interface
IVTEditLink, then you can added in this interface your own editor or
datasource interface.

Have a nice weekend
Roland


re: Re: Saving/Loading VT

From: TC Lai [lai_tc@y...]
Date: Fri Jul 6, 2001 12:54 pm
Subject: Re: [VirtualTreeview] Re: Saving/Loading VT

--- Jim Kueneman [jimdk@m...] wrote:
> Hi TC,
>
> I am a little confused as to which was faster than
> which. When

Sorry for the confusion. Let me summarise below:

CASE 1
======
Root Nodes : 3000
User Data : rtf text in RichEdit (TMemoryStream)
Save/Load Method : VST.SaveToStream/LoadFromStream,
Stream.SaveToFile/LoadFromFile,
without OnSaveNode/OnLoadNode.
Time to Load file : 6 seconds
Time to Save file : 6 seconds

CASE 2
======
Root Nodes : 3000
User Data : none
Save/Load Method : VST.SaveToStream/LoadFromStream,
Stream.SaveToFile/LoadFromFile,
without OnSaveNode/OnLoadNode.
Time to Load file : 4 seconds
Time to Save file : 4 seconds

CASE 3
======
Root Nodes : 3000
User Data : none
Save/Load Method : VST.SaveToFile/LoadFromFile,
with OnSaveNode/OnLoadNode.
Time to Load file : 11 seconds (modified code)
Time to Save file : 10 seconds

> using the OnSaveNode/OnLoadNode handler were these
> used from
> VST.SaveToFile/LoadFromFile or Save/LoadFromStream?

Please see above.

> Also if you are not loading your data into the node
> until VT asks for
> it, ie. your data is loaded and stored in OnInitNode

Doesn't the code "Data.XX := YY" when the file is
loaded, load the data into the node? How can I "keep"
the data until VT asks for it?

> (which is should
> since not doing so sort of ruins the value of a
> virtual tree <g>) you

This is actually my worry, that I am not getting the
maximum advantage from VT because of "misuse". I am
afraid not using the OnSaveNode/OnLoadNode handlers
may give rise to problems when I use drag-and-drop,
that's why I want to use them, but just can't get it
right - slow, data not saved.

> have to make sure the voInitOnSave option is set
> (the default) so your

Yes, voInitOnSave was set to true.

> Also can you show us what your Data structure looks
> like.

I am thinking of converting my current program to VT.
At the moment I have just built a small trial program
by modifying the General Abilities section of the
Advanced demo, with Data structure as follows:

PNodeData = ^TNodeData;
TNodeData = record
Caption : string;
Level: Integer;
Note : TmemoryStream; // For rtf text
end;

> If you are using the "virtual" aspect

Honestly, I am not sure if I am using the "virtual"
aspect of VT, I doubt so.

Thanks and Regards,

TC

__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail
http://personal.mail.yahoo.com/

 | Replies | Author | Date
2925 | Re: Saving/Loading VT | Jim Kueneman | Sat 7/7/2001
2934 | Re: Saving/Loading VT | [ltchoong@s...] | Sat 7/7/2001
2945 | Re: Saving/Loading VT | Jim Kueneman | Sat 7/7/2001
2955 | Re: Saving/Loading VT | TC Lai | Sun 7/8/2001


re: In-place editing

From: [Manfred@F...]
Date: Fri Jul 6, 2001 1:31 pm
Subject: Re: In-place editing

Hi, Greg

Look at VSTEdit.zip in files area. This is a set of ready to use in-
place editors for VirtualStringTree.
MaskEdit, DropDown-Combo, Num-Edit, DateTime-Edit, ..., with source.
You must install the Components first to use it, but the zip includes
a exe for preview also.

cu
Manfred

--- In [VirtualTreeview@y...], "Greg" [greg@k...] wrote:
> Hi
>
> I'm having trouble creating an in-placed editor. I have two columns
> and would like to be able to edit them in an in-place TEdit-derived
> editor (like in a string grid.) Not too hard, so far...
>
> I need the control to capture things like the DEL key, ESCAPE key,
> etc. I have a menu item whose shortcut is the DEL key, but whenever
I
> hit del inside the in-place editor, the menu item is fired instead
of
> the in-place editor handling it.
>
> I'm not sure why the handling of special keys inside the editor
isn't
> working properly (ie. like they would if the TEdit was placed on
the
> form as per normal.)
>
> Any tips, anyone? Maybe a fully working in place editor could be
> included in the next release? One that handles escape nicely, etc.
>
> Thanks
>
> Greg


re: How to print the complete tree ?

From: "Mathias Thorell" [tias@m...]
Date: Fri Jul 6, 2001 2:36 pm
Subject: Re: How to print the complete tree ?

--- In [VirtualTreeview@y...], "Jim Kueneman" [jimdk@m...] wrote:
> Mathias,
> I saw this a few days ago when trying to get a form to print to a
> bitmap. Are you using TBitmap? Try locking the canvas first
>
> Bitmap.Canvas.Lock;
> try
> PaintTo(....);
> finally
> Bitmap.Canvas.Unlock;
> end;

Yes, I'm using a TBitmap, but the Lock() / Unlock() calls made no
difference...

> This fixed it. Look at TCustomForm.GetFormImage which is what I was
> trying to duplicate and removed the canvas locking, bang "Out of
> Resource" exception. I did not try to understand why.

I'm gonna try to track down exactly where I get the bad Width value in
TBaseVirtualTree to see what I can do about it. (It was a couple of
weeks ago, so I have to reinvestigate the whole thing...)

Thanks anyway !

/Mathias


re: How to print the complete tree ?

From: "Mathias Thorell" [tias@m...]
Date: Fri Jul 6, 2001 2:40 pm
Subject: Re: How to print the complete tree ?

--- In [VirtualTreeview@y...], Werner Lehmann [wl@b...] wrote:

> By any chance, did you compile with runtime packages?

Nope (actually, I never do that :)

> I had an AV on
> that same line, too. When compiler without runtime vcl50.bpl I could
> see where the AV really happened (mine was about a stale interface
> reference, probably not the same problem as you have).

Not really, I just see the effect of the exception in the WndPrc(),
it's not a true AV since I at least get a description of the
exception.

Thanks anyway.

/Mathias


String tree descendant problems

From: Werner Lehmann [wl@b...]
Date: Fri Jul 6, 2001 4:15 pm
Subject: String tree descendant problems

Hi Mike,

I am porting a treeview component which is used for some commonly used trees at
my company
from TdxTreelist (Developer Express) over to TVirtualStringTree. So far
everythings works
quite well, the treeview is implementing and using only interfaces to present
and access
the tree data so migration is remarkably easy. I like the VTree much better
than this cludgy
TdxTreelist, source and design are quite messy there (IMO). This demonstrates
even more the
good job that you did with VTree, not having the resources of DevEx.

Hopefully this was enough flattery (but I was serious! :) that you take a look
at the 'issues'
I am encountering with my TCustomVirtualStringTree descendant:

* Why is the Loaded() procedure public when it is usually protected?

* I have found a bug with ContentToHTML, when I dragged a node over the desktop
I got an
AV in line 23966, probably because I did not define a column. An additional
check is
required there (I think) and maybe at other places too.

* Selected image index vs. blending. Currently the tree imagelist has separate
selected images
for each 'normal' image. This works with VTree, too, but the selected image
is also blended
with the selection color which makes the image look quite different (esp.
darker) than
customers (and my boss :) have come to expect. May I ask that a node image is
not blended
if an extra selected image is provided? Or is there a way how I can handle
this in my
descendant?

* Drag and drop... I am trying to implement drag and drop transparently. What I
am trying to
say is that I want to publish the DAD events and still have my code handle
drag and drop
and calling the appropriate interface functions for the real tree data.

As you know this is usually done by overriding Doxxx() methods but I don't
know which methods
should be overriden for drag and drop. The event handlers are called from
several parts and
overriding them all is not only tedious but would also require a fair amount
of copy and paste
and making private things protected.

Specifically, which methods can I override to handle OnDragOver and
OnDragDrop in the same
way in which event handlers would see them (i.e. the Doxxx() way)? I guess
that there are no
such central methods and suggest to introduce them.

FDragSelection is private. If my code is also participating in the drag and
drop it would
be nice to access it somehow, even if only read only. Or do I have to go the
way over the
data object? Currently I am only needing DAD within the same tree.

And one more point. While it is nice at most times that VTree processes a
copy or move operation
on DAD itself I need to do this myself in this situation. Nodes must not be
moved or copied
until the tree data interface (which capsules a database tree cache) has
successfully done
that and notified the treeview. And customers which are used to the previous
versions expect
that a dragged node is not copied with all its children but only the node
itself (certainly
not my liking but I have to be compatible for the time being).

Therefore I would like to somehow tell VTree not to process the drop. Any
ideas on this?

That's it for now :)

Regards,
Werner

 | Replies | Author | Date
2929 | Re: String tree descendant problems | Teus de Jong | Sat 7/7/2001
2931 | Re: String tree descendant problems | Werner Lehmann | Sat 7/7/2001
2961 | Re: String tree descendant problems | Mike Lischke | Sun 7/8/2001
2970 | Re: String tree descendant problems | Werner Lehmann | Sun 7/8/2001
2977 | Re: String tree descendant problems | Mike Lischke | Sun 7/8/2001


re: In-place editing

From: Werner Lehmann [wl@b...]
Date: Fri Jul 6, 2001 5:08 pm
Subject: Re: [VirtualTreeview] In-place editing

Greg wrote:
>
> I'm not sure why the handling of special keys inside the editor isn't
> working properly (ie. like they would if the TEdit was placed on the
> form as per normal.)

Are you sure about that? Once I had an edit on a toolbar and the delete
key never reached the edit even when it had focus. Instead items from my
listview where deleted because a menu item had the delete shortcut assigned.

The solution was to override TCustomForm.IsShortcut and not swallow the del
key if the edit had focus.

Werner


re: Knowing node is last painted?

From: Werner Lehmann [wl@b...]
Date: Fri Jul 6, 2001 5:04 pm
Subject: Re: [VirtualTreeview] Knowing node is last painted?

[MJLeaver@n...] wrote:
>
> So when a root node is initialsied, if it knows no
> more are going to be initialised (because its the
> last one) then the initialised nodes in the tree
> can then be sorted. If the user scrolls down some
> more then we sort again etc.

Ok, you know the topnode (property) and you know how
many nodes fit in the client height (esp. when they
all have the same height). You can calculate which
node is the bottom node.

My suggestion is this: on scrolling or when a node
is being init'ed (re)start a timer and when no other
node has been init'ed for x ms do your sorting (manually
of course since the built in sort functions init all
nodes AFAIR). You get smoother scrolling this way.

Still I am afraid that this will irritate users, nodes
will jump around, including the selection and the
focused node.

Regards,
Werner


CustomCheckImages

From: [duke_n5@h...]
Date: Fri Jul 6, 2001 9:15 pm
Subject: CustomCheckImages

I am using (to be correct attempting to use) this great feature of VT.

However who is who?
I thought the VT reads only 2 custom images for checked/unchecked
from the imagelist, but is seems not so. I see that there is one for
checkedmouseup, checkedmousedown, uncheckedmouseup,
uncheckedmousedown, and probably something else.

can you fully describe all the states and their corresponding
imagelist numbers to prevent my headache of finding it out by myself?

 | Replies | Author | Date
2923 | Re: CustomCheckImages | Ariel | Fri 7/6/2001
2962 | Re: CustomCheckImages | Mike Lischke | Sun 7/8/2001


re: CustomCheckImages

From: "Ariel" [asel98@y...]
Date: Fri Jul 6, 2001 10:00 pm
Subject: Re: CustomCheckImages

open the .res file, theres the bmp that have all the checks states.


descendant with Datasource..

From: "Ariel" [asel98@y...]
Date: Fri Jul 6, 2001 10:02 pm
Subject: descendant with Datasource..

hi
did u finish it, cuz i was doing one too... :(

other thing, are u duplicating the data? (i saw that it is a
customSTRING descendant)

thanks


re: Re: Saving/Loading VT

From: Jim Kueneman [jimdk@m...]
Date: Sat Jul 7, 2001 2:25 am
Subject: Re: [VirtualTreeview] Re: Saving/Loading VT

At 05:54 AM 7/6/2001 -0700, you wrote:

>Doesn't the code "Data.XX := YY" when the file is
>loaded, load the data into the node? How can I "keep"
>the data until VT asks for it?

Yes, but the way you should look at VT is like this:

1) How can I separate the Data needed from the VT node.
2) What is the minimal amount of information needed to be able to connect a
node to a block of data using only the Node and its Parent (remembering the
parent will have access to its associated data ie. it has been initialized).
3) Put any "binding" of time consuming data retireval to the node in
OnInitNode. This is called when VT needs to manipulate the node, such as
make it visible, sort the level of nodes, save it to a stream etc. Within
the OnInitNode use whatever mechinism you devised to retrieve the data for
that node.
4) When a node is expanded it calls OnInitChildren. This is called if the
HasChildren flag is set for the parent node. Note the node most likely
really does not contain nodes yet, you have set this flag in OnInitNode for
the parent because you know it may have children.
5) In OnInitChildren use AddChild to add the child nodes, and most
importantly only add as much information to the user data that is necessary
to accomplish 2. Wait until OnInitNode is called for the new node to
retrieve the time consuming data.
6) Return the number of children to add to the parent node to OnInitChildren.

Of course if you have a single level tree the this is almost pointless
especially if you are going to sort the data. In that case all nodes must
be initialized to do the sort.

> PNodeData = ^TNodeData;
> TNodeData = record
> Caption : string;
> Level: Integer;
> Note : TmemoryStream; // For rtf text
> end;

I uploaded an example of how to use OnLoadNode/OnSaveNode using this data
structure. The Memory stream use the txt file to load it with some text.

Note that file access is very slow within the IDE. Run it as a stand alone
program, much faster. It loads and saves a 2.6MB file in under a second on
my 733Mhz

Jim

 | Replies | Author | Date
2934 | Re: Saving/Loading VT | [ltchoong@s...] | Sat 7/7/2001
2945 | Re: Saving/Loading VT | Jim Kueneman | Sat 7/7/2001
2955 | Re: Saving/Loading VT | TC Lai | Sun 7/8/2001


Any planned release dates for 2.0

From: "Wim van der Vegt" [wvd_vegt@k...]
Date: Sat Jul 7, 2001 10:50 am
Subject: Any planned release dates for 2.0

Hi,

It may already been asked but is there a target date for the 2.0 release?
Especially better documentation would be great to verify what i'm doing it the
right thing.

I would also like a more microsoft tree/listview compatibility (perhaps an
emulation?) of both tree/listview (so including data storage) for smaller
dialogs. That way i could swap them more easily (especially on code that
doesn't need to be vitual do to limited numbers of items.

Has anyone written such wrappers already?

--------
Wim van der Vegt

[Non-text portions of this message have been removed]

 | Replies | Author | Date
2963 | Re: Any planned release dates for 2.0 | Mike Lischke | Sun 7/8/2001
2969 | Re: Any planned release dates for 2.0 | Wim van der Vegt | Sun 7/8/2001
2976 | Re: Any planned release dates for 2.0 | Mike Lischke | Sun 7/8/2001


Normal and static text overlapping

From: Werner Lehmann [wl@b...]
Date: Sat Jul 7, 2001 11:38 am
Subject: Normal and static text overlapping

Hi Mike,

one problem with normal/static text. Some tree nodes should appear in bold font
if they have a totalcount > 1. In that case the static text should indicate how
many children belong to such a node.

Unfortunately the position of the static text is not changed when the normal
text
becomes bold (via OnPaintText) resulting in overlapping normal and static text.
Only when the node is being clicked on the static text's position is corrected.

I have tried to find a fix but am not sure where to change the code. A
DoPaintText
in DoGetNodeWidth did not help. In PaintNormalText you call DoPaintText but only
adjust the node height afterwards, not the NodeWidth. You know probably better
where an effective and most efficient place for a check would be.

Regards,
Werner

 | Replies | Author | Date
2964 | Re: Normal and static text overlapping | Mike Lischke | Sun 7/8/2001


re: Fixed column

From: "Franc v/d Westelaken" [F.vdwestelaken@c...]
Date: Sat Jul 7, 2001 11:42 am
Subject: RE: [VirtualTreeview] Fixed column

Hi Werner,

sorry I didn't look in the archive first before asking this question.

Franc.


re: String tree descendant problems

From: "Teus de Jong" [teusjdejong@p...]
Date: Sat Jul 7, 2001 11:45 am
Subject: Re: [VirtualTreeview] String tree descendant problems

Werner,

> * Drag and drop... I am trying to implement drag and drop transparently.
What I am trying to
> say is that I want to publish the DAD events and still have my code
handle drag and drop
> and calling the appropriate interface functions for the real tree data.
>
> As you know this is usually done by overriding Doxxx() methods but I
don't know which methods
> should be overriden for drag and drop. The event handlers are called
from several parts and
> overriding them all is not only tedious but would also require a fair
amount of copy and paste
> and making private things protected.
>
> Specifically, which methods can I override to handle OnDragOver and
OnDragDrop in the same
> way in which event handlers would see them (i.e. the Doxxx() way)? I
guess that there are no
> such central methods and suggest to introduce them.

I don't know if I understand you correctly, but there are: DoDragEnter,
DoDragOver, DoDragLeave, DoDragDrop, DoStartDrag, DoEndDrag, all
overrideable.

> FDragSelection is private. If my code is also participating in the drag
and drop it would
> be nice to access it somehow, even if only read only. Or do I have to go
the way over the
> data object? Currently I am only needing DAD within the same tree.

There is the public function GetSortedSelection, which gives you FSelection.

Greetings,

Teus de Jng.


Probably simple question

From: [acidleia@h...]
Date: Sat Jul 7, 2001 12:31 pm
Subject: Probably simple question

Hi.

I'm a new user to the virtual tree component, and would like to know
if I can somehow access nodes by an index, just as in the "old"
TTreeView compoment, where you could use the items property to access
a particualr node by an index.

Thanks in advance,
Mikael Stalvik

PS: I'm using the new beta of the virtual tree component

 | Replies | Author | Date
2932 | Re: Probably simple question | Jim Kueneman | Sat 7/7/2001
2933 | Re: Probably simple question | Werner Lehmann | Sat 7/7/2001
2947 | Re: Probably simple question | Werner Lehmann | Sat 7/7/2001
3005 | Re: Probably simple question | [acidleia@h...] | Mon 7/9/2001


re: String tree descendant problems

From: Werner Lehmann [wl@b...]
Date: Sat Jul 7, 2001 12:55 pm
Subject: Re: [VirtualTreeview] String tree descendant problems

Hi Teus,

> I don't know if I understand you correctly, but there are: DoDragEnter,
> DoDragOver, DoDragLeave, DoDragDrop, DoStartDrag, DoEndDrag, all
> overrideable.

Let's see where the OnDragOver event is called:
* DoDragEnter, line 14370
* DoDragLeave, line 14525
* DoDragOver, line 14718

If I would override them all I cannot just call inherited because the call to
the event handler is not the last line in the code (except DoDragLeave). I
would have to copy much code, not exactly ideal. Also I would have to override
three methods when only the code of one event handler would suffice already.

If I am not mistaken DoStartDrag and DoEndDrag are used for VCL dragging only
while I am using OLE DAD.

DoDragDrop is similar, the call to the event handler is in between, I cannot
override it without copying most code (and could not even access the private
fields in that copied code, have not checked if anything in there is private).

> > FDragSelection is private. If my code is also participating in the drag
> and drop it would
> > be nice to access it somehow, even if only read only. Or do I have to go
> the way over the
> > data object? Currently I am only needing DAD within the same tree.
>
> There is the public function GetSortedSelection, which gives you FSelection.

I know, it is used for FDragSelection but why not make this field protected
so I don't have to call GetSortedSelection again? Anyway this is the point
with the least importance of all that I mentioned, I am getting my own drag
data when I call BeginDrag. Just occurred to me that protected might be better.

Regards,
Werner


re: Probably simple question

From: Jim Kueneman [jimdk@m...]
Date: Sat Jul 7, 2001 1:14 pm
Subject: Re: [VirtualTreeview] Probably simple question

At 12:31 PM 7/7/2001 +0000, you wrote:
>Hi.
>
>I'm a new user to the virtual tree component, and would like to know
>if I can somehow access nodes by an index, just as in the "old"
>TTreeView compoment, where you could use the items property to access
>a particualr node by an index.

function TBaseVirtualTree.AbsoluteIndex(Node: PVirtualNode): Cardinal;

It is a time consuming iteration of the tree every time you use it. Try to
forget all those TTreeview bad habits and relearn the VT way <g> It is
really better to think of a VT node like a class.... What does the node
need to know to handle it own existence, and its children to an extent, and
put that info in the owner data of the node so it is directly
accessible. Many of the events pass you a node or parent node.

Jim


re: Probably simple question

From: Werner Lehmann [wl@b...]
Date: Sat Jul 7, 2001 1:36 pm
Subject: Re: [VirtualTreeview] Probably simple question

[acidleia@h...] wrote:
>
> I'm a new user to the virtual tree component, and would like to know
> if I can somehow access nodes by an index, just as in the "old"
> TTreeView compoment, where you could use the items property to access
> a particualr node by an index.

The nodes are managed as chained lists and these are not good at index based
access. I guess you would have to iterate them.

function GetChildByIndex(Parent: PVirtualNode; Index: Integer): PVirtualNode;
begin
if (vsHasChildren in Node.States) and (Node.ChildCount = 0) then
InitChildren(Node);

if (Index < 0) or (Index >= Parent.ChildCount) then
result := nil
else if Index < Parent.ChildCount div 2 then
begin
result := Parent.FirstChild;
while (result <> nil) and (result.Index <> Index) do
result := result.NextSibling;
end else
begin
result := Parent.LastChild;
while (result <> nil) and (result.Index <> Index) do
result := result.PrevSibling;
end;
end;

(untested!)

Generally speaking, if you have to iterate the nodes in a loop with an index
variable you should change it similar to the above function.

Regards,
Werner


re: Saving/Loading VT

From: [ltchoong@s...]
Date: Sat Jul 7, 2001 1:52 pm
Subject: Re: Saving/Loading VT

Jim,

Thanks for taking the time to create the example for me. I have
realised why I was unable to save my data to the tree. The example is
really helpful. It has helped me to proceed from where I was stuck at.

But I still have some questions.

--- In [VirtualTreeview@y...], Jim Kueneman [jimdk@m...] wrote:
> Within the OnInitNode use whatever mechinism you devised to
> retrieve the data for that node.

Looking at your example, it seems that the OnInitNode only serves to
supply a new node with some predetermined values and data. Am I
right? Does it mean that this example does not depend on OnInitNode
to retrieve data for a node? I have tried removing the code, and the
example still loads the file correctly, and displays the correct rtf
text in a richedit box which I had added. I could also perform drag-
and-drop without this handler. Why is it so? What role does this
handler play in this example?

In your previous message, you mentioned that

> any node that has not been shown to the user has uninitialized
> data, so before you can write it to a file VT must initialize
> all the nodes before it can write your user data,

If the user loads a tree from file, and manipulated only a few nodes,
why must the rest of the nodes that has not been shown to the user be
initialised before the tree can be written to a file?

Regards,

TC

 | Replies | Author | Date
2945 | Re: Saving/Loading VT | Jim Kueneman | Sat 7/7/2001
2955 | Re: Saving/Loading VT | TC Lai | Sun 7/8/2001


re: Re: BCB5 - VT2.4.34/VET1.2.34 - CF_RTF

From: "Mike Lischke" [lists@l...]
Date: Sat Jul 7, 2001 3:28 pm
Subject: RE: [VirtualTreeview] Re: BCB5 - VT2.4.34/VET1.2.34 - CF_RTF

> I think this is a problem, when an user use RTF, normally the user
> will also use richtext.h from microsoft, we can try:
>
> 1. rename the define in VT
> 2. use a namespace with VT, for example Virtualtrees::CF_RTF

I renamed the two identifiers.

Ciao, Mike


re: DeleteNode bug?

From: "Mike Lischke" [lists@l...]
Date: Sat Jul 7, 2001 3:28 pm
Subject: RE: [VirtualTreeview] DeleteNode bug?

Hi Will,

> 'User: are you sure you wish to abandon your changes to this
> node?'
>
> and when the user says 'No' it prohibits the loss of focus. This
> strikes me as reasonable behaviour for application code. The fact
> that the user has just deleted this node, and now wants to save his
> changes, is peculiar behaviour by a user - which we know never
> happens ;-)

I got your point and have changed InternalDisconnectNode (where the focused
node is reset) so that
it will reset the node without asking the user. Otherwise there would be a
whole chain of additional
changes (if DeleteNode can fail), which are not of much use.

Ciao, mike


re: TopNode and EndUpdate

From: "Mike Lischke" [lists@l...]
Date: Sat Jul 7, 2001 3:28 pm
Subject: RE: [VirtualTreeview] TopNode and EndUpdate

Hi Jim,

> I have noticed that it is not possible to set the TopNode within a
> Begin/EndUpdate block and have it work. Is this by design? I have
> stepped through it and see why but I am not sure how to change it
> without messing something else up.

Call me stupid, but I cannot find a reason why this should not work. Btw: what
does not work? Is it
only the tree update or does it not scroll at all?

Ciao, Mike

 | Replies | Author | Date
2948 | Re: TopNode and EndUpdate | Jim Kueneman | Sat 7/7/2001
2971 | Re: TopNode and EndUpdate | Mike Lischke | Sun 7/8/2001


re: Re: Change Header Color ?

From: "Mike Lischke" [lists@l...]
Date: Sat Jul 7, 2001 3:28 pm
Subject: RE: [VirtualTreeview] Re: Change Header Color ?

> Now is it possible to add another style to be flat(2D) at all ? I
> mean you have an option to be flat(2D) but when you move the mouse
> over the header it changes to "Flat Button" ... I want to stay flat
> instead putting a "soft border" around it ... Is it possible to
> override the border with the "ownerdraw" event ?

The border is drawn before the OnwerDraw event is triggered, but I have already
in the todo list to
avoid painting the border entirely because it is also not required for Windows
XP header style.

> Also i if it's possible to a new property to change the cursor over
> the headers ...

-> Todo list.

Ciao, Mike

 | Replies | Author | Date
2951 | Re: Change Header Color ? | [x_gate@h...] | Sun 7/8/2001


re: Static text on left of the node caption

From: "Mike Lischke" [lists@l...]
Date: Sat Jul 7, 2001 3:28 pm
Subject: RE: [VirtualTreeview] Static text on left of the node caption

Hi Andreas,

> I would like to show the static text before the caption. How can I do this?

This is not possible with VT in its current implementation. Change DoPaintNode
of the string tree if
you really need the reverse order.

Ciao, Mike


re: Re: Saving/Loading VT

From: "Mike Lischke" [lists@l...]
Date: Sat Jul 7, 2001 3:28 pm
Subject: RE: [VirtualTreeview] Re: Saving/Loading VT

> Which brings up another point here. If you are using the "virtual" aspect
> using OnInitNode don't forget any node that has not been shown to the user
> has uninitialized data, so before you can write it to a file VT must
> initialize all the nodes before it can write your user data, which
> depending on your data could take a fair amout of time.

There is also a flag (voInitOnSave) which is on by default and tells the tree
to initialize any node
which is not yet when saving into a stream. This is also true for clipboard or
drag'n drop transfers
of native tree data which uses streams too.

Ciao, Mike


re: VT 2.5.1 + Notification + AV problem

From: "Mike Lischke" [lists@l...]
Date: Sat Jul 7, 2001 3:28 pm
Subject: RE: [VirtualTreeview] VT 2.5.1 + Notification + AV problem

Will,

> I seem to have a funny with VT 2.5.1. I have been getting occasional
> AV's on shutdown of the owning form. Tracking them down, they
> seem to be caused by TBaseVirtualTree.Notification.
>
> The problem seems to be that a VT somehow gets a notification link
> to itself, so Notification gets called during the call to the inherited
> destructor with AComponent set to itself. The lines

Sorry, but I cannot reproduce this behaviour. The only way to make this happen
seems to me to delete
the images after the header class has been destroyed. But this should never
happen unless you
explicitly wrote it so.

Ciao, Mike

 | Replies | Author | Date
2999 | Re: VT 2.5.1 + Notification + AV problem | Will Watts | Mon 7/9/2001
3058 | Re: VT 2.5.1 + Notification + AV problem | Mike Lischke | Thu 7/12/2001


re: Knowing node is last painted?

From: "Mike Lischke" [lists@l...]
Date: Sat Jul 7, 2001 3:28 pm
Subject: RE: [VirtualTreeview] Knowing node is last painted?

> Is it possible, when a node is initialised, to know
> that it is the last one actually painted into the
> control, i.e. the last physically visible node in
> the tree, i.e. the one at the bottom of the control,
> i.e. I hope you know what I mean by now :)

What about GetNodeAt(0, ClientHeight - 1, True, Dummy) ?

Ciao, Mike


re: Fixed column

From: "Mike Lischke" [lists@l...]
Date: Sat Jul 7, 2001 3:28 pm
Subject: RE: [VirtualTreeview] Fixed column

Franc,

> Is it possible with VT to have a fixed column when using grid mode so that
> for example the left most column doesn't scroll of the screen when moving
> the scroll bar to the right ?

Sorry, but VT is a tree not a grid. There would be significant changes to make
columns static that
way.

Ciao, Mike


re: AV in DoValidateCache

From: "Mike Lischke" [lists@l...]
Date: Sat Jul 7, 2001 3:28 pm
Subject: RE: [VirtualTreeview] AV in DoValidateCache

Hi Alex,

> The program that uses TVirtualStringTree crashes on start once in a
> while. Dr. Watson indicates the point of failure at line 15678 of
> VirtualTrees.pas (v.2.5.1):
>
> Inc(CurrentTop, CurrentNode.NodeHeight);
> It looks like TWorkerThread.Execute -> DoValidateCache somehow gets
> called before the tree is initialized.

This is very strange and I have never heard about nor seen this problem. Even
if the tree is empty
or not initialized it will still not execute a loop with an empty node variable
because this is
check before everything else (FVisibleCount > CacheThreshold). The only way I
can imagine how this
error can appear is if FVisibleCount is (wrongly) greater than the threshold
but the tree is empty.
But how to create this situation by accident?

Ciao, Mike


re: Re: Saving/Loading VT

From: Jim Kueneman [jimdk@m...]
Date: Sat Jul 7, 2001 4:19 pm
Subject: Re: [VirtualTreeview] Re: Saving/Loading VT

At 01:52 PM 7/7/2001 +0000, you wrote:

>Looking at your example, it seems that the OnInitNode only serves to
>supply a new node with some predetermined values and data. Am I
>right? Does it mean that this example does not depend on OnInitNode
>to retrieve data for a node? I have tried removing the code, and the

Right this only serves to load the node on startup so there is something
useful to save to the file.

>example still loads the file correctly, and displays the correct rtf

But what if the file did not exist first <g>?

>text in a richedit box which I had added. I could also perform drag-
>and-drop without this handler. Why is it so? What role does this
>handler play in this example?

Hum, there is as Property called ClipboardFormats that enables a lot of OLE
drag drop and Clipboard formats including RTF. It appears that the
property is not working right as shutting off all the unwanted formats
acually add all them back in. Turn off all but one that the Rich Edit
can't use like Virtual Tree Data. I will post a message for Mike.

> > any node that has not been shown to the user has uninitialized
> > data, so before you can write it to a file VT must initialize
> > all the nodes before it can write your user data,
>
>If the user loads a tree from file, and manipulated only a few nodes,
>why must the rest of the nodes that has not been shown to the user be
>initialised before the tree can be written to a file?

If you load VT from the file it will by default have initialized nodes, at
least the ones that were loaded. If you added new nodes and used the
OnInitNode technique I explained to wait to load the data then VT will have
to initialize those nodes to save.

Jim

 | Replies | Author | Date
2955 | Re: Saving/Loading VT | TC Lai | Sun 7/8/2001


Bug List

From: "Jim Kueneman" [jimdk@m...]
Date: Sat Jul 7, 2001 4:25 pm
Subject: Bug List

Hi Mike,

Are you still checking the bug list database? I posted something
there. I forgot about it as others have too <g>

Jim

 | Replies | Author | Date
2965 | Re: Bug List | Mike Lischke | Sun 7/8/2001


re: Probably simple question

From: Werner Lehmann [wl@b...]
Date: Sat Jul 7, 2001 2:33 pm
Subject: Re: [VirtualTreeview] Probably simple question

Werner Lehmann wrote:
>
> if (vsHasChildren in Node.States) and (Node.ChildCount = 0) then
> InitChildren(Node);

Oops. Replace Node by Parent.

Werner

 | Replies | Author | Date
3005 | Re: Probably simple question | [acidleia@h...] | Mon 7/9/2001


re: TopNode and EndUpdate

From: Jim Kueneman [jimdk@m...]
Date: Sat Jul 7, 2001 5:02 pm
Subject: RE: [VirtualTreeview] TopNode and EndUpdate

At 05:28 PM 7/7/2001 +0200, you wrote:
>Hi Jim,
>
> > I have noticed that it is not possible to set the TopNode within a
> > Begin/EndUpdate block and have it work. Is this by design? I have
> > stepped through it and see why but I am not sure how to change it
> > without messing something else up.
>
>Call me stupid, but I cannot find a reason why this should not work. Btw:
>what does not work? Is it
>only the tree update or does it not scroll at all?

Well I had a note in the VET code (many versions ago) to this effect but
now it is not doing it. What it is doing is only scrolling to the
middle. Use the VET demo and go to the Browse To Path tab. Leave Expand
unchecked (if you check it it works because the expand may scroll it to the
top). You will most likely have to change the E to C and hit the
button. Does it scroll to the top or middle?

Here is the block of code that does that.

begin
BeginUpdate;
try
Result := False;
TargetNode := nil;
PIDL := PathToPIDL(APath); // Convert the Path to a PIDL
if Assigned(PIDL) then
try
TargetNode := WalkPIDLToNode(PIDL, False, True); // Find the PIDL
in the Tree
if Assigned(TargetNode) then
begin
if CollapseAllFirst then
FullCollapse; // the InFamous
Full Collapse <g>
Expanded[TargetNode] := ExpandTarget;
if SelectTarget then
begin
ClearSelection;
Selected[TargetNode] := True;
FocusedNode := TargetNode
end;
if SetFocusToVET then
SetFocus;
Result := True
end
finally
if Assigned(TargetNode) then
TopNode := TargetNode;
PIDLMgr.FreePIDL(PIDL);
end;
finally
EndUpdate
end
end;

 | Replies | Author | Date
2971 | Re: TopNode and EndUpdate | Mike Lischke | Sun 7/8/2001


Focusednode after collapse

From: Werner Lehmann [wl@b...]
Date: Sat Jul 7, 2001 9:27 pm
Subject: Focusednode after collapse

Hi,

if the parent of the focused node is collapsed, shouldn't the focus
be set to this parent node? At least explorer does it like this...

Regards,
Werner

 | Replies | Author | Date
2950 | Re: Focusednode after collapse | Jim Kueneman | Sat 7/7/2001
2967 | Re: Focusednode after collapse | Werner Lehmann | Sun 7/8/2001


re: Focusednode after collapse

From: Jim Kueneman [jimdk@m...]
Date: Sat Jul 7, 2001 10:56 pm
Subject: Re: [VirtualTreeview] Focusednode after collapse

At 11:27 PM 7/7/2001 +0200, you wrote:
>Hi,
>
>if the parent of the focused node is collapsed, shouldn't the focus
>be set to this parent node? At least explorer does it like this...

Hi Werner,

In VET I do it like this on the DoCollapsing (OnCollapsing) event. Make
a special note of the check for voAutoExpand. It leads to infinite
recursion within VT.

Jim

procedure CollapseFolder(Node: PVirtualNode);
var
SelNode: PVirtualNode;
begin
if Assigned(Node) and not (voAutoExpand in Options) then
begin
BeginUpdate;
try
SelNode := GetFirstSelected;
if HasAsParent(SelNode, Node) then
begin
ClearSelection;
Selected[Node] := True;
FocusedNode := Node
end;
finally
EndUpdate
end
end
end;


re: Change Header Color ?

From: [x_gate@h...]
Date: Sun Jul 8, 2001 12:40 am
Subject: Re: Change Header Color ?

> The border is drawn before the OnwerDraw event is triggered, but I
have already in the todo list to
> avoid painting the border entirely because it is also not required
for Windows XP header style.

Hi,
That means that i'll be able to paint the header cell without
borders ? If yes that's great!
(eg. to make my own borders if like)

> > Also i if it's possible to a new property to change the cursor
over
> > the headers ...
>
> -> Todo list.

Thanks! =)


Version numbers

From: Raymond Wilson [raymond.wilson@t...]
Date: Sun Jul 8, 2001 3:41 am
Subject: Version numbers

Mike et al,

I have noticed a bunch of archived releases in the files area with version
numbers like 2.4.*, and more recent ones marked 2.5.* in the top of the
files tree. These are all marked as beta. Was there a 'release' build of
2.4, or did the build number get too high and roll over to 2.5? :-)

Is there an intended version number the the release version of the current
virtual treeview development?

Cheers,

Raymond.

PS: Mike and Co: You are doing a great job on this treeview - I am very
impressed!

 | Replies | Author | Date
2953 | Re: Version numbers | Jim Kueneman | Sun 7/8/2001
2966 | Re: Version numbers | Mike Lischke | Sun 7/8/2001
2991 | Re: Version numbers | Raymond Wilson | Sun 7/8/2001


re: Version numbers

From: Jim Kueneman [jimdk@m...]
Date: Sun Jul 8, 2001 3:57 am
Subject: Re: [VirtualTreeview] Version numbers

At 03:41 PM 7/8/2001 +1200, you wrote:
>Mike et al,
>
>I have noticed a bunch of archived releases in the files area with version
>numbers like 2.4.*, and more recent ones marked 2.5.* in the top of the
>files tree. These are all marked as beta. Was there a 'release' build of
>2.4, or did the build number get too high and roll over to 2.5? :-)

The last "release" is 1.3 ;^) Not sure why Mike rolled over to
2.5. If we would leave him alone with improvements (and I would finish my
help for VET) maybe he could actually do a release!

BTW 2.5 is very stable. I would use it as there are some major differences
in it compared to 1.3 expecially in DragDrop.

Jim


Cell Painting

From: "Jim Kueneman" [jimdk@m...]
Date: Sun Jul 8, 2001 6:21 am
Subject: Cell Painting

Hi Mike,

I just ran into a problem trying to make a row of cells a different
color than the rest when using a Column Colors. I am changing the
brush color and filling the cell in OnBeforeCellPaint but right after
that VT calls PrepareCell which fills the cell with the ColumnColor.
Is it possible to move this:

// Fill cell background if its color differs from tree background.
with FHeader.FColumns do
if poColumnColor in PaintOptions then
begin
Brush.Color := Items[Column].Color;
FillRect(CellRect);
end;

From the PrepareCell method to the PaintTo method before the
OnBeforeCellPaint. It appears the rectangle size will depend on grid
lines being draw but other than that is should be ok.

I guess it depends on what you feel has priority the Column Color or
the Owner Draw of a cell. My opinion is the Owner Draw but I am
biased :^)

Jim

 | Replies | Author | Date
2974 | Re: Cell Painting | Mike Lischke | Sun 7/8/2001
2978 | Re: Cell Painting | Jim Kueneman | Sun 7/8/2001
2996 | Re: Cell Painting | Mike Lischke | Mon 7/9/2001


re: Re: Saving/Loading VT

From: TC Lai [lai_tc@y...]
Date: Sun Jul 8, 2001 7:21 am
Subject: Re: [VirtualTreeview] Re: Saving/Loading VT

Jim and Mike,

Thanks for your help.

--- Jim Kueneman [jimdk@m...] wrote:
> At 01:52 PM 7/7/2001 +0000, you wrote:
>
> Right this only serves to load the node on startup
> so there is something useful to save to the file.

That clears my doubt about OnInitNode, and
RootNodeCount as well.

> acually add all them back in. Turn off all but one
> that the Rich Edit can't use like Virtual Tree
> Data. I will post a message for Mike.

You might have misunderstood me here. I wasn't
complaining that drag-and-drop worked when it should
not have. I initially thought OnInitNode would be
triggered after a drop operation.

> If you load VT from the file it will by default have
> initialized nodes, at least the ones that were

Understood.

Thanks and regards,

TC

__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail
http://personal.mail.yahoo.com/


ignore : test

From: "Wim van der Vegt" [wvd_vegt@k...]
Date: Sun Jul 8, 2001 8:20 am
Subject: ignore : test

Hi,

Just a test to see if my mail addresses are correctly set for this listserver.

Wim van der Vegt

[Non-text portions of this message have been removed]


Beta's

From: "Wim van der Vegt" [wvd_vegt@k...]
Date: Sun Jul 8, 2001 8:22 am
Subject: Beta's

Hi,

After reading a few e-mails i discovered the download area mentioned and
downloaded the 2.5 beta. Is there any documentation available yet? And any
target releasedates for this 2.x version?

Wim van der Vegt

[Non-text portions of this message have been removed]

 | Replies | Author | Date
2975 | Re: Beta's | Mike Lischke | Sun 7/8/2001


for loop ??

From: [PCXSoft@I...]
Date: Sun Jul 8, 2001 8:20 am
Subject: for loop ??

hi,

It's driving me crazy...
How can I do a for-loop over all items that is simmilar to a
TreeView's loop:

var
i: Integer;
t: TTreeItem;
begin
for i:=0 to Tree.Items.Count-1 do
begin
t := Tree.Items.Item[i];
end;
end;

Thank you,
=Alex=


TListView and TTreeView Emulation

From: "Wim van der Vegt" [wvd_vegt@k...]
Date: Sun Jul 8, 2001 8:31 am
Subject: TListView and TTreeView Emulation

Hi,

As i really like the Virtual Treeview i would like to replace most of the
Microsoft controls in my existing code. But what prevents me is that VT is
very different on many ascpects.

So my question is : has anyone written a emulation of the MS controls based
on VT (so including datastorage, and yes i know virtual is better, but for
5-10 items it's pure overhead). Or do i have to program it myself?

At the moment i can only 'easily' use VT to replace a ms control that i made
virtual anyway (in which case it was still a lot of work). For new code i
know it won't matter.

-------
Wim van der Vegt


Loop ?

From: "Alexander Adam" [PCXSoft@I...]
Date: Sun Jul 8, 2001 8:52 am
Subject: Loop ?

hi,

It's driving me crazy...
How can I do a for-loop over all items that is simmilar to a
TreeView's loop:

var
i: Integer;
t: TTreeItem;
begin
for i:=0 to Tree.Items.Count-1 do
begin
t := Tree.Items.Item[i];
end;
end;

Thank you,
=Alex=

 | Replies | Author | Date
2968 | Re: Loop ? | Werner Lehmann | Sun 7/8/2001


re: String tree descendant problems

From: "Mike Lischke" [lists@l...]
Date: Sun Jul 8, 2001 9:41 am
Subject: RE: [VirtualTreeview] String tree descendant problems

Hi Werner,

> * Why is the Loaded() procedure public when it is usually protected?

I see. You will find every little mistake I made :o] This auditorium is the
best beta tester group I
ever had! Moved the method to protected section.

> * I have found a bug with ContentToHTML, when I dragged a node over the
desktop I got an
> AV in line 23966, probably because I did not define a column. An additional
check is
> required there (I think) and maybe at other places too.

It was only that one place. I forgot to check for columns when storing the
background color in HTML.
Fixed.

> May I ask that a node image is not blended
> if an extra selected image is provided? Or is there a way how I can handle
this in my
> descendant?

Mmh, I can imagine to have an option to switch off blending generally but this
requires some
significant changes (you know the main Options property is full). I'll take
this in the todo list.
For now you can only manually remove (comment out) the

if Ghosted or ...

part.

> * Drag and drop... I am trying to implement drag and drop transparently. What
I am trying to
> say is that I want to publish the DAD events and still have my code handle
drag and drop
> and calling the appropriate interface functions for the real tree data.

Do I get this right that you want to circumvent all the handling done in VT
regarding drag'n drop?
What I can see currently is that you either want to do it all on your own
behalf (then you have to
rewrite/copy a great part of the drag'n drop code of course) or you use the
mechanism of VT.

> Specifically, which methods can I override to handle OnDragOver and
OnDragDrop in the same
> way in which event handlers would see them (i.e. the Doxxx() way)? I guess
that there are no
> such central methods and suggest to introduce them.

What can we win here? I can rename the methods currently named DoDragOver etc.
and introduce new
ones which only call the event handler. But what is the general advantage?

> FDragSelection is private. If my code is also participating in the drag and
drop it would
> be nice to access it somehow, even if only read only. Or do I have to go
the way over the
> data object? Currently I am only needing DAD within the same tree.

Well, making this a protected property is a task of 10 seconds. Done.

> Therefore I would like to somehow tell VTree not to process the drop. Any
ideas on this?

Simple. Just do not pass on the drop event to VT. The drop action which happens
to VT will be passed
to the OnDragDrop event and if the data is not passed back to the tree then
nothing happens. You
have to set Effects to DROPEFFECT_NONE to avoid that the source tree changes
something in the node
structure.

Ciao, Mike


re: CustomCheckImages

From: "Mike Lischke" [lists@l...]
Date: Sun Jul 8, 2001 9:41 am
Subject: RE: [VirtualTreeview] CustomCheckImages

Hi duke_n5,

> I thought the VT reads only 2 custom images for checked/unchecked
> from the imagelist, but is seems not so. I see that there is one for
> checkedmouseup, checkedmousedown, uncheckedmouseup,
> uncheckedmousedown, and probably something else.
>
> can you fully describe all the states and their corresponding
> imagelist numbers to prevent my headache of finding it out by myself?

Don't confuse yourself with this stuff. A check image list must contain images
for various states
and kinds of check buttons. That's the reason why there are so many images in
the list. For a list
of indices and their meaning in the check image context look up the source code
(quite at the start)
where you will find:

// Indices for check state images used for checking.
ckEmpty = 0; // an empty image
ckCheckEmpty = 1; // an empty checkbox
ckCheckChecked = 2; // a checkbox with a cross
ckCheckDisabled = 3; // a grayed and empty checkbox
ckCheckGrayed = 4; // a grayed checkbox with a cross
ckRadioEmpty = 5; // an empty radio button (circle)
ckRadioChecked = 6; // a radio button with a filled circle
ckRadioDisabled = 7; // a grayed and empty radio button
ckRadioGrayed = 8; // a grayed radio button with a filled circle
ckButtonUp = 9; // an unpressed button
ckButtonDown = 10; // a pressed button
ckButtonGrayed = 11; // a disabled button

The grayed version of the images are used either when the node/tree is disabled
or the mouse is down
on that particular image.

Ciao, Mike


re: Any planned release dates for 2.0

From: "Mike Lischke" [lists@l...]
Date: Sun Jul 8, 2001 9:41 am
Subject: RE: [VirtualTreeview] Any planned release dates for 2.0

Hi Wim,

> It may already been asked but is there a target date for the 2.0 release?
Especially
> better documentation would be great to verify what i'm doing it the right
thing.

I have planned to release the new version several times but I simpy cannot make
it for various
reasons. One is I had to fix some bugs but I have also implemented a lot of new
stuff (with new bugs
to be fixed). Another one is that the mailing list and direct mail keeps me
busy. I have not written
one line in the new help file in the past 3 weeks because I had to answer a lot
of emails which took
my time.

Frankly, I do not know when I can publish the new version. I would be happy if
it would be before
September but I would not wonder if it will be christmas then. I am already
quite harsh when new
wishes for VT arrive here but even so I can't entirely focus on documentation.
Additionally I have
to make support for other projects of mine (currently I get a lot of emails
regarding D6
compliance), have nearly done the new layout of my homepage which shall appear
with the new VT
version, have got a new domain (www.delphi-unicode.net) which needs to be
filled, have to make the
demos of VT really usefull, have to do my everday job and last but not least: I
have got a family.

> I would also like a more microsoft tree/listview compatibility (perhaps an
emulation?) of
> both tree/listview (so including data storage) for smaller dialogs. That way
i could swap
> them more easily (especially on code that doesn't need to be vitual do to
limited numbers
> of items.

There is already enough compatibility. You can use AddChild and InsertNode and
you have a data
property for each node. Even with an additional compatibility layer you would
have to do at least
some of the things required for VT to work (e.g. node initialization etc.).

Ciao, Mike


re: Normal and static text overlapping

From: "Mike Lischke" [lists@l...]
Date: Sun Jul 8, 2001 9:41 am
Subject: RE: [VirtualTreeview] Normal and static text overlapping

Hi Werner,

> one problem with normal/static text. Some tree nodes should appear in bold
font
> if they have a totalcount > 1. In that case the static text should indicate
how
> many children belong to such a node.

A quick solution is to increase the text margin. For the next build I have
included a recalculation
of the node width if the font changed.

Ciao, Mike


re: Bug List

From: "Mike Lischke" [lists@l...]
Date: Sun Jul 8, 2001 9:41 am
Subject: RE: [VirtualTreeview] Bug List

Hi Jim,

> Are you still checking the bug list database? I posted something
> there. I forgot about it as others have too <g>

Of course do I check the bug list. I just have created it!

To all: Please insert bug reports in the future into the bug list table in the
database section of
the mailing list instead reporting bugs to the list. I will regularly look into
the table and fix
bugs as they appear.

Ciao, Mike


re: Version numbers

From: "Mike Lischke" [lists@l...]
Date: Sun Jul 8, 2001 9:41 am
Subject: RE: [VirtualTreeview] Version numbers

Hi Ray,

long time no speak :o] Still active on experts-exchange?

> I have noticed a bunch of archived releases in the files area with version
> numbers like 2.4.*, and more recent ones marked 2.5.* in the top of the
> files tree. These are all marked as beta. Was there a 'release' build of
> 2.4, or did the build number get too high and roll over to 2.5? :-)

Well, I felt it was time to increase the minor build number after a couple of
build increases. There
is enough which had changed in the mean time to justfy this increase.

> Is there an intended version number the the release version of the current
> virtual treeview development?

No, no particular number is intended for release. It will happen whenever I
have ready the new
documentation.

Ciao, Mike


re: Focusednode after collapse

From: Werner Lehmann [wl@b...]
Date: Sat Jul 7, 2001 11:36 pm
Subject: Re: [VirtualTreeview] Focusednode after collapse

Jim Kueneman wrote:
>
> At 11:27 PM 7/7/2001 +0200, you wrote:
> >Hi,
> >
> >if the parent of the focused node is collapsed, shouldn't the focus
> >be set to this parent node? At least explorer does it like this...
>
> Hi Werner,
>
> In VET I do it like this on the DoCollapsing (OnCollapsing) event. Make
> a special note of the check for voAutoExpand. It leads to infinite
> recursion within VT.

Thank you, Jim, I am doing something similar already. I just stumbled over
that code again when I restructured some parts and wondered if this might
be included in the component...

Werner


re: Loop ?

From: Werner Lehmann [wl@b...]
Date: Sun Jul 8, 2001 9:50 am
Subject: Re: [VirtualTreeview] Loop ?

Hi Alexander,

> It's driving me crazy...
> How can I do a for-loop over all items that is simmilar to a
> TreeView's loop:
>
> var
> i: Integer;
> t: TTreeItem;
> begin
> for i:=0 to Tree.Items.Count-1 do
> begin
> t := Tree.Items.Item[i];
> end;
> end;

var
Node: PVirtualNode;
begin
Node := Tree.GetFirst;
while Node <> nil do
begin
// do stuff with Node
Node := Tree.GetNext(Node);
end;
end;

Werner


re: Any planned release dates for 2.0

From: "Wim van der Vegt" [wvd_vegt@k...]
Date: Sun Jul 8, 2001 10:13 am
Subject: Re: [VirtualTreeview] Any planned release dates for 2.0

Hi,

Any timeframe for a beta of the documentation?

I hope you use some kind of documentation generator so sources and on-line
help are easily kept in sync and to keep the workload down. I currently have
a go at rjPasDoc which will generate ms htmlhelp including keyword indexes
(in it's next release) directly from delphi sources and looks quite
promising. I think i will have it run over VT today to see what happens with
a large & complex sourcefile.

>I have planned to release the new version several times but I simpy cannot
make it for various
>reasons. One is I had to fix some bugs but I have also implemented a lot of
new stuff (with new bugs
>to be fixed). Another one is that the mailing list and direct mail keeps me
busy. I have not written
>one line in the new help file in the past 3 weeks because I had to answer a
lot of emails which took
>my time.

The secret of success (no programming = no new bugs ;-) ?

--------
Wim van der Vegt

 | Replies | Author | Date
2976 | Re: Any planned release dates for 2.0 | Mike Lischke | Sun 7/8/2001


re: String tree descendant problems

From: Werner Lehmann [wl@b...]
Date: Sun Jul 8, 2001 11:22 am
Subject: Re: [VirtualTreeview] String tree descendant problems

Hi Mike,

I am sorry about this rather long reply but do not fear, most of it is just
copied from
VirtualTrees.pas or online help...

> > * Why is the Loaded() procedure public when it is usually protected?
>
> I see. You will find every little mistake I made :o] This auditorium is the
best beta tester group I
> ever had! Moved the method to protected section.

:)

> > May I ask that a node image is not blended
> > if an extra selected image is provided? Or is there a way how I can
handle this in my
> > descendant?
>
> Mmh, I can imagine to have an option to switch off blending generally but
this requires some
> significant changes (you know the main Options property is full). I'll take
this in the todo list.
> For now you can only manually remove (comment out) the
>
> if Ghosted or ...
>
> part.

Ok then. Of course I always try to avoid direct changes in your code because I
have to remember
to do these changes with each new version again. But it'll be ok if there is
hope that this will
be an option.

As to the options property, I believe they can be divided into different
groups. This will
break existing code of course and require a good deal of search and replace in
thousands of
lines in VirtualTrees.pas. Thus I do not expect that to happen anytime soon (I
would volunteer
to do the boring search and replace job). However *if* this is to be done it
should better be
before the final release is out.

Anyway, here's my suggestion of a possible split:

TVirtualTreeOption = (
voAcceptOLEDrop, // register tree as OLE accepting drop target
voAutoDropExpand, // expand node if it is the drop target for more
than 1 sec.
voAutoExpand, // nodes are expanded/collapsed on node
focus/unfocus
voAutoScroll, // tree automatically scrolls if mouse is near
the border while dragging or selecting
voAutoSort, // if set then the tree is (re)sorted when
Header.SortColumn or Header.SortDirection
// changes and the children of a node are
resorted when a new node is added
voAutoSpanColumns, // large entries continue into next column(s) if
there's no text in them (no clipping)
voAutoTristateTracking, // if set then checkstates are automatically
propagated for tri state check boxes
voCheckSupport, // checkboxes/radio buttons are shown
voEditable, // node labels can be edited
voExtendedFocus, // entries other than in the main column can be
selected, edited etc.
voGridExtensions, // use some special enhancements to simulate
grid behaviour
voInitOnSave, // nodes which aren't already initialized when
saving a tree to a stream will be initialized
// on the fly (including their children)
voPopupMode, // tree is painted as would it always have the
focus (useful for tree combo boxes etc.)
voToggleOnDblClick // when set then nodes are expanded/collapsed
when double clicked
);

TVirtualTreeVisualOption = (
voAnimatedToggle, // expanding and collapsing a node is animated
(quick window scroll)
voHideFocusRect, // if set then no focus rect is drawn around the
text
voHideSelection, // if set then selected nodes are drawn as
unselected nodes
voHotTrack, // indicate the node where the mouse is
currently over
voShowBackground, // use the background image if there's one
voShowButtons, // display collapse/expand buttons left to a node
voShowDropmark, // show/hide dropmark
voShowHorzGridLines, // display horizontal lines to simulate a grid
voShowRoot, // show lines also at root level
voShowTreeLines, // display tree lines to show hierarchy of nodes
voShowVertGridLines, // display vertical lines (depending on columns)
to simulate a grid
);

TVirtualTreeSelectOption = (
soDisableDrawSelection, // prevent user form selecting with the
selection rectangle in multiselect mode
soFullRowSelect, // hit test as well as selection highlight are
not constrained to the (main) text of a node
soLevelSelectConstraint, // constrain selection to the same level as the
selection anchor
soMiddleClickSelect, // like voRightClickSelect but with the middle
mouse button
soMultiSelect, // multiselection is enabled
soRightClickSelect, // select node on right click
soSiblingSelectConstraint, // constrain selection to nodes with same parent
);

It would be desirable to have the options property near each other in the OI
but that would
require to name them like 'Options, OptionsVisual, OptionsSelection' which
sounds odd. The
other alternative would be to group them with a TPersistent, also not exactly
elegant in the
code, but the persistant's property getters/setters could just be passed on to
the respective
(protected) properties in the tree itself. Probably more flexible if there are
more option
groups to come sometime, since they would also be in that nested options
property.

> > * Drag and drop... I am trying to implement drag and drop transparently.
What I am trying to
> > say is that I want to publish the DAD events and still have my code
handle drag and drop
> > and calling the appropriate interface functions for the real tree data.
>
> Do I get this right that you want to circumvent all the handling done in VT
regarding drag'n drop?
> What I can see currently is that you either want to do it all on your own
behalf (then you have to
> rewrite/copy a great part of the drag'n drop code of course) or you use the
mechanism of VT.

No, I'm afraid I couldn't make myself clear enough. I want to provide a default
drag and drop
handling which deals with the tree node interfaces in my data pointers. My DAD
handling is
based on yours (for instance changing the drop effect if ctrl or shift are
pressed, calling the
events in the right places etc). So far I could just use some event handlers
hard wired to the
drag and drop events in my descendant. But then I cannot publish these events
(obviously). But
it is good (and common) style to do this. My component provides default DAD
handling which can
be overriden by e.g. a TForm's method as event handler of a DAD event.

See this quote from online help, topic 'Calling an Event':

"You should centralize calls to an event. That is, create a virtual method in
your component that
calls the application’s event handler (if it assigns one) and provides any
default handling.
Putting all the event calls in one place ensures that someone deriving a new
component from yours
can customize event handling by overriding a single method, rather than
searching through your code
for places where you call the event."

This is exactly what I meant. The OnDragOver event calls are not centralized
(see also my reply
to Teus on this thread).

> > Specifically, which methods can I override to handle OnDragOver and
OnDragDrop in the same
> > way in which event handlers would see them (i.e. the Doxxx() way)? I
guess that there are no
> > such central methods and suggest to introduce them.
>
> What can we win here? I can rename the methods currently named DoDragOver
etc. and introduce new
> ones which only call the event handler. But what is the general advantage?

I may have answered that above. We get the possibility to override 'event
handler calling code',
the famous 'if assigned(FOnblabla) then FOnblabla(self, ...)' methods only.
Which in turn allows
us to make use of your DAD code and still provides the possibility for some
descendant specific
processing.

Example.

// virtual base method, method name not very important
procedure TBaseVirtualTree.DoDragOver(Sender: TBaseVirtualTree; Source:
TObject; Shift: TShiftState;
State: TDragState; Pt: TPoint; Mode: TDropMode; var Effect: Integer; var
Accept: Boolean);
begin
if Assigned(FOnDragOver) then
FOnDragOver(Self, DragManager.DragSource, Shift, dsDragEnter, Pt,
FLastDropMode, Effect, Accept);
end;

// overriden method in descendant
procedure TInterfaceTreeview.DoDragOver(Sender: TBaseVirtualTree; Source:
TObject; Shift: TShiftState;
State: TDragState; Pt: TPoint; Mode: TDropMode; var Effect: Integer; var
Accept: Boolean);
begin
// Do some stuff here using the provided parameters, this can be almost the
same code that
// would be written in external event handlers, nothing else.
// The parameters have been translated and provided by inherited code already.

// If the descendant code has decided to allow the drag lets still ask if the
component user
// agrees. It is also possible to translate this event to a more specific
event that (in this
// case) provides some interface references for the component user to decide.
The point is
// however that this happens centrally in this single place.
if Accept <> DROPEFFECT_NONE then
inherited;
end;

Here is another quote from the online help which describes this. Sorry, it is
somewhat lengthy
but you may safely ignore it :)

"If you want to change the way your component responds to a certain kind of
event, you might be
tempted to write some code and assign it to the event. As an application
developer, that is exactly
what you would do. But when you are creating a component, you must keep the
event available for
developers who use the component.

This is the reason for the protected implementation methods associated with
each of the standard
events. By overriding the implementation method, you can modify the internal
event handling; and by
calling the inherited method you can maintain the standard handling, including
the event for the
application developer’s code.

The order in which you call the methods is significant. As a rule, call the
inherited method first,
allowing the application developer’s event-handler to execute before your
customizations (and in some
cases, to keep the customizations from executing). There may be times when you
want to execute your
code before calling the inherited method, however. For example, if the
inherited code is somehow
dependent on the status of the component and your code changes that status, you
should make the changes
and then allow the user’s code to respond to them."

> Well, making this a protected property is a task of 10 seconds. Done.

Thanks.

> > Therefore I would like to somehow tell VTree not to process the drop. Any
ideas on this?
>
> Simple. Just do not pass on the drop event to VT. The drop action which
happens to VT will be passed
> to the OnDragDrop event and if the data is not passed back to the tree then
nothing happens. You
> have to set Effects to DROPEFFECT_NONE to avoid that the source tree changes
something in the node
> structure.

Doh. I could have guessed that myself :)

Regards,
Werner

 | Replies | Author | Date
2977 | Re: String tree descendant problems | Mike Lischke | Sun 7/8/2001


re: TopNode and EndUpdate

From: "Mike Lischke" [lists@l...]
Date: Sun Jul 8, 2001 12:30 pm
Subject: RE: [VirtualTreeview] TopNode and EndUpdate

> Use the VET demo and go to the Browse To Path tab. Leave Expand
> unchecked (if you check it it works because the expand may scroll it to the
> top). You will most likely have to change the E to C and hit the
> button. Does it scroll to the top or middle?

It scrolls to top so it seems to be fixed :o]

Ciao, Mike


Builder 5 + StrEdit

From: "Lester Caine" [lester@l...]
Date: Sun Jul 8, 2001 1:47 pm
Subject: Builder 5 + StrEdit

I am now in a position to play with a tree component for one of my
application modules.

I have had a scout around and come back to VirtualTreeview, with a
view to getting it working with IBO as I need a data aware display.

The first problem relates to the unit StrEdit.

Which is obviously the TClipboardFormatsProperty bit, as I have
deleted that and can now compile in Builder 5 - I don't want it anyway
but it would be nice to sort things out.

What should I be including to get it to compile?


Virtual Tree, IBO4 and Delphi6

From: "Paul Gallagher" [paul@t...]
Date: Sun Jul 8, 2001 2:17 pm
Subject: Virtual Tree, IBO4 and Delphi6

I just started to work on updating my IB_VTree to work with IBOv4, D6 and the
latest version of Virtual Tree(2.52 I think). If anyone has gotten this to work
yet, I would appreciate any feedback. Seems like there are some significant
changes that might take a little work to figure out.

It also looks like IBO4 and D6 are very version specific. It will take seperate
packages for IBO4 and D5, or IBO3.6 and D6. So I am just skipping past the old
stuff and getting it to work with the latest versions of everything.

Paul Gallagher

[Non-text portions of this message have been removed]


re: Cell Painting

From: "Mike Lischke" [lists@l...]
Date: Sun Jul 8, 2001 2:49 pm
Subject: RE: [VirtualTreeview] Cell Painting

Jim,

> From the PrepareCell method to the PaintTo method before the
> OnBeforeCellPaint. It appears the rectangle size will depend on grid
> lines being draw but other than that is should be ok.

Although I understand your concern I don't know where I could move the code to.
The only solution I
can see is to use an additional flag. But this requires to allow in
OnBeforeCellPaint to set this
flag. Better ideas?

Ciao, Mike

 | Replies | Author | Date
2978 | Re: Cell Painting | Jim Kueneman | Sun 7/8/2001
2996 | Re: Cell Painting | Mike Lischke | Mon 7/9/2001


re: Beta's

From: "Mike Lischke" [lists@l...]
Date: Sun Jul 8, 2001 2:49 pm
Subject: RE: [VirtualTreeview] Beta's

Wim,

> After reading a few e-mails i discovered the download area mentioned and
downloaded the
> 2.5 beta. Is there any documentation available yet? And any target
releasedates for this
> 2.x version?

This is the beta version. It is the very nature of the this intermediate
release not to be complete.
Otherwise I could publish it on my homepage. Btw. there is also a newer release
of the VT chm help
in this file area.

Ciao, Mike


re: Any planned release dates for 2.0

From: "Mike Lischke" [lists@l...]
Date: Sun Jul 8, 2001 2:49 pm
Subject: RE: [VirtualTreeview] Any planned release dates for 2.0

> I hope you use some kind of documentation generator so sources and on-line
> help are easily kept in sync and to keep the workload down.

The help (chm and plain html) of VT is being build with Time2Help. I could also
create the WinHelp
with it but somebody else has already taken the burden (see file area of YG).

Ciao, Mike


re: String tree descendant problems

From: "Mike Lischke" [lists@l...]
Date: Sun Jul 8, 2001 2:49 pm
Subject: RE: [VirtualTreeview] String tree descendant problems

Hi Werner,

> As to the options property, I believe they can be divided into different
groups. This will
> break existing code of course and require a good deal of search and replace
in thousands of
> lines in VirtualTrees.pas. Thus I do not expect that to happen anytime soon
(I would volunteer
> to do the boring search and replace job). However *if* this is to be done it
should better be
> before the final release is out.

I've thought about this a whole while already but I still hesitate to do the
split. I guess you are
right that this should happen before the next release, just give me some more
time.

> It would be desirable to have the options property near each other in the OI
but that would
> require to name them like 'Options, OptionsVisual, OptionsSelection' which
sounds odd.

I think it will be a new owned class. This is the most elegant solution with
the best extensibility.

> No, I'm afraid I couldn't make myself clear enough. I want to provide a
default drag and drop
> handling which deals with the tree node interfaces in my data pointers. My
DAD handling is
> based on yours (for instance changing the drop effect if ctrl or shift are
pressed, calling the
> events in the right places etc).

Now I understood what you meant. Well, also this is changed now. See the next
upload.

Ciao, Mike


re: Cell Painting

From: Jim Kueneman [jimdk@m...]
Date: Sun Jul 8, 2001 3:20 pm
Subject: RE: [VirtualTreeview] Cell Painting

At 04:49 PM 7/8/2001 +0200, you wrote:
>Jim,
>
> > From the PrepareCell method to the PaintTo method before the
> > OnBeforeCellPaint. It appears the rectangle size will depend on grid
> > lines being draw but other than that is should be ok.
>
>Although I understand your concern I don't know where I could move the
>code to. The only solution I
>can see is to use an additional flag. But this requires to allow in
>OnBeforeCellPaint to set this
>flag. Better ideas?

I though of that one too but did not like it. How about looking at the
Brush.Color before painting the cell in PrepareCell and use that color if
it is different from the column color. ie. just like in PaintText. We can
set the font color here why not be able to set the cell color using the
canvas too? I know "Not another event" but what about OnPaintCell?

Jim

 | Replies | Author | Date
2996 | Re: Cell Painting | Mike Lischke | Mon 7/9/2001


New file uploaded to VirtualTreeview

From: [VirtualTreeview@yahoogroups.com>
Date: Sun Jul 8, 2001 3:26 pm
Subject: New file uploaded to VirtualTreeview

Hello,

This email message is a notification to let you know that
a file has been uploaded to the Files area of the VirtualTreeview
group.

File : /VirtualTree_2.5.6.zip
Uploaded by : [lists@l...]
Description : Yet another beta

You can access this file at the URL

http://groups.yahoo.com/group/VirtualTreeview/files/VirtualTree_2.5.6.zip

To learn more about file sharing for your group, please visit

http://help.yahoo.com/help/us/groups/files

Regards,

lists@l...]

 | Replies | Author | Date
2980 | Re: New file uploaded to VirtualTreeview | Mike Lischke | Sun 7/8/2001
2981 | Re[2]: [VirtualTreeview] New file uploaded to Vir | prog-fr | Sun 7/8/2001
2982 | Re[2]: [VirtualTreeview] New file uploaded to Vir | Jim Kueneman | Sun 7/8/2001
2983 | Re: New file uploaded to VirtualTreeview | Moritz Franckenstein | Sun 7/8/2001
2986 | Re: New file uploaded to VirtualTreeview | Mike Lischke | Sun 7/8/2001
3001 | Re: New file uploaded to VirtualTreeview | Moritz Franckenstein | Mon 7/9/2001
3002 | Re: New file uploaded to VirtualTreeview | Moritz Franckenstein | Mon 7/9/2001
2993 | Getting VET back online | Jim Kueneman | Mon 7/9/2001
2994 | Was: Getting VET back online > Now: Big Bug in ne | Jim Kueneman | Mon 7/9/2001


re: New file uploaded to VirtualTreeview

From: "Mike Lischke" [lists@l...]
Date: Sun Jul 8, 2001 3:36 pm
Subject: RE: [VirtualTreeview] New file uploaded to VirtualTreeview

Hi all,

> This email message is a notification to let you know that
> a file has been uploaded to the Files area of the VirtualTreeview
> group.

This is new:

- reworked internal data handling which makes it easier for descentants to
"register" their needs
- Delphi 6 compatibility, run and design time packages included
- Delphi 5 run and design time package included
- consolidated DoDrag* and Drag* methods, DoDrag* methods only call their
appropriate events
- AddChild and InsertNode can now take a pointer to user data which is placed
into the first four
bytes of
a node's user data area (there must of course at least be 4 bytes user data).
- vsInitialUserData to indicate a node needs OnFreeNode even if it is not
"officially" initialized
- FDragSelection is now also a protected property
- LineMode, difficult to describe, see the screen shot folder on YG to get an
idea
- ContentToRTF improvements for correct table building
- ContentToHTML improvments and bug fixes
- changed CF_RTF* to CF_VRTF* to avoid identifier conflicts
- other small changes
- bug fixes

Can anybody send me design and runtime package for Delphi 4?

Jim,
you need some little rework again in VET. Please look up
AllocateInternalDataArea and InternalData
and how it is used in the string tree to allocate internal data. The second
line in the comment of
AllocateInternalDataArea should read:

// Result is the offset from the begin of the node to the internal data area of
the calling tree
class.

but you will see its use in the string tree anyway. The way this stuff is
implemented now should
improve the speed again a bit (because the total internal data size is now
cached).

To all again:
Please try out the new version and report all bugs in the Bug List table
located in the database
area of the VT mailing list.

Ciao, Mike

 | Replies | Author | Date
2981 | Re[2]: [VirtualTreeview] New file uploaded to Vir | prog-fr | Sun 7/8/2001
2982 | Re[2]: [VirtualTreeview] New file uploaded to Vir | Jim Kueneman | Sun 7/8/2001
2983 | Re: New file uploaded to VirtualTreeview | Moritz Franckenstein | Sun 7/8/2001
2986 | Re: New file uploaded to VirtualTreeview | Mike Lischke | Sun 7/8/2001
3001 | Re: New file uploaded to VirtualTreeview | Moritz Franckenstein | Mon 7/9/2001
3002 | Re: New file uploaded to VirtualTreeview | Moritz Franckenstein | Mon 7/9/2001
2993 | Getting VET back online | Jim Kueneman | Mon 7/9/2001
2994 | Was: Getting VET back online > Now: Big Bug in ne | Jim Kueneman | Mon 7/9/2001
3004 | Re: Was: Getting VET back online > Now: Big Bug i | Mike Lischke | Mon 7/9/2001


Re[2]: New file uploaded to VirtualTreeview

From: prog-fr [prog-fr@n...]
Date: Sun Jul 8, 2001 4:52 pm
Subject: Re[2]: [VirtualTreeview] New file uploaded to VirtualTreeview

Bonjour Mike,

Sunday, July 08, 2001, 5:36:52 PM, vous avez écrit:

ML> Hi all,

>> This email message is a notification to let you know that
>> a file has been uploaded to the Files area of the VirtualTreeview
>> group.

ML> This is new:

ML> - reworked internal data handling which makes it easier for descentants to
"register" their needs
ML> - Delphi 6 compatibility, run and design time packages included
ML> - Delphi 5 run and design time package included
ML> - consolidated DoDrag* and Drag* methods, DoDrag* methods only call their
appropriate events
ML> - AddChild and InsertNode can now take a pointer to user data which is
placed into the first four
ML> bytes of
ML>   a node's user data area (there must of course at least be 4 bytes user
data).
ML> - vsInitialUserData to indicate a node needs OnFreeNode even if it is not
"officially" initialized
ML> - FDragSelection is now also a protected property
ML> - LineMode, difficult to describe, see the screen shot folder on YG to get
an idea
ML> - ContentToRTF improvements for correct table building
ML> - ContentToHTML improvments and bug fixes
ML> - changed CF_RTF* to CF_VRTF* to avoid identifier conflicts
ML> - other small changes
ML> - bug fixes

ML> Can anybody send me design and runtime package for Delphi 4?

ML> Jim,
ML> you need some little rework again in VET. Please look up
AllocateInternalDataArea and InternalData
ML> and how it is used in the string tree to allocate internal data. The second
line in the comment of
ML> AllocateInternalDataArea should read:

ML> // Result is the offset from the begin of the node to the internal data
area of the calling tree
ML> class.

ML> but you will see its use in the string tree anyway. The way this stuff is
implemented now should
ML> improve the speed again a bit (because the total internal data size is now
cached).

ML> To all again:
ML> Please try out the new version and report all bugs in the Bug List table
located in the database
ML> area of the VT mailing list.

ML> Ciao, Mike

ML> To unsubscribe from this group, send an email to:
ML> [VirtualTreeview-unsubscribe@egroups.com

ML> Your use of Yahoo! Groups is subject to theYahoo! Terms of Service.

Sory but y have error in déclaration of : " function
DoDragDrop(const DataObject: IDataObject; KeyState: Integer; Pt:
TPoint;" when i compile VirtualTreesD6.dpk (VirtualExplorerTree)

--
Cordialement,
prog-fr mailto:prog-fr@n...]

 | Replies | Author | Date
2982 | Re[2]: [VirtualTreeview] New file uploaded to Vir | Jim Kueneman | Sun 7/8/2001


Re[2]: New file uploaded to VirtualTreeview

From: Jim Kueneman [jimdk@m...]
Date: Sun Jul 8, 2001 5:01 pm
Subject: Re[2]: [VirtualTreeview] New file uploaded to VirtualTreeview

Bonjour,

That file is my responsibility. If you are not using the
VirtualExplorerTree remove that file from the package until I get a chance
to update it to what Mike has changed in VT. I will update the zip file
right after I do the upgrade.

Jim

>Sory but y have error in déclaration of : " function
>DoDragDrop(const DataObject: IDataObject; KeyState: Integer; Pt:
>TPoint;" when i compile VirtualTreesD6.dpk (VirtualExplorerTree)


re: New file uploaded to VirtualTreeview

From: "Moritz Franckenstein" [franckenstein@a...]
Date: Sun Jul 8, 2001 5:07 pm
Subject: Re: New file uploaded to VirtualTreeview

> - reworked internal data handling which makes it easier for
descentants to "register" their needs

what does that mean (i also have derived a component from vt)?
do i have to change anything? or should i only change something?

> - AddChild and InsertNode can now take a pointer to user data which
is placed into the first four
> bytes of
> a node's user data area (there must of course at least be 4 bytes
user data).
> - vsInitialUserData to indicate a node needs OnFreeNode even if it
is not "officially" initialized

wonderful! thank you!
is this flag automatically set when addchild gets the optional
pointer?

> - LineMode, difficult to describe, see the screen shot folder on YG
to get an idea

cool *g*. really. thank you.

-moritz

 | Replies | Author | Date
2986 | Re: New file uploaded to VirtualTreeview | Mike Lischke | Sun 7/8/2001
3001 | Re: New file uploaded to VirtualTreeview | Moritz Franckenstein | Mon 7/9/2001
3002 | Re: New file uploaded to VirtualTreeview | Moritz Franckenstein | Mon 7/9/2001


re: [IBO] Virtual Tree, IBO4 and Delphi6

From: "Paul Gallagher" [paul@t...]
Date: Sun Jul 8, 2001 8:10 pm
Subject: Re: [IBO] Virtual Tree, IBO4 and Delphi6

There is something with this new DesignIntf vs DsgnIntf thing, that I do no
understand. Apparently, I am going to have to split my component into two
seperate pieces, a design and a runtime package. I'm really not at all sure
how to do this, so if anyone can shed some light, I'd appreciate it.

I also have to do something with OnDragDrop. Mike made a change to this, so
I will have to do something with it.

Thanks,
Paul

----- Original Message -----
From: "Lester Caine" [lester@l...]
To: <IBObjects@yahoogroups.com>
Sent: Sunday, July 08, 2001 9:32 AM
Subject: Re: [IBO] Virtual Tree, IBO4 and Delphi6

> I have just posted to VirtualTree about getting the latest
> version to compile on Builder 5, with a view to getting it
> working with IBO as well.
>
> The version I have is VirtualTree_2.5.1.
>
> I have just got the components to compile with IBO3.6D ( my
> own version with some of the colours changed ) and am now
> trying to see if it actually works!
>
> --
> Lester Caine
> -----------------------------
> L.S.Caine Electronic Services
>
>
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>
>

 | Replies | Author | Date
2987 | Re: [IBO] Virtual Tree, IBO4 and Delphi6 | Mike Lischke | Sun 7/8/2001
2990 | Re: [IBO] Virtual Tree, IBO4 and Delphi6 | Paul Gallagher | Sun 7/8/2001
2998 | Re: [IBO] Virtual Tree, IBO4 and Delphi6 | Mike Lischke | Mon 7/9/2001


Format?

From: [duke_n5@h...]
Date: Sun Jul 8, 2001 8:18 pm
Subject: Format?

I need to especially format several nodes(I am using StringTree) -
for example use another back color and/or font on them.

It was quite simple on TTreeview and even on TVirtualStringTree1.0 ,
but I seem to have problem with it on VT2.

plz plz help

 | Replies | Author | Date
2988 | Re: Format? | Mike Lischke | Sun 7/8/2001
2989 | Re: Format? | [duke_n5@h...] | Sun 7/8/2001
2992 | Re: Format? | Jim Kueneman | Sun 7/8/2001
2997 | Re: Format? | Mike Lischke | Mon 7/9/2001


re: Re: New file uploaded to VirtualTreeview

From: "Mike Lischke" [lists@l...]
Date: Sun Jul 8, 2001 8:18 pm
Subject: RE: [VirtualTreeview] Re: New file uploaded to VirtualTreeview

Hi Moritz,

> > - reworked internal data handling which makes it easier for
> descentants to "register" their needs
>
> what does that mean (i also have derived a component from vt)?
> do i have to change anything? or should i only change something?

If you use internal data in your component then yes. The changes are quite
simple, though. Remove
TotalInternalNodeDataSize and InternalDataSize and call instead the
registration method (see what
the string tree does in its constructor). For convinience I recommend to keep
InternalData to return
the correct pointer to the internal data (again see what the string tree does
there).

> > - vsInitialUserData to indicate a node needs OnFreeNode even if it
> is not "officially" initialized
>
> wonderful! thank you!
> is this flag automatically set when addchild gets the optional
> pointer?

Of course :o]

> > - LineMode, difficult to describe, see the screen shot folder on YG
> to get an idea
>
> cool *g*. really. thank you.

This one was quite tough, but I made it finally ...

Ciao, Mike

 | Replies | Author | Date
3001 | Re: New file uploaded to VirtualTreeview | Moritz Franckenstein | Mon 7/9/2001
3002 | Re: New file uploaded to VirtualTreeview | Moritz Franckenstein | Mon 7/9/2001


re: Re: [IBO] Virtual Tree, IBO4 and Delphi6

From: "Mike Lischke" [lists@l...]
Date: Sun Jul 8, 2001 8:21 pm
Subject: RE: [VirtualTreeview] Re: [IBO] Virtual Tree, IBO4 and Delphi6

Hi Paul,

> There is something with this new DesignIntf vs DsgnIntf thing, that I do no
> understand. Apparently, I am going to have to split my component into two
> seperate pieces, a design and a runtime package. I'm really not at all sure
> how to do this, so if anyone can shed some light, I'd appreciate it.

This is actually not that difficult. Make a package without design time stuff
(as with VT I left out
the dcr and the registration file). Mark this a being run time only. Build then
a bpl with it and
create a new package which only gets the dcr and the registration unit (with
IDE experts or
whatever). Mark this as design time package, include the new bpl just build in
the requires clause
and install it. You have to make sure the path where the bpl is is also in the
search path of the
system (as with most other DLLs).

Ciao, Mike


re: Format?

From: "Mike Lischke" [lists@l...]
Date: Sun Jul 8, 2001 8:23 pm
Subject: RE: [VirtualTreeview] Format?

Hi duke_n5,

> I need to especially format several nodes(I am using StringTree) -
> for example use another back color and/or font on them.

Very simple, really. Assign a handler to the OnPaintText event and change the
provided canvas to
whatever you like (including font).

Ciao, Mike

 | Replies | Author | Date
2989 | Re: Format? | [duke_n5@h...] | Sun 7/8/2001
2992 | Re: Format? | Jim Kueneman | Sun 7/8/2001
2997 | Re: Format? | Mike Lischke | Mon 7/9/2001


re: Format?

From: [duke_n5@h...]
Date: Sun Jul 8, 2001 8:42 pm
Subject: Re: Format?

> Very simple, really. Assign a handler to the OnPaintText event and
change the provided canvas to
> whatever you like (including font).
>
> Ciao, Mike

That is very good, thanks, but how do I change the background?
Just changing Canvas.Brush.Color doesn't seem to do anything, and in
order to fill a Node Rect, I must know where that rect is (and
OnPaintText doesn't have it)

 | Replies | Author | Date
2992 | Re: Format? | Jim Kueneman | Sun 7/8/2001
2997 | Re: Format? | Mike Lischke | Mon 7/9/2001


re: Re: [IBO] Virtual Tree, IBO4 and Delphi6

From: "Paul Gallagher" [paul@t...]
Date: Sun Jul 8, 2001 9:02 pm
Subject: Re: [VirtualTreeview] Re: [IBO] Virtual Tree, IBO4 and Delphi6

Well, that was fun! I'm sure there will be some bugs to work out, but at least
IB_VTree compiles and runs.

I'm sure Borland must have had a real good reason for what they did, but it
sure has caused a lot of grief for a lot of component writers. After I do some
testing, and after a couple bottles of beer.(Or is that bier?) I'll get the
revisions up on the Yahoo site.

Paul
----- Original Message -----
From: Mike Lischke
To: VirtualTreeview@yahoogroups.com
Sent: Sunday, July 08, 2001 3:21 PM
Subject: RE: [VirtualTreeview] Re: [IBO] Virtual Tree, IBO4 and Delphi6

Hi Paul,

> There is something with this new DesignIntf vs DsgnIntf thing, that I do no
> understand. Apparently, I am going to have to split my component into two
> seperate pieces, a design and a runtime package. I'm really not at all sure
> how to do this, so if anyone can shed some light, I'd appreciate it.

This is actually not that difficult. Make a package without design time stuff
(as with VT I left out
the dcr and the registration file). Mark this a being run time only. Build
then a bpl with it and
create a new package which only gets the dcr and the registration unit (with
IDE experts or
whatever). Mark this as design time package, include the new bpl just build
in the requires clause
and install it. You have to make sure the path where the bpl is is also in
the search path of the
system (as with most other DLLs).

Ciao, Mike

To unsubscribe from this group, send an email to:
VirtualTreeview-unsubscribe@egroups.com

Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.

[Non-text portions of this message have been removed]

 | Replies | Author | Date
2998 | Re: [IBO] Virtual Tree, IBO4 and Delphi6 | Mike Lischke | Mon 7/9/2001


re: Version numbers

From: Raymond Wilson [raymond.wilson@t...]
Date: Sun Jul 8, 2001 9:56 pm
Subject: RE: [VirtualTreeview] Version numbers

Hi Mike,

I still hang around EE a little, but it's changed, I've changed and other
priorities abound!

Keep up the good work!

Cheers,

Raymond.

-----Original Message-----
From: Mike Lischke [mailto:[lists@l...]]
Sent: Sunday, July 08, 2001 9:42 PM
To: VirtualTreeview@yahoogroups.com
Subject: RE: [VirtualTreeview] Version numbers

Hi Ray,

long time no speak :o] Still active on experts-exchange?

> I have noticed a bunch of archived releases in the files area with version
> numbers like 2.4.*, and more recent ones marked 2.5.* in the top of the
> files tree. These are all marked as beta. Was there a 'release' build of
> 2.4, or did the build number get too high and roll over to 2.5? :-)

Well, I felt it was time to increase the minor build number after a couple
of build increases. There
is enough which had changed in the mean time to justfy this increase.

> Is there an intended version number the the release version of the current
> virtual treeview development?

No, no particular number is intended for release. It will happen whenever I
have ready the new
documentation.

Ciao, Mike

To unsubscribe from this group, send an email to:
VirtualTreeview-unsubscribe@egroups.com

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/


re: Re: Format?

From: Jim Kueneman [jimdk@m...]
Date: Sun Jul 8, 2001 11:46 pm
Subject: Re: [VirtualTreeview] Re: Format?

At 08:42 PM 7/8/2001 +0000, you wrote:

> > Very simple, really. Assign a handler to the OnPaintText event and
>change the provided canvas to
> > whatever you like (including font).
> >
> > Ciao, Mike
>
>
>That is very good, thanks, but how do I change the background?
>Just changing Canvas.Brush.Color doesn't seem to do anything, and in
>order to fill a Node Rect, I must know where that rect is (and
>OnPaintText doesn't have it)

OnBeforeCellPaint and use the canvas and rect passed. Fill it your self
with Canvas.FillRect or equivalent. NOTE: this has problems if you are
using column colors, the subject matter from the "Cell Painting" thread.

Jim


Getting VET back online

From: Jim Kueneman [jimdk@m...]
Date: Mon Jul 9, 2001 4:34 am
Subject: Getting VET back online

>Jim,
>you need some little rework again in VET. Please look up
>AllocateInternalDataArea and InternalData
>and how it is used in the string tree to allocate internal data. The
>second line in the comment of
>AllocateInternalDataArea should read:

Hi Mike,

I have this almost worked out but something I did that worried me has
come back to haunt me. I have been "using" the fact that RootNode is
nothing more than a normal node and assigning data to it. Well with the
new data scheme has bitten me. When I retrieve the "data" from the root
node and write to it I overwrite some memory that is part of the "+"
TBitmap class. The reason I do this is so I can hide the root tree
node. I did it by making the RootNode the root tree node so now only it
children are shown and it looks like a flat listview.

This is a simple way to do this so is it possible to make the RootNode
just like anyother node again and let it have UserData? Please
:^) Pretty Please ;^) I have been trying to answer a lot of questions
to take some load off you <Blackmail>. Please <g>?

Jim

 | Replies | Author | Date
2994 | Was: Getting VET back online > Now: Big Bug in ne | Jim Kueneman | Mon 7/9/2001
3004 | Re: Was: Getting VET back online > Now: Big Bug i | Mike Lischke | Mon 7/9/2001
3003 | Re: Getting VET back online | Mike Lischke | Mon 7/9/2001
3009 | Re: Getting VET back online | Jim Kueneman | Mon 7/9/2001
3010 | Re: Getting VET back online | Moritz Franckenstein | Mon 7/9/2001
3011 | Re: Getting VET back online | Mike Lischke | Mon 7/9/2001


Was: Getting VET back online > Now: Big Bug in new InternalData

From: Jim Kueneman [jimdk@m...]
Date: Mon Jul 9, 2001 6:02 am
Subject: Was: Getting VET back online > Now: Big Bug in new InternalData

> This is a simple way to do this so is it possible to make the RootNode
> just like any other node again and let it have UserData? Please

Ok maybe this is not the problem. Has anyone gotten their descendant to work?

Found it. Mike are you trying to make my wife file for divorce because I
am sitting at this damn computer to long <g> After about 3 hours I
finally figured it out.

Line 23292

PInteger(InternalData(Node))^ := CalculateTextWidth(Canvas, Node,
Column, Text);

Think about that line for awhile and let me know if you need a hint ;^)

"Theme from Jeopardy plays in the background"

Need a hint........

InternalData is virtual.......

..........

Need another hint.......

Who's data did you just obliterate?

........

I fixed it by not declaring InternalData virutal and reintroducing it in
the Descendant that way the each class will only calls its own version of
the method. I am too tired to think if that will work with more decendants
so....that may or may not be a good thing but at least it did not give me AV's

Sorry I did not put this on the database but I wanted to make sure I saved
anyone else some time trying to get a descendant working, plus I am cranky
since I spend half the day discovering a quirky little gotcha with
IFolder2.GetDetailsOf and the other half chasing this down. On the
brighter side I held a copy of D6 in my hands, and almost purchased it. If
I was not about to take 2 expensive vacations in the next 4 weeks I would
have spent this evening installing D6 instead of having this fun. I am
going to bed.

Jim

< I am just kidding Mike ;^) >

 | Replies | Author | Date
3004 | Re: Was: Getting VET back online > Now: Big Bug i | Mike Lischke | Mon 7/9/2001


what happened to MVCDemo?

From: "Remco v.d. Woestijne" [woestijn@h...]
Date: Sun Jul 8, 2001 10:30 pm
Subject: what happened to MVCDemo?

I can no longer find the MVC Demo by Marian Aldenhövel in
the VirtualTree Demos.zip. Does it no longer work with the
newer versions of VirtualTree? Or has it lost its value?

Ramco

 | Replies | Author | Date
3044 | Re: what happened to MVCDemo? | Mike Lischke | Tue 7/10/2001


re: Cell Painting

From: "Mike Lischke" [lists@l...]
Date: Mon Jul 9, 2001 8:13 am
Subject: RE: [VirtualTreeview] Cell Painting

Hi Jim,

> I though of that one too but did not like it. How about looking at the
> Brush.Color before painting the cell in PrepareCell and use that color if
> it is different from the column color. ie. just like in PaintText. We can
> set the font color here why not be able to set the cell color using the
> canvas too? I know "Not another event" but what about OnPaintCell?

Well, I think I have a better idea. I moved DoBeforeCellPaint to PrepareCell
(after the column color
application) so you can easily change the appearence. This will cause a bit
overdraw (since the
background is erased by the tree *and* by your descentant/application), but
this is only very small
overhead.

Ciao, Mike


re: Re: Format?

From: "Mike Lischke" [lists@l...]
Date: Mon Jul 9, 2001 8:13 am
Subject: RE: [VirtualTreeview] Re: Format?

> That is very good, thanks, but how do I change the background?
> Just changing Canvas.Brush.Color doesn't seem to do anything, and in
> order to fill a Node Rect, I must know where that rect is (and
> OnPaintText doesn't have it)

Use the OnBeforeCellPaint event for erasing the background.

Ciao, Mike


re: Re: [IBO] Virtual Tree, IBO4 and Delphi6

From: "Mike Lischke" [lists@l...]
Date: Mon Jul 9, 2001 8:13 am
Subject: RE: [VirtualTreeview] Re: [IBO] Virtual Tree, IBO4 and Delphi6

Paul,

> I'm sure Borland must have had a real good reason for what they did, but it
sure has
> caused a lot of grief for a lot of component writers. After I do some
testing, and after
> a couple bottles of beer.(Or is that bier?) I'll get the revisions up on the
Yahoo site.

I thought a while about whether to split into design and run time package or
not. Actually, it is
only necessary for programmers who use run time packages. I do not because I
had serious trouble
with them. Imagine the case a developer of Delphi x.01 installs run time
packages created with
version x.02. Either some entry points may not be found (the lesser evil) or
you overwrite other
bpls (this case is the worst). Also here, the DLL hell (as Microsoft calls it)
appears.

But *if* you use run time packages and have not splitted your dpk files then
the bpl will also
contain all the design time stuff which is not only waste of resources but also
a violation of the
Delphi license agreement which states that a developer is not allowed to
distribute Delphi stuff
(source, bpls or design time code etc.).

Ciao, Mike


re: VT 2.5.1 + Notification + AV problem

From: "Will Watts" [willw@a...]
Date: Mon Jul 9, 2001 8:59 am
Subject: RE: [VirtualTreeview] VT 2.5.1 + Notification + AV problem

Mike,

I wrote:

> I seem to have a funny with VT 2.5.1. I have been getting
> occasional AV's on shutdown of the owning form. Tracking them
> down, they seem to be caused by TBaseVirtualTree.Notification.
>
> The problem seems to be that a VT somehow gets a notification link
> to itself, so Notification gets called during the call to the
> inherited destructor with AComponent set to itself.

Then you wrote:

> Sorry, but I cannot reproduce this behaviour.

<Baffled> I can make it happen in a stripped down application,
comprising nothing but a form and a String tree with some design
time nodes slung into it. Set a breakpoint in Notification and off you
go.

I wonder what is going on :-(

W

Will Watts Direct Line +44 20 8400 6104
Applied Industrial Systems Ltd Main Voice +44 20 8400 6100
10 Barley Mow Passage Fax +44 20 8742 2456
Chiswick London W4 4PH Web http://www.applied.co.uk

 | Replies | Author | Date
3058 | Re: VT 2.5.1 + Notification + AV problem | Mike Lischke | Thu 7/12/2001


re: New file uploaded to VirtualTreeview

From: GIANNAKOPOULOS KOSTAS [kyan@s...]
Date: Mon Jul 9, 2001 9:21 am
Subject: RE: [VirtualTreeview] New file uploaded to VirtualTreeview

Good morning, mike.

I haven't yet downloaded the new version, but i've read your announcement.

> - AddChild and InsertNode can now take a pointer to user data
> which is placed into the first four
> bytes of
> a node's user data area (there must of course at least be 4
> bytes user data).

Interesting addition, but incomplete. It won't help much if the user data is
a record instead of just a pointer.

Just some thoughts:

Since you can find the size of the user data, you *could* copy NodeDataSize
bytes from the passed pointer parameter straight to the user data area,
instead of just a pointer.

The problem that would arise from this would be if the user data had
reference-counted members (strings, variants, interface pointers), ant it
will, most of the time.

I took a look at System.pas to see if there is a generic routine like
Finalize() (which releases all ref-counted data members of a record) that
would copy a record structure AddRef'ing all ref-counted data members and i
saw that there *seems* to be a magic function that does this: _CopyRecord.
You cannot call this directly but you can call it like this:

procedure CopyRecord(const Source, Dest; TypeInfo: Pointer);
asm
MOV EAX, Dest
MOV EDX, Source
MOV ECX, TypeInfo
CALL [system.@C...]
end;

I suspect that he "MOV" instructions are not necessary; i'm no assembly
expert like you.
Notice that the "_" is replaced by a "@". This can be done for all exported
magic functions in system.pas.

So, maybe you could change AddChild (or provide an overloaded version) that
would be like this:

function TBaseVirtualTree.AddChild(Parent: PVirtualNode; UserDataTypeInfo:
Pointer; UserData: Pointer): PVirtualNode;

And the user would do:

var
MyData: TMyNodeData;
begin
MyData.Text := 'MyText';
MyData.ImageIndex := 1;
VT.AddChild(nil, TypeInfo(TMyNodeData), @MyData);
end;

The next step is to introduce a GetDataTypeInfo event and use it instead of
asking for it every time.
I suspect that there is a way to figure out the value of NodeDataSize from
the TypeInfo pointer.

I'm not sure that this technique will work at all and i don't know if you
like it, but you might want to give it a shot if you do.

<KY>

 | Replies | Author | Date
3059 | Re: New file uploaded to VirtualTreeview | Mike Lischke | Thu 7/12/2001


re: New file uploaded to VirtualTreeview

From: "Moritz Franckenstein" [franckenstein@a...]
Date: Mon Jul 9, 2001 9:28 am
Subject: Re: New file uploaded to VirtualTreeview

> > > - LineMode, difficult to describe, see the screen shot folder
on YG
> > to get an idea
> >
> > cool *g*. really. thank you.
>
> This one was quite tough, but I made it finally ...

yes, very good. but you should use the line style of the grid lines
when linemode is set to lmBand. zumindest for the horizontal parts of
the "treelines". or did i oversee a property to configure the
treelinestyle?

-moritz

 | Replies | Author | Date
3002 | Re: New file uploaded to VirtualTreeview | Moritz Franckenstein | Mon 7/9/2001


re: New file uploaded to VirtualTreeview

From: "Moritz Franckenstein" [franckenstein@a...]
Date: Mon Jul 9, 2001 9:34 am
Subject: Re: New file uploaded to VirtualTreeview

> yes, very good. but you should use the line style of the grid lines
> when linemode is set to lmBand. zumindest for the horizontal parts
of
> the "treelines". or did i oversee a property to configure the
> treelinestyle?
>
> -moritz

ok, ok, sorry, i thought it was a linestyle but it only was a color.
and that can be set with the colors property. now it looks correct.

-moritz


re: Getting VET back online

From: "Mike Lischke" [lists@l...]
Date: Mon Jul 9, 2001 9:52 am
Subject: RE: [VirtualTreeview] Getting VET back online

Hi Jim,

> I have been "using" the fact that RootNode is
> nothing more than a normal node and assigning data to it. Well with the
> new data scheme has bitten me. When I retrieve the "data" from the root
> node and write to it I overwrite some memory that is part of the "+"
> TBitmap class.

I don't understand how this can happen. Do you use internal or user data for
this stuff? The hidden
root node always got the same amount of internal data as any other node in the
tree.

> This is a simple way to do this so is it possible to make the RootNode
> just like anyother node again and let it have UserData? Please
> :^) Pretty Please ;^) I have been trying to answer a lot of questions
> to take some load off you <Blackmail>. Please <g>?

8-) How can I resist? But perhaps internal data is enough?

Ciao, Mike

 | Replies | Author | Date
3009 | Re: Getting VET back online | Jim Kueneman | Mon 7/9/2001
3010 | Re: Getting VET back online | Moritz Franckenstein | Mon 7/9/2001
3011 | Re: Getting VET back online | Mike Lischke | Mon 7/9/2001


re: Was: Getting VET back online > Now: Big Bug in new InternalData

From: "Mike Lischke" [lists@l...]
Date: Mon Jul 9, 2001 9:52 am
Subject: RE: [VirtualTreeview] Was: Getting VET back online > Now: Big Bug in new InternalData

> I fixed it by not declaring InternalData virutal and reintroducing it in
> the Descendant that way the each class will only calls its own version of
> the method. I am too tired to think if that will work with more decendants
> so....that may or may not be a good thing but at least it did not give me AV's

No, no this should be very fine. I have already changed it because Vadim made
me aware of this
serious mistake. Sorry for this, I simply overlooked it when I removed the
other methods.

> < I am just kidding Mike ;^) >

Never understood it the other way :o]

Ciao, Mike


re: Probably simple question

From: [acidleia@h...]
Date: Mon Jul 9, 2001 11:07 am
Subject: Re: Probably simple question

--- In [VirtualTreeview@y...], Werner Lehmann [wl@b...] wrote:
> Werner Lehmann wrote:
> >
> > if (vsHasChildren in Node.States) and (Node.ChildCount = 0) then
> > InitChildren(Node);
>
> Oops. Replace Node by Parent.
>
> Werner

Ok, thanks a lot for the example and the answers!

/Mikael Stalvik


Moving selection up/down

From: [acidleia@h...]
Date: Mon Jul 9, 2001 11:44 am
Subject: Moving selection up/down

Hi.

I would like to know if there's any possiblity to move a selection of
nodes on the same level (all siblings) any steps up/down withint the
same level.

The selection contains arbitary selected nodes (multiselect=true).

I mainly would like to move the items by a drag and drop operation,
such as when you move items in Winamp's playlist for example.

I hope that I have expressed myself understandable. :)

Thanks in advance,
Mikael Stalvik

 | Replies | Author | Date
3014 | Re: Moving selection up/down | Werner Lehmann | Mon 7/9/2001


Errors at trying to compile TExplorerTreeView

From: [Chris.Schindler@g...]
Date: Mon Jul 9, 2001 12:39 pm
Subject: Errors at trying to compile TExplorerTreeView

Hi all,
I installed TVirtualTreeView 2.5.6 successfully into the IDE :) But I
have problems to install the newest TVirtualExplorerTreeView :( I
tried to added it to the VirtualTreesD5d.dpk and I get many errors :

[Error] VirtualExplorerTree.pas(1051): Declaration of 'DoDragDrop'
differs from previous declaration
[Error] VirtualExplorerTree.pas(1053): Method 'DoDragEnter' not found
in base class
[Error] VirtualExplorerTree.pas(1055): Method 'DoDragLeave' not found
in base class
[Error] VirtualExplorerTree.pas(1056): Declaration of 'DoDragOver'
differs from previous declaration
[Warning] VirtualExplorerTree.pas(1085): Method 'InternalData' hides
virtual method of base type 'TCustomVirtualStringTree'
[Error] VirtualExplorerTree.pas(1095): Method 'TotalInternalDataSize'
not found in base class
[Error] VirtualExplorerTree.pas(1608): Incompatible types: 'TObject'
and 'IDataObject'
[Error] VirtualExplorerTree.pas(1608): Incompatible types: 'TPoint'
and 'TFormatArray'
[Error] VirtualExplorerTree.pas(1650): Undeclared
identifier: 'DoDragEnter'
[Error] VirtualExplorerTree.pas(1694): Incompatible
types: 'TShiftState' and 'Integer'
[Error] VirtualExplorerTree.pas(1694): Incompatible
types: 'TDropMode' and 'Integer'
[Error] VirtualExplorerTree.pas(1926): Undeclared
identifier: 'InternalDataSize'
[Error] VirtualExplorerTree.pas(3251): Undeclared
identifier: 'TPaintOptions'
[Error] VirtualExplorerTree.pas(3300): Incompatible types
[Fatal Error] VirtualTreesD5D.dpk(37): Could not compile used
unit 'VirtualExplorerTree.pas'

How can I successfully install TVirtualExplorerView?

Thank you very much for your help
Christian

 | Replies | Author | Date
3008 | Re: Errors at trying to compile TExplorerTreeView | Jim Kueneman | Mon 7/9/2001
3015 | Re: Errors at trying to compile TExplorerTreeView | Werner Lehmann | Mon 7/9/2001
3016 | Re: Errors at trying to compile TExplorerTreeView | Jim Kueneman | Mon 7/9/2001
3017 | Re: Errors at trying to compile TExplorerTreeView | Mike Lischke | Mon 7/9/2001


re: Errors at trying to compile TExplorerTreeView

From: Jim Kueneman [jimdk@m...]
Date: Mon Jul 9, 2001 1:18 pm
Subject: Re: [VirtualTreeview] Errors at trying to compile TExplorerTreeView

At 12:39 PM 7/9/2001 +0000, you wrote:

>How can I successfully install TVirtualExplorerView?

I'm working on it, I'm working on it. If Mike would quit making
fundamental changes to the DragDrop COM handlers (Ok he just renamed them
but I have not been able to get VET working enough to see if the changes he
made in the DragDrop are compatible with VET) and leave the bugs in his
other projects I would have it working by now. Only one more problem (I
hope) and it will be ready.

Jim


re: Getting VET back online

From: Jim Kueneman [jimdk@m...]
Date: Mon Jul 9, 2001 1:34 pm
Subject: RE: [VirtualTreeview] Getting VET back online

At 11:52 AM 7/9/2001 +0200, you wrote:
>Hi Jim,
>
> > I have been "using" the fact that RootNode is
> > nothing more than a normal node and assigning data to it. Well with the
> > new data scheme has bitten me. When I retrieve the "data" from the root
> > node and write to it I overwrite some memory that is part of the "+"
> > TBitmap class.
>
>I don't understand how this can happen. Do you use internal or user data
>for this stuff? The hidden
>root node always got the same amount of internal data as any other node in
>the tree.

Actually it does not. Look at

constructor TBaseVirtualTree.Create(AOwner: TComponent);
inherited;
....................
FTotalInternalDataSize := 0;
.....................
InitRootNode;
..................
end;

constructor TCustomVirtualStringTree.Create(AOwner: TComponent);
begin
inherited;
FInternalDataOffset := AllocateInternalDataArea(SizeOf(Cardinal));
FDefaultText := 'Node';
FStringOptions := DefaultStringOptions;
end;

constructor TCustomVirtualExplorerTree.Create(AOwner: TComponent);
begin
inherited;
FInternalDataOffset := AllocateInternalDataArea( SizeOf(TNodeData));
............
end;

The InitRootNode is called before any decendant has a change to increase
the FTotalInternalDataSize by registering more data. Thus the RootNode
gets 0 extra bytes.

One, kludgy way is to require the AllocateInternalDataArea
and FTotalInternalDataSize := 0 to be made before the inherited
call. That is how I have temporaraly made it work.

Jim

 | Replies | Author | Date
3010 | Re: Getting VET back online | Moritz Franckenstein | Mon 7/9/2001
3011 | Re: Getting VET back online | Mike Lischke | Mon 7/9/2001


re: Getting VET back online

From: "Moritz Franckenstein" [franckenstein@a...]
Date: Mon Jul 9, 2001 2:14 pm
Subject: Re: Getting VET back online

> > > I have been "using" the fact that RootNode is
> > > nothing more than a normal node and assigning data to it. Well

i would also be interested to put custom data into the hidden root
node to make things more consistently.

it would be nice if i could abandon (?verzichten) setting the
rootnodecount and making special checks for the rootnodes in the
OnInitNode event. the hidden root node could determine his childcount
at his own, like any normal node.

is this possible? or could it be made possible?

-moritz


re: Getting VET back online

From: "Mike Lischke" [lists@l...]
Date: Mon Jul 9, 2001 5:40 pm
Subject: RE: [VirtualTreeview] Getting VET back online

Jim,

>
> The InitRootNode is called before any decendant has a change to increase
> the FTotalInternalDataSize by registering more data. Thus the RootNode
> gets 0 extra bytes.

You are talking about internal data, not user data. FRoot has this data area
too but I forgot to
reinitialize it when internal data is allocated. Also this is fixed with the
new build.

Ciao, Mike


New file uploaded to VirtualTreeview

From: [VirtualTreeview@yahoogroups.com>
Date: Mon Jul 9, 2001 5:47 pm
Subject: New file uploaded to VirtualTreeview

Hello,

This email message is a notification to let you know that
a file has been uploaded to the Files area of the VirtualTreeview
group.

File : /VirtualTree_2.5.7.zip
Uploaded by : [lists@l...]
Description : Yet another beta

You can access this file at the URL

http://groups.yahoo.com/group/VirtualTreeview/files/VirtualTree_2.5.7.zip

To learn more about file sharing for your group, please visit

http://help.yahoo.com/help/us/groups/files

Regards,

lists@l...]


2 Mike (was Re: Errors at trying to compile TExplorerTreeView)

From: "Vadim Sedulin" [wsntrl@o...]
Date: Mon Jul 9, 2001 1:24 pm
Subject: 2 Mike (was Re: [VirtualTreeview] Errors at trying to compile TExplorerTreeView)

Hello Mike!

> I installed TVirtualTreeView 2.5.6 successfully into the IDE :) But I
> have problems to install the newest TVirtualExplorerTreeView :( I
> tried to added it to the VirtualTreesD5d.dpk and I get many errors :

...

> How can I successfully install TVirtualExplorerView?

I think it would be better to remove VET from VT package...

Bye.

Vadim Sedulin
E-Mail: [wsntrl@o...]

 | Replies | Author | Date
3019 | VET 1.5.7 is compatible (let's hope) | Jim Kueneman | Tue 7/10/2001
3022 | Re: VET 1.5.7 is compatible (let's hope) | [Chris.Schindler@g...] | Tue 7/10/2001
3025 | Re: VET 1.5.7 is compatible (let's hope) | Jim Kueneman | Tue 7/10/2001
3029 | Re: VET 1.5.7 is compatible (let's hope) | prog-fr | Tue 7/10/2001
3034 | Re: VET 1.5.7 is compatible (let's hope) | [adembaba@e...] | Tue 7/10/2001
3035 | Re: VET 1.5.7 is compatible (let's hope) | Jim Kueneman | Tue 7/10/2001


re: Moving selection up/down

From: Werner Lehmann [wl@b...]
Date: Mon Jul 9, 2001 7:12 pm
Subject: Re: [VirtualTreeview] Moving selection up/down

Hi Mikael,

> I would like to know if there's any possiblity to move a selection of
> nodes on the same level (all siblings) any steps up/down withint the
> same level.
>
> The selection contains arbitary selected nodes (multiselect=true).
>
> I mainly would like to move the items by a drag and drop operation,
> such as when you move items in Winamp's playlist for example.
>
> I hope that I have expressed myself understandable. :)

I am not sure. Do you want to move up/down each single selection thus
keeping the (possible) gaps between selected nodes? What if a selected
node is the first and you cannot move it up? What sense does this all
make?

Maybe you just want to have a multi selection and drag and drop move
it with any dropmode w.r.t. a drop node. Some months ago I have found
that the easiest way was to lock updates (BeginUpdate), create a new
tmp root node, move all selected nodes into this tmp node, then move
the tmp node with ChildrenOnly param of MoveTo to the drop node and
delete the tmp node, then EndUpdate.

This works also very good with selected items which are not siblings.
And if you use a sorted selection (GetSortedSelection) the nodes will
also be inserted / moved in order and you don't have to care about
selected child nodes of selected nodes (Resolve parameter).

Regards,
Werner


re: Errors at trying to compile TExplorerTreeView

From: Werner Lehmann [wl@b...]
Date: Mon Jul 9, 2001 7:13 pm
Subject: Re: [VirtualTreeview] Errors at trying to compile TExplorerTreeView

Hi Jim,

> I'm working on it, I'm working on it. If Mike would quit making
> fundamental changes to the DragDrop COM handlers (Ok he just renamed them

I am sorry but it was because of my begging and bugging that Mike did this.
And it really helped me a lot with my descendant and is now VCL conform.

Werner

 | Replies | Author | Date
3016 | Re: Errors at trying to compile TExplorerTreeView | Jim Kueneman | Mon 7/9/2001
3017 | Re: Errors at trying to compile TExplorerTreeView | Mike Lischke | Mon 7/9/2001


re: Errors at trying to compile TExplorerTreeView

From: "Jim Kueneman" [jimdk@m...]
Date: Mon Jul 9, 2001 7:52 pm
Subject: Re: Errors at trying to compile TExplorerTreeView

--- In [VirtualTreeview@y...], Werner Lehmann [wl@b...] wrote:

Werner,

> I am sorry but it was because of my begging and bugging that Mike
did this.
> And it really helped me a lot with my descendant and is now VCL
conform.

I know just giving Mike a hard time, no need to apologize I think it
is better now too.

Jim

 | Replies | Author | Date
3017 | Re: Errors at trying to compile TExplorerTreeView | Mike Lischke | Mon 7/9/2001


re: Re: Errors at trying to compile TExplorerTreeView

From: "Mike Lischke" [lists@l...]
Date: Mon Jul 9, 2001 9:06 pm
Subject: RE: [VirtualTreeview] Re: Errors at trying to compile TExplorerTreeView

> I know just giving Mike a hard time, no need to apologize I think it
> is better now too.

Watch out, I read you ALL ;-)


New file uploaded to VirtualTreeview

From: [VirtualTreeview@yahoogroups.com>
Date: Tue Jul 10, 2001 4:26 am
Subject: New file uploaded to VirtualTreeview

Hello,

This email message is a notification to let you know that
a file has been uploaded to the Files area of the VirtualTreeview
group.

File : /VET_V1.5.7.zip
Uploaded by : [jimdk@m...]
Description : Virtual Explorer Tree Version 1.5.7 with Demo Executable

You can access this file at the URL

http://groups.yahoo.com/group/VirtualTreeview/files/VET_V1.5.7.zip

To learn more about file sharing for your group, please visit

http://help.yahoo.com/help/us/groups/files

Regards,

jimdk@m...]


VET 1.5.7 is compatible (let's hope)

From: Jim Kueneman [jimdk@m...]
Date: Tue Jul 10, 2001 4:33 am
Subject: VET 1.5.7 is compatible (let's hope)

Ok after much work VET is now working with the latest (2.5.7) version of VT;

Not a lot of changes:

- Made SelectedToPIDLArray and SelectedToNamespaceArray functions public
- Fixed bug in test to see if "+" should be display (incorrect for
FolderOnly view)
- Published OnPaintText property

Worked out most issues with IShellFolder2 for advanced Details. Updated
the demo to see this in action. There is more work to do as it is slow
since none of the data is cached yet but it will give a glimps of what is
yet to come.

Also I agree that VET should be left out of VT (during Beta at least) as it
creates a lot of confusion when Mike makes a change that trips up
decendants of VT.

So it will be necessary to add these files to the VirtualTreesDX.dpk then
recompile the VirtualTreesDX.dpk package.
Edit the VirtualTreesReg.pas to include TVirtualExplorerTree in the
Register procedure:

procedure Register;

begin
RegisterComponents('Virtual Controls', [TVirtualStringTree,
TVirtualDrawTree, TVirtualExplorerTree]);
......
end

and recompile the VirtualTreesDxD.dpk so it is available at design time.

Jim

 | Replies | Author | Date
3022 | Re: VET 1.5.7 is compatible (let's hope) | [Chris.Schindler@g...] | Tue 7/10/2001
3025 | Re: VET 1.5.7 is compatible (let's hope) | Jim Kueneman | Tue 7/10/2001
3029 | Re: VET 1.5.7 is compatible (let's hope) | prog-fr | Tue 7/10/2001
3034 | Re: VET 1.5.7 is compatible (let's hope) | [adembaba@e...] | Tue 7/10/2001
3035 | Re: VET 1.5.7 is compatible (let's hope) | Jim Kueneman | Tue 7/10/2001


To Mike

From: "Wiktor Sadowski" [wiktor@w...]
Date: Tue Jul 10, 2001 2:32 am
Subject: To Mike

Mike,
Sorry for bothering (I know you are busy), but could you (PLEASE)
upload the 2.5.6 version to
http://www.lischke-online.de/download/Betas/ ?

many thanks in advance
Wiktor Sadowski

 | Replies | Author | Date
3039 | Re: To Mike | Mike Lischke | Tue 7/10/2001


BCB5, VT2.5.7 and AddChild

From: "Roland" [Beduerftig@S...]
Date: Tue Jul 10, 2001 8:05 am
Subject: BCB5, VT2.5.7 and AddChild

Hi All,

I downloaded VT 2.5.7 and compile the library with no error.

Ok, but when I compile the actual project an error happened, the
reason is:

Mike changed the method:

from

function AddChild(Parent: PVirtualNode): PVirtualNode;

to

function AddChild(Parent: PVirtualNode;
UserData: Pointer = nil): PVirtualNode;

he added UsedData as an initialized Pointer, that Ok, but BCB5 will
not translate the initialition for this pointer, when we have a look
into the *.hpp

PVirtualNode __fastcall AddChild(PVirtualNode Parent,
void * UserData);

then we missing "void* UserData = NULL".

I think this is a generell problem, because I see all initialized
variables will translate in this way.

Question:

Have any an idea which compiler option must switched on, that we can
compile VT with initialized variables in the calling methods.

I try then the options under the tabsheet "pascal" and also "calling
convention", but nothing will change the result in *.hpp.

For the next step I switched back to 2.4.34, because I cannot change
all projects used AddChild() to AddChild(Node, NULL);

Bye
Roland

 | Replies | Author | Date
3038 | Re: BCB5, VT2.5.7 and AddChild | Lester Caine | Tue 7/10/2001
3052 | Re: BCB5, VT2.5.7 and AddChild | Vandrovec Milan | Wed 7/11/2001
3054 | Re: BCB5, VT2.5.7 and AddChild | Roland | Wed 7/11/2001
3075 | Re: BCB5, VT2.5.7 and AddChild | Mike Lischke | Fri 7/13/2001
3118 | Re: BCB5, VT2.5.7 and AddChild | Roland | Mon 7/16/2001
3195 | Re: BCB5, VT2.5.7 and AddChild | Mike Lischke | Sat 7/21/2001
3225 | Re: BCB5, VT2.5.7 and AddChild | Roland | Mon 7/23/2001
3354 | Re: BCB5, VT2.5.7 and AddChild | Mike Lischke | Sun 8/5/2001
3366 | Re: BCB5, VT2.5.7 and AddChild | Roland | Mon 8/6/2001


re: VET 1.5.7 is compatible (let's hope)

From: [Chris.Schindler@g...]
Date: Tue Jul 10, 2001 8:18 am
Subject: Re: VET 1.5.7 is compatible (let's hope)

--- In [VirtualTreeview@y...], Jim Kueneman [jimdk@m...] wrote:
>
> So it will be necessary to add these files to the
VirtualTreesDX.dpk then
> recompile the VirtualTreesDX.dpk package.
> Edit the VirtualTreesReg.pas to include TVirtualExplorerTree in the
> Register procedure:
>
> procedure Register;
>
> begin
> RegisterComponents('Virtual Controls', [TVirtualStringTree,
> TVirtualDrawTree, TVirtualExplorerTree]);
> ......
> end
>
> and recompile the VirtualTreesDxD.dpk so it is available at design
time.

Thank you for the fast correction :)
But Í have now a new problem:
[Error] VirtualTreesReg.pas(256): Undeclared
identifier: 'TVirtualExplorerTree'
I added VirtualExplorerTree to the uses-clausel, but I get then many
other errors!!
It's now a more simple problem I think ;)

Regards
Chris

 | Replies | Author | Date
3025 | Re: VET 1.5.7 is compatible (let's hope) | Jim Kueneman | Tue 7/10/2001
3029 | Re: VET 1.5.7 is compatible (let's hope) | prog-fr | Tue 7/10/2001
3034 | Re: VET 1.5.7 is compatible (let's hope) | [adembaba@e...] | Tue 7/10/2001
3035 | Re: VET 1.5.7 is compatible (let's hope) | Jim Kueneman | Tue 7/10/2001


DoGetImageIndex is not so nice

From: "Moritz Franckenstein" [franckenstein@a...]
Date: Tue Jul 10, 2001 10:03 am
Subject: DoGetImageIndex is not so nice

TVTGetImageEvent = procedure(Sender: TBaseVirtualTree; Node:
PVirtualNode; Kind: TVTImageKind; Column: Integer;
var Ghosted: Boolean; var Index: Integer) of object;

function TBaseVirtualTree.DoGetImageIndex(Node: PVirtualNode; Kind:
TVTImageKind; Column: Integer; var Ghosted: Boolean): Integer;
begin
Result := -1;
Ghosted := False;
if Assigned(FOnGetImage) then
FOnGetImage(Self, Node, Kind, Column, Ghosted, Result);
end;

this way i cannot overload this in my derived component. there is no
way to initialize the index to my own default value.

all Do... functions should do nothing other than calling the event
handler. and they should have the same parameters. in this case,
Index as var parameter and not as result.

if you need a function that returns the image index then you can make
a new function that calls DoGetImageIndex.

this problems happens with a lot of event handlers in VT. could you
change that, Mike? (for me, this one event would be enough, and its
just a small change)

thank you,
-moritz

 | Replies | Author | Date
3026 | Re: DoGetImageIndex is not so nice | Werner Lehmann | Tue 7/10/2001
3027 | Re: DoGetImageIndex is not so nice | Moritz Franckenstein | Tue 7/10/2001
3028 | Re: DoGetImageIndex is not so nice | GIANNAKOPOULOS KOSTAS | Tue 7/10/2001
3032 | Re: DoGetImageIndex is not so nice | Werner Lehmann | Tue 7/10/2001
3033 | Re: DoGetImageIndex is not so nice | Werner Lehmann | Tue 7/10/2001
3074 | Re: DoGetImageIndex is not so nice | Mike Lischke | Fri 7/13/2001
3104 | Re: DoGetImageIndex is not so nice | Moritz Franckenstein | Sun 7/15/2001
3137 | Re: DoGetImageIndex is not so nice | Moritz Franckenstein | Tue 7/17/2001
3194 | Re: DoGetImageIndex is not so nice | Mike Lischke | Sat 7/21/2001


Drag & drop highlighting failing

From: [MJLeaver@n...]
Date: Tue Jul 10, 2001 10:12 am
Subject: Drag & drop highlighting failing

I'm having problems with drag & drop highlighting. Sometimes (and I
cannot say how to reproduce it, it appears to be random) when
dragging a node, VT does not highlight the nodes being dragged over.

It looks like VT thinks there is some "box" partially over the tree.
Anything in this hidden box is not highlighted. Sometimes the node
is "partially" highlighted, i.e. half-in this hidden box.

I'm using Windows 2000 Pro and the latest version of VT with OLE drag
& drop.

 | Replies | Author | Date
3076 | Re: Drag & drop highlighting failing | Mike Lischke | Fri 7/13/2001


re: Re: VET 1.5.7 is compatible (let's hope)

From: Jim Kueneman [jimdk@m...]
Date: Tue Jul 10, 2001 12:43 pm
Subject: Re: [VirtualTreeview] Re: VET 1.5.7 is compatible (let's hope)

At 08:18 AM 7/10/2001 +0000, you wrote:
>--- In [VirtualTreeview@y...], Jim Kueneman [jimdk@m...] wrote:
>
>Thank you for the fast correction :)
>But Í have now a new problem:
>[Error] VirtualTreesReg.pas(256): Undeclared
>identifier: 'TVirtualExplorerTree'
>I added VirtualExplorerTree to the uses-clausel, but I get then many
>other errors!!
>It's now a more simple problem I think ;)

What errors? I highly suggest that you close all projects, Uninstall the
VirtualTree package, delete all *.dcu's having to do with VT and VET,
delete the VirtualTreeDx.bpl (usually defaults to $DELPHI/projects/bpl
folder), then open the VirtualTreesDx.dpk add VirtualExplorerTree.pas and
recompile. Then open VirtualTreesDxD.pas with the modified
VirtualTrees.Reg.pas (yes I forgot to mention adding VirtualExplorerTree to
the uses clause, thanks) and recompile it. Once that is all ok then
install the package into the IDE. Otherwise I get a lot of Lxxxx errors in
Delphi and even a "*.bpl is not a valid file image" or somthing like that.

Jim


re: DoGetImageIndex is not so nice

From: Werner Lehmann [wl@b...]
Date: Tue Jul 10, 2001 12:47 pm
Subject: Re: [VirtualTreeview] DoGetImageIndex is not so nice

Hi Moritz,

> this way i cannot overload this in my derived component. there is no
> way to initialize the index to my own default value.

Yes. I was having that problem too but I decided not to bug Mike again.
I just dropped the inherited call and used my own 'if assigned()'.

> all Do... functions should do nothing other than calling the event
> handler. and they should have the same parameters. in this case,
> Index as var parameter and not as result.
>
> if you need a function that returns the image index then you can make
> a new function that calls DoGetImageIndex.

Why? A boolean function result is just fine and much more descriptive
than an 'Accept' parameter. And if you forget to return a result the
compiler will warn you anyway.

AFAIK the only reason why Borland does not use functional events instead
of 'Accept' params is that even empty event handlers (assigned but no
code) should not produce a warning which would be the case with function
event types.

I would consider an additional function-to-var-map-procedure as too much
and unnecessary overhead. In many cases too many funcs/procs need to be
called and stack frames need to be created and removed.

BTW, GetNodeData has been improved since 2.5.1. w.r.t. this: up to that version
each GetNodeData implicitly called a function which called another function.
This should be faster now. And GetNodeData is really performance critical
since it is used a lot (obviously, think of CompareNodes with a large tree
and sorting).

Regards,
Werner

 | Replies | Author | Date
3027 | Re: DoGetImageIndex is not so nice | Moritz Franckenstein | Tue 7/10/2001


re: DoGetImageIndex is not so nice

From: "Moritz Franckenstein" [franckenstein@a...]
Date: Tue Jul 10, 2001 1:20 pm
Subject: Re: DoGetImageIndex is not so nice

> Why? A boolean function result is just fine and much more
descriptive
> than an 'Accept' parameter. And if you forget to return a result the
> compiler will warn you anyway.

but in most cases it is necessary to set a default value and allow
the event handler to change it, if he wants. this is not possible
with a function.

to have a Do... procedure is the normal way to allow deriving
components to insert additional things before or after calling an
event.

i have the same problem with DoGetText: my component cannot set the
text value and then call the inherited DoGetText to allow the
application to change it, because it sets its default value itself.

-moritz


re: Re: DoGetImageIndex is not so nice

From: GIANNAKOPOULOS KOSTAS [kyan@s...]
Date: Tue Jul 10, 2001 1:29 pm
Subject: RE: [VirtualTreeview] Re: DoGetImageIndex is not so nice

> > Why? A boolean function result is just fine and much more
> descriptive
> > than an 'Accept' parameter. And if you forget to return a result the
> > compiler will warn you anyway.
>
> but in most cases it is necessary to set a default value and allow
> the event handler to change it, if he wants. this is not possible
> with a function.

Also, don't forget that the "inherited;" notation works for procedures, not
functions. For functions you have to write it explicitly:

Result := inherited MyFunc(Params);

So the automatically generated event handler code that the IDE creates when
you double click an event in the OI would not compile or, even worse, it
would not contain the "inherited;" statement, leading to bugs.

For these reasons i think that event handlers SHOULD always be procedures.


re: Re: VET 1.5.7 is compatible (let's hope)

From: prog-fr [prog-fr@n...]
Date: Tue Jul 10, 2001 1:49 pm
Subject: Re: [VirtualTreeview] Re: VET 1.5.7 is compatible (let's hope)

I have this Errors :
[Erreur] VirtualTreesReg.pas(115): Type Record, Object ou Class requis
[Erreur] VirtualTreesReg.pas(119): Type Record, Object ou Class requis
[Erreur] VirtualTreesReg.pas(131): Types incompatibles : 'Boolean' et 'Set'
[Erreur] VirtualTreesReg.pas(136): Instruction attendu(e) mais 'FUNCTION'
trouvé(e)
[Erreur] VirtualTreesReg.pas(151): Type Record, Object ou Class requis
[Avertissement] VirtualTreesReg.pas(151): Combinaison de types signés et non
signés - opérandes agrandis
[Erreur] VirtualTreesReg.pas(177): Type Record, Object ou Class requis
[Erreur] VirtualTreesReg.pas(185): Type Record, Object ou Class requis
[Erreur] VirtualTreesReg.pas(197): Identificateur non déclaré : 'Result'
[Erreur] VirtualTreesReg.pas(202): Instruction attendu(e) mais 'PROCEDURE'
trouvé(e)
[Erreur] VirtualTreesReg.pas(211): Type Record, Object ou Class requis
[Erreur] VirtualTreesReg.pas(51): Déclaration forward ou external non
satisfaite : 'TClipboardElement.GetAttributes'
[Erreur] VirtualTreesReg.pas(68): Déclaration forward ou external non
satisfaite : 'TClipboardFormatsProperty.GetAttributes'
[Erreur fatale] VirtualTreesD6D.dpk(34): Impossible de compiler l'unité
utilisée 'VirtualTreesReg.pas'

 | Replies | Author | Date
3034 | Re: VET 1.5.7 is compatible (let's hope) | [adembaba@e...] | Tue 7/10/2001
3035 | Re: VET 1.5.7 is compatible (let's hope) | Jim Kueneman | Tue 7/10/2001


OnGetText: Called so often only moving the focus

From: Ralf Junker [ralfjunker@g...]
Date: Tue Jul 10, 2001 2:43 pm
Subject: OnGetText: Called so often only moving the focus

Hi Group, Hi Mike,

I am a little worried about how many times OnGetText is called in
TVirtualStringTree. Each time I move the focus, it gets called between 70 and
100 times, i.e. approximately the number of visible nodes * columns.

I find this very strange, since I do not scroll the tree and only two nodes
should be affected: The currently focused node and the next focused node.

Is there any way to cut down on calling GetOnText for the application or does
it require changes to VirtualTrees.pas? What happens if I scroll the tree by
one node only? Cant't the tree's canvas be scrolled and only that one new node
be queried?

I am quite desparate since I need to query database tables, which takes quite a
while amd considerably slows down the application.

I am gratefull for any help,

-- Ralf

 | Replies | Author | Date
3049 | Re: OnGetText: Called so often only moving the fo | Werner Lehmann | Wed 7/11/2001
3055 | Re: OnGetText: Called so often only moving the fo | Vadim Sedulin | Wed 7/11/2001
3056 | Re: OnGetText: Called so often only moving the fo | Werner Lehmann | Wed 7/11/2001
3060 | Re: OnGetText: Called so often only moving the fo | Vadim Sedulin | Thu 7/12/2001
3082 | Re: OnGetText: Called so often only moving the fo | Mike Lischke | Sat 7/14/2001
3065 | Re: OnGetText: Called so often only moving the fo | Ralf Junker | Thu 7/12/2001
3100 | Re: OnGetText: Called so often only moving the fo | Vadim Sedulin | Sun 7/15/2001
3102 | Re: OnGetText: Called so often only moving the fo | Mike Lischke | Sun 7/15/2001
3106 | Find node | Franc v/d Westelaken | Sun 7/15/2001


re: OnGetText: Called so often only moving the focus

From: GIANNAKOPOULOS KOSTAS [kyan@s...]
Date: Tue Jul 10, 2001 2:53 pm
Subject: RE: [VirtualTreeview] OnGetText: Called so often only moving the focus

Sorry to cut in, but...

OnGetText along with OnGetImageIndex and OnNewText is one of those event
handlers that implement the "data" of a virtual node. These event handlers
ARE EXPECTED to be called very often (every time a node needs to be painted
for example).

There is another group of event handlers like OnInitNode and OnInitChildren
that are meant to provide the "structural" information of a "virtual tree"
and these are called only once per node.

So, if the process of data extraction is time consuming you should consider
caching them in the data record of the virtual node and getting their values
from your database once in the OnInitNode event handler, which is called
only once.

>
> I am a little worried about how many times OnGetText is
> called in TVirtualStringTree. Each time I move the focus, it
> gets called between 70 and 100 times, i.e. approximately the
> number of visible nodes * columns.
>
> I find this very strange, since I do not scroll the tree and
> only two nodes should be affected: The currently focused node
> and the next focused node.
>
> Is there any way to cut down on calling GetOnText for the
> application or does it require changes to VirtualTrees.pas?
> What happens if I scroll the tree by one node only? Cant't
> the tree's canvas be scrolled and only that one new node be queried?
>
> I am quite desparate since I need to query database tables,
> which takes quite a while amd considerably slows down the application.

 | Replies | Author | Date
3047 | Re: OnGetText: Called so often only moving the f | Ralf Junker | Wed 7/11/2001
3048 | Re: OnGetText: Called so often only moving the f | GIANNAKOPOULOS KOSTAS | Wed 7/11/2001
3053 | Re: OnGetText: Called so often only moving the f | Jim Kueneman | Wed 7/11/2001
3077 | Re: OnGetText: Called so often only moving the f | Mike Lischke | Fri 7/13/2001


re: Re: DoGetImageIndex is not so nice

From: Werner Lehmann [wl@b...]
Date: Tue Jul 10, 2001 3:41 pm
Subject: Re: [VirtualTreeview] Re: DoGetImageIndex is not so nice

Moritz Franckenstein wrote:
>
> > Why? A boolean function result is just fine and much more
> descriptive
> > than an 'Accept' parameter. And if you forget to return a result the
> > compiler will warn you anyway.
>
> but in most cases it is necessary to set a default value and allow
> the event handler to change it, if he wants. this is not possible
> with a function.

True. You're right.

But please let's not have this function-to-var-map-procedure wrapper.

> i have the same problem with DoGetText: my component cannot set the
> text value and then call the inherited DoGetText to allow the
> application to change it, because it sets its default value itself.

Yes, me too. I have copied the assigned check here as well and am not
calling inherited. Maybe this'll change later.

Werner


re: Re: DoGetImageIndex is not so nice

From: Werner Lehmann [wl@b...]
Date: Tue Jul 10, 2001 3:41 pm
Subject: Re: [VirtualTreeview] Re: DoGetImageIndex is not so nice

GIANNAKOPOULOS KOSTAS wrote:
>
> Also, don't forget that the "inherited;" notation works for procedures, not
> functions. For functions you have to write it explicitly:
>
> Result := inherited MyFunc(Params);

Admittedly. I am not sure but didn't this work once (without repeating the
whole function after inherited)? I think I have used it this way some time
ago. But probably not. Must be a segmentation fault in some of my synapses.
Anyway I don't really understand why it can't be

result := inherited;

technically speaking.

> So the automatically generated event handler code that the IDE creates when
> you double click an event in the OI would not compile or, even worse, it
> would not contain the "inherited;" statement, leading to bugs.
>
> For these reasons i think that event handlers SHOULD always be procedures.

Yes, but we were talking about the virtual methods and not the event
handlers that are called by these methods. And since we are just at the
automatic creation of the inherited statement: the IDE even creates this
for overridden abstract methods which raise an exception at runtime... :)

Werner


re: VET 1.5.7 is compatible (let's hope)

From: [adembaba@e...]
Date: Tue Jul 10, 2001 4:28 pm
Subject: Re: VET 1.5.7 is compatible (let's hope)

Jim,

Even though it can be argued that VET is based on
VT and should not have a separate, I believe there
is so much stuff in VET that it is time VET must
have separate group. There, you could point to
the working version of VT and save us all the
game of guessing which VT version is suitable
with which version of VET.

I wonder what Mike would say about this; I doubt
he will be possessive about all the derivatives
of VT --plus, this solution would save him head
aches too.

Plus, why don you use a separate register package
such as below, and add you own .DCR and .RES files as
necessary.

Cheers,
Adem
--

{I copied Mike's reg package and altered it}

--

Unit VirtualExplorerTreeReg;

Interface
{$INCLUDE Compilers.inc}

Uses
Windows,
Classes,
{$IFDEF COMPILER_6+}
DesignIntf,
DesignEditors,
VCLEditors,
{$ELSE}
DsgnIntf,
{$ENDIF}
{$IFNDEF CPPB}
ColnEdit,
{$ENDIF}
VirtualTrees,
VirtualExplorerTree;

Procedure Register;

Implementation

Procedure Register;
Begin
RegisterComponents('Virtual Controls', [TVirtualExplorerTree]);
End;

End.


re: VET 1.5.7 is compatible (let's hope)

From: "Jim Kueneman" [jimdk@m...]
Date: Tue Jul 10, 2001 4:11 pm
Subject: Re: VET 1.5.7 is compatible (let's hope)

--- In [VirtualTreeview@y...], prog-fr [prog-fr@n...] wrote:
> I have this Errors :

> [Erreur fatale] VirtualTreesD6D.dpk(34): Impossible de compiler
l'unité utilisée 'VirtualTreesReg.pas'

Yikes,
First I don't have D6 so.. Second this looks odd all the errors
are in the VirtualTreesReg.pas. If you take VirtualExplorerTree out
of the uses clause and remove TVirtualExplorerTree out of
RegisterComponent( ) is ok?

Are you using VT 2.5.7 that Mike uploaded yesterday?
There is a naming conflict between VT and VET I just
noticed..TClipboardFormats.

Try moving the VirtualExplorerTree in the uses clause to the last
unit. (or the first, just try moving it may be a new check in D6?)

Jim


VET 1.5.7 TClipboardFormats not needed

From: [adembaba@e...]
Date: Tue Jul 10, 2001 4:41 pm
Subject: VET 1.5.7 TClipboardFormats not needed

Jim,

Could you remove this line from VirtualExplorerTree
unit

TClipboardFormats = Array Of TClipFormat;

as it not being used.

Secondly, it renames VT's TClipboardFormats
if VirtualExplorerTree unit is placed after
VirtualTrees unit in the uses clause in
VirtualTreesReg unit.

Cheers,
Adem


VET 1.5.7 WMPaint problem

From: [adembaba@e...]
Date: Tue Jul 10, 2001 4:54 pm
Subject: VET 1.5.7 WMPaint problem

Hi Jim,

I am trying to compile and run your new demo,
but running into a problem: When running in IDE,
stops with AV in TBaseVirtualTree.PaintTree at:

ButtonX := (Length(LineImage) * Integer(FIndent)) +
Trunc((Integer(FIndent) - FPlusBM.Width) / 2 + 0.5) -
FIndent;

apprently, there is a problem with FPlusBM.Width
even though FPlusBM is assigned the Width is
not available. I have no idea why.

BTW, VT demos run just fine, so I gusss it must have
something to do with TCustomVirtualExplorerTree.WMPaint.

Can you help, please.

Cheers,
Adem

 | Replies | Author | Date
3040 | Re: VET 1.5.7 WMPaint problem | Jim Kueneman | Tue 7/10/2001
3043 | Re: VET 1.5.7 WMPaint problem | [adembaba@e...] | Tue 7/10/2001


re: BCB5, VT2.5.7 and AddChild

From: "Lester Caine" [lester@l...]
Date: Tue Jul 10, 2001 5:56 pm
Subject: Re: BCB5, VT2.5.7 and AddChild

> he added UsedData as an initialized Pointer, that Ok, but BCB5 will
> not translate the initialition for this pointer, when we have a look
> into the *.hpp
>
> PVirtualNode __fastcall AddChild(PVirtualNode Parent,
> void * UserData);
>
> then we missing "void* UserData = NULL".

I don't think AddChild is the only 'new' call that has this problem,
UserData has been added elsewhere.

How do you get the Clipboard bits to compile? and then perhaps I can
also look at this problem. I have updated my program to cope with it
so far.


re: To Mike

From: "Mike Lischke" [lists@l...]
Date: Tue Jul 10, 2001 6:37 pm
Subject: RE: [VirtualTreeview] To Mike

> Sorry for bothering (I know you are busy), but could you (PLEASE)
> upload the 2.5.6 version to
> http://www.lischke-online.de/download/Betas/ ?

Done.

Ciao, Mike


re: VET 1.5.7 WMPaint problem

From: "Jim Kueneman" [jimdk@m...]
Date: Tue Jul 10, 2001 6:44 pm
Subject: Re: VET 1.5.7 WMPaint problem

--- In [VirtualTreeview@y...], [adembaba@e...] wrote:
> Hi Jim,
> apprently, there is a problem with FPlusBM.Width
> even though FPlusBM is assigned the Width is
> not available. I have no idea why.

I do. That was what Mike fixed in VT2.5.7. Make sure that is what
you have and delete all *.dcu's and *.bpl's and force a recompile.

The root node is being used to hold InternalData and in 2.5.6 the
rootnode was not updated when a decendent requested more internal
data. The results were something Delphi programs don't have to worry
about much, memory overwrites <g> it corrupts the TBitmap instance.

Jim

 | Replies | Author | Date
3043 | Re: VET 1.5.7 WMPaint problem | [adembaba@e...] | Tue 7/10/2001


VET Questions

From: "Jim Kueneman" [jimdk@m...]
Date: Tue Jul 10, 2001 6:48 pm
Subject: VET Questions

It is partially my fault for posting the announcment to the VT group
but there is a VirtualExplorerTree group for questions.

Maybe VET should become its own enity and it all moves to that area?
With all these packages it is getting confusing even for me to keep
things straight <g>. Mike what is you opinion?

Jim

 | Replies | Author | Date
3042 | Re: VET Questions | Mike Lischke | Tue 7/10/2001


re: VET Questions

From: "Mike Lischke" [lists@l...]
Date: Tue Jul 10, 2001 7:18 pm
Subject: RE: [VirtualTreeview] VET Questions

> Maybe VET should become its own enity and it all moves to that area?
> With all these packages it is getting confusing even for me to keep
> things straight <g>. Mike what is you opinion?

Ah, there it happens now. VET has grown up and goes now its own way <sniffle>.
So farewell and live
long and prosper. Hope you turn back one day to see where your roots were. :?-(

:o]

But seriously, I have no objections to do the split. There is enough stuff in
each component to
confuse the user, so we don't need to have both in one package nor in one
mailing list. Quite the
opposite is true, I would love to see more spin offs giving Delphi the right
kick.

Jim, will you move also your other files (museum) over to your VET mailing list?

Ciao, Mike


re: VET 1.5.7 WMPaint problem

From: [adembaba@e...]
Date: Tue Jul 10, 2001 7:27 pm
Subject: Re: VET 1.5.7 WMPaint problem

> Make sure that is what you have and delete all *.dcu's and
> *.bpl's and force a recompile.

I have done all that (i.e. delete all *.dcu's and *.bpl's and
force a recompile), but what I had not done was to upgrade
to VT 2.5.7 --I have a lower opinion of myself than anyone
could possibly attribute to me :-(


re: what happened to MVCDemo?

From: "Mike Lischke" [lists@l...]
Date: Tue Jul 10, 2001 7:40 pm
Subject: RE: [VirtualTreeview] what happened to MVCDemo?

Hi Remco,

> I can no longer find the MVC Demo by Marian Aldenhövel in
> the VirtualTree Demos.zip. Does it no longer work with the
> newer versions of VirtualTree? Or has it lost its value?

The demo package I uploaded was a quick shot to help people with some stuff
like OLE. The MVC demo
needs some more changes to compile with the latest VT build so I left it out
this time.

Ciao, Mike


All VET related files moved

From: "Jim Kueneman" [jimdk@m...]
Date: Tue Jul 10, 2001 8:11 pm
Subject: All VET related files moved

To All,

The VET files, both new and old versions have been moved to the
VirtualExplorerTree files area

http://groups.yahoo.com/group/VirtualExplorerTree/files/

Jim

BTW,

Dad, I know I am moving out but can I borrow $20 for gas before I go
<g>


New file uploaded to VirtualTreeview

From: [VirtualTreeview@yahoogroups.com>
Date: Tue Jul 10, 2001 9:55 pm
Subject: New file uploaded to VirtualTreeview

Hello,

This email message is a notification to let you know that
a file has been uploaded to the Files area of the VirtualTreeview
group.

File : /mvcdemo25.zip
Uploaded by : [woestijn@h...]
Description : updated MVCDemo that compiles with VT2.5.1, needs work on
IVTEditLink though...

You can access this file at the URL

http://groups.yahoo.com/group/VirtualTreeview/files/mvcdemo25.zip

To learn more about file sharing for your group, please visit

http://help.yahoo.com/help/us/groups/files

Regards,

woestijn@h...]


re: OnGetText: Called so often only moving the focus

From: Ralf Junker [ralfjunker@g...]
Date: Wed Jul 11, 2001 6:40 am
Subject: RE: [VirtualTreeview] OnGetText: Called so often only moving the focus

Sorry to come back to my original issue...

>OnGetText along with OnGetImageIndex and OnNewText is one of those event
>handlers that implement the "data" of a virtual node. These event handlers
>ARE EXPECTED to be called very often (every time a node needs to be painted
>for example).

I fully understand the virtual paradigm. Your answer does not explain why the
node queries for data if the node does not change and there does not seem to be
a need for a node to be painted because it is painted already.

We are talking about only moving the focus (i.e. pressing key up once) and
OnGetText is fired more than 100 times.

Is there no way this could be changed?

I do not intend to offend anybody. VirtualTres is for sure one of the best open
source products in the Delphi industry. However, it does not mean it can not be
improved. I think that it would greatly benefit from reducing the number the
OnGetText and OnGetImageIndex get fired.

Any thoughts?

-- Ralf

>There is another group of event handlers like OnInitNode and OnInitChildren
>that are meant to provide the "structural" information of a "virtual tree"
>and these are called only once per node.
>
>So, if the process of data extraction is time consuming you should consider
>caching them in the data record of the virtual node and getting their values
>from your database once in the OnInitNode event handler, which is called
>only once.
>
>>
>> I am a little worried about how many times OnGetText is
>> called in TVirtualStringTree. Each time I move the focus, it
>> gets called between 70 and 100 times, i.e. approximately the
>> number of visible nodes * columns.
>>
>> I find this very strange, since I do not scroll the tree and
>> only two nodes should be affected: The currently focused node
>> and the next focused node.
>>
>> Is there any way to cut down on calling GetOnText for the
>> application or does it require changes to VirtualTrees.pas?
>> What happens if I scroll the tree by one node only? Cant't
>> the tree's canvas be scrolled and only that one new node be queried?
>>
>> I am quite desparate since I need to query database tables,
>> which takes quite a while amd considerably slows down the application.
>
>
>To unsubscribe from this group, send an email to:
>VirtualTreeview-unsubscribe@egroups.com
>
>
>
>Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/


re: OnGetText: Called so often only moving the focus

From: GIANNAKOPOULOS KOSTAS [kyan@s...]
Date: Wed Jul 11, 2001 7:59 am
Subject: RE: [VirtualTreeview] OnGetText: Called so often only moving the focus

> I fully understand the virtual paradigm. Your answer does not
> explain why the node queries for data if the node does not
> change and there does not seem to be a need for a node to be
> painted because it is painted already.

Sorry, i didn't mean to imply that you don't, but from what i read i
understood that you query the database inside an OnGetText event handler. If
this is true, it is an overkill, even if calls to OnGetText are reduced to
the absolute minimum it would mean that you would have, for example, 2
select statements executed every time the focus changes. OnGetText is there
to implement the CACHING of the data, not their retrieval. OnInitNode is for
that purpose.

> We are talking about only moving the focus (i.e. pressing key
> up once) and OnGetText is fired more than 100 times.

Well, maybe OnGetText does need some optimization, but it's up to Mike. A
good profiling tool might help there.
Anyway, if OnGetText is implemented correctly we're talking about some
microseconds of overhead.
If optimizing OnGetText means making a mess out of the code, i would leave
it alone if i was in Mike's shoes.

> I do not intend to offend anybody. VirtualTres is for sure
> one of the best open source products in the Delphi industry.
> However, it does not mean it can not be improved. I think
> that it would greatly benefit from reducing the number the
> OnGetText and OnGetImageIndex get fired.

I'm the last person to be offended, i'm only a humble user of this great
component. And i'm sure that Mike wants us to suggest improvements to it or
else this group would not exist.

<KY>


re: OnGetText: Called so often only moving the focus

From: Werner Lehmann [wl@b...]
Date: Wed Jul 11, 2001 8:26 am
Subject: Re: [VirtualTreeview] OnGetText: Called so often only moving the focus

Hi Ralf,

> >OnGetText along with OnGetImageIndex and OnNewText is one of those event
> >handlers that implement the "data" of a virtual node. These event handlers
> >ARE EXPECTED to be called very often (every time a node needs to be painted
> >for example).
>
> I fully understand the virtual paradigm. Your answer does not explain why the
node queries for data if the node does not change and there does not seem to be
a need for a node to be painted because it is painted already.
>
> We are talking about only moving the focus (i.e. pressing key up once) and
OnGetText is fired more than 100 times.
>
> Is there no way this could be changed?
>
> I do not intend to offend anybody. VirtualTres is for sure one of the best
open source products in the Delphi industry. However, it does not mean it can
not be improved. I think that it would greatly benefit from reducing the number
the OnGetText and OnGetImageIndex get fired.
>
> Any thoughts?

you say that you are querying the DB for gettext. Each time? You should really
cache at least
node text's and image indices in your node data.

Having said that I just put a counter into one of my GetText handlers. In a
tree with only
four (top level) nodes, possibly static text and two columns (2nd mostly empty
but with col
spanning switched on so it has to be asked for text anyway) it is called 15
times per focus
change. If the tree contains more and nested nodes it is usually 50-70 times
per focus change.

These numbers sound high to me as well. But *if* you have the data already in
memory or (speaking
in VT terms) the node is init'ed none of todays CPU's would frown at 100 or
more times. I have
done a search for DoGetText in VirtualTrees.pas and it is 16 times in there
(not counting the
declaration and definition). Hard to say if the node text can be cached in the
tree itself only
for the current task it has to accomplish. My (wild!) guess is that the amount
of GetText events
may be cut in half by retrieving it only once for related tasks. Would require
a fair amount of
work probably. And I doubt that your tree would get reasonably faster if your
DB was not queried
100 but 50 times per focus change.

Regards,
Werner


Cosmetic suggestion

From: [duke_n5@h...]
Date: Wed Jul 11, 2001 9:24 am
Subject: Cosmetic suggestion

I think that when FullRowSelect is on, the focus rectangle on the
focused node should spread to the width of the whole tree and not
only the current column


Save/Load

From: [duke_n5@h...]
Date: Wed Jul 11, 2001 11:57 am
Subject: Save/Load

I managed to correctly write the save&load procedures for my treeview
(Thanks, ppl).

Now, the problem is like that: the data file saved/loaded is a fatty:
more than 5Mb. The save taketh around 20 secs and load around 6 secs.
I put a progressbar and all but it is still kind of tough on the poor
user.

Is there any smartass trick to speed it all up?

 | Replies | Author | Date
3061 | Re: Save/Load | [ltchoong@s...] | Thu 7/12/2001
3063 | Re: Save/Load | Jim Kueneman | Thu 7/12/2001
3070 | Re: Save/Load | TC Lai | Fri 7/13/2001
3071 | Re: Save/Load | Jim Kueneman | Fri 7/13/2001
3086 | Re: Save/Load | TC Lai | Sat 7/14/2001
3087 | Re: Save/Load | Jim Kueneman | Sat 7/14/2001
3096 | Re: Save/Load | TC Lai | Sun 7/15/2001


re: BCB5, VT2.5.7 and AddChild

From: Vandrovec Milan [milan_va@s...]
Date: Wed Jul 11, 2001 11:59 am
Subject: RE: [VirtualTreeview] BCB5, VT2.5.7 and AddChild

Hi again.

>
> PVirtualNode __fastcall AddChild(PVirtualNode Parent,
> void * UserData);
>
> then we missing "void* UserData = NULL".
>
> I think this is a generell problem, because I see all initialized
> variables will translate in this way.

I solve this generally by adding an overloaded version of the method, i.e.

function AddChild(Parent: PVirtualNode): PVirtualNode; overload;
function AddChild(Parent: PVirtualNode;
UserData: Pointer = nil): PVirtualNode; overload;

...

function TBaseVirtualTree.AddChild(Parent: PVirtualNode): PVirtualNode;
begin
AddChild(Parent, nil);
end;

...

Of course this has to be done in VirtualTrees.pas . Perhaps Mike could give
some time to us, BCB5 users?

Milan Vandrovec

 | Replies | Author | Date
3054 | Re: BCB5, VT2.5.7 and AddChild | Roland | Wed 7/11/2001
3075 | Re: BCB5, VT2.5.7 and AddChild | Mike Lischke | Fri 7/13/2001
3118 | Re: BCB5, VT2.5.7 and AddChild | Roland | Mon 7/16/2001
3195 | Re: BCB5, VT2.5.7 and AddChild | Mike Lischke | Sat 7/21/2001
3225 | Re: BCB5, VT2.5.7 and AddChild | Roland | Mon 7/23/2001
3354 | Re: BCB5, VT2.5.7 and AddChild | Mike Lischke | Sun 8/5/2001
3366 | Re: BCB5, VT2.5.7 and AddChild | Roland | Mon 8/6/2001


re: OnGetText: Called so often only moving the focus

From: Jim Kueneman [jimdk@m...]
Date: Wed Jul 11, 2001 12:39 pm
Subject: RE: [VirtualTreeview] OnGetText: Called so often only moving the focus

At 10:59 AM 7/11/2001 +0300, you wrote:
> > I fully understand the virtual paradigm. Your answer does not
> > explain why the node queries for data if the node does not
> > change and there does not seem to be a need for a node to be
> > painted because it is painted already.

In my recent adventure trying to get IShellFolder2.GetDetailOf working I
also noticed when the popup hint window closed the text in every cell was
redrawn. I have to admit that this "feature" helped me debug my problem
but it did seem inefficent.

Jim

 | Replies | Author | Date
3077 | Re: OnGetText: Called so often only moving the f | Mike Lischke | Fri 7/13/2001


re: BCB5, VT2.5.7 and AddChild

From: "Roland" [Beduerftig@S...]
Date: Wed Jul 11, 2001 12:51 pm
Subject: Re: BCB5, VT2.5.7 and AddChild

Hi Milan,

> > PVirtualNode __fastcall AddChild(PVirtualNode Parent,
> > void * UserData);
> >
> > then we missing "void* UserData = NULL".
> >
> > I think this is a generell problem, because I see all initialized
> > variables will translate in this way.
>
> I solve this generally by adding an overloaded version of the
> method, i.e.
>
> function AddChild(Parent: PVirtualNode): PVirtualNode; overload;
> function AddChild(Parent: PVirtualNode;
> UserData: Pointer = nil): PVirtualNode; overload;
>
> ...
>
> function TBaseVirtualTree.AddChild(Parent: PVirtualNode): PVir..
> begin
> AddChild(Parent, nil);
> end;
>
> ...
>
> Of course this has to be done in VirtualTrees.pas .
> Perhaps Mike could give some time to us, BCB5 users?

Ok, this works correct, but it is not a nive way to do this.

I think, then we can direct create a new method, for example
function AddChildData(....): ...;

Roland


re: OnGetText: Called so often only moving the focus

From: "Vadim Sedulin" [wsntrl@o...]
Date: Wed Jul 11, 2001 3:23 pm
Subject: Re: [VirtualTreeview] OnGetText: Called so often only moving the focus

Hello Werner, Ralf and others.

>> I fully understand the virtual paradigm. Your answer does not explain why
the node queries for data if the node does not change and there does not
seem to be a need for a node to be painted because it is painted already.
>>
>> We are talking about only moving the focus (i.e. pressing key up once)
and OnGetText is fired more than 100 times.
>>
>> Is there no way this could be changed?
>>
>> I do not intend to offend anybody. VirtualTres is for sure one of the
best
>> open source products in the Delphi industry. However, it does not mean it
can not be improved. I think that it
>>would greatly benefit from reducing the number the OnGetText and
OnGetImageIndex get fired.
>>
>> Any thoughts?
>
> you say that you are querying the DB for gettext. Each time? You should
really cache at least
> node text's and image indices in your node data.
>
> Having said that I just put a counter into one of my GetText handlers. In
a tree with only
> four (top level) nodes, possibly static text and two columns (2nd mostly
empty but with col
> spanning switched on so it has to be asked for text anyway) it is called
15 times per focus
> change. If the tree contains more and nested nodes it is usually 50-70
times per focus change.
>
> These numbers sound high to me as well. But *if* you have the data already
in memory or (speaking
> in VT terms) the node is init'ed none of todays CPU's would frown at 100
or more times. I have
> done a search for DoGetText in VirtualTrees.pas and it is 16 times in
there (not counting the
> declaration and definition). Hard to say if the node text can be cached in
the tree itself only
> for the current task it has to accomplish. My (wild!) guess is that the
amount of GetText events
> may be cut in half by retrieving it only once for related tasks. Would
require a fair amount of
> work probably. And I doubt that your tree would get reasonably faster if
your DB was not queried
> 100 but 50 times per focus change.

DoGetText called visible_node_count * 2 times from
TCustomVirtualStringTree.DoPaintNode, and 2 times from another method(s)
(after each focus change).

Bye.

Vadim Sedulin
E-Mail: [wsntrl@o...]


re: OnGetText: Called so often only moving the focus

From: Werner Lehmann [wl@b...]
Date: Wed Jul 11, 2001 6:25 pm
Subject: Re: [VirtualTreeview] OnGetText: Called so often only moving the focus

Hi Vadim;

> DoGetText called visible_node_count * 2 times from
> TCustomVirtualStringTree.DoPaintNode, and 2 times from another method(s)
> (after each focus change).

I wonder why visible_node_count * 2? Theoretically only two nodes are related,
the old
and the new focused node, and not all visible nodes. I have not checked the
source yet.

Werner


Access violations in very special circumstance (OCX)

From: Björn Lindell [bli@c...]
Date: Thu Jul 12, 2001 8:33 am
Subject: Access violations in very special circumstance (OCX)

I have been using VT in an OCX that I dynamically create
and destroy in another application. However, it caused some
horrible access violations when exiting the application. I tried
to simulate the same thing in a trivial application (instead of
my complex one), but there I couldn't reproduce the problem.

However, I managed to track it down to the finalization
section of "virtualtrees.pas". It turns out it gets called first when
my application closes (I guess that is when the OCX-DLL is
unloaded as well, although I much earlier destroyed the actual
OCX-instance). The failing code line is the OleUninitialize line.

I am not sure why this occurs, perhaps there is some mismatch
with something in my particular App.
Anyway, my workaround was to remove the initialization/
finalization sections of "virtualtrees" and instead call a
"doInitialization"
and "doFinalization" procedure whenever a VT-component is
created/destroyed. To prevent multiple calls, I keep a global
counter. This way, my problem disappeared.

I am however interested in hearing if anyone has similar
experiences or any idea as to what the problem might be.

By the way,
I am running W2K sp2 and Delphi 5 sp1
The problem occured both with VT 2.4.7 and 2.5.7

/Björn

 | Replies | Author | Date
3081 | Re: Access violations in very special circumstanc | Mike Lischke | Sat 7/14/2001
3088 | Re: Access violations in very special circumstanc | =?iso-8859-1?Q?Bj=F6rn_Lindel | Sat 7/14/2001
3113 | Re: Access violations in very special circumstanc | Mike Lischke | Sun 7/15/2001


re: VT 2.5.1 + Notification + AV problem

From: "Mike Lischke" [lists@l...]
Date: Thu Jul 12, 2001 10:01 am
Subject: RE: [VirtualTreeview] VT 2.5.1 + Notification + AV problem

Will,

> <Baffled> I can make it happen in a stripped down application,
> comprising nothing but a form and a String tree with some design
> time nodes slung into it. Set a breakpoint in Notification and off you
> go.

What I meant here was that I can reproduce the notification of the control for
itself, but not a
removal notification for the header image list between destruction of the
header and destruction of
the tree.

Ciao, Mike


re: New file uploaded to VirtualTreeview

From: "Mike Lischke" [lists@l...]
Date: Thu Jul 12, 2001 10:01 am
Subject: RE: [VirtualTreeview] New file uploaded to VirtualTreeview

Kostas,

> Interesting addition, but incomplete. It won't help much if the user data is
> a record instead of just a pointer.

It won't help either if the user data is a collection of classes, or a string
or something else. The
user has simply to make it a pointer. VT cannot handle every case, this is
impossible. But the
pointer approach is the one most widely used and I think this solution is
acceptable.

> I'm not sure that this technique will work at all and i don't know if you
> like it, but you might want to give it a shot if you do.

Thank you for suggesting this, but currently I would really like to avoid
implementing anything new.
Please understand this.

Ciao, Mike


re: OnGetText: Called so often only moving the focus

From: "Vadim Sedulin" [wsntrl@o...]
Date: Thu Jul 12, 2001 12:11 pm
Subject: Re: [VirtualTreeview] OnGetText: Called so often only moving the focus

Hello Werner!

>> DoGetText called visible_node_count * 2 times from
>> TCustomVirtualStringTree.DoPaintNode, and 2 times from another method(s)
>> (after each focus change).
>
> I wonder why visible_node_count * 2? Theoretically only two nodes are
related, the old
> and the new focused node, and not all visible nodes. I have not checked
the source yet.

Ok, I found...

procedure TBaseVirtualTree.ClearSelection;
begin
if (FSelectionCount > 0) and not (csDestroying in ComponentState) then
begin
InternalClearSelection;

// Repainting the entire tree is actually faster than determining the
display rectangles of all
// previously selected nodes and invalidating them.
if FUpdateCount = 0 then
begin
Invalidate;
Change(nil);
end;
end;
end;

This procedure called from WMKeyDown if (Shift = []) or (ActAsGrid and not
(ssShift in Shift)) or not (voMultiSelect in FOptions) or (CharCode in
[VK_TAB, VK_BACK]).

Bye.

Vadim Sedulin
E-Mail: [wsntrl@o...]

 | Replies | Author | Date
3082 | Re: OnGetText: Called so often only moving the fo | Mike Lischke | Sat 7/14/2001


re: Save/Load

From: [ltchoong@s...]
Date: Thu Jul 12, 2001 12:40 pm
Subject: Re: Save/Load

Hi Duke_n5

Please take a look at the file 'Save-LoadTree.zip' uploaded by Jim.
He created the example to show me how to save/load a file.

I did a test with the example with different combinations of number
of nodes and file size, and the result shows that file size is not
the issue. I don't know what's other's findings. The result is
tabulated below:

File Size No. of Nodes Load (sec) Save (sec)
==========================================================

282 kB 3000 10 10

5403 kB 3000 11 11

5404 kB 100 x 30 11 11

5405 kB 120 3 3

10804 kB 120 4 4

Please note that timings are approximate only, and are based on my
166 MHz machine. 100 x 30 indicates 100 root nodes each with 30
children nodes, a total of 3000 nodes.

Regards,

TC

--- In [VirtualTreeview@y...], [duke_n5@h...] wrote:
> I managed to correctly write the save&load procedures for my
treeview
> (Thanks, ppl).
>
> Now, the problem is like that: the data file saved/loaded is a
fatty:
> more than 5Mb. The save taketh around 20 secs and load around 6
secs.
> I put a progressbar and all but it is still kind of tough on the
poor
> user.
>
> Is there any smartass trick to speed it all up?

 | Replies | Author | Date
3063 | Re: Save/Load | Jim Kueneman | Thu 7/12/2001
3070 | Re: Save/Load | TC Lai | Fri 7/13/2001
3071 | Re: Save/Load | Jim Kueneman | Fri 7/13/2001
3086 | Re: Save/Load | TC Lai | Sat 7/14/2001
3087 | Re: Save/Load | Jim Kueneman | Sat 7/14/2001
3096 | Re: Save/Load | TC Lai | Sun 7/15/2001


Re:VT 2.5.1 + Notification + AV problem

From: "Will Watts" [willw@a...]
Date: Thu Jul 12, 2001 2:18 pm
Subject: Re:VT 2.5.1 + Notification + AV problem

Mike ,

> What I meant here was that I can reproduce the notification of the
> control for itself, but not a removal notification for the header
> image list between destruction of the header and destruction of the
> tree.

Ah. I think we are at cross purposes. Let me try again. The
sequence when a tree is destroyed is:

1. TBaseVirtualTree.Destroy is called. This does various tidying up
stuff including FHeader.Free. I claim that anything that references
*any* field of FHeader after this point is dangerous. You agree,
yes?

2. TBaseVirtualTree.Destroy calls 'inherited' as its last line

3. Eventually the inherited TComponent.Destroy gets called. This
loops over all the FreeNotification objects that the TreeView has.
This is where TreeView notifies itself.

4. TBaseVirtualTree.Notification is called, and as currently
implemented executes the line of code (around 17125 in 2.5.1)

if AComponent = FHeader.FImages then

Now I say this is intrinsically dangerous because FHeader has been
freed. If you called FreeAndNil(FHeader) in your destructor, as you
might reasonably do, I think the result would be that it usually AV'd
here. As it is I have a program where it occasionally causes an AV
on shutdown.

The fix I suggested is safe, because the VT doesn't need to act on
its own notification. To remind you it is this:

if (AComponent <> Self) and (Operation = opRemove) then

as the first line of Notification. And I recommend FreeAndNil() too,
of course ;-)

I admit I was partly puzzled that the TV component got a notification
of its own destruction. It doesn't seem useful behaviour... Perhaps I
am just showing up my ignorance of the FreeNotification subsystem.

W.

Will Watts Direct Line +44 20 8400 6104
Applied Industrial Systems Ltd Main Voice +44 20 8400 6100
10 Barley Mow Passage Fax +44 20 8742 2456
Chiswick London W4 4PH Web http://www.applied.co.uk

 | Replies | Author | Date
3083 | Re: VT 2.5.1 + Notification + AV problem | Mike Lischke | Sat 7/14/2001


re: Save/Load

From: "Jim Kueneman" [jimdk@m...]
Date: Thu Jul 12, 2001 2:49 pm
Subject: Re: Save/Load

--- In [VirtualTreeview@y...], [ltchoong@s...] wrote:
>
> Please note that timings are approximate only, and are based on my
> 166 MHz machine. 100 x 30 indicates 100 root nodes each with 30
> children nodes, a total of 3000 nodes.

TC,

When playing with this I noticed that the TMemoryStream creation and
destruction was very slow. Take those out and see how fast it is.

Jim

 | Replies | Author | Date
3070 | Re: Save/Load | TC Lai | Fri 7/13/2001
3071 | Re: Save/Load | Jim Kueneman | Fri 7/13/2001
3086 | Re: Save/Load | TC Lai | Sat 7/14/2001
3087 | Re: Save/Load | Jim Kueneman | Sat 7/14/2001
3096 | Re: Save/Load | TC Lai | Sun 7/15/2001


DB version of VT

From: "Ariel" [asel98@y...]
Date: Thu Jul 12, 2001 4:45 pm
Subject: DB version of VT

theres any person making it? (tcustomdataset compatible)
with full data load, and partial? (i mean duplicating data, and not)..

tnx.


re: OnGetText: Called so often only moving the focus

From: Ralf Junker [ralfjunker@g...]
Date: Thu Jul 12, 2001 5:46 pm
Subject: Re: [VirtualTreeview] OnGetText: Called so often only moving the focus

Hi to all who replied!

Thank you all for your answers and let me try to summarize:

Some things regarding the OnGetText event go without saying but must still be
taken care of:

1. Code in the event should be as small and as fast as possible.
2. Do not use it as the point to query databases.

That said, I feel some common ground on the following:

3. There is confusion about why the OnGetText event gets called relatively
often compared to what one would theoretically expect. Example: If moving the
focus affects two nodes only and does not scroll the tree, OnGetText should
_ideally_ be called 2 times the number of visible columns in the tree.

4. In practice, OnGetText gets called more often than that number. For example,
when the tree needs to know the with of the node, it also calls OnGetText. This
_small_ overhead should be fine.

5. What we experience, and what does cause some confusion, is that we see
OnGetText fired _many_ more times than we would expect from the above. Even Jim
was surprised about it, but used it to his advantage. All answers indicate that
the tree is likely to be faster if the calls to OnGetText could be reduced,
especially in situations similar to the above.

Concluding:

My tests show that a focus change triggers OnGetText at least once for each
visible node multiplied by the visible columns. I.e. 40 visible nodes * 3
columns = 120 times as a minimum.

Further testing showed that a single focus change causes the entire tree to be
redrawn, i.e. the Paint and the PaintTree method to be called.

Looking at the OnFocusNode and the ScrollIntoView procedure makes me me believe
that they are smart enough not to initialize a repaint of the entire tree.

So finally my question is: What does cause the entire tree to be repainted?
Where does the WM_PAINT message originate from? If this could be avoided, the
problem could be solved easily.

However, at this point I am lost. I never understood thoses Windows messages.
Maybe someone else has the answer?

-- Ralf

PS: Let me try to explain why I think this is important: Caching of database
records is fine. Just cache the data on the OnInitNode event. What happens when
a user expands the entire tree with some thousand nodes? All tables' data is
loaded into memory. OK, only cache records for visible nodes. But how to tell
when a node moves out of the tree's window so its record can be released? How
to tell when it moves back in? Just a suggestion: Maybe two new events
OnScrollIntoView and OnScrollOutOfView would come in handy?

At 10:26 11.07.2001, you wrote:
>Hi Ralf,
>
>> >OnGetText along with OnGetImageIndex and OnNewText is one of those event
>> >handlers that implement the "data" of a virtual node. These event handlers
>> >ARE EXPECTED to be called very often (every time a node needs to be painted
>> >for example).
>>
>> I fully understand the virtual paradigm. Your answer does not explain why
the node queries for data if the node does not change and there does not seem
to be a need for a node to be painted because it is painted already.
>>
>> We are talking about only moving the focus (i.e. pressing key up once) and
OnGetText is fired more than 100 times.
>>
>> Is there no way this could be changed?
>>
>> I do not intend to offend anybody. VirtualTres is for sure one of the best
open source products in the Delphi industry. However, it does not mean it can
not be improved. I think that it would greatly benefit from reducing the number
the OnGetText and OnGetImageIndex get fired.
>>
>> Any thoughts?
>
>you say that you are querying the DB for gettext. Each time? You should really
cache at least
>node text's and image indices in your node data.
>
>Having said that I just put a counter into one of my GetText handlers. In a
tree with only
>four (top level) nodes, possibly static text and two columns (2nd mostly empty
but with col
>spanning switched on so it has to be asked for text anyway) it is called 15
times per focus
>change. If the tree contains more and nested nodes it is usually 50-70 times
per focus change.
>
>These numbers sound high to me as well. But *if* you have the data already in
memory or (speaking
>in VT terms) the node is init'ed none of todays CPU's would frown at 100 or
more times. I have
>done a search for DoGetText in VirtualTrees.pas and it is 16 times in there
(not counting the
>declaration and definition). Hard to say if the node text can be cached in the
tree itself only
>for the current task it has to accomplish. My (wild!) guess is that the amount
of GetText events
>may be cut in half by retrieving it only once for related tasks. Would require
a fair amount of
>work probably. And I doubt that your tree would get reasonably faster if your
DB was not queried
>100 but 50 times per focus change.
>
>Regards,
>Werner


ScrollIntoView

From: "Jim Kueneman" [jimdk@m...]
Date: Fri Jul 13, 2001 1:56 am
Subject: ScrollIntoView

Hi Mike,

I know you added this by request and I have tried to get use to it
but one feature I really liked was when you expanded a node it did not
"jump away" from you, even if it meant some of the child nodes are
hidden. I know you are out of Option bits but is there some way to
add this as a parameter to DoExpand or something?

Jim

 | Replies | Author | Date
3084 | Re: ScrollIntoView | Mike Lischke | Sat 7/14/2001


re: New file uploaded to VirtualTreeview

From: GIANNAKOPOULOS KOSTAS [kyan@s...]
Date: Fri Jul 13, 2001 9:26 am
Subject: RE: [VirtualTreeview] New file uploaded to VirtualTreeview

> Thank you for suggesting this, but currently I would really
> like to avoid implementing anything new.
> Please understand this.

I apologize if the word "incomplete" has offended you.

Of course i understand that you do not want to add new features, i wasn't
trying to press you, i thought that was clear in my message.

Today i went through my mail archive and i found that Vadim Sedulin has
proposed something relative in the past (having the user provide a TypeInfo
pointer and using it for memory management).

I am just suggesting that you should consider this approach (or figure out
another one) some time in the future. Only today i found out that i have to
call Finalize() in OnFreeNode if i have reference counted data members in
the node record to avoid a memory leak.

You can blame me of carelessness if you want, but i think that asking an
end-user of a component to be aware of the quirks of memory management for
reference counted data types is too much. People take it for granted that
strings, variants, dynamic arrays and interfaced objects are automatically
freed when they go out of references.

Oh, and i think that the record approach IS quite popular. You even use it
in your demos (and the memory leak seems to be there too).

<KY>


re: New file uploaded to VirtualTreeview

From: "Bjorn Lindell" [bli@c...]
Date: Fri Jul 13, 2001 10:41 am
Subject: Re: [VirtualTreeview] New file uploaded to VirtualTreeview

----- Original Message -----
From: "GIANNAKOPOULOS KOSTAS" [kyan@s...]
To: <VirtualTreeview@yahoogroups.com>
Sent: Friday, July 13, 2001 11:26 AM
Subject: RE: [VirtualTreeview] New file uploaded to VirtualTreeview

>
> I am just suggesting that you should consider this approach (or figure out
> another one) some time in the future. Only today i found out that i have
to
> call Finalize() in OnFreeNode if i have reference counted data members in
> the node record to avoid a memory leak.

Hmm, interesting, didn't know this.
Since I am a bit paranoid about how Delphi manages reference counting
(probably due to oddities in earlier versions), I always take some overhead
precautions. For instance, I sometimes use a delphi object as a wrapper for
an interface when I need to store lists of COM-objects etc since I am
comfortable with the management of delphi objects, but uncertain about
finer details of reference counting when pointer manipulation and type
casting is involved. Also, I sometimes explicitly assign "nil" to interface
variables
even though they are supposed to be handled by scoping rules, just
to be explicit.

Just curious, instead of using Finalize on the interface reference, would it
not do the same trick by assigning "nil" ? For instance, if we have the
record

TMyRec = record
iface : IMyCOMStuff;
end;

procedure TEFBLinkFormMain.vstFreeNode(
Sender: TBaseVirtualTree; Node: PVirtualNode);
var
Data: PMyRec;
begin
Data := Sender.GetNodeData(Node);
if Assigned(Data) then
Data.iface := nil
end;
end;


re: New file uploaded to VirtualTreeview

From: GIANNAKOPOULOS KOSTAS [kyan@s...]
Date: Fri Jul 13, 2001 10:45 am
Subject: RE: [VirtualTreeview] New file uploaded to VirtualTreeview

> Just curious, instead of using Finalize on the interface
> reference, would it
> not do the same trick by assigning "nil" ? For instance, if
> we have the
> record
>
> TMyRec = record
> iface : IMyCOMStuff;
> end;
>
> procedure TEFBLinkFormMain.vstFreeNode(
> Sender: TBaseVirtualTree; Node: PVirtualNode);
> var
> Data: PMyRec;
> begin
> Data := Sender.GetNodeData(Node);
> if Assigned(Data) then
> Data.iface := nil
> end;
> end;

Of course, but it's much more "tidy" to do:

procedure TEFBLinkFormMain.vstFreeNode(
Sender: TBaseVirtualTree; Node: PVirtualNode);
begin
if Assigned(Data) then
Finalize(PMyRec(Sender.GetNodeData(Node))^); // The typecast "PMyRec()"
IS ABSOLUTELY NECESSARY
end;

instead of

procedure TEFBLinkFormMain.vstFreeNode(
Sender: TBaseVirtualTree; Node: PVirtualNode);
var
Data: PMyRec;
begin
Data := Sender.GetNodeData(Node);
if Assigned(Data) then
with Data^ do
begin
sText := ''; // string or WideString
vValue := Unassigned; // Variant
iface := nil; // Interface pointer
:
:
end;
end;


re: Re: Save/Load

From: TC Lai [lai_tc@y...]
Date: Fri Jul 13, 2001 12:26 pm
Subject: Re: [VirtualTreeview] Re: Save/Load

Jim,

I tried it after removing the Data.Note and the code
for processing it. The time taken to load the file
(3000 nodes) is 7 seconds, and 11 seconds to save.
This case is a bit strange because the time to save is
consistently much longer than to load.

Regards,

TC

--- Jim Kueneman [jimdk@m...] wrote:

> TC,
>
> When playing with this I noticed that the
> TMemoryStream creation and
> destruction was very slow. Take those out and see
> how fast it is.
>
> Jim
>
>

__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail
http://personal.mail.yahoo.com/

 | Replies | Author | Date
3071 | Re: Save/Load | Jim Kueneman | Fri 7/13/2001
3086 | Re: Save/Load | TC Lai | Sat 7/14/2001
3087 | Re: Save/Load | Jim Kueneman | Sat 7/14/2001
3096 | Re: Save/Load | TC Lai | Sun 7/15/2001


re: Save/Load

From: "Jim Kueneman" [jimdk@m...]
Date: Fri Jul 13, 2001 2:10 pm
Subject: Re: Save/Load

--- In [VirtualTreeview@y...], TC Lai [lai_tc@y...] wrote:
> Jim,
>
> I tried it after removing the Data.Note and the code
> for processing it. The time taken to load the file
> (3000 nodes) is 7 seconds, and 11 seconds to save.
> This case is a bit strange because the time to save is
> consistently much longer than to load.

We need to back up here. Was the main problem that VT is slower than
TTreeview saving the same data? Try iterating through every node and
saving the data directly (search through VT public methods it should
start with GetFirst then a GetNextXXX or something to that effect
there is also a method that takes a callback to iterate through the
whole tree), you can't recreate the tree but you can see if the
bottleneck is in VT's implementation of SaveToTree (or whatever its
name is)

Jim

 | Replies | Author | Date
3086 | Re: Save/Load | TC Lai | Sat 7/14/2001
3087 | Re: Save/Load | Jim Kueneman | Sat 7/14/2001
3096 | Re: Save/Load | TC Lai | Sun 7/15/2001


One more problem under Delphi6.

From: [basil@r...]
Date: Fri Jul 13, 2001 2:46 pm
Subject: One more problem under Delphi6.

Hi Mike,

One more problem under Delphi6.

I have an ActiveX form with Virtual Tree on it.
When I close HTML page containing the form
the page doesn't close and waits forever at
the following line:

...
WorkerThread.Free;
...

Best regards.
Basil.

 | Replies | Author | Date
3085 | Re: One more problem under Delphi6. | Mike Lischke | Sat 7/14/2001


XMLTree Component

From: "Moritz Franckenstein" [franckenstein@a...]
Date: Fri Jul 13, 2001 4:34 pm
Subject: XMLTree Component

Hi all,

if someone is interested in a first working version of my XMLTree
component, it can be downloaded here:

http://groups.yahoo.com/group/VirtualTreeview_de/files/XMLTreeTest.zip

A test project and its exe file is included.

There is still a lot to do (and some things are solved not so nice),
suggestions are welcome.

-Moritz

 | Replies | Author | Date
3078 | Re: XMLTree Component | [adembaba@e...] | Fri 7/13/2001
3105 | Re: XMLTree Component | Moritz Franckenstein | Sun 7/15/2001
3111 | Re: XMLTree Component | [adembaba@e...] | Sun 7/15/2001
3123 | Re: XMLTree Component | Moritz Franckenstein | Mon 7/16/2001
3124 | Re: XMLTree Component | Franz-Leo Chomse | Mon 7/16/2001
3126 | Re: XMLTree Component | Moritz Franckenstein | Mon 7/16/2001
3129 | Re: XMLTree Component | [adembaba@e...] | Mon 7/16/2001
3136 | Re: XMLTree Component | Moritz Franckenstein | Tue 7/17/2001
3116 | Re: XMLTree Component | Wim van der Vegt | Sun 7/15/2001


re: DoGetImageIndex is not so nice

From: "Mike Lischke" [lists@l...]
Date: Fri Jul 13, 2001 7:46 pm
Subject: RE: [VirtualTreeview] DoGetImageIndex is not so nice

Hi Moritz,

> all Do... functions should do nothing other than calling the event
> handler. and they should have the same parameters. in this case,
> Index as var parameter and not as result.

I see this a bit different. Those methods must also provide a default value if
there is no event
handler, so the caller does not have to take care of it. This particularly
important since the
return value can either be provided by the event or by an overriden method.
Thus the caller should
rely on a certain behaviour.

Ciao, Mike

 | Replies | Author | Date
3104 | Re: DoGetImageIndex is not so nice | Moritz Franckenstein | Sun 7/15/2001
3137 | Re: DoGetImageIndex is not so nice | Moritz Franckenstein | Tue 7/17/2001
3194 | Re: DoGetImageIndex is not so nice | Mike Lischke | Sat 7/21/2001


re: BCB5, VT2.5.7 and AddChild

From: "Mike Lischke" [lists@l...]
Date: Fri Jul 13, 2001 7:46 pm
Subject: RE: [VirtualTreeview] BCB5, VT2.5.7 and AddChild

> function AddChild(Parent: PVirtualNode): PVirtualNode; overload;
> function AddChild(Parent: PVirtualNode;
> UserData: Pointer = nil): PVirtualNode; overload;
>
> function TBaseVirtualTree.AddChild(Parent: PVirtualNode): PVirtualNode;
> begin
> AddChild(Parent, nil);
> end;
>
> Of course this has to be done in VirtualTrees.pas . Perhaps Mike could give
> some time to us, BCB5 users?

I won't come around that if nobody comes up with a solution for BCB. Is there
really no default
parameter possible in BCB4+? I have problems to believe that...

Ciao, Mike

 | Replies | Author | Date
3118 | Re: BCB5, VT2.5.7 and AddChild | Roland | Mon 7/16/2001
3195 | Re: BCB5, VT2.5.7 and AddChild | Mike Lischke | Sat 7/21/2001
3225 | Re: BCB5, VT2.5.7 and AddChild | Roland | Mon 7/23/2001
3354 | Re: BCB5, VT2.5.7 and AddChild | Mike Lischke | Sun 8/5/2001
3366 | Re: BCB5, VT2.5.7 and AddChild | Roland | Mon 8/6/2001


re: Drag & drop highlighting failing

From: "Mike Lischke" [lists@l...]
Date: Fri Jul 13, 2001 7:46 pm
Subject: RE: [VirtualTreeview] Drag & drop highlighting failing

> I'm having problems with drag & drop highlighting. Sometimes (and I
> cannot say how to reproduce it, it appears to be random) when
> dragging a node, VT does not highlight the nodes being dragged over.
>
> It looks like VT thinks there is some "box" partially over the tree.
> Anything in this hidden box is not highlighted. Sometimes the node
> is "partially" highlighted, i.e. half-in this hidden box.

Mmmh, never heard about this. VT does a very hard job to make the drag image
really smooth which
also requires not to paint over parts of other windows. It could be that the
update region
calculation is fooled somehow. But this is very wild guess and without a little
program
demonstrating the effect I can't do anything.

Ciao, Mike


re: OnGetText: Called so often only moving the focus

From: "Mike Lischke" [lists@l...]
Date: Fri Jul 13, 2001 7:46 pm
Subject: RE: [VirtualTreeview] OnGetText: Called so often only moving the focus

> In my recent adventure trying to get IShellFolder2.GetDetailOf working I
> also noticed when the popup hint window closed the text in every cell was
> redrawn. I have to admit that this "feature" helped me debug my problem
> but it did seem inefficent.

Well, I already use CS_SAVEBITS but it does not seem to have the desired
effect. It could well be
that VT itself is the reason for repaints after the hint window disappears but
I do not really
consider this as inefficent as it is. It simply happens too rarely.

Ciao, Mike


re: XMLTree Component

From: [adembaba@e...]
Date: Fri Jul 13, 2001 8:25 pm
Subject: Re: XMLTree Component

Hi Moritz,

> if someone is interested in a first working version of my XMLTree
> component, it can be downloaded here:
>
> There is still a lot to do (and some things are solved not
> so nice), suggestions are welcome.

Looks real good. And fast.

How do I find MSXML ActiveX in the 'Component | Import
ActiveX Control...' window? To make sure I have it,
I have downloaded it and installed it; but cant find
it for Delphi.

My second --sort of-- gripe is that it has to use
M$ ActiveX, could you not consider writing your own
parser or use other peoples free stuff, such as
home.hetnet.nl/~newlife-software/Delphi/index.html#NLDoc
which is not bad at all.

And, finally, it may be too late, but, would it not
be a good idea to name your VCL something like
TVirtualXMLTree or TVirtualTreeXML or TXMLVirtualTree
so that it could better be distinguished from so many
generic TXMLTree attempts.

Cheers,
Adem

 | Replies | Author | Date
3105 | Re: XMLTree Component | Moritz Franckenstein | Sun 7/15/2001
3111 | Re: XMLTree Component | [adembaba@e...] | Sun 7/15/2001
3123 | Re: XMLTree Component | Moritz Franckenstein | Mon 7/16/2001
3124 | Re: XMLTree Component | Franz-Leo Chomse | Mon 7/16/2001
3126 | Re: XMLTree Component | Moritz Franckenstein | Mon 7/16/2001
3129 | Re: XMLTree Component | [adembaba@e...] | Mon 7/16/2001
3136 | Re: XMLTree Component | Moritz Franckenstein | Tue 7/17/2001


Problems with NodeHeight

From: [andersthomsen@h...]
Date: Sat Jul 14, 2001 2:49 am
Subject: Problems with NodeHeight

Hi Mike,

Please take a look at a sample project I've placed in the Screen
Shots folder in the file area:

http://groups.yahoo.com/group/VirtualTreeview/files/Screen%
20shots/nodeheightbug.zip

It shows a problem with redrawing the tree if a childs nodeheight is
set.

The nodeheight property is set trough the tree.nodeheight[node] := x
so that is not the problem : )

- Thomsen


Problems with NodeHeight

From: [andersthomsen@h...]
Date: Sat Jul 14, 2001 2:57 am
Subject: Problems with NodeHeight

Hi Mike,

I've uploaded an example project that shows a bug when setting the
nodeheight for child nodes. It acts as if the nodeheight is set
directly to node.nodeheight := x, but it is set by tree.nodeheight
[node] := x

Please take a look to see if this is a bug or if it's just me.

I've placed the project in the ScreenShots folder so I don't pollute
the main folder.

- Thomsen

 | Replies | Author | Date
3112 | Re: Problems with NodeHeight | Mike Lischke | Sun 7/15/2001


re: Access violations in very special circumstance (OCX)

From: "Mike Lischke" [lists@l...]
Date: Sat Jul 14, 2001 12:32 pm
Subject: RE: [VirtualTreeview] Access violations in very special circumstance (OCX)

Hi Björn,

> However, I managed to track it down to the finalization
> section of "virtualtrees.pas". It turns out it gets called first when
> my application closes (I guess that is when the OCX-DLL is
> unloaded as well, although I much earlier destroyed the actual
> OCX-instance). The failing code line is the OleUninitialize line.
>
> I am not sure why this occurs, perhaps there is some mismatch
> with something in my particular App.
> Anyway, my workaround was to remove the initialization/
> finalization sections of "virtualtrees" and instead call a
> "doInitialization" and "doFinalization" procedure whenever a VT-component is
> created/destroyed. To prevent multiple calls, I keep a global
> counter. This way, my problem disappeared.

Mmmh, very strange. OleInitialize as well as OleUninitialize are called in the
context of the main
thread so this should be balanced. But perhaps with OCX this is a bit different?

> I am however interested in hearing if anyone has similar
> experiences or any idea as to what the problem might be.

Seems there are no other who encountered this effect. However I would like to
learn from your
experiences because I want to create an OCX from VT. Unfortunately many of the
properties are not
automatically converted by the wizard because they do not use standard OLE data
types. How did you
manage this problem? Manually including them all is not a good option since the
OCX might need to be
recreated several times until there is a final verison.

Ciao, Mike


re: OnGetText: Called so often only moving the focus

From: "Mike Lischke" [lists@l...]
Date: Sat Jul 14, 2001 12:32 pm
Subject: RE: [VirtualTreeview] OnGetText: Called so often only moving the focus

> Ok, I found...
>
> procedure TBaseVirtualTree.ClearSelection;
> This procedure called from WMKeyDown if (Shift = []) or (ActAsGrid and not
> (ssShift in Shift)) or not (voMultiSelect in FOptions) or (CharCode in
> [VK_TAB, VK_BACK]).

Indeed, if multi selection is enabled then the previous selection must be
cleared if a key is
pressed without modifiers like Ctrl or Shift. If multi selection is not active
then only two nodes
are invalidated.

Ciao, Mike


re: Re:VT 2.5.1 + Notification + AV problem

From: "Mike Lischke" [lists@l...]
Date: Sat Jul 14, 2001 12:32 pm
Subject: RE: [VirtualTreeview] Re:VT 2.5.1 + Notification + AV problem

Hi Will,

> 4. TBaseVirtualTree.Notification is called, and as currently
> implemented executes the line of code (around 17125 in 2.5.1)
>
> if AComponent = FHeader.FImages then
>
> Now I say this is intrinsically dangerous because FHeader has been
> freed.

Now I got what you meant. Of course you are totally right. The dangerous part
is the test using
FHeader which might already been destroyed. Thank you for making me aware of
this. I have included
your solution.

Ciao, Mike


re: ScrollIntoView

From: "Mike Lischke" [lists@l...]
Date: Sat Jul 14, 2001 12:32 pm
Subject: RE: [VirtualTreeview] ScrollIntoView

Hi Jim,

> I know you added this by request and I have tried to get use to it
> but one feature I really liked was when you expanded a node it did not
> "jump away" from you, even if it meant some of the child nodes are
> hidden. I know you are out of Option bits but is there some way to
> add this as a parameter to DoExpand or something?

I'll add this as a new option. Since I have to restructure the options anyway
it is not a problem to
add new ones. I think again about a kind of registration scheme so descentants
can add their own
options.

Ciao, Mike


re: One more problem under Delphi6.

From: "Mike Lischke" [lists@l...]
Date: Sat Jul 14, 2001 12:32 pm
Subject: RE: [VirtualTreeview] One more problem under Delphi6.

Hi Basil,

> I have an ActiveX form with Virtual Tree on it.
> When I close HTML page containing the form
> the page doesn't close and waits forever at
> the following line:
>
> ...
> WorkerThread.Free;

It seems a very nasty problem raises its head again. I had a hard time to
figure out why a control
panel applet hung when it contained a VT instance. After a lot of investigation
I found out that
there is an unfortunate combination of Windows DLL behavior (and an ActiveX
server is located in a
DLL) and Delphi's VCL led to this problem. The initialization sections of
Delphi units in DLLs are
executed when the DLL is loaded and the (usually hidden) DLLMain function is
called by Windows with
DLL_PROCESS_ATTACH as reason. So far no problems. However the finalization
sections are executed on
DLL_PROCESS_DETACH and here a difficult problem appears. Windows "serializes"
execution of process
detach (this is how they call it). What they mean is that it is guaranteed that
no other than the
main thread of a process is executed at that time. While this is surely often
very helpful it
becomes a pain if you want to release other threads just in this finalization
code.

Because other threads will never awake again once the detaching is complete you
would not need to
wait for your other threads to make sure they cleaned up correctly, but this is
something I do not
consider good style. Consequently on destruction of the worker thread I want to
wait for the end of
its execution so I can be sure it is freed correctly. The VCL implicitely calls
WaitFor to wait for
the thread when it is being destroyed. So I only need to call Thread.Free.
While this works in most
applications it can result in a deadlock in DLLs because of the fact that the
worker thread never
gets any CPU time on unit finalization. For this situation I have included the
lines:

if IsLibrary then
Suspend;

This will prevent that the VCL calls WaitFor the thread and all is fine.
However it seems that with
ActiveX controls this call is not done so the only conclusion which remains is
that IsLibrary is not
set to True for ActiveX servers. Could you please verify this? And perhaps you
can find another flag
which can be tested for ActiveX servers?

Ciao, Mike


re: Re: Save/Load

From: TC Lai [lai_tc@y...]
Date: Sat Jul 14, 2001 1:15 pm
Subject: Re: [VirtualTreeview] Re: Save/Load

Jim,

Yes, I did use iterating through every node for saving
and loading tree data. That was what cases 1 and 2 in
my message 2915 was about. And this method was faster
than using OnSaveNode and OnLoadNode handlers (case
3). TTreeview was slightly faster at 10 seconds for a
similar file size and the same number of nodes.

I summarise below:

Root Nodes : 3000
File Size : ~ 2 MB

Save/Load
Treeview Method Load (sec) Save (sec)
===================================================
TTreeview Iteration 10 10

VT Iteration 6 6

VT OSN/OLN 11 11

Duke_n5's posting promted me to try the two methods
with bigger files. Below is a summary of the
comparison.

Root Nodes : 3000
File Size : ~ 6.5 MB

Save/Load
Treeview Method Load (sec) Save (sec)
===================================================
TTreeview Iteration 26 26

VT Iteration 26 26

VT OSN/OLN 12 12

It can be seen from the above table that with an
increase in file size from 2 MB to about 6.5 MB the
time taken to save and load a file using the
OnSaveNode and OnLoadNode handlers increased only
slightly. Whereas when using the iteration method, the
time has increased considerably. Even though the
iteration method has clocked a low of 18 seconds, it
was still slower, but most of the time it clocked
between 26 to 28 seconds.

I will stick with the recommended method of using the
OnSaveNode and OnLoadNode handlers.

Regards,

TC

--- Jim Kueneman [jimdk@m...] wrote:
> --- In [VirtualTreeview@y...], TC Lai [lai_tc@y...]
> wrote:
> > Jim,
> >
> > I tried it after removing the Data.Note and the
> code
> > for processing it. The time taken to load the file
> > (3000 nodes) is 7 seconds, and 11 seconds to save.
> > This case is a bit strange because the time to
> save is
> > consistently much longer than to load.
>
> We need to back up here. Was the main problem that
> VT is slower than
> TTreeview saving the same data? Try iterating
> through every node and
> saving the data directly (search through VT public
> methods it should
> start with GetFirst then a GetNextXXX or something
> to that effect
> there is also a method that takes a callback to
> iterate through the
> whole tree), you can't recreate the tree but you can
> see if the
> bottleneck is in VT's implementation of SaveToTree
> (or whatever its
> name is)
>
> Jim
>
>

__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail
http://personal.mail.yahoo.com/

 | Replies | Author | Date
3087 | Re: Save/Load | Jim Kueneman | Sat 7/14/2001
3096 | Re: Save/Load | TC Lai | Sun 7/15/2001


re: Re: Save/Load

From: Jim Kueneman [jimdk@m...]
Date: Sat Jul 14, 2001 2:29 pm
Subject: Re: [VirtualTreeview] Re: Save/Load

At 06:15 AM 7/14/2001 -0700, you wrote:

>I will stick with the recommended method of using the
>OnSaveNode and OnLoadNode handlers.

I think the obvious solution is to upgrade the 166, then it won't matter ;^)

Jim

 | Replies | Author | Date
3096 | Re: Save/Load | TC Lai | Sun 7/15/2001


re: Access violations in very special circumstance (OCX)

From: Björn Lindell [bli@c...]
Date: Sat Jul 14, 2001 3:42 pm
Subject: Re: [VirtualTreeview] Access violations in very special circumstance (OCX)

> Mmmh, very strange. OleInitialize as well as OleUninitialize are called in
the context of the main
> thread so this should be balanced. But perhaps with OCX this is a bit
different?

I think there is something particular to do with the main app I was
integrating it with,
I did try using the OCX from a testapplication and that worked fine.
The interesting thing was that even if I didn't use the VT at all, but just
included "virtualtrees.pas"
in my OCX-project, I would still get that problem. I seem to recall someone
else posting
something about using an ActiveX Form and having problems in Internet
Explorer, don't know
if it was the same problem though.

>However I would like to learn from your
>experiences because I want to create an OCX from VT. Unfortunately many of
the properties are not
>automatically converted by the wizard because they do not use standard OLE
data types. How did you
>manage this problem? Manually including them all is not a good option since
the OCX might need to be
>recreated several times until there is a final verison.

My OCX doesn't publish any tree-related properties really, it is sort of
"self-contained", it is not a
general OCX-wrapper but rather a specific solution and thus only publish
some properties and methods
that I myself implement.

I am not sure how a more general VT OCX-wrapper would be created, since
there are a lot of
lower-level handling with pointers and stuff. If you give me some more
details on your plans for this,
I can try and see if I can help you out a little. I doubt that every aspect
of VT will be "portable" to an
OCX, and doing some manual work is probably unavoidable.

/Björn

 | Replies | Author | Date
3113 | Re: Access violations in very special circumstanc | Mike Lischke | Sun 7/15/2001


re: ScrollIntoView

From: Raymond Wilson [raymond.wilson@t...]
Date: Sat Jul 14, 2001 8:20 pm
Subject: RE: [VirtualTreeview] ScrollIntoView

Though I have not looked at the code, why is there a restriction on the
number of options? Isn't it just a set?

Cheers,
Raymond.

-----Original Message-----
From: Mike Lischke [mailto:[lists@l...]]
Sent: 15 July 2001 00:33
To: VirtualTreeview@yahoogroups.com
Subject: RE: [VirtualTreeview] ScrollIntoView

Hi Jim,

> I know you added this by request and I have tried to get use to it
> but one feature I really liked was when you expanded a node it did not
> "jump away" from you, even if it meant some of the child nodes are
> hidden. I know you are out of Option bits but is there some way to
> add this as a parameter to DoExpand or something?

I'll add this as a new option. Since I have to restructure the options
anyway it is not a problem to
add new ones. I think again about a kind of registration scheme so
descentants can add their own
options.

Ciao, Mike

To unsubscribe from this group, send an email to:
VirtualTreeview-unsubscribe@egroups.com

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/


I'm sorry but I am getting crazy

From: [drrfaustus@y...]
Date: Sat Jul 14, 2001 9:53 pm
Subject: I'm sorry but I am getting crazy

Well I guess this is a very easy question but I've been two days with
it and I cannot find the reason why this doesn't work. I am starting
with delphi after some years out of programming so I guess I am doing
something wrong. Can you tell me why this doesn't work??? What am I
doing wrong??

Thanks in advance and sorry if this is a stupid question.

type
PMyNodeData = ^TMyNodeData;
TMyNodeData = record
ID: Cardinal;
Caption: String;
end;

procedure TForm1.Button1Click(Sender: TObject);
var
Node, Node1:PVirtualnode;
data: PMyNodeData;
begin

Node1:=Tree1.AddChild(nil);
Node:=Tree1.AddChild(Node1);

Data := Tree1.GetNodeData(Node1);
Data.Caption := 'This is my caption';
end;
end.
I get a Memory access violation

Thanks again

 | Replies | Author | Date
3091 | Re: I'm sorry but I am getting crazy | Werner Lehmann | Sat 7/14/2001
3093 | Re: I'm sorry but I am getting crazy | =?iso-8859-1?Q?Bj=F6rn_Lindel | Sat 7/14/2001
3094 | Re: I'm sorry but I am getting crazy | Jim Kueneman | Sat 7/14/2001


re: I'm sorry but I am getting crazy

From: Werner Lehmann [wl@b...]
Date: Sat Jul 14, 2001 10:27 pm
Subject: Re: [VirtualTreeview] I'm sorry but I am getting crazy

[drrfaustus@y...] wrote:
>
> procedure TForm1.Button1Click(Sender: TObject);
> var
> Node, Node1:PVirtualnode;
> data: PMyNodeData;
> begin
>
> Node1:=Tree1.AddChild(nil);
> Node:=Tree1.AddChild(Node1);
>
> Data := Tree1.GetNodeData(Node1);
> Data.Caption := 'This is my caption';
> end;
> end.
> I get a Memory access violation

Did you set your nodedatasize?

Tree1.NodeDataSize := SizeOf(TMyNodeData);

Since you are using a long string you may also need Initialize(Data), but
probably not because Init' does nothing but zero the data memory which is
already allocated zero'ed out.

Werner


re: ScrollIntoView

From: Werner Lehmann [wl@b...]
Date: Sat Jul 14, 2001 10:32 pm
Subject: Re: [VirtualTreeview] ScrollIntoView

Raymond Wilson wrote:
>
> Though I have not looked at the code, why is there a restriction on the
> number of options? Isn't it just a set?

AFAIK, the number of members of a pascal set is limited to 256. If the set
is to be published (like Options) the limit is 32 members because the size
of the set property must be 4 bytes at most.

Werner


re: I'm sorry but I am getting crazy

From: Björn Lindell [bli@c...]
Date: Sat Jul 14, 2001 10:40 pm
Subject: Re: [VirtualTreeview] I'm sorry but I am getting crazy

It seems mostly correct, but
the last part:

Data := Tree1.GetNodeData(Node1);
Data.Caption := 'This is my caption';

should be placed in the event "OnInitNode" of
the tree. Due to the "virtualness" of VT, nodes
are initialized first when they are required.

It should be something like the following:

procedure TForm1.Tree1InitNode(
Sender: TBaseVirtualTree; ParentNode, Node: PVirtualNode;
var InitialStates: TVirtualNodeInitStates);
var
Data: PMyNodeData;
begin
Data := Sender.GetNodeData(Node);
Data.Caption := 'This is my caption';
end;

Also, make sure that you have initialized the tree
with the size of your structure, such as:

procedure TForm1.FormCreate(sender : TObject);
begin
Tree1.NodeDataSize := SizeOf(TMyNodeData);
end;

----- Original Message -----
From: [drrfaustus@y...]
To: <VirtualTreeview@yahoogroups.com>
Sent: Saturday, July 14, 2001 11:53 PM
Subject: [VirtualTreeview] I'm sorry but I am getting crazy

> Well I guess this is a very easy question but I've been two days with
> it and I cannot find the reason why this doesn't work. I am starting
> with delphi after some years out of programming so I guess I am doing
> something wrong. Can you tell me why this doesn't work??? What am I
> doing wrong??
>
> Thanks in advance and sorry if this is a stupid question.
>
> type
> PMyNodeData = ^TMyNodeData;
> TMyNodeData = record
> ID: Cardinal;
> Caption: String;
> end;
>
> procedure TForm1.Button1Click(Sender: TObject);
> var
> Node, Node1:PVirtualnode;
> data: PMyNodeData;
> begin
>
> Node1:=Tree1.AddChild(nil);
> Node:=Tree1.AddChild(Node1);
>
>
> Data := Tree1.GetNodeData(Node1);
> Data.Caption := 'This is my caption';
> end;
> end.
> I get a Memory access violation
>
> Thanks again
>
>
> To unsubscribe from this group, send an email to:
> VirtualTreeview-unsubscribe@egroups.com
>
>
>
> Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
>
>


re: I'm sorry but I am getting crazy

From: Jim Kueneman [jimdk@m...]
Date: Sat Jul 14, 2001 10:52 pm
Subject: Re: [VirtualTreeview] I'm sorry but I am getting crazy

At 09:53 PM 7/14/2001 +0000, you wrote:
>Well I guess this is a very easy question but I've been two days with
>it and I cannot find the reason why this doesn't work. I am starting
>with delphi after some years out of programming so I guess I am doing
>something wrong. Can you tell me why this doesn't work??? What am I
>doing wrong??

Are you setting the amout of memory VT should allocate for your data?

NodeDataLSize := SizeOf(TMyNodeData);

In the OnCreate event of the form is a good place.

Jim


Another question from a beginner

From: [drrfaustus@y...]
Date: Sat Jul 14, 2001 11:48 pm
Subject: Another question from a beginner

First of all THANKS A LOT to Werner Bj and Jim. Yes!, it was what you
told me about setting the amount of memory for my Node.

I have solved it but I still don't get the caption of my node
I have created a Tree1InitMode and I change the caption there.
It is something like this

procedure TForm1.Tree1InitNode(Sender: TBaseVirtualTree; ParentNode,
Node: PVirtualNode; var InitialStates: TVirtualNodeInitStates);
var
Data: PMyNodeData;
begin
Data := Sender.GetNodeData(Node);
Data.Caption := 'This is my caption';
label1.Caption:=Data.Caption; // just to check if it changes
end;

Anyways when I see my Tree on the screen I still get the "Node"
caption but (just to check) the label1.caption has changed, so I
guess that is ok

Do I have to refresh or repaint the tree1?
I think that if my Data is a pointer to the node being initialised,
it should change automatically, so it should change automatically. Am
I wrong?

I have tried with the Paint, Update and refresh methods but I don't
get anything.

thanks again

 | Replies | Author | Date
3097 | Re: Another question from a beginner | Werner Lehmann | Sun 7/15/2001
3098 | Re: Another question from a beginner | Jim Kueneman | Sun 7/15/2001
3101 | Re: Another question from a beginner | Mike Lischke | Sun 7/15/2001


re: Re: Save/Load

From: TC Lai [lai_tc@y...]
Date: Sun Jul 15, 2001 12:07 am
Subject: Re: [VirtualTreeview] Re: Save/Load

Thanks Jim.

--- Jim Kueneman [jimdk@m...] wrote:
>
> I think the obvious solution is to upgrade the 166,
> then it won't matter ;^)
>
> Jim

Yes, I agree with you. It is in the pipeline for this
year anyway.

Duke_n5, I hope your question has been answered by
these exchanges.

Regards,

TC

__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail
http://personal.mail.yahoo.com/


re: Another question from a beginner

From: Werner Lehmann [wl@b...]
Date: Sun Jul 15, 2001 12:17 am
Subject: Re: [VirtualTreeview] Another question from a beginner

[drrfaustus@y...] wrote:
>
> Do I have to refresh or repaint the tree1?
> I think that if my Data is a pointer to the node being initialised,
> it should change automatically, so it should change automatically. Am
> I wrong?

It may or may not be obvious but are you handling the OnGetText event?

Werner


re: Another question from a beginner

From: Jim Kueneman [jimdk@m...]
Date: Sun Jul 15, 2001 12:45 am
Subject: Re: [VirtualTreeview] Another question from a beginner

At 11:48 PM 7/14/2001 +0000, you wrote:
>I have solved it but I still don't get the caption of my node
>I have created a Tree1InitMode and I change the caption there.
>It is something like this

As Werner has already mentioned for the text remember that VT knows
absolutely *nothing* about what to put in the cells. There is an event
that is called to display anything other than the defaults Mike as hard
coded in.

Jim

 | Replies | Author | Date
3101 | Re: Another question from a beginner | Mike Lischke | Sun 7/15/2001


I'm gettting crazy too!

From: [andersthomsen@h...]
Date: Sun Jul 15, 2001 1:07 am
Subject: I'm gettting crazy too!

I'm using OnInitNode to filter nodes (to display them or not). To run
the filter I use tree.reinitnode(nil, true);

When running though a lot of nodes (in my example 10000), the tree
makes a weird drawing error, and I can't found out of what causes it.

It's a bit hard to explain, so I've uploaded a little demoproject in
the ScreenShots folder:
http://groups.yahoo.com/group/VirtualTreeview/files/Screen%
20shots/nodeselect.zip

Run the project, and try to drag a node right after the project is
started. When clicking down the mouse, look that only the first
pixels to the left are painted blue (selection color), and when
moving the mouse to drag the node, it freaks out.
I don't know if this is an error caused by VT or it is my use of
InitNode that causes this. But it's drivin' me crazy : )

I'm sorry that I can't explain the problem better, but please
download the example project to see for yourself (that is, if it
happens on your pc).

Using Win2k and Delphi5

-Thomsen


re: OnGetText: Called so often only moving the focus

From: "Vadim Sedulin" [wsntrl@o...]
Date: Sun Jul 15, 2001 3:37 am
Subject: Re: [VirtualTreeview] OnGetText: Called so often only moving the focus

> > Ok, I found...
> >
> > procedure TBaseVirtualTree.ClearSelection;
> > This procedure called from WMKeyDown if (Shift = []) or (ActAsGrid and
not
> > (ssShift in Shift)) or not (voMultiSelect in FOptions) or (CharCode in
> > [VK_TAB, VK_BACK]).
>
> Indeed, if multi selection is enabled then the previous selection must be
cleared if a key is
> pressed without modifiers like Ctrl or Shift. If multi selection is not
active then only two nodes
> are invalidated.

But Mike, full invalidate after each focus change?!!

Bye.

Vadim Sedulin
E-Mail: [wsntrl@o...]

 | Replies | Author | Date
3102 | Re: OnGetText: Called so often only moving the fo | Mike Lischke | Sun 7/15/2001
3106 | Find node | Franc v/d Westelaken | Sun 7/15/2001
3215 | Re: Find node | Mike Lischke | Sun 7/22/2001
3107 | Re: OnGetText: Called so often only moving the fo | Ralf Junker | Sun 7/15/2001
3214 | Re: OnGetText: Called so often only moving the fo | Mike Lischke | Sun 7/22/2001


re: Another question from a beginner

From: "Mike Lischke" [lists@l...]
Date: Sun Jul 15, 2001 7:04 am
Subject: RE: [VirtualTreeview] Another question from a beginner

> There is an event
> that is called to display anything other than the defaults Mike as hard
> coded in.

Actually, it is not hard coded but there is a property called DefaultText.

Ciao, Mike


re: OnGetText: Called so often only moving the focus

From: "Mike Lischke" [lists@l...]
Date: Sun Jul 15, 2001 7:06 am
Subject: RE: [VirtualTreeview] OnGetText: Called so often only moving the focus

> But Mike, full invalidate after each focus change?!!

Yes, in the worst case all nodes currently in the client area where selected
before the user changed
the focus.

Ciao, Mike

 | Replies | Author | Date
3106 | Find node | Franc v/d Westelaken | Sun 7/15/2001
3215 | Re: Find node | Mike Lischke | Sun 7/22/2001
3107 | Re: OnGetText: Called so often only moving the fo | Ralf Junker | Sun 7/15/2001
3214 | Re: OnGetText: Called so often only moving the fo | Mike Lischke | Sun 7/22/2001


One more problem under Delphi6

From: [basil@r...]
Date: Sun Jul 15, 2001 8:07 am
Subject: One more problem under Delphi6

Hi Mike,

1. IsLibrary returns true for OCX.
When I've commented out the following lines:

if IsLibrary then
Suspend;

the problem has gone. Borland revised the code for Thread
and it seems improved it (?).

2. I have found out that MapVirtualKey returns the wrong result
for digit keys under the national keyboard layout.
So consider adding a function, please:

function MapKey(CharCode: Word): Word;
var
kbs: TKeyboardState;
begin
GetKeyboardState(kbs);
toAscii(CharCode,OemKeyScan(CharCode)[,kbs,@R...],0);
end;

and then

NewChar := KeyUnicode(Char(MapKey(CharCode)));

It seems this code works (but I am not totally sure);

Best regards.
Basil.

 | Replies | Author | Date
3191 | Re: One more problem under Delphi6 | Mike Lischke | Sat 7/21/2001


re: DoGetImageIndex is not so nice

From: "Moritz Franckenstein" [franckenstein@a...]
Date: Sun Jul 15, 2001 12:03 pm
Subject: Re: DoGetImageIndex is not so nice

--- In [VirtualTreeview@y...], "Mike Lischke" [lists@l...] wrote:
> Hi Moritz,
>
> > all Do... functions should do nothing other than calling the event
> > handler. and they should have the same parameters. in this case,
> > Index as var parameter and not as result.
>
> I see this a bit different. Those methods must also provide a
default value if there is no event
> handler, so the caller does not have to take care of it. This
particularly important since the
> return value can either be provided by the event or by an overriden
method. Thus the caller should
> rely on a certain behaviour.

this is absolutely true. this function which sets the default value
and then calls the event handler is needed by you internally.

but usually Do... procedures are provided for derived components so
that they can override them and insert additional behaviour before or
after the event handler call.

having Do... wrappers around event calls is a standard way for
delphi. with your function the same standard things are not possible.
so the name of your function is misleading and a real Do... wrapper
for this event is missing.

-moritz

 | Replies | Author | Date
3137 | Re: DoGetImageIndex is not so nice | Moritz Franckenstein | Tue 7/17/2001
3194 | Re: DoGetImageIndex is not so nice | Mike Lischke | Sat 7/21/2001


re: XMLTree Component

From: "Moritz Franckenstein" [franckenstein@a...]
Date: Sun Jul 15, 2001 12:21 pm
Subject: Re: XMLTree Component

--- In [VirtualTreeview@y...], [adembaba@e...] wrote:
> Looks real good. And fast.
>
> How do I find MSXML ActiveX in the 'Component | Import
> ActiveX Control...' window? To make sure I have it,
> I have downloaded it and installed it; but cant find
> it for Delphi.

the correct dll is msxml.dll in your system32 folder.

i have used this very old version (1.0) of the ms parser because it
already is installed on every windows machine.
the new version 3.0 is much better and i will use it in practice.
then the dll is called msxml3.dll.

> My second --sort of-- gripe is that it has to use
> M$ ActiveX, could you not consider writing your own
> parser or use other peoples free stuff, such as
> home.hetnet.nl/~newlife-software/Delphi/index.html#NLDoc
> which is not bad at all.

no, the ms parser in the latest version is very good and i like it.
another reason is, that my component not only allows to parse xml as
text, it can also accept an XMLDocument dom object from outside which
is needed in my projects.
using a common and well-known parser makes my component much more
universal and it can exchange its data with a lot of other components
without reparsing it (or even work on the parsed data of another
component).
it is also planned that the xml tree has options to edit the xml -
this is also very good with the ms parser.

> And, finally, it may be too late, but, would it not
> be a good idea to name your VCL something like
> TVirtualXMLTree or TVirtualTreeXML or TXMLVirtualTree
> so that it could better be distinguished from so many
> generic TXMLTree attempts.

yes, hmmm, i will think about it :)

-moritz

 | Replies | Author | Date
3111 | Re: XMLTree Component | [adembaba@e...] | Sun 7/15/2001
3123 | Re: XMLTree Component | Moritz Franckenstein | Mon 7/16/2001
3124 | Re: XMLTree Component | Franz-Leo Chomse | Mon 7/16/2001
3126 | Re: XMLTree Component | Moritz Franckenstein | Mon 7/16/2001
3129 | Re: XMLTree Component | [adembaba@e...] | Mon 7/16/2001
3136 | Re: XMLTree Component | Moritz Franckenstein | Tue 7/17/2001


Find node

From: "Franc v/d Westelaken" [F.vdwestelaken@c...]
Date: Sun Jul 15, 2001 12:24 pm
Subject: Find node

Hi,

in my program I want to remember which node was last selected. So that when
the user displays the form again, that specific node is selected and the
tree is expanded to that node. How can I accomplish this ? I looked for a
findnode procedure but didn't find it. Do I have to iterate trhough all
nodes until I find the specific node or is there a better way ?

Franc.

 | Replies | Author | Date
3215 | Re: Find node | Mike Lischke | Sun 7/22/2001


re: OnGetText: Called so often only moving the focus

From: Ralf Junker [ralfjunker@g...]
Date: Sun Jul 15, 2001 12:33 pm
Subject: RE: [VirtualTreeview] OnGetText: Called so often only moving the focus

Hi Mike, Hi Vadim,

>> But Mike, full invalidate after each focus change?!!
>
>Yes, in the worst case all nodes currently in the client area where selected
before the user changed
>the focus.

True, but only for the worst case. Most of the time we are dealing with the
best case where only the focused node is selected.

I made the following changes to TBaseVirtualTree.WMKeyDown (new code below):

// Clear old selection if required but take care about change events.
if ClearPending and (LastFocused <> FFocusedNode) then
if FSelectionCount <= 1 then
InternalClearSelection
else
ClearSelection;

With this little change OnGetText count drops by a factor of 10 per keyboard
focus change depending on the number of visible nodes. I do not know if the
changes are safe, but the tree seems to work as before.

Btw: ANY change of focus seems to invalidate the entire tree. This is true for
keyboard as well as for mouse navigation. Only keyboard navigation benefits
from the above change. Is something similar possible for mouse navigation?

-- Ralf

 | Replies | Author | Date
3214 | Re: OnGetText: Called so often only moving the fo | Mike Lischke | Sun 7/22/2001


How to Validate User Input in TVirtualStringTree?

From: Ralf Junker [ralfjunker@g...]
Date: Sun Jul 15, 2001 12:56 pm
Subject: How to Validate User Input in TVirtualStringTree?

Hi Group,

When the user enters invalid data, I would like a warning message to pop up and
the edit to stay active so the user can change the data or cancel the changes
pressing escape.

There are no parameters like ACCEPT in both OnNewText and in OnEdited. Reading
the code, there seems to be no way to avoid the edit to close. Do I have to
create my own extended edit link for that purpose?

Thanks for any answers,

-- Ralf

 | Replies | Author | Date
3145 | Re: How to Validate User Input in TVirtualStringT | [zh66w6@h...] | Wed 7/18/2001
3213 | Re: How to Validate User Input in TVirtualStringT | Mike Lischke | Sun 7/22/2001


[no subject]

From: "Ven" [Ven1@n...]
Date: Sun Jul 15, 2001 1:24 pm
Subject:


re: OnGetText: Called so often only moving the focus

From: "Vadim Sedulin" [wsntrl@o...]
Date: Sun Jul 15, 2001 1:53 pm
Subject: Re: [VirtualTreeview] OnGetText: Called so often only moving the focus

Hello Ralf!

> Btw: ANY change of focus seems to invalidate the entire tree.
> This is true for keyboard as well as for mouse navigation.
> Only keyboard navigation benefits from the above change.
> Is something similar possible for mouse navigation?

Try this:

procedure TBaseVirtualTree.ClearSelection;
var
Node: PVirtualNode;
begin
if (FSelectionCount > 0) and not (csDestroying in ComponentState) then
begin
if (FSelectionCount = 1) and (FUpdateCount = 0) then
Node := FSelection[0]
else
Node := nil;

InternalClearSelection;

// Repainting the entire tree is actually faster than determining the
display rectangles of all
// previously selected nodes and invalidating them.
if FUpdateCount = 0 then
begin
if Node <> nil then
InvalidateNode (Node)
else
Invalidate;
Change(nil);
end;
end;
end;

Bye.

Vadim Sedulin
E-Mail: [wsntrl@o...]


re: XMLTree Component

From: [adembaba@e...]
Date: Sun Jul 15, 2001 2:46 pm
Subject: Re: XMLTree Component

> the correct dll is msxml.dll in your system32 folder.
>
> i have used this very old version (1.0) of the ms parser because it
> already is installed on every windows machine.
> the new version 3.0 is much better and i will use it in practice.
> then the dll is called msxml3.dll.

msxml3.dll is in my System32 dir, but how do I create
a .TLB using just a .dll; dont I need an .ocx?

> > My second --sort of-- gripe is that it has to use
> > M$ ActiveX, could you not consider writing your own
> > parser or use other peoples free stuff, such as
> > home.hetnet.nl/~newlife-software/Delphi/index.html#NLDoc
> > which is not bad at all.
>
> no, the ms parser in the latest version is very good and
> i like it. another reason is, that my component not only
> allows to parse xml as text, it can also accept an
> XMLDocument dom object from outside which is needed in
> my projects. using a common and well-known parser makes
> my component much more universal and it can exchange its
> data with a lot of other components without reparsing it
> (or even work on the parsed data of another component).
> it is also planned that the xml tree has options to edit
> the xml - this is also very good with the ms parser.

All are valid points, except that I dont foresee MS
coming up with a Kylix version of msxml3, whereas XDOM
is as good and is free in all senses of the word and
comes in native Delphi code which means it is extremely
likely that it will be ported to Kylix (if it has not
already been done, by now).

I would like to urge you to check out the code at
http://www.philo.de/xml/dom/
before you carve your decision to stone.

Cheers,
Adem

 | Replies | Author | Date
3123 | Re: XMLTree Component | Moritz Franckenstein | Mon 7/16/2001
3124 | Re: XMLTree Component | Franz-Leo Chomse | Mon 7/16/2001
3126 | Re: XMLTree Component | Moritz Franckenstein | Mon 7/16/2001


re: Problems with NodeHeight

From: "Mike Lischke" [lists@l...]
Date: Sun Jul 15, 2001 2:50 pm
Subject: RE: [VirtualTreeview] Problems with NodeHeight

Hello Anders,

> I've uploaded an example project that shows a bug when setting the
> nodeheight for child nodes. It acts as if the nodeheight is set
> directly to node.nodeheight := x, but it is set by tree.nodeheight
> [node] := x
> Please take a look to see if this is a bug or if it's just me.

Actually, this was a bug in the setter for the node height. When I introduced
the visible style for
nodes I thought it would be a good idea to set the total height of this node
and all its parents
(which includes the height of all child and grand child nodes) only if the node
is fully visible.
While this is mainly ok it leaves also out the total height of that particular
node which must of
course be set regardless of its visibility or the expand state or visibility of
its parents. The
total height is used in hit determination and introduces all kinds of strange
effects if it is
wrong.

This is now fixed.

Ciao, Mike


re: Access violations in very special circumstance (OCX)

From: "Mike Lischke" [lists@l...]
Date: Sun Jul 15, 2001 2:50 pm
Subject: RE: [VirtualTreeview] Access violations in very special circumstance (OCX)

Hi Björn,

> I am not sure how a more general VT OCX-wrapper would be created, since
> there are a lot of lower-level handling with pointers and stuff. If you give
me some more
> details on your plans for this, I can try and see if I can help you out a
little. I doubt that
every aspect
> of VT will be "portable" to an OCX, and doing some manual work is probably
unavoidable.

Mmh, good points. I wonder how a VB guy will handle dynamically allocated
memory which must be
accessed via pointers. For VET, however, this is different, since one does not
directly have to
access the nodes. Seems I have to rethink this ...

Ciao, Mike


New file uploaded to VirtualTreeview

From: [VirtualTreeview@yahoogroups.com>
Date: Sun Jul 15, 2001 3:03 pm
Subject: New file uploaded to VirtualTreeview

Hello,

This email message is a notification to let you know that
a file has been uploaded to the Files area of the VirtualTreeview
group.

File : /VirtualTree_2.5.9.zip
Uploaded by : [lists@l...]
Description : Beta version

You can access this file at the URL

http://groups.yahoo.com/group/VirtualTreeview/files/VirtualTree_2.5.9.zip

To learn more about file sharing for your group, please visit

http://help.yahoo.com/help/us/groups/files

Regards,

lists@l...]

 | Replies | Author | Date
3115 | Re: New file uploaded to VirtualTreeview | Mike Lischke | Sun 7/15/2001


re: New file uploaded to VirtualTreeview

From: "Mike Lischke" [lists@l...]
Date: Sun Jul 15, 2001 3:09 pm
Subject: RE: [VirtualTreeview] New file uploaded to VirtualTreeview

Hi all,

> This email message is a notification to let you know that
> a file has been uploaded to the Files area of the VirtualTreeview
> group.

Here is new food for you :o] This time there were the following changes:

- support for standard actions
- options splitted into sub-options, property Options is now a class instead of
a set (called
TreeOptions)
- new options toUseBlendedImages and toAutoScrollOnExpand
- bug fixes

Note: because the change in the option management would cause serious trouble
with existing projects
I have included two little migration methods which transparently convert the
old options property
into the new properties. This process should silently happen without any
interaction by the user (be
at run or design time). If you still find problems then report them as quickly
as possible please.

Ciao, Mike

PS: the beta folder on my homepage is updated too.


re: Re: XMLTree Component

From: "Wim van der Vegt" [wvd_vegt@k...]
Date: Sun Jul 15, 2001 3:53 pm
Subject: Re: [VirtualTreeview] Re: XMLTree Component

Hi,

>All are valid points, except that I dont foresee MS
>coming up with a Kylix version of msxml3, whereas XDOM
>is as good and is free in all senses of the word and
>comes in native Delphi code which means it is extremely
>likely that it will be ported to Kylix (if it has not
>already been done, by now).

Sure other products may easiliy match ms-es products. But main drawback is
they never seem finished (not so much for bug fixing but for functionality)
whereas microsoft freezes version (and functionality) every now and then
(and ok you might have to add a build number too).

Just compare VirtualTreeView to the MS tree/listview which are virtually
frozen in functionality since ages. VT is still not finished nor is it's
functionality frozen. The reason i use VT is that i needed one simple
functionality (the combined tree/listview) that ms didn't supply and i don't
care that much about the rest (not even the pure virtual stuff). I even
wrote an object that gives me back the combined static data of the ms
tree/listview functionality of the ms controls. The only other funtionality
i can use good is the linestyle=bands. This functionality is added long
after
the other functionality i really needed. As i don't use kylix i don't care
about that too.

So my point : if you want kylix support that badly (or need functionality
only available in XDOM)
port the xmltree to xdom yourself (thats what the source in Open Source is
for).
The code is still very small (and i hope it stays that way). I for instance
need it with the
ms parser (just like the author) and would have to port back a XDOM version.

And functionality that for some is important is not (that) importtant to
others.

Please before responding, note i've got nothing against kylix/unix or open
source projects.

---------
Wim van der Vegt


BackgroundColor of Expand/Collapse Buttons

From: [hj_schnorrenberg@y...]
Date: Mon Jul 16, 2001 6:11 am
Subject: BackgroundColor of Expand/Collapse Buttons

I would like to suggest an option by which the background color of
the expand/collapse buttons could be switched to clWindow (like the
background color of then checkboxes). This yields a more attractive
optical appearance, if the background color of the VirtualTreeView is
not equal clWindow. I add a screenshot (BKColorButtons.zip) to the
file directory, which showes an example.

Hans-Jürgen Schnorrenberg

 | Replies | Author | Date
3193 | Re: BackgroundColor of Expand/Collapse Buttons | Mike Lischke | Sat 7/21/2001


re: BCB5, VT2.5.7 and AddChild

From: "Roland" [Beduerftig@S...]
Date: Mon Jul 16, 2001 6:33 am
Subject: Re: BCB5, VT2.5.7 and AddChild

> > function AddChild(Parent: PVirtualNode): PVirtualNode; overload;
> > function AddChild(Parent: PVirtualNode;
> > UserData: Pointer = nil): PVirtualNode;overload;
> >
> > Of course this has to be done in VirtualTrees.pas .
> > Perhaps Mike could give some time to us, BCB5 users?
>
> I won't come around that if nobody comes up with a solution for
> BCB. Is there really no default parameter possible in BCB4+?
> I have problems to believe that...

Hi Mike,

of course BCB knows default parameter, but in this case we compile
Delphi-Code under BCB an the compiler generate automatically from
*.pas a *.hpp file for #include "*.hpp" in C++ Projects.

In this point the automatic will not create the default parameter, I
have also problems to believe that .... but I can not find the
parameter to switch on, that the compiler will generate the *.hpp
file correct.

Bye
Roland

 | Replies | Author | Date
3195 | Re: BCB5, VT2.5.7 and AddChild | Mike Lischke | Sat 7/21/2001
3225 | Re: BCB5, VT2.5.7 and AddChild | Roland | Mon 7/23/2001
3354 | Re: BCB5, VT2.5.7 and AddChild | Mike Lischke | Sun 8/5/2001
3366 | Re: BCB5, VT2.5.7 and AddChild | Roland | Mon 8/6/2001


[no subject]

From: [F.vdwestelaken@c...]
Date: Mon Jul 16, 2001 7:01 am
Subject:

5 Jul 2001 14:24:38 +0200
To: [VirtualTreeview@yahoogroups.com>
Message-ID: [000001c10d29$1d1fad40$0a00a8c0@p...]
X-Priority: 3 (Normal)
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook CWS, Build 9.0.2416 (9.0.2911.0)
In-Reply-To: [NABBLOKFMDBHOGNKKJHEEENLCOAA.public@l...]
Importance: Normal
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2479.0006
From: "Franc v/d Westelaken" <F.vdwestelaken@c...]
MIME-Version: 1.0
Mailing-List: list VirtualTreeview@yahoogroups.com; contact
VirtualTreeview-owner@yahoogroups.com
Delivered-To: mailing list VirtualTreeview@yahoogroups.com
Precedence: bulk
List-Unsubscribe: <mailto:VirtualTreeview-unsubscribe@yahoogroups.com>
Date: Sun, 15 Jul 2001 14:24:36 +0200
Reply-To: VirtualTreeview@yahoogroups.com
Subject: [VirtualTreeview] Find node
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
X-UIDL: 293661818
Status: U

Hi,

in my program I want to remember which node was last selected. So that when
the user displays the form again, that specific node is selected and the
tree is expanded to that node. How can I accomplish this ? I looked for a
findnode procedure but didn't find it. Do I have to iterate trhough all
nodes until I find the specific node or is there a better way ?

Franc.

To unsubscribe from this group, send an email to:
VirtualTreeview-unsubscribe@egroups.com

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/

 | Replies | Author | Date
3120 | Bands and coloring the background | Wim van der Vegt | Mon 7/16/2001
3122 | Re: Bands and coloring the background | Moritz Franckenstein | Mon 7/16/2001
3231 | Re: Bands and coloring the background | Moritz Franckenstein | Mon 7/23/2001
3121 | Feature request | Wim van der Vegt | Mon 7/16/2001
3212 | Re: Feature request | Mike Lischke | Sun 7/22/2001


Bands and coloring the background

From: "Wim van der Vegt" [wvd_vegt@k...]
Date: Mon Jul 16, 2001 9:44 am
Subject: Bands and coloring the background

Hi,

Got a, perhaps, simple question.

I'm trying to paint the background of the topmost two levels of my VT
StringTree in a color different from the deeper levels.

I use OnBeforeItemErase (i think, code not at hand) for that purpose and set
the color and fill the rectangle passed to this event with that color. This
went fine but i recently switched to the bands linestyle which was more
appropiate for my
problem and now see that the whole line's background is filled where i want
it only to be filled starting at the start of the band upto the end.

So any way of determining where a band of a certain level starts?

----------------
Wim van der Vegt

 | Replies | Author | Date
3122 | Re: Bands and coloring the background | Moritz Franckenstein | Mon 7/16/2001
3231 | Re: Bands and coloring the background | Moritz Franckenstein | Mon 7/23/2001


Feature request

From: "Wim van der Vegt" [wvd_vegt@k...]
Date: Mon Jul 16, 2001 9:44 am
Subject: Feature request

Hi,

I would like to see two more enhancements to VT (anyone else agrees?) I have
already implemented it in my private code/apps but perhaps they're nice
standard features for VT too.

1. A footer like the current header (i use it for displaying averages/std
deviations of values in the grid).

2. A multilevel header (i currrently have a MS HeaderControl on top of the
VT so i can group the columns hierachically. I also implemented that
resizing a column will resize the groupheader properly. Basically i see the
header as a tree too instead of a list. I know this will conflict with
drag/drop of headers.

Another suggestion is to turn the header options into a separate class too
as most option releated code is already broken with the current beta. That
way it's more expandable in the future.

--------------
Wim van der Vegt

 | Replies | Author | Date
3212 | Re: Feature request | Mike Lischke | Sun 7/22/2001


re: Bands and coloring the background

From: "Moritz Franckenstein" [franckenstein@a...]
Date: Mon Jul 16, 2001 9:55 am
Subject: Re: Bands and coloring the background

--- In [VirtualTreeview@y...], "Wim van der Vegt" [wvd_vegt@k...] wrote:

> So any way of determining where a band of a certain level starts?

hi,

i have just asked the same question in the german group. and i have
also a working solution. please take a look into the current version
of my xmltree component:

http://groups.yahoo.com/group/VirtualTreeview_de/files/XMLTreeTest.zip

note: this solution is not only quick, it is also very dirty :) and
has to be corrected soon.

-moritz

 | Replies | Author | Date
3231 | Re: Bands and coloring the background | Moritz Franckenstein | Mon 7/23/2001


re: XMLTree Component

From: "Moritz Franckenstein" [franckenstein@a...]
Date: Mon Jul 16, 2001 10:07 am
Subject: Re: XMLTree Component

--- In [VirtualTreeview@y...], [adembaba@e...] wrote:
> msxml3.dll is in my System32 dir, but how do I create
> a .TLB using just a .dll; dont I need an .ocx?

no, it also works with a dll if it contains an activex.

> All are valid points, except that I dont foresee MS
> coming up with a Kylix version of msxml3, whereas XDOM
> is as good and is free in all senses of the word and
> comes in native Delphi code which means it is extremely
> likely that it will be ported to Kylix (if it has not
> already been done, by now).

> I would like to urge you to check out the code at
> http://www.philo.de/xml/dom/
> before you carve your decision to stone.

no way - my company is very microsoft-friendly *g* and i will have to
use it.

if some more people need another parser, we could make two versions.
and if the other parser works similar, this could be done by some
conditional compiler defines (?). hmmm... not so nice.

feel free to port the component yourself of find out the necessary
changes and explain them to me.

-moritz

 | Replies | Author | Date
3124 | Re: XMLTree Component | Franz-Leo Chomse | Mon 7/16/2001
3126 | Re: XMLTree Component | Moritz Franckenstein | Mon 7/16/2001


re: Re: XMLTree Component

From: Franz-Leo Chomse [chomse@c...]
Date: Mon Jul 16, 2001 11:30 am
Subject: Re: [VirtualTreeview] Re: XMLTree Component

>no way - my company is very microsoft-friendly *g* and i will have to
>use it.
>
>if some more people need another parser, we could make two versions.
>and if the other parser works similar, this could be done by some
>conditional compiler defines (?). hmmm... not so nice.

In this case I would suggest, that you download the Apache Xerxes Project,
and ask a Visual C++ Guy in your company to produce both the DLL and the
COM wrapper (provideded by IBM). The com wrapper is very MXXML compatible,
I assume that it has been modeled after the MXXML type library.

Regards from Germany

Franz-Leo

 | Replies | Author | Date
3126 | Re: XMLTree Component | Moritz Franckenstein | Mon 7/16/2001


Header.Color

From: "Moritz Franckenstein" [franckenstein@a...]
Date: Mon Jul 16, 2001 3:27 pm
Subject: Header.Color

hi mike,

it took me some hours and caused bad headache to find out why my old
project didnt show my backcolor when compiled with the new version of
vt.

the onBeforeItemErase was called correcly, the color was correctly
returned but the cells stayed white.

now i found out that the new columns flag parentcolor was the
problem. it was set to false.

when a property doesnt exist in the old project, is it always set to
false or can it be set to a default value? if yes, that would be
helpful.

-moritz

 | Replies | Author | Date
3127 | Re: Header.Color | Moritz Franckenstein | Mon 7/16/2001
3130 | Re: Header.Color | [adembaba@e...] | Mon 7/16/2001
3131 | Re: Header.Color | Mike Lischke | Mon 7/16/2001
3132 | Re: Header.Color | Werner Lehmann | Mon 7/16/2001


re: XMLTree Component

From: "Moritz Franckenstein" [franckenstein@a...]
Date: Mon Jul 16, 2001 3:28 pm
Subject: Re: XMLTree Component

--- In [VirtualTreeview@y...], Franz-Leo Chomse [chomse@c...] wrote:

> In this case I would suggest, that you download the Apache Xerxes
Project,
> and ask a Visual C++ Guy in your company to produce both the DLL
and the
> COM wrapper (provideded by IBM). The com wrapper is very MXXML
compatible,
> I assume that it has been modeled after the MXXML type library.

i have to time for that, sorry...


re: Header.Color

From: "Moritz Franckenstein" [franckenstein@a...]
Date: Mon Jul 16, 2001 3:33 pm
Subject: Re: Header.Color

> when a property doesnt exist in the old project, is it always set
to
> false or can it be set to a default value? if yes, that would be
> helpful.

btw: are there other new properties that i should correct?


Ver 2.5.9 bug

From: [ainpoissee@y...]
Date: Mon Jul 16, 2001 3:38 pm
Subject: Ver 2.5.9 bug

Hello

I just downloaded latest beta and it seems to have following problems:

*) Tree setup: two columns; AutoSizeIndex:= 1; Problem: the second
column don't (auto)resize itself until I manually resize column's
width.

*)Using Sender.MoveTo(SourceNode, TargetNode, amAddChildLast, FALSE);
(in OnDragDrop handler) the SourceNode is deleted form it's old
parent's "tree" but it don't appear in new parent's tree. If the new
parent didn't had any child, the [+] mark doesn't appear aswell.

ain


re: XMLTree Component

From: [adembaba@e...]
Date: Mon Jul 16, 2001 7:00 pm
Subject: Re: XMLTree Component

> --- In [VirtualTreeview@y...], [adembaba@e...] wrote:
> the correct dll is msxml.dll in your system32 folder.
>
> the new version 3.0 is much better and i will use it in
> practice. then the dll is called msxml3.dll.

I have managed to use msxml3.dll. It looks fine.
Now, I will play around with it a little more to find
out why I get 'Parse Error: Only Default Namespaces
can have empty URI. (Line 1, Pos 69)' message when
all I do is to press the Parse button.

And, for the lack of time, I would like to sort of
comment on other replies.

First, I think there is a misconception about the
stuff found in groups.yahoo/sourgeforge etc., if
the expectation is to land on a near-shrink-wrapped
product.

By the very nature of it, everything is construction
in progress; and VT is no exception. Feture freeze etc.
do not necessarily equate to a good thing, nor is it
in anyway needed. Anyone can freeze the features by
not upgrading to the latest beta --it does not get
sneaked in like I find with a lot of MS OS DLLs.

Secondly, I am not an open/free source freak; I like
its benefits: If I dont like anything about it, I
can look at the source and alter it myself, that
is all. With closed source I am stuck.

To everyone else, I am sorry for having verged on the
off-topic.

Cheers,
Adem

 | Replies | Author | Date
3136 | Re: XMLTree Component | Moritz Franckenstein | Tue 7/17/2001


re: Header.Color

From: [adembaba@e...]
Date: Mon Jul 16, 2001 7:04 pm
Subject: Re: Header.Color

Moritz,

As a general and off-cuff answer, any property that did not
exist in a different version gets to be assigned to its
default value: In other words, it is aasigned whatever
it would be assigned if you placed a new component on
the form. Hence, you should not assume 'False' for all
boolean values, or 'excluded' for new set members etc.

Cheers,
Adem

--- In [VirtualTreeview@y...], "Moritz Franckenstein"
[franckenstein@a...] wrote:
>
> hi mike,
>
> it took me some hours and caused bad headache to find out why my
old
> project didnt show my backcolor when compiled with the new version
of
> vt.
>
> the onBeforeItemErase was called correcly, the color was correctly
> returned but the cells stayed white.
>
> now i found out that the new columns flag parentcolor was the
> problem. it was set to false.
>
> when a property doesnt exist in the old project, is it always set
to
> false or can it be set to a default value? if yes, that would be
> helpful.
>
> -moritz

 | Replies | Author | Date
3131 | Re: Header.Color | Mike Lischke | Mon 7/16/2001


re: Re: Header.Color

From: "Mike Lischke" [lists@l...]
Date: Mon Jul 16, 2001 7:17 pm
Subject: RE: [VirtualTreeview] Re: Header.Color

> As a general and off-cuff answer, any property that did not
> exist in a different version gets to be assigned to its
> default value: In other words, it is aasigned whatever
> it would be assigned if you placed a new component on
> the form. Hence, you should not assume 'False' for all
> boolean values, or 'excluded' for new set members etc.

Depends. If the changed property was already saved to a DFM then it gets of
course loaded (if
compatible) and keeps therefore its old value. If there are new members, e.g.
in an enumeration, and
the property was saved then those new members do not appear of course because
there weren't known at
the time the property was saved. This is also true if the new member is now
part of the default
value (e.g. the parent color flag for columns) because this default value gets
overwritten by the
loaded value.

This is nothing I can change and one of the weak points of the property/DFM
concept.

Ciao, Mike


re: Re: Header.Color

From: Werner Lehmann [wl@b...]
Date: Mon Jul 16, 2001 9:03 pm
Subject: Re: [VirtualTreeview] Re: Header.Color

Hi Mike,

> Depends. If the changed property was already saved to a DFM then it gets of
course loaded (if
> compatible) and keeps therefore its old value. If there are new members, e.g.
in an enumeration, and
> the property was saved then those new members do not appear of course because
there weren't known at
> the time the property was saved. This is also true if the new member is now
part of the default
> value (e.g. the parent color flag for columns) because this default value
gets overwritten by the
> loaded value.
>
> This is nothing I can change and one of the weak points of the property/DFM
concept.

What if you extend an enumeration and add a new member somewhere in the middle
(say, to keep it
sorted alphabetically). If a set property based on this enumeration is streamed
in from the DFM
will this be handled correctly? The new member being not in the set? I guess
not... I have seen
sometimes oddities to the options property when upgrading VT which may be
explained with this
(or with some bad memory of mine, forgetting which options I have set and which
not :).

Regards,
Werner


re: Feature request

From: GORTSILAS ANDREAS [agorts@s...]
Date: Tue Jul 17, 2001 5:49 am
Subject: RE: [VirtualTreeview] Feature request

I agree with you...

Andreas Gortsilas

-----Original Message-----
From: Wim van der Vegt [mailto:[wvd_vegt@k...]]
Sent: Monday, July 16, 2001 12:44 PM
To: VirtualTreeview@yahoogroups.com
Subject: [VirtualTreeview] Feature request

Hi,

I would like to see two more enhancements to VT (anyone else agrees?) I have
already implemented it in my private code/apps but perhaps they're nice
standard features for VT too.

1. A footer like the current header (i use it for displaying averages/std
deviations of values in the grid).

2. A multilevel header (i currrently have a MS HeaderControl on top of the
VT so i can group the columns hierachically. I also implemented that
resizing a column will resize the groupheader properly. Basically i see the
header as a tree too instead of a list. I know this will conflict with
drag/drop of headers.

Another suggestion is to turn the header options into a separate class too
as most option releated code is already broken with the current beta. That
way it's more expandable in the future.

--------------
Wim van der Vegt

To unsubscribe from this group, send an email to:
VirtualTreeview-unsubscribe@egroups.com

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/


FocusedChanged causing problems

From: [MJLeaver@n...]
Date: Tue Jul 17, 2001 10:20 am
Subject: FocusedChanged causing problems

In my OnFocusedChanged event I need to do some processing that may
take a second or two.

The problem is that OnFocusedChanged is fired before the mouse button
is released, so after the event VT still thinks the left mouse button
is down. So if I click a node then quickly click another node, it
thinks its a drag operation, even though it isn't.

I've moved the code to OnMouseUp, but of course this means if the
focused node is changed by other means (e.g. keyboard) then this
causes problems.

Any ideas? Is there a way to make OnFocusedChanged be fired after
releasing the mouse button?

 | Replies | Author | Date
3135 | Re: FocusedChanged causing problems | [adembaba@e...] | Tue 7/17/2001


re: FocusedChanged causing problems

From: [adembaba@e...]
Date: Tue Jul 17, 2001 11:24 am
Subject: Re: FocusedChanged causing problems

The way I solved it was with
VT1.Enabled := False VT
while processing is going on and then
VT1.Enabled := False
followed by a
VT1.SetFocus
at the end of it.

Make sure you also use OnFocusChaging and set
Allowed := OldNode <> NewNode;

HTH,
Adem

--- In [VirtualTreeview@y...], [MJLeaver@n...] wrote:
> In my OnFocusedChanged event I need to do some processing that may
> take a second or two.
>
> The problem is that OnFocusedChanged is fired before the mouse
button
> is released, so after the event VT still thinks the left mouse
button
> is down. So if I click a node then quickly click another node, it
> thinks its a drag operation, even though it isn't.
>
> I've moved the code to OnMouseUp, but of course this means if the
> focused node is changed by other means (e.g. keyboard) then this
> causes problems.
>
> Any ideas? Is there a way to make OnFocusedChanged be fired after
> releasing the mouse button?


re: XMLTree Component

From: "Moritz Franckenstein" [franckenstein@a...]
Date: Tue Jul 17, 2001 11:51 am
Subject: Re: XMLTree Component

--- In [VirtualTreeview@y...], [adembaba@e...] wrote:
> I have managed to use msxml3.dll. It looks fine.
> Now, I will play around with it a little more to find
> out why I get 'Parse Error: Only Default Namespaces
> can have empty URI. (Line 1, Pos 69)' message when
> all I do is to press the Parse button.

this is a problem with the 3.0 parser that i have found and fixed
yesterday :)

try the current version:

http://groups.yahoo.com/group/VirtualTreeview_de/files/XMLTreeTest.zip


re: DoGetImageIndex is not so nice

From: "Moritz Franckenstein" [franckenstein@a...]
Date: Tue Jul 17, 2001 2:13 pm
Subject: Re: DoGetImageIndex is not so nice

> having Do... wrappers around event calls is a standard way for
> delphi. with your function the same standard things are not
possible.
> so the name of your function is misleading and a real Do... wrapper
> for this event is missing.

i am still stuck with this problem with many events. for example:

function TBaseVirtualTree.CanEdit(Node: PVirtualNode; Column:
Integer): Boolean;
begin
Result := (toEditable in FOptions.FMiscOptions) and Enabled;
// application can override the default edit permission
if Assigned(FOnEditing) then
FOnEditing(Self, Node, Column, Result);
end;

yes, the application can override the value, but not a derived
component. do i really have to set your OnEditing property in my
constructor so that it points to my internal event handler which then
calls a new event handler of mine?

mike, if you dont have a better solution for that problem, i think
the above "if assigned" line should be changed to a new DoEditing
procedure call.

and the same with some other functions: for example, DoGetImageIndex
and DoGetText.

moritz

 | Replies | Author | Date
3194 | Re: DoGetImageIndex is not so nice | Mike Lischke | Sat 7/21/2001


Problem with checkboxes?

From: "Brian Huggins" [bghugg@a...]
Date: Tue Jul 17, 2001 6:05 pm
Subject: Problem with checkboxes?

Hi,

Is there a reason the following code wouldn't work? (i'm using
checkboxes) I'm just trying to uncheck all nodes except the one that
the user has clicked, but it doesn't uncheck them. What's really
odd is is that it seems to work if I step through the code, but it
doesn't work when I just let it run.

thanks,
Brian Huggins

procedure TComponentsForm.VST1Checked(Sender: TBaseVirtualTree;
Node: PVirtualNode);
var
CompNode : PVirtualNode;
begin
CompNode := Node.Parent.FirstChild;

while CompNode <> nil do
begin
if Node <> CompNode then
begin
CompNode.CheckState := csUnChecked;
end;
CompNode := CompNode.NextSibling;
end;
end;

 | Replies | Author | Date
3140 | Re: Problem with checkboxes? | Werner Lehmann | Tue 7/17/2001
3141 | Re: Problem with checkboxes? | Brian Huggins | Tue 7/17/2001


re: Re: DoGetImageIndex is not so nice

From: Werner Lehmann [wl@b...]
Date: Tue Jul 17, 2001 6:50 pm
Subject: Re: [VirtualTreeview] Re: DoGetImageIndex is not so nice

Moritz Franckenstein wrote:
>
> > having Do... wrappers around event calls is a standard way for
> > delphi. with your function the same standard things are not
> possible.
> > so the name of your function is misleading and a real Do... wrapper
> > for this event is missing.
>
> i am still stuck with this problem with many events. for example:
>
> function TBaseVirtualTree.CanEdit(Node: PVirtualNode; Column:
> Integer): Boolean;
> begin
> Result := (toEditable in FOptions.FMiscOptions) and Enabled;
> // application can override the default edit permission
> if Assigned(FOnEditing) then
> FOnEditing(Self, Node, Column, Result);
> end;
>
> yes, the application can override the value, but not a derived
> component. do i really have to set your OnEditing property in my
> constructor so that it points to my internal event handler which then
> calls a new event handler of mine?

Moritz,

before you do that you can more easily do this:

function TMyTreeDescendant.CanEdit(Node: PVirtualNode; Column: Integer):
Boolean;
begin
Result := (toEditable in FOptions.FMiscOptions) and Enabled;

// do stuff

if Assigned(OnEditing) then
OnEditing(Self, Node, Column, Result);

// do stuff
end;

Far from optimal but at least no 'overridden event property' with new private
event field. Of course: if someone wants to inherit a tree from your descendant
he would have to copy your code as well. But chances are that this is not
necessary. Only point was anyhow not to override the event property.

Werner

 | Replies | Author | Date
3146 | Re: DoGetImageIndex is not so nice | Moritz Franckenstein | Wed 7/18/2001


re: Problem with checkboxes?

From: Werner Lehmann [wl@b...]
Date: Tue Jul 17, 2001 6:57 pm
Subject: Re: [VirtualTreeview] Problem with checkboxes?

Hi Brian,

> Is there a reason the following code wouldn't work? (i'm using
> checkboxes) I'm just trying to uncheck all nodes except the one that
> the user has clicked, but it doesn't uncheck them. What's really
> odd is is that it seems to work if I step through the code, but it
> doesn't work when I just let it run.

let me guess: while you are debugging (stepping through the code) the
IDE editor window overlaps the tree in your application. If so you
force a repaint of the tree when the app runs again, this time with
unchecked boxes.

> procedure TComponentsForm.VST1Checked(Sender: TBaseVirtualTree;
> Node: PVirtualNode);
> var
> CompNode : PVirtualNode;
> begin
> CompNode := Node.Parent.FirstChild;
>
> while CompNode <> nil do
> begin
> if Node <> CompNode then
> begin
> CompNode.CheckState := csUnChecked;

Sender.CheckState[CompNode] := csUnchecked;

> end;
> CompNode := CompNode.NextSibling;
> end;
> end;

See correction inline. This invalidates the node. The VTree can not know
that you change a member of the node record. You have to explicitly tell
that to it. Another, probably more performant fix would be to call

Sender.Invalidate;

after your loop has run. BTW, did you notice that the radio button style
built-in would achieve the same effect? With added value that the user
can see already that only one node may be checked... (usual behaviour of
radio buttons).

Werner

 | Replies | Author | Date
3141 | Re: Problem with checkboxes? | Brian Huggins | Tue 7/17/2001


re: Problem with checkboxes?

From: "Brian Huggins" [bghugg@a...]
Date: Tue Jul 17, 2001 7:28 pm
Subject: Re: Problem with checkboxes?

Werner,

Thanks, that was the problem. I do know about the radio buttons, but
I simplified the code for the example. I actually want the checks to
be cleared only in certain circumstances, usually I want to allow
multiple checks.

thanks again,
brian huggins

--- In [VirtualTreeview@y...], Werner Lehmann [wl@b...] wrote:
> Hi Brian,
>
> > Is there a reason the following code wouldn't work? (i'm using
> > checkboxes) I'm just trying to uncheck all nodes except the one
that
> > the user has clicked, but it doesn't uncheck them. What's really
> > odd is is that it seems to work if I step through the code, but it
> > doesn't work when I just let it run.
>
> let me guess: while you are debugging (stepping through the code)
the
> IDE editor window overlaps the tree in your application. If so you
> force a repaint of the tree when the app runs again, this time with
> unchecked boxes.
>
> > procedure TComponentsForm.VST1Checked(Sender: TBaseVirtualTree;
> > Node: PVirtualNode);
> > var
> > CompNode : PVirtualNode;
> > begin
> > CompNode := Node.Parent.FirstChild;
> >
> > while CompNode <> nil do
> > begin
> > if Node <> CompNode then
> > begin
> > CompNode.CheckState := csUnChecked;
>
> Sender.CheckState[CompNode] := csUnchecked;
>
> > end;
> > CompNode := CompNode.NextSibling;
> > end;
> > end;
>
> See correction inline. This invalidates the node. The VTree can not
know
> that you change a member of the node record. You have to explicitly
tell
> that to it. Another, probably more performant fix would be to call
>
> Sender.Invalidate;
>
> after your loop has run. BTW, did you notice that the radio button
style
> built-in would achieve the same effect? With added value that the
user
> can see already that only one node may be checked... (usual
behaviour of
> radio buttons).
>
> Werner


Focused node and parent node collapsing

From: Werner Lehmann [wl@b...]
Date: Wed Jul 18, 2001 12:01 am
Subject: Focused node and parent node collapsing

Hi Mike,

I am now at the decision again what to do if a parent of the focused node is
collapsed.
Currently the focused node is not changed and is not (fully) visible anymore.
As I said
before the windows explorer focuses the next most fully visible parent. I
believe that
this makes sense and cannot imagine that someone would object if the tree did
this on its
own. At most the collapsing would not be allowed by someone who does not want
to have the
focus changed.

Before I implement that myself and outside of the component I'd like to ask you
'officially' :)
to include some code like the one below from Jim. AFAIK you have not said
anything about
this topic yet.

Regards,
Werner

PS: Instead of GetFirstSelected it might be better to directly use FocusedNode.
There is
no rule that a node which contains the *first* selected node is collapsed. This
works only
in VET where sibling select constraint is forced.

PPS: And please note the reported bug that HasAsParent claims that a node is
always a parent
of itself (easy to fix but...).

At 11:27 PM 7/7/2001 +0200, you wrote:
>Hi,
>
>if the parent of the focused node is collapsed, shouldn't the focus
>be set to this parent node? At least explorer does it like this...

Hi Werner,

In VET I do it like this on the DoCollapsing (OnCollapsing) event. Make
a special note of the check for voAutoExpand. It leads to infinite
recursion within VT.

Jim

procedure CollapseFolder(Node: PVirtualNode);
var
SelNode: PVirtualNode;
begin
if Assigned(Node) and not (voAutoExpand in Options) then
begin
BeginUpdate;
try
SelNode := GetFirstSelected;
if HasAsParent(SelNode, Node) then
begin
ClearSelection;
Selected[Node] := True;
FocusedNode := Node
end;
finally
EndUpdate
end
end
end;

 | Replies | Author | Date
3192 | Re: Focused node and parent node collapsing | Mike Lischke | Sat 7/21/2001
3200 | Re: Focused node and parent node collapsing | Werner Lehmann | Sat 7/21/2001
3236 | Re: Focused node and parent node collapsing | [adembaba@e...] | Mon 7/23/2001


Disabled nodes

From: Werner Lehmann [wl@b...]
Date: Wed Jul 18, 2001 12:13 am
Subject: Disabled nodes

Hi Mike,

how are disabled nodes supposed to work with respect to focus? If I set some
node to
disabled state via IsDisabled[Node] := true; the node is drawn disabled (that's
ok :)
but the focus can somehow move on this disabled node. The node is not drawn
neither focused
nor selected but the focus is removed from the previously focused node. And if
I press
the up/down key a second time the focus is drawn on the next node which is not
dis-
abled.

Shouldn't the focus 'jump' over disabled nodes?

And one other not related 'issue' I always forgot to mention. In grid mode with
full
row select, can Home/End work like ctrl Home and ctrl End, thus moving focus to
the
first/last node? Currently they do not seem to do anything under these
circumstances.

And while I am at it: horizontally scrolling goes column-wise. What do you say
about
using ScrollbarOptions.HorizontalIncrement instead? Hm, better forget that one.
To get
it really 'right' the tree should scroll instantly if VK_RIGHT is pressed. But
this
would mean that the FocusedColumn is meaningless with FullRowSelect. And that
would
open another can of worms probably.

Regards,
Werner

 | Replies | Author | Date
3186 | Re: Disabled nodes | Mike Lischke | Sat 7/21/2001
3199 | Re: Disabled nodes | Werner Lehmann | Sat 7/21/2001


Focusing question

From: [expertiza@i...]
Date: Wed Jul 18, 2001 3:26 am
Subject: [VirtualTreeview] Focusing question

Hi Mike,

My form contains PageControl with two pages. On one page is VST
(toExtendedFocus, toEditable). If the editor (standart) is active to
switch to the second page with click of the mouse it is possible only
in 2 steps.
1. The first click a bookmark of the second page is switched off by
the editor (switching does not occur)
2. The second click a bookmark of the second page gives switching.

How it is possible to provide switching by ONE cliclink of the mouse?

Surkov Andrey ([expertiza@i...])


re: How to Validate User Input in TVirtualStringTree?

From: [zh66w6@h...]
Date: Wed Jul 18, 2001 7:55 am
Subject: Re: How to Validate User Input in TVirtualStringTree?

This would also be very useful for me. Any chance of including it, it
shouldn't be too difficult should it?

Cheers,
Paul

--- In [VirtualTreeview@y...], Ralf Junker [ralfjunker@g...] wrote:
> Hi Group,
>
> When the user enters invalid data, I would like a warning message
to pop up and the edit to stay active so the user can change the data
or cancel the changes pressing escape.
>
> There are no parameters like ACCEPT in both OnNewText and in
OnEdited. Reading the code, there seems to be no way to avoid the
edit to close. Do I have to create my own extended edit link for that
purpose?
>
> Thanks for any answers,
>
> -- Ralf


re: DoGetImageIndex is not so nice

From: "Moritz Franckenstein" [franckenstein@a...]
Date: Wed Jul 18, 2001 8:48 am
Subject: Re: DoGetImageIndex is not so nice

> function TMyTreeDescendant.CanEdit(Node: PVirtualNode; Column:
Integer): Boolean;
> begin
> Result := (toEditable in FOptions.FMiscOptions) and Enabled;
>
> // do stuff
>
> if Assigned(OnEditing) then
> OnEditing(Self, Node, Column, Result);
>
> // do stuff
> end;
>
> Far from optimal but at least no 'overridden event property' with
new private
> event field. Of course: if someone wants to inherit a tree from
your descendant
> he would have to copy your code as well. But chances are that this
is not
> necessary. Only point was anyhow not to override the event property.

yes, thats much better... thanks for this hint, its a good work-
around until it is fixed.

when i copy mikes code i would have to watch it every time a new
version is released...

-moritz


ChangeDelay

From: Werner Lehmann [wl@b...]
Date: Wed Jul 18, 2001 11:07 am
Subject: ChangeDelay

Hi,

I am using ChangeDelay to delay change events (surprising eh? :). Sometimes I
was not
getting an OnChange event when there should have been one, not even after the
ChangeDelay
time has elapsed. A dependent other component would not update then *sometimes*.

This puzzled me at first but I think the reason is this:

procedure TBaseVirtualTree.Change(Node: PVirtualNode);

begin
if FChangeDelay > 0 then
begin
if tsChangePending in FStates then
StopTimer(ChangeTimer);
FLastChangedNode := Node;
Include(FStates, tsChangePending);
SetTimer(Handle, ChangeTimer, FChangeDelay, nil);
end
else
DoChange(Node);
end;

procedure TBaseVirtualTree.StructureChange(Node: PVirtualNode; Reason:
TChangeReason);

begin
if FChangeDelay > 0 then
begin
StopTimer(StructureChangeTimer);
FLastChangedNode := Node;
FLastChangeReason := Reason;
SetTimer(Handle, StructureChangeTimer, FChangeDelay, nil);
end
else
DoStructureChange(Node, Reason);
end;

You are using the same field (FLastChangeNode) for change and structure change
events.
So, if the selection (focus w/o multiselect) changes, the delay timer starts
and a new
node is being inserted before the ChangeTimer has finished, the change event
fires with
the wrong node (because StructureChange has overwritten the previous value of
FLastChangedNode).

I suggest to use another field variable for structure changes.

BTW, my problem is gone when the ChangeDelay is set to 0 (obviously). And btw,
what I
really wanted was a FocusChangeDelay. But since there is none and the tree has
no multi-
selection OnChange did it as well.

Regards,
Werner

 | Replies | Author | Date
3185 | Re: ChangeDelay | Mike Lischke | Sat 7/21/2001


Header Columns order doesn't change internally.

From: [yourfantasy50@h...]
Date: Wed Jul 18, 2001 12:07 pm
Subject: Header Columns order doesn't change internally.

Hi everybody,

I have succesfully implemented VT as a grid. First of all I want to
thank you guys for your GREAT SUPPORT. This mailinglist is really
awesome.
I have one little problem left. When i drag a column to another
position, so that the column order (on screen) changes, the columns
order internally (VT.Header.Columns) don 't change at all. The VT
display is updated automatically, the data in a column is correctly
displayed in the moved column. Is there a property /
function /procedure or event that 's called when the column order has
changed by dragging the column to a new position?
Another small problem i have, occurs when i have more columns than
the screen can display. I tried to drag a column to the end of the
screen, but the screen doesn 't scroll automatically, so you can 't
drag a column to the end of all columns and drop it there so it
becomes the last column.
Does anybody know how to do this?
Thanx, again and again and....

Kind Regards,
Mark Dekker.

 | Replies | Author | Date
3150 | Re: Header Columns order doesn't change internall | Werner Lehmann | Wed 7/18/2001
3151 | Re: Header Columns order doesn't change internall | Werner Lehmann | Wed 7/18/2001
3165 | Re: Header Columns order doesn't change internall | [zh66w6@h...] | Fri 7/20/2001


different HintMode for different columns?

From: "Moritz Franckenstein" [franckenstein@a...]
Date: Wed Jul 18, 2001 3:09 pm
Subject: different HintMode for different columns?

hi mike,

i am still looking for a way to have a hint on one column and a
tooltip on others.

this could be solved by a HintMode property for every column (or a
new flag in the options).

an automatic hint would also be useful: automatically display a hint
if a tooltip is not necessary. maybe as new HintMode?

determining the HintMode dynamically by an event would maybe be a
little bit overkill...

-moritz

 | Replies | Author | Date
3189 | Re: different HintMode for different columns? | Mike Lischke | Sat 7/21/2001


re: Header Columns order doesn't change internally.

From: Werner Lehmann [wl@b...]
Date: Wed Jul 18, 2001 4:37 pm
Subject: Re: [VirtualTreeview] Header Columns order doesn't change internally.

Hi Mark,

> I have succesfully implemented VT as a grid. First of all I want to
> thank you guys for your GREAT SUPPORT. This mailinglist is really
> awesome.

Indeed.

> I have one little problem left. When i drag a column to another
> position, so that the column order (on screen) changes, the columns
> order internally (VT.Header.Columns) don 't change at all. The VT
> display is updated automatically, the data in a column is correctly
> displayed in the moved column. Is there a property /
> function /procedure or event that 's called when the column order has
> changed by dragging the column to a new position?

Without delphi and VTree source at hand I cannot say if there is such
an event but why do you need it? I can imagine that you want to save and
restore the column order on app shutdown/restart. You can do this with
some header methods. Again, without source I cannot say anything specific.
IIRC I have written two functions which translate the column order and
width into a string and vice versa, to easily save the columns state in
registry, inifile etc.

> Another small problem i have, occurs when i have more columns than
> the screen can display. I tried to drag a column to the end of the
> screen, but the screen doesn 't scroll automatically, so you can 't
> drag a column to the end of all columns and drop it there so it
> becomes the last column.
> Does anybody know how to do this?

Currently you need more than one step to get the column all the way
to the right side (drag, scroll, drag, scroll...). Autoscrolling is
on the todo list, see database section on YG.

Werner


re: Header Columns order doesn't change internally.

From: Werner Lehmann [wl@b...]
Date: Wed Jul 18, 2001 4:41 pm
Subject: Re: [VirtualTreeview] Header Columns order doesn't change internally.

> I have one little problem left. When i drag a column to another
> position, so that the column order (on screen) changes, the columns
> order internally (VT.Header.Columns) don 't change at all. The VT

I'd like to add that this is a feature. You don't have to know where
a column is on screen. You always have one unique and unchanged column no.
to refer to it.

If you have to use other multi-column components like TdxTreelist you'll
appreciate this soon. Because with said component you have to keep track
of the column order and which column index is which column data yourself.

Werner


HELP! Data handling changed in the new version

From: [dragan.juric@q...]
Date: Wed Jul 18, 2001 5:45 pm
Subject: HELP! Data handling changed in the new version

I'm developing a tree that is derived from VirtualTree, and I was
overriding TotalInternalDataSize like this:

function TPNEVVirtualTree.TotalInternalDataSize: Cardinal;
begin
Result := inherited TotalInternalDataSize + InternalDataSize;
end;

now there is no TotalInternalDataSize any more, what is the
recommended way to do this?

Thanks,
Dragan


re: HELP! Data handling changed in the new version

From: Werner Lehmann [wl@b...]
Date: Wed Jul 18, 2001 6:00 pm
Subject: Re: [VirtualTreeview] HELP! Data handling changed in the new version

[dragan.juric@q...] wrote:
>
> I'm developing a tree that is derived from VirtualTree, and I was
> overriding TotalInternalDataSize like this:
>
> function TPNEVVirtualTree.TotalInternalDataSize: Cardinal;
> begin
> Result := inherited TotalInternalDataSize + InternalDataSize;
> end;
>
> now there is no TotalInternalDataSize any more, what is the
> recommended way to do this?

Please see how TVirtualStringTree reserves its internal data, look
in the constructor.

Regards,
Werner

 | Replies | Author | Date
3154 | DAD-questions from a beginner | [ls@t...] | Thu 7/19/2001


DAD-questions from a beginner

From: [ls@t...]
Date: Thu Jul 19, 2001 6:23 am
Subject: DAD-questions from a beginner

Hi together,

I'm a beginner in Drag 'n Drop programming and have one simple(?)
question:
I have a VST with only two levels: parent and child nodes.
I've implemented DAD as dtOLE.
Now I want the user dragging only child nodes to other parent nodes
and NOT(!!!) as new parent nodes between the other parent nodes. How
can I do this?

Here are some simplified code fragments:
The parent nodes have a valid ROOTID and an UNKNOWN_PICID in data structure and
the
chilld nodes have valid PICID and an UNKNOWN_ROOTID (this is because
storing the tree in a database).

procedure TfrmMain.VSTImgDragOver(Sender: TBaseVirtualTree; Source: TObject;
Shift: TShiftState; State: TDragState; Pt: TPoint; Mode: TDropMode; var Effect:
Integer; var Accept: Boolean);
var
Trash: Integer;
begin
Accept := (PVSTData(Sender.GetNodeData(Sender.FocusedNode)).RootID =
UNKNOWN_ROOTID) and
(PVSTData(Sender.GetNodeData(Sender.GetNodeAt(Pt.x, Pt.y, True,
Trash))).PicID = UNKNOWN_PICID);
end;

procedure TfrmMain.VSTImgDragDrop(Sender: TBaseVirtualTree; Source: TObject;
DataObject: IDataObject; Formats: TFormatArray; Shift: TShiftState; Pt: TPoint;
var Effect: Integer; Mode: TDropMode);
var
i, Trash: Integer;
AttachMode : TVTNodeAttachMode;
begin
if Length(Formats) > 0 then begin
for i := 0 to High(Formats) do
if Formats[i] = CF_VIRTUALTREE then begin
if not(Assigned(Sender.GetNodeAt(Pt.x, Pt.y, True, Trash))) then
AttachMode := amNowhere
else
case Mode of
dmAbove : AttachMode := amInsertBefore;
dmOnNode : AttachMode := amAddChildLast;
dmBelow : AttachMode := amInsertAfter;
else if Assigned(Source) and (Source is TBaseVirtualTree) and (Sender <>
Source) then
AttachMode := amInsertBefore
else
AttachMode := amNowhere;
end;//case
Sender.ProcessDrop(DataObject, Sender.DropTargetNode, Effect, AttachMode);
Break;
end;//if
end;//if
end;

Can anybody give me a hint?

Thanks very much

Lars

--------------------------------------------------
Lars Söding

eMail: [ls@t...]
-------------------------------------------------


need help with vt's options

From: "Moritz Franckenstein" [franckenstein@a...]
Date: Thu Jul 19, 2001 9:48 am
Subject: need help with vt's options

hello,

can anyone tell me which properties or options i have to set to get
this behaviour for my multi-column treeview?

- i want the normal selectionrect where only the text is highlighted,
not the complete cell -> normal setting

- but i want it to be selected when i click anywhere in the cell,
currently i have to click on the text -> ?

- every column can be selected -> toExtendedFocus

- the cursor keys should be used to move the focus to another column.
currently the left/right keys expand and collapse nodes, even if i am
in another column -> ?

this could also be combined: when pressing the left/right cursor keys
on the main column, the column is only switched when the node is
already collapsed/expanded. on other columns it should always move to
another column.

- is there a way to leave the cell editor by pressing the up/down
cursor keys?

btw. i am uploading a new version of the xml tree component in some
minutes. new: the ability to edit the values, some fixes...

http://groups.yahoo.com/group/VirtualTreeview_de/files/XMLTreeTest.zip

-moritz

 | Replies | Author | Date
3160 | Re: need help with vt's options | Werner Lehmann | Thu 7/19/2001
3177 | Re: need help with vt's options | Moritz Franckenstein | Sat 7/21/2001
3180 | Re: need help with vt's options | Werner Lehmann | Sat 7/21/2001


ResetNode() question

From: "Moritz Franckenstein" [franckenstein@a...]
Date: Thu Jul 19, 2001 10:30 am
Subject: ResetNode() question

is it necessary for anything or anyone that in ResetNode() the
vsExpanded flag is removed?

-moritz

 | Replies | Author | Date
3184 | Re: ResetNode() question | Mike Lischke | Sat 7/21/2001


Paint error

From: [expertiza@i...]
Date: Thu Jul 19, 2001 10:41 am
Subject: [VirtualTreeview] Paint error

Hi, Mike

vt (Version 2.5.9) with two (and more) columns in the noncolumn area
(on the right) paint incorrectly at the multiselected lines.

Surkov Andrey

 | Replies | Author | Date
3158 | Re: Paint error | Michael Leaver | Thu 7/19/2001
3187 | Re: Paint error | Mike Lischke | Sat 7/21/2001
3196 | To Mike : Re: Paint error | [andersthomsen@h...] | Sat 7/21/2001
3218 | Re: To Mike : Re: Paint error | Mike Lischke | Sun 7/22/2001
3197 | Re: Paint error | Michael Leaver | Sat 7/21/2001
3205 | Re: Paint error | Jim Kueneman | Sun 7/22/2001
3210 | Re: Paint error | Mike Lischke | Sun 7/22/2001
3206 | Re: Paint error | Wim van der Vegt | Sun 7/22/2001


re: Paint error

From: Michael Leaver [MJLeaver@n...]
Date: Thu Jul 19, 2001 1:45 pm
Subject: RE: [VirtualTreeview] Paint error

I'm also having a number of (re)paint problems, especially
with drag & drop in the tree and also scrolling up and
down.

They seem to appear randomly, but once they appear nothing
but restarting the program can get rid of the problem.

-----Original Message-----
From: [expertiza@i...] [mailto:[expertiza@i...]]
Sent: 19 July 2001 18:42
To: [VirtualTreeview@yahoogroups.com
Subject: [VirtualTreeview] Paint error

Hi, Mike

vt (Version 2.5.9) with two (and more) columns in the noncolumn area
(on the right) paint incorrectly at the multiselected lines.

Surkov Andrey

To unsubscribe from this group, send an email to:
VirtualTreeview-unsubscribe@egroups.com

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/

 | Replies | Author | Date
3187 | Re: Paint error | Mike Lischke | Sat 7/21/2001
3196 | To Mike : Re: Paint error | andersthomsen@h...] | Sat 7/21/2001
3218 | Re: To Mike : Re: Paint error | Mike Lischke | Sun 7/22/2001


VT 2.5.9 Under Delphi 4

From: [colin@p...]
Date: Thu Jul 19, 2001 2:41 pm
Subject: VT 2.5.9 Under Delphi 4

I'm trying to install VT 2.5.9 under Delphi 4 but it complains of the
following :

TEditDelete and TEditSelectAll - Undeclared identifier

Does anybody know how I can fix this?

Colin

 | Replies | Author | Date
3162 | Re: VT 2.5.9 Under Delphi 4 | =?iso-8859-1?Q?Bj=F6rn_Lindel | Thu 7/19/2001
3163 | Re: VT 2.5.9 Under Delphi 4 | Colin Meeks | Thu 7/19/2001
3188 | Re: VT 2.5.9 Under Delphi 4 | Mike Lischke | Sat 7/21/2001
3190 | Re: VT 2.5.9 Under Delphi 4 | Mike Lischke | Sat 7/21/2001


re: need help with vt's options

From: Werner Lehmann [wl@b...]
Date: Thu Jul 19, 2001 5:52 pm
Subject: Re: [VirtualTreeview] need help with vt's options

Hi Moritz,

> - but i want it to be selected when i click anywhere in the cell,
> currently i have to click on the text -> ?

This would mean to select a node if a mouse down occurs somewhere in the
node rect, any column, on text or not on text. Problem with drag selection.
If you start a drag selection the node where you start would immediately
be selected. Differs from the usual behaviour shown by windows explorer
/ comctrl listview. Let's keep the selection mechanism as standard.

> - the cursor keys should be used to move the focus to another column.
> currently the left/right keys expand and collapse nodes, even if i am
> in another column -> ?

Consistency. You want to switch columns if arrow is pressed in column <>
Header.Maincolumn. But people expect to be able to reverse that action,
i.e. to press left arrow, then right arrow to get back to the previously
selected column. This would not be possible anymore if the node is collapsed,
it would be expanded then which is unexpected.

Obviously we have a functionality collision: arrow keys expand/collapse or
change focused column. IMO with nodes which have child nodes the former should
have precedence, always, because of common treeview behaviour. If you want
something different you have the liberty to use the OnKeyAction (from top of my
head) event and switch the column yourself.

> - is there a way to leave the cell editor by pressing the up/down
> cursor keys?

Detect VK_DOWN/VK_UP in your node editor and call CancelEdit, then send a
faked keydown to the VTree (see keybd_event in win32 api). The tree should
not handle these. Imagine a combobox node editor: clearly up/down should select
a different item in the drop down and not cancel the edit.

Regards,
Werner

 | Replies | Author | Date
3177 | Re: need help with vt's options | Moritz Franckenstein | Sat 7/21/2001


re: DAD-questions from a beginner

From: Werner Lehmann [wl@b...]
Date: Thu Jul 19, 2001 6:00 pm
Subject: Re: [VirtualTreeview] DAD-questions from a beginner

Hi Lars,

> Now I want the user dragging only child nodes to other parent nodes
> and NOT(!!!) as new parent nodes between the other parent nodes. How
> can I do this?

You don't say where the actual problem is.

> Here are some simplified code fragments:
> The parent nodes have a valid ROOTID and an UNKNOWN_PICID in data structure
and the
> chilld nodes have valid PICID and an UNKNOWN_ROOTID (this is because
> storing the tree in a database).
>
> procedure TfrmMain.VSTImgDragOver(Sender: TBaseVirtualTree; Source: TObject;
Shift: TShiftState; State: TDragState; Pt: TPoint; Mode: TDropMode; var Effect:
Integer; var Accept: Boolean);
> var
> Trash: Integer;
> begin
> Accept := (PVSTData(Sender.GetNodeData(Sender.FocusedNode)).RootID =
UNKNOWN_ROOTID) and
> (PVSTData(Sender.GetNodeData(Sender.GetNodeAt(Pt.x, Pt.y, True,
Trash))).PicID = UNKNOWN_PICID);
> end;

This assumes that there is always a node at point Pt. Expect nasty AV's
approaching. Also,
what I miss here is that you check if the dropmode is dmOnNode. And that a node
is not
dragged over its current parent.

> procedure TfrmMain.VSTImgDragDrop(Sender: TBaseVirtualTree; Source: TObject;
DataObject: IDataObject; Formats: TFormatArray; Shift: TShiftState; Pt: TPoint;
var Effect: Integer; Mode: TDropMode);
> var
> i, Trash: Integer;
> AttachMode : TVTNodeAttachMode;
> begin
> if Length(Formats) > 0 then begin
> for i := 0 to High(Formats) do
> if Formats[i] = CF_VIRTUALTREE then begin
> if not(Assigned(Sender.GetNodeAt(Pt.x, Pt.y, True, Trash))) then
> AttachMode := amNowhere
> else
> case Mode of
> dmAbove : AttachMode := amInsertBefore;
> dmOnNode : AttachMode := amAddChildLast;
> dmBelow : AttachMode := amInsertAfter;
> else if Assigned(Source) and (Source is TBaseVirtualTree) and (Sender
<> Source) then
> AttachMode := amInsertBefore
> else
> AttachMode := amNowhere;
> end;//case
> Sender.ProcessDrop(DataObject, Sender.DropTargetNode, Effect, AttachMode);
> Break;
> end;//if
> end;//if
> end;
>
> Can anybody give me a hint?

Hm, you want only dropmode dmOnNode (-> attach mode amAddChildLast). Why are
you handling the
rest? And the else part of the case statement does not make much sense. You
told us that you
are only dragging within a single tree, so why set attach mode to
amInsertBefore if the node
was dragged from a different tree? Without checking the source I don't even
know which value
of TDropMode is left for the else part.

Regards,
Werner

 | Replies | Author | Date
3166 | Re[2]: [VirtualTreeview] DAD-questions from a beg | [ls@t...] | Fri 7/20/2001
3222 | Re: DAD-questions from a beginner | Michael Valentiner=Branth | Mon 7/23/2001
3228 | Re: DAD-questions from a beginner | Werner Lehmann | Mon 7/23/2001
3235 | Re: DAD-questions from a beginner | Mike Lischke | Mon 7/23/2001
3238 | MFE and Use | Wim van der Vegt | Tue 7/24/2001
3239 | Re: MFE and Use | Wim van der Vegt | Tue 7/24/2001
3269 | Re: MFE and Use | Mike Lischke | Sat 7/28/2001
3243 | Re: DAD-questions from a beginner | Michael Valentiner=Branth | Wed 7/25/2001
3252 | Re[2]: [VirtualTreeview] DAD-questions from a beg | [ls@t...] | Wed 7/25/2001


re: VT 2.5.9 Under Delphi 4

From: Björn Lindell [bli@c...]
Date: Thu Jul 19, 2001 7:15 pm
Subject: Re: [VirtualTreeview] VT 2.5.9 Under Delphi 4

By looking at the VT source, it seems it has to do with "Actions"
which is as far as I recall a feature introduced in Delphi 5.

It appears to be used in two functions "TBaseVirtualTree.ExecuteAction"
and "TBaseVirtualTree.UpdateAction"
They appear to be overrides of default functions in a parent class, probably
some standard Delphi 5 functions.
My suggestion is that you simply comment out these functions, they are
not called by any code in virtualtrees.pas, so they are probably just there
as a "feature support" for Delphi 5 users who use "Actions".

If VT is intended to support D4, this would probably be handled in future
versions with IFDEFs

/Björn

----- Original Message -----
From: [colin@p...]
To: <VirtualTreeview@yahoogroups.com>
Sent: Thursday, July 19, 2001 4:41 PM
Subject: [VirtualTreeview] VT 2.5.9 Under Delphi 4

> I'm trying to install VT 2.5.9 under Delphi 4 but it complains of the
> following :
>
> TEditDelete and TEditSelectAll - Undeclared identifier
>
> Does anybody know how I can fix this?
>
> Colin
>
>
> To unsubscribe from this group, send an email to:
> VirtualTreeview-unsubscribe@egroups.com
>
>
>
> Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
>
>


re: VT 2.5.9 Under Delphi 4

From: "Colin Meeks" [colin@p...]
Date: Thu Jul 19, 2001 7:25 pm
Subject: Re: [VirtualTreeview] VT 2.5.9 Under Delphi 4

> It appears to be used in two functions "TBaseVirtualTree.ExecuteAction"
> and "TBaseVirtualTree.UpdateAction"
> They appear to be overrides of default functions in a parent class,
probably
> some standard Delphi 5 functions.
> My suggestion is that you simply comment out these functions, they are
> not called by any code in virtualtrees.pas, so they are probably just
there
> as a "feature support" for Delphi 5 users who use "Actions".
>
> If VT is intended to support D4, this would probably be handled in future
> versions with IFDEFs

I've done that but now find that the package needs a file called StrEdit
which I assume comes again with Delphi 5 and above. I've tried remove this
but the errors just escalate.

Colin

 | Replies | Author | Date
3188 | Re: VT 2.5.9 Under Delphi 4 | Mike Lischke | Sat 7/21/2001


[no subject]

From: [colin@p...]
Date: Thu Jul 19, 2001 7:30 pm
Subject:

1 12:24:45 -0700
Message-ID: [000501c11088$85d91e40$42d32a18@C...]
To: [VirtualTreeview@yahoogroups.com>
References: [9j6rij+mp9n@e...] [001101c11087$2d24cb60$0a0a0a0a@b...]
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 5.50.4522.1200
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200
From: "Colin Meeks" <colin@p...]
MIME-Version: 1.0
Mailing-List: list VirtualTreeview@yahoogroups.com; contact
VirtualTreeview-owner@yahoogroups.com
Delivered-To: mailing list VirtualTreeview@yahoogroups.com
Precedence: bulk
List-Unsubscribe: <mailto:VirtualTreeview-unsubscribe@yahoogroups.com>
Date: Thu, 19 Jul 2001 15:25:06 -0400
Reply-To: VirtualTreeview@yahoogroups.com
Subject: Re: [VirtualTreeview] VT 2.5.9 Under Delphi 4
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
X-UIDL: 293661878
Status: U

> It appears to be used in two functions "TBaseVirtualTree.ExecuteAction"
> and "TBaseVirtualTree.UpdateAction"
> They appear to be overrides of default functions in a parent class,
probably
> some standard Delphi 5 functions.
> My suggestion is that you simply comment out these functions, they are
> not called by any code in virtualtrees.pas, so they are probably just
there
> as a "feature support" for Delphi 5 users who use "Actions".
>
> If VT is intended to support D4, this would probably be handled in future
> versions with IFDEFs

I've done that but now find that the package needs a file called StrEdit
which I assume comes again with Delphi 5 and above. I've tried remove this
but the errors just escalate.

Colin

To unsubscribe from this group, send an email to:
VirtualTreeview-unsubscribe@egroups.com

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/


re: Header Columns order doesn't change internally.

From: [zh66w6@h...]
Date: Fri Jul 20, 2001 8:06 am
Subject: Re: Header Columns order doesn't change internally.

It is possible to figure out the order in which the columns are
displayed (if this is what you are looking for). The following code
will iterate through the columns in the order in which they are
displayed:

procedure StepThroughColumnsInVisibleOrder;
var
i : Integer;
begin
i := VT.Header.Columns.GetFirstVisibleColumn;
While i >= 0 do
begin
// Do something with column

i := VT.Header.Columns.GetNextVisibleColumn(i);
end;
end;

Hope this helps.

Cheers,
Paul
--- In [VirtualTreeview@y...], [yourfantasy50@h...] wrote:
> Hi everybody,
>
> I have succesfully implemented VT as a grid. First of all I want to
> thank you guys for your GREAT SUPPORT. This mailinglist is really
> awesome.
> I have one little problem left. When i drag a column to another
> position, so that the column order (on screen) changes, the columns
> order internally (VT.Header.Columns) don 't change at all. The VT
> display is updated automatically, the data in a column is correctly
> displayed in the moved column. Is there a property /
> function /procedure or event that 's called when the column order
has
> changed by dragging the column to a new position?
> Another small problem i have, occurs when i have more columns than
> the screen can display. I tried to drag a column to the end of the
> screen, but the screen doesn 't scroll automatically, so you can 't
> drag a column to the end of all columns and drop it there so it
> becomes the last column.
> Does anybody know how to do this?
> Thanx, again and again and....
>
> Kind Regards,
> Mark Dekker.


Re[2]: DAD-questions from a beginner

From: [ls@t...]
Date: Fri Jul 20, 2001 9:14 am
Subject: Re[2]: [VirtualTreeview] DAD-questions from a beginner

Hallo Werner,

WL> You don't say where the actual problem is.

You're right. Maybe it is because I don't know exactly how to describe
it ;-)

WL> This assumes that there is always a node at point Pt. Expect nasty AV's
approaching. Also,
WL> what I miss here is that you check if the dropmode is dmOnNode. And that a
node is not
WL> dragged over its current parent.

OK. I revised my code a little bit:

procedure TfrmMain.VSTImgDragOver(Sender: TBaseVirtualTree; Source: TObject;
Shift: TShiftState; State: TDragState; Pt: TPoint; Mode: TDropMode; var Effect:
Integer; var Accept: Boolean);
var
Trash: Integer;
begin
Accept := False;
try
Accept := (Mode = dmOnNode) and
(PVSTData(Sender.GetNodeData(Sender.FocusedNode)).RootID =
UNKNOWN_ROOTID) and
(PVSTData(Sender.GetNodeData(Sender.GetNodeAt(Pt.x, Pt.y, True,
Trash))).PicID = UNKNOWN_PICID);
except
end;
end;

WL> Hm, you want only dropmode dmOnNode (-> attach mode amAddChildLast). Why
are you handling the
WL> rest? And the else part of the case statement does not make much sense. You
told us that you
WL> are only dragging within a single tree, so why set attach mode to
amInsertBefore if the node
WL> was dragged from a different tree? Without checking the source I don't even
know which value
WL> of TDropMode is left for the else part.

You're right again. I also revised it like this:

procedure TfrmMain.VSTImgDragDrop(Sender: TBaseVirtualTree; Source: TObject;
DataObject: IDataObject; Formats: TFormatArray; Shift: TShiftState; Pt: TPoint;
var Effect: Integer; Mode: TDropMode);
var
i: Integer;
AttachMode : TVTNodeAttachMode;
begin
AttachMode := amNowhere;
if Length(Formats) > 0 then begin
for i := 0 to High(Formats) do
if Formats[i] = CF_VIRTUALTREE then
if Mode = dmOnNode then begin
AttachMode := amAddChildLast;
Break;
end;//if
Sender.ProcessDrop(DataObject, Sender.DropTargetNode, Effect, AttachMode);
end;//if
end;

And I also set the option toShowDropMark to False. And I think, now it
works unless you find other strange things ;-)

Many thanks!

Regards

Lars


re: New file uploaded to VirtualTreeview

From: Werner Lehmann [wl@b...]
Date: Fri Jul 20, 2001 9:51 am
Subject: Re: [VirtualTreeview] New file uploaded to VirtualTreeview

Hi Mike,

sorry for the delay but I had to finish some intermediate work before switching
to the
new VTree version.

> - support for standard actions

Seems to cause problems with D4.

> - options splitted into sub-options, property Options is now a class instead
of a set (called
> TreeOptions)

Well done and a big thank you. We can add some 80-100 new options now :) Even
if we are not
adding a new sub options property. Adding or removing some option values from
any of the sets
in descendants is still not possible but I can not think of any way to make
this working,
Delphi simply does not allow to 'override' a set type or something like that.
By breaking the
options into smaller sets at least the work 'VTree options translation to VTree
descendant options'
is eased.

> - new options toUseBlendedImages and toAutoScrollOnExpand

Thanks again for the toUseBlendedImages option.

> Note: because the change in the option management would cause serious trouble
with existing projects
> I have included two little migration methods which transparently convert the
old options property
> into the new properties. This process should silently happen without any
interaction by the user (be
> at run or design time). If you still find problems then report them as
quickly as possible please.

This seems to work well. With the exception of default option values which are
already set before
ReadOldOptions() is called. The method only adds values, e.g. it never removes
the toShowRoot for grid mode
VTrees where voShowRoot was not set.

Regards,
Werner

 | Replies | Author | Date
3183 | Re: New file uploaded to VirtualTreeview | Mike Lischke | Sat 7/21/2001


OLE drag and drop again

From: Werner Lehmann [wl@b...]
Date: Fri Jul 20, 2001 9:38 am
Subject: OLE drag and drop again

Hi,

I want to drag files from a VTree to explorer (Desktop etc). With
OnGetUserClipboardFormat
and OnRenderOLEData really easy. The copy works perfectly already. But I've got
a problem
with the move. The files may be moved but I have to remove them from the VTree
then, but
don't know when.

It appears that ActiveX.DoDragDrop() returns a pdwEffect parameter describing
the actual
drop action. But although explorer has successfully moved a file which has been
dragged and
dropped with move (shift held down), this pdwEffect is 0 (= DROPEFFECT_NONE).
Therefore the
following code which deletes the nodes does not execute:

procedure TBaseVirtualTree.DoDragging(P: TPoint);
...
try
ActiveX.DoDragDrop(DragManager.GetDataObject , DragManager as
IDropSource, AllowedEffects, DragEffect);
finally
GetCursorPos(P);
P := ScreenToClient(P);
DoEndDrag(Self, P.X, P.Y);

FDragImage.EndDrag;

// Finish the operation.
if DragEffect = DROPEFFECT_MOVE then <------------- DragEffect is 0
although file has been moved
begin
// The operation was a move so delete the previously selected nodes.
BeginUpdate;
try
// The list of selected nodes was retrieved in resolved state. That
means there can never be a node
// in the list whose parent (or its parent etc.) is also selected.
for I := 0 to High(FDragSelection) do
DeleteNode(FDragSelection[I]);
finally
EndUpdate;
end;
end;

I have examined Jim's VET and it seems to me that he relies on shell
notifications. Well I could
do the same but the notifications are not always reliable and there should
really be a better way
to inform the drop source of a move.

And, Mike why are you not examining the return value of ActiveX.DoDragDrop()?
This can be

DRAGDROP_S_DROP, DRAGDROP_S_CANCEL, E_OUTOFMEMORY, E_UNSPEC.

And even if the pdwEffect would be set correctly by ActiveX.DoDragDrop(), how
am I supposed to know
that the drop has occurred, with which effect? I see only the DoDragEnd event
call, but it has neither
format nor effect information. Also, OnDragEnd has the VTree as target even if
the drop has occured
on the desktop. Currently I can only hook on OnFreeNode and see if
tsOLEDragging is in the tree states.
To react on a move. For a copy or link there is nothing I can do. Any word on
this?

A second problem I am having with the automatic deletion of the nodes is that I
cannot prevent it
if the drop does not occur on the same tree. Mike, you may remember my question
about this, your
response was to just set the effect to DROPEFFECT_NONE. But where can I do this
if the drop does not
occur on the same tree (or any VTree at all). To clarify this: even with
DROPEFFECT_MOVE I want to be
able to process the drop myself, that is deleting the nodes.

Regards,
Werner

PS: Yesterday I dragged nodes from the tree to MS Word for the first time. *WAY
COOL*. This is really
a nice additional value. One titbit: after dropping a few nodes (representing
files, format CF_HDROP
is also supported) on an open word document I wanted to test a larger drop
example and selected many
files. I closed the previous word test doc and dropped the nodes on the word
window. Guess what
happened. Word has been opening a new instance (Word 2000, SDI not MDI) for
each node/file and loading
the file. Soon I was having ~100 word windows open and the taskbar showed
up/down arrows :)

I also tried to drag the nodes to IE but apparently it prefers CF_HDROP and not
the HTML which I had
enabled also.

 | Replies | Author | Date
3175 | Re: OLE drag and drop again | Jim Kueneman | Sat 7/21/2001
3181 | Re: OLE drag and drop again | Werner Lehmann | Sat 7/21/2001
3221 | Re: OLE drag and drop again | Jim Kueneman | Mon 7/23/2001
3229 | Re: OLE drag and drop again | Werner Lehmann | Mon 7/23/2001
3234 | Re: OLE drag and drop again | Jim Kueneman | Mon 7/23/2001


[no subject]

From: [zh66w6@h...]
Date: Fri Jul 20, 2001 9:24 pm
Subject:

Hi All,

I've just upgraded to the latest version of VT and two things seem to
have changed regarding OLE drag and drop:

1) When dragging with grid extensions turned on, I can only begin
dragging when the pointer is over the text. With the earlier version
I could drag from anywhere in the column.
2) When dropping I use the following:

procedure TDBRestructure.VT1DragDrop(Sender: TBaseVirtualTree;
Source: TObject;
DataObject: IDataObject; Formats: TFormatArray; Shift: TShiftState;
Pt: TPoint; var Effect: Integer; Mode: TDropMode);
begin
if (Mode in [dmBelow]) then
Sender.ProcessDrop(DataObject, Sender.DropTargetNode, Effect,
amInsertAfter)
else
Sender.ProcessDrop(DataObject, Sender.DropTargetNode, Effect,
amInsertBefore);
end;

Again, this worked fine before upgrading, but now nothing happens
when I drop the node (it used to move the node in the tree).

What do I need to to to get these working again?

Cheers,
Paul


Win2k & Win98 & OnDblClick event

From: [mhieta@h...]
Date: Fri Jul 20, 2001 9:24 pm
Subject: Win2k & Win98 & OnDblClick event

Hi!,

I use this code:

procedure TView.VirtualDrawTree1DblClick(Sender: TObject);
var
Data: PImageData;
SR: TSearchRec;
FileName: String;
Picture: TPicture;
begin
Data := VirtualDrawTree1.GetNodeData
(VirtualDrawTree1.GetFirstSelected);
ZoomedSizeToOriginal(Sender);
Picture := TPicture.Create;
View.Tag:=47;
if (Data <> Nil) and not IsDir(Data.FullPath) then
begin
FullPathandFileName := Data.FullPath;
FileName := (Data.FullPath) + '\' + SR.Name;
if (SR.Attr and faDirectory <> 0) or CanDisplay(FileName) then
begin
Picture.LoadFromFile(Data.FullPath);
ViewerForm.HorzScrollBar.Range := Picture.Width;
ViewerForm.VertScrollBar.Range := Picture.Height;
ViewerForm.ClientWidth := Picture.Width;
ViewerForm.ClientHeight := Picture.Height;
ViewerForm.Caption := Data.FullPath + ' - ' +
Format(' (%d x %d)', [Picture.Width, Picture.Height]);
ViewerForm.Image1.Picture:=Picture;
ViewerForm.ClientWidth := Picture.Width;
ViewerForm.ClientHeight := Picture.Height;
ViewerForm.HorzScrollBar.Range := Picture.Width;
ViewerForm.VertScrollBar.Range := Picture.Height;
RotatedSizeToOriginal(Sender);
ViewerForm.Show;
Picture.Free;
end;
end;
end;

So my problem is strange. How can it be, on Win98 above code works
ok. But in Win2k, above code doesn't work at all?!.
I'm using VT version 1.31.

BRgrds Marko Hietanen

 | Replies | Author | Date
3172 | Re: Win2k & Win98 & OnDblClick event | Werner Lehmann | Fri 7/20/2001
3179 | Re: Win2k & Win98 & OnDblClick event | [mhieta@h...] | Sat 7/21/2001


Need help with Changes in Drap and Drop

From: [zh66w6@h...]
Date: Fri Jul 20, 2001 9:25 pm
Subject: Need help with Changes in Drap and Drop

Hi All,

I've just upgraded to the latest version of VT and two things seem to
have changed regarding OLE drag and drop:

1) When dragging with grid extensions turned on, I can only begin
dragging when the pointer is over the text. With the earlier version
I could drag from anywhere in the column.
2) When dropping I use the following:

procedure TDBRestructure.VT1DragDrop(Sender: TBaseVirtualTree;
Source: TObject;
DataObject: IDataObject; Formats: TFormatArray; Shift: TShiftState;
Pt: TPoint; var Effect: Integer; Mode: TDropMode);
begin
if (Mode in [dmBelow]) then
Sender.ProcessDrop(DataObject, Sender.DropTargetNode, Effect,
amInsertAfter)
else
Sender.ProcessDrop(DataObject, Sender.DropTargetNode, Effect,
amInsertBefore);
end;

Again, this worked fine before upgrading, but now nothing happens
when I drop the node (it used to move the node in the tree).

What do I need to to to get these working again?

Cheers,
Paul

P.S. Sorry about the last post, I forgot the subject!

 | Replies | Author | Date
3173 | Re: Need help with Changes in Drap and Drop | Werner Lehmann | Fri 7/20/2001


re: Win2k & Win98 & OnDblClick event

From: Werner Lehmann [wl@b...]
Date: Fri Jul 20, 2001 10:26 pm
Subject: Re: [VirtualTreeview] Win2k & Win98 & OnDblClick event

Hi Marko,

> procedure TView.VirtualDrawTree1DblClick(Sender: TObject);
> var
> Data: PImageData;
> SR: TSearchRec;
> FileName: String;
> Picture: TPicture;
> begin
> Data := VirtualDrawTree1.GetNodeData
> (VirtualDrawTree1.GetFirstSelected);
> ZoomedSizeToOriginal(Sender);
> Picture := TPicture.Create;
> View.Tag:=47;
> if (Data <> Nil) and not IsDir(Data.FullPath) then
> begin
> FullPathandFileName := Data.FullPath;
> FileName := (Data.FullPath) + '\' + SR.Name;
> if (SR.Attr and faDirectory <> 0) or CanDisplay(FileName) then
> begin
> Picture.LoadFromFile(Data.FullPath);
> ViewerForm.HorzScrollBar.Range := Picture.Width;
> ViewerForm.VertScrollBar.Range := Picture.Height;
> ViewerForm.ClientWidth := Picture.Width;
> ViewerForm.ClientHeight := Picture.Height;
> ViewerForm.Caption := Data.FullPath + ' - ' +
> Format(' (%d x %d)', [Picture.Width, Picture.Height]);
> ViewerForm.Image1.Picture:=Picture;
> ViewerForm.ClientWidth := Picture.Width;
> ViewerForm.ClientHeight := Picture.Height;
> ViewerForm.HorzScrollBar.Range := Picture.Width;
> ViewerForm.VertScrollBar.Range := Picture.Height;
> RotatedSizeToOriginal(Sender);
> ViewerForm.Show;
> Picture.Free;
> end;
> end;
> end;
>
> So my problem is strange. How can it be, on Win98 above code works
> ok. But in Win2k, above code doesn't work at all?!.

What do you mean 'it doesn't work at all'? You should be able to find out
more with the debugger and stepping through the code line by line. At first
glance it seems strange to me that SR is never initialized. A local var,
no FindFirst anywhere, but you use it at SR.Name.

> I'm using VT version 1.31.

The current version is 2.5.9 beta and it has changed a lot...

Werner

 | Replies | Author | Date
3179 | Re: Win2k & Win98 & OnDblClick event | [mhieta@h...] | Sat 7/21/2001


re: Need help with Changes in Drap and Drop

From: Werner Lehmann [wl@b...]
Date: Fri Jul 20, 2001 10:24 pm
Subject: Re: [VirtualTreeview] Need help with Changes in Drap and Drop

Hi Paul,

> I've just upgraded to the latest version of VT and two things seem to
> have changed regarding OLE drag and drop:
>
> 1) When dragging with grid extensions turned on, I can only begin
> dragging when the pointer is over the text. With the earlier version
> I could drag from anywhere in the column.

Mike has done this on my behalf. Draw selection can not work if each click
and drag starts node dragging. Draw select beside node text, drag node on
node text.

You may be able to get around this if you disable draw selection in options
and start the drag manually in mousedown.

> 2) When dropping I use the following:
>
> procedure TDBRestructure.VT1DragDrop(Sender: TBaseVirtualTree;
> Source: TObject;
> DataObject: IDataObject; Formats: TFormatArray; Shift: TShiftState;
> Pt: TPoint; var Effect: Integer; Mode: TDropMode);
> begin
> if (Mode in [dmBelow]) then
> Sender.ProcessDrop(DataObject, Sender.DropTargetNode, Effect,
> amInsertAfter)
> else
> Sender.ProcessDrop(DataObject, Sender.DropTargetNode, Effect,
> amInsertBefore);
> end;
>
> Again, this worked fine before upgrading, but now nothing happens
> when I drop the node (it used to move the node in the tree).

No idea. Step through the code in the debugger, you'll probably see then
what the problem is.

Werner


To All: Need help !

From: Kirill Zinov [kirill@a...]
Date: Fri Jul 20, 2001 11:25 pm
Subject: To All: Need help !

Hello Everybody,

I need a functional example inherited from TCustomVirtualStringTree,
which is able to work in VT version 2.5.9.

Creating a components i used VT 2.4.34. VET was an example for my VCLs from
that version. At That time I used :
TotalInternalDataSize/InternalDataSize ... etc.

I think that the other members of the group whill be interested in
this kind of information.

--
Thanks,
Kirill mailto:[kirill@a...]

 | Replies | Author | Date
3176 | Re: To All: Need help ! | Jim Kueneman | Sat 7/21/2001
3178 | Re: To All: Need help ! | Vadim Sedulin | Sat 7/21/2001


re: OLE drag and drop again

From: "Jim Kueneman" [jimdk@m...]
Date: Sat Jul 21, 2001 1:10 am
Subject: Re: OLE drag and drop again

Hi Werner,

I am doing this while on vacation so I have to make it quick before
the wife catches me <g>.

--- In [VirtualTreeview@y...], Werner Lehmann [wl@b...] wrote:
> It appears that ActiveX.DoDragDrop() returns a pdwEffect parameter
describing the actual
> drop action. But although explorer has successfully moved a file
which has been dragged and
> dropped with move (shift held down), this pdwEffect is 0 (=
DROPEFFECT_NONE). Therefore the
> following code which deletes the nodes does not execute:

The shell is doing an optimized move. The way to catch is using the
CFSTR_PERFORMEDDROPEFFECT format. Look here:

http://msdn.microsoft.com/library/default.asp?url=/library/en-
us/shellcc/platform/Shell/Shell_basics/DataScenarios.asp

> A second problem I am having with the automatic deletion of the
nodes is that I cannot prevent it
> if the drop does not occur on the same tree. Mike, you may remember
my question about this, your

One reason why VET relies on the notification. I did not like the
auto reaction to the DoDragDrop return plus it has to watch the
system anyway so why complicate things with two different methods.

> happened. Word has been opening a new instance (Word 2000, SDI not
MDI) for each node/file and loading
> the file. Soon I was having ~100 word windows open and the taskbar
showed up/down arrows :)

I love Word it is my favorite MS program.....NOT!

Jim


re: To All: Need help !

From: "Jim Kueneman" [jimdk@m...]
Date: Sat Jul 21, 2001 1:18 am
Subject: Re: To All: Need help !

--- In [VirtualTreeview@y...], Kirill Zinov [kirill@a...] wrote:
> Hello Everybody,

> Creating a components i used VT 2.4.34. VET was an example for my
VCLs from

The latest version of VET will show you how also I thought that the
StringTree also uses the new technique.

There are now two methods, the original internal allocation (using
registration technique easier than before) and a way to add "user"
data which can be done without deriving a new tree.

Sorry for the vagueness but I am on the in-laws computer and for some
odd reason they don't have Delphi and VT installed <g>

Jim


re: need help with vt's options

From: "Moritz Franckenstein" [franckenstein@a...]
Date: Sat Jul 21, 2001 7:56 am
Subject: Re: need help with vt's options

hi werner,

it seems that you did understand me wrong. this was not meant to be a
suggestion to change the standard behaviour of vt.

i was just asking how I can get it to work this way.

> > - but i want it to be selected when i click anywhere in the cell,
> > currently i have to click on the text -> ?
>
> This would mean to select a node if a mouse down occurs somewhere
in the
> node rect, any column, on text or not on text. Problem with drag
selection.
> If you start a drag selection the node where you start would
immediately
> be selected. Differs from the usual behaviour shown by windows
explorer
> / comctrl listview. Let's keep the selection mechanism as standard.

you are right, if multiselect is possible. but in my case it isnt. so
there wouldnt be any problem with it.
(maybe it would also work in multiselect when selecting it in
mouseup, if the mouse has not moved?)
(and another maybe: this could be used for all non-main columns,
where no drag selection is used)

the reason why i need this, is that some of my cells are empty and to
select or to edit it you have to click a very small invisible area on
the left of the cell.
is there a way?

> > - the cursor keys should be used to move the focus to another
column.
> > currently the left/right keys expand and collapse nodes, even if
i am
> > in another column -> ?
>
> Consistency. You want to switch columns if arrow is pressed in
column <>
> Header.Maincolumn. But people expect to be able to reverse that
action,
> i.e. to press left arrow, then right arrow to get back to the
previously
> selected column. This would not be possible anymore if the node is
collapsed,
> it would be expanded then which is unexpected.

what people expect is a very difficult thing. i have given my program
to the people and most of them think, it is impossible to change
columns with the keyboard. i know that it works with tab and shift-
tab, but they didnt find that out theirselves.
and they all get confused when they are in one of the non-main-
columns, press the cursor keys and the tree gets expanded/collapsed.

so i think, my suggestion would be useful (and maybe good as an
option in vt):
by default, pressing the right cursor key in the main tree column,
the current node is expanded. that is ok.
when pressing it again, the first childnode is selected. instead of
this the next column could optionally be selected, isnt it?
and when pressing right/left keys in other than the main column, the
column could be changed.

if noone want this as an option in vt, could you give me an example
how i can do it?

> > - is there a way to leave the cell editor by pressing the up/down
> > cursor keys?
>
> Detect VK_DOWN/VK_UP in your node editor and call CancelEdit, then
send a
> faked keydown to the VTree (see keybd_event in win32 api). The tree
should
> not handle these. Imagine a combobox node editor: clearly up/down
should select
> a different item in the drop down and not cancel the edit.

i dont have a special node editor. can i get this to work with the
standard built in editor?

thank you very much,
-moritz


re: To All: Need help !

From: "Vadim Sedulin" [wsntrl@o...]
Date: Sat Jul 21, 2001 8:34 am
Subject: Re: [VirtualTreeview] To All: Need help !

Hello Kirill!

> I need a functional example inherited from TCustomVirtualStringTree,
> which is able to work in VT version 2.5.9.
>
> Creating a components i used VT 2.4.34. VET was an example for my VCLs
from
> that version. At That time I used :
> TotalInternalDataSize/InternalDataSize ... etc.

AllocateInternalDataArea. See TCustomVirtualStringTree.Create and
TCustomVirtualStringTree.InternalData.

> I think that the other members of the group whill be interested in
> this kind of information.

That question. Again and again... :)

Bye.

Vadim Sedulin
E-Mail: [wsntrl@o...]


re: Win2k & Win98 & OnDblClick event

From: [mhieta@h...]
Date: Sat Jul 21, 2001 8:56 am
Subject: Re: Win2k & Win98 & OnDblClick event

I have now leaved unnecessary code away:
{ FileName := (Data.FullPath) + '\' + SR.Name;
if (SR.Attr and faDirectory <> 0) or CanDisplay(FileName) then
begin }

Now it works on Win98 and Win2k ok, it seems that Win98 doesn't care
that incomplete code but Win2k cares. And that's why it not worked at
all in Win2k.

I know that 2.5.9 is much more better than this 1.31 version. But
there seems alot be done to get final version out. And i'm using
still Delphi 4 and there is installation problems... Hopefully using
Delphi 5 or 6 in future.

BRgrds Marko Hietanen

--- In [VirtualTreeview@y...], Werner Lehmann [wl@b...] wrote:
> Hi Marko,
>
> > procedure TView.VirtualDrawTree1DblClick(Sender: TObject);
> > var
> > Data: PImageData;
> > SR: TSearchRec;
> > FileName: String;
> > Picture: TPicture;
> > begin
> > Data := VirtualDrawTree1.GetNodeData
> > (VirtualDrawTree1.GetFirstSelected);
> > ZoomedSizeToOriginal(Sender);
> > Picture := TPicture.Create;
> > View.Tag:=47;
> > if (Data <> Nil) and not IsDir(Data.FullPath) then
> > begin
> > FullPathandFileName := Data.FullPath;
> > FileName := (Data.FullPath) + '\' + SR.Name;
> > if (SR.Attr and faDirectory <> 0) or CanDisplay(FileName) then
> > begin
> > Picture.LoadFromFile(Data.FullPath);
> > ViewerForm.HorzScrollBar.Range := Picture.Width;
> > ViewerForm.VertScrollBar.Range := Picture.Height;
> > ViewerForm.ClientWidth := Picture.Width;
> > ViewerForm.ClientHeight := Picture.Height;
> > ViewerForm.Caption := Data.FullPath + ' - ' +
> > Format(' (%d x %d)', [Picture.Width, Picture.Height]);
> > ViewerForm.Image1.Picture:=Picture;
> > ViewerForm.ClientWidth := Picture.Width;
> > ViewerForm.ClientHeight := Picture.Height;
> > ViewerForm.HorzScrollBar.Range := Picture.Width;
> > ViewerForm.VertScrollBar.Range := Picture.Height;
> > RotatedSizeToOriginal(Sender);
> > ViewerForm.Show;
> > Picture.Free;
> > end;
> > end;
> > end;
> >
> > So my problem is strange. How can it be, on Win98 above code works
> > ok. But in Win2k, above code doesn't work at all?!.
>
> What do you mean 'it doesn't work at all'? You should be able to
find out
> more with the debugger and stepping through the code line by line.
At first
> glance it seems strange to me that SR is never initialized. A local
var,
> no FindFirst anywhere, but you use it at SR.Name.
>
> > I'm using VT version 1.31.
>
> The current version is 2.5.9 beta and it has changed a lot...
>
> Werner


re: Re: need help with vt's options

From: Werner Lehmann [wl@b...]
Date: Sat Jul 21, 2001 12:00 pm
Subject: Re: [VirtualTreeview] Re: need help with vt's options

Hi Moritz,

> it seems that you did understand me wrong. this was not meant to be a
> suggestion to change the standard behaviour of vt.

Sorry for that.

> > > - but i want it to be selected when i click anywhere in the cell,
> > > currently i have to click on the text -> ?
> >
> > This would mean to select a node if a mouse down occurs somewhere
> in the
> > node rect, any column, on text or not on text. Problem with drag
> selection.
> > If you start a drag selection the node where you start would
> immediately
> > be selected. Differs from the usual behaviour shown by windows
> explorer
> > / comctrl listview. Let's keep the selection mechanism as standard.
>
> you are right, if multiselect is possible. but in my case it isnt. so
> there wouldnt be any problem with it.
> (maybe it would also work in multiselect when selecting it in
> mouseup, if the mouse has not moved?)
> (and another maybe: this could be used for all non-main columns,
> where no drag selection is used)
>
> the reason why i need this, is that some of my cells are empty and to
> select or to edit it you have to click a very small invisible area on
> the left of the cell.
> is there a way?

Well why not straight forward. Hook a handler to the OnMouseDown event,
use GetHitTestAt to learn on which cell the mouse was clicked and change
the FocusedColumn property accordingly.

> > > - the cursor keys should be used to move the focus to another
> column.
> > > currently the left/right keys expand and collapse nodes, even if
> i am
> > > in another column -> ?
> >
> > Consistency. You want to switch columns if arrow is pressed in
> column <>
> > Header.Maincolumn. But people expect to be able to reverse that
> action,
> > i.e. to press left arrow, then right arrow to get back to the
> previously
> > selected column. This would not be possible anymore if the node is
> collapsed,
> > it would be expanded then which is unexpected.
>
> what people expect is a very difficult thing. i have given my program
> to the people and most of them think, it is impossible to change
> columns with the keyboard. i know that it works with tab and shift-
> tab, but they didnt find that out theirselves.
> and they all get confused when they are in one of the non-main-
> columns, press the cursor keys and the tree gets expanded/collapsed.

I see...

> so i think, my suggestion would be useful (and maybe good as an
> option in vt):
> by default, pressing the right cursor key in the main tree column,
> the current node is expanded. that is ok.
> when pressing it again, the first childnode is selected. instead of
> this the next column could optionally be selected, isnt it?
> and when pressing right/left keys in other than the main column, the
> column could be changed.
>
> if noone want this as an option in vt, could you give me an example
> how i can do it?

As I said: use OnKeyAction if you want any different VTree special key
handling.

> > > - is there a way to leave the cell editor by pressing the up/down
> > > cursor keys?
> >
> > Detect VK_DOWN/VK_UP in your node editor and call CancelEdit, then
> send a
> > faked keydown to the VTree (see keybd_event in win32 api). The tree
> should
> > not handle these. Imagine a combobox node editor: clearly up/down
> should select
> > a different item in the drop down and not cancel the edit.
>
> i dont have a special node editor. can i get this to work with the
> standard built in editor?

You need to know when the arrow keys are pressed. You may be able to
do this with KeyPreview set to true on the form and exmaining if the
tree is currently editing, then cancelling the edit and moving the focus.

Or,

- descend from TVTEdit, use your own WM_KEYDOWN handler that redirects
VK_UP and VK_DOWN to the tree and cancels the editing

- ask Mike nicely to change the private directive in TStringEditLink
to protected, inherit from TStringEditLink, override the constructor
to create an instance for your own TVTEdit descendant from the previous
step

- return an instance of your own TStringEditLink in OnCreateEditor

Regards,
Werner


re: Re: OLE drag and drop again

From: Werner Lehmann [wl@b...]
Date: Sat Jul 21, 2001 12:05 pm
Subject: Re: [VirtualTreeview] Re: OLE drag and drop again

Hi Jim,

> I am doing this while on vacation so I have to make it quick before
> the wife catches me <g>.

Oh :) I am trying to be brief so you have a chance to read this reply :)

> The shell is doing an optimized move. The way to catch is using the
> CFSTR_PERFORMEDDROPEFFECT format. Look here:
>
> http://msdn.microsoft.com/library/default.asp?url=/library/en-
> us/shellcc/platform/Shell/Shell_basics/DataScenarios.asp

Valuable information. This explains a lot. Only to recognize an optimized
move I will have to provide my own data object which supports SetData.
Not exactly straight forward, I would consider this way as 'knitted with
a hot needle' (word by word translation of a german saying).

The optimized move is not restricted to CF_HDROP and the shell. Thus I
believe that the VTree itself should already be aware of this possibility.
Currently the return value of DoDragDrop is ignored, the pdwEffect is set
to DROPEFFECT_NONE and the VTree thinks that the drag has been cancelled.

Also, I still do not know how to learn what the real effect was, the VTree
does not communicate this AFAIK.

> > A second problem I am having with the automatic deletion of the
> nodes is that I cannot prevent it
> > if the drop does not occur on the same tree. Mike, you may remember
> my question about this, your
>
> One reason why VET relies on the notification. I did not like the
> auto reaction to the DoDragDrop return plus it has to watch the
> system anyway so why complicate things with two different methods.

Ok, but how do you prevent this auto reaction? Did you replace the whole
dragging method without overriding it? Apparently not, it is not even
virtual in VTree.

I say we need another event which is fired after a drag has ended and which
provides information on the real drag effect resp. if the drag was cancelled.
And the tree should not delete nodes on its own (maybe as optional behaviour).

Something like this:

procedure TBaseVirtualTree.DoEndDragOLE(Effect: Integer; OptimizedMove: Boolean;
var AutoDeleteIfMoved: Boolean); virtual;

Effect could be any effect including DROPEFFECT_NONE. If it is NONE the drag
has either been cancelled or was an optimized move if OptimizedMove is true.
If a move has occurred (optimized or not) and AutoDeleteIfMoved is true, the
selected nodes will be deleted after the event handler returns.

To complicate the matter even more there is the possibility of asynchronous
drag and drop. Lets ignore this... :)

I might be able to put this together but I'd like to wait for a comment from
Mike. Of course I would not mind if he did it himself... :)

Generally it might be wise to distinguish OLE drag and drop events from VCL
events by postfixing OLE to their names.

Werner

 | Replies | Author | Date
3221 | Re: OLE drag and drop again | Jim Kueneman | Mon 7/23/2001


Possible Drag and Drop Bug

From: [zh66w6@h...]
Date: Sat Jul 21, 2001 3:38 pm
Subject: Possible Drag and Drop Bug

I have been having problems dragging and dropping nodes in the new
version of VT. I am using OLE DAD to move a node from one position to
another. Before I upgraded, the node was moved as it should, but
after upgrading nothing happens when the node is dropped. I have
traced the problem into the ProcessOLEData function. The function
Result := DataObject.QueryGetData(StandardOLEFormat) = S_OK; always
returns FALSE when I believe it should be returning TRUE. The format
appears to still be available as when I insert the line Result :=
TRUE, everything begins working as normal again.

Is there a new option which I have missed or is this a bug?

function TBaseVirtualTree.ProcessOLEData(Source: TBaseVirtualTree;
DataObject: IDataObject; TargetNode: PVirtualNode;
Mode: TVTNodeAttachMode; Optimized: Boolean): Boolean;

// Recreates the (sub) tree structure serialized into memory and
provided by DataObject. The new nodes are attached to
// the passed node or FRoot if TargetNode is nil according to Mode.
Optimized can be set to True if the entire operation
// happens within the same process (i.e. sender and receiver of the
OLE operation are located in the same process).
// Optimize = True makes only sense if the operation to carry out is
a move hence it is also the indication of the
// operation to be done here. Source is the source of the OLE data
and only of use (and usually assigned) when
// an OLE operation takes place in the same application.
// Returns True on success, i.e. the CF_VIRTUALTREE format is
supported by the data object and the structure could be
// recreated, otherwise False.

var
Medium: TStgMedium;
Stream: TOLEMemoryStream;
Data: Pointer;
Node: PVirtualNode;
Nodes: TNodeArray;
I: Integer;
Res: HRESULT;

begin
Nodes := nil;
// check the data format available by the data object
with StandardOLEFormat do
begin
// read best format
cfFormat := CF_VIRTUALTREE;
end;
Result := DataObject.QueryGetData(StandardOLEFormat) = S_OK;
> Result := TRUE; <-----
if Result then
begin
BeginUpdate;
Result := False;
try
// Optimized means source is known and in the same process so
we can access its pointers, which avoids duplicating
// the data while doing a serialization. Can only be used with
cut'n paste and drag'n drop with move effect.
if Optimized then
begin
if tsOLEDragging in Source.FStates then
Nodes := Source.FDragSelection
else
Nodes := Source.GetSortedCutCopySet(True);
.
.
.

Also, would it be possible to add an option to turn on and off the
ability to drag and drop from anywhere within a column and not just
on the text. When FullRowSelect is activated, it is not very ituitive
to only be able to drag when clicking on the text.

Cheers, Paul

 | Replies | Author | Date
3217 | Re: Possible Drag and Drop Bug | Mike Lischke | Sun 7/22/2001


re: New file uploaded to VirtualTreeview

From: "Mike Lischke" [lists@l...]
Date: Sat Jul 21, 2001 3:57 pm
Subject: RE: [VirtualTreeview] New file uploaded to VirtualTreeview

> > - support for standard actions
> Seems to cause problems with D4.

Here are the action I use:
TEditCut
TEditCopy
TEditPaste
TEditDelete
TEditSelectAll

Could somebody please tell me which are not already in Delphi 4?

> This seems to work well. With the exception of default option values which
are already set before
> ReadOldOptions() is called. The method only adds values, e.g. it never
removes the
> toShowRoot for grid mode VTrees where voShowRoot was not set.

I don't understand. When you have compiled the new source then other default
parameters are set, not
the old ones. So it should not happen that any of the old values is set in
advance. You cannot, of
course, expect to have it the other way around. Once the new options are stored
then you cannot read
back them with the old tree version.

Ciao, Mike


re: ResetNode() question

From: "Mike Lischke" [lists@l...]
Date: Sat Jul 21, 2001 3:57 pm
Subject: RE: [VirtualTreeview] ResetNode() question

> is it necessary for anything or anyone that in ResetNode() the
> vsExpanded flag is removed?

Yes, because the initial state of a node is that it is collapsed and ResetNode
resets a node to that
state.

Ciao, Mike


re: ChangeDelay

From: "Mike Lischke" [lists@l...]
Date: Sat Jul 21, 2001 3:57 pm
Subject: RE: [VirtualTreeview] ChangeDelay

> You are using the same field (FLastChangeNode) for change and structure
change events.
> So, if the selection (focus w/o multiselect) changes, the delay timer starts
and a new
> node is being inserted before the ChangeTimer has finished, the change event
fires with
> the wrong node (because StructureChange has overwritten the previous value of
> FLastChangedNode).
>
> I suggest to use another field variable for structure changes.

OK, obviously I have not thought to the end when I split selection and
structure change.

Ciao, Mike


re: Disabled nodes

From: "Mike Lischke" [lists@l...]
Date: Sat Jul 21, 2001 3:57 pm
Subject: RE: [VirtualTreeview] Disabled nodes

Hi Werner,

> how are disabled nodes supposed to work with respect to focus? If I set some
node to
> disabled state via IsDisabled[Node] := true; the node is drawn disabled
(that's ok :)
> but the focus can somehow move on this disabled node.

Not "somehow". This is intended.

> Shouldn't the focus 'jump' over disabled nodes?

No. There must be at least one way to let the user point to a node and say:
this is now
disabled/enabled. A disabled node is in many ways not included (e.g. for
clipboard operations,
(constrained) selection, checking and editing). But it can still be focused to
allow e.g. to open a
popup menu. Another way I have used this feature is to disable an entire branch
(to indicate that it
is not active currently) and allow the user to click on any of the disabled
nodes to manipulate
aspects of this branch including to enable it or to act on a particular node.

> And one other not related 'issue' I always forgot to mention. In grid mode
with full
> row select, can Home/End work like ctrl Home and ctrl End, thus moving focus
to the
> first/last node? Currently they do not seem to do anything under these
circumstances.

What which key combination does under which conditions is described in a large
table in the new help
file.

> And while I am at it: horizontally scrolling goes column-wise. What do you
say about
> using ScrollbarOptions.HorizontalIncrement instead? Hm, better forget that
one.

Try Ctrl + arrow key.

Ciao, Mike


re: Paint error

From: "Mike Lischke" [lists@l...]
Date: Sat Jul 21, 2001 3:57 pm
Subject: RE: [VirtualTreeview] Paint error

> I'm also having a number of (re)paint problems, especially
> with drag & drop in the tree and also scrolling up and
> down.
> vt (Version 2.5.9) with two (and more) columns in the noncolumn area
> (on the right) paint incorrectly at the multiselected lines.

I cannot reproduce either problem. Is it limited to a particular OS (eg.
Win9x)? Can you send me a
very simple demo which shows this behavior?

Ciao, Mike

 | Replies | Author | Date
3196 | To Mike : Re: Paint error | [andersthomsen@h...] | Sat 7/21/2001
3218 | Re: To Mike : Re: Paint error | Mike Lischke | Sun 7/22/2001


re: VT 2.5.9 Under Delphi 4

From: "Mike Lischke" [lists@l...]
Date: Sat Jul 21, 2001 3:57 pm
Subject: RE: [VirtualTreeview] VT 2.5.9 Under Delphi 4

> I've done that but now find that the package needs a file called StrEdit
> which I assume comes again with Delphi 5 and above. I've tried remove this
> but the errors just escalate.

Please try to find the package which contains this unit by adding them to the
package until it
compiles. At least the string list editor must be somewhere because this
feature is present since
D1.

Ciao, Mike


re: different HintMode for different columns?

From: "Mike Lischke" [lists@l...]
Date: Sat Jul 21, 2001 3:57 pm
Subject: RE: [VirtualTreeview] different HintMode for different columns?

> i am still looking for a way to have a hint on one column and a
> tooltip on others.

For this and other proposals, ideas etc. I will create a new table in the YG
database area.

Ciao, Mike


re: VT 2.5.9 Under Delphi 4

From: "Mike Lischke" [lists@l...]
Date: Sat Jul 21, 2001 3:57 pm
Subject: RE: [VirtualTreeview] VT 2.5.9 Under Delphi 4

> TEditDelete and TEditSelectAll - Undeclared identifier

I covered both with ifdefs. Any other undefined identifier?

Ciao, Mike


re: One more problem under Delphi6

From: "Mike Lischke" [lists@l...]
Date: Sat Jul 21, 2001 3:57 pm
Subject: RE: [VirtualTreeview] One more problem under Delphi6

Hi Basil,

> 1. IsLibrary returns true for OCX.

Interesting. Good to know

> the problem has gone. Borland revised the code for Thread
> and it seems improved it (?).

Thank you. I have put an ifdef around the code.

> 2. I have found out that MapVirtualKey returns the wrong result
> for digit keys under the national keyboard layout.

Well, I have again changed the caller for incremental search. The main problem
is that I have not
found an API to convert a virtual key code (as it appears in WM_KEYDOWN) to a
real character. Often
there is a simple one-to-one mapping (eg. for the latin alphabet or navigation
keys). But this does
not work for keys > 255.

Hence I have reintroduced the WM_CHAR message handler but set a flag in
WM_KEYDOWN to know whether
to use the next character for incremental searching. This will hopefully work
for all kind of input.

Ciao, Mike


re: Focused node and parent node collapsing

From: "Mike Lischke" [lists@l...]
Date: Sat Jul 21, 2001 3:57 pm
Subject: RE: [VirtualTreeview] Focused node and parent node collapsing

> Before I implement that myself and outside of the component I'd like to ask
you 'officially' :)
> to include some code like the one below from Jim. AFAIK you have not said
anything about
> this topic yet.

Please insert it inofficially in your own application/component. Not everybody
likes so many
automatisms which have sometimes serious side effects.

Ciao, Mike


re: BackgroundColor of Expand/Collapse Buttons

From: "Mike Lischke" [lists@l...]
Date: Sat Jul 21, 2001 3:57 pm
Subject: RE: [VirtualTreeview] BackgroundColor of Expand/Collapse Buttons

Hi Hans-Jürgen,

> I would like to suggest an option by which the background color of
> the expand/collapse buttons could be switched to clWindow (like the
> background color of then checkboxes). This yields a more attractive
> optical appearance, if the background color of the VirtualTreeView is
> not equal clWindow. I add a screenshot (BKColorButtons.zip) to the
> file directory, which showes an example.

Please add this proposal to the new feature request table.

Ciao, Mike


re: Re: DoGetImageIndex is not so nice

From: "Mike Lischke" [lists@l...]
Date: Sat Jul 21, 2001 3:57 pm
Subject: RE: [VirtualTreeview] Re: DoGetImageIndex is not so nice

> mike, if you dont have a better solution for that problem, i think
> the above "if assigned" line should be changed to a new DoEditing
> procedure call.
>
> and the same with some other functions: for example, DoGetImageIndex
> and DoGetText.

OK, I have included the three Doxxx methods. These are hopefully the last
missing ones...

Ciao, Mike


re: Re: BCB5, VT2.5.7 and AddChild

From: "Mike Lischke" [lists@l...]
Date: Sat Jul 21, 2001 3:57 pm
Subject: RE: [VirtualTreeview] Re: BCB5, VT2.5.7 and AddChild

Hi Roland,

> of course BCB knows default parameter, but in this case we compile
> Delphi-Code under BCB an the compiler generate automatically from
> *.pas a *.hpp file for #include "*.hpp" in C++ Projects.

Any news about it. Can I perhaps include a HPPEMIT directive in the Delphi code
or anything else to
help with the automatic creation?

Ciao, Mike

 | Replies | Author | Date
3225 | Re: BCB5, VT2.5.7 and AddChild | Roland | Mon 7/23/2001
3354 | Re: BCB5, VT2.5.7 and AddChild | Mike Lischke | Sun 8/5/2001
3366 | Re: BCB5, VT2.5.7 and AddChild | Roland | Mon 8/6/2001


To Mike : Re: Paint error

From: [andersthomsen@h...]
Date: Sat Jul 21, 2001 4:14 pm
Subject: To Mike : Re: Paint error

Hi,

I've uploaded a demo that shows some of the problems that is
described here. I've posted this some days ago, but you haven't
replied, so I guess you've overlooked it : )

However, please go to msg: 3099
I've not included the .exe file in the example project, but I can
send it to you if you cannot regenerate the error with the sample
I've send to the group.

-Thomsen

--- In [VirtualTreeview@y...], "Mike Lischke" [lists@l...] wrote:
>
>
> > I'm also having a number of (re)paint problems, especially
> > with drag & drop in the tree and also scrolling up and
> > down.
> > vt (Version 2.5.9) with two (and more) columns in the noncolumn
area
> > (on the right) paint incorrectly at the multiselected lines.
>
> I cannot reproduce either problem. Is it limited to a particular OS
(eg. Win9x)? Can you send me a
> very simple demo which shows this behavior?
>
> Ciao, Mike

 | Replies | Author | Date
3218 | Re: To Mike : Re: Paint error | Mike Lischke | Sun 7/22/2001


re: Paint error

From: Michael Leaver [MJLeaver@n...]
Date: Sat Jul 21, 2001 5:28 pm
Subject: RE: [VirtualTreeview] Paint error

Unfortunately I can't. Being a developer myself I know I'm
not helping much. I am really trying to find out how I can
reproduce the problem, but it really is random.

To recap, the two main problems I have are:

1. Dragging nodes sometimes does not highlight the target
nodes. VT thinks there is some invisible box (with very
square edges) that is in front of the tree.

2. Scrolling up and down sometimes causes half of the tree
to invert (go black).

I have 3 trees on a form. Each tree is in a frame. Using
Delphi 5 (latest patches) and Windows 2000 Pro (SP2).

Refreshing the form (or the trees) does not fix it during
run-time.

Its very frustrating. There are three developers full-time
trying to find out why this is happening. Its stopping me
releasing a product.

There are possibly two reasons why this may be happening
(although I cannot prove it yet):

1. I'm not handling drag & drop correctly. In the drop
event I set effect to NONE and do the move/copy myself.
Is this correct?

2. I'm using a component to get an image for the type of
file shown in the tree (the file does not actually exist,
its virtual, so I cannot use VET). This may be causing
the scroll problem, but so far it does not appear so. I
say this because only one tree exhibits the scroll problem
and its the only one that uses this component.

Appreciate any suggestions.

-----Original Message-----
From: Mike Lischke [mailto:[lists@l...]]
Sent: 21 July 2001 23:58
To: VirtualTreeview@yahoogroups.com
Subject: RE: [VirtualTreeview] Paint error

> I'm also having a number of (re)paint problems, especially
> with drag & drop in the tree and also scrolling up and
> down.
> vt (Version 2.5.9) with two (and more) columns in the noncolumn area
> (on the right) paint incorrectly at the multiselected lines.

I cannot reproduce either problem. Is it limited to a particular OS (eg.
Win9x)? Can you send me a
very simple demo which shows this behavior?

Ciao, Mike

To unsubscribe from this group, send an email to:
VirtualTreeview-unsubscribe@egroups.com

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/

 | Replies | Author | Date
3205 | Re: Paint error | Jim Kueneman | Sun 7/22/2001
3210 | Re: Paint error | Mike Lischke | Sun 7/22/2001


re: New file uploaded to VirtualTreeview

From: Werner Lehmann [wl@b...]
Date: Sat Jul 21, 2001 5:50 pm
Subject: Re: [VirtualTreeview] New file uploaded to VirtualTreeview

Hi Mike,

> Could somebody please tell me which are not already in Delphi 4?

Sorry, I was only sort of forwarding that problem report, I have no D4
installed.

> > This seems to work well. With the exception of default option values which
are already set before
> > ReadOldOptions() is called. The method only adds values, e.g. it never
removes the
> > toShowRoot for grid mode VTrees where voShowRoot was not set.
>
> I don't understand. When you have compiled the new source then other default
parameters are set, not
> the old ones. So it should not happen that any of the old values is set in
advance. You cannot, of
> course, expect to have it the other way around. Once the new options are
stored then you cannot read
> back them with the old tree version.

I meant the new tree options have default values, one example is toShowRoot. If
the imported options
in the old options format did not include voShowRoot (explicitly disabled) it
will be set nevertheless
after the import. This is because the import method (ReadOldOptions) does not
clear the new default
options and never removes new options which were not set in the old options.

If I still could make myself not clear or I am misunderstanding something lets
just forget the thing,
there is more important work to be done.

Regards,
Werner

 | Replies | Author | Date
3211 | Re: New file uploaded to VirtualTreeview | Mike Lischke | Sun 7/22/2001


re: Disabled nodes

From: Werner Lehmann [wl@b...]
Date: Sat Jul 21, 2001 5:57 pm
Subject: Re: [VirtualTreeview] Disabled nodes

Hi Mike,

> > how are disabled nodes supposed to work with respect to focus? If I set
some node to
> > disabled state via IsDisabled[Node] := true; the node is drawn disabled
(that's ok :)
> > but the focus can somehow move on this disabled node.
>
> Not "somehow". This is intended.
>
> > Shouldn't the focus 'jump' over disabled nodes?
>
> No. There must be at least one way to let the user point to a node and say:
this is now
> disabled/enabled. A disabled node is in many ways not included (e.g. for
clipboard operations,
> (constrained) selection, checking and editing). But it can still be focused
to allow e.g. to open a
> popup menu. Another way I have used this feature is to disable an entire
branch (to indicate that it
> is not active currently) and allow the user to click on any of the disabled
nodes to manipulate
> aspects of this branch including to enable it or to act on a particular node.

Very valid reasons, I have not thought about these. Was only strange to not get
any visual effect
when I clicked on the disabled node (well at least I do not remember such an
effect).

> > And one other not related 'issue' I always forgot to mention. In grid mode
with full
> > row select, can Home/End work like ctrl Home and ctrl End, thus moving
focus to the
> > first/last node? Currently they do not seem to do anything under these
circumstances.
>
> What which key combination does under which conditions is described in a
large table in the new help
> file.
>
> > And while I am at it: horizontally scrolling goes column-wise. What do you
say about
> > using ScrollbarOptions.HorizontalIncrement instead? Hm, better forget that
one.
>
> Try Ctrl + arrow key.

Forgive my ignorance. I will not ask any more 'key questions'. :)

Werner


re: Focused node and parent node collapsing

From: Werner Lehmann [wl@b...]
Date: Sat Jul 21, 2001 5:59 pm
Subject: Re: [VirtualTreeview] Focused node and parent node collapsing

> > Before I implement that myself and outside of the component I'd like to ask
you 'officially' :)
> > to include some code like the one below from Jim. AFAIK you have not said
anything about
> > this topic yet.
>
> Please insert it inofficially in your own application/component. Not
everybody likes so many
> automatisms which have sometimes serious side effects.

Ok, if you see sense in the current behaviour I will do that and do not ask
again.

Werner

 | Replies | Author | Date
3236 | Re: Focused node and parent node collapsing | [adembaba@e...] | Mon 7/23/2001


Just wondering........

From: [duke_n5@h...]
Date: Sat Jul 21, 2001 8:07 pm
Subject: Just wondering........

Why in Object Inspector the string properties of VT are edited with a
TCombobox insteada TEdit?

I figured this was because they are actually not strings but
WideStrings, but I wondered if this dropdown list can somehow be used?

I hope I explained myself well.

 | Replies | Author | Date
3209 | Re: Just wondering........ | Mike Lischke | Sun 7/22/2001


Custom Editor

From: [duke_n5@h...]
Date: Sat Jul 21, 2001 8:26 pm
Subject: Custom Editor

I think it is a good feature but I faint immediately when I see all
the interfaces and stuff.

Can anyone help me use a form of my project as an inplace editor?

 | Replies | Author | Date
3226 | Re: Custom Editor | Roland | Mon 7/23/2001


Deletenode bug

From: [andersthomsen@h...]
Date: Sat Jul 21, 2001 10:37 pm
Subject: Deletenode bug

Hi,

Found another small problem : )

When using Scrollbars = ssNone and scrolling all the way down (using
f.i. the mousewheel) and select a node and delete it
(using .deletenode or .deleteselectednodes), the tree is not scrolled
so that the last node is at the bottom of the boundsrect.

-Thomsen

 | Replies | Author | Date
3208 | Re: Deletenode bug | Mike Lischke | Sun 7/22/2001


Resize bug

From: [andersthomsen@h...]
Date: Sun Jul 22, 2001 1:04 am
Subject: Resize bug

Hi again, Mike

I just found another problem: When using scrollbars = ssNone and the
tree is scrolled all the way down, and the tree is resized bigger, it
leaves space at the bottom of the tree instead of scrolling the
bottom of the tree to the bottom of the clientrect.

-Thomsen

 | Replies | Author | Date
3207 | Re: Resize bug | Mike Lischke | Sun 7/22/2001


re: Paint error

From: "Jim Kueneman" [jimdk@m...]
Date: Sun Jul 22, 2001 3:44 am
Subject: Re: Paint error

--- In [VirtualTreeview@y...], Michael Leaver [MJLeaver@n...] wrote:

> 2. I'm using a component to get an image for the type of
> file shown in the tree (the file does not actually exist,
> its virtual, so I cannot use VET). This may be causing

Not entirely true. I have added some "undocumented" functions that I
have started to implement for just this purpose. If you post a
message to the VET group I can upload a little demo that creates
virtual nodes that show the contents of a ZIP file.

It means creating a decendant of TNamespace and overriding a few
property setters (yes they have been moved to protected and made
virtual) Once you create an instance of this you call Some funtion
in TVirtualExplorerTree (again I am on "vacation") that is obvious if
you look through the public methods. I think it is something like
AddVirtualNode or something like that.

I will be home in about a week to upload this if you want it.

Jim


re: Re: Paint error

From: "Wim van der Vegt" [wvd_vegt@k...]
Date: Sun Jul 22, 2001 7:49 am
Subject: Re: [VirtualTreeview] Re: Paint error

Hi,

Please upload a sample. I would like to tie VET to a Visual SourceSafe Database.

---------
Wim van der Vegt
----- Original Message -----
From: Jim Kueneman
To: [VirtualTreeview@yahoogroups.com
Sent: Sunday, July 22, 2001 05:44 AM
Subject: [VirtualTreeview] Re: Paint error

--- In [VirtualTreeview@y...], Michael Leaver <MJLeaver@n...] wrote:

> 2. I'm using a component to get an image for the type of
> file shown in the tree (the file does not actually exist,
> its virtual, so I cannot use VET). This may be causing

Not entirely true. I have added some "undocumented" functions that I
have started to implement for just this purpose. If you post a
message to the VET group I can upload a little demo that creates
virtual nodes that show the contents of a ZIP file.

It means creating a decendant of TNamespace and overriding a few
property setters (yes they have been moved to protected and made
virtual) Once you create an instance of this you call Some funtion
in TVirtualExplorerTree (again I am on "vacation") that is obvious if
you look through the public methods. I think it is something like
AddVirtualNode or something like that.

I will be home in about a week to upload this if you want it.

Jim

Yahoo! Groups Sponsor

To unsubscribe from this group, send an email to:
VirtualTreeview-unsubscribe@egroups.com

Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.

[Non-text portions of this message have been removed]


re: Resize bug

From: "Mike Lischke" [lists@l...]
Date: Sun Jul 22, 2001 10:48 am
Subject: RE: [VirtualTreeview] Resize bug

> I just found another problem: When using scrollbars = ssNone and the
> tree is scrolled all the way down, and the tree is resized bigger, it
> leaves space at the bottom of the tree instead of scrolling the
> bottom of the tree to the bottom of the clientrect.

Fixed. Please report bugs in the future by entering them into the Bugs table in
the database area of
the mailing list.

Ciao, Mike


re: Deletenode bug

From: "Mike Lischke" [lists@l...]
Date: Sun Jul 22, 2001 10:48 am
Subject: RE: [VirtualTreeview] Deletenode bug

> When using Scrollbars = ssNone and scrolling all the way down (using
> f.i. the mousewheel) and select a node and delete it
> (using .deletenode or .deleteselectednodes), the tree is not scrolled
> so that the last node is at the bottom of the boundsrect.

Related to the other bug and fixed.

Ciao, Mike


re: Just wondering........

From: "Mike Lischke" [lists@l...]
Date: Sun Jul 22, 2001 10:48 am
Subject: RE: [VirtualTreeview] Just wondering........

Hi Duke,

> Why in Object Inspector the string properties of VT are edited with a
> TCombobox insteada TEdit?
>
> I figured this was because they are actually not strings but
> WideStrings, but I wondered if this dropdown list can somehow be used?
>
> I hope I explained myself well.

I think I understood you. By default also wide string properties are handled
with a normal TEdit
(like ANSI string properties). In my company we have a wide string editor
registered for all wide
string and TWideStringList properties, so they can get also greek or other
strings. If there is now
a combo box in your case then I guess some other expert or third-party stuff
has registered an own
editor too. Try unloading all third party stuff (including experts) and see if
the combo box
disappears.

Ciao, Mike


re: Paint error

From: "Mike Lischke" [lists@l...]
Date: Sun Jul 22, 2001 10:48 am
Subject: RE: [VirtualTreeview] Paint error

Michael,

> Unfortunately I can't. Being a developer myself I know I'm
> not helping much. I am really trying to find out how I can
> reproduce the problem, but it really is random.

I will try Anders' demo code to find out what is wrong. Hopefully this will
also solve your problem.
If not then tell me...

Ciao, Mike


re: New file uploaded to VirtualTreeview

From: "Mike Lischke" [lists@l...]
Date: Sun Jul 22, 2001 10:48 am
Subject: RE: [VirtualTreeview] New file uploaded to VirtualTreeview

Hi Werner,

> I meant the new tree options have default values, one example is toShowRoot.
If the
> imported options in the old options format did not include voShowRoot
(explicitly disabled) it
will be set
> nevertheless after the import. This is because the import method
(ReadOldOptions) does not clear
the
> new default options and never removes new options which were not set in the
old options.

Ah, this time I got it :o] Well, I have included an explicit clearance of all
properties if old
options are loaded. I think this should solve this problem.

Ciao, Mike


re: Feature request

From: "Mike Lischke" [lists@l...]
Date: Sun Jul 22, 2001 10:48 am
Subject: RE: [VirtualTreeview] Feature request

Wim,

> I would like to see two more enhancements to VT (anyone else agrees?) I have
> already implemented it in my private code/apps but perhaps they're nice
> standard features for VT too.

Please enter your whishes into the Feature request table at YG.

Ciao, Mike


re: How to Validate User Input in TVirtualStringTree?

From: "Mike Lischke" [lists@l...]
Date: Sun Jul 22, 2001 10:48 am
Subject: RE: [VirtualTreeview] How to Validate User Input in TVirtualStringTree?

Hi Ralf,

> When the user enters invalid data, I would like a warning message to pop up
and the edit
> to stay active so the user can change the data or cancel the changes pressing
escape.
>
> There are no parameters like ACCEPT in both OnNewText and in OnEdited.
Reading the code,
> there seems to be no way to avoid the edit to close. Do I have to create my
own extended
> edit link for that purpose?

Yes, for special behavior you have to derive an own class. But it isn't
difficult at all. You can
prevent the tree from stopping editing if there is invalid content by returning
False in
IVTEditLink.EndEdit.

Ciao, Mike


re: OnGetText: Called so often only moving the focus

From: "Mike Lischke" [lists@l...]
Date: Sun Jul 22, 2001 10:48 am
Subject: RE: [VirtualTreeview] OnGetText: Called so often only moving the focus

>
> Btw: ANY change of focus seems to invalidate the entire tree. This is true
for keyboard
> as well as for mouse navigation. Only keyboard navigation benefits from the
above change.
> Is something similar possible for mouse navigation?

The invalidation is due to the Invalidate call in ClearSelection. I was perhaps
a bit too lazy there
and have therefore changed the routine so that it now determines once the
display rectangle of the
top node and simply iterates down the client area until all nodes currently in
view and selected are
invalidated. This should now minimize the OnGetText calls when clearing the
current selection.

Ciao, Mike


re: Find node

From: "Mike Lischke" [lists@l...]
Date: Sun Jul 22, 2001 10:48 am
Subject: RE: [VirtualTreeview] Find node

Hi Franc,

> in my program I want to remember which node was last selected. So that when
> the user displays the form again, that specific node is selected and the
> tree is expanded to that node. How can I accomplish this ? I looked for a
> findnode procedure but didn't find it. Do I have to iterate trhough all
> nodes until I find the specific node or is there a better way ?

Restoring the last focused node is not simply done by keeping the node
reference because this
reference is not valid on next run. What you could do is to have an ID for each
node and store this
one. Then use IterateSubtree or GetFirstVisible/GetNextVisible to go through
the tree and restore
the last focused node. These methods are very fast (~ 500ms on a PII 350 for 1
million nodes), so
don't care about time penalties.

Ciao, Mike


unsubscribe

From: [bdaunt@p...]
Date: Sun Jul 22, 2001 11:51 am
Subject: unsubscribe

Mike,

Sorry for posting this here but I have tried several times
unsuccessfully to unsubscribe via normal channels.

I need to (temporarily) stop receiving emails to
([bdaunt@p...]) from this forum. Thanks.

 | Replies | Author | Date
3814 | unsubscribe | Tanzim Husain | Thu 9/20/2001


re: Possible Drag and Drop Bug

From: "Mike Lischke" [lists@l...]
Date: Sun Jul 22, 2001 3:06 pm
Subject: RE: [VirtualTreeview] Possible Drag and Drop Bug

> I have been having problems dragging and dropping nodes in the new
> version of VT. I am using OLE DAD to move a node from one position to
> another. Before I upgraded, the node was moved as it should, but
> after upgrading nothing happens when the node is dropped. I have
> traced the problem into the ProcessOLEData function. The function
> Result := DataObject.QueryGetData(StandardOLEFormat) = S_OK; always
> returns FALSE when I believe it should be returning TRUE. The format
> appears to still be available as when I insert the line Result :=
> TRUE, everything begins working as normal again.

Please see if you have included "Virtual Tree Data" in property
ClipboardFormats.

Ciao, Mike


re: To Mike : Re: Paint error

From: "Mike Lischke" [lists@l...]
Date: Sun Jul 22, 2001 3:06 pm
Subject: RE: [VirtualTreeview] To Mike : Re: Paint error

Hi Anders,

> I've uploaded a demo that shows some of the problems that is
> described here. I've posted this some days ago, but you haven't
> replied, so I guess you've overlooked it : )

Well, the error comes from the fact that you show and hide nodes in OnInitNode.
Although it seems to
work at times I have my reasons when I remove certain stuff like ivsVisible.

Ciao, Mike


EditNode

From: [ermserg@y...]
Date: Sun Jul 22, 2001 7:16 pm
Subject: EditNode

In Delphi 6 EditNode(VirtualStringTree.FocusedNode,0) generates
exception 'Range Check Error' if FocusedNode is a child of RootNode.
Why? How to fix?
(VirtulTree 2.5.9)

 | Replies | Author | Date
3267 | Re: EditNode | Mike Lischke | Sat 7/28/2001


re: Re: Data-aware VST

From: "sugi" [slim@c...]
Date: Sun Jul 22, 2001 10:35 pm
Subject: RE: [VirtualTreeview] Re: Data-aware VST

Dear all,

To recap my situation: I was asking about the availability of a
data-aware version of VT a couple of weeks ago. I wrote a simple
'read-only' data aware version of VT, because I thought it would
be a snap...:)

I (finally) succeeded to download the DBVT files (by egorushkin),
but has been unable to install the components to my system.
I have not downloaded the ib_vtree226.zip (by paultansit),
but it probably wouldn't help me since it's for IBO while I'm
using BDE and/or IBX.

So the bottom line is that I'm stuck. I just found out that my
'quick-and-dirty' data-aware treeview just won't work in design
time, only in run-time, which is a real nuisance since I don't
really have time to fiddle around with that code anymore,
with a deadline looming in the horizon...:)

I'm sure that these are probably very basic questions, so I'd
really appreciate if anyone here can point to the resource(s)
I can study to 'properly' use VT. To a certain extent, I
have consulted the archives, but have not found answers to
several issues:

As I understand it, the proper way to initialize a treeview
is a two-step process:
a. Setting the RootNodeCount property to the number of root nodes.
b. Providing the OnInitNode event handler to initialize the nodes.

Frankly, this is very counter-intuitive. It's not clear (at least
to me) what I'm supposed to do in the OnInitNode event handler? The
sample code in the "little code repository" section didn't help
much. I ended up with a large procedure called InitAllNodes that
LOADS the whole table from database, create, and initialized the
node at one go.

This is the traditional way, I think, and not the way VT is supposed
to work, but I can't figure out how to write the OnInitNode to work.
To give you some idea, here's my TMyNodeData declaration:
...
type TMyNodeData = record
key : variant; //holds the primary key value
parentkey : variant; //holds the foreign key value
level : integer; //level in the tree. 0 = root
bookmark : string; //TBookmarkStr, marker in TDataset.
end;
type PMyNodeData = ^TMyNodeData;
...

The requirement of having the number of root nodes available alone is
enough to put me off since this will require additional step to call
(select count(*) from table where parentkey is null) in a TQuery or
something.

Just as a side note, I'm a fairly experienced Delphi developer,
so I have to say that VT represent the biggest challenge so far
in my 3+ years in Delphi...:)

Maybe the problem is I don't understand how the initialization sequence
works. I'll be grateful if anyone would take the time to explain this
or send me someplace where I can learn more about this.

Many Thanks in advance,
salam,
sugi.

 | Replies | Author | Date
3224 | Re: Data-aware VST | [adembaba@e...] | Mon 7/23/2001
3230 | Re: Data-aware VST | Moritz Franckenstein | Mon 7/23/2001


re: OLE drag and drop again

From: "Jim Kueneman" [jimdk@m...]
Date: Mon Jul 23, 2001 12:14 am
Subject: Re: OLE drag and drop again

--- In [VirtualTreeview@y...], Werner Lehmann [wl@b...] wrote:

> Valuable information. This explains a lot. Only to recognize an
optimized
> move I will have to provide my own data object which supports
SetData.
> Not exactly straight forward, I would consider this way as 'knitted
with
> a hot needle' (word by word translation of a german saying).

I can think of a few "colorful" american saying for using SetData
<g>. I am trying to implement it in a generic way so I can use the
Win2k IDropSource/TargetHelper interfaces. With VET it is easy since
the shell is supplying the IDataObjects already SetData aware. I
think I understand how it works now, and it is not straightforward.
if it were not for an example by MS it would not be obvious at all.
There are a number of little "gotcha's".

> Ok, but how do you prevent this auto reaction? Did you replace the
whole
> dragging method without overriding it? Apparently not, it is not
even
> virtual in VTree.

Hum, apparently I am getting lucky right now. Since the shell uses
the opimized moves the effect is alway DROPEFFECT_NONE and VT does
nothing. Apparently after the last D&D redesign in VT I forgot this
bit. What I did was override the DoDragDrop method of VT which is
directly called by the interface function in the DragManager object.
The last line before it returns (after inherited) was to return
DROPEFFECT_NONE so this is what was returned to ActiveX.DoDragDrop.

> I might be able to put this together but I'd like to wait for a
comment from
> Mike. Of course I would not mind if he did it himself... :)

From the lack of response my guess is that Mike is sick of talking
about OLE Drag and Drop <g>. I know Mike did his best to make is
easy to implement but unfortunately to use it to its fullest extent
it is really necessary to be able to take control of everything that
is passed and returned from the COM interfaces.

Jim


re: DAD-questions from a beginner

From: Michael Valentiner=Branth [MichaelVB@g...]
Date: Mon Jul 23, 2001 6:54 am
Subject: Re: [VirtualTreeview] DAD-questions from a beginner

Hello,

> > Now I want the user dragging only child nodes to other parent nodes
> > and NOT(!!!) as new parent nodes between the other parent nodes. How
> > can I do this?
>
> You don't say where the actual problem is.

I think I understood, what Lars wants to do.
I am just trying to do the same.<g>

I have a tree with only level0- and level1-Nodes.
- level0-nodes are not to be dragged.
- level1-nodes may be dragged, but they have to stay in level1.

Here is (in simple form), how I am trying to do it:
What does not work is, to disallow the Level0-nodes to be dragged.

procedure TForm1.VirtualStringTree1DragAllowed(Sender: TBaseVirtualTree;
Node: PVirtualNode; Column: Integer; var Allowed: Boolean);
//// This should make sure, that no Level0-Nodes can be dragged
begin
if (Sender.GetNodeLevel(Node)=0) then Allowed := False
else Allowed := True;
end;

procedure TForm1.VirtualStringTree1DragOver(Sender: TBaseVirtualTree;
Source: TObject; Shift: TShiftState; State: TDragState; Pt: TPoint;
Mode: TDropMode; var Effect: Integer; var Accept: Boolean);
//// This makes sure, that Level1-Nodes can only be dragged to Level1 as
//// a child of another Level0-Node (or within the same for reorder);
//// not as a Level0-Node! and not as a child of an existing //// Level1-Node!
var
PNode : PVirtualNode;
Dummy : integer;
begin
Accept := False;

//// get the concerned dragged-over-Node
PNode := Sender.GetNodeAt(Pt.X, Pt.y, True, Dummy);

if ((Sender=Source) and (Sender.GetNodeLevel(PNode)>0)) then begin
case Mode of
dmAbove:
Accept := True;
dmOnNode:
Accept := False;
dmBelow:
Accept := True;
else
showmessage('???'); //not finished yet
end;
end;
end;

1. Why doesn't OnDragAllowed work the way I thought it would?
2. Any more suggestions, how to do the whole thing better?

Michael
(also a beginner with VT and espacially with DragnDrop)


CharSet Problem + Invisible Focused Node

From: [adembaba@e...]
Date: Mon Jul 23, 2001 7:15 am
Subject: CharSet Problem + Invisible Focused Node

Hi,

I have 2 questions:

1) Does the latest VT have any problems with non-ASCII
text display. Reason is, when I display exactly the same
text on VT I get funny characters, even though it diplays
fine in every other VCL --Fonts, character sets etc. are
the same. To make sure I have set ParentFont := True
for everything. Nope, VT displays funny. Any reasons.

2) Is it sensical to have a focused node remain focused
even though its parent is now collapsed, hence the node
is not visible anymore. Shoudn't the parent node receive
the focus --after firind NodeChanging, NodeChanged etc.

Cheers,
Adem

 | Replies | Author | Date
3227 | Re: CharSet Problem + Invisible Focused Node | Werner Lehmann | Mon 7/23/2001
3268 | Re: CharSet Problem + Invisible Focused Node | Mike Lischke | Sat 7/28/2001


re: Data-aware VST

From: [adembaba@e...]
Date: Mon Jul 23, 2001 7:19 am
Subject: Re: Data-aware VST

Sugi,

While I fully sympathise with you, I can only
suggest that you contact Alex directly as I
believe (hope?) he is already working on DBVT.

Cheers,
Adem


re: BCB5, VT2.5.7 and AddChild

From: "Roland" [Beduerftig@S...]
Date: Mon Jul 23, 2001 8:56 am
Subject: Re: BCB5, VT2.5.7 and AddChild

> Hi Roland,
>
> > of course BCB knows default parameter, but in this case we compile
> > Delphi-Code under BCB an the compiler generate automatically from
> > *.pas a *.hpp file for #include "*.hpp" in C++ Projects.
>
> Any news about it. Can I perhaps include a HPPEMIT directive in the
> Delphi code or anything else to
> help with the automatic creation?
>
> Ciao, Mike

Hi Mike,

I search for a "good" way to fix the problem with the default
parameter while compile pascal source with BCB5, but I have not found
a #pragma to switch on the compiler to do that.

Your question:

we can not use HPPEMIT, because we must write:
......
{$HPPEMIT 'PVirtualNode __fastcall AddChild(PVirtualNode Parent,
void* UserData = NULL);'}
function AddChild(Parent: PVirtualNode; UserData: Pointer = NIL):
PVirtualNode;
.....
direct in the class definition, but the compiler will not generate
this line here at this position in the *.hpp.
The compiler will add all HPPEMIT statement (from the whole source)
in the beginning of the *.hpp file like this:

//-- user supplied ----------------------------------------------
#include <objidl.h>
PVirtualNode __fastcall AddChild(PVirtualNode Parent, ......

What can we do ?

we can add following code until one of the BCB5-User found a compiler
switch to compile with default parameter.

function AddChild(Parent: PVirtualNode): PVirtualNode; overload;
function AddChild(Parent: PVirtualNode; UserData: Pointer):
PVirtualNode; overload;

and the code:

function TBaseVirtualTree.AddChild(Parent: PVirtualNode):
PVirtualNode;
begin
Result := AddChild(Parent, NIL);
end;

with best regards
Roland

 | Replies | Author | Date
3354 | Re: BCB5, VT2.5.7 and AddChild | Mike Lischke | Sun 8/5/2001
3366 | Re: BCB5, VT2.5.7 and AddChild | Roland | Mon 8/6/2001


re: Custom Editor

From: "Roland" [Beduerftig@S...]
Date: Mon Jul 23, 2001 8:58 am
Subject: Re: Custom Editor

> I think it is a good feature but I faint immediately when I see all
> the interfaces and stuff.
>
> Can anyone help me use a form of my project as an inplace editor?

Hi,

have a look in the file area, there are two samples, PropertyEditor
and VST, both samples show how to use VT with an inplace editor.

regards
Roland


re: CharSet Problem + Invisible Focused Node

From: Werner Lehmann [wl@b...]
Date: Mon Jul 23, 2001 8:53 am
Subject: Re: [VirtualTreeview] CharSet Problem + Invisible Focused Node

Hi Adem,

> 1) Does the latest VT have any problems with non-ASCII
> text display. Reason is, when I display exactly the same
> text on VT I get funny characters, even though it diplays
> fine in every other VCL --Fonts, character sets etc. are
> the same. To make sure I have set ParentFont := True
> for everything. Nope, VT displays funny. Any reasons.

No idea on this one, except... see where VT actually draws the
node text, check the API flags and try to reproduce and fix it
in a simple test project. Unless Mike has an idea you're probably
best suited to find the problem :)

> 2) Is it sensical to have a focused node remain focused
> even though its parent is now collapsed, hence the node
> is not visible anymore. Shoudn't the parent node receive
> the focus --after firind NodeChanging, NodeChanged etc.

Please see thread "Focused node and parent node collapsing" from
Wednesday including Mikes answer.

Werner


re: DAD-questions from a beginner

From: Werner Lehmann [wl@b...]
Date: Mon Jul 23, 2001 8:50 am
Subject: Re: [VirtualTreeview] DAD-questions from a beginner

Hi Michael,

> Here is (in simple form), how I am trying to do it:
> What does not work is, to disallow the Level0-nodes to be dragged.
>
> procedure TForm1.VirtualStringTree1DragAllowed(Sender: TBaseVirtualTree;
> Node: PVirtualNode; Column: Integer; var Allowed: Boolean);
> //// This should make sure, that no Level0-Nodes can be dragged
> begin
> if (Sender.GetNodeLevel(Node)=0) then Allowed := False
> else Allowed := True;
> end;

Is that code even called? You have to set dragmode to dmManual. And not call
BeginDrag in MouseDown (as I understand is the usual VCL style, Mike?).

> procedure TForm1.VirtualStringTree1DragOver(Sender: TBaseVirtualTree;
> Source: TObject; Shift: TShiftState; State: TDragState; Pt: TPoint;
> Mode: TDropMode; var Effect: Integer; var Accept: Boolean);
> //// This makes sure, that Level1-Nodes can only be dragged to Level1 as
> //// a child of another Level0-Node (or within the same for reorder);
> //// not as a Level0-Node! and not as a child of an existing //// Level1-Node!
> var
> PNode : PVirtualNode;
> Dummy : integer;
> begin
> Accept := False;
>
> //// get the concerned dragged-over-Node
> PNode := Sender.GetNodeAt(Pt.X, Pt.y, True, Dummy);

Use Sender.DropTargetNode.

> if ((Sender=Source) and (Sender.GetNodeLevel(PNode)>0)) then begin
> case Mode of
> dmAbove:
> Accept := True;
> dmOnNode:
> Accept := False;
> dmBelow:
> Accept := True;
> else
> showmessage('???'); //not finished yet
> end;
> end;
> end;
>
> 1. Why doesn't OnDragAllowed work the way I thought it would?

See above.

> 2. Any more suggestions, how to do the whole thing better?

If you have only two levels it does not matter much but it is probably
more performat to check if the parent of a node is the rootnode or not.
GetNodeLevel counts the level each time.

procedure TForm1.VirtualStringTree1DragAllowed(Sender: TBaseVirtualTree;
Node: PVirtualNode; Column: Integer; var Allowed: Boolean);
begin
Allowed := (Node.Parent <> Sender.RootNode);
end;

procedure TForm1.VirtualStringTree1DragOver(Sender: TBaseVirtualTree;
Source: TObject; Shift: TShiftState; State: TDragState; Pt: TPoint;
Mode: TDropMode; var Effect: Integer; var Accept: Boolean);
begin
Accept := (Sender = Source) and (Sender.DropTargetNode.Parent <>
Sender.RootNode)
and (Mode in [dmAbove, dmBelow]);
end;

You may also want to check if the Effect is DROPEFFECT_MOVE or DROPEFFECT_COPY
or completely switch off what you don't need in DragOperations.

Werner

 | Replies | Author | Date
3235 | Re: DAD-questions from a beginner | Mike Lischke | Mon 7/23/2001
3238 | MFE and Use | Wim van der Vegt | Tue 7/24/2001
3239 | Re: MFE and Use | Wim van der Vegt | Tue 7/24/2001
3269 | Re: MFE and Use | Mike Lischke | Sat 7/28/2001
3243 | Re: DAD-questions from a beginner | Michael Valentiner=Branth | Wed 7/25/2001
3252 | Re[2]: [VirtualTreeview] DAD-questions from a beg | [ls@t...] | Wed 7/25/2001


re: Re: OLE drag and drop again

From: Werner Lehmann [wl@b...]
Date: Mon Jul 23, 2001 8:30 am
Subject: Re: [VirtualTreeview] Re: OLE drag and drop again

Hi Jim,

> the shell is supplying the IDataObjects already SetData aware. I
> think I understand how it works now, and it is not straightforward.
> if it were not for an example by MS it would not be obvious at all.
> There are a number of little "gotcha's".

Are you talking about any other gotchas or example than provided on
the msdn page that you gave me? How about another link? :)

> Hum, apparently I am getting lucky right now. Since the shell uses
> the opimized moves the effect is alway DROPEFFECT_NONE and VT does
> nothing. Apparently after the last D&D redesign in VT I forgot this
> bit. What I did was override the DoDragDrop method of VT which is
> directly called by the interface function in the DragManager object.
> The last line before it returns (after inherited) was to return
> DROPEFFECT_NONE so this is what was returned to ActiveX.DoDragDrop.

:)

> > I might be able to put this together but I'd like to wait for a
> comment from
> > Mike. Of course I would not mind if he did it himself... :)
>
> >From the lack of response my guess is that Mike is sick of talking
> about OLE Drag and Drop <g>. I know Mike did his best to make is
> easy to implement but unfortunately to use it to its fullest extent
> it is really necessary to be able to take control of everything that
> is passed and returned from the COM interfaces.

I don't know what else is lurking there with missing interface
implementations. But the optimized move should make it in (because
I need it right now :). I can only offer to try it myself. But it's
not urgent, it's more to completely allow to drag files from VT to
the explorer without limiting to copy. Although completely is relative
since I have yet to find out how right drag context menus work and
implement it if it's not too much work. I am using this more or less
as a learning experience for OLE DAD.

And I am quite happy with OnGetUserClipboardFormat and RenderOLEData.
I believe Mike has done a good job here so why stop so short before
the goal is reached. Supporting SetData for this reason does not sound
so complicated to implement. But we need some common ground on how
to name the event and which parameters it should have.

Oh, and I can imagine that Mike is sick of the whole VT development at
times (after so long time) or his RL came 'in the way' :)

Werner

 | Replies | Author | Date
3234 | Re: OLE drag and drop again | Jim Kueneman | Mon 7/23/2001


re: Data-aware VST

From: "Moritz Franckenstein" [franckenstein@a...]
Date: Mon Jul 23, 2001 11:14 am
Subject: Re: Data-aware VST

> The requirement of having the number of root nodes available alone
is
> enough to put me off since this will require additional step to
call
> (select count(*) from table where parentkey is null) in a TQuery or
> something.
>
> Just as a side note, I'm a fairly experienced Delphi developer,
> so I have to say that VT represent the biggest challenge so far
> in my 3+ years in Delphi...:)
>
> Maybe the problem is I don't understand how the initialization
sequence
> works. I'll be grateful if anyone would take the time to explain
this
> or send me someplace where I can learn more about this.

maybe it helps if you look through the source of my xmltree component:
http://groups.yahoo.com/group/VirtualTreeview_de/files/XMLTreeTest.zip

i have solved some things in a non-standard way so that i did not
need the rootnodecount and related things.
this is a little bit against what mike wanted us to do with vt, but i
think it is not very bad :) it is still virtual and fast and
initializes nodes as last as possible.

-moritz


re: Bands and coloring the background

From: "Moritz Franckenstein" [franckenstein@a...]
Date: Mon Jul 23, 2001 11:23 am
Subject: Re: Bands and coloring the background

> --- In [VirtualTreeview@y...], "Wim van der Vegt" [wvd_vegt@k...]
wrote:
>
> > So any way of determining where a band of a certain level starts?
>
> i have just asked the same question in the german group. and i have
> also a working solution. please take a look into the current
version
> of my xmltree component:

http://groups.yahoo.com/group/VirtualTreeview_de/files/XMLTreeTest.zip

the solution of this has now been corrected to non-pfusch way. thanks
to mike for his hint...

btw: "pfusch" is one of the first german words a developer learns in
our company *g*, hmm... dont know how to explain it... leo dict says:

to bungle
bricolage
flub
botch


NodeHeight & DefaultNodeHeight

From: [SimonMoscrop@H...]
Date: Mon Jul 23, 2001 2:10 pm
Subject: NodeHeight & DefaultNodeHeight

Hiya,

I'm having a little difficulty with getting nodes to resize correctly
when the parent font is changed.

I have an MDI app which has been set up so that when the parent font
(the one for the MDI Main canvas) is changed all sub forms & controls
have their font changed to be this property. However, when i try to
resize the nodes in the VirtualString tree all existing nodes get
resized - but any new nodes added have a different node size.

I am calling the following procedures on CM_FONTCHANGE and on
form_load.

//--------------------------------------------------------------------
--------//
procedure TfrmPPADimensions.SetupNodeSizes(Tree : TVirtualStringTree);
begin
Tree.BeginUpdate;
Tree.DefaultNodeHeight := Canvas.TextHeight('O') +
(Canvas.TextHeight('O') div 2);
Tree.IterateSubtree(nil,SetNodeHeightIterator,nil,[],false,false);
Tree.EndUpdate;
end;
//--------------------------------------------------------------------
--------//
procedure TfrmPPADimensions.SetNodeHeightIterator(Sender:
TBaseVirtualTree; Node: PVirtualNode; Data: Pointer; var Abort:
Boolean);
begin
Sender.NodeHeight[Node] := Canvas.TextHeight('O') +
(Canvas.TextHeight('O') div 2);
Sender.InvalidateNode(Node);
end;

It may be that I am doing something wildy wrong (i know the way i am
measuring nodes is a bit dodgy :( ) Have you any suggestions?

Cheers in advance
- Simon Moscrop


Node Height & Default Node Height. (ignore previous message)

From: [SimonMoscrop@H...]
Date: Mon Jul 23, 2001 2:26 pm
Subject: Node Height & Default Node Height. (ignore previous message)

Sorry,

The last problem that i reported i have found to be fixed. I got
version 2.5.9 , removed the '+ canvas.textheight('O') div 2' from the
end of the lines setting the new text height + tested evertything ok.

Cheerz


re: OLE drag and drop again

From: "Jim Kueneman" [jimdk@m...]
Date: Mon Jul 23, 2001 3:51 pm
Subject: Re: OLE drag and drop again

--- In [VirtualTreeview@y...], Werner Lehmann [wl@b...] wrote:
> Are you talking about any other gotchas or example than provided on
> the msdn page that you gave me? How about another link? :)

Search for Raymond Chen IDragSourceHelper article on MSDN. It
implements SetData.

Jim


re: DAD-questions from a beginner

From: "Mike Lischke" [lists@l...]
Date: Mon Jul 23, 2001 6:45 pm
Subject: RE: [VirtualTreeview] DAD-questions from a beginner

> Is that code even called? You have to set dragmode to dmManual. And not call
> BeginDrag in MouseDown (as I understand is the usual VCL style, Mike?).

Yep :o]

Ciao, Mike

 | Replies | Author | Date
3238 | MFE and Use | Wim van der Vegt | Tue 7/24/2001
3239 | Re: MFE and Use | Wim van der Vegt | Tue 7/24/2001
3269 | Re: MFE and Use | Mike Lischke | Sat 7/28/2001


re: Focused node and parent node collapsing

From: [adembaba@e...]
Date: Mon Jul 23, 2001 7:28 pm
Subject: Re: Focused node and parent node collapsing

Hi,

I have to rekindle this thread to say that the kind of
behavior that Werner is talking about should be made
default, iMHO.

I can not see or even imagine how it makes sense to
have a focused node to be invisible. This goes against
every thing Windows stands for; i.e. you can not set
focus to an nvisible control --not even to a visible
control that resides in a TabSheet that is not the
active page on a PageControl... To me this is the best
analogy I can offer to make the point clearer.

So, Mike, could you please re-consider your decision
on this.

Cheers,
Adem

> > > Before I implement that myself and outside of the component I'd
like to ask you 'officially' :)
> > > to include some code like the one below from Jim. AFAIK you
have not said anything about
> > > this topic yet.
> >
> > Please insert it inofficially in your own application/component.
Not everybody likes so many
> > automatisms which have sometimes serious side effects.
>
> Ok, if you see sense in the current behaviour I will do that and do
not ask again.
>
> Werner


Someone has experiences with printing?

From: "Frank van den Bergh" [frankvdbergh@y...]
Date: Tue Jul 24, 2001 12:06 pm
Subject: Someone has experiences with printing?

Hi Forum members,

I want to print a tree with many columns (more than one page).
Someone tried before or can give me hints regarding Printing (and
Preview)? I was thinking about the same technique Jan Verhoeven uses
with StringGrids (TjvGridPrinter - see
http://members.xoom.com/JanVee/freewre.htm).

Thanks in advance,

Frank.

 | Replies | Author | Date
3240 | Re: Someone has experiences with printing? | Werner Lehmann | Tue 7/24/2001
3242 | More on data aware stuffs (long). | sugi | Wed 7/25/2001
3244 | Re: More on data aware stuffs (long). | Jim Kueneman | Wed 7/25/2001
3245 | Re: Someone has experiences with printing? | Frank van den Bergh | Wed 7/25/2001
3251 | Re: Someone has experiences with printing? | Werner Lehmann | Wed 7/25/2001
3254 | Re: Someone has experiences with printing? | [zh66w6@h...] | Wed 7/25/2001
3255 | Re: Someone has experiences with printing? | [mathias.thorell@s...] | Wed 7/25/2001
3256 | Re: Someone has experiences with printing? | Roland | Wed 7/25/2001
3257 | Re: Someone has experiences with printing? | [mathias.thorell@s...] | Wed 7/25/2001


MFE and Use

From: "Wim van der Vegt" [wvd_vegt@k...]
Date: Tue Jul 24, 2001 11:58 am
Subject: MFE and Use

Hi Mike,

A bit off-topic but.... I just started working on extending the VSTedit
sample with you USE editor and found some interesting 'bugs' :

1. When the USE control is very small (like a bit below the lineheight) you
get a divide by zero because Linesinwindow becomes zero.
2. When i set the color of USE to clInfoBlk (the nice soft yellow one) the
window displays a black background and a black window.
3. I miss an option to force trailing lf's to be trimmed. If you edit a line
without crlf's it's always changed by the editor.
4. I miss an option to allow enter (ie crlf's) to be entered in the text.

For the rest the editor seems to be working.

Wim van der Vegt

[Non-text portions of this message have been removed]

 | Replies | Author | Date
3239 | Re: MFE and Use | Wim van der Vegt | Tue 7/24/2001
3269 | Re: MFE and Use | Mike Lischke | Sat 7/28/2001


re: MFE and Use

From: "Wim van der Vegt" [wvd_vegt@k...]
Date: Tue Jul 24, 2001 2:48 pm
Subject: RE: [VirtualTreeview] MFE and Use

Hi Mike,

I traced the problems i have back to the following code :

procedure TWideStringList.Clear;

begin
if FCount <> 0 then
begin
Changing;
// this will automatically finalize the array
FList := nil;
FCount := 0;
SetCapacity(0);
Changed;
end;
end;

procedure TWideStringList.SetCapacity(NewCapacity: Integer);

begin
SetLength(FList, NewCapacity);
end;

What i think is wrong is that SetCapacity is called after FList is set to
nil So SetLength is called with an invalid list.
Problem however is that swapping the statements doesn't cure it.

My problem happens when i assign a shorter text to the SyntaxEditor than the
one already present.

Wim van der Vegt
-----Original Message-----
From:
[sentto-2425673-3239-995978295-wvd_vegt=knoware.nl@r...]
[mailto:[sentto-2425673-3239-995978295-wvd_vegt=knoware.nl@r...]
m]On Behalf Of Wim van der Vegt
Sent: dinsdag 24 juli 2001 13:58
To: VirtualTreeview@yahoogroups.com
Subject: [VirtualTreeview] MFE and Use

Hi Mike,

A bit off-topic but.... I just started working on extending the VSTedit
sample with you USE editor and found some interesting 'bugs' :

1. When the USE control is very small (like a bit below the lineheight)
you
get a divide by zero because Linesinwindow becomes zero.
2. When i set the color of USE to clInfoBlk (the nice soft yellow one) the
window displays a black background and a black window.
3. I miss an option to force trailing lf's to be trimmed. If you edit a
line
without crlf's it's always changed by the editor.
4. I miss an option to allow enter (ie crlf's) to be entered in the text.

For the rest the editor seems to be working.

Wim van der Vegt

[Non-text portions of this message have been removed]

Yahoo! Groups Sponsor

To unsubscribe from this group, send an email to:
VirtualTreeview-unsubscribe@egroups.com

Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.

[Non-text portions of this message have been removed]


re: Someone has experiences with printing?

From: Werner Lehmann [wl@b...]
Date: Tue Jul 24, 2001 5:45 pm
Subject: Re: [VirtualTreeview] Someone has experiences with printing?

Frank van den Bergh wrote:
>
> I want to print a tree with many columns (more than one page).
> Someone tried before or can give me hints regarding Printing (and
> Preview)? I was thinking about the same technique Jan Verhoeven uses
> with StringGrids (TjvGridPrinter - see
> http://members.xoom.com/JanVee/freewre.htm).

That site gives a 'warez404'.

If the columns do not fit on a portrait page you can try landscape. If
that still is not wide enough you can only omit or resize columns, or
print each node in several lines. With that approach you have to do the
printing manually, of course, and cannot use the print image that VT
offers (PaintTo).

Regards,
Werner

 | Replies | Author | Date
3242 | More on data aware stuffs (long). | sugi | Wed 7/25/2001
3244 | Re: More on data aware stuffs (long). | Jim Kueneman | Wed 7/25/2001
3245 | Re: Someone has experiences with printing? | Frank van den Bergh | Wed 7/25/2001


toAutoSpanColumns

From: Werner Lehmann [wl@b...]
Date: Tue Jul 24, 2001 10:12 pm
Subject: toAutoSpanColumns

Hi Mike,

I have found a problem with col spanning, and I hope you don't say 'by design'
now. In a
certain my nodes did not respond over the whole text length on mouse clicks.
First I thought
that it is due to an incorrect node width cache value but it turned out that
the click has
no effect (=no selection) if it occurs within the column after the maincolumn
when the node
text has 'spanned' into this column. I have no header visible in this tree and
it is absolutely
not obvious to users (let alone me) why this would be the case.

I am afraid that fixing this will/would complicate things considerably.

Regards,
Werner

 | Replies | Author | Date
3270 | Re: toAutoSpanColumns | Mike Lischke | Sat 7/28/2001


More on data aware stuffs (long).

From: "sugi" [slim@c...]
Date: Wed Jul 25, 2001 1:39 am
Subject: More on data aware stuffs (long).

Dear all,

Please bear with me, since this is a long posting. I'm sorry for this,
but since I received no response earlier, I'm trying to make myself
clear enough, hence the excessive wordings...:)

There were a couple of postings talking about the 'virtual paradigm'
in the archives, which, if I got it right, is about VT acting as
a 'view' only, so it does not have to bother about what data to
display.

I've been giving it a lot of thought lately, and I can't help feeling
that something is missing in this picture. (Note that I'm fairly new
to VT, and can't even get OnInitNode() event working yet...:[ See
the other post by me...:).

In my project, for example, where I'd need to display database records
(self referencing) in VT, I'm having a lot of difficulties (again,
please see my other post), since I don't really have much idea on
what is the best course to 'adapt' VT in my applications. In my initial
test app, I was a bit uncomfortable to see the myriads of event handlers
peppered all over the place (especially OnGetText(); see below).

The first thing that came to mind, is to turn VT into a DBVT, and it
worked for a while, with its own whole bag of snakes..>:). The problem
of my simple adaption is emphasized by the recent thread about OnGetText
being called a lot of times (number of visible nodes * columns). The
(unsaid) implication is (i think) that simple conversion of VT to a
DBVT is not practical.

This is a bit disappointing, since the "Little Code Repository" actually
suggested an approach using TBookmark to 'wire' VT to a TDataset. In my
test data (100+ records), things were fine, but all those bookmark
operations everytime OnGetText() is called will be expensive.

So the million-dollar question is now, how are we supposed to do this?

On the other hand, I'd think that the problem is in the 'virtual paradigm'
itself, where VT is nothing but a 'view', so OnGetText() is a necessary
evil...:(

The next thing that came to mind is to write a Controller/Adapter class to
'adapt' VT to different 'models' (not really MVC, but close enough). I think
it would be very nice if I could connect VT to this controller, and then
connect the controller to a model (a database table, a text file, a string
list, whatever), specify a couple of paramaters (node id, parent node id, etc),
and we're ready to go, without having to code custom event handlers again.
Frankly, I'm a bit tired to write "nodedata:=sender.getnodedata(node);" all
over the place...:)

The controller classes is the 'classic' approach. We can always do something
fancier by using interfaces (something like INodeData and INodeDataCollection),
but this will require that VT (or a derivative: TInterfacedVT anyone?) 'knows'
and 'uses' these interfaces, which I'm sure is not really in Mike's priority
list of implementation.

Has anyone wrote anything like this before? I'd like to know your opinions,
before I commit the time to write it down, since it is possible that I'm
getting way off the mark here...

Many thanks in advance,
Salam,
sugi.

PS: I have received no response concerning the OnInitNode() and
OnInitChildren() issue. Is this the right place to ask newbie
support question? Or is this a developer-only list?

 | Replies | Author | Date
3244 | Re: More on data aware stuffs (long). | Jim Kueneman | Wed 7/25/2001


re: DAD-questions from a beginner

From: Michael Valentiner=Branth [MichaelVB@g...]
Date: Wed Jul 25, 2001 6:41 am
Subject: Re: [VirtualTreeview] DAD-questions from a beginner

Hi Werner,

> Is that code even called?
Oh, no. How could I forget to check this?

> You have to set dragmode to dmManual.
That's it! Now it works. Thanks!

> And not call BeginDrag in MouseDown
No, I didn't.

> Use Sender.DropTargetNode.
Works, too.

> If you have only two levels it does not matter much but it is
> probably more performat to check if the parent of a node is the
> rootnode or not.
> GetNodeLevel counts the level each time.
>
> procedure TForm1.VirtualStringTree1DragAllowed(Sender:
> TBaseVirtualTree;
> Node: PVirtualNode; Column: Integer; var Allowed: Boolean);
> begin
> Allowed := (Node.Parent <> Sender.RootNode);
> end;

There are a lot of ways to get to Rome.<g>

> procedure TForm1.VirtualStringTree1DragOver(Sender: TBaseVirtualTree;
> Source: TObject; Shift: TShiftState; State: TDragState; Pt: TPoint;
> Mode: TDropMode; var Effect: Integer; var Accept: Boolean);
> begin
> Accept := (Sender = Source) and (Sender.DropTargetNode.Parent <>
> Sender.RootNode)
> and (Mode in [dmAbove, dmBelow]);
> end;

This leads to an access violation.

> You may also want to check if the Effect is DROPEFFECT_MOVE or
> DROPEFFECT_COPY
> or completely switch off what you don't need in DragOperations.

For now I only need to MOVE, and that's the only option that is set in
DragOperations.

Michael

 | Replies | Author | Date
3252 | Re[2]: [VirtualTreeview] DAD-questions from a beg | [ls@t...] | Wed 7/25/2001


re: More on data aware stuffs (long).

From: "Jim Kueneman" [jimdk@m...]
Date: Wed Jul 25, 2001 7:33 am
Subject: Re: More on data aware stuffs (long).

--- In [VirtualTreeview@y...], "sugi" [slim@c...] wrote:

> PS: I have received no response concerning the OnInitNode() and
> OnInitChildren() issue. Is this the right place to ask newbie
> support question? Or is this a developer-only list?

This is the right place sugi, I wish that I could be more help but I
am not in a postion to be of much help this week and next (no Delphi
and no way to look at the VT source code except with Notepad <g>)
Take a look at the Save-LoadTree.zip demo in the Files area, it may
help you with the OnInitNode problem.

Jim


re: Someone has experiences with printing?

From: "Frank van den Bergh" [frankvdbergh@y...]
Date: Wed Jul 25, 2001 7:48 am
Subject: Re: Someone has experiences with printing?

--- In [VirtualTreeview@y...], Werner Lehmann [wl@b...] wrote:
> Frank van den Bergh wrote:
> >
> > I want to print a tree with many columns (more than one page).
> > Someone tried before or can give me hints regarding Printing (and
> > Preview)? I was thinking about the same technique Jan Verhoeven
uses
> > with StringGrids (TjvGridPrinter - see
> > http://members.xoom.com/JanVee/freewre.htm).
>
> That site gives a 'warez404'.
>
> If the columns do not fit on a portrait page you can try landscape.
If
> that still is not wide enough you can only omit or resize columns,
or
> print each node in several lines. With that approach you have to do
the
> printing manually, of course, and cannot use the print image that VT
> offers (PaintTo).
>
> Regards,
> Werner

Hi Werner,

Thanks for your reply. Sorry about the URL (it was written in the
readme.txt). I downloaded TjvGridPrinter from
http://jansfreeware.com/. Basically it draws every cell in the
canvas, taking into account the length and width of a page. Small but
efficient component (preview is not so fast however).

I use now the ContentToRTF function; I expended it with the
possibility to "break" too wide columns into new tables (sent to
Mike). And then I print it with TRichEdit98. This has two drawbacks:
when the text is too wide for a column all next columns will be
shifted and alignment is not supported. Saving to a RTF file and
importing it via MS Word works excellent. I have tested some RichEdit
components, but none really work ok.

One solution might be to use the PaintTree procedure. Where three
extra properties have to be added: set of columns to be printed and
the starting and ending row. But I have to discuss this with Mike
first.

Your suggestion is to make certain columns temporary invisible, use
PaintTo, then the next columns, PaintTo, etcetera? Worth a try.
Printing each node into several lines? How can you do that as
multiline is not supported?

Grußen,

Frank.


VDrawTree or VStringTree?

From: [jogador3@y...]
Date: Wed Jul 25, 2001 7:51 am
Subject: VDrawTree or VStringTree?

Hi!

It´s possible to change the font properties in some nodes in a
VirtualStringTreee, or do I need to change to a VirtualDrawTree?

Thanks,

Trevis

 | Replies | Author | Date
3250 | Re: VDrawTree or VStringTree? | Werner Lehmann | Wed 7/25/2001
3253 | Re: VDrawTree or VStringTree? | [jogador3@y...] | Wed 7/25/2001


re: DAD-questions from a beginner

From: Werner Lehmann [wl@b...]
Date: Wed Jul 25, 2001 7:28 am
Subject: Re: [VirtualTreeview] DAD-questions from a beginner

Michael Valentiner=Branth wrote:
>
> > procedure TForm1.VirtualStringTree1DragOver(Sender: TBaseVirtualTree;
> > Source: TObject; Shift: TShiftState; State: TDragState; Pt: TPoint;
> > Mode: TDropMode; var Effect: Integer; var Accept: Boolean);
> > begin
> > Accept := (Sender = Source) and (Sender.DropTargetNode.Parent <>
> > Sender.RootNode)
> > and (Mode in [dmAbove, dmBelow]);
> > end;
>
> This leads to an access violation.

Hm, probably because DropTargetNode might be nil if the drag is not over a node,
needs an additional check. Was untested... :)

Werner

 | Replies | Author | Date
3264 | Re: DAD-questions from a beginner | Michael Valentiner=Branth | Thu 7/26/2001


re: Re: Data-aware VST

From: Werner Lehmann [wl@b...]
Date: Wed Jul 25, 2001 8:04 am
Subject: Re: [VirtualTreeview] Re: Data-aware VST

Hi sugi,

> To recap my situation: I was asking about the availability of a
> data-aware version of VT a couple of weeks ago. I wrote a simple
> 'read-only' data aware version of VT, because I thought it would
> be a snap...:)
>
> I (finally) succeeded to download the DBVT files (by egorushkin),
> but has been unable to install the components to my system.
> I have not downloaded the ib_vtree226.zip (by paultansit),
> but it probably wouldn't help me since it's for IBO while I'm
> using BDE and/or IBX.

I have never looked at these since I am not using IB.

> As I understand it, the proper way to initialize a treeview
> is a two-step process:
> a. Setting the RootNodeCount property to the number of root nodes.
> b. Providing the OnInitNode event handler to initialize the nodes.

And OnInitChildren.

> Frankly, this is very counter-intuitive. It's not clear (at least
> to me) what I'm supposed to do in the OnInitNode event handler? The
> sample code in the "little code repository" section didn't help
> much. I ended up with a large procedure called InitAllNodes that
> LOADS the whole table from database, create, and initialized the
> node at one go.

To be also frankly, I am not using the init events at all. With db
access it is bad to init and query one node at a time. I am init'ing
each node when I add it. If I know how many children I am about to
add and the number is more than only a few I am setting the ChildCount[]
of the parent and am init'ing the children manually when the dataset
is still available.

Loading the whole tree may be fine if it is relatively small. Otherwise
I suggest you only load a few levels on demand.

> This is the traditional way, I think, and not the way VT is supposed
> to work, but I can't figure out how to write the OnInitNode to work.
> To give you some idea, here's my TMyNodeData declaration:
> ...
> type TMyNodeData = record
> key : variant; //holds the primary key value
> parentkey : variant; //holds the foreign key value
> level : integer; //level in the tree. 0 = root
> bookmark : string; //TBookmarkStr, marker in TDataset.
> end;
> type PMyNodeData = ^TMyNodeData;
> ...

You may not know it but Variant is not exactly the performance master in
this world. Unless your key consists of anything other than an int I
would change this. And even if the primary key is not an int I would
rather consider a specialized record type than use Variant for the key.

> The requirement of having the number of root nodes available alone is
> enough to put me off since this will require additional step to call
> (select count(*) from table where parentkey is null) in a TQuery or
> something.

As I said my approach is to load the first n levels into the tree which
includes the number of root nodes.

Regards,
Werner

 | Replies | Author | Date
3259 | Re: Data-aware VST | Sugiharto Lim | Wed 7/25/2001
3260 | Re: Data-aware VST | Werner Lehmann | Thu 7/26/2001


re: More on data aware stuffs (long).

From: Werner Lehmann [wl@b...]
Date: Wed Jul 25, 2001 8:08 am
Subject: Re: [VirtualTreeview] More on data aware stuffs (long).

Hi sugi,

> There were a couple of postings talking about the 'virtual paradigm'
> in the archives, which, if I got it right, is about VT acting as
> a 'view' only, so it does not have to bother about what data to
> display.

This is also my understanding and close to the way the virtual listview
from Microsoft is working. But the initialization of nodes has no real
place in this notion of virtual so we have an extended meaning here.

> In my project, for example, where I'd need to display database records
> (self referencing) in VT, I'm having a lot of difficulties (again,
> please see my other post), since I don't really have much idea on
> what is the best course to 'adapt' VT in my applications. In my initial
> test app, I was a bit uncomfortable to see the myriads of event handlers
> peppered all over the place (especially OnGetText(); see below).

Yes, I can see your point. I have an app with 3 VTrees on one form and the
combined event handler code is not small, my guess is 1000-2000 LOC without
me counting it now.

My advice on this: put your VTree (and maybe some panel or other surrounding
controls which are tied to it) on a frame of its own. This will not remedy
the need for any of the event handlers. But it clears up things a lot and
you have still RAD, being able to add a handler with double click.

And my 2nd advice on this...

> Frankly, I'm a bit tired to write "nodedata:=sender.getnodedata(node);" all
> over the place...:)

...is to add a property to the frame which deals with the data extraction,
like so:

class
MyFrame = class (TFrame)
private
function GetLink(Node: PVirtualNode): TLink;
procedure SetLink(Node: PVirtualNode; const Value: TLink);
public
property Link[Node: PVirtualNode]: TLink read GetLink write SetLink;
end;

The implementation of getter and setter should be obvious, if not say so.
IMO this approach makes the handler code much more readable and you avoid
the GetNodeData everywhere.

> The first thing that came to mind, is to turn VT into a DBVT, and it
> worked for a while, with its own whole bag of snakes..>:). The problem
> of my simple adaption is emphasized by the recent thread about OnGetText
> being called a lot of times (number of visible nodes * columns). The
> (unsaid) implication is (i think) that simple conversion of VT to a
> DBVT is not practical.

That's why the nodes should be init'ed. Which means not only (if at all) to
tie a bookmark to its data but also to cache the node's column texts and
image indices, everything which is needed by handlers and would require DB
access.

DBs are not good at random access times. Thus maybe you should init more than
one node at a time, i.e. all children of a given node (OnInitChildren) or
even a 3 level deep subtree. The trade-off depends on your DB access times
and the structure of your tree. If it is rather deep (many nodes, few children
per node) than wide (few nodes, many children) this is probably better.

It also depends on how you get the tree structure from your table. Oracle
provides a hierarchical query command which allows you to easily extract n
levels below a given node.

> This is a bit disappointing, since the "Little Code Repository" actually
> suggested an approach using TBookmark to 'wire' VT to a TDataset. In my
> test data (100+ records), things were fine, but all those bookmark
> operations everytime OnGetText() is called will be expensive.

As I said, no massive bookmark usage, node text caching.

> On the other hand, I'd think that the problem is in the 'virtual paradigm'
> itself, where VT is nothing but a 'view', so OnGetText() is a necessary
> evil...:(

You'll get used to it and learn it to be your best friend :) The displayed
text can be anything you assemble in the gettext handler, combined strings
for instance. With a traditional approach you would have to add the strings
and store them explicitily and still keep the partial strings / ints around
if you need them. Hope you get the picture, was a little bit confusing probably.

> The next thing that came to mind is to write a Controller/Adapter class to
> 'adapt' VT to different 'models' (not really MVC, but close enough). I think
> it would be very nice if I could connect VT to this controller, and then
> connect the controller to a model (a database table, a text file, a string
> list, whatever), specify a couple of paramaters (node id, parent node id,
etc),
> and we're ready to go, without having to code custom event handlers again.
> Frankly, I'm a bit tired to write "nodedata:=sender.getnodedata(node);" all
> over the place...:)
>
> The controller classes is the 'classic' approach. We can always do something
> fancier by using interfaces (something like INodeData and
INodeDataCollection),
> but this will require that VT (or a derivative: TInterfacedVT anyone?) 'knows'
> and 'uses' these interfaces, which I'm sure is not really in Mike's priority
> list of implementation.

Well, to be honest I have done exactly this for my company. The node interfaces
are implemented by a database tree cache which can be shared by several VTrees.
But this is property of my company and I cannot give it to you.

> Has anyone wrote anything like this before? I'd like to know your opinions,
> before I commit the time to write it down, since it is possible that I'm
> getting way off the mark here...

Probably not. Hope I could shed some light on things...

> PS: I have received no response concerning the OnInitNode() and
> OnInitChildren() issue. Is this the right place to ask newbie
> support question? Or is this a developer-only list?

It is the right place. Only a little bit quiet in the last days. Mike is
probably
busy, Jim is on vacation and the others have RL's of their own (I suppose :).

Regards,
Werner

 | Replies | Author | Date
3258 | Re: More on data aware stuffs (long). | Sugiharto Lim | Wed 7/25/2001
3261 | Re: More on data aware stuffs (long). | Werner Lehmann | Thu 7/26/2001
3353 | Re: More on data aware stuffs (long). | Sugiharto Lim | Sun 8/5/2001
3363 | Re: More on data aware stuffs (long). | Werner Lehmann | Sun 8/5/2001


re: VDrawTree or VStringTree?

From: Werner Lehmann [wl@b...]
Date: Wed Jul 25, 2001 8:13 am
Subject: Re: [VirtualTreeview] VDrawTree or VStringTree?

Hi Trevis,

> It´s possible to change the font properties in some nodes in a
> VirtualStringTreee, or do I need to change to a VirtualDrawTree?

Look at OnPaintText.

Werner

 | Replies | Author | Date
3253 | Re: VDrawTree or VStringTree? | [jogador3@y...] | Wed 7/25/2001


re: Re: Someone has experiences with printing?

From: Werner Lehmann [wl@b...]
Date: Wed Jul 25, 2001 8:18 am
Subject: Re: [VirtualTreeview] Re: Someone has experiences with printing?

Hi Frank,

> Thanks for your reply. Sorry about the URL (it was written in the
> readme.txt). I downloaded TjvGridPrinter from
> http://jansfreeware.com/. Basically it draws every cell in the
> canvas, taking into account the length and width of a page. Small but
> efficient component (preview is not so fast however).

I am not sure how to understand that short from the usual way of proportionally
fit the columns on the given page width.

> I use now the ContentToRTF function; I expended it with the
> possibility to "break" too wide columns into new tables (sent to
> Mike). And then I print it with TRichEdit98. This has two drawbacks:
> when the text is too wide for a column all next columns will be
> shifted and alignment is not supported. Saving to a RTF file and
> importing it via MS Word works excellent. I have tested some RichEdit
> components, but none really work ok.

Sounds like a working solution. Although the detour via MS Word would
bother me.

> One solution might be to use the PaintTree procedure. Where three
> extra properties have to be added: set of columns to be printed and
> the starting and ending row. But I have to discuss this with Mike
> first.
>
> Your suggestion is to make certain columns temporary invisible, use
> PaintTo, then the next columns, PaintTo, etcetera? Worth a try.
> Printing each node into several lines? How can you do that as
> multiline is not supported?

No, I was assuming that you have the same columns visible which you want
to print. But hiding and showing can work. If you get flicker on the
screen because of the hide and show during printing you can try Begin/End-
Update if the tree still paints or look at WM_SETREDRAW and avoid painting
the tree while it is printing.

Several lines: as I said: manually. You're on your own with that approach.
It's not that hard but naturally more work than PainTo.

Regards,
Werner

 | Replies | Author | Date
3254 | Re: Someone has experiences with printing? | [zh66w6@h...] | Wed 7/25/2001
3255 | Re: Someone has experiences with printing? | [mathias.thorell@s...] | Wed 7/25/2001
3256 | Re: Someone has experiences with printing? | Roland | Wed 7/25/2001
3257 | Re: Someone has experiences with printing? | [mathias.thorell@s...] | Wed 7/25/2001
4636 | Re: Someone has experiences with printing? ROLAND | Frank van den Bergh | Thu 11/15/2001
4782 | Re: Someone has experiences with printing? ROLAND | Roland | Thu 11/22/2001
3272 | Re: Someone has experiences with printing? | Mike Lischke | Sat 7/28/2001
3271 | Re: Someone has experiences with printing? | Mike Lischke | Sat 7/28/2001


Re[2]: DAD-questions from a beginner

From: [ls@t...]
Date: Wed Jul 25, 2001 8:54 am
Subject: Re[2]: [VirtualTreeview] DAD-questions from a beginner

Hallo Michael,

after your posting I've tried to make your DAD-code working in my app.
But the only thing happened is that I'm not allowed doing any
DAD-operations. (I'm sure that I've set all properties right.)

Could you please send me your (complete) DAD-code (maybe with all
properties of the VST) via eMail (address below)? It would by very nice.

Regards

Lars

--------------------------------------------------
tpm taberna pro medicum
Physik und Elektronik in der Medizintechnik GmbH

Dipl.-Ing. Lars Söding
-Software Entwicklung-
eMail: [ls@t...]
--------------------------------------------------


re: VDrawTree or VStringTree?

From: [jogador3@y...]
Date: Wed Jul 25, 2001 9:31 am
Subject: Re: VDrawTree or VStringTree?

Thanks Werner!

I already did! I found in an old message how to do this.

Trevis.

--- In [VirtualTreeview@y...], Werner Lehmann [wl@b...] wrote:
> Hi Trevis,
>
> > It´s possible to change the font properties in some nodes in a
> > VirtualStringTreee, or do I need to change to a VirtualDrawTree?
>
> Look at OnPaintText.
>
> Werner


re: Someone has experiences with printing?

From: [zh66w6@h...]
Date: Wed Jul 25, 2001 1:02 pm
Subject: Re: Someone has experiences with printing?

When I try to use PaintTo to print the tree, I end up with a postage
stamp size printout of what is currently displayed in the tree (i.e.
not the whole tree) minus header. How do I print the whole tree
(including header) and zoom in to a reasonable size? Anybody got any
source code?

Cheers,
Paul

--- In [VirtualTreeview@y...], Werner Lehmann [wl@b...] wrote:
> Hi Frank,
>
> > Thanks for your reply. Sorry about the URL (it was written in the
> > readme.txt). I downloaded TjvGridPrinter from
> > http://jansfreeware.com/. Basically it draws every cell in the
> > canvas, taking into account the length and width of a page. Small
but
> > efficient component (preview is not so fast however).
>
> I am not sure how to understand that short from the usual way of
proportionally
> fit the columns on the given page width.
>
> > I use now the ContentToRTF function; I expended it with the
> > possibility to "break" too wide columns into new tables (sent to
> > Mike). And then I print it with TRichEdit98. This has two
drawbacks:
> > when the text is too wide for a column all next columns will be
> > shifted and alignment is not supported. Saving to a RTF file and
> > importing it via MS Word works excellent. I have tested some
RichEdit
> > components, but none really work ok.
>
> Sounds like a working solution. Although the detour via MS Word
would
> bother me.
>
> > One solution might be to use the PaintTree procedure. Where three
> > extra properties have to be added: set of columns to be printed
and
> > the starting and ending row. But I have to discuss this with Mike
> > first.
> >
> > Your suggestion is to make certain columns temporary invisible,
use
> > PaintTo, then the next columns, PaintTo, etcetera? Worth a try.
> > Printing each node into several lines? How can you do that as
> > multiline is not supported?
>
> No, I was assuming that you have the same columns visible which you
want
> to print. But hiding and showing can work. If you get flicker on
the
> screen because of the hide and show during printing you can try
Begin/End-
> Update if the tree still paints or look at WM_SETREDRAW and avoid
painting
> the tree while it is printing.
>
> Several lines: as I said: manually. You're on your own with that
approach.
> It's not that hard but naturally more work than PainTo.
>
> Regards,
> Werner

 | Replies | Author | Date
3255 | Re: Someone has experiences with printing? | [mathias.thorell@s...] | Wed 7/25/2001
3256 | Re: Someone has experiences with printing? | Roland | Wed 7/25/2001
3257 | Re: Someone has experiences with printing? | [mathias.thorell@s...] | Wed 7/25/2001
4636 | Re: Someone has experiences with printing? ROLAND | Frank van den Bergh | Thu 11/15/2001
4782 | Re: Someone has experiences with printing? ROLAND | Roland | Thu 11/22/2001
3272 | Re: Someone has experiences with printing? | Mike Lischke | Sat 7/28/2001
3271 | Re: Someone has experiences with printing? | Mike Lischke | Sat 7/28/2001


re: Someone has experiences with printing?

From: [mathias.thorell@s...]
Date: Wed Jul 25, 2001 1:56 pm
Subject: Re: Someone has experiences with printing?

--- In [VirtualTreeview@y...], [zh66w6@h...] wrote:
> When I try to use PaintTo to print the tree, I end up with a postage
> stamp size printout of what is currently displayed in the tree (i.e.
> not the whole tree) minus header. How do I print the whole tree
> (including header) and zoom in to a reasonable size? Anybody got any
> source code?

I'v ebeen struggling with this as well, but last week I came up with
(an acceptable solution) in BCB...
(I'm currently using VT v 2.4.23)
It's not beautiful at all, but it works and I was in a real hurry to
release my project...
I supports multiple pages, put if the tree is wider than the page, the
rightmost parts will be discarded (not printed) :

1: I had to make the Color property and the PaintTree() public in the
sourcecode of VT.

2: I created an external method, PrintVT(TVirtualStringTree
*tree,TPrinter *Prt)

3: Here, I basically use PaintTree() to draw the complete tree (not
just the visible part) to a temporary TBitmap.
Then I copy "pages" from the bitmap to another, temporary bitmap, and
StretchDraw this to the Printer Canvas. (Not using th
TCanvas->StretchDraw though since it's extremly buggy for printers.
I'm using Rober Dunns' implementation instead).

That's about it, if someone is interested, I can post the source code
to this group (it's about 290 lines of code...)

/Mathias

 | Replies | Author | Date
3256 | Re: Someone has experiences with printing? | Roland | Wed 7/25/2001
3257 | Re: Someone has experiences with printing? | [mathias.thorell@s...] | Wed 7/25/2001
4636 | Re: Someone has experiences with printing? ROLAND | Frank van den Bergh | Thu 11/15/2001
4782 | Re: Someone has experiences with printing? ROLAND | Roland | Thu 11/22/2001
3272 | Re: Someone has experiences with printing? | Mike Lischke | Sat 7/28/2001


re: Someone has experiences with printing?

From: "Roland" [Beduerftig@S...]
Date: Wed Jul 25, 2001 3:13 pm
Subject: Re: Someone has experiences with printing?

> (an acceptable solution) in BCB...
> (I'm currently using VT v 2.4.23)
.....
> That's about it, if someone is interested, I can post the source
> code to this group (it's about 290 lines of code...)
>
> /Mathias

Hi Mathias,

it sounds interest, I released also my project, but in the next step
I can try to implement such a feature.

When you copy the code in files area, I can translate it from BCB to
delphi.

with best regards
Roland

 | Replies | Author | Date
3257 | Re: Someone has experiences with printing? | [mathias.thorell@s...] | Wed 7/25/2001
4636 | Re: Someone has experiences with printing? ROLAND | Frank van den Bergh | Thu 11/15/2001
4782 | Re: Someone has experiences with printing? ROLAND | Roland | Thu 11/22/2001


re: Someone has experiences with printing?

From: [mathias.thorell@s...]
Date: Wed Jul 25, 2001 4:38 pm
Subject: Re: Someone has experiences with printing?

--- In [VirtualTreeview@y...], "Roland" [Beduerftig@S...] wrote:
> Hi Mathias,
>
> it sounds interest, I released also my project, but in the next step
> I can try to implement such a feature.
>
> When you copy the code in files area, I can translate it from BCB to
> delphi.

Ok, now it's there PrtVTree.zip.

Hope you enjoy it... :-)

/Mathias


re: More on data aware stuffs (long).

From: "Sugiharto Lim" [slim@c...]
Date: Wed Jul 25, 2001 10:47 pm
Subject: RE: [VirtualTreeview] More on data aware stuffs (long).

Hi Werner,

> Yes, I can see your point. I have an app with 3 VTrees on one form and the
> combined event handler code is not small, my guess is 1000-2000
> LOC without me counting it now.
Ouch...:) If you don't mind me asking, what constitutes the bulk of the
event handler code ? (User-interface related code?, Persistence?, ?).

> My advice on this: put your VTree (and maybe some panel or other
> surrounding
> controls which are tied to it) on a frame of its own. This will not remedy
> the need for any of the event handlers. But it clears up things a lot and
> you have still RAD, being able to add a handler with double click.
Point taken. Thank you.

> The implementation of getter and setter should be obvious, if not say so.
> IMO this approach makes the handler code much more readable and you avoid
> the GetNodeData everywhere.
Excellent suggestion. I understand the merits of wrapping the GetNodeData
into a property, but could you tell me more about TLink ???, I don't know
what a TLink was and couldn't find any references in both Delphi and VT
docs.

> That's why the nodes should be init'ed. Which means not only (if
> at all) to tie a bookmark to its data but also to cache the node's
> column texts and image indices, everything which is needed by handlers
> and would require DB access.
I have another idea, although I won't know how feasible this is. Maybe
we can use a TClientDataSet as the base dataset class, since all data
in the CDS is cached into RAM locally. This *might* make the concerns
about OnGetText() performance obsolete. What do you think? Maybe I ought
to do some benchmarking on this.

> It also depends on how you get the tree structure from your table. Oracle
> provides a hierarchical query command which allows you to easily extract n
> levels below a given node.
This is interesting. Here's the code that I came up with, although maybe not
very efficient performance-wise. Right now I had to process the records in
two pass:

...
//3. Create Nodes
bookmark := dataset.Bookmark;
dataset.First;
while dataset.eof = false do begin
node := tree.AddChild(nil);

nodedata := tree.GetNodeData(node);
nodedata^.key := dataset[FKeyFieldName];
nodedata^.parentkey := dataset[FParentFieldName];
nodedata^.bookmark := dataset.bookmark;

nodelist.Add(node); //save reference to a temporary list

dataset.next;
end;
dataset.Bookmark := bookmark;

//4. Rearrange nodes
for i := 0 to nodelist.count-1 do begin
node := nodelist.Items[i];
nodedata := tree.GetNodeData(node);
if nodedata^.parentkey = null then continue;
//find parent of this node
for j := 0 to nodelist.count-1 do begin
ParentNode := nodelist.Items[j];
ParentNodeData := tree.GetNodeData(ParentNode);
if (nodedata^.parentkey) = (ParentNodeData^.key) then begin
//found parent, rearrange, break
tree.MoveTo(node, parentNode, amAddChildLast, False);
break;
end;
end;
//
end;
...
The first pass loads all the records as root nodes, to avoid re-queries.
The second pass 'rearrange' the nodes to their rightful places...:)
The real-world version will probably need a lot more stuffs inside
(circular references checking, orphaned nodes checking, etc). I'm
wondering whether someone can show me a better way to do this. Thanks.

> Well, to be honest I have done exactly this for my company. The
> node interfaces
> are implemented by a database tree cache which can be shared by
> several VTrees.
> But this is property of my company and I cannot give it to you.
That is perfectly fine. It's good to know that someone had went
this path before me, so at least I know that I'm in the right
direction. I hope I can find the e-mail address of the person(s)
implementing DBVT, since he/she/they probably had a lot of things
to share. Is the person on the list?

> Probably not. Hope I could shed some light on things...
You definitely did. And I hope you will again...:)

Many Thanks,
Salam,
sugi.


re: Re: Data-aware VST

From: "Sugiharto Lim" [slim@c...]
Date: Wed Jul 25, 2001 10:47 pm
Subject: RE: [VirtualTreeview] Re: Data-aware VST

> Hi sugi,
Hi Werner,
many thanks for taking the time to answer.

> I have never looked at these since I am not using IB.
I think since D3 borland has made the TDataset class as the lowest
common denominator of all database access. I'm a bit surprised
that the component I was talking about is for IBO only. I'm sure
there are good reasons why this is so....:)

> > As I understand it, the proper way to initialize a treeview
> > is a two-step process:
> > a. Setting the RootNodeCount property to the number of root nodes.
> > b. Providing the OnInitNode event handler to initialize the nodes.
> And OnInitChildren.
Yes, and just as confusing...:)

> Loading the whole tree may be fine if it is relatively small. Otherwise
> I suggest you only load a few levels on demand.
Can you give me a ballpark figure on what can be considered as 'small' ?
My current table is about machine parts hierarchy structure, so it's
probably will be maxed at around 500 records. The next project, however,
is an inventory database, and I believe the client has around 14.000 items
on their inventory list right now. This is going to be a problem...:(

> You may not know it but Variant is not exactly the performance master in
> this world. Unless your key consists of anything other than an int I
> would change this. And even if the primary key is not an int I would
> rather consider a specialized record type than use Variant for the key.
Thank you for pointing it out. I know that Variant is no speed demon, but
I was trying to tie VT to a generic database table, so I chose Variants,
because there's no telling what the primary key's data type would be. This
is the approach used by Delphi (since D3), in the TDataSet.FieldValues[]
property. It's better in some ways (albeit the performance penalty) because
we can properly handle NULLs instead of typecasting it into zero (in case
of numeric data) or empty string (in case of character data).

> > The requirement of having the number of root nodes available alone is
> > enough to put me off since this will require additional step to call
> > (select count(*) from table where parentkey is null) in a TQuery or
> > something.
> As I said my approach is to load the first n levels into the tree which
> includes the number of root nodes.
I understand, but Where/when/how do you load the additional levels?

TIA,
salam,
sugi.


re: Re: Data-aware VST

From: Werner Lehmann [wl@b...]
Date: Thu Jul 26, 2001 8:33 am
Subject: Re: [VirtualTreeview] Re: Data-aware VST

Hi Sugi,

> > I have never looked at these since I am not using IB.
> I think since D3 borland has made the TDataset class as the lowest
> common denominator of all database access. I'm a bit surprised
> that the component I was talking about is for IBO only. I'm sure
> there are good reasons why this is so....:)

Probably :)

> > > As I understand it, the proper way to initialize a treeview
> > > is a two-step process:
> > > a. Setting the RootNodeCount property to the number of root nodes.
> > > b. Providing the OnInitNode event handler to initialize the nodes.
> > And OnInitChildren.
> Yes, and just as confusing...:)

Why? You just say how many children a node really has when it has been init'ed
with HasChildren but not actual children at that time.

> > Loading the whole tree may be fine if it is relatively small. Otherwise
> > I suggest you only load a few levels on demand.
> Can you give me a ballpark figure on what can be considered as 'small' ?

Well, IMO 'small' is everything which will be processed on your or your users
machines in acceptable or less time. I have no idea how fast the DB server is
(not even if c/s or desktop db) and how many concurrent users are accessing it.

> My current table is about machine parts hierarchy structure, so it's
> probably will be maxed at around 500 records. The next project, however,
> is an inventory database, and I believe the client has around 14.000 items
> on their inventory list right now. This is going to be a problem...:(

500 should definitely be small. 14000 not so. But if you load only the first
2-3 levels and that keeps the loaded nodes in small figures it'll be fine.

> > You may not know it but Variant is not exactly the performance master in
> > this world. Unless your key consists of anything other than an int I
> > would change this. And even if the primary key is not an int I would
> > rather consider a specialized record type than use Variant for the key.
> Thank you for pointing it out. I know that Variant is no speed demon, but
> I was trying to tie VT to a generic database table, so I chose Variants,
> because there's no telling what the primary key's data type would be. This
> is the approach used by Delphi (since D3), in the TDataSet.FieldValues[]
> property. It's better in some ways (albeit the performance penalty) because
> we can properly handle NULLs instead of typecasting it into zero (in case
> of numeric data) or empty string (in case of character data).

Ok then. I am mapping NULL values to (int) -1 and avoid the performance
penalty. And primary keys (especially in tree tables) are always ints.

> > > The requirement of having the number of root nodes available alone is
> > > enough to put me off since this will require additional step to call
> > > (select count(*) from table where parentkey is null) in a TQuery or
> > > something.
> > As I said my approach is to load the first n levels into the tree which
> > includes the number of root nodes.
> I understand, but Where/when/how do you load the additional levels?

When they are needed. In OnExpanding for instance. You check if the node
has vsHasChildren flag set in its states (or vis HasChildren[]) but the
childcount is 0:

OnExpanding:
if Sender.HasChildren[Node] and (Node.ChildCount = 0) then
begin
// Fetch next 2-3 levels below Node from DB.
end;

The 'right' way would be OnInitNode, OnInitChildren but as discussed earlier
this is problematic with DBs when we want to avoid masses of Locate()'s or
redundant queries or bookmarks.

Werner


re: More on data aware stuffs (long).

From: Werner Lehmann [wl@b...]
Date: Thu Jul 26, 2001 9:01 am
Subject: Re: [VirtualTreeview] More on data aware stuffs (long).

Hi Sugi,

> > Yes, I can see your point. I have an app with 3 VTrees on one form and the
> > combined event handler code is not small, my guess is 1000-2000
> > LOC without me counting it now.
> Ouch...:) If you don't mind me asking, what constitutes the bulk of the
> event handler code ? (User-interface related code?, Persistence?, ?).

Hm, I guess I had better be counting before. Now I did and it turned out that
the three trees are needing ~70, ~280 and ~515 LOC (total of 865 LOC). That
is only the implementation part. The 'big' tree uses no less than 27 events,
the 'small' tree is at 7 events but you may not need them all.

The number of events is intimidating at first but I see them as opportunity.
Most of them (all but OnGetText?) are optional as usual with events.

> > The implementation of getter and setter should be obvious, if not say so.
> > IMO this approach makes the handler code much more readable and you avoid
> > the GetNodeData everywhere.
> Excellent suggestion. I understand the merits of wrapping the GetNodeData
> into a property, but could you tell me more about TLink ???, I don't know
> what a TLink was and couldn't find any references in both Delphi and VT
> docs.

TLink is a data class of my own. I am not using records but am storing object
references in the node data. Here is a shortened example:

TLink = class
public
property ImageIndex: Integer read GetImageIndex;
property Node: PVirtualNode read FNode write SetNode;
property NodeText: string read GetNodeText;
end;

> > That's why the nodes should be init'ed. Which means not only (if
> > at all) to tie a bookmark to its data but also to cache the node's
> > column texts and image indices, everything which is needed by handlers
> > and would require DB access.
> I have another idea, although I won't know how feasible this is. Maybe
> we can use a TClientDataSet as the base dataset class, since all data
> in the CDS is cached into RAM locally. This *might* make the concerns
> about OnGetText() performance obsolete. What do you think? Maybe I ought
> to do some benchmarking on this.

Probably. I have no experiences with CDS, unfortunately. Maybe its already
fast enough.

> > It also depends on how you get the tree structure from your table. Oracle
> > provides a hierarchical query command which allows you to easily extract n
> > levels below a given node.
> This is interesting. Here's the code that I came up with, although maybe not
> very efficient performance-wise. Right now I had to process the records in
> two pass:
>
> ...
> //3. Create Nodes
> bookmark := dataset.Bookmark;
> dataset.First;
> while dataset.eof = false do begin
> node := tree.AddChild(nil);
>
> nodedata := tree.GetNodeData(node);
> nodedata^.key := dataset[FKeyFieldName];
> nodedata^.parentkey := dataset[FParentFieldName];
> nodedata^.bookmark := dataset.bookmark;
>
> nodelist.Add(node); //save reference to a temporary list
>
> dataset.next;
> end;
> dataset.Bookmark := bookmark;
>
> //4. Rearrange nodes
> for i := 0 to nodelist.count-1 do begin
> node := nodelist.Items[i];
> nodedata := tree.GetNodeData(node);
> if nodedata^.parentkey = null then continue;
> //find parent of this node
> for j := 0 to nodelist.count-1 do begin
> ParentNode := nodelist.Items[j];
> ParentNodeData := tree.GetNodeData(ParentNode);
> if (nodedata^.parentkey) = (ParentNodeData^.key) then begin
> //found parent, rearrange, break
> tree.MoveTo(node, parentNode, amAddChildLast, False);
> break;
> end;
> end;
> //
> end;
> ...
> The first pass loads all the records as root nodes, to avoid re-queries.
> The second pass 'rearrange' the nodes to their rightful places...:)
> The real-world version will probably need a lot more stuffs inside
> (circular references checking, orphaned nodes checking, etc). I'm
> wondering whether someone can show me a better way to do this. Thanks.

Step 4 is **expensive**. Complexity is n^2 and many MoveTo's for nothing.
If you can't query the table as with Oracle (CONNECT BY statement) you might
be able to put together a stored proc which takes a node key as param,
gets the immediate children of node and stores them in a result set, then
iterates that set (or maybe in a 2nd stored proc, or recursively with
decreasing level parameter) and gets the children of their children. You
could then walk that dataset and add the nodes right away without any re-
ordering afterwards.

> > Well, to be honest I have done exactly this for my company. The
> > node interfaces
> > are implemented by a database tree cache which can be shared by
> > several VTrees.
> > But this is property of my company and I cannot give it to you.
> That is perfectly fine. It's good to know that someone had went
> this path before me, so at least I know that I'm in the right

Please note that stuffing everything into interfaces tends to make code
even bulkier. It really depends.

> direction. I hope I can find the e-mail address of the person(s)
> implementing DBVT, since he/she/they probably had a lot of things
> to share. Is the person on the list?

I don't remember who it was but you can see the list of members on yahoogroups.

Regards,
Werner

PS: I'll be out of town for a few days...

 | Replies | Author | Date
3353 | Re: More on data aware stuffs (long). | Sugiharto Lim | Sun 8/5/2001


Finding a node in TVirtualStringTree + OnSelect-event missing?

From: "Helge Jung \(ECO-Logic\)" [helge@e...]
Date: Thu Jul 26, 2001 2:30 pm
Subject: Finding a node in TVirtualStringTree + OnSelect-event missing?

I've two questions:

1. I need to find a node - I know the exact data of the node and I have to
select that node so that the user can see the node.

2. How can I detect that a node has been selected? The OnFocusChanged event
changes as soon as I scroll through the list. But I want to have the
selection kept at that single row (I'm simulating a DBGrid).

Can anybody help? You may mail me directly ([helge@e...]).

Helge.

 | Replies | Author | Date
3263 | Re: Finding a node in TVirtualStringTree + OnSele | [helge@e...] | Thu 7/26/2001
3297 | Re: Finding a node in TVirtualStringTree + OnSele | Werner Lehmann | Mon 7/30/2001
3298 | Re: Finding a node in TVirtualStringTree + OnSele | Werner Lehmann | Mon 7/30/2001


re: Finding a node in TVirtualStringTree + OnSelect-event missing?

From: [helge@e...]
Date: Thu Jul 26, 2001 3:47 pm
Subject: Re: Finding a node in TVirtualStringTree + OnSelect-event missing?

Okay, how to find a node I understood now (I hope - with
IterateSubTree and abortion in the callback routine).

But I still have the problem with the selection.

I'm reading data out of an SQL-Query (IBDataset - Interbase) - how I
assign all nodes at once (ability to sort and so on).


re: DAD-questions from a beginner

From: Michael Valentiner=Branth [MichaelVB@g...]
Date: Thu Jul 26, 2001 4:30 pm
Subject: Re: [VirtualTreeview] DAD-questions from a beginner

Hello Werner,

> Hm, probably because DropTargetNode might be nil if the drag is not over a
node,
> needs an additional check.

Yepp! It's no problem if DropTargetNode is used "standalone", but it seems,
that DropTargetNode.Parent doesn't like nil.

BTW: Astonishing, that DropTargetNode can become nil on the way from one item
in the VT to another.

> Was untested... :)

Not my fault! It was *you* who introduced DropTargetNode to my code. <g>

Thanks again!

Michael


Absolute Index

From: [ccdsystems@y...]
Date: Thu Jul 26, 2001 10:52 pm
Subject: Absolute Index

Given an index into the TreeView, how do I get the node? In my case,
the treeview has only root nodes, so the index should be absolute.
Later, though, I'd like to be able to find my way even if there are
children, finding a root node with the index of the root node.

Getting the first record, and incrementing a counter for every next
until I reach the target node is too slow.

 | Replies | Author | Date
3273 | Re: Absolute Index | Mike Lischke | Sat 7/28/2001
3307 | Re: Absolute Index | [ccdsystems@y...] | Tue 7/31/2001
3308 | Re: Absolute Index | Werner Lehmann | Tue 7/31/2001


ContentTo... is very slow

From: [anders@t...]
Date: Sat Jul 28, 2001 10:51 am
Subject: ContentTo... is very slow

Hi,

I'm trying to save my tree to a HTML file.
This is the code I use:

var s:String
begin
s := tabel.ContentToHTML(tstAll);
f := TFileStream.create(savedialog2.filename, fmCreate);
f.Write(pointer(s)^, length(s));
f.free

This takes about 30 min with some 7000 nodes.
I've seen other trees do this function with TStringList as output.
Maybe that's an idea, or maybe Tstream as output.
ContentToRTF and other are also very slow.

-Thomsen

 | Replies | Author | Date
3300 | Re: ContentTo... is very slow | Werner Lehmann | Mon 7/30/2001
3301 | Re: ContentTo... is very slow | [adembaba@e...] | Mon 7/30/2001
3303 | Re: ContentTo... is very slow | GIANNAKOPOULOS KOSTAS | Tue 7/31/2001
3355 | Re: ContentTo... is very slow | Mike Lischke | Sun 8/5/2001


re: EditNode

From: "Mike Lischke" [lists@l...]
Date: Sat Jul 28, 2001 3:21 pm
Subject: RE: [VirtualTreeview] EditNode

> In Delphi 6 EditNode(VirtualStringTree.FocusedNode,0) generates
> exception 'Range Check Error' if FocusedNode is a child of RootNode.
> Why? How to fix?
> (VirtulTree 2.5.9)

Sorry, but I cannot reproduce this problem. Can you send me a simple demo
showing the problem? And
please, enter bug reports into the appropriate table of the database area of
the mailing list.

Ciao, Mike


re: CharSet Problem + Invisible Focused Node

From: "Mike Lischke" [lists@l...]
Date: Sat Jul 28, 2001 3:21 pm
Subject: RE: [VirtualTreeview] CharSet Problem + Invisible Focused Node

Hi Adem,

> 1) Does the latest VT have any problems with non-ASCII
> text display.

Not that I know of, but be aware VT uses Unicode exclusively for display.

> 2) Is it sensical to have a focused node remain focused
> even though its parent is now collapsed, hence the node
> is not visible anymore. Shoudn't the parent node receive
> the focus --after firind NodeChanging, NodeChanged etc.

The parent might or might not get the focus then. This depends on the task in
the particular
application. If you want this behavior then simply add a handler for
OnCollapsed and move the focus
if needed.

Ciao, Mike


re: MFE and Use

From: "Mike Lischke" [lists@l...]
Date: Sat Jul 28, 2001 3:21 pm
Subject: RE: [VirtualTreeview] MFE and Use

Hi Wim,

> A bit off-topic but.... I just started working on extending the VSTedit
> sample with you USE editor and found some interesting 'bugs' :

Although this is not a support mailing list for USE (I will create one after
the next version of VT
is out), let me quickly answer your questions.

> 1. When the USE control is very small (like a bit below the lineheight) you
> get a divide by zero because Linesinwindow becomes zero.

USE is basically still in beta. It's been out for a long time, I know, and many
people have
downloaded it und use it at various places. But it still has serious problems
(you mentioned one)
which I have to solve yet.

> 2. When i set the color of USE to clInfoBlk (the nice soft yellow one) the
> window displays a black background and a black window.

Never seen this before. Have to investigate further...

> 3. I miss an option to force trailing lf's to be trimmed. If you edit a line
> without crlf's it's always changed by the editor.

Not sure what you mean here. If you have enabled "keep trailing blanks" then
the lines are not
touched by USE, otherwise they are right-trimmed.

> 4. I miss an option to allow enter (ie crlf's) to be entered in the text.

Strange wish :o] When you enter CR then a new line is created and shown. Why do
you want to show
some CR characters in a normal line?

Ciao, Mike

PS: What is MFE?


re: toAutoSpanColumns

From: "Mike Lischke" [lists@l...]
Date: Sat Jul 28, 2001 3:21 pm
Subject: RE: [VirtualTreeview] toAutoSpanColumns

Hi Werner,

> I have found a problem with col spanning, and I hope you don't say 'by
design' now.

No, this is not by design, it is a bug :o]

> I am afraid that fixing this will/would complicate things considerably.

This time fortunately not. I only had to exchange two lines.

Ciao, Mike


re: Re: Someone has experiences with printing?

From: "Mike Lischke" [lists@l...]
Date: Sat Jul 28, 2001 3:21 pm
Subject: RE: [VirtualTreeview] Re: Someone has experiences with printing?

Hi Paul,

> When I try to use PaintTo to print the tree, I end up with a postage
> stamp size printout of what is currently displayed in the tree (i.e.
> not the whole tree) minus header. How do I print the whole tree
> (including header) and zoom in to a reasonable size? Anybody got any
> source code?

Have you ever thought to use SetWindowExtEx and SetViewportExtEx? These APIs
allow to scale any
drawing into a particular device context with remarkable results. Most print
preview code uses them
to show a full preview of printer output on screen.

Ciao, Mike


re: Re: Someone has experiences with printing?

From: "Mike Lischke" [lists@l...]
Date: Sat Jul 28, 2001 3:21 pm
Subject: RE: [VirtualTreeview] Re: Someone has experiences with printing?

Hio Mathias,

> 3: Here, I basically use PaintTree() to draw the complete tree (not
> just the visible part) to a temporary TBitmap.
> Then I copy "pages" from the bitmap to another, temporary bitmap, and
> StretchDraw this to the Printer Canvas. (Not using th
> TCanvas->StretchDraw though since it's extremly buggy for printers.
> I'm using Rober Dunns' implementation instead).

Use this instead:

SetWindowExtEx(Handle, ScreenHorzDpi, ScreenVertDpi, nil);
SetViewportExtEx(Handle, Round(MasterScale * PrinterHorzDpi),
Round(MasterScale *
PrinterVertDpi), nil);

The window extent is what you have on screen and the viewport extent is what
you have on printer
(all in pixels, both values depend on resolution, usually 95dpi for screen and
300..600dpi for
printer). This way you will get a print out of a tree exactly as large as you
see it on screen (take
a ruler to measure :o]).

MasterScale can be used if you want to have an resolution independent overall
scale.

Ciao, Mike


re: Absolute Index

From: "Mike Lischke" [lists@l...]
Date: Sat Jul 28, 2001 3:21 pm
Subject: RE: [VirtualTreeview] Absolute Index

> Given an index into the TreeView, how do I get the node? In my case,
> the treeview has only root nodes, so the index should be absolute.
> Later, though, I'd like to be able to find my way even if there are
> children, finding a root node with the index of the root node.
>
> Getting the first record, and incrementing a counter for every next
> until I reach the target node is too slow.

You want to use feature which is against the "nature" of a treeview. That's the
reason why it is
slow (although with VT it should still be orders of magnitudes faster compared
with TTreeview). With
VT you cannot access nodes by index because they are organized in doubly linked
lists. I'm afraid
you will have to change your design or the treeview.

Ciao, Mike

 | Replies | Author | Date
3307 | Re: Absolute Index | [ccdsystems@y...] | Tue 7/31/2001


Sourceforge

From: "Mike Lischke" [lists@l...]
Date: Sat Jul 28, 2001 3:22 pm
Subject: Sourceforge

Hi all,

recently I opened a Virtual Treeview project on Sourceforge
(www.sourceforge.net). Has somebody of you experiences with this CVS? Can you
help me with setting up all necessary structures?

> Your project registration for SourceForge has been approved.
>
> Project Full Name: Virtual Treeview
> Project Unix Name: virtualtreeview
>CVS Server: cvs.virtualtreeview.sourceforge.net
> Shell/Web Server: virtualtreeview.sourceforge.net

Ciao, Mike

 | Replies | Author | Date
3277 | Re: Sourceforge | Vadim Sedulin | Sat 7/28/2001
3378 | Re: Sourceforge | Mike Lischke | Tue 8/7/2001
3280 | Re: Sourceforge (client access) | Ariel | Sat 7/28/2001
3281 | Re: Sourceforge (client access) | Ariel | Sat 7/28/2001
3379 | Re: Sourceforge (client access) | Mike Lischke | Tue 8/7/2001
3387 | Re: Sourceforge | Vadim Sedulin | Wed 8/8/2001


New file uploaded to VirtualTreeview

From: [VirtualTreeview@yahoogroups.com>
Date: Sat Jul 28, 2001 3:23 pm
Subject: New file uploaded to VirtualTreeview

Hello,

This email message is a notification to let you know that
a file has been uploaded to the Files area of the VirtualTreeview
group.

File : /VirtualTree_2.5.13.zip
Uploaded by : [lists@l...]
Description : Beta version

You can access this file at the URL

http://groups.yahoo.com/group/VirtualTreeview/files/VirtualTree_2.5.13.zip

To learn more about file sharing for your group, please visit

http://help.yahoo.com/help/us/groups/files

Regards,

[lists@l...]

Replies | Author | Date
3276 | Re: New file uploaded to VirtualTreeview | Mike Lischke | Sat 7/28/2001
3279 | Re[2]: [VirtualTreeview] New file uploaded to Vir | Oleg Kraynov | Sat 7/28/2001
3356 | Re: Re[2]: [VirtualTreeview] New file uploaded to | Mike Lischke | Sun 8/5/2001
3364 | Re[4]: [VirtualTreeview] New file uploaded to Vir | Oleg Kraynov | Sun 8/5/2001


re: New file uploaded to VirtualTreeview

From: "Mike Lischke" [lists@l...]
Date: Sat Jul 28, 2001 3:47 pm
Subject: RE: [VirtualTreeview] New file uploaded to VirtualTreeview

> This email message is a notification to let you know that
> a file has been uploaded to the Files area of the VirtualTreeview
> group.

New this time:

- live check with Delphi 6 on my side
- bug fixes
- other small changes

This looks not that much but there were a lot small issues to fix this time.

Note for bug entries 12, 14 and 18: I cannot reproduce those bugs, so if you
still find them
existant than throw me a small sample project to fix it.

Ciao, Mike

 | Replies | Author | Date
3279 | Re[2]: [VirtualTreeview] New file uploaded to Vir | Oleg Kraynov | Sat 7/28/2001
3356 | Re: Re[2]: [VirtualTreeview] New file uploaded to | Mike Lischke | Sun 8/5/2001
3364 | Re[4]: [VirtualTreeview] New file uploaded to Vir | Oleg Kraynov | Sun 8/5/2001
3286 | Re: New file uploaded to VirtualTreeview | [ltchoong@s...] | Mon 7/30/2001


re: Sourceforge

From: "Vadim Sedulin" [wsntrl@o...]
Date: Sat Jul 28, 2001 7:07 pm
Subject: Re: [VirtualTreeview] Sourceforge

Hello Mike!

----- Original Message -----
From: "Mike Lischke" [lists@l...]
To: "Virtual Treeview mailing list" [VirtualTreeview@yahoogroups.com>
Sent: Saturday, July 28, 2001 7:22 PM
Subject: [VirtualTreeview] Sourceforge

> recently I opened a Virtual Treeview project on Sourceforge
(www.sourceforge.net). Has somebody of you experiences with this CVS? Can
you help me with setting up all necessary structures?
>
> > Your project registration for SourceForge has been approved.
> >
> > Project Full Name: Virtual Treeview
> > Project Unix Name: virtualtreeview
> >CVS Server: cvs.virtualtreeview.sourceforge.net
> > Shell/Web Server: virtualtreeview.sourceforge.net

Not muh, but let's try (if there is no real experts on this group). Contact
me by e-mail.

Bye.

Vadim Sedulin
E-Mail: wsntrl@o...]

 | Replies | Author | Date
3378 | Re: Sourceforge | Mike Lischke | Tue 8/7/2001


ContentToText error

From: Bohuslav Švancara [boh.svancara@q...]
Date: Sat Jul 28, 2001 7:08 pm
Subject: ContentToText error

Hi Mike!

Version: 2.5.9

There is an error in ContentToText procedure.

A command "FillChar(Tabs, Level, Separator)" does not fill "Tabs" by
"Separator", but rewrites a pointer to AnsiString "Tabs".

I suggest you to use:

Tabs := StringOfChar(Separator,Level);

instead of:

SetLength(Tabs, Level);
FillChar(Tabs, Level, Separator);

and

Tabs := StringOfChar(#9,Level);

instead of:

SetLength(Tabs, Level);
FillChar(Tabs, Level, #9);

Regards,

Bohuslav Svancara
[softprojekt@i...]

 | Replies | Author | Date
3282 | Re: ContentToText error | Frank van den Bergh | Sun 7/29/2001


Re[2]: New file uploaded to VirtualTreeview

From: Oleg Kraynov [olegvkr@y...]
Date: Sat Jul 28, 2001 9:16 pm
Subject: Re[2]: [VirtualTreeview] New file uploaded to VirtualTreeview

Hi, Mike.

I for the first time has installed VirtualTree for BCB5.

Question:
For what properties is used TVirtualTreeEditor?
Why is not registerred for BCB?

I has deleted all {$ifndef CPPB}, has added dsnide50.bpi to design-time project
of package.

After compiling did not find nothing fresh...

--
Best regards,
Oleg

_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com

 | Replies | Author | Date
3356 | Re: Re[2]: [VirtualTreeview] New file uploaded to | Mike Lischke | Sun 8/5/2001
3364 | Re[4]: [VirtualTreeview] New file uploaded to Vir | Oleg Kraynov | Sun 8/5/2001


re: Sourceforge (client access)

From: "Ariel" [asel98@y...]
Date: Sat Jul 28, 2001 10:14 pm
Subject: Re: Sourceforge (client access)

hello; i only know the client side part...
in a vt.bat do:

echo VirtualTreeView
SET HOME=C:\vt-cvs\
cd c:\vt-cvs
set
CVSROOT=:pserver:[anonymous@c...]:/data/
cvs login
cvs -z3 update -dP
cvs logout

* i tried that, and it seams there isnt any account created...
* the /data/ is the directory where u have all the files.
* i have the cvs.exe... let me know if u want, i can upload it.

http://www.cvsgui.org
a windows cvs manamager.. ucan create all the structures with it.
(well.. i think).

hth

--- In [VirtualTreeview@y...], "Mike Lischke" [lists@l...] wrote:
> Hi all,
>
> recently I opened a Virtual Treeview project on Sourceforge
(www.sourceforge.net). Has somebody of you experiences with this CVS?
Can you help me with setting up all necessary structures?
>
> > Your project registration for SourceForge has been approved.
> >
> > Project Full Name: Virtual Treeview
> > Project Unix Name: virtualtreeview
> >CVS Server: cvs.virtualtreeview.sourceforge.net
> > Shell/Web Server: virtualtreeview.sourceforge.net
>
> Ciao, Mike

 | Replies | Author | Date
3281 | Re: Sourceforge (client access) | Ariel | Sat 7/28/2001
3379 | Re: Sourceforge (client access) | Mike Lischke | Tue 8/7/2001


re: Sourceforge (client access)

From: "Ariel" [asel98@y...]
Date: Sat Jul 28, 2001 10:16 pm
Subject: Re: Sourceforge (client access)

yahoo hides when theres something after a "@"
i writed anonymous () cvs.virtualtreeview.sourceforge.net:

> CVSROOT=:pserver:[anonymous@c...]:/data/


re: ContentToText error

From: "Frank van den Bergh" [frankvdbergh@y...]
Date: Sun Jul 29, 2001 8:25 am
Subject: Re: ContentToText error

Hi Bohuslav,

Mike solved this problem in his newest version,

He uses FillChar(Tabs[1], Level, Separator); instead.

Frank.
--- In [VirtualTreeview@y...], Bohuslav Švancara [boh.svancara@q...]
wrote:
> Hi Mike!
>
> Version: 2.5.9
>
> There is an error in ContentToText procedure.
>
> A command "FillChar(Tabs, Level, Separator)" does not fill "Tabs" by
> "Separator", but rewrites a pointer to AnsiString "Tabs".
>
> I suggest you to use:
>
> Tabs := StringOfChar(Separator,Level);
>
> instead of:
>
> SetLength(Tabs, Level);
> FillChar(Tabs, Level, Separator);
>
> and
>
> Tabs := StringOfChar(#9,Level);
>
> instead of:
>
> SetLength(Tabs, Level);
> FillChar(Tabs, Level, #9);
>
>
> Regards,
>
> Bohuslav Svancara
> [softprojekt@i...]


DeleteSelectedNodes

From: [anders@t...]
Date: Sun Jul 29, 2001 6:52 pm
Subject: DeleteSelectedNodes

Hi,

I suggest you make a small change in DeleteSelectedNodes:

procedure TBaseVirtualTree.DeleteSelectedNodes;
...
for I := 0 to High(Nodes) do
//change this to: for I := High(Nodes) downto 0 do
DeleteNode(Nodes[I]);
...

This is faster since you don't decrease the index number of nodes
that are about to be deleted.

-Thomsen

 | Replies | Author | Date
3357 | Re: DeleteSelectedNodes | Mike Lischke | Sun 8/5/2001


Merge 2 cols

From: [tparent@c...]
Date: Mon Jul 30, 2001 7:41 am
Subject: Merge 2 cols

(sorry for my english)

Hey,

IS it possible to merge 2 columns for particulars nodes ?

I want to merge/strech 2 columns like in Excel
(see button '<- a ->')

In particular case, data from one column is big and
there are nothing to display in the second column

for example, for an Xml representation, I want to see
a attribute name on the first col and the value on the second.
But for a text node I want to display the text on the 2 cols

(I hope this is clear enough)

How to do that ?

 | Replies | Author | Date
3287 | Re: Merge 2 cols | [zh66w6@h...] | Mon 7/30/2001


working on selected nodes

From: "Moritz Franckenstein" [franckenstein@a...]
Date: Mon Jul 30, 2001 8:06 am
Subject: working on selected nodes

hi,

is the usual way to loop through all selected nodes by using
GetFirst/NextSelected?

i think, this might be a little bit slow when i have a big tree with
only a few selected nodes on the end.

i have seen that you have an internal nodearray of the selected
nodes, is it possible to access it instead? did i oversee something?

-moritz

 | Replies | Author | Date
3288 | Re: working on selected nodes | [zh66w6@h...] | Mon 7/30/2001
3289 | Re: working on selected nodes | Moritz Franckenstein | Mon 7/30/2001
3295 | Re: working on selected nodes | Werner Lehmann | Mon 7/30/2001
3358 | Re: working on selected nodes | Mike Lischke | Sun 8/5/2001
3362 | Re: working on selected nodes | Werner Lehmann | Sun 8/5/2001
3438 | Re: working on selected nodes | Mike Lischke | Mon 8/13/2001
3442 | Re: working on selected nodes | Werner Lehmann | Mon 8/13/2001
3472 | Re: working on selected nodes | Mike Lischke | Wed 8/15/2001


re: New file uploaded to VirtualTreeview

From: [ltchoong@s...]
Date: Mon Jul 30, 2001 10:23 am
Subject: Re: New file uploaded to VirtualTreeview

Mike,

In relation to bug entry 18, I have uploaded file EditNodeText.zip to
the file area.

Anyway this is not critical.

Thanks,

TC

--- In [VirtualTreeview@y...], "Mike Lischke" [lists@l...] wrote:
> > This email message is a notification to let you know that
> > a file has been uploaded to the Files area of the VirtualTreeview
> > group.
>
> New this time:
>
> - live check with Delphi 6 on my side
> - bug fixes
> - other small changes
>
> This looks not that much but there were a lot small issues to fix
this time.
>
> Note for bug entries 12, 14 and 18: I cannot reproduce those bugs,
so if you still find them
> existant than throw me a small sample project to fix it.
>
> Ciao, Mike


re: Merge 2 cols

From: [zh66w6@h...]
Date: Mon Jul 30, 2001 11:45 am
Subject: Re: Merge 2 cols

Try setting the AutoSpanColumns option. This should do what you're
looking for.

Cheers,
Paul

--- In [VirtualTreeview@y...], [tparent@c...] wrote:
> (sorry for my english)
>
> Hey,
>
> IS it possible to merge 2 columns for particulars nodes ?
>
> I want to merge/strech 2 columns like in Excel
> (see button '<- a ->')
>
> In particular case, data from one column is big and
> there are nothing to display in the second column
>
> for example, for an Xml representation, I want to see
> a attribute name on the first col and the value on the second.
> But for a text node I want to display the text on the 2 cols
>
> (I hope this is clear enough)
>
> How to do that ?


re: working on selected nodes

From: [zh66w6@h...]
Date: Mon Jul 30, 2001 11:49 am
Subject: Re: working on selected nodes

Use the following code to step through all the selected node in VT.

var
Node : PVirtualNode;

begin
Node := VT.GetFirstSelected;
While Node <> nil do
begin
// Do Something...

Node := VT.GetNextSelected(Node);
end;
end;

Hope this helps.

Cheers,
Paul
--- In [VirtualTreeview@y...], "Moritz Franckenstein"
[franckenstein@a...] wrote:
> hi,
>
> is the usual way to loop through all selected nodes by using
> GetFirst/NextSelected?
>
> i think, this might be a little bit slow when i have a big tree
with
> only a few selected nodes on the end.
>
> i have seen that you have an internal nodearray of the selected
> nodes, is it possible to access it instead? did i oversee something?
>
> -moritz

 | Replies | Author | Date
3289 | Re: working on selected nodes | Moritz Franckenstein | Mon 7/30/2001


re: working on selected nodes

From: "Moritz Franckenstein" [franckenstein@a...]
Date: Mon Jul 30, 2001 2:57 pm
Subject: Re: working on selected nodes

--- In [VirtualTreeview@y...], [zh66w6@h...] wrote:
> Node := VT.GetNextSelected(Node);
> Hope this helps.

yes, thank you, i will do it this way. but when i am looking at the
implementation of this function, i am asking me if this couldnt get
faster when the internal selection nodearray would be used instead.
not for this function getnextselected, but when someone wants to loop
through all selected nodes.

-moritz


problem with new version (bug ?)

From: "Moritz Franckenstein" [franckenstein@a...]
Date: Mon Jul 30, 2001 3:04 pm
Subject: problem with new version (bug ?)

function TBaseVirtualTree.AllocateInternalDataArea(Size: Cardinal):
Cardinal;

// Simple registration method to be called by each descentant to
claim their internal data area.
// Result is the offset from the begin of the node to the internal
data area of the calling tree class.

begin
Assert(FRoot = nil, 'Internal data allocation must be done before
any node is created.');
Result := TreeNodeSize + FTotalInternalDataSize;
Inc(FTotalInternalDataSize, (Size + 3) and not 3);

InitRootNode;
end;

how can this method be called more than once, when it initializes the
rootnode after the first call and then crashes on the next one due to
the assertion in the first line...

i have tried a lot of things for some hours until i found this.

-moritz

 | Replies | Author | Date
3291 | Re: problem with new version (bug ?) | Werner Lehmann | Mon 7/30/2001
3292 | Re: problem with new version (bug ?) | Moritz Franckenstein | Mon 7/30/2001
3293 | Re: problem with new version (bug ?) | Werner Lehmann | Mon 7/30/2001


re: problem with new version (bug ?)

From: Werner Lehmann [wl@b...]
Date: Mon Jul 30, 2001 3:17 pm
Subject: Re: [VirtualTreeview] problem with new version (bug ?)

Hi Moritz,

> how can this method be called more than once, when it initializes the
> rootnode after the first call and then crashes on the next one due to
> the assertion in the first line...
>
> i have tried a lot of things for some hours until i found this.

why do you need it more than once? Before the root node is created? Even
if you clear the tree after that the root node should remain (not checked
with code).

Regards,
Werner

 | Replies | Author | Date
3292 | Re: problem with new version (bug ?) | Moritz Franckenstein | Mon 7/30/2001


re: problem with new version (bug ?)

From: "Moritz Franckenstein" [franckenstein@a...]
Date: Mon Jul 30, 2001 3:42 pm
Subject: Re: problem with new version (bug ?)

--- In [VirtualTreeview@y...], Werner Lehmann [wl@b...] wrote:
> why do you need it more than once? Before the root node is created?
Even
> if you clear the tree after that the root node should remain (not
checked
> with code).

i need it once and the original treeview uses it once also. when i
put it before the inherited create call, it crashes on the original
call, when i put it after, it crashed on my call.


re: Re: problem with new version (bug ?)

From: Werner Lehmann [wl@b...]
Date: Mon Jul 30, 2001 4:10 pm
Subject: Re: [VirtualTreeview] Re: problem with new version (bug ?)

Hi Moritz,

> i need it once and the original treeview uses it once also. when i
> put it before the inherited create call, it crashes on the original
> call, when i put it after, it crashed on my call.

Indeed. See also bug #22, reported by Vadim Sedulin:

"AllocateInternalDataArea: This fn. must not call InitRootNode."

Problem was probably introduced with the fix for missing root node data
reported by Jim.

Regards,
Werner


Bug report #21 - not a bug?

From: [ainpoissee@y...]
Date: Mon Jul 30, 2001 4:15 pm
Subject: Bug report #21 - not a bug?

Hi Mike!

Quote from virtual tree help file:
>>
Declaration
Property IsVisible[Node:PVirtualNode] : Boolean;

Description
A node is visible when all its parents are expanded. Setting IsVisible
to True will therefor expand all parents of Node. Note: setting this
property to False has no effect.
<<

however code like (VST is TVirtualStringTree)

procedure TForm1.Button1Click(Sender: TObject);
var PNode, NNode: PVirtualNode;
begin
PNode:= VST.GetFirstSelected;
NNode:= VST.AddChild(PNode);
VST.IsVisible[NNode]:= TRUE;
end;

doesn't make new node (NNode) visible in case parent node (PNode)
isn't expanded already.
Of course there is workaround - one can use either
VST.Expanded[PNode]:= TRUE; or VST.TopNode:= NNode; but it is still
bug, isn't it?

ain

 | Replies | Author | Date
3296 | Re: Bug report #21 - not a bug? | Werner Lehmann | Mon 7/30/2001
3359 | Re: Bug report #21 - not a bug? | Mike Lischke | Sun 8/5/2001


re: working on selected nodes

From: Werner Lehmann [wl@b...]
Date: Mon Jul 30, 2001 4:33 pm
Subject: Re: [VirtualTreeview] working on selected nodes

Hi Moritz,

> is the usual way to loop through all selected nodes by using
> GetFirst/NextSelected?

Think so.

> i think, this might be a little bit slow when i have a big tree with
> only a few selected nodes on the end.

As far as I recall the word on this was formerly to use GetFirst/NextSelected
to avoid resorting the node selection by logical order. It was said to be the
fastest way. Some versions ago then Mike has changed something and - again if
I recall correctly - the change log said something like GetSortedSelection would
not be (significantly) slower anymore.

While this sounded as if GetSortedSelection would have been optimized I am now
under the impression that the previously declared as fast way with GetFirst/Next
is now equally slow. I am surprised to see that the selection array is not used
in both ways anymore.

GetSortedSelection does not even make use of FSelectionCount to stop the loop
as soon as all selected nodes are found. Worst case: a bazillion nodes, only
first node selected, but all nodes looped. Not even a rare case without multi
selection.

I am sure Mike has had good reasons to do this but I have no clue which. At
least
the above mentioned optmization with SelectedCount could be applied without
hurting
something else.

> i have seen that you have an internal nodearray of the selected
> nodes, is it possible to access it instead? did i oversee something?

I hope that you oversaw something (and me too) :)

Well. The problem with internal FSelection array is that not always all of its
entries are valid. Mike uses a trick to 'mark' some entries as invalid without
actually removing them from the array. He wants to avoid lengthy array update
operations because node selection is time critical, the user expects to get
instant
feedback, esp. with mouse draw selection. This must not 'stutter'.

The trick which Mike is using is to increment the pointer to a node in the array
by 1. The invalid pointer can be detected because it is odd not even and
divisable
by 4 as before. See InternalRemoveFromSelection for an example (apparently this
is the only place at all or which is left where this trick is used).

Also, I am suspecting that the array is not complete or up to date at all times.
This is really the only reason I can imagine for Mike not using it at the
Get*Selected*
methods.

Regards,
Werner


re: Bug report #21 - not a bug?

From: Werner Lehmann [wl@b...]
Date: Mon Jul 30, 2001 4:42 pm
Subject: Re: [VirtualTreeview] Bug report #21 - not a bug?

Hi Ain,

> Of course there is workaround - one can use either
> VST.Expanded[PNode]:= TRUE; or VST.TopNode:= NNode; but it is still
> bug, isn't it?

Documentation bug I would say. Two notions of visibility are distinguished in
VTrees:

- "vsVisible"-Visibility. If a node does not have this flag set in its states,
it is
not drawn in the tree. Not even if the node's parent is expanded and
currently in
the scrolled-to area. This can be used for node filtering. Please note that
the +
button is not removed from collapsed nodes with all invisible child nodes.
This is
on the todo list and IMO necessary before this feature can be used at large
scale.

- FullyVisible[Node]-Visibility. A node is fully visible if it visible in the
preceding
sense and all of its parents are expanded. The scroll position is meaningless
AFAIK.

To make a node fully visible you might also take a look at ScrollIntoView().

Regards,
Werner


re: Finding a node in TVirtualStringTree + OnSelect-event missing?

From: Werner Lehmann [wl@b...]
Date: Mon Jul 30, 2001 4:51 pm
Subject: Re: [VirtualTreeview] Finding a node in TVirtualStringTree + OnSelect-event missing?

Hi Helge,

> 1. I need to find a node - I know the exact data of the node and I have to
> select that node so that the user can see the node.

You have to find that yourself. Usually it is easiest to just store the node
which is associated to your data in your data. If you are not init'ing the
whole tree at once and/or are using the 'add children on expanding' approach
but still want to select a node which might not be init'ed or in the tree,
you can speed this a lot for large trees if you store also a references to the
parent data node (not virtual node). Contact me for details (on this list) if
you node them.

> 2. How can I detect that a node has been selected? The OnFocusChanged event
> changes as soon as I scroll through the list. But I want to have the
> selection kept at that single row (I'm simulating a DBGrid).

I am not sure about this point. If you scroll the tree with mouse the focus
does not change. If you scroll with keyboard the focus changes, of course, but
this would also be the case with a DBGrid. Anyhow, maybe OnChange is what you
are looking for, it is fired if and only if the selection (not focus) changes.

Werner


re: Re: Finding a node in TVirtualStringTree + OnSelect-event missing?

From: Werner Lehmann [wl@b...]
Date: Mon Jul 30, 2001 4:53 pm
Subject: Re: [VirtualTreeview] Re: Finding a node in TVirtualStringTree + OnSelect-event missing?

Hi Helge,

> I'm reading data out of an SQL-Query (IBDataset - Interbase) - how I
> assign all nodes at once (ability to sort and so on).

BeginUpdate, set ChildCount[] / RootNodeCount, iterate nodes and dataset,
manually init each node, EndUpdate.

Werner


re: DAD-questions from a beginner

From: Werner Lehmann [wl@b...]
Date: Mon Jul 30, 2001 4:54 pm
Subject: Re: [VirtualTreeview] DAD-questions from a beginner

Hi Michael,

> > Hm, probably because DropTargetNode might be nil if the drag is not over a
node,
> > needs an additional check.
>
> Yepp! It's no problem if DropTargetNode is used "standalone", but it seems,
that DropTargetNode.Parent doesn't like nil.

Of course. If DropTargetNode is nil you cannot access any member of its record
(like .Parent).

> BTW: Astonishing, that DropTargetNode can become nil on the way from one item
in the VT to another.

Well, have not looked further into this since you have to check for nil anyway.

Werner


re: ContentTo... is very slow

From: Werner Lehmann [wl@b...]
Date: Mon Jul 30, 2001 5:06 pm
Subject: Re: [VirtualTreeview] ContentTo... is very slow

Hi Anders,

> I'm trying to save my tree to a HTML file.
> This is the code I use:
>
> var s:String
> begin
> s := tabel.ContentToHTML(tstAll);
> f := TFileStream.create(savedialog2.filename, fmCreate);
> f.Write(pointer(s)^, length(s));
> f.free
>
> This takes about 30 min with some 7000 nodes.
> I've seen other trees do this function with TStringList as output.
> Maybe that's an idea, or maybe Tstream as output.
> ContentToRTF and other are also very slow.

I have not checked out your example. But I can imagine the string (s)
is concatenated a whole lot of times. This yields several (many) memory
reallocations (probably with data copy side effect).

Since the string is returned and not a var (out) parameter you cannot
even set the length to something high to avoid many or all reallocations.
But you can test if my guess is correct: insert this call as first line
of ContentToHTML:

SetLength(result, 10000); // or anything where your HTML fits in probably

and the last line (or before any exit, or with try..finally around everything)

SetLength(result, StrLen(result) + 1);

If this is much faster I am right and you might want to contact Mike. Maybe
the length of the resulting HTML can somehow be estimated.

Regards,
Werner

 | Replies | Author | Date
3301 | Re: ContentTo... is very slow | [adembaba@e...] | Mon 7/30/2001


re: ContentTo... is very slow

From: [adembaba@e...]
Date: Mon Jul 30, 2001 5:33 pm
Subject: Re: ContentTo... is very slow

Hi,

This is a problem I faced with XMLDataset
and largely solved: Here is how:

First, try not to use string concatenation,
but use TMemoryStream (or something similar)
and set its size **beforehand**. The time it
takes for you to programmaticaly estimate
the stream size is negligible when compared
to the time you waste by concatenating
strings.

Finally, dont use TFileStream, use a stream
derivative that has a SaveToStream method
and use it.

You will see dramatic speed increases --well
I did, anyhow.

Cheers,
Adem

--- In [VirtualTreeview@y...], Werner Lehmann [wl@b...] wrote:
> Hi Anders,
>
> > I'm trying to save my tree to a HTML file.
> > This is the code I use:
> >
> > var s:String
> > begin
> > s := tabel.ContentToHTML(tstAll);
> > f := TFileStream.create(savedialog2.filename, fmCreate);
> > f.Write(pointer(s)^, length(s));
> > f.free
> >
> > This takes about 30 min with some 7000 nodes.
> > I've seen other trees do this function with TStringList as output.
> > Maybe that's an idea, or maybe Tstream as output.
> > ContentToRTF and other are also very slow.
>
> I have not checked out your example. But I can imagine the string
(s)
> is concatenated a whole lot of times. This yields several (many)
memory
> reallocations (probably with data copy side effect).
>
> Since the string is returned and not a var (out) parameter you
cannot
> even set the length to something high to avoid many or all
reallocations.
> But you can test if my guess is correct: insert this call as first
line
> of ContentToHTML:
>
> SetLength(result, 10000); // or anything where your HTML fits in
probably
>
> and the last line (or before any exit, or with try..finally around
everything)
>
> SetLength(result, StrLen(result) + 1);
>
> If this is much faster I am right and you might want to contact
Mike. Maybe
> the length of the resulting HTML can somehow be estimated.
>
> Regards,
> Werner


String options

From: Werner Lehmann [wl@b...]
Date: Mon Jul 30, 2001 5:45 pm
Subject: String options

Hi Mike,

recently I noticed that the TBaseVirtualTree's tree options already
contain and publish StringOptions. Obviously only needed for and
starting with TCustomVirtualStringTree. Not very dramatic but I
thought I just mention it. The draw tree does not need the string
options (always). Fixing it would mean to make ReadOldStringOptions()
protected and virtual and to derive a new class from TCustomVirtual-
TreeOptions. Much work for the effect but at least the latter has to
be done for each descendant with changed options.

I stop babbling now, you get the point and may or may not change it :)

Regards,
Werner

 | Replies | Author | Date
3360 | Re: String options | Mike Lischke | Sun 8/5/2001


re: ContentTo... is very slow

From: GIANNAKOPOULOS KOSTAS [kyan@s...]
Date: Tue Jul 31, 2001 7:31 am
Subject: RE: [VirtualTreeview] ContentTo... is very slow

Well, actually there *could* be another solution: the use of a TMemoryStream
instead of a string. I suspect that most of the string manipulation is
concatenation at the end of the running result. This can be done in a stream
as well (TStream.Write will do it if Position = Size - 1). The performance
will be much better because TMemoryStream objectss grow in increments of 8K
instead of being reallocated each time they grow as strings do.

Of course this would mean rewriting ContentToHTML(), but i think it's worth
it.

<KY>

> > This takes about 30 min with some 7000 nodes.
> > I've seen other trees do this function with TStringList as output.
> > Maybe that's an idea, or maybe Tstream as output.
> > ContentToRTF and other are also very slow.
>
> I have not checked out your example. But I can imagine the string (s)
> is concatenated a whole lot of times. This yields several
> (many) memory
> reallocations (probably with data copy side effect).
>
> Since the string is returned and not a var (out) parameter you cannot
> even set the length to something high to avoid many or all
> reallocations.
> But you can test if my guess is correct: insert this call as
> first line
> of ContentToHTML:
>
> SetLength(result, 10000); // or anything where your HTML


What is the deal with AllocateInternalDataArea in 2.5.13?

From: "Jim Kueneman" [jimdk@m...]
Date: Tue Jul 31, 2001 2:19 pm
Subject: What is the deal with AllocateInternalDataArea in 2.5.13?

Hi Mike,

Why did the assertion in 2.5.13 change from looking at the root
node's child count to checking if the RootNode is nil? This check
will make any derivative of TCustomVirtualStringTree fail when you use
AllocateInternalDataArea in the constructor because after it is called
in TCustomVirtualStringTree it calls InitRootNode and creates the root
node. You can never have more than one level of decendants.

Jim

 | Replies | Author | Date
3305 | Re: What is the deal with AllocateInternalDataAre | Moritz Franckenstein | Tue 7/31/2001
3306 | Re: What is the deal with AllocateInternalDataAre | Moritz Franckenstein | Tue 7/31/2001
3309 | Re: What is the deal with AllocateInternalDataAre | Jim Kueneman | Wed 8/1/2001
3310 | Re: What is the deal with AllocateInternalDataAre | Moritz Franckenstein | Wed 8/1/2001
3361 | Re: What is the deal with AllocateInternalDataAre | Mike Lischke | Sun 8/5/2001


re: What is the deal with AllocateInternalDataArea in 2.5.13?

From: "Moritz Franckenstein" [franckenstein@a...]
Date: Tue Jul 31, 2001 5:34 pm
Subject: Re: What is the deal with AllocateInternalDataArea in 2.5.13?

--- In [VirtualTreeview@y...], "Jim Kueneman" [jimdk@m...] wrote:
> node. You can never have more than one level of decendants.

i fact, you can have no descendants because the vst calls this
function also... :)

mike is currently fixing it, you can safely out-comment the assertion
in AllocateInternalDataArea...

-moritz


re: What is the deal with AllocateInternalDataArea in 2.5.13?

From: "Moritz Franckenstein" [franckenstein@a...]
Date: Tue Jul 31, 2001 5:36 pm
Subject: Re: What is the deal with AllocateInternalDataArea in 2.5.13?

sorry, forget my posting :) i should read more carefully...

-moritz

 | Replies | Author | Date
3309 | Re: What is the deal with AllocateInternalDataAre | Jim Kueneman | Wed 8/1/2001
3310 | Re: What is the deal with AllocateInternalDataAre | Moritz Franckenstein | Wed 8/1/2001


re: Absolute Index

From: [ccdsystems@y...]
Date: Tue Jul 31, 2001 6:00 pm
Subject: Re: Absolute Index

--- In [VirtualTreeview@y...], "Mike Lischke" [lists@l...] wrote:
> > Given an index into the TreeView, how do I get the node? In my
case,
> > the treeview has only root nodes, so the index should be absolute.
> > Later, though, I'd like to be able to find my way even if there
are
> > children, finding a root node with the index of the root node.
> >
> > Getting the first record, and incrementing a counter for every
next
> > until I reach the target node is too slow.
>
> You want to use feature which is against the "nature" of a
treeview. That's the reason why it is
> slow (although with VT it should still be orders of magnitudes
faster compared with TTreeview). With
> VT you cannot access nodes by index because they are organized in
doubly linked lists. I'm afraid
> you will have to change your design or the treeview.
>
> Ciao, Mike

OK, maybe I was looking at my problem too closely. I'm looking for
fast solutions, and so far have found none. I'm hoping someone can
tell me how to use the VT "properly" and get a faster response time
than I'm experiencing now. The situation is thus:

I am using VT as a database viewer into a proprietary data structure
(actually, BTree from Turbopower). We have two TStringLists in
memory: (1) points to all of the entries for a database index, and
each record number of that index, while (2) points to the actual data
loaded for each record, loaded only as required. I load (1) in its
entirety, and it is quite fast, and is loaded in the correct order (0
to number of records on the index), with the correct record number in
the database that it points to. My hope was that I could use the
TStringList.IndexOf routine to return where the record number occurs
in (1), then use that index number to get the correct node out of the
tree. I thought this would be fast, and didn't "violate the
principles of using a Virtual TreeView". I don't want to have to
access each node at this point in time, as that will trigger the
ViewInitNode, which will hit the database and load records into (2)
(which is slow). The code I'm currently using is as follows:

procedure UpDateBrowserScreen(Key : string; Ref : integer);
var
Node : PVirtualNode;
ix : Int64;
begin
// note - FIndexList is TStringList (1)
ix := FIndexList.IndexOf(IntToStr(Ref)); // return the index for
// the record I'm looking
// for
if (ix < 0) then // if not found...
exit;
Node := vtView.GetFirstNode; // Get the first node
// I could use an external counter instead of Node.Index
while assigned(Node) and (Node.Index <> ix) do
Node := vtView.GetNext(Node); // go through a long and lengthy
// process to find the node I'm
// looking for
if assigned(Node) and (Node.Index = ix) then // if I found the
// node...
begin
vtView.FocusedNode := Node; // ...focus it...
vtView.SetFocus;
vtView.ScrollIntoView(Node); // ...and scroll it
// into view.
end;
end;

Now, I suppose I could store a separate Index field in the data being
pointed to by Node, then search for it, instead of relying on
Node.Index, but that would be faster only if there is a better search
method to access it, and a way to differentiate between initializing
the nodes for a search (which would not require a hit on the
database) vs. initializing the nodes for display/access (which would
require the data from the database).

Any assistance from anyone who has done this sort of thing before
would help greatly. Saying that this type of processing should not
be done is like telling the child that the pain is all in his head...

Daniel


re: Re: Absolute Index

From: Werner Lehmann [wl@b...]
Date: Tue Jul 31, 2001 6:20 pm
Subject: Re: [VirtualTreeview] Re: Absolute Index

[ccdsystems@y...] wrote:
>
> OK, maybe I was looking at my problem too closely. I'm looking for
> fast solutions, and so far have found none. I'm hoping someone can
> tell me how to use the VT "properly" and get a faster response time
> than I'm experiencing now. The situation is thus:
>
> I am using VT as a database viewer into a proprietary data structure
> (actually, BTree from Turbopower). We have two TStringLists in
> memory: (1) points to all of the entries for a database index, and
> each record number of that index, while (2) points to the actual data
> loaded for each record, loaded only as required. I load (1) in its
> entirety, and it is quite fast, and is loaded in the correct order (0
> to number of records on the index), with the correct record number in
> the database that it points to. My hope was that I could use the
> TStringList.IndexOf routine to return where the record number occurs
> in (1), then use that index number to get the correct node out of the
> tree. I thought this would be fast, and didn't "violate the
> principles of using a Virtual TreeView". I don't want to have to
> access each node at this point in time, as that will trigger the
> ViewInitNode, which will hit the database and load records into (2)
> (which is slow). The code I'm currently using is as follows:

I suggest this:

(a) your data does not change (in order, no inserts), you only want a
view of it. Set the rootnodecount to the count of stringlist 1. Use
OnInitNode to retrieve the data (via stringlist 2 or whatever) and Node.
Index as an index to stringlist 1. Of course, this uses the sort order
of stringlist 1. May not be appropriate. But that's up to you.

(b) your data does change. Set rootnodecount to number of items in
stringlist 1, manually init all nodes with a unique ID which allows you
to identify the node data without actually fetching it at that time (maybe
record number). Then, in OnGetText (and everywhere where you need the node
data), get the data if not already done and fully init the node. Note that
you don't get OnInitNode event if you init the nodes manually. Or maybe
you still get them if vsInitialized is not in the node state...

Werner


re: What is the deal with AllocateInternalDataArea in 2.5.13?

From: "Jim Kueneman" [jimdk@m...]
Date: Wed Aug 1, 2001 1:56 am
Subject: Re: What is the deal with AllocateInternalDataArea in 2.5.13?

--- In [VirtualTreeview@y...], "Moritz Franckenstein"

> sorry, forget my posting :) i should read more carefully...

Why, I thought it summed up the issue exactly what did you think of to
make you retract your observation?

Jim

 | Replies | Author | Date
3310 | Re: What is the deal with AllocateInternalDataAre | Moritz Franckenstein | Wed 8/1/2001


re: What is the deal with AllocateInternalDataArea in 2.5.13?

From: "Moritz Franckenstein" [franckenstein@a...]
Date: Wed Aug 1, 2001 10:07 am
Subject: Re: What is the deal with AllocateInternalDataArea in 2.5.13?

--- In [VirtualTreeview@y...], "Jim Kueneman" [jimdk@m...] wrote:
> --- In [VirtualTreeview@y...], "Moritz Franckenstein"
>
> > sorry, forget my posting :) i should read more carefully...
>
> Why, I thought it summed up the issue exactly what did you think of
to
> make you retract your observation?

yes, it was correct, but it was meant to be the opposite of what you
said, which it was not, it was the same :)

-moritz


with loading columns

From: "Moritz Franckenstein" [franckenstein@a...]
Date: Wed Aug 1, 2001 1:59 pm
Subject: with loading columns

hi,

in my derived component i create to standard columns in the
constructor but i also publish the header property so that the
columns can be edited.
everything works, i can add or remove columns from the object
inspector, but when i remove all columns, my standard columns are
there again. how can i accomplish that they are overwritten (deleted)
in this case?

while trying to find out what happens, i have found
TVirtualTreeColumns.LoadFromStream, but it is never called. i think i
dont understand the concept how properties are loaded... can someone
explain that to me?

thank you,
-moritz

 | Replies | Author | Date
3318 | Re: with loading columns | GIANNAKOPOULOS KOSTAS | Thu 8/2/2001
3319 | Re: with loading columns | Moritz Franckenstein | Thu 8/2/2001


GetText/GetIndex - Column 0 image appears without text

From: [ccdsystems@y...]
Date: Wed Aug 1, 2001 5:08 pm
Subject: GetText/GetIndex - Column 0 image appears without text

I am having difficulty in getting my image and text to appear in the
same column together. When I set breakpoints in the GetText and
GetImage routines, I noticed the following pattern occurred for each
record:

GetText, Node 0, Column 0
GetText, Node 0, Column 1
GetText, Node 0, Column 2
GetText, Node 0, Column 3
GetImage, Node 0, Column 0
GetImage, Node 0, Column 0 { This should call GetText, no? }
GetImage, Node 0, Column 1
GetText, Node 0, Column 1
GetImage, Node 0, Column 2
GetText, Node 0, Column 2
GetImage, Node 0, Column 3
GetText, Node 0, Column 3

GetText, Node 1 Column 0
...

When I click on the first line, the progression is like this:

GetImage, Node 0, Column 0
GetImage, Node 0, Column 0
GetText, Node 0, Column 0
GetImage, Node 0, Column 0
GetText, Node 0, Column 0
GetText, Node 0, Column 1
GetText, Node 0, Column 2
GetText, Node 0, Column 3
GetImage, Node 0, Column 0
GetImage, Node 0, Column 1
GetText, Node 0, Column 1
GetImage, Node 0, Column 2
GetText, Node 0, Column 2
GetImage, Node 0, Column 3
GetText, Node 0, Column 3
GetText, Node 1, Column 0
GetText, Node 1, Column 1
GetText, Node 1, Column 2
GetText, Node 1, Column 3
GetImage, Node 1, Column 0
GetImage, Node 1, Column 0
GetImage, Node 1, Column 1
GetText, Node 1, Column 1
GetImage, Node 1, Column 2
GetText, Node 1, Column 2
GetImage, Node 1, Column 3
GetText, Node 1, Column 3

... and the net result is that the image disappears and the text
appears. It's almost like the text and the image can't co-exist in
the same column? Is there a switch somewhere that we're missing?

Daniel

 | Replies | Author | Date
3313 | Re: GetText/GetIndex - Column 0 image appears wit | [ccdsystems@y...] | Wed 8/1/2001
3314 | Re: GetText/GetIndex - Column 0 image appears wit | Werner Lehmann | Wed 8/1/2001
3315 | Re: GetText/GetIndex - Column 0 image appears wit | [ccdsystems@y...] | Wed 8/1/2001
3316 | Re: GetText/GetIndex - Column 0 image appears wit | Jim Kueneman | Wed 8/1/2001


re: GetText/GetIndex - Column 0 image appears without text

From: [ccdsystems@y...]
Date: Wed Aug 1, 2001 6:13 pm
Subject: Re: GetText/GetIndex - Column 0 image appears without text

--- In [VirtualTreeview@y...], [ccdsystems@y...] wrote:
> I am having difficulty in getting my image and text to appear in
the
> same column together. When I set breakpoints in the GetText and
> GetImage routines, I noticed the following pattern occurred for
each
> record:
>
> ( useful data snipped for brevity )
>
> Daniel

I logged the calls to InitNode, GetText and GetImage for my 32 row, 6
column table, with notes to indicate what happened and where. I
expect this would be useful to Mike or anyone else who has access to
the VT code for debugging. Some things I've noticed:

- GetImage doesn't get called when a line on the display is
selected. Any image that was originally painted on the row
disappears.
- When initializing the screen for the first time, GetImage is called
twice for each node, column 0, first with a Kind of ikNormal, then
with a Kind of ikOverlay, but GetText isn't called at this time for
column 0. All other columns, however, get called with GetImage with
a Kind of ikNormal, then a following GetText.
- If Icons are displayed for columns > 0, they display with the text
on the first paint.

Hope this helps,

Daniel


re: GetText/GetIndex - Column 0 image appears without text

From: Werner Lehmann [wl@b...]
Date: Wed Aug 1, 2001 6:21 pm
Subject: Re: [VirtualTreeview] GetText/GetIndex - Column 0 image appears without text

Hi Daniel,

> ... and the net result is that the image disappears and the text
> appears. It's almost like the text and the image can't co-exist in
> the same column? Is there a switch somewhere that we're missing?

Please show us your OnGetText and OnGetImageIndex event handlers...

Regards,
Werner

 | Replies | Author | Date
3315 | Re: GetText/GetIndex - Column 0 image appears wit | [ccdsystems@y...] | Wed 8/1/2001
3316 | Re: GetText/GetIndex - Column 0 image appears wit | Jim Kueneman | Wed 8/1/2001


re: GetText/GetIndex - Column 0 image appears without text

From: [ccdsystems@y...]
Date: Wed Aug 1, 2001 8:06 pm
Subject: Re: GetText/GetIndex - Column 0 image appears without text

--- In [VirtualTreeview@y...], Werner Lehmann [wl@b...] wrote:
> Hi Daniel,
>
> > ... and the net result is that the image disappears and the text
> > appears. It's almost like the text and the image can't co-exist
in
> > the same column? Is there a switch somewhere that we're missing?
>
> Please show us your OnGetText and OnGetImageIndex event handlers...
>
> Regards,
> Werner

I've whacked a chunk out for the sake of brevity, but I believe all
of the critical stuff is there. The unusual way of handling the
GetText, while I don't think it should impact the VT at all, is
because this code was originally using the FVCBrowser supplied by
TurboPower for browsing BTree databases...

Type
TListRec = record
case RecType : etFiles of
dbNone : (NotInitialized : boolean);
dbPatient : (Pat : rtPatient);
dbAdmission : (Adm : rtAdmission);
dbHistory : (Hist : rtHistory);
dbRadExam : (Rad : rtRadExam);
end;

function TFileDef.BrowserLine(const Rec; KeyNr : byte; Width : byte;
const column : integer) : string;

var
lRec : TListRec;
ColNo : integer;
Value : string;

procedure Col(const St : string;
const wid : integer);
begin
if (ColNo = Column) then
Value := St;
inc(ColNo);
end;

begin
Result := '';
if (KeyNr = 0) then
exit;
if (Column < 0) then
exit;
ColNo := 0;
Value := '';
move(Rec, lRec, SizeOf(TListRec));
case FFileID of
dbPatient :
with lRec.Pat do
begin
case KeyNr of
PatientNameKeyN :
begin
Col(PatientName,30);
Col(UnitNumber,15);
Col(FormattedDate(BirthDate),15);
Col(Trim(PostalCode),11);
Col(Address3,30);
Col(PhoneNumber,15);
end;
end; {case}
end;
else
begin
Value := '-----';
end;
end; {case}
Result := Value;
end;

procedure TPopBrowser.vtViewGetText(Sender: TBaseVirtualTree;
Node: PVirtualNode; Column: Integer; TextType: TVSTTextType;
var Text: WideString);
var
RecNum : longint;
TempRec : TListRec;
begin
move(Node.Data, TempRec, SizeOf(TListRec));
if TempRec.notInitialized then
begin
if ReturnRec(Node.Index, RecNum) then
begin
{ this always sets notInitialized to FALSE }
BTGetRec(CurrFB{FileArray[FFileToBrowse]}, RecNum, CurrRec,
true);
move(CurrRec, TempRec.NotInitialized, CurrFileDef.RecordSize);
TempRec.RecType := CurrFileDef.FileID;
Move(TempRec, Node.Data, SizeOf(TListRec));
end;
end;
Text := CurrFileDef.BrowserLine(Node.Data,FKeyNr,MaxCols, Column);
end;

procedure TPopBrowser.vtViewGetImageIndex(Sender: TBaseVirtualTree;
Node: PVirtualNode; Kind: TVTImageKind; Column: Integer;
var Index: Integer);
var
Data : TListRec;
begin
if (Column = 0) then
begin
move(Node.Data, Data, SizeOf(TListRec));
case Data.RecType of
dbPatient : Index := 0;
dbAdmission : Index := 1;
dbHistory : Index := 2;
dbRadExam : Index := 3;
end; {Case}
end;
end;

 | Replies | Author | Date
3316 | Re: GetText/GetIndex - Column 0 image appears wit | Jim Kueneman | Wed 8/1/2001


re: GetText/GetIndex - Column 0 image appears without text

From: "Jim Kueneman" [jimdk@m...]
Date: Wed Aug 1, 2001 9:55 pm
Subject: Re: GetText/GetIndex - Column 0 image appears without text

--- In [VirtualTreeview@y...], [ccdsystems@y...] wrote:

Not to jump in on Werner but try this:

> procedure TPopBrowser.vtViewGetImageIndex(Sender: TBaseVirtualTree;
> Node: PVirtualNode; Kind: TVTImageKind; Column: Integer;
> var Index: Integer);
> var
> Data : TListRec;
> begin
> if (Column = 0) and((Kind = ikNormal) or (Kind = ikSelected)) then
> begin
> move(Node.Data, Data, SizeOf(TListRec));
> case Data.RecType of
> dbPatient : Index := 0;
> dbAdmission : Index := 1;
> dbHistory : Index := 2;
> dbRadExam : Index := 3;
> end; {Case}
> end;
> end;

I think it is because you are returning indexes for non-existant
overlays

Jim


re: Re: GetText/GetIndex - Column 0 image appears without text

From: Werner Lehmann [wl@b...]
Date: Wed Aug 1, 2001 10:40 pm
Subject: Re: [VirtualTreeview] Re: GetText/GetIndex - Column 0 image appears without text

Hi Daniel,

you copy the node data several times. I have no idea why. Furthermore, you
also copy the internal node data which is at the beginning of Node.Data. The
stringtree uses this internal data area to cache a nodewidth for the maincolumn.
Your copying gets the record from a wrong offset. Also, copying the data each
time is rather useless. At least I don't see the point.

Why not:

procedure TPopBrowser.vtViewGetImageIndex(Sender: TBaseVirtualTree;
Node: PVirtualNode; Kind: TVTImageKind; Column: Integer;
var Index: Integer);
var
Data : PListRec; // <- pointer!
begin
if (Column = 0) and (Kind = ikNormal) then // <- check kind!
begin
Data := Sender.GetNodeData(Node);
// move(Node.Data, Data, SizeOf(TListRec));
Index := Ord(Data.RecType); // <- requires enum order as in case statement!
(*case Data.RecType of
dbPatient : Index := 0;
dbAdmission : Index := 1;
dbHistory : Index := 2;
dbRadExam : Index := 3;
end; {Case}*)
end;
end;

Untested. And OnGetText similarly. BTW, you seem to have ansistrings in your
record data. Don't forget to finalize that data, at least in OnFreeNode:

OnFreeNode:

Finalize(PListRec(GetNodeData));

And define a record pointer type:

Type
PListRec = ^TListRec;
TListRec = record
...

Regards,
Werner

 | Replies | Author | Date
3320 | Re: GetText/GetIndex - Column 0 image appears wi | Werner Lehmann | Thu 8/2/2001
3325 | Re: GetText/GetIndex - Column 0 image appears wi | [ccdsystems@y...] | Thu 8/2/2001
3327 | Re: GetText/GetIndex - Column 0 image appears wi | Jim Kueneman | Thu 8/2/2001
3328 | Re: GetText/GetIndex - Column 0 image appears wi | [ccdsystems@y...] | Thu 8/2/2001
3326 | Re: GetText/GetIndex - Column 0 image appears wi | Vadim Sedulin | Thu 8/2/2001


re: with loading columns

From: GIANNAKOPOULOS KOSTAS [kyan@s...]
Date: Thu Aug 2, 2001 7:54 am
Subject: RE: [VirtualTreeview] with loading columns

> in my derived component i create to standard columns in the
> constructor but i also publish the header property so that the
> columns can be edited.
> everything works, i can add or remove columns from the object
> inspector, but when i remove all columns, my standard columns are
> there again. how can i accomplish that they are overwritten (deleted)
> in this case?
>
> while trying to find out what happens, i have found
> TVirtualTreeColumns.LoadFromStream, but it is never called. i think i
> dont understand the concept how properties are loaded... can someone
> explain that to me?

Well, since you create your std columns in your constructor, you would
expect them to be created every time an instance of your component is
created and at that time you can't know whether any columns have been stored
in the DFM, so i don't think there is a clear solution to this, unless you
change your logic a little bit.

Don't look at LoadFromStream, it is not used while streaming. What happens
is that TReader.ReadCollection is called, which repeatedly reads collection
items (in your case TVirtualTreeColumn items) until it reaches an
end-of-list indicator, calls TCollection.Add on TVirtualTreeColumn and then
reads the properties of each new column object from the stream and assigns
them.

If you have a way of knowing whether the component has standard columns (eg.
via a property "DefaultColumns") you can use a "stored" function to prevent
writing the std columns to the dfm stream. Now, if the TVirtualTreeColumns
collection class had an OnChange event handler you could hook in it so that
you clear the DefaultColumns property if the user changed anything in the
columns collection. If the user would set DefaultColumns back to true then
you would delete all columns and recreate the std ones What i describe is
similar to the "Font/ParentFont" logic of TWinControl, or the TDBGrid's
columns. The only problem is that there is no OnChange event handler in
TVirtualTreeColumns and no decent way to replace them with your own
descendant (actually, there is one but it is very dirty). So the user should
be aware that if he sets "DefaultColumns" to true, any modifications he
makes to the columns will not be saved in the DFM.

You might want to take a look at TDBGrid.Columns or TDataset.Fields for
similar situations.

<KY>

 | Replies | Author | Date
3319 | Re: with loading columns | Moritz Franckenstein | Thu 8/2/2001


re: with loading columns

From: "Moritz Franckenstein" [franckenstein@a...]
Date: Thu Aug 2, 2001 8:16 am
Subject: Re: with loading columns

> Well, since you create your std columns in your constructor, you
would
> expect them to be created every time an instance of your component
is
> created and at that time you can't know whether any columns have
been stored
> in the DFM, so i don't think there is a clear solution to this,
unless you
> change your logic a little bit.
>
> Don't look at LoadFromStream, it is not used while streaming. What
happens
> is that TReader.ReadCollection is called, which repeatedly reads
collection
> items (in your case TVirtualTreeColumn items) until it reaches an
> end-of-list indicator, calls TCollection.Add on TVirtualTreeColumn
and then
> reads the properties of each new column object from the stream and
assigns
> them.

procedure TReader.ReadCollection(Collection: TCollection);
var
Item: TPersistent;
begin
Collection.BeginUpdate;
try
if not EndOfList then Collection.Clear;
while not EndOfList do
begin

and here we see the problem. the collection is not cleared when there
are no columns stored. thats bad.

is it possible in my constructor to find out if my component is newly
dropped on a form? this is the only situation where the creation of
my standard columns is needed. after that they are stored in the dfm
and always can be loaded from there.

-moritz


re: Re: GetText/GetIndex - Column 0 image appears without text

From: Werner Lehmann [wl@b...]
Date: Thu Aug 2, 2001 8:22 am
Subject: Re: [VirtualTreeview] Re: GetText/GetIndex - Column 0 image appears without text

Jim Kueneman wrote:
>
> --- In [VirtualTreeview@y...], [ccdsystems@y...] wrote:
>
> Not to jump in on Werner but try this:

No problem. Apparently I forgot ikSelected (and Kind in [ikNormal, ikSelected]).
But the move() should still be a problem.

Werner

> > procedure TPopBrowser.vtViewGetImageIndex(Sender: TBaseVirtualTree;
> > Node: PVirtualNode; Kind: TVTImageKind; Column: Integer;
> > var Index: Integer);
> > var
> > Data : TListRec;
> > begin
> > if (Column = 0) and((Kind = ikNormal) or (Kind = ikSelected)) then
> > begin
> > move(Node.Data, Data, SizeOf(TListRec));
> > case Data.RecType of
> > dbPatient : Index := 0;
> > dbAdmission : Index := 1;
> > dbHistory : Index := 2;
> > dbRadExam : Index := 3;
> > end; {Case}
> > end;
> > end;


How many visible children?

From: Michael Valentiner=Branth [MichaelVB@g...]
Date: Thu Aug 2, 2001 10:47 am
Subject: How many visible children?

Hi all,

until now I could not find out how to use IncrementalSearch in VT, and
I didn't find an example for it.

But using IterateSubtree and the search-condition to switch IsVisible
for each node works fine and fast.

My problem is: It happens, that all child-nodes of a node are switched
invisible. In this case I want to set the parent node invisible too (I
only have level1 and level0-nodes in my tree).

Is there a function to find out, how many child-nodes of a node are
*visible*? Or do I have to iterate again and count ...?

Would IncrementalSearch do this job for me? And how?

Michael

 | Replies | Author | Date
3413 | Re: How many visible children? | Mike Lischke | Fri 8/10/2001
3427 | Re: How many visible children? | Michael Valentiner=Branth | Sun 8/12/2001


Exception while editing locks up VTreeview

From: [zh66w6@h...]
Date: Thu Aug 2, 2001 11:57 am
Subject: Exception while editing locks up VTreeview

I've found that if an exception occurs while editing a treeview node,
it is impossible to leave the editing state (pressing escape, calling
EndNodeEdit etc.). Also, invisible characters seem to be added at the
end of the line.

To test this out, try throwing an exception in the OnNewText event.

Anybody else had this problem?

 | Replies | Author | Date
3323 | Re: Exception while editing locks up VTreeview | [zh66w6@h...] | Thu 8/2/2001
3414 | Re: Exception while editing locks up VTreeview | Mike Lischke | Fri 8/10/2001


re: Exception while editing locks up VTreeview

From: [zh66w6@h...]
Date: Thu Aug 2, 2001 12:25 pm
Subject: Re: Exception while editing locks up VTreeview

A quick fix for this problem is:

function TStringEditLink.EndEdit: Boolean;
begin
Result := not FStopping;
if Result then
begin
FStopping := True;
Try
if FEdit.Modified then
FTree.DoNewText(FNode, FColumn, FEdit.Caption);
FEdit.Hide;
except
FStopping := FALSE;
Result := FALSE;
raise;
end;
end;
end;

Problem is, the exception is thrown twice, but at least you can exit
the edit state.

Cheers, Paul

--- In [VirtualTreeview@y...], [zh66w6@h...] wrote:
> I've found that if an exception occurs while editing a treeview
node,
> it is impossible to leave the editing state (pressing escape,
calling
> EndNodeEdit etc.). Also, invisible characters seem to be added at
the
> end of the line.
>
> To test this out, try throwing an exception in the OnNewText event.
>
> Anybody else had this problem?

 | Replies | Author | Date
3414 | Re: Exception while editing locks up VTreeview | Mike Lischke | Fri 8/10/2001


prob with UpdateHorizontalScrollBar and GetMaxRightExtend

From: "Moritz Franckenstein" [franckenstein@a...]
Date: Thu Aug 2, 2001 2:47 pm
Subject: prob with UpdateHorizontalScrollBar and GetMaxRightExtend

in my component i add new nodes in DoInitNode which now works after
some changes by mike.

now i have the problem that it doesnt work when columns are not used
(only the main column as -1).

i have found the problem in UpdateHorizontalScrollBar which is called
when a new node is added.
there it calls GetMaxRightExtend if there are no columns. and this
function initalizes nodes which causes the problem (endless loop in
DoInitNode).

i have investigated it a long time but dont find a solution. i have
tried a lot of things with beginupdate/endupdate but it only moved
the problem so that it occurs after endupdate is called.

can anyone help?

-moritz


re: GetText/GetIndex - Column 0 image appears without text

From: [ccdsystems@y...]
Date: Thu Aug 2, 2001 3:34 pm
Subject: Re: GetText/GetIndex - Column 0 image appears without text

--- In [VirtualTreeview@y...], Werner Lehmann [wl@b...] wrote:
> Hi Daniel,
>
> you copy the node data several times. I have no idea why.
Furthermore, you
> also copy the internal node data which is at the beginning of
Node.Data. The
> stringtree uses this internal data area to cache a nodewidth for
the maincolumn.

As there is no "SetNodeData" (I see this as an oversight), I need to
use a Move command to get the data into Node.Data. There is no
reference in anything I've seen yet that indicates a protected
section of Node.Data.

> Your copying gets the record from a wrong offset. Also, copying the
data each
> time is rather useless. At least I don't see the point.

When I replace my "MyVar : TListRec" references with "MyVar :
PListRec", and use GetNodeData instead of a Move command, the data is
offset in the MyVar record. If there is a special offset I should be
avoiding, then how do I initialize Node.Data correctly? There is no
SetNodeData that allows me to avoid unknowables like this.

> Why not:
>
> procedure TPopBrowser.vtViewGetImageIndex(Sender: TBaseVirtualTree;
> Node: PVirtualNode; Kind: TVTImageKind; Column: Integer;
> var Index: Integer);
> var
> Data : PListRec; // <- pointer!
> begin
> if (Column = 0) and (Kind = ikNormal) then // <- check kind!

(BTW, this line makes no difference in the real problem - icons and
text don't mix in the first column only. All subsequent columns work
fine, except for the fact that GetImageIndex doesn't get called at
any time after the original VT gets painted...)

> begin
> Data := Sender.GetNodeData(Node);
> // move(Node.Data, Data, SizeOf(TListRec));
> Index := Ord(Data.RecType); // <- requires enum order as in
case statement!
> (*case Data.RecType of
> dbPatient : Index := 0;
> dbAdmission : Index := 1;
> dbHistory : Index := 2;
> dbRadExam : Index := 3;
> end; {Case}*)
> end;
> end;
>
> Untested. And OnGetText similarly. BTW, you seem to have
ansistrings in your
> record data.

Actually, the record data contains shortStrings only (and is
packed). The data comes from a database that is being accessed
through Borland Pascal 7.0 programs, and in BP7.0, shortstrings are
much easier to use than ansistrings.

> Don't forget to finalize that data, at least in OnFreeNode:
>
> OnFreeNode:
>
> Finalize(PListRec(GetNodeData));

I don't believe I need to do this, but it's better to be safe than
sorry - I will check into this. My InitNode routine is included
below for reference.

> And define a record pointer type:
>
> Type
> PListRec = ^TListRec;
> TListRec = record
> ...
>
>
> Regards,
> Werner

Thank you for your points about finalizing the data - I had forgotten
to do this.

As for the other "wierd" stuff in my code, this is my attempt to get
a VT to work at all... I understand that Mike has his hands more
than full, and he's not getting any support from work now, but if
there are any issues that are not intuitive (like protected sections
of Node.Data), these should be documented somewhere, in a "Watch Out
for These" type of section. While my methods in the other stuff may
be "unorthodox", they work, and when the entire app works, I will re-
write potentially problematic code. If my methods are causing a
memory overwrite somewhere, then I will fix it ASAP, as it is
probably trashing other stuff too. But, I don't see this as the
case. I may be moving data excessively, but it isn't impacting speed
much (not my issue), and it seems to be working. If anyone can
indicate a genuine problem in the code, then you'll find me very
attentive and willing to change.

-----

procedure TPopBrowser.vtViewInitNode(Sender: TBaseVirtualTree;
ParentNode, Node: PVirtualNode;
var InitialStates:
TVirtualNodeInitStates);
var
lRec : TListRec;
begin
FillChar(lRec, SizeOf(lRec), #0);
lRec.notInitialized := true;
Move(lRec, Node.Data, SizeOf(lRec)); { Set NotInitialized flag }
end;

(BTW, the following code occurs before any InitNodes are ever called:

vtView.NodeDataSize := SizeOf(TListRec);
vtView.RootNodeCount := 0;

)

Daniel

 | Replies | Author | Date
3327 | Re: GetText/GetIndex - Column 0 image appears wi | Jim Kueneman | Thu 8/2/2001
3328 | Re: GetText/GetIndex - Column 0 image appears wi | [ccdsystems@y...] | Thu 8/2/2001


re: Re: GetText/GetIndex - Column 0 image appears without text

From: "Vadim Sedulin" [wsntrl@o...]
Date: Thu Aug 2, 2001 4:31 pm
Subject: Re: [VirtualTreeview] Re: GetText/GetIndex - Column 0 image appears without text

Hello Daniel!

> As there is no "SetNodeData" (I see this as an oversight), I need to
> use a Move command to get the data into Node.Data. There is no
> reference in anything I've seen yet that indicates a protected
> section of Node.Data.
>
> > Your copying gets the record from a wrong offset. Also, copying the
> data each
> > time is rather useless. At least I don't see the point.
>
> When I replace my "MyVar : TListRec" references with "MyVar :
> PListRec", and use GetNodeData instead of a Move command, the data is
> offset in the MyVar record. If there is a special offset I should be
> avoiding, then how do I initialize Node.Data correctly? There is no
> SetNodeData that allows me to avoid unknowables like this.

Node.Data was introduced for internal use only and will be removed sooner (I
think).
GetNodeData returns pointer to user data area inside TVirtualNode which is
NodeDataSize bytes long. Think of it as "@Node.Data" or PListRec.

Bye.

Vadim Sedulin
E-Mail: [wsntrl@o...]


re: GetText/GetIndex - Column 0 image appears without text

From: "Jim Kueneman" [jimdk@m...]
Date: Thu Aug 2, 2001 4:42 pm
Subject: Re: GetText/GetIndex - Column 0 image appears without text

Hi Daniel

> When I replace my "MyVar : TListRec" references with "MyVar :
> PListRec", and use GetNodeData instead of a Move command, the data
is
> offset in the MyVar record. If there is a special offset I should
be
> avoiding, then how do I initialize Node.Data correctly? There is no
> SetNodeData that allows me to avoid unknowables like this.

GetNodeData should work. Since is does not it makes me very
suspicious. Are you using the UserData parameter in AddChild or
InsertNode? That is intended for a quick 4 byte user data field (like
a pointer to memory you allocate). Leave it nil (default).

Is this what you tried?

In the vtViewOnCreate event

vtView.RootNodeCount := 0;
vtView.NodeDataSize := SizeOf(TListRec);

procedure TPopBrowser.vtViewInitNode(Sender: TBaseVirtualTree;

ParentNode, Node: PVirtualNode; var InitialStates:
VirtualNodeInitStates);
var
lRec : PListRec;
begin
lRec := Sender.GetNodeData(Node);
FillChar(lRec^, SizeOf(lRec^), #0);
lRec^.notInitialized := true;
end;

procedure TPopBrowser.vtViewGetText(Sender: TBaseVirtualTree; Node:
PVirtualNode; Column: Integer; TextType: TVSTTextType; var Text:
WideString);
var
RecNum : longint;
TempRec : PListRec;
begin
TempRec := Sender.GetNodeData(Node);
if TempRec^.notInitialized then
begin
if ReturnRec(Node.Index, RecNum) then
begin

// To be honest I am not sure what is going on here so
// I am faking it <g>
{ this always sets notInitialized to FALSE }
BTGetRec(CurrFB{FileArray[FFileToBrowse]}, RecNum, CurrRec,
true);
move(CurrRec, TempRec^.NotInitialized, CurrFileDef.RecordSize);
TempRec^.RecType := CurrFileDef.FileID;
// Don't need this since working on the actual stored data
{Move(TempRec, Node.Data, SizeOf(TListRec));
end;}
end;
{ Change BrowerLine to take a PListRec }
Text := CurrFileDef.BrowserLine(TempRec,FKeyNr,MaxCols, Column);
end;

Jim

 | Replies | Author | Date
3328 | Re: GetText/GetIndex - Column 0 image appears wi | [ccdsystems@y...] | Thu 8/2/2001


re: GetText/GetIndex - Column 0 image appears without text

From: [ccdsystems@y...]
Date: Thu Aug 2, 2001 5:49 pm
Subject: Re: GetText/GetIndex - Column 0 image appears without text

--- In [VirtualTreeview@y...], "Jim Kueneman" [jimdk@m...] wrote:
>
> Hi Daniel
>
> > When I replace my "MyVar : TListRec" references with "MyVar :
> > PListRec", and use GetNodeData instead of a Move command, the
data
> is
> > offset in the MyVar record. If there is a special offset I
should
> be
> > avoiding, then how do I initialize Node.Data correctly? There is
no
> > SetNodeData that allows me to avoid unknowables like this.
>
>
> GetNodeData should work. Since is does not it makes me very
> suspicious. Are you using the UserData parameter in AddChild or
> InsertNode? That is intended for a quick 4 byte user data field
(like
> a pointer to memory you allocate). Leave it nil (default).
>
> Is this what you tried?
>
> In the vtViewOnCreate event
>
> vtView.RootNodeCount := 0;
> vtView.NodeDataSize := SizeOf(TListRec);
>
>
> procedure TPopBrowser.vtViewInitNode(Sender:
TBaseVirtualTree;

> ParentNode, Node: PVirtualNode; var InitialStates:
> VirtualNodeInitStates);
> var
> lRec : PListRec;
> begin
> lRec := Sender.GetNodeData(Node);
> FillChar(lRec^, SizeOf(lRec^), #0);
> lRec^.notInitialized := true;
> end;
>
> procedure TPopBrowser.vtViewGetText(Sender: TBaseVirtualTree; Node:
> PVirtualNode; Column: Integer; TextType: TVSTTextType; var Text:
> WideString);
> var
> RecNum : longint;
> TempRec : PListRec;
> begin
> TempRec := Sender.GetNodeData(Node);
> if TempRec^.notInitialized then
> begin
> if ReturnRec(Node.Index, RecNum) then
> begin
>
> // To be honest I am not sure what is going on here so
> // I am faking it <g>
> { this always sets notInitialized to FALSE }
> BTGetRec(CurrFB{FileArray[FFileToBrowse]}, RecNum, CurrRec,
> true);
> move(CurrRec, TempRec^.NotInitialized, CurrFileDef.RecordSize);
> TempRec^.RecType := CurrFileDef.FileID;
> // Don't need this since working on the actual stored data
> {Move(TempRec, Node.Data, SizeOf(TListRec));
> end;}
> end;
> { Change BrowerLine to take a PListRec }
> Text := CurrFileDef.BrowserLine(TempRec,FKeyNr,MaxCols, Column);
> end;
>
> Jim

Y'know, Jim, for "not [being] sure what is going on here", you hit
the nail on the head. Unfortunately, I found this out myself, after
rooting through the VT calls, and implemented the fix before I read
your message, still, your InitNode call was cleaner than mine -
thanks.

I think I've got it now. Because I was directly accessing Node.Data
instead of using GetNodeData (because I thought it returned the data,
not a pointer - serves me right for not looking closer), I was
overwriting the first few bytes of Node.Data, which I believe is
being used to store some internal-type stuff. This was causing my
column 0 to go to lunch. Changing these calls to pointers (properly)
corrected these issues. Thank you all for your patience in helping
me with this.

Daniel


Searching...

From: [ccdsystems@y...]
Date: Thu Aug 2, 2001 5:50 pm
Subject: Searching...

Is there any word on building in some sort of search functionality
into the VT? The method I'm using seems to work (querying the
database itself, then searcing for the Record Number in the VT), and
it conforms to the paradigm "a VT doesn't know about its data", but I
could see a lot of flexibility available if we could search in a VT
(like, show me a list of all records that have "Bill" in any
displayed field, whether it be name, address, or whatnot - database
queries like this can get messy).

Thanks,

Daniel

 | Replies | Author | Date
3332 | Re: Searching... | Werner Lehmann | Thu 8/2/2001


OnKeyPress

From: "Anders Thomsen" [anders@t...]
Date: Thu Aug 2, 2001 7:05 pm
Subject: OnKeyPress

Hi,

After updating to the newest version, OnKeyPress does nothing anymore.

Any comments on that?

-Thomsen

[Non-text portions of this message have been removed]

 | Replies | Author | Date
3412 | Re: OnKeyPress | Mike Lischke | Fri 8/10/2001


re: prob with UpdateHorizontalScrollBar and GetMaxRightExtend

From: Werner Lehmann [wl@b...]
Date: Thu Aug 2, 2001 10:24 pm
Subject: Re: [VirtualTreeview] prob with UpdateHorizontalScrollBar and GetMaxRightExtend

Hi Moritz,
>
> i have investigated it a long time but dont find a solution. i have
> tried a lot of things with beginupdate/endupdate but it only moved
> the problem so that it occurs after endupdate is called.

If you cannot find a better place to add your nodes you have still the
two usual methods to break the loop:

- in OnInitNode check if nodes to be added are already there, maybe by
using a local const, serves as static var

- send a message (WM_USER) to your tree in OnInitNode and add the nodes
in that message handler

Werner

 | Replies | Author | Date
3344 | Re: prob with UpdateHorizontalScrollBar and GetM | Moritz Franckenstein | Fri 8/3/2001
3347 | Re: prob with UpdateHorizontalScrollBar and GetM | Werner Lehmann | Fri 8/3/2001
3352 | Re: prob with UpdateHorizontalScrollBar and GetM | Moritz Franckenstein | Sat 8/4/2001


re: Searching...

From: Werner Lehmann [wl@b...]
Date: Thu Aug 2, 2001 10:47 pm
Subject: Re: [VirtualTreeview] Searching...

[ccdsystems@y...] wrote:
>
> Is there any word on building in some sort of search functionality
> into the VT? The method I'm using seems to work (querying the
> database itself, then searcing for the Record Number in the VT), and
> it conforms to the paradigm "a VT doesn't know about its data", but I
> could see a lot of flexibility available if we could search in a VT
> (like, show me a list of all records that have "Bill" in any
> displayed field, whether it be name, address, or whatnot - database
> queries like this can get messy).

Check out incremental search. Hook up event OnIncrementalSearch (do the
search with the provided search text on all columns you like to search
in) and change incremental search properties as needed.

Werner


Right way to use VT

From: "Jim Kueneman" [jimdk@m...]
Date: Thu Aug 2, 2001 10:50 pm
Subject: Right way to use VT

What is the right way to create nodes and child nodes in VT? Both
AddChild and InsertNode have this disclaimer:

"AddChild/InsertNode is a compatibility method and will implicitly
validate the parent node. This is however against the virtual paradigm
and hence I dissuade from its usage."

What other way is there?

Jim

 | Replies | Author | Date
3335 | Re: Right way to use VT | [adembaba@e...] | Fri 8/3/2001
3340 | Re: Right way to use VT | Jim Kueneman | Fri 8/3/2001
3337 | Re: Right way to use VT | Werner Lehmann | Fri 8/3/2001
3411 | Re: Right way to use VT | Mike Lischke | Fri 8/10/2001
3415 | Re: Right way to use VT | Jim Kueneman | Fri 8/10/2001
3417 | Re: Right way to use VT | Mike Lischke | Fri 8/10/2001
3419 | Re: Right way to use VT | Jim Kueneman | Fri 8/10/2001
3476 | Re: Right way to use VT | Mike Lischke | Wed 8/15/2001


toHideSelection, the 1-pix distance between nodes, and a white line

From: "Anthony Mills" [amills@m...]
Date: Fri Aug 3, 2001 12:35 am
Subject: toHideSelection, the 1-pix distance between nodes, and a white line

Mike,

Just updated from 2.4.28 to 2.5.13; wow, what a lot of new options! A few
issues, though:

Issue #1: toHideSelection doesn't turn on. My Virtual Treeviews work the
same whether it's on or off and they're focused or not.

Issue #2: The 1-pixel gap between rows looks bad when toFullRowSelect is on;
the part of the tree that isn't part of a column has ugly 1-pixel clWindow
gaps between the selected nodes.

Issue #3: When dragging nodes from one VT to another, a white 1-pixel gap
will sometimes show up between two of the destination nodes. Its placement
would change from time to time (between 2nd and 3rd nodes, then between 15th
and 16th nodes), but when it changed, it was fairly random. I suspect this
is connected to the 1-pixel gap mentioned above.

Also, I'm not too fond of the invisible drop target; I prefer that VT honors
my selection of DropTargetBorderColor and DropTargetColor.

Pointing stuff out only to help make the best control there is even better,

Tony

 | Replies | Author | Date
3431 | Re: toHideSelection, the 1-pix distance between n | Mike Lischke | Mon 8/13/2001


re: Right way to use VT

From: [adembaba@e...]
Date: Fri Aug 3, 2001 4:12 am
Subject: Re: Right way to use VT

Jim,

I could not find the disclaimer you mention in
the latest VT version. Hence, I believe they
are legitimate now.

Cheers,
Adem

--- In [VirtualTreeview@y...], "Jim Kueneman" [jimdk@m...] wrote:
>
> What is the right way to create nodes and child nodes in VT? Both
> AddChild and InsertNode have this disclaimer:
>
> "AddChild/InsertNode is a compatibility method and will implicitly
> validate the parent node. This is however against the virtual
paradigm
> and hence I dissuade from its usage."
>
> What other way is there?
>
> Jim

 | Replies | Author | Date
3340 | Re: Right way to use VT | Jim Kueneman | Fri 8/3/2001


Some help on usage of VT

From: "Kiran, N (IE10)" [KiranN@h...]
Date: Fri Aug 3, 2001 6:40 am
Subject: Some help on usage of VT

Hi,

1: Can some one help me out on how to use copy node ??

when i drag & drop a node to new place after setting the drag option to
doCopy the node & its child node gets copied but the User data is not
copied. is there a way i get to access the data while its being copied &
change it say if i want to change the caption to copy of caption & other
user data respectively.

2: what is this doLink in the options i assume it links the dragged node to
the drop target & data referenced by both the nodes are same.. am i right???
when i used the demo or my one test code i found it did nothing at all am i
missing some thing here??

3: when i chose to use image the background is tiled... is there a way i can
change that to some thing like stretch draw.

TIA,
Kiran.

 | Replies | Author | Date
3338 | Re: Some help on usage of VT | Werner Lehmann | Fri 8/3/2001
3339 | Re: Some help on usage of VT | Kiran, N (IE10) | Fri 8/3/2001
3341 | Re: Some help on usage of VT | Werner Lehmann | Fri 8/3/2001
3342 | Re: Some help on usage of VT | Kiran, N (IE10) | Fri 8/3/2001
3345 | Re: Some help on usage of VT | Werner Lehmann | Fri 8/3/2001
3432 | Re: Some help on usage of VT | Mike Lischke | Mon 8/13/2001


re: Right way to use VT

From: Werner Lehmann [wl@b...]
Date: Fri Aug 3, 2001 8:39 am
Subject: Re: [VirtualTreeview] Right way to use VT

Hi Jim,

> What is the right way to create nodes and child nodes in VT? Both
> AddChild and InsertNode have this disclaimer:
>
> "AddChild/InsertNode is a compatibility method and will implicitly
> validate the parent node. This is however against the virtual paradigm
> and hence I dissuade from its usage."
>
> What other way is there?

I believe the recommended way is to use the init events. Use OnInitChildren
to set the child count when the children of a node are needed (increase /
decrease childcount) and OnInitNode to set the data of any node (including
the just created child nodes).

Currently I am still not using the init events, it depends much on your
data structure if it is reasonable and possible at all, and IMO shows bene-
fits only if you have huge amounts of nodes.

And there is a third way similar to this but also not using the init events.
This is what I do if I know that I want to add n nodes. Instead of calling
AddChild n times with n times quite some overhead I set ChildCount[Node] := n
and (optionally) init the nodes manually in a "Node.FirstChild, .NextSibling"
loop.

Regards,
Werner


re: Some help on usage of VT

From: Werner Lehmann [wl@b...]
Date: Fri Aug 3, 2001 8:49 am
Subject: Re: [VirtualTreeview] Some help on usage of VT

Hi Kiran,

> 1: Can some one help me out on how to use copy node ??
>
> when i drag & drop a node to new place after setting the drag option to
> doCopy the node & its child node gets copied but the User data is not
> copied. is there a way i get to access the data while its being copied &
> change it say if i want to change the caption to copy of caption & other
> user data respectively.

How are you doing the copying? You have to know which nodes are the copied
nodes during/after the copying and init them manually if you don't know the
information "this node is a copy" in OnInitNode anymore.

> 2: what is this doLink in the options i assume it links the dragged node to
> the drop target & data referenced by both the nodes are same.. am i right???
> when i used the demo or my one test code i found it did nothing at all am i
> missing some thing here??

doLink just provides the OLE drop effect (DROPEFFECT_LINK). This means that
a small arrow is displayed beside your cursor. The real effect of the link
drop action is up to your application. You must implement that. VT cannot
know what your intentions are when a node is linked dropped.

> 3: when i chose to use image the background is tiled... is there a way i can
> change that to some thing like stretch draw.

Not built into VTree I guess. Prepare a bitmap of the exact size of the VT
clientarea, stretchdraw your background into it, use the OnBefore* events
to copy appropriate parts of the bitmap (BitBlt or Canvas.Draw).

Regards,
Werner


re: Some help on usage of VT

From: "Kiran, N (IE10)" [KiranN@h...]
Date: Fri Aug 3, 2001 9:16 am
Subject: RE: [VirtualTreeview] Some help on usage of VT

> How are you doing the copying? You have to know which nodes are the copied
> nodes during/after the copying and init them manually if you don't know
> the
> information "this node is a copy" in OnInitNode anymore.
>
i use the standard method of copying as shown in the demo

Sender.ProcessDrop(DataObject, Sender.DropTargetNode, Effect,
AttachMode);

I also tried to access the nodes in OnCopying & OnCopied event &
came to know that its of no use. can u pls give me a code sample which shows
how its actually done.

> doLink just provides the OLE drop effect (DROPEFFECT_LINK). This means
> that
> a small arrow is displayed beside your cursor. The real effect of the link
> drop action is up to your application. You must implement that. VT cannot
> know what your intentions are when a node is linked dropped.
>
OK.

> Not built into VTree I guess. Prepare a bitmap of the exact size of the VT
> clientarea, stretchdraw your background into it, use the OnBefore* events
> to copy appropriate parts of the bitmap (BitBlt or Canvas.Draw).
>
The TV is resizable. and i want to display the Application Logo on
the background. so i need to have a mechanism to stretch draw. onbefore* is
not much of a use here as its always erased in the paint cycle. any
suggestion how i can change the TileBackground function so that i can
overcome this problem.

Regards
Kiran


re: Re: Right way to use VT

From: Jim Kueneman [jimdk@m...]
Date: Fri Aug 3, 2001 10:25 am
Subject: Re: [VirtualTreeview] Re: Right way to use VT

At 04:12 AM 8/3/2001 +0000, you wrote:
>Jim,
>
>I could not find the disclaimer you mention in
>the latest VT version. Hence, I believe they
>are legitimate now.

This was taken from 2.5.13

Jim


re: Some help on usage of VT

From: Werner Lehmann [wl@b...]
Date: Fri Aug 3, 2001 1:08 pm
Subject: Re: [VirtualTreeview] Some help on usage of VT

Hi Kiran,

> > How are you doing the copying? You have to know which nodes are the copied
> > nodes during/after the copying and init them manually if you don't know
> > the
> > information "this node is a copy" in OnInitNode anymore.
> >
> i use the standard method of copying as shown in the demo
>
> Sender.ProcessDrop(DataObject, Sender.DropTargetNode, Effect,
> AttachMode);
>
> I also tried to access the nodes in OnCopying & OnCopied event &
> came to know that its of no use. can u pls give me a code sample which shows
> how its actually done.

Sorry, I have never used ProcessDrop or the OnCop* events. It appears that
the original code (which was copied) is not accessible in OnCop* anymore.

> > Not built into VTree I guess. Prepare a bitmap of the exact size of the VT
> > clientarea, stretchdraw your background into it, use the OnBefore* events
> > to copy appropriate parts of the bitmap (BitBlt or Canvas.Draw).
> >
> The TV is resizable. and i want to display the Application Logo on
> the background. so i need to have a mechanism to stretch draw. onbefore* is
> not much of a use here as its always erased in the paint cycle. any
> suggestion how i can change the TileBackground function so that i can
> overcome this problem.

Of course, if the Tree is resized you need to resize your bitmap as well
and invalidate the whole client area. That is the usual drawback you get
with stretch drawn background.

I don't understand why OnBefore* is not of help here.

Werner


re: Some help on usage of VT

From: "Kiran, N (IE10)" [KiranN@h...]
Date: Fri Aug 3, 2001 1:15 pm
Subject: RE: [VirtualTreeview] Some help on usage of VT

HI,

> Sorry, I have never used ProcessDrop or the OnCop* events. It appears that
> the original code (which was copied) is not accessible in OnCop* anymore.
>
In that case what are the other options available for copy of nodes
i thought it was the only way to do so... in other words how to handle the
drag & drop of a node with the intention of node copy.
>
Can i have an example on how to handle this.. & do i need to use
OLEDragdrop only or can i do it with VCL mode also.

> Of course, if the Tree is resized you need to resize your bitmap as well
> and invalidate the whole client area. That is the usual drawback you get
> with stretch drawn background.
>
I managed to solve this problem.. now i have another attribute in
the Class that keeps the bitmap in the size of the client Rectangle. &
stretch draw it from FBackground on WM_SIZE message & use this in the
function of TileBackground... a quick fix soln i could think of... only
regret though is i am changing the base code

> I don't understand why OnBefore* is not of help here.
>
If i paint something to the canvas in onPaint event its erased after
the paint cycle.. any way its solved now.

Regards
Kiran


VT as a graph / tree?

From: [yourfantasy50@h...]
Date: Fri Aug 3, 2001 2:19 pm
Subject: VT as a graph / tree?

Hi Everybody,

I was wondering if VT is suitable for displaying an undirected tree-
graph. Is it possible to display nodes randomly instead of static
positions and static treeconnections? This tree / graph can also
contain recursionnodes.

Thanx already!

I also 'd like to thank everybody (Mike, Werner and the rest of you
great guys(!)) who helped me with using VT as a grid. I succesfully
implemented it and it works great. VT is really superfast and a great
component. The performance comparing with a standard Listview is
outstanding!

Kind Regards,
Mark Dekker.

 | Replies | Author | Date
3346 | Re: VT as a graph / tree? | Werner Lehmann | Fri 8/3/2001


re: prob with UpdateHorizontalScrollBar and GetMaxRightExtend

From: "Moritz Franckenstein" [franckenstein@a...]
Date: Fri Aug 3, 2001 2:59 pm
Subject: Re: prob with UpdateHorizontalScrollBar and GetMaxRightExtend

--- In [VirtualTreeview@y...], Werner Lehmann [wl@b...] wrote:

> two usual methods to break the loop:
>
> - in OnInitNode check if nodes to be added are already there, maybe
by
> using a local const, serves as static var
>
> - send a message (WM_USER) to your tree in OnInitNode and add the
nodes
> in that message handler

thank you, while trying to do it with your first idea, i have found
out that setting Node.States to vsInitialized before adding the
children in OnInitNode helps and seems to make no problems. it
prevents other vt functions from calling InitNode...

could anyone think of any problems this could cause?

what about a flag in Node.States that says that this node is
currently beeing initialized? just an idea :)

-moritz


re: Some help on usage of VT

From: Werner Lehmann [wl@b...]
Date: Fri Aug 3, 2001 10:26 pm
Subject: Re: [VirtualTreeview] Some help on usage of VT

Hi Kiran,

> In that case what are the other options available for copy of nodes
> i thought it was the only way to do so... in other words how to handle the
> drag & drop of a node with the intention of node copy.

Well, I copy the nodes manually (not exactly but it would boil down to this in
your case).

> Can i have an example on how to handle this.. & do i need to use
> OLEDragdrop only or can i do it with VCL mode also.

Regardless of that. But note that you have no dragimage with VCL dragging.

> If i paint something to the canvas in onPaint event its erased after
> the paint cycle.. any way its solved now.

Shouldn't. But if you have something satisfying...

Werner


re: VT as a graph / tree?

From: Werner Lehmann [wl@b...]
Date: Fri Aug 3, 2001 10:32 pm
Subject: Re: [VirtualTreeview] VT as a graph / tree?

Hi Mark,

> I was wondering if VT is suitable for displaying an undirected tree-
> graph. Is it possible to display nodes randomly instead of static
> positions and static treeconnections? This tree / graph can also
> contain recursionnodes.

Most likely not. In any case you would have to do the drawing all yourself,
handle mouse clicks, (draw) selection, drag and drop, the whole stuff. You
could just as well start a new component.

Just for the record, the TeeTreeview component (commercial) is able to
show net-connections, that is each node can be connected with each other,
but it is rather ugly (no graph drawing, just the usual treeview with some
straight lines).

> I also 'd like to thank everybody (Mike, Werner and the rest of you
> great guys(!)) who helped me with using VT as a grid. I succesfully
> implemented it and it works great. VT is really superfast and a great
> component. The performance comparing with a standard Listview is
> outstanding!

Nice to hear :)

Regards,
Werner


re: Re: prob with UpdateHorizontalScrollBar and GetMaxRightExtend

From: Werner Lehmann [wl@b...]
Date: Fri Aug 3, 2001 10:33 pm
Subject: Re: [VirtualTreeview] Re: prob with UpdateHorizontalScrollBar and GetMaxRightExtend

Hi Moritz,

> could anyone think of any problems this could cause?
>
> what about a flag in Node.States that says that this node is
> currently beeing initialized? just an idea :)

I do not anticipate any problems if you set the init flag manually.
Of course you will not receive OnInitNode events for these nodes.

Werner

 | Replies | Author | Date
3352 | Re: prob with UpdateHorizontalScrollBar and GetM | Moritz Franckenstein | Sat 8/4/2001


AnimationDuration := 0

From: [adembaba@e...]
Date: Sat Aug 4, 2001 2:09 am
Subject: AnimationDuration := 0

Hi Mike,

This is a very small bug, but VT should either
not let me specify 0 for AnimationDuration or
when it is 0 then it should turn toAnimatedToggle
off.

Do you agree?

Cheers,
Adem

 | Replies | Author | Date
3433 | Re: AnimationDuration := 0 | Mike Lischke | Mon 8/13/2001


A few bug fixes

From: "Anthony Mills" [amills@m...]
Date: Sat Aug 4, 2001 3:08 am
Subject: A few bug fixes

Mike,

In an earlier email to the list ("toHideSelection, the 1-pix distance
between nodes, and a white line"), I mentioned three issues and a concern I
had with the new version of Virtual Treeview. I'm happy to report that the
patches I have made to VT have fixed all four issues. Some of them feel a
bit kludgey, but I wanted to post them as a means of putting you on the
trail of the bugs.

First, with toFullRowSelect I was noticing that the selection in the
non-column area did not go completely to the bottom. This I fixed by
commenting out the following line of TBaseVirtualTree.ClearNodeBackground:

if (toFullRowSelect in FOptions.FSelectionOptions) and (vsSelected
in Node.States) then
begin
//Dec(R.Bottom); <-- This line was commented out
if Focused or (toPopupMode in FOptions.FPaintOptions)then

Also, with toHideSelection on, I noticed no change in the operation of VT.
This I fixed by making a change further down in
TBaseVirtualTree.ClearNodeBackground:

Before:
if Focused or (toPopupMode in FOptions.FPaintOptions)then
begin
Brush.Color := FColors.FocusedSelectionColor;
Pen.Color := FColors.FocusedSelectionBorderColor;
end
else
begin
Brush.Color := FColors.UnfocusedSelectionColor;
Pen.Color := FColors.UnfocusedSelectionBorderColor;
end;

After:
if Focused or (toPopupMode in FOptions.FPaintOptions)then
begin
Brush.Color := FColors.FocusedSelectionColor;
Pen.Color := FColors.FocusedSelectionBorderColor;
end
else
if not (toHideSelection in FOptions.PaintOptions) then
begin
Brush.Color := FColors.UnfocusedSelectionColor;
Pen.Color := FColors.UnfocusedSelectionBorderColor;
end
else
begin
Brush.Color := Color;
Pen.Color := Color;
end;

OK, those two were fine, but the next one is really crying out for a real
rewrite. I noticed that when dragging nodes, the FDragTargetNode would be
drawn with the right text color, but not the right background color. This I
fixed by changing TBaseVirtualTree.PrepareCell, the part where it fills the
selection rectangle. What I did was to copy the 'if Node = FDropTargetNode
...' bit and paste it below as an else clause to 'if poDrawSelection in
PaintOptions ...' so it draws it if this is the drop target node
nonetheless.

As I think about it, perhaps the drag code is not calling PrepareCell with
poDrawSelection in PaintOptions. That's probably the best fix.

Regards,

Tony

 | Replies | Author | Date
3350 | Re: A few bug fixes | Werner Lehmann | Sat 8/4/2001
3351 | Checkboxes and children | Franc v/d Westelaken | Sat 8/4/2001
3365 | Checkboxes and children | Franc v/d Westelaken | Sun 8/5/2001
3436 | Re: Checkboxes and children | Mike Lischke | Mon 8/13/2001
3369 | Re: A few bug fixes | Anthony Mills | Mon 8/6/2001
3373 | Re: A few bug fixes | Werner Lehmann | Mon 8/6/2001
3435 | Re: A few bug fixes | Mike Lischke | Mon 8/13/2001


re: A few bug fixes

From: Werner Lehmann [wl@b...]
Date: Sat Aug 4, 2001 11:24 am
Subject: Re: [VirtualTreeview] A few bug fixes

Hi Tony,

> First, with toFullRowSelect I was noticing that the selection in the
> non-column area did not go completely to the bottom. This I fixed by
> commenting out the following line of TBaseVirtualTree.ClearNodeBackground:
>
> if (toFullRowSelect in FOptions.FSelectionOptions) and (vsSelected
> in Node.States) then
> begin
> //Dec(R.Bottom); <-- This line was commented out
> if Focused or (toPopupMode in FOptions.FPaintOptions)then

I have noticed this in previous versions (IIRC) but not in 2.5.13: the
non-column
part is not drawn selected at all, even with row selection.

> Also, with toHideSelection on, I noticed no change in the operation of VT.
> This I fixed by making a change further down in
> TBaseVirtualTree.ClearNodeBackground:

With 2.5.13 and 2.5.9 toHideSelection works. If enabled the selection is
hidden when the tree looses focus. If disabled the selection is painted
in color UnfocusedSelectionColor.

So I wonder what your fix could do.

> OK, those two were fine, but the next one is really crying out for a real
> rewrite. I noticed that when dragging nodes, the FDragTargetNode would be
> drawn with the right text color, but not the right background color. This I

Are you saying the Colors.DropTargetColor is not respected? Again, this is
working for me.

Werner

 | Replies | Author | Date
3351 | Checkboxes and children | Franc v/d Westelaken | Sat 8/4/2001
3365 | Checkboxes and children | Franc v/d Westelaken | Sun 8/5/2001
3436 | Re: Checkboxes and children | Mike Lischke | Mon 8/13/2001


Checkboxes and children

From: "Franc v/d Westelaken" [F.vdwestelaken@c...]
Date: Sat Aug 4, 2001 9:33 pm
Subject: Checkboxes and children

Hi,

when the tree is not expanded and you check a node which has children, the
children are not checked when the node is expanded afterwards (although
tristatechecking is 'on').
I assume this is because the children weren't initialized at the moment the
checkbox was checked.

Is this normal behaviour and if so, what's the best way to overcome this so
that the children get checked also ?

Franc.

[Non-text portions of this message have been removed]


re: prob with UpdateHorizontalScrollBar and GetMaxRightExtend

From: "Moritz Franckenstein" [franckenstein@a...]
Date: Sat Aug 4, 2001 11:42 pm
Subject: Re: prob with UpdateHorizontalScrollBar and GetMaxRightExtend

--- In [VirtualTreeview@y...], Werner Lehmann [wl@b...] wrote:
> I do not anticipate any problems if you set the init flag manually.
> Of course you will not receive OnInitNode events for these nodes.

i am doing it inside onInitNode *g*
... to prevent calling it again while it is still running (updating
scrollbars can cause this).

-moritz


re: More on data aware stuffs (long).

From: "Sugiharto Lim" [slim@c...]
Date: Sun Aug 5, 2001 3:47 pm
Subject: RE: [VirtualTreeview] More on data aware stuffs (long).

Hi...,

> Probably. I have no experiences with CDS, unfortunately. Maybe its already
> fast enough.
The only thing I can say is that doing so with an (uncached) TDataset is
suicidal, performance-wise, because of the OnGetText() mechanism. Going
through CDS is attractive because it relieves us from having to incorporate
the field values into a node data structure. I did it the last time with
a TStringList, and I was a bit nervous about memory leaks since I'm using
a lot of strings...:)

> > The first pass loads all the records as root nodes, to avoid re-queries.
> > The second pass 'rearrange' the nodes to their rightful places...:)
> > The real-world version will probably need a lot more stuffs inside
> > (circular references checking, orphaned nodes checking, etc). I'm
> > wondering whether someone can show me a better way to do this. Thanks.
> Step 4 is **expensive**. Complexity is n^2 and many MoveTo's for nothing.
> If you can't query the table as with Oracle (CONNECT BY
> statement) you might
> be able to put together a stored proc which takes a node key as param,
> gets the immediate children of node and stores them in a result set, then
> iterates that set (or maybe in a 2nd stored proc, or recursively with
> decreasing level parameter) and gets the children of their children. You
> could then walk that dataset and add the nodes right away without any re-
> ordering afterwards.
Considering that the reordering is done completely with in-memory
structures,
I thought that it would be a lot faster than doing multiple queries
(one for each parent nodes). I guess I was wrong. Thanks for pointing this
out.

A couple more questions that popped up last week:
1. If I'm doing my own inits (without going through the OnInitNode route),
do I need to add anything to the node States property? VT acted very
weird if I'm adding vsExpanded to the States property.
2. Related to the above, what is the right way to keep the whole tree
expanded (i.e. as grid) on startup? By adding the vsExpanded States,
or call virtualStringTree1.FullExpand(nil); at the end of the inits?

> Please note that stuffing everything into interfaces tends to make code
> even bulkier. It really depends.
Understood. I don't think I should do this until I understand more of VT's
internals.

> I don't remember who it was but you can see the list of members
> on yahoogroups.
Mr Alexander Egorushkin has kindly contacted me privately and had helped me
immensely with his insights from the DBVT project. What I'm contemplating
right now is how VT should react to dataset changes. The fact that we need
to cache the field values in the node data made it a bit more complex to
implement this.

Any comments are welcome.
Many thanks in advance.
salam,
sugi.


re: Re: BCB5, VT2.5.7 and AddChild

From: "Mike Lischke" [lists@l...]
Date: Sun Aug 5, 2001 6:34 pm
Subject: RE: [VirtualTreeview] Re: BCB5, VT2.5.7 and AddChild

Hi Roland,

> we can add following code until one of the BCB5-User found a compiler
> switch to compile with default parameter.
>
> function AddChild(Parent: PVirtualNode): PVirtualNode; overload;
> function AddChild(Parent: PVirtualNode; UserData: Pointer):
> PVirtualNode; overload;

I wonder if we shouldn't rather expect the BCB user to always pass the
parameter? I mean, this is a
problem of BCB not Delphi, so why should the Delphi code take care of this?

Ciao, Mike

 | Replies | Author | Date
3366 | Re: BCB5, VT2.5.7 and AddChild | Roland | Mon 8/6/2001


re: ContentTo... is very slow

From: "Mike Lischke" [lists@l...]
Date: Sun Aug 5, 2001 6:34 pm
Subject: RE: [VirtualTreeview] ContentTo... is very slow

Hi Anders,

> This takes about 30 min with some 7000 nodes.
> I've seen other trees do this function with TStringList as output.
> Maybe that's an idea, or maybe Tstream as output.
> ContentToRTF and other are also very slow.

Yes, I know. But I first wanted to have it running in a clean manner then I
optimized. Now it is
much faster.

Ciao, Mike


re: Re[2]: New file uploaded to VirtualTreeview

From: "Mike Lischke" [lists@l...]
Date: Sun Aug 5, 2001 6:43 pm
Subject: RE: Re[2]: [VirtualTreeview] New file uploaded to VirtualTreeview

> For what properties is used TVirtualTreeEditor?

This is to allow a double click on the control in the IDE to bring up the
column editor.

> Why is not registerred for BCB?

I have been told there is a file missing in BCB.

> I has deleted all {$ifndef CPPB}, has added dsnide50.bpi to design-time
project of package.
> After compiling did not find nothing fresh...

What do you mean? Did the editor appear or did nothing happen?

Ciao, Mike

 | Replies | Author | Date
3364 | Re[4]: [VirtualTreeview] New file uploaded to Vir | Oleg Kraynov | Sun 8/5/2001


re: DeleteSelectedNodes

From: "Mike Lischke" [lists@l...]
Date: Sun Aug 5, 2001 6:44 pm
Subject: RE: [VirtualTreeview] DeleteSelectedNodes

> I suggest you make a small change in DeleteSelectedNodes:

Thank you Anders. Done.

Ciao, Mike


re: working on selected nodes

From: "Mike Lischke" [lists@l...]
Date: Sun Aug 5, 2001 6:47 pm
Subject: RE: [VirtualTreeview] working on selected nodes

> is the usual way to loop through all selected nodes by using
> GetFirst/NextSelected?

There are two options. One is to use the mentione method pair which is
compatible with other
navigation functions and returns nodes in logical order. The other one is
GetSortedSelection which
returns the internal selection array (a copy of it actually) and is therefor
faster. But it returns
nodes in memory location order. This is because the nodes must be sorted this
way to allow quick
manipulation of the selection array.

> i think, this might be a little bit slow when i have a big tree with
> only a few selected nodes on the end.

Well, it takes ~500ms for 1 million nodes on a PII 350 to traverse the full
tree. Don't care about
the speed, that's the natural domain of VT :o]

Ciao, Mike


re: Bug report #21 - not a bug?

From: "Mike Lischke" [lists@l...]
Date: Sun Aug 5, 2001 6:54 pm
Subject: RE: [VirtualTreeview] Bug report #21 - not a bug?

> A node is visible when all its parents are expanded. Setting IsVisible
> to True will therefor expand all parents of Node. Note: setting this
> property to False has no effect.
> however code like (VST is TVirtualStringTree)
>
> procedure TForm1.Button1Click(Sender: TObject);
> var PNode, NNode: PVirtualNode;
> begin
> PNode:= VST.GetFirstSelected;
> NNode:= VST.AddChild(PNode);
> VST.IsVisible[NNode]:= TRUE;
> end;
>
> doesn't make new node (NNode) visible in case parent node (PNode)
> isn't expanded already.
> Of course there is workaround - one can use either
> VST.Expanded[PNode]:= TRUE; or VST.TopNode:= NNode; but it is still
> bug, isn't it?

Correct, this is a bug (better: was a bug, because it is fixed now).

Ciao, Mike


re: String options

From: "Mike Lischke" [lists@l...]
Date: Sun Aug 5, 2001 6:59 pm
Subject: RE: [VirtualTreeview] String options

> recently I noticed that the TBaseVirtualTree's tree options already
> contain and publish StringOptions. Obviously only needed for and
> starting with TCustomVirtualStringTree.

Ah well, you will find every little glitch, won't you :o]? Indeed the string
options aren't needed
by VDT but for now I think it is not worth the effort to fix that.

Ciao, Mike


re: What is the deal with AllocateInternalDataArea in 2.5.13?

From: "Mike Lischke" [lists@l...]
Date: Sun Aug 5, 2001 7:02 pm
Subject: RE: [VirtualTreeview] What is the deal with AllocateInternalDataArea in 2.5.13?

> Why did the assertion in 2.5.13 change from looking at the root
> node's child count to checking if the RootNode is nil? This check
> will make any derivative of TCustomVirtualStringTree fail when you use
> AllocateInternalDataArea in the constructor because after it is called
> in TCustomVirtualStringTree it calls InitRootNode and creates the root
> node. You can never have more than one level of decendants.

Somehow I did not see all consequences with this assertion. You see you can
make things worse with
stuff which is meant to improve the life :-). I have extended the check now to
nil or
FRoot.ChildCount = 0. This should do the job which is to ensure that no nodes
have been allocated
yet (except FRoot for which special care is taken).

Ciao, Mike


re: working on selected nodes

From: Werner Lehmann [wl@b...]
Date: Sun Aug 5, 2001 9:12 pm
Subject: Re: [VirtualTreeview] working on selected nodes

Hi Mike,

> > is the usual way to loop through all selected nodes by using
> > GetFirst/NextSelected?
>
> There are two options. One is to use the mentione method pair which is
compatible with other
> navigation functions and returns nodes in logical order. The other one is
GetSortedSelection which
> returns the internal selection array (a copy of it actually) and is therefor
faster. But it returns
> nodes in memory location order. This is because the nodes must be sorted this
way to allow quick
> manipulation of the selection array.

GetSortedSelection does not look at the internal selection array, it uses
GetNextNoInit although
you say the same in the comment to the method. I say the comment is wrong (I
wished it would be
true).

You also say GetSortedSelection "returns nodes in memory location order". This
is also wrong. Since
GetNextNoInit is used it is the logical order.

Mike, I suspect you changed this at some time in the past, don't know why. Did
you read my reply to
Moritz in this thread? I don't want to write this all again...

Regards,
Werner

 | Replies | Author | Date
3438 | Re: working on selected nodes | Mike Lischke | Mon 8/13/2001


re: More on data aware stuffs (long).

From: Werner Lehmann [wl@b...]
Date: Sun Aug 5, 2001 9:03 pm
Subject: Re: [VirtualTreeview] More on data aware stuffs (long).

Hi,

> A couple more questions that popped up last week:
> 1. If I'm doing my own inits (without going through the OnInitNode route),
> do I need to add anything to the node States property? VT acted very
> weird if I'm adding vsExpanded to the States property.

You don't have to. If you add vsInitialized though you will get OnFreeNode
events
otherwise not. Don't add vsExpanded. If you have problems because of this it is
because you don't do what the Expanded[] property setter does. Use the property
instead.

> 2. Related to the above, what is the right way to keep the whole tree
> expanded (i.e. as grid) on startup? By adding the vsExpanded States,
> or call virtualStringTree1.FullExpand(nil); at the end of the inits?

Try Expanded[] for each node that you add and has children. You can also use
OnStructureChange (probably).

> Mr Alexander Egorushkin has kindly contacted me privately and had helped me
> immensely with his insights from the DBVT project. What I'm contemplating
> right now is how VT should react to dataset changes. The fact that we need
> to cache the field values in the node data made it a bit more complex to
> implement this.

Yes, this database caching stuff can get a life of its own and it's going to
haunt you :)

Anyway, you have always the problem to update the dataset view component when
the dataset is updated. This is independent of VT.

Werner


Re[4]: New file uploaded to VirtualTreeview

From: Oleg Kraynov [olegvkr@y...]
Date: Sun Aug 5, 2001 9:24 pm
Subject: Re[4]: [VirtualTreeview] New file uploaded to VirtualTreeview

Hi, Mike.

>> I has deleted all {$ifndef CPPB}, has added dsnide50.bpi to design-time
project of package.
>> After compiling did not find nothing fresh...

ML> What do you mean? Did the editor appear or did nothing happen?

Oops. I did not check the double click. The editor appears.

--
Best regards,
Oleg

_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


Checkboxes and children

From: "Franc v/d Westelaken" [F.vdwestelaken@c...]
Date: Sat Aug 4, 2001 9:33 pm
Subject: [VirtualTreeview] Checkboxes and children

Hi,

when the tree is not expanded and you check a node which has children, the
children are not checked when the node is expanded afterwards (although
tristatechecking is 'on').
I assume this is because the children weren't initialized at the moment the
checkbox was checked.

Is this normal behaviour and if so, what's the best way to overcome this so
that the children get checked also ?

Franc.

[Non-text portions of this message have been removed]

To unsubscribe from this group, send an email to:
VirtualTreeview-unsubscribe@egroups.com

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/

 | Replies | Author | Date
3436 | Re: Checkboxes and children | Mike Lischke | Mon 8/13/2001


re: BCB5, VT2.5.7 and AddChild

From: "Roland" [Beduerftig@S...]
Date: Mon Aug 6, 2001 1:08 pm
Subject: Re: BCB5, VT2.5.7 and AddChild

Hi Mike,

> > function AddChild(Parent: PVirtualNode): PVirtualNode; overload;
> > function AddChild(Parent: PVirtualNode; UserData: Pointer):
> > PVirtualNode; overload;
>
> I wonder if we shouldn't rather expect the BCB user to always pass
> the parameter? I mean, this is a problem of BCB not Delphi, so why
> should the Delphi code take care of this?

of cource this is only a problem of BCB and not Delphi, right but for
example {$HPPEMIT xxxx} is also a problem of BCB and not Delphi.

The answer to your question (why ?) is:
a. the further version will not compatible with actual version
(the BCB-User must modify the orginal source code of the project)
b. I think the BCB-User like also to write AddChild(node); and not
AddChild(node, NULL);

with best regards
Roland


Problem with Assign called from Notification

From: [sales@d...]
Date: Mon Aug 6, 2001 7:05 pm
Subject: Problem with Assign called from Notification

I'm new to this group. Apologies if this is already covered. I have
been using v1.31 within a Delphi frame. When I replace the code with
the current beta and run I get a problem with the Assign (called from
Notification during the frame startup). I have dropped in the code
and the new package, NOT replaced the component on the frame.

Has anyone seen this? Is there a solution?

I have seen this in the past caused by Notification being called
before all structures are initialized in the create. The solution
was to create the structures BEFORE the Inherited Create is called.

Thanks

 | Replies | Author | Date
3368 | Problem with Assign called from Notification | [sales@d...] | Mon 8/6/2001
3372 | Re: Problem with Assign called from Notification | Werner Lehmann | Mon 8/6/2001
3374 | Re: Problem with Assign called from Notification | John | Tue 8/7/2001


Problem with Assign called from Notification

From: [sales@d...]
Date: Mon Aug 6, 2001 7:34 pm
Subject: Problem with Assign called from Notification

I'm new to this group. Apologies if this is already covered. I have
been using v1.31 within a Delphi frame. When I replace the code with
the current beta and run I get a problem with the Assign (called from
Notification during the frame startup). I have dropped in the code
and the new package, NOT replaced the component on the frame.

Has anyone seen this? Is there a solution?

I have seen this in the past caused by Notification being called
before all structures are initialized in the create. The solution
was to create the structures BEFORE the Inherited Create is called.

Thanks


re: A few bug fixes

From: "Anthony Mills" [amills@m...]
Date: Mon Aug 6, 2001 9:36 pm
Subject: Re: A few bug fixes

Werner,

I am almost wondering if we have the same VT 2.5.13!

> I have noticed this in previous versions (IIRC) but not in 2.5.13: the
non-column
> part is not drawn selected at all, even with row selection.

It was in mine, and it was drawn wrong.

> With 2.5.13 and 2.5.9 toHideSelection works. If enabled the selection is
> hidden when the tree looses focus. If disabled the selection is painted
> in color UnfocusedSelectionColor.

In mine, it didn't matter if toHideSelection was on or not; it was always
drawn with UnfocusedSelectionColor.

> Are you saying the Colors.DropTargetColor is not respected? Again, this is
> working for me.

More precisely, the background was not drawn at all. So for my
black-on-white VT, drop targets were drawn as white on white. And for my
black-on-grey VT, drop targets were white on grey.

...

This is all very curious. My original VT 2.5.13 is 900,869 bytes in size and
the final 'end.' is on line 25,230. I compiled it in Delphi 5 update pack 1
in Windows 2000 ... anyway, it's all rather fishy.

Regards,

Tony


(Mike, please read) OLE Drag and drop: optimized move and more

From: Werner Lehmann [wl@b...]
Date: Mon Aug 6, 2001 10:17 pm
Subject: (Mike, please read) OLE Drag and drop: optimized move and more

Hi,

there is still this problem with optimized shell move operation after
a drag and drop move from the VT to Explorer. The shell will return
DROPEFFECT_NONE from ActiveX.DoDragDrop but has moved the file(s) at
that point of time. To learn the real effect one has to implement
IDataObject.SetData. I believe that this can be done well in the VT
dataobject. Then nobody is forced to provide an own dataobject for the
relatively common case of file (CF_HDROP) drag and drop.

Second problem is that the VT will delete nodes if ActiveX.DoDragDrop
returns DROPEFFECT_MOVE. I was forced to comment out these lines in
the VT version at my company. The nodes may only be deleted when the
database says yes to that operation. I would like to see this optional
or completely removed... Any chance?

I would like to see an event that fires after a drag and drop (which
began on the VT and ended on any OLE drop target) has ended and which
contains the real drop effect (including optimized move resolution,
thus not only the return value from ActiveX.DoDragDrop since this is
DROPEFFECT_NONE for optimized moves (and the shell always uses these)).

Please see also thread "OLE drag and drop again" from 21st of July,
already 2.5 weeks ago. I was hoping that you would say at least 'make
it so' but you ignored that thread on your last VT list answer day on
sunday :)

Regards,
Werner

 | Replies | Author | Date
3437 | Re: (Mike, please read) OLE Drag and drop: opti | Mike Lischke | Mon 8/13/2001
3445 | Re: (Mike, please read) OLE Drag and drop: opti | Jim Kueneman | Tue 8/14/2001
3474 | Re: (Mike, please read) OLE Drag and drop: opt | Mike Lischke | Wed 8/15/2001


re: Re: BCB5, VT2.5.7 and AddChild

From: Werner Lehmann [wl@b...]
Date: Mon Aug 6, 2001 10:25 pm
Subject: Re: [VirtualTreeview] Re: BCB5, VT2.5.7 and AddChild

Hi Roland,

> > > function AddChild(Parent: PVirtualNode): PVirtualNode; overload;
> > > function AddChild(Parent: PVirtualNode; UserData: Pointer):
> > > PVirtualNode; overload;
> >
> > I wonder if we shouldn't rather expect the BCB user to always pass
> > the parameter? I mean, this is a problem of BCB not Delphi, so why
> > should the Delphi code take care of this?
>
> of cource this is only a problem of BCB and not Delphi, right but for
> example {$HPPEMIT xxxx} is also a problem of BCB and not Delphi.
>
> The answer to your question (why ?) is:
> a. the further version will not compatible with actual version
> (the BCB-User must modify the orginal source code of the project)
> b. I think the BCB-User like also to write AddChild(node); and not
> AddChild(node, NULL);

I can understand your fears of always having to type NULL :)

But it is no real solution to turn all default value parameters into
all sorts of overloaded methods. It's not only AddChild, you know. And
its ugly and makes code bulkier and harder to read. And it creates one
additional level of indirection (and a stackframe possibly) as one over-
loaded method calls another.

After all, I can still not believe that there is no other way to teach
BCB to behave :) I wonder, did you already investigate this issue on the
net and/or ask some gurus in the appropriate newsgroups at Borland?

This problem has surfaced most likely earlier for someone. And even the
VCL itself uses default values and is (AFAIK) usable by BCB.

Regards,
Werner

 | Replies | Author | Date
3393 | Re: BCB5, VT2.5.7 and AddChild | Roland | Thu 8/9/2001


re: Problem with Assign called from Notification

From: Werner Lehmann [wl@b...]
Date: Mon Aug 6, 2001 10:31 pm
Subject: Re: [VirtualTreeview] Problem with Assign called from Notification

Hi sales (?)

> I'm new to this group. Apologies if this is already covered. I have
> been using v1.31 within a Delphi frame. When I replace the code with
> the current beta and run I get a problem with the Assign (called from
> Notification during the frame startup). I have dropped in the code
> and the new package, NOT replaced the component on the frame.

I am a little bit confused, 'NOT replaced the component on the frame'?
Do you mean you have installed both VT versions at the same time? This
means asking for trouble, if even possible.

> Has anyone seen this? Is there a solution?

Nope, not seen yet. I am using the VT on frames, too, but am creating
them at runtime mostly. And I have not done the step from 1.31 to 2.5.13,
it has changed a LOT. Did you double check that no debris from the
previous version is lying around somewhere? DCUs, BPLs...

> I have seen this in the past caused by Notification being called
> before all structures are initialized in the create. The solution
> was to create the structures BEFORE the Inherited Create is called.

Somehow frames always open their own can of worms. Components tend to
not work on frames because init code in the constructor comes in an
earlier state than if the component is on a form.

Regards,
Werner

 | Replies | Author | Date
3374 | Re: Problem with Assign called from Notification | John | Tue 8/7/2001


re: Re: A few bug fixes

From: Werner Lehmann [wl@b...]
Date: Mon Aug 6, 2001 10:42 pm
Subject: Re: [VirtualTreeview] Re: A few bug fixes

Hi Tony,

> I am almost wondering if we have the same VT 2.5.13!

I thought that you would say that. Three (4) points, the bugfixes, and I am
not seeing any of the problems.

> > I have noticed this in previous versions (IIRC) but not in 2.5.13: the
> non-column
> > part is not drawn selected at all, even with row selection.
>
> It was in mine, and it was drawn wrong.
>
> > With 2.5.13 and 2.5.9 toHideSelection works. If enabled the selection is
> > hidden when the tree looses focus. If disabled the selection is painted
> > in color UnfocusedSelectionColor.
>
> In mine, it didn't matter if toHideSelection was on or not; it was always
> drawn with UnfocusedSelectionColor.
>
> > Are you saying the Colors.DropTargetColor is not respected? Again, this is
> > working for me.
>
> More precisely, the background was not drawn at all. So for my
> black-on-white VT, drop targets were drawn as white on white. And for my
> black-on-grey VT, drop targets were white on grey.
>
> ...
>
> This is all very curious. My original VT 2.5.13 is 900,869 bytes in size and
> the final 'end.' is on line 25,230. I compiled it in Delphi 5 update pack 1
> in Windows 2000 ... anyway, it's all rather fishy.

The numbers and OS match mine exactly. Probably some unfortunate combination
of reasons, or some bug in your code (but I cannot imagine what would cause
this). Anyhow, the problem is on your side, so if you can come up with a small
test project which surfaces the problem I'd be happy to test it here.

Apparently noone else has complained about these problems...

Regards,
Werner


re: Problem with Assign called from Notification

From: "John" [johnh@d...]
Date: Tue Aug 7, 2001 1:16 am
Subject: RE: [VirtualTreeview] Problem with Assign called from Notification

Werner,

I'm John..I need to sort out the contact email.

By Not replacing I mean I did not remove the component from the frame in the
designer then replace it, I simply replaced the code and the package and
reopend the frame.

I will try completely removing the component and re-inserting.

Do not beileve there is any debri.

cheers

-----Original Message-----
From: Werner Lehmann [mailto:[wl@b...]]
Sent: Tuesday, August 07, 2001 8:31 AM
To: VirtualTreeview@yahoogroups.com
Subject: Re: [VirtualTreeview] Problem with Assign called from
Notification

Hi sales (?)

> I'm new to this group. Apologies if this is already covered. I have
> been using v1.31 within a Delphi frame. When I replace the code with
> the current beta and run I get a problem with the Assign (called from
> Notification during the frame startup). I have dropped in the code
> and the new package, NOT replaced the component on the frame.

I am a little bit confused, 'NOT replaced the component on the frame'?
Do you mean you have installed both VT versions at the same time? This
means asking for trouble, if even possible.

> Has anyone seen this? Is there a solution?

Nope, not seen yet. I am using the VT on frames, too, but am creating
them at runtime mostly. And I have not done the step from 1.31 to 2.5.13,
it has changed a LOT. Did you double check that no debris from the
previous version is lying around somewhere? DCUs, BPLs...

> I have seen this in the past caused by Notification being called
> before all structures are initialized in the create. The solution
> was to create the structures BEFORE the Inherited Create is called.

Somehow frames always open their own can of worms. Components tend to
not work on frames because init code in the constructor comes in an
earlier state than if the component is on a form.

Regards,
Werner

To unsubscribe from this group, send an email to:
VirtualTreeview-unsubscribe@egroups.com

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/


Some observations regarding the source...

From: "Theodor Kleynhans" [theodor.yahoogroups@s...]
Date: Tue Aug 7, 2001 1:56 pm
Subject: [VirtualTreeview] Some observations regarding the source...

Hi All,

I'm new to this list and the VirtualTreeView component. I downloaded
versions 1.31 and 2.5.13 this morning and played around with it. First
off I have to say that I'm *very* impressed. This control kicks ass!
Well done Mike! :)

At first I studied version 1.31 (didn't have 2.5.13 until later) and
found the 98KB impact on the size of the EXE very reasonable (the people
I work for are very concerned about the size of the EXE). Then I
downloaded and installed 2.5.13 and suddenly the impact jumped to 196KB!
I realize that there's a lot of extra functionality, but a doubling in
size seemed a bit excessive. Upon further investigation I found the
culprit to be TVirtualStringTree. When using only a TVirtualDrawTree the
overall size impact is only 149KB, but TVirtualStringTree is still
partially linked in. When commenting lines 5063-5065 (which should
rather be handled by a virtual method IMO) and lines 25221-25227 (since
I don't require the extended clipboard formats support) the size impact
drops to 128KB.

Since I'm sure there are many users who would like the tree to
automatically paint strings but don't require the extended clipboard
formats, I think the current TVirtualStringTree should be split in two.
The extended clipboard functionality can be added in a descendant of
TVirtualStringTree. Anyone else agree with this?

On another note: why is the Background property limited to TBitmap? It
seems that it's done for performance reasons (using BitBlt instead of
TBitmap.Draw). If so, a simple check in the TileBackground method can
use BitBlt if Background contains a TBitmap, otherwise
Background.Graphic.Draw could be used (the speed penalty of the test
will be negligible compared to the time taken to draw the image). If
Background.Graphic.Transparent is True, then the background could be
filled with the background color first (to correctly handle TIcon as a
background graphic for example). Alternatively, if there is a reason to
limit Background to TBitmap, shouldn't it be of type TBitmap instead of
TPicture?

Kind Regards,
Theodor

-----------------------------
Theodor Kleynhans
[theodor@s...]
http://www.sulako.com

 | Replies | Author | Date
3434 | Re: Some observations regarding the source... | Mike Lischke | Mon 8/13/2001
3462 | Re: Some observations regarding the source... | Ralf Junker | Wed 8/15/2001
3500 | Re: Some observations regarding the source... | Mike Lischke | Sat 8/18/2001


extending lmBands ???

From: "Moritz Franckenstein" [franckenstein@a...]
Date: Tue Aug 7, 2001 3:22 pm
Subject: extending lmBands ???

hi, i have uploaded some edited screenshots:

http://groups.yahoo.com/group/VirtualTreeview/files/Screen%
20shots/moritz/

mike, could you tell me your opinion about it? is it possible? do you
have some hints for me how i can do it? i think this would be of
general use and implementing it into vt could increase vt's worth.

if i get some hints and help i will try to implement it into vt so
that everyone can use it.

-moritz

 | Replies | Author | Date
3377 | Re: extending lmBands ??? | Mike Lischke | Tue 8/7/2001
3394 | Re: extending lmBands ??? | Moritz Franckenstein | Thu 8/9/2001
3396 | Re: extending lmBands ??? | Moritz Franckenstein | Thu 8/9/2001
3455 | Re: extending lmBands ??? | Wim van der Vegt | Tue 8/14/2001
3467 | Re: extending lmBands ??? | Wim van der Vegt | Wed 8/15/2001
3468 | Re: extending lmBands ??? | Wim van der Vegt | Wed 8/15/2001
3486 | Re: extending lmBands ??? | Moritz Franckenstein | Thu 8/16/2001
3404 | Re: extending lmBands ??? | Werner Lehmann | Fri 8/10/2001


re: extending lmBands ???

From: "Mike Lischke" [lists@l...]
Date: Tue Aug 7, 2001 7:28 pm
Subject: RE: [VirtualTreeview] extending lmBands ???

Moritz,

> mike, could you tell me your opinion about it? is it possible? do you
> have some hints for me how i can do it? i think this would be of
> general use and implementing it into vt could increase vt's worth.

Well, I still have more than 40 mails pending (most require more than a simple
answer) so I do not
want to prefer this particular one. I only want to say that I though about such
things too.
Particularly xml_3.png was in my mind because it allows "Outlook-like" things.
However I have no
idea how to implement this currently and still a lot of other things to do
(including reducing open
bugs :-)). Additionally, I'm on vacation next weekend, so...

But on this list are meanwhile more than 520 people listening. There should be
some more than the 5
enthusiasts which always discuss here to give you an idea.

Ciao, Mike

 | Replies | Author | Date
3394 | Re: extending lmBands ??? | Moritz Franckenstein | Thu 8/9/2001
3396 | Re: extending lmBands ??? | Moritz Franckenstein | Thu 8/9/2001
3455 | Re: extending lmBands ??? | Wim van der Vegt | Tue 8/14/2001
3467 | Re: extending lmBands ??? | Wim van der Vegt | Wed 8/15/2001
3468 | Re: extending lmBands ??? | Wim van der Vegt | Wed 8/15/2001
3486 | Re: extending lmBands ??? | Moritz Franckenstein | Thu 8/16/2001


re: Sourceforge

From: "Mike Lischke" [lists@l...]
Date: Tue Aug 7, 2001 7:31 pm
Subject: RE: [VirtualTreeview] Sourceforge

Vadim,

> Not muh, but let's try (if there is no real experts on this group). Contact
> me by e-mail.

Thank you for your offer. I will likely come back to it once the next version
of VT is really
published.

Ciao, Mike

PS: Could you please formulate your bug list entries as descriptions of the
bugs, not hints how to
solve the bugs?


re: Re: Sourceforge (client access)

From: "Mike Lischke" [lists@l...]
Date: Tue Aug 7, 2001 7:36 pm
Subject: RE: [VirtualTreeview] Re: Sourceforge (client access)

Hi Ariel,

> * i tried that, and it seams there isnt any account created...
> * the /data/ is the directory where u have all the files.
> * i have the cvs.exe... let me know if u want, i can upload it.

I don't even know how to create accounts for other users. Additionally,
sometimes the server is
extremly slow.

>
> http://www.cvsgui.org
> a windows cvs manamager.. ucan create all the structures with it.
> (well.. i think).

That's what I have downloaded too. But I still have to find the time to get
used to it.

Ciao, Mike


Column bugs

From: [mikael@i...]
Date: Tue Aug 7, 2001 9:07 pm
Subject: Column bugs

After I have dragged a column, the order on the columns changes
visually, but when I try to iterate thru them, I cannot get their
order correct. No problem, found an answer for that in this message
group.

The main problem is that if I have dragged a column, the position
array is updated. When I then clears all columns and rebuilds them
(Header.Columns.Clear, Header.Columns.Add) the position array doesn't
seems to be reseted, which causes my columns to show up in wrong
order.

Can I clear the position array somehow?

I tried to call the InitializePositionArray, but that didn't work.
Instead it removed columns for me.

Thanks for a grat component anyway!

Regards,
Mikael Stalvik


Redraw problem in large trees during keyboard scrolling

From: Werner Lehmann [wl@b...]
Date: Tue Aug 7, 2001 11:26 pm
Subject: Redraw problem in large trees during keyboard scrolling

Hi,

here's a redraw / scroll problem with large trees. Mike, you always speak about
trees with 1e6 nodes so I figured I could just set the rootnodecount to 50000
:).
Well, this works. But: if I do not scroll by mouse (and scrollbar) but by key up
and down the node text's in the current tree 'view' (scroll area) are
duplicated
while the tree is scrolling and the arrow key is held down. As soon as the key
is
released the view is correct again. It is hard to describe but easy to
reproduce:

- new project, virtualstringtree
- set rootnodecount to 50000 in OI
- gettext event handler:

if (Column = VirtualStringTree1.Header.MainColumn) and (TextType = ttNormal)
then
Text := Format('%.5d', [Node.Index]);

- run, focus last node
- hold VK_UP until tree scrolls

I don't have trees with so many nodes very often and it surely makes not much
sense
to have 50000 nodes in one branch as siblings. But the problems shows 'already'
beginning
with 8700 and up on my machine (effect is not steady, but with 9000 and up it
always
shows up).

No idea why at the moment. I only hope you know some places to check. Probably
hard
to debug since scrolling the tree while stepping through the code is not really
easy...
Low priority.

Regards,
Werner

 | Replies | Author | Date
3440 | Re: Redraw problem in large trees during keyboard | Mike Lischke | Mon 8/13/2001
3443 | Re: Redraw problem in large trees during keyboard | Werner Lehmann | Mon 8/13/2001
3499 | Re: Redraw problem in large trees during keyboard | Mike Lischke | Sat 8/18/2001
3507 | Re: Redraw problem in large trees during keyboard | Werner Lehmann | Sat 8/18/2001
3578 | Re: Redraw problem in large trees during keyboard | Mike Lischke | Fri 8/24/2001


Get Treeview from Node.

From: "Kiran, N (IE10)" [KiranN@h...]
Date: Wed Aug 8, 2001 1:33 pm
Subject: Get Treeview from Node.

Hi,

Is it possible to get the treeview for a given PVirtualNode.

In TTreeNode i have "Node.TreeView" i do not find any thing similar to
that. Is there a way to get that.

Regards
Kiran

 | Replies | Author | Date
3383 | Re: Get Treeview from Node. | [Texx2k@g...] | Wed 8/8/2001
3384 | Re: Get Treeview from Node. | Kiran, N (IE10) | Wed 8/8/2001
3385 | Re: Get Treeview from Node. | Vandrovec Milan | Wed 8/8/2001
3386 | Re: Get Treeview from Node. | Kiran, N (IE10) | Wed 8/8/2001


re: Get Treeview from Node.

From: [Texx2k@g...]
Date: Wed Aug 8, 2001 2:08 pm
Subject: Re: [VirtualTreeview] Get Treeview from Node.

At 19:03 08.08.01 +0530, you wrote:

>Hi,
>
> Is it possible to get the treeview for a given PVirtualNode.
>
> In TTreeNode i have "Node.TreeView" i do not find any thing similar to
>that. Is there a way to get that.
>
>
>Regards
>Kiran

You can add a pointer to the tree in the record that every node holds.
If you then add an new node you have to fill this field with a pointer to
the tree witch the Node is added! Maybe you can do this in the
"OnInitNode"-procedure of the tree!?

Later you can access the Tree by using this Pointer!

I hope that solved your problem...

by Torsten

--
Aufgepasst - jetzt viele 1&1 New WebHosting Pakete ohne
Einrichtungsgebuehr + 1 Monat Grundgebuehrbefreiung!
http://puretec.de/index.html?ac=OM.PU.PU003K00736T0492a


re: Get Treeview from Node.

From: "Kiran, N (IE10)" [KiranN@h...]
Date: Wed Aug 8, 2001 2:00 pm
Subject: RE: [VirtualTreeview] Get Treeview from Node.

Yes.. I think i can do that ...

Thanks
Kiran

> -----Original Message-----
> From: [Texx2k@g...] [SMTP:[Texx2k@g...]]
> Sent: Wednesday, August 08, 2001 7:38 PM
> To: VirtualTreeview@yahoogroups.com
> Subject: Re: [VirtualTreeview] Get Treeview from Node.
>
> At 19:03 08.08.01 +0530, you wrote:
>
> >Hi,
> >
> > Is it possible to get the treeview for a given PVirtualNode.
> >
> > In TTreeNode i have "Node.TreeView" i do not find any thing similar to
> >that. Is there a way to get that.
> >
> >
> >Regards
> >Kiran
>
> You can add a pointer to the tree in the record that every node holds.
> If you then add an new node you have to fill this field with a pointer to
> the tree witch the Node is added! Maybe you can do this in the
> "OnInitNode"-procedure of the tree!?
>
> Later you can access the Tree by using this Pointer!
>
> I hope that solved your problem...
>
> by Torsten
>
> --
> Aufgepasst - jetzt viele 1&1 New WebHosting Pakete ohne
> Einrichtungsgebuehr + 1 Monat Grundgebuehrbefreiung!
> <http://puretec.de/index.html?ac=OM.PU.PU003K00736T0492a>
>
>
> To unsubscribe from this group, send an email to:
> VirtualTreeview-unsubscribe@egroups.com
>
>
>
> Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service
> <http://docs.yahoo.com/info/terms/>.


re: Get Treeview from Node.

From: Vandrovec Milan [milan_va@s...]
Date: Wed Aug 8, 2001 2:36 pm
Subject: RE: [VirtualTreeview] Get Treeview from Node.

Hi.

> Is it possible to get the treeview for a given PVirtualNode.

I haven't downloaded the latest version, but in 2.4.34 there is:

function TreeFromNode(Node: PVirtualNode): TBaseVirtualTree;
// Returns the tree the node currently belongs to or nil if the node is not
attached to a tree.

I believe it is still there, and does what you want.

Milan Vandrovec


re: Get Treeview from Node.

From: "Kiran, N (IE10)" [KiranN@h...]
Date: Wed Aug 8, 2001 2:29 pm
Subject: RE: [VirtualTreeview] Get Treeview from Node.

Oops!! overlooked it... looks like i am not the only one to do that either
:)

thanks.
Kiran

> -----Original Message-----
> From: Vandrovec Milan [SMTP:[milan_va@s...]]
> Sent: Wednesday, August 08, 2001 8:06 PM
> To: 'VirtualTreeview@yahoogroups.com'
> Subject: RE: [VirtualTreeview] Get Treeview from Node.
>
>
> Hi.
>
> > Is it possible to get the treeview for a given PVirtualNode.
>
> I haven't downloaded the latest version, but in 2.4.34 there is:
>
> function TreeFromNode(Node: PVirtualNode): TBaseVirtualTree;
> // Returns the tree the node currently belongs to or nil if the node is
> not
> attached to a tree.
>
> I believe it is still there, and does what you want.
>
> Milan Vandrovec
>
>
> To unsubscribe from this group, send an email to:
> VirtualTreeview-unsubscribe@egroups.com
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/


re: Sourceforge

From: "Vadim Sedulin" [wsntrl@o...]
Date: Wed Aug 8, 2001 8:38 pm
Subject: Re: [VirtualTreeview] Sourceforge

Hello Mike!

> PS: Could you please formulate your bug list entries as descriptions of
the bugs, not hints how to
> solve the bugs?

Sorry, will do. I think FreeMem(FRoot) useless is quite clear because
InitRootNode called once (from AfterConstruction).

Bye.

Vadim Sedulin
E-Mail: [wsntrl@o...]


re: Re: Sourceforge (client access)

From: "Vadim Sedulin" [wsntrl@o...]
Date: Wed Aug 8, 2001 8:53 pm
Subject: Re: [VirtualTreeview] Re: Sourceforge (client access)

Hello Mike!

> I don't even know how to create accounts for other users. Additionally,
sometimes the server is
> extremly slow.

Project Admin -> Add Group Member

Bye.

Vadim Sedulin
E-Mail: [wsntrl@o...]


[no subject]

From: "Praveen, Karki (IE10)" [Praveen.karki@h...]
Date: Thu Aug 9, 2001 4:57 am
Subject:

Praveen A. Karki Honeywell
<<...OLE_Obj...>>
Ph : 91-80-658 5751. Extn: 1214
Email : [praveen.karki@h...]


Multiple Lines Hint problem!

From: [Praveen.karki@h...]
Date: Thu Aug 9, 2001 5:17 am
Subject: Multiple Lines Hint problem!

Hello All,

I am using multiple lines hint for a tree view. The problem I
am facing is

a. Some letters are getting chopped at the right and also at the
bottom of the hint window. I am using '#13' in hint message to break
a line.

b. If I happen to put the hint message in a single line, it is coming
perfect.

Is this known issue or I am missing some thing....

Any clues??

Thanks for ur comments
Praveen

 | Replies | Author | Date
3391 | Re: Multiple Lines Hint problem! | [Praveen.karki@h...] | Thu 8/9/2001
3392 | Re: Multiple Lines Hint problem!- Solved | [Praveen.karki@h...] | Thu 8/9/2001


re: Multiple Lines Hint problem!

From: [Praveen.karki@h...]
Date: Thu Aug 9, 2001 5:24 am
Subject: Re: Multiple Lines Hint problem!

Hello,

I missed some information in the last mail..That is,
I want the Virtual treeview hint to be in 'Courier New' font. So I
also changes the source code to have courier New font in procedure
TVirtualTreeHintWindow.InternalPaint.

I noticed it works fine without this change.

Thanks
Praveen

--- In [VirtualTreeview@y...], [Praveen.karki@h...] wrote:
> Hello All,
>
> I am using multiple lines hint for a tree view. The problem
I
> am facing is
>
> a. Some letters are getting chopped at the right and also at the
> bottom of the hint window. I am using '#13' in hint message to
break
> a line.
>
> b. If I happen to put the hint message in a single line, it is
coming
> perfect.
>
> Is this known issue or I am missing some thing....
>
> Any clues??
>
> Thanks for ur comments
> Praveen

 | Replies | Author | Date
3392 | Re: Multiple Lines Hint problem!- Solved | [Praveen.karki@h...] | Thu 8/9/2001


re: Multiple Lines Hint problem!- Solved

From: [Praveen.karki@h...]
Date: Thu Aug 9, 2001 5:54 am
Subject: Re: Multiple Lines Hint problem!- Solved

Hello,

I could get through this, The problem was Hintfont was again
initialised in CalcHintRect. SO I need to change the font
to 'Courier New' there also.

Thanks
Praveen

--- In [VirtualTreeview@y...], [Praveen.karki@h...] wrote:
> Hello,
>
> I missed some information in the last mail..That is,
> I want the Virtual treeview hint to be in 'Courier New' font. So I
> also changes the source code to have courier New font in procedure
> TVirtualTreeHintWindow.InternalPaint.
>
> I noticed it works fine without this change.
>
> Thanks
> Praveen
>
> --- In [VirtualTreeview@y...], [Praveen.karki@h...] wrote:
> > Hello All,
> >
> > I am using multiple lines hint for a tree view. The
problem
> I
> > am facing is
> >
> > a. Some letters are getting chopped at the right and also at the
> > bottom of the hint window. I am using '#13' in hint message to
> break
> > a line.
> >
> > b. If I happen to put the hint message in a single line, it is
> coming
> > perfect.
> >
> > Is this known issue or I am missing some thing....
> >
> > Any clues??
> >
> > Thanks for ur comments
> > Praveen


re: BCB5, VT2.5.7 and AddChild

From: "Roland" [Beduerftig@S...]
Date: Thu Aug 9, 2001 7:55 am
Subject: Re: BCB5, VT2.5.7 and AddChild

Hi Werner,

> I can understand your fears of always having to type NULL :)
>
> But it is no real solution to turn all default value parameters into
> all sorts of overloaded methods. It's not only AddChild, you know.
.....

you are right, it was only a discussion of the basic "newer is not
compatible with older version" when someone rebuild an existing
project.

Of course there is no problem, the user must added in all
places ...,NULL); and all is happy, but the user must modify the
existing project!

Normally is: When a release a project I save all things, the
environment, the components and the project, then I can recreate the
orginal, when I try to find an error.

And when I work for a new release I install first the new components
and try to translate the actual project, correct all new things, for
example add ...,NULL); and then I work for the new release.

> After all, I can still not believe that there is no other way to
> teach BCB to behave :) I wonder, did you already investigate this
> issue on the net and/or ask some gurus in the appropriate
> newsgroups at Borland?
>
> This problem has surfaced most likely earlier for someone. And even
> the VCL itself uses default values and is (AFAIK) usable by BCB.

Yes, I asked in this newsgroups, but the support of Borland is very
very bad, in the most I get none or stupid answers, and I have in
this days a many work, so it is easier adding ...,NULL); as finding
to correct option.

with best regards
Roland


re: extending lmBands ???

From: "Moritz Franckenstein" [franckenstein@a...]
Date: Thu Aug 9, 2001 12:36 pm
Subject: Re: extending lmBands ???

--- In [VirtualTreeview@y...], "Mike Lischke" [lists@l...] wrote:
> > mike, could you tell me your opinion about it? is it possible? do
you
> > have some hints for me how i can do it? i think this would be of
> > general use and implementing it into vt could increase vt's worth.
>
> Well, I still have more than 40 mails pending (most require more
than a simple answer) so I do not
> want to prefer this particular one. I only want to say that I
though about such things too.
> Particularly xml_3.png was in my mind because it allows "Outlook-
like" things. However I have no
> idea how to implement this currently and still a lot of other
things to do (including reducing open
> bugs :-)). Additionally, I'm on vacation next weekend, so...
>
> But on this list are meanwhile more than 520 people listening.
There should be some more than the 5
> enthusiasts which always discuss here to give you an idea.

hm... really important for _me_ are the pictures 4 or 5 - is there
anyone out there with an idea?

http://groups.yahoo.com/group/VirtualTreeview/files/Screen%
20shots/moritz/xml_5.png

-moritz

 | Replies | Author | Date
3396 | Re: extending lmBands ??? | Moritz Franckenstein | Thu 8/9/2001


re: extending lmBands ???

From: "Moritz Franckenstein" [franckenstein@a...]
Date: Thu Aug 9, 2001 12:40 pm
Subject: Re: extending lmBands ???

<a href="../files/Screen%20shots/moritz/xml_5.png">xml_5.png</a>


Node specific Popup Menus

From: "Evgeni Vasilev" [evasilev@y...]
Date: Thu Aug 9, 2001 2:03 pm
Subject: Node specific Popup Menus

Hi everyone,

Could somebody tell me how to assign different context menus depending on a
node parameter.
Thank you.

Evgeni Vasilev

 | Replies | Author | Date
3399 | Re: Node specific Popup Menus | Roland | Thu 8/9/2001
3400 | Re: Node specific Popup Menus | Werner Lehmann | Thu 8/9/2001
3401 | Independent treenodes type structure | Tom | Thu 8/9/2001


Easiest way to emulate a standard TTreeView?

From: [yahoo@a...]
Date: Thu Aug 9, 2001 2:49 pm
Subject: Easiest way to emulate a standard TTreeView?

I am using VTs more and more in my project and still have a few stray
TTreeView controls around. I was thinking about converting them to
VTs but was concerned about the additional work involved.

Consider this scenario:

Vanilla TTreeView
Does a .LoadFromFile() to get contents
I cycle through the nodes and:
- set the images
- set Node.Data to an integer
I can rearrange nodes via drag a drop
Does a .SaveToFile() to save contents

That's it. So what would be the best way to do this in a VT,
particularly the LoadFromFile() & SaveToFile() -- how does this work
in VT.

Ideas?

Ben

 | Replies | Author | Date
3403 | Re: Easiest way to emulate a standard TTreeView? | Jim Kueneman | Thu 8/9/2001
3439 | Re: Easiest way to emulate a standard TTreeView? | Mike Lischke | Mon 8/13/2001


re: Node specific Popup Menus

From: "Roland" [Beduerftig@S...]
Date: Thu Aug 9, 2001 2:55 pm
Subject: Re: Node specific Popup Menus

Hi Evgeni Vasilev,

> Could somebody tell me how to assign different context menus
> depending on a node parameter.
> Thank you.

try this:

1. create a new project
2. insert a "Tree" virtualstringtree
3. insert a "Popup" menu
4. add more columns on tree
5. add more then once Menu on "Popup"
6. bind "Popup" to "Tree" using the object inspector

procedure TForm1.TreeGetText(Sender: TBaseVirtualTree;
Node: PVirtualNode; Column: Integer; TextType: TVSTTextType;
var Text: WideString);
begin
Text := IntToStr(Node.Index) + ': ' + IntToStr(Column);
end;

procedure TForm1.FormShow(Sender: TObject);
begin
Tree.NodeDataSize := 0;
Tree.RootNodeCount := 100;
end;

procedure TForm1.TreeMouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
var HitInfo: THitInfo;
begin
Tree.GetHitTestInfoAt(X,Y,false,HitInfo);
Popup.Items[0].Caption := IntToStr(HitInfo.HitNode.Index) + ': '
+ IntToStr(HitInfo.HitColumn);
end;

now you see in popup also the info about the node and column.

regards
Roland


re: Node specific Popup Menus

From: Werner Lehmann [wl@b...]
Date: Thu Aug 9, 2001 3:16 pm
Subject: Re: [VirtualTreeview] Node specific Popup Menus

Hi Evgeni,

> Could somebody tell me how to assign different context menus depending on a
node parameter.
> Thank you.

Dynamically change your popup menu. Or have several popup menus made up ready
and use OnGetPopupMenu.

Werner

 | Replies | Author | Date
3401 | Independent treenodes type structure | Tom | Thu 8/9/2001


Independent treenodes type structure

From: Tom [Tom@s...]
Date: Thu Aug 9, 2001 4:54 pm
Subject: Independent treenodes type structure

I use a virtual treeview and some normal TTreeView's im my application,
which all represent the same data in different ways. All these including
the virtualtreeview are created and destroyed as needed at runtime, and I
was wondering if anyone could suggest a structure that's something like
TTreeNodes in which I could store my data, as TTreeNodes doesnt work unless
its attatched to a treeview. I'm currently using my own solution made from
a hieracy of TLists but its buggy and I'd like to start fresh with some
good code, so does anyone have any experience with this sort of thing or
any examples I could look at?

thanks,
Tom

ps. virtualtreeview is amazing


Multicolumn sorting

From: [mikael@i...]
Date: Thu Aug 9, 2001 8:32 pm
Subject: Multicolumn sorting

Hi.

I just would like to know if multi column sorting is planned to be
implemented.

Example:
A treeview has 3 columns.
1. A user presses the rightmost column. The view gets sorted.
2. The user presses the middle column. The view gets sorted, and the
old sorting should be remembered.
3. The user press the leftmost column, which is the most important
sort column for him. The view get's sorted based on the old sorting.

This technique is implemented in the normal TListView for example and
can be said to be equal to a sample SQL statement like the following:

SELECT * FROM tblXX ORDER BY 1st_column, 2nd_column, 3rd
_column.

Thanks in advance for any replies.

Regards,
Mikael Stalvik

 | Replies | Author | Date
3406 | Re: Multicolumn sorting | Werner Lehmann | Fri 8/10/2001
3441 | Re: Multicolumn sorting | Mike Lischke | Mon 8/13/2001


re: Easiest way to emulate a standard TTreeView?

From: Jim Kueneman [jimdk@m...]
Date: Thu Aug 9, 2001 8:45 pm
Subject: Re: [VirtualTreeview] Easiest way to emulate a standard TTreeView?

Hi Ben,

>That's it. So what would be the best way to do this in a VT,
>particularly the LoadFromFile() & SaveToFile() -- how does this work
>in VT.

Go to the files area and download Save-LoadTree.zip. It is an example I
whipped up for someone in the past.

http://groups.yahoo.com/group/VirtualTreeview/files/

Jim


re: Re: extending lmBands ???

From: Werner Lehmann [wl@b...]
Date: Thu Aug 9, 2001 10:20 pm
Subject: Re: [VirtualTreeview] Re: extending lmBands ???

Moritz Franckenstein wrote:
>
> hm... really important for _me_ are the pictures 4 or 5 - is there
> anyone out there with an idea?

You get to some point with faking a node and owner drawing your bottom
border for a level. But you will run into severe problems soon probably.
Better to extend the PaintTree method. Of course not trivial, and with
support for all the other options VT has allready.

I am not sure what idea you need. You'll just have to sit down and do
it. Or are you stuck somewhere? Then maybe a specific question will help.

I anticipate that it is a work of 1 week or more to get the stuff from
your uploaded images working. Plus beta phase.

Regards,
Werner


re: Independent treenodes type structure

From: Werner Lehmann [wl@b...]
Date: Thu Aug 9, 2001 10:26 pm
Subject: Re: [VirtualTreeview] Independent treenodes type structure

Hi Tom,

> I use a virtual treeview and some normal TTreeView's im my application,
> which all represent the same data in different ways. All these including
> the virtualtreeview are created and destroyed as needed at runtime, and I
> was wondering if anyone could suggest a structure that's something like
> TTreeNodes in which I could store my data, as TTreeNodes doesnt work unless
> its attatched to a treeview. I'm currently using my own solution made from
> a hieracy of TLists but its buggy and I'd like to start fresh with some
> good code, so does anyone have any experience with this sort of thing or
> any examples I could look at?

I am not sure what else you want. A tree is a datastructure of nested lists.
So your TList approach is not bad. Sometimes variations with TObjectList,
dynamic arrays or chained lists may be better, but the principle remains the
same.

Any more specific question?

BTW, if you want to present one piece of data in different views the virtual
treeview is best suited, why still use the TTreeViews which require you to
copy some node data? Don't bind your data to any visual control only for longer
periods of time (e.g. longer than a modal dialog is shown).

> ps. virtualtreeview is amazing

Indeed :)

Regards,
Werner

 | Replies | Author | Date
3429 | Re: Independent treenodes type structure | Tom | Mon 8/13/2001
3453 | Re: Independent treenodes type structure | Wim van der Vegt | Tue 8/14/2001


re: Multicolumn sorting

From: Werner Lehmann [wl@b...]
Date: Thu Aug 9, 2001 10:33 pm
Subject: Re: [VirtualTreeview] Multicolumn sorting

Hi Mikael,

> I just would like to know if multi column sorting is planned to be
> implemented.

Not, that I knew of. You might want to add this to the request list on
yahoo groups.

> Example:
> A treeview has 3 columns.
> 1. A user presses the rightmost column. The view gets sorted.
> 2. The user presses the middle column. The view gets sorted, and the
> old sorting should be remembered.
> 3. The user press the leftmost column, which is the most important
> sort column for him. The view get's sorted based on the old sorting.
>
> This technique is implemented in the normal TListView for example and
> can be said to be equal to a sample SQL statement like the following:

Hm, this sounds as if we would need a special sort algorithm which ensures
that the order of nodes being equal on the current sort key never changes.
The currently used merge sort does not appear to ensure this if you face
this problem (I did not check).

Why don't you implement that yourself? But I would rather see the style
in which the Developer Express treelist is multi column sorted: click
on several columns with shift held down, showing as much sort glyphs as
sort columns there are. But I am not really needing it so it will probably
be your work. Remember that this is open source, taking and sharing :)

Regards,
Werner


Bug fix report

From: "Mike Lischke" [lists@l...]
Date: Fri Aug 10, 2001 9:57 am
Subject: Bug fix report

Hi all,

I've gone through the open bug entries and have a couple of comments for some
of them:

#18: I cannot solve this problem because I have to use a multiline edit as
default edit to allow for a formatting rectangle (to position the edit
correctly). In multiline mode however (as used also by TMemo) the control
behaves weird when the font height is larger then the entire control height.
Hence I recommend to make nodes as large as the font size. Otherwise you will
only see part of the text anyway.

#22: "This fn. must not call InitRootNode." is not a bug description and
InitRoot *must* be called (otherwise the root node has a too small internal
data area).

#23: Also this is not a bug. It is a proposal to improve an aspect of VT.
Please keep this strictly separate. Btw: using ReallocMem instead the current
solution requires to clear the root node record explicitly. So it makes no
sense. And if I simply make what has been proposed (Delete "FreeMem(FRoot)")
then I would produce memory leaks when I call AllocMem afterwards.

#29: Also this is not a bug, but a proposal. Btw: according to the help setting
SWP_NOZORDER will ignore the hnwdInsertAfter parameter which is however to set
the top most style for the hint window. So ignoring it would be contra
productive.

While we are at it: I had the opportunity to test VT on Windows XP RC1 (see two
screen shots in the file area). The situation as whole has improved a lot there
(regarding normal and flat scrollbars). Both work most of the time. There are
still at least two situations where they do not work, however.

One is that for no obvious reason initially only the thumb bar is painted
correctly but not the array buttons. Strangly enough I have two identical trees
(identical options) but one shows the weird behaviour and the other does not.
Once the mouse was moved over one of the arrow buttons everything started
working normally.

The other situation is during drag'n drop. To provide a smooth drag image there
is code to paint non-client area stuff into a back bitmap which is then merged
with the drag image. This is done using the WM_PRINT message (see
TVTDragImage.RecaptureBackground) which works fine except for scrollbars under
XP. The handler for the WM_PRINT message (in DefaultWindowProc) draws the
scrollbars in "old" 3D style (as used on W2K, Win9x etc.) although on screen
the new aqua look is displayed. This leads to a strange visual effect which I
consider as being a bug in the scrollbar handling.

Note: The mentioned scroll bar problems only appear if I use the normal 3D
style. Flat scroll bars are painted as they should. So I believe we can leave
the flat scroll bar code in VT if the mentioned bugs are fixed in RC2/the
release version of XP. If for some reason I have to remove the flat scroll bar
support then I will do it using conditional compilation.

Ciao, Mike

 | Replies | Author | Date
3416 | Re: Bug fix report | Werner Lehmann | Fri 8/10/2001
3418 | Re: Bug fix report | Mike Lischke | Fri 8/10/2001
3422 | Re: Bug fix report | Vadim Sedulin | Fri 8/10/2001
3470 | Re: Bug fix report | Mike Lischke | Wed 8/15/2001
3485 | Re: Bug fix report | Vadim Sedulin | Thu 8/16/2001
3528 | Re: Bug fix report | Mike Lischke | Sun 8/19/2001
3529 | Re: Bug fix report | Jim Kueneman | Sun 8/19/2001
3582 | Re: Bug fix report | Mike Lischke | Fri 8/24/2001


New file uploaded to VirtualTreeview

From: [VirtualTreeview@yahoogroups.com>
Date: Fri Aug 10, 2001 10:03 am
Subject: New file uploaded to VirtualTreeview

Hello,

This email message is a notification to let you know that
a file has been uploaded to the Files area of the VirtualTreeview
group.

File : /VirtualTree_2.5.15.zip
Uploaded by : [lists@l...]
Description : Beta version

You can access this file at the URL

http://groups.yahoo.com/group/VirtualTreeview/files/VirtualTree_2.5.15.zip

To learn more about file sharing for your group, please visit

http://help.yahoo.com/help/us/groups/files

Regards,

lists@l...]

 | Replies | Author | Date
3409 | Re: New file uploaded to VirtualTreeview | Mike Lischke | Fri 8/10/2001
3410 | Bug with mouse wheel | Danil Galimov | Fri 8/10/2001
3475 | Re: Bug with mouse wheel | Mike Lischke | Wed 8/15/2001


re: New file uploaded to VirtualTreeview

From: "Mike Lischke" [lists@l...]
Date: Fri Aug 10, 2001 10:08 am
Subject: RE: [VirtualTreeview] New file uploaded to VirtualTreeview

> This email message is a notification to let you know that
> a file has been uploaded to the Files area of the VirtualTreeview
> group.

This version is mainly for maintenance. All of the documented bugs are fixed
(which could be fixed
of course). Additionally I improved the ContentToXXX routines so they are now
much faster.
IsVisible[Node] := True makes the given node now really visible (expands its
parents).

Ciao, Mike


Bug with mouse wheel

From: "Danil Galimov" [danil@o...]
Date: Fri Aug 10, 2001 10:05 am
Subject: Bug with mouse wheel

Hello all.

Sorry, i cannot access Yahoo Goups correctly, so i will post it here:

I have found a bug in handling mouse wheel by flat scrollbars. If the
window with VT is not enabled (about box is displayed, for
example), i still can scroll the VT using mouse wheel, and this
makes the modal window to lost it focus. I have not tested it with
normal scrollbars, maybe this bug will be in normal scrollbars too.

And a suggestion to ToDo list: - Mike, is it possible to make a
publised property Flat Scrollbars, in which i can change the colors
for flat scfrollbar? Or include this in the colors property? AFAIK, flat
scrollbar colors can be easily customized.

Thanks.

 | Replies | Author | Date
3475 | Re: Bug with mouse wheel | Mike Lischke | Wed 8/15/2001


re: Right way to use VT

From: "Mike Lischke" [lists@l...]
Date: Fri Aug 10, 2001 12:28 pm
Subject: RE: [VirtualTreeview] Right way to use VT

Jim,

> What is the right way to create nodes and child nodes in VT? Both
> AddChild and InsertNode have this disclaimer:

I'm really surprised that this question comes from you. I was very sure if
nobody else than you
would know things like this. So let me reiterate for all old and new listeners
here:

- AddChild and InsertNode *are* compatibility nodes and only there to allow
easier migration of
existing applications from TTreeView to VT. Both methods have to execute the
full chain of updates
etc. for each call if not updating is active. So they are quite ineffective (in
terms of VT times,
compared with TTreeView they are still much faster).
- Properties ChildCount and RootNodeCount (which is only a special version of
ChildCount mainly for
use in the object inspector) should be used if you want to set a number of
child nodes externally.
The underlying code is much more effective for a large number of nodes to add.
- The preferred way of adding child nodes however is to use OnInitNode to tell
there *are* child
nodes and OnInitChildren to tell how many child nodes there are. This allows to
ask for and
initialize child nodes only if they are really needed, not when the application
things it would be a
good place. This is the most effective approach and corresponds much better to
the way a user is
acting and not a programmer is thinking.

Unfortunately, there are situations where you cannot use OnInitNode etc. This
is mostly the case
where it is difficult to access data randomly (e.g. in databases). This is the
weak side of the
paradigm. The point however is that this weak side is only "relatively bad",
because the tree should
only display data which is already there for some reason. It is a viewer not a
container. OK, there
are means to store user data in the tree but this is only to minimize the
effort for very simple
applications. For instance I have written an application which displays images
which are sorted in
various categories (several images can appear in several categories). This is
not at all a complex
application but because the data is stored in a database I have used an
internal data structure
(which is similar to a tree) to hold the data and return information about an
image on demand. The
main structure (the layout of the categories) however is read in advance (you
know, it's the typical
structure: one column holds an id of an item and a second one the id of the
parent of that item). In
my opinion this is an acceptable solution.

The worst case however is reached when there is no information available about
the data to be
displayed, no total count, no child count, perhaps not even if the node is
visible or not until some
complex structure is build. I admit this is the limit of VT and you can only do
some work arounds to
make the situation not so bad.

I hope I clarified some things.

Ciao, Mike

 | Replies | Author | Date
3415 | Re: Right way to use VT | Jim Kueneman | Fri 8/10/2001
3417 | Re: Right way to use VT | Mike Lischke | Fri 8/10/2001
3419 | Re: Right way to use VT | Jim Kueneman | Fri 8/10/2001
3476 | Re: Right way to use VT | Mike Lischke | Wed 8/15/2001


re: OnKeyPress

From: "Mike Lischke" [lists@l...]
Date: Fri Aug 10, 2001 12:28 pm
Subject: RE: [VirtualTreeview] OnKeyPress

> After updating to the newest version, OnKeyPress does nothing anymore.
> Any comments on that?

For some reason I thought it would be a good idea to call the inherited WM_CHAR
handler only if
incremental search is not enabled/pending. This is stupid and I have changed it
now.

Btw: you mentioned a bug, please enter bugs in the future into the bug list in
the data base area of
YG.

Ciao, Mike


re: How many visible children?

From: "Mike Lischke" [lists@l...]
Date: Fri Aug 10, 2001 12:28 pm
Subject: RE: [VirtualTreeview] How many visible children?

Hi Michael,

> My problem is: It happens, that all child-nodes of a node are switched
> invisible. In this case I want to set the parent node invisible too (I
> only have level1 and level0-nodes in my tree).
>
> Is there a function to find out, how many child-nodes of a node are
> *visible*? Or do I have to iterate again and count ...?

There is no function to determine the visible count of child nodes. Use the
iterateSubtree method
instead.

> Would IncrementalSearch do this job for me? And how?

Have you ever heard about what incremental search is? This term is used to
describe what happens
when a user types letters while the VT (or other controls which support IS) has
the focus. In this
case the tree tries to find a node with the caption corresponding to the
letters typed by the user
starting with the currently focused node (the start point can be switched
however in VT). The focus
jumps from node to node while typing because the last typed letter is an
increment to the current
search string. Hence the more letters are typed the more exact is the search
(it is said to be
incrementally refined, hence the name incemental search).

Ciao, Mike

 | Replies | Author | Date
3427 | Re: How many visible children? | Michael Valentiner=Branth | Sun 8/12/2001


re: Re: Exception while editing locks up VTreeview

From: "Mike Lischke" [lists@l...]
Date: Fri Aug 10, 2001 12:28 pm
Subject: RE: [VirtualTreeview] Re: Exception while editing locks up VTreeview

Hi Paul,

> A quick fix for this problem is:

This is not only a quick fix but also a sufficient fix. I have included your
change.

> Problem is, the exception is thrown twice, but at least you can exit
> the edit state.

Actually, the exception is only shown twice while debugging in the IDE. The
user still gets only one
exception.

Ciao, Mike


re: Right way to use VT

From: Jim Kueneman [jimdk@m...]
Date: Fri Aug 10, 2001 2:46 pm
Subject: RE: [VirtualTreeview] Right way to use VT

At 02:28 PM 8/10/2001 +0200, you wrote:
>Jim,
>
> > What is the right way to create nodes and child nodes in VT? Both
> > AddChild and InsertNode have this disclaimer:
>
>I'm really surprised that this question comes from you. I was very sure if
>nobody else than you
>would know things like this. So let me reiterate for all old and new
>listeners here:

I am sorry to disappoint you, oh great one <g>. It just seems there was so
many opinions and suggestions from various people that a good explination
from you could clear up some things and as I hoped it did. Thanks.

your humble follower,
Jim

 | Replies | Author | Date
3417 | Re: Right way to use VT | Mike Lischke | Fri 8/10/2001
3419 | Re: Right way to use VT | Jim Kueneman | Fri 8/10/2001
3476 | Re: Right way to use VT | Mike Lischke | Wed 8/15/2001


re: Bug fix report

From: Werner Lehmann [wl@b...]
Date: Fri Aug 10, 2001 2:51 pm
Subject: Re: [VirtualTreeview] Bug fix report

Hi Mike,

> While we are at it: I had the opportunity to test VT on Windows XP RC1 (see
two screen shots in the file area). The situation as whole has improved a lot
there (regarding normal and flat scrollbars). Both work most of the time. There
are still at least two situations where they do not work, however.
>
> One is that for no obvious reason initially only the thumb bar is painted
correctly but not the array buttons. Strangly enough I have two identical trees
(identical options) but one shows the weird behaviour and the other does not.
Once the mouse was moved over one of the arrow buttons everything started
working normally.
>
> The other situation is during drag'n drop. To provide a smooth drag image
there is code to paint non-client area stuff into a back bitmap which is then
merged with the drag image. This is done using the WM_PRINT message (see
TVTDragImage.RecaptureBackground) which works fine except for scrollbars under
XP. The handler for the WM_PRINT message (in DefaultWindowProc) draws the
scrollbars in "old" 3D style (as used on W2K, Win9x etc.) although on screen
the new aqua look is displayed. This leads to a strange visual effect which I
consider as being a bug in the scrollbar handling.

Did you inform MS about this? As far as I know there is Bug report button on
each
caption bar... Don't know if this is ever read but not doing so means risking
that
they don't even know the problem.

And btw,... Aqua is the code name for the GUI of Mac OS X, don't mean to be
nitpicking
here, but I have seen some comparison between Aqua and Luna and it is said that
MS
might have copied some aspects of the MAC GUI (again :), this adds to the irony.

> Note: The mentioned scroll bar problems only appear if I use the normal 3D
style. Flat scroll bars are painted as they should. So I believe we can leave
the flat scroll bar code in VT if the mentioned bugs are fixed in RC2/the
release version of XP. If for some reason I have to remove the flat scroll bar
support then I will do it using conditional compilation.

I take this as good news and set all my hopes on the bug fixing capabilities of
MS! :)

Werner

 | Replies | Author | Date
3418 | Re: Bug fix report | Mike Lischke | Fri 8/10/2001


re: Right way to use VT

From: "Mike Lischke" [lists@l...]
Date: Fri Aug 10, 2001 3:57 pm
Subject: RE: [VirtualTreeview] Right way to use VT

> I am sorry to disappoint you, oh great one <g>.

I hope I have not annoyed you too much with my surprise...

> your humble follower,

Yes, yes :o] Btw: If you like to follow then do it to my changed home page
(www.lischke-online.de).
Today is an important day, I got my Spirit Of Delphi 2001 Award certificate
from Borland and today
is also my third wedding day.

 | Replies | Author | Date
3419 | Re: Right way to use VT | Jim Kueneman | Fri 8/10/2001
3476 | Re: Right way to use VT | Mike Lischke | Wed 8/15/2001


re: Bug fix report

From: "Mike Lischke" [lists@l...]
Date: Fri Aug 10, 2001 4:05 pm
Subject: RE: [VirtualTreeview] Bug fix report

Hi Werner,

> Did you inform MS about this? As far as I know there is Bug report button on
each
> caption bar... Don't know if this is ever read but not doing so means risking
that
> they don't even know the problem.

No, not yet. I was too busy lately and could only test because I had to test a
new product of my
company on XP. Perhaps I will do it later.

> And btw,... Aqua is the code name for the GUI of Mac OS X, don't mean to be
nitpicking

:-) oops, meant Luna of course.

> here, but I have seen some comparison between Aqua and Luna and it is said
that MS
> might have copied some aspects of the MAC GUI (again :), this adds to the
irony.

Ah come on Werner, they all copy from each other. Apple was not the inventor of
a GUI as it is used
today. This happend already in the late 60's in the Palo Alto Research center.
There was an article
just about this lately in the c't.

> I take this as good news and set all my hopes on the bug fixing capabilities
of MS! :)

They still have some time until October :o]

Ciao, Mike


re: Right way to use VT

From: "Jim Kueneman" [jimdk@m...]
Date: Fri Aug 10, 2001 4:31 pm
Subject: Re: Right way to use VT

--- In [VirtualTreeview@y...], "Mike Lischke" [lists@l...] wrote:
> Yes, yes :o] Btw: If you like to follow then do it to my changed
home page (www.lischke-online.de).
> Today is an important day, I got my Spirit Of Delphi 2001 Award
certificate from Borland and today
> is also my third wedding day.

A big congratulations is in order, it could not have gone to a more
deserving person.

So three happily wedded years for you. How many for your wife?
<vbg>

Congratulations on both accomplishments.

Jim

 | Replies | Author | Date
3476 | Re: Right way to use VT | Mike Lischke | Wed 8/15/2001


OnKeyPress problem

From: Kent Briggs [kbriggs@b...]
Date: Fri Aug 10, 2001 5:44 pm
Subject: OnKeyPress problem

I just upgraded from VT 2.5.9 to 2.5.15 and rebuilt my project. However, the
OnKeyPress event now doesn't fire when an alphanumeric key is pressed. It
does still fire with the spacebar, enter key, etc. I have IncrementalSearch
set to isNone and I looked through the changes posted in the source file but
didn't see anything there that looked relevant to my problem. Any ideas as
to what changes between 2.5.9 and 2.5.15 would have caused this?

--
Kent Briggs, [kbriggs@b...]
Briggs Softworks, http://www.briggsoft.com

 | Replies | Author | Date
3421 | Re: OnKeyPress problem | Anders Thomsen | Fri 8/10/2001
3469 | Re: OnKeyPress problem | Mike Lischke | Wed 8/15/2001
3477 | Re: OnKeyPress problem | Kent Briggs | Wed 8/15/2001


re: OnKeyPress problem

From: "Anders Thomsen" [anders@t...]
Date: Fri Aug 10, 2001 9:39 pm
Subject: Re: [VirtualTreeview] OnKeyPress problem

Some hours ago, Mike answered this:
> After updating to the newest version, OnKeyPress does nothing anymore.
> Any comments on that?

For some reason I thought it would be a good idea to call the inherited WM_CHAR
handler only if
incremental search is not enabled/pending. This is stupid and I have changed it
now.

Btw: you mentioned a bug, please enter bugs in the future into the bug list in
the data base area of
YG.

Ciao, Mike

-Thomsen

----- Original Message -----
From: Kent Briggs
To: [VirtualTreeview@yahoogroups.com
Sent: Friday, August 10, 2001 7:44 PM
Subject: [VirtualTreeview] OnKeyPress problem

I just upgraded from VT 2.5.9 to 2.5.15 and rebuilt my project. However, the
OnKeyPress event now doesn't fire when an alphanumeric key is pressed. It
does still fire with the spacebar, enter key, etc. I have IncrementalSearch
set to isNone and I looked through the changes posted in the source file but
didn't see anything there that looked relevant to my problem. Any ideas as
to what changes between 2.5.9 and 2.5.15 would have caused this?

--
Kent Briggs, kbriggs@b...]
Briggs Softworks, http://www.briggsoft.com

To unsubscribe from this group, send an email to:
VirtualTreeview-unsubscribe@egroups.com

Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.

[Non-text portions of this message have been removed]


re: Bug fix report

From: "Vadim Sedulin" [wsntrl@o...]
Date: Fri Aug 10, 2001 10:08 pm
Subject: Re: [VirtualTreeview] Bug fix report

Hello Mike!

> #22: "This fn. must not call InitRootNode." is not a bug description and
InitRoot *must* be called (otherwise the root node has a too small internal
data area).
> #23: Also this is not a bug. It is a proposal to improve an aspect of VT.
Please keep this strictly separate.

So, there was a bug with assertion in AllocateInternalDataArea... Sorry. I
think that you switch to allocation of the root node in AfterConstruction
only.

> Btw: using ReallocMem instead the current solution requires to clear the
root node record explicitly.
> So it makes no sense.

It makes real sense, because internal data that can be already set will be
preserved.

Without ReallocMem we can say that internal data inaccessible during
construction. In this case call to InitRootNode from
AllocateInternalDataArea makes no sense at all...

Bye.

Vadim Sedulin
E-Mail: [wsntrl@o...]

 | Replies | Author | Date
3470 | Re: Bug fix report | Mike Lischke | Wed 8/15/2001


New file uploaded to VirtualTreeview

From: [VirtualTreeview@yahoogroups.com>
Date: Sat Aug 11, 2001 12:44 am
Subject: New file uploaded to VirtualTreeview

Hello,

This email message is a notification to let you know that
a file has been uploaded to the Files area of the VirtualTreeview
group.

File : /BufferedUpdate.zip
Uploaded by : [wl@b...]
Description : String tree descendant with optional buffered update incl. exe
demo

You can access this file at the URL

http://groups.yahoo.com/group/VirtualTreeview/files/BufferedUpdate.zip

To learn more about file sharing for your group, please visit

http://help.yahoo.com/help/us/groups/files

Regards,

wl@b...]


Buffering updates

From: Werner Lehmann [wl@b...]
Date: Sat Aug 11, 2001 12:39 am
Subject: Buffering updates

Hi,

sometimes I must change the structure of a large VTree (add or delete many
nodes). As
this takes some time (additional processing is done in parallel) I am showing a
progress
dialog which happens to be above the VTree.

I can not really afford to *not* call BeginUpdate before the operation begins.
Although
the tree nicely reflects what is happening the screen update slows down the
whole operation
up to an unacceptable point.

With BeginUpdate though the user can move the progress dialog and 'paint' some
nice patterns
on the VTree which is not updating at that time. And after a task switch the VT
is painted
in clBtnFace, no nodes to be seen until EndUpdate after the whole operation has
ended.

To overcome these problems I have created a descendant of
TCustomVirtualStringTree which
can optionally take a snapshot of the current VTree view on the screen and uses
this to
paint it when needed. Thus the VTree uses BeginUpdate (no slowdown) and still
looks as if
frozen, keeping its original content. With an additional option the backbuffer
is shaded in
an effect which is similar to the windows shutdown dialog desktop effect.

I have uploaded the code and a sample exe (requires runtime package vcl50.bpl,
D5 SP1) to
YG for anyone who is interested. There are some problems left so I recommend
not to use it
already in this state:

- the tree options have no effect, for details see thread "Tree options in
descendants"

- MMX is assumed to be available since the VirtualTrees.MMXAvailabe variable is
not accessible
for descendants (Mike, could you change this and move it to the interface
section?)

- the buffering should only be used when a modal dialog is shown since the
scrollbars of the
VT continue to work during the updating, also the scrollbars are not shaded
with the back-
buffer image (non client area problem).

I'd appreciate any hints on how to solve both scrollbar problems (disable
scrollbar, paint
scrollbar shaded).

The demo works already, of course, since it only uses both new option values
which are
provided as a new option set within TreeOptions.

Regards,
Werner

 | Replies | Author | Date
3447 | Re: Buffering updates | Bender Heri | Tue 8/14/2001
3451 | Re: Buffering updates | Wim van der Vegt | Tue 8/14/2001
3448 | Re: Buffering updates | Werner Lehmann | Tue 8/14/2001
3452 | Re: Buffering updates | Werner Lehmann | Tue 8/14/2001
3534 | Re: Buffering updates | Werner Lehmann | Sun 8/19/2001


Tree options in descendants

From: Werner Lehmann [wl@b...]
Date: Sat Aug 11, 2001 12:39 am
Subject: Tree options in descendants

Hi Mike,

for the first time with the new option structure I am testing how to make a VT
descendent which passes existing options through and extends them with new
ones.

I believe when you made a custom version of the tree options class you had
in mind that descendants can inherit their options from this custom version
and override the TreeOptions property. This approach is not bad and probably
the best I can think of (provided that options should be toggleable in the
OI but also be fast in access). Unfortunately it does not work unless I am
missing something (quite possible of course).

To override the options property I need to provide my own and descended options
class property with my own private FOptions. I can assign this in the property
setter to the inherited TreeOptions. Two 'buts' though:

(1) Changes to the options in the OI are not propagated to the inherited options
(for example if I enable horz grid lines at design time in the OI they are
not painted as with a plain VT).

-> Do I really have to provide my own setters for each option set even for
your
VT options which I am just publishing now (=> means, overriding each
inherited
option set property)?

(2) The ancestor VT is not using the new overridden options class but its
own FOptions (not: Options). This inherited TreeOptions is not published
and thus not streamed.

-> This may be overcome if VT would use Options.PaintOptions etc everywhere
instead of FOptions.FPaintOptions. The former version is not slower, the
compiler creates the same code, but it allows property overriding if I am
not mistaken.

I am suggesting to make FOptions protected. This would allow for a solution
along the lines of the test project below... and both problems from above should
be solved even if you keep referencing FOptions instead of Options everywhere.

I am uploading a demo to YG to demonstrate (among others) the current options
situation (see also thread "Buffering updates").

Regards,
Werner

----------------------------------------

{ The output of this program is:

TA: A
TB: B, C
}

program Project3;

{$APPTYPE CONSOLE}

uses
SysUtils,
Unit3 in 'Unit3.pas';

var
A: TA;
B: TB;

begin
A := TA.Create;
B := TB.Create;
WriteLn(A.Test);
WriteLn(B.Test);
ReadLn;
A.Free;
B.Free;
end.

----------------------------------------

unit Unit3;

interface

uses
Classes, SysUtils;

type
// Options classes...

TOptions = class (TPersistent)
private
FSomeOption: Char;
public
procedure Assign(Source: TPersistent); override;
property SomeOption: Char read FSomeOption write FSomeOption;
end;

TMoreOptions = class (TOptions)
private
FAnotherOption: Char;
public
procedure Assign(Source: TPersistent); override;
property AnotherOption: Char read FAnotherOption write FAnotherOption;
end;

// "Tree" classes...

TA = class
protected
FOptions: TOptions;
public
constructor Create; virtual;
destructor Destroy; override;
function Test: string; virtual; // access options from inside to test
'virtuality'
property Options: TOptions read FOptions;
end;

TB = class(TA)
private
function GetOptions: TMoreOptions;
public
constructor Create; override;
function Test: string; override;
property Options: TMoreOptions read GetOptions;
end;

implementation

{ TOptions }

procedure TOptions.Assign(Source: TPersistent);
begin
if Source is TOptions then
self.SomeOption := TOptions(Source).SomeOption
else
inherited;
end;

{ TMoreOptions }

procedure TMoreOptions.Assign(Source: TPersistent);
begin
if Source is TMoreOptions then
self.AnotherOption := TMoreOptions(Source).AnotherOption;

inherited;
end;

{ TA }

constructor TA.Create;
begin
FOptions := TOptions.Create;
Options.SomeOption := 'A';
end;

destructor TA.Destroy;
begin
FreeAndNil(FOptions);
inherited;
end;

function TA.Test: string;
begin
result := ClassName + ': ' + Options.SomeOption;
end;

{ TB }

constructor TB.Create;
var
MoreOptions: TMoreOptions;
begin
inherited;

// Replace inherited TOptions by our new TMoreOptions.
MoreOptions := TMoreOptions.Create;
MoreOptions.Assign(FOptions);
FOptions.Free;
FOptions := MoreOptions;

// Set some default options.
Options.SomeOption := 'B';
Options.AnotherOption := 'C';
end;

function TB.GetOptions: TMoreOptions;
begin
result := TMoreOptions(FOptions);
end;

function TB.Test: string;
begin
result := inherited Test + ', ' + Options.AnotherOption;
end;

end.

 | Replies | Author | Date
3473 | Re: Tree options in descendants | Mike Lischke | Wed 8/15/2001
3535 | Re: Tree options in descendants | Werner Lehmann | Sun 8/19/2001
3579 | Re: Tree options in descendants | Mike Lischke | Fri 8/24/2001
3592 | Re: Tree options in descendants | Werner Lehmann | Fri 8/24/2001
3600 | Re: Tree options in descendants | Mike Lischke | Sat 8/25/2001


New Folders needed

From: [adembaba@e...]
Date: Sat Aug 11, 2001 6:18 am
Subject: New Folders needed

Hi Mike,

I know this is not that important,
but Files section has become way too
cluttered.

There are way too many static files (i.e.
those that do not change much).

Could you please creata a a few more
folders, such as:

-Help & Info
-Demo Files
-Debug Samples

Cheers,
Adem

 | Replies | Author | Date
3471 | Re: New Folders needed | Mike Lischke | Wed 8/15/2001


re: How many visible children?

From: Michael Valentiner=Branth [MichaelVB@g...]
Date: Sun Aug 12, 2001 7:47 am
Subject: Re: [VirtualTreeview] How many visible children?

Hello Mike,

> Have you ever heard about what incremental search is?

No, and thanx for the explanation. I could not find any in the help or
somewhere else.

Michael


Possible bug?

From: [dragan.juric@q...]
Date: Mon Aug 13, 2001 2:24 pm
Subject: Possible bug?

...or am I doing something wrong?

Situation: I have a tree that before the bug has only first level
nodes. I expand one of them. When during expansion I create n nodes,
if I do not use BeginUpdate/EndUpdate, and later if I press down
arrow to move the seleciton, after n nodes (counted from after the
last added one, that is, from the next first-level node), the tree
starts (in OnGetText) working with a node that is n nodes up from the
selected one, instead with the selected one. Trying to click with the
mouse in order to change selection also seems to select wrong node.

The problem does not appear when I use BeginUpdate/EndUpdate.

The code goes like this: (called from Expanding event of the tree)

ServerList.BeginUpdate;
try
// do some initialization of my data
*******
// end initialization
for i := 0 to ServerNames.Count-1 do
begin
// get data for each node to be created
*******
eventually use "continue" to skip to next data element
if I don't want to display this one
// end get data
ServerNode := ServerList.AddChild(Node);
NodeData := ServerList.GetNodeData(ServerNode);
NodeData.Data := ServerInfo;

// compare data to what should be a default node,
// save it if it is, to select it later
if ServerInfo.SQLVersion <> nil
then if ServerInfo.SQLVersion.Major >= 2000
then if CompareText(ServerInfo.Name,
DBISettings.DefaultServer) = 0
then DefaultServerNode := ServerNode;
//Application.ProcessMessages;
end;
finally
ServerNames.Free;
if Node.ChildCount < 1
then Node.States := Node.States - [vsHasChildren];
if DefaultServerNode <> nil
then ServerList.FocusedNode := DefaultServerNode;
ProgressPanel.Visible := false;
ServerList.EndUpdate;
Screen.Cursor := OldCursor;
end;

And this same code withoug BeginUpdate/EndUpdate will later result in
a problem, as described. Am I doing something wrong? Or is this a
genuine bug?

Dragan

 | Replies | Author | Date
3498 | Re: Possible bug? | Mike Lischke | Sat 8/18/2001


re: Independent treenodes type structure

From: Tom [Tom@s...]
Date: Mon Aug 13, 2001 5:40 pm
Subject: Re: [VirtualTreeview] Independent treenodes type structure

Hi again,
At 00:26 10/08/01 +0200, you wrote:
>I am not sure what else you want. A tree is a datastructure of nested lists.
>So your TList approach is not bad. Sometimes variations with TObjectList,
>dynamic arrays or chained lists may be better, but the principle remains the
>same.
I was looking for a better class because the nodes in my TList system
didn't have links to their parents and siblings so it would be difficult
(or at least inefficient) to access the tree non-sequentially as I need to
do in OnInitChildren etc. Instead of writing something better I've decided
I dont need a tree at all (the data is stored in hash lists, the tree was
just acting as an intermediate structure).

>BTW, if you want to present one piece of data in different views the virtual
>treeview is best suited, why still use the TTreeViews which require you to
>copy some node data? Don't bind your data to any visual control only for
>longer
>periods of time (e.g. longer than a modal dialog is shown).

Actually the only TTreeView I use is a descendant that displays itself in a
combo box (looks very cool), and I think it's less trouble for me to cater
for using TTreeNodes than trying to make VT do that:)

Thanks again for your help,
Tom

 | Replies | Author | Date
3453 | Re: Independent treenodes type structure | Wim van der Vegt | Tue 8/14/2001


[no subject]

From: Martin Lehmann [martin.lehmann@a...]
Date: Mon Aug 13, 2001 5:42 pm
Subject:


re: toHideSelection, the 1-pix distance between nodes, and a white line

From: "Mike Lischke" [lists@l...]
Date: Mon Aug 13, 2001 8:32 pm
Subject: RE: [VirtualTreeview] toHideSelection, the 1-pix distance between nodes, and a white line

Hi Anthony,

> Just updated from 2.4.28 to 2.5.13; wow, what a lot of new options!

Not *so* much. Most of them were there before but have been splitted now. Only
two new options where
added.

> Issue #1: toHideSelection doesn't turn on. My Virtual Treeviews work the
> same whether it's on or off and they're focused or not.

Not in my case. Do you have special handling for painting or something like
that? Btw: please add
bug reports to the bug table in the database area of the mailing list.

> Issue #2: The 1-pixel gap between rows looks bad when toFullRowSelect is on;
> the part of the tree that isn't part of a column has ugly 1-pixel clWindow
> gaps between the selected nodes.

Well, I know. This is a compromise between several disjunct features. I thought
it would be the
lesser evil and it only shows up when horizontal tree lines are visible (which
is the more unlikely
case). Some day perhaps I look again into this and try to find a better
solution.

> Issue #3: When dragging nodes from one VT to another, a white 1-pixel gap
> will sometimes show up between two of the destination nodes. Its placement
> would change from time to time (between 2nd and 3rd nodes, then between 15th
> and 16th nodes), but when it changed, it was fairly random. I suspect this
> is connected to the 1-pixel gap mentioned above.

This is something I cannot reproduce. Could you please create a minimal demo
showing the effect?

> Also, I'm not too fond of the invisible drop target; I prefer that VT honors
> my selection of DropTargetBorderColor and DropTargetColor.

I have no idea what you are talking about here. When I set the drop target
colors to my own choice
then I get them also. Again, something special in your tree?

> Pointing stuff out only to help make the best control there is even better,

Thank you, this is most appreciated :-)

Ciao, Mike


re: Some help on usage of VT

From: "Mike Lischke" [lists@l...]
Date: Mon Aug 13, 2001 8:32 pm
Subject: RE: [VirtualTreeview] Some help on usage of VT

Hi Kiran,

> when i drag & drop a node to new place after setting the drag option to
> doCopy the node & its child node gets copied but the User data is not
> copied. is there a way i get to access the data while its being copied &
> change it say if i want to change the caption to copy of caption & other
> user data respectively.

This is related to different things. Copying the user data is easy by either
responding to
OnNodeCopied or to OnSaveNode/OnLoadNode. Accessing user data during drag is
possible (by
enumerating the currently selected nodes) but is time consuming and therefore
not recommended unless
you limit access to the bare minimum.

> 2: what is this doLink in the options i assume it links the dragged node to
> the drop target & data referenced by both the nodes are same.. am i right???

doLink is there for completeness only. Since it is a valid drag operation I
included it in the
implementation. There is no handling yet for it nor an idea what it means to
"link a node". Create
your own paradigm here.

> 3: when i chose to use image the background is tiled... is there a way i can
> change that to some thing like stretch draw.

That has already been answered a while ago.

Ciao, Mike


re: AnimationDuration := 0

From: "Mike Lischke" [lists@l...]
Date: Mon Aug 13, 2001 8:32 pm
Subject: RE: [VirtualTreeview] AnimationDuration := 0

Hi Adem,

> This is a very small bug, but VT should either
> not let me specify 0 for AnimationDuration or
> when it is 0 then it should turn toAnimatedToggle
> off.
> Do you agree?

Yes, I do. There is now an automatic switch on/off for toAnimatedToggle as well
as a check in
Animate.

Ciao, Mike


re: Some observations regarding the source...

From: "Mike Lischke" [lists@l...]
Date: Mon Aug 13, 2001 8:33 pm
Subject: RE: [VirtualTreeview] Some observations regarding the source...

Hi Theodor,

> versions 1.31 and 2.5.13 this morning and played around with it. First
> off I have to say that I'm *very* impressed. This control kicks ass!
> Well done Mike! :)

Thank you.

> At first I studied version 1.31 (didn't have 2.5.13 until later) and
> found the 98KB impact on the size of the EXE very reasonable (the people
> I work for are very concerned about the size of the EXE). Then I
> downloaded and installed 2.5.13 and suddenly the impact jumped to 196KB!
> I realize that there's a lot of extra functionality, but a doubling in
> size seemed a bit excessive.

I might be a dumb or beaten with extraordinary ignorance but I don't see your
point here. What are
200KB today for the platform at which VT is targetted? VT is a high capacity
tree and will add
several megabytes memory foot print where it is used usually. And still this is
much smaller
compared with any other tree control available today. Lessen the pure tree
memory footprint would
mean to take out functionality. Delphi's linker takes care to remove code which
is not used so
everything which is left is also used in some way. Btw: you can of course use
runtime packages to
avoid large exe sizes.

>Upon further investigation I found the culprit to be TVirtualStringTree. When
using only a
TVirtualDrawTree the
> overall size impact is only 149KB, but TVirtualStringTree is still
> partially linked in. When commenting lines 5063-5065 (which should
> rather be handled by a virtual method IMO) and lines 25221-25227 (since
> I don't require the extended clipboard formats support) the size impact
> drops to 128KB.

This could well be, yes. But what happens if you need it? Should I wrap
everything with loads of
conditional symbols so everyone can pick what is needed (and recompile their
packages afterwards)?

> Since I'm sure there are many users who would like the tree to
> automatically paint strings but don't require the extended clipboard
> formats, I think the current TVirtualStringTree should be split in two.
> The extended clipboard functionality can be added in a descendant of
> TVirtualStringTree. Anyone else agree with this?

It seems there are not many people who like this idea (judged from the lack of
response). It is your
personal preference to have that stuff out. Other people might want to get
something else out and
other things in. It is impossible to make everyone happy. You are unfortunately
in a situation where
you care for that little bit more size, but other people are happy not to have
to care about
clipboard stuff and so on but simply can use it.

> TBitmap.Draw). If so, a simple check in the TileBackground method can
> use BitBlt if Background contains a TBitmap, otherwise
> Background.Graphic.Draw could be used .... If
> Background.Graphic.Transparent is True, then the background could be
> filled with the background color first (to correctly handle TIcon as a
> background graphic for example).

Please add this to the wish list in the database area of the mailing list.

Ciao, Mike


re: A few bug fixes

From: "Mike Lischke" [lists@l...]
Date: Mon Aug 13, 2001 8:32 pm
Subject: RE: [VirtualTreeview] A few bug fixes

> First, with toFullRowSelect I was noticing that the selection in the
> non-column area did not go completely to the bottom. This I fixed by
> commenting out the following line of TBaseVirtualTree.ClearNodeBackground:
>
> if (toFullRowSelect in FOptions.FSelectionOptions) and (vsSelected
> in Node.States) then
> begin
> //Dec(R.Bottom); <-- This line was commented out
> if Focused or (toPopupMode in FOptions.FPaintOptions)then

Strange. I do not see any fix (aside the fact that I cannot see your problem),
but what I see is
that now the selection in unfocused state is not drawn correctly.

Ciao, Mike


re: Checkboxes and children

From: "Mike Lischke" [lists@l...]
Date: Mon Aug 13, 2001 8:32 pm
Subject: RE: [VirtualTreeview] Checkboxes and children

Hi Franc,

> when the tree is not expanded and you check a node which has children, the
> children are not checked when the node is expanded afterwards (although
> tristatechecking is 'on').
> I assume this is because the children weren't initialized at the moment the
> checkbox was checked.
>
> Is this normal behaviour and if so, what's the best way to overcome this so
> that the children get checked also ?

This is normal behavior, yes. But you can in OnChecking validate all children
to get the desired
effect.

Ciao, Mike


re: (Mike, please read) OLE Drag and drop: optimized move and more

From: "Mike Lischke" [lists@l...]
Date: Mon Aug 13, 2001 8:33 pm
Subject: RE: [VirtualTreeview] (Mike, please read) OLE Drag and drop: optimized move and more

> there is still this problem with optimized shell move operation after
> a drag and drop move from the VT to Explorer. The shell will return
> DROPEFFECT_NONE from ActiveX.DoDragDrop but has moved the file(s) at
> that point of time. To learn the real effect one has to implement
> IDataObject.SetData. I believe that this can be done well in the VT
> dataobject. Then nobody is forced to provide an own dataobject for the
> relatively common case of file (CF_HDROP) drag and drop.

I understand your concerns Werner, but I'm quite unsure how I should proceed.
This case you
mentioned is by far not so common. It is a special case of the shell to make
sure that files aren't
deleted which could not be copied (e.g. for remote storage). The tree does not
need that information
at all and the shell takes care to avoid initiators of such operation to act
wrongly (by returning
DROPEFFECT_NONE). Sure, I could implement SetData but this is a bit more
complex that you think.
*When* I start to implement it then it must be a solid implementation, not only
for that one special
case you are in need of at the time being. Unfortunately, this can get complex
because of various
kinds of storage mediums etc. What is the tree expected to do when it suddenly
gets a request to
store say an IStream or IStorage? There is no infrastructure to accept that and
simply refusing it
is no solution at all. Why must the tree handle every possible case, which
hasn't even any meaning
to it as with CFSTR_PERFORMEDDROPEFFECT?

Don't get me wrong. I'm open to suggestions. Perhaps it isn't that difficult.
I'm only afraid about
*a lot* of work when I read articles like "Handling Shell Data Transfer
Scenarios" from MSDN.

> Second problem is that the VT will delete nodes if ActiveX.DoDragDrop
> returns DROPEFFECT_MOVE. I was forced to comment out these lines in
> the VT version at my company. The nodes may only be deleted when the
> database says yes to that operation. I would like to see this optional
> or completely removed... Any chance?

Unlikely. The flag DROPEFFECT_MOVE has only one meaning when returned from
ActiveX.DoDragDrop: to
remove the source data. I would break part of the normal chain when removing
the handling for it.
You could also ask for reordering selected nodes after dd, it would have a
similar effect (->
confusion). If you want to prevent deleting the source nodes then simply do not
return
DROPEFFECT_MOVE. If you do not have control over the drag process then do not
allow a MOVE
operation. It makes no sense to allow a MOVE if you never move afterwards.

> I would like to see an event that fires after a drag and drop (which
> began on the VT and ended on any OLE drop target) has ended and which
> contains the real drop effect (including optimized move resolution,
> thus not only the return value from ActiveX.DoDragDrop since this is
> DROPEFFECT_NONE for optimized moves (and the shell always uses these)).

Mmh, if you need that.... Please add it to the wish list on YG.

Ciao, Mike

 | Replies | Author | Date
3445 | Re: (Mike, please read) OLE Drag and drop: opti | Jim Kueneman | Tue 8/14/2001
3474 | Re: (Mike, please read) OLE Drag and drop: opt | Mike Lischke | Wed 8/15/2001


re: working on selected nodes

From: "Mike Lischke" [lists@l...]
Date: Mon Aug 13, 2001 8:32 pm
Subject: RE: [VirtualTreeview] working on selected nodes

Hi Werner,

> GetSortedSelection does not look at the internal selection array, it uses
GetNextNoInit although
> you say the same in the comment to the method. I say the comment is wrong (I
wished it would be
> true).

Sorry about the wrong information. It seems I have worked to much lately so I
mixed this with other
things.

> You also say GetSortedSelection "returns nodes in memory location order".
This is also
> wrong. Since GetNextNoInit is used it is the logical order.

Actually, it was GetFirstSelected/GetNextSelected which returned the nodes as I
described it. But I
changed these methods to work as the other related methods (nodes in logical
order). Now it seems
like FSelection is no longer needed. It is referenced in various places but
mostly to do some
housekeeping. I have to check this back however before I remove the array
completely.

Ciao, Mike


re: Easiest way to emulate a standard TTreeView?

From: "Mike Lischke" [lists@l...]
Date: Mon Aug 13, 2001 8:33 pm
Subject: RE: [VirtualTreeview] Easiest way to emulate a standard TTreeView?

Hi Ben,

> Vanilla TTreeView
> Does a .LoadFromFile() to get contents
> I cycle through the nodes and:
> - set the images
> - set Node.Data to an integer
> I can rearrange nodes via drag a drop
> Does a .SaveToFile() to save contents
>
> That's it. So what would be the best way to do this in a VT,
> particularly the LoadFromFile() & SaveToFile() -- how does this work
> in VT.

In this scenario I can only see one problem and this is the format of the file
you are using to keep
tree data. TTreeView uses plain text while VT uses binary data. So you cannot
directly load the tab
delimited text file into VT. You can however take existing routines (e.g. from
my TreeNT at
www.lischke-online.de/Controls.html) which parse such a file and create nodes
from it. Storing would
hower be incompatible with any TTreeView once and for all.

Cycling through the nodes is easy and fast. Use GetFirst/GetNext to do this. An
alternative would be
IterateSubtree, but for a full traversal the first way is the better one.

Setting node data to a value is trivial too. Assign VT.NodeDataSize the size of
the data you want to
store (here obviously only 4 bytes for the ony integer) and load your tree. Get
the pointer to the
user data via VT.GetNodeData and use it as PInteger.

Drag'n drop is more difficult and you should first implement the other stuff.
Then download the OLE
demo from the file area of this mailing list and read carefully the source code
to learn how to do
dd.

Ciao, Mike


re: Redraw problem in large trees during keyboard scrolling

From: "Mike Lischke" [lists@l...]
Date: Mon Aug 13, 2001 8:33 pm
Subject: RE: [VirtualTreeview] Redraw problem in large trees during keyboard scrolling

> Well, this works. But: if I do not scroll by mouse (and scrollbar) but by key
up
> and down the node text's in the current tree 'view' (scroll area) are
duplicated
> while the tree is scrolling and the arrow key is held down. As soon as the
key is
> released the view is correct again. It is hard to describe but easy to
reproduce:

Mmmh, this sounds strange but I vaguely remember about a similar effect a while
ago. This was
related to slow tree painting, because of both a slow machine and not optimized
code. The code has
now been optimized...

> I don't have trees with so many nodes very often and it surely makes not much
sense
> to have 50000 nodes in one branch as siblings.

:-)) It makes sense, believe me. Imagine a dictionary with 100.000+ words, each
with 5 or more
translations as child nodes.

> No idea why at the moment. I only hope you know some places to check.
Probably hard
> to debug since scrolling the tree while stepping through the code is not
really easy...

To be sure I checked again with the advanced demo (on a 350MHz machine and 1M
root nodes). I cannot
reproduce this effect.

Ciao, Mike


re: Multicolumn sorting

From: "Mike Lischke" [lists@l...]
Date: Mon Aug 13, 2001 8:33 pm
Subject: RE: [VirtualTreeview] Multicolumn sorting

Hi Mikael,

> I just would like to know if multi column sorting is planned to be
> implemented.

There is nothing to implement (except a kind of indicator). Simply do the
proper comparation in
OnCompareNodes to sort them over several columns. You have to manage the
columns yourself, however.
The only problem is the indication which columns are sorted in which order.

Ciao, Mike


re: working on selected nodes

From: Werner Lehmann [wl@b...]
Date: Mon Aug 13, 2001 10:20 pm
Subject: Re: [VirtualTreeview] working on selected nodes

Hi Mike,

> > GetSortedSelection does not look at the internal selection array, it uses
GetNextNoInit although
> > you say the same in the comment to the method. I say the comment is wrong
(I wished it would be
> > true).
>
> Sorry about the wrong information. It seems I have worked to much lately so I
mixed this with other
> things.

Never mind. I even triple checked since it was so likely that I was at fault :)

> Actually, it was GetFirstSelected/GetNextSelected which returned the nodes as
I described it. But I
> changed these methods to work as the other related methods (nodes in logical
order). Now it seems
> like FSelection is no longer needed. It is referenced in various places but
mostly to do some
> housekeeping. I have to check this back however before I remove the array
completely.

Aha. I regret this somewhat. Getting the nodes from the array should be faster.
Magnitudes. I know you
will say 1e6 nodes - 350ms :) Did not check that figure. Still it appears like
resource wasting to browse
1..n nodes only to learn that node n is selected. The search could at least
stop if SelectedCount nodes
are found. In GetSortedSelection.

Regards,
Werner

 | Replies | Author | Date
3472 | Re: working on selected nodes | Mike Lischke | Wed 8/15/2001


re: Redraw problem in large trees during keyboard scrolling

From: Werner Lehmann [wl@b...]
Date: Mon Aug 13, 2001 10:19 pm
Subject: Re: [VirtualTreeview] Redraw problem in large trees during keyboard scrolling

Hi Mike,

> Mmmh, this sounds strange but I vaguely remember about a similar effect a
while ago. This was
> related to slow tree painting, because of both a slow machine and not
optimized code. The code has
> now been optimized...

I see.

> > I don't have trees with so many nodes very often and it surely makes not
much sense
> > to have 50000 nodes in one branch as siblings.
>
> :-)) It makes sense, believe me. Imagine a dictionary with 100.000+ words,
each with 5 or more
> translations as child nodes.

Well, I am primarily focusing on the problem to scroll through the nodes with
the scrollbar,
1 Pixel too much and you are off by hundreds or thousands of nodes :)

> > No idea why at the moment. I only hope you know some places to check.
Probably hard
> > to debug since scrolling the tree while stepping through the code is not
really easy...
>
> To be sure I checked again with the advanced demo (on a 350MHz machine and 1M
root nodes). I cannot
> reproduce this effect.

Hm. I will check on a 633 Celeron with Win98. On my Celeron 533 under Win2k Sp1
the effect
is immediately reproducible again, even after I started a new project and
followed my own
instructions. I would post the project but it is really only setting the
rootnodecount and
the gettext handler.

With 50000 nodes it gets even worse. Focus on last node. Hold VK_UP down. Focus
moves up only
one node, no other visible changes. If the key is released the tree is
repainted and one can
see that it has been scrolled while the display was frozen. Also, if I hold the
key down for
a shorter time, I can see that the focus switch is far more slower than it used
to be (and is
also faster (=normal) if the focus is on the first node and moves down).

As I said this is a low priority at least for me. Only strange. I would say it
is not dependent
on the speed of the machine as 350 < 533.

Regards,
Werner

PS: I have found something significant. If I set the rootnodecount in
FormCreate (only) the
phenomenon does not occur. Regardless if 50000 or 1000000. But if the count is
set in OI (as
described) the effect happens. With 1.000.000 nodes right from the OI the tree
is very slow
at the last nodes. Changing focus takes about 5s then.

I suspect that this might be a memory manager problem. I have noticed (on other
occasions)
that if large portions of memory are freed reallocation right after that is
sloooow. So if
the 50000 rootnodes are create twice during startup if set up in the OI it
might be this
problem. Don't know if they are really created twice, just a guess.

 | Replies | Author | Date
3499 | Re: Redraw problem in large trees during keyboard | Mike Lischke | Sat 8/18/2001


image artifacts

From: [martin.lehmann@a...]
Date: Mon Aug 13, 2001 11:25 pm
Subject: image artifacts

Hi there,

I just upgraded from 1.3.1 to 2.5.15 (since the new version is so
much more frugal when it comes to GDI resource consumption) but I
encountered one problem that I've been unable to solve:
in some cases (meaning for certain images) the images in my VTs are
corrupted (like somebody overlayed a white line on that image).

What am I doing wrong?

Also, enabling AutoScrollOnExpand causes an AV when a node
gets "reexpanded" (i. e. expand the node, collapse it, expand
again..and bang)

Thanks for the excellent work!

Martin

 | Replies | Author | Date
3446 | Re: image artifacts | Jim Kueneman | Tue 8/14/2001
3456 | Re: image artifacts | Martin Lehmann | Tue 8/14/2001
3466 | Minor Bugreport | Wim van der Vegt | Wed 8/15/2001
3501 | Re: Minor Bugreport | Mike Lischke | Sat 8/18/2001


re: (Mike, please read) OLE Drag and drop: optimized move and more

From: Jim Kueneman [jimdk@m...]
Date: Tue Aug 14, 2001 12:39 am
Subject: RE: [VirtualTreeview] (Mike, please read) OLE Drag and drop: optimized move and more

At 10:33 PM 8/13/2001 +0200, you wrote:

>Don't get me wrong. I'm open to suggestions. Perhaps it isn't that
>difficult. I'm only afraid about
>*a lot* of work when I read articles like "Handling Shell Data Transfer
>Scenarios" from MSDN.

Be afraid Mike be *very* afraid <g>. It is not trivial and has lots of traps.

Mike and Werner, I currently am working on a slick (IMHO) wrapper for
IDataObject and OLE Drag/Drop It includes implementation of SetData for
the IDragSourceHelper image in Win2k. Give me a week or so more to clean
up the details. I am not suggesting that VT use this (or maybe I am) but
it does everything that Werner is asking for, detecting and telling the
user about optimized moves, BeforeDrag / AfterDrag events plus it
automaticlly handles the mouse and the drag. Just drop it assign a
WinControl.handle to it and it works like magic. It also supports an easy
interface to adding new clipboard formats and an simple way to register
"ClipboardModules" as interfaces to creates "handlers" for new formats the
user creates or to read/write windows defined clipboard formats. Right now
I have HDrop, ShellIDList, and PerformedDropEffect (optimized moves).

I basiclly took your idea on clipboard format registration and took it to
the next level (or two).

Hang tight.

Jim

 | Replies | Author | Date
3474 | Re: (Mike, please read) OLE Drag and drop: opt | Mike Lischke | Wed 8/15/2001


re: image artifacts

From: Jim Kueneman [jimdk@m...]
Date: Tue Aug 14, 2001 12:43 am
Subject: Re: [VirtualTreeview] image artifacts

At 11:25 PM 8/13/2001 +0000, you wrote:
>Hi there,
>
>I just upgraded from 1.3.1 to 2.5.15 (since the new version is so
>much more frugal when it comes to GDI resource consumption) but I
>encountered one problem that I've been unable to solve:
>in some cases (meaning for certain images) the images in my VTs are
>corrupted (like somebody overlayed a white line on that image).
>
>What am I doing wrong?

Make sure you are checking for what image is being requested in the
event. The new version has a flag for normal, selected, overlay etc. Only
change the return result at the right time.

>Also, enabling AutoScrollOnExpand causes an AV when a node
>gets "reexpanded" (i. e. expand the node, collapse it, expand
>again..and bang)

You are likely doing something in the expanding events that is recursive
with AutoScroll (speaking from experience <g>)

Jim


re: Buffering updates

From: Bender Heri [HBender@E...]
Date: Tue Aug 14, 2001 8:47 am
Subject: RE: [VirtualTreeview] Buffering updates

> To overcome these problems I have created a descendant of
> TCustomVirtualStringTree which
> can optionally take a snapshot of the current VTree view on
> the screen and uses this to
> paint it when needed. Thus the VTree uses BeginUpdate (no
> slowdown) and still looks as if
> frozen, keeping its original content. With an additional
> option the backbuffer is shaded in
> an effect which is similar to the windows shutdown dialog
> desktop effect.

In such situations (during a lengthy tree operation) I usually set the tree
invisible in conjunction with the hourglass cursor. So the users desktop is
not that fancy as it could be, but I avoid to have problems with
inconsistent desktops.

Heri

 | Replies | Author | Date
3451 | Re: Buffering updates | Wim van der Vegt | Tue 8/14/2001


re: Buffering updates

From: Werner Lehmann [wl@b...]
Date: Tue Aug 14, 2001 10:33 am
Subject: Re: [VirtualTreeview] Buffering updates

Hi Heri,

> In such situations (during a lengthy tree operation) I usually set the tree
> invisible in conjunction with the hourglass cursor. So the users desktop is
> not that fancy as it could be, but I avoid to have problems with
> inconsistent desktops.

Correct. But removing the whole tree (visually by making it invisible) seems a
bit too rigorous to me. And I believe my solution is very acceptable when the
tree options can be expanded at some time in the future. Everything which is
needed is to move FOptions from private to protected...

Regards,
Werner


re: (Mike, please read) OLE Drag and drop: optimized move and more

From: Werner Lehmann [wl@b...]
Date: Tue Aug 14, 2001 10:42 am
Subject: Re: [VirtualTreeview] (Mike, please read) OLE Drag and drop: optimized move and more

Hi Jim,

> >Don't get me wrong. I'm open to suggestions. Perhaps it isn't that
> >difficult. I'm only afraid about
> >*a lot* of work when I read articles like "Handling Shell Data Transfer
> >Scenarios" from MSDN.
>
> Be afraid Mike be *very* afraid <g>. It is not trivial and has lots of
traps.

Uhm, Jim, this is contraproductive, I was trying to talk Mike into having
this feature (implemented by me or him) and you are scaring him away :)

> Mike and Werner, I currently am working on a slick (IMHO) wrapper for
> IDataObject and OLE Drag/Drop It includes implementation of SetData for
> the IDragSourceHelper image in Win2k. Give me a week or so more to clean
> up the details. I am not suggesting that VT use this (or maybe I am) but
> it does everything that Werner is asking for, detecting and telling the
> user about optimized moves, BeforeDrag / AfterDrag events plus it
> automaticlly handles the mouse and the drag. Just drop it assign a
> WinControl.handle to it and it works like magic. It also supports an easy
> interface to adding new clipboard formats and an simple way to register
> "ClipboardModules" as interfaces to creates "handlers" for new formats the
> user creates or to read/write windows defined clipboard formats. Right now
> I have HDrop, ShellIDList, and PerformedDropEffect (optimized moves).
>
> I basiclly took your idea on clipboard format registration and took it to
> the next level (or two).

I take this as very good news. Someone who does my work :)

Apparently you are going the same way as Anders Melander with his drag & drop
components (because of the WinControl.Handle). This means no tight integration
into the VT (can the dataobject be used in the VT event OnCreateDataObject?).

Trouble is probably to be expected with the drag image. You rely on the drag
source helper. Nice on Win2k, but no drag image at all on everything else (but
XP). And this includes even drag and drop within the same tree. Or am I wrong
here?

Regards,
Werner

 | Replies | Author | Date
3450 | Re: (Mike, please read) OLE Drag and drop: optimi | Werner Lehmann | Tue 8/14/2001
3454 | Re: (Mike, please read) OLE Drag and drop: optimi | Jim Kueneman | Tue 8/14/2001
3515 | Re: (Mike, please read) OLE Drag and drop: optimi | Werner Lehmann | Sun 8/19/2001
3519 | Re: (Mike, please read) OLE Drag and drop: optimi | Jim Kueneman | Sun 8/19/2001
3524 | Re: (Mike, please read) OLE Drag and drop: optimi | Werner Lehmann | Sun 8/19/2001
3537 | Re: (Mike, please read) OLE Drag and drop: optimi | Jim Kueneman | Sun 8/19/2001


re: (Mike, please read) OLE Drag and drop: optimized move and more

From: Werner Lehmann [wl@b...]
Date: Tue Aug 14, 2001 11:00 am
Subject: Re: [VirtualTreeview] (Mike, please read) OLE Drag and drop: optimized move and more

Hi Mike,

> > there is still this problem with optimized shell move operation after
> > a drag and drop move from the VT to Explorer. The shell will return
> > DROPEFFECT_NONE from ActiveX.DoDragDrop but has moved the file(s) at
> > that point of time. To learn the real effect one has to implement
> > IDataObject.SetData. I believe that this can be done well in the VT
> > dataobject. Then nobody is forced to provide an own dataobject for the
> > relatively common case of file (CF_HDROP) drag and drop.
>
> I understand your concerns Werner, but I'm quite unsure how I should proceed.
This case you
> mentioned is by far not so common. It is a special case of the shell to make
sure that files aren't
> deleted which could not be copied (e.g. for remote storage). The tree does
not need that information

Hm. It is only that the shell always uses this on a move drop. Even if source
and target files are
not on the same drives. You handle a drop move in the tree automatically (which
I regret but you
still do it). The shell move is unhandled. And no event tells me what happened
(let alone influence
the automatic VT processing).

> at all and the shell takes care to avoid initiators of such operation to act
wrongly (by returning
> DROPEFFECT_NONE). Sure, I could implement SetData but this is a bit more
complex that you think.

> *When* I start to implement it then it must be a solid implementation, not
only for that one special
> case you are in need of at the time being. Unfortunately, this can get
complex because of various
> kinds of storage mediums etc. What is the tree expected to do when it
suddenly gets a request to
> store say an IStream or IStorage? There is no infrastructure to accept that
and simply refusing it
> is no solution at all. Why must the tree handle every possible case, which
hasn't even any meaning
> to it as with CFSTR_PERFORMEDDROPEFFECT?

Ok, I see we have different opinions on this topic. I say it is not necessary
to accept each and
every possible storage medium. GetData also does support only TYMED_HGLOBAL.
Accept only such media
which are meaningful and supported.

About the complexity of the optimized move, I offered to try and implement
this. Looks as if Jim
is doing the work now.

> Don't get me wrong. I'm open to suggestions. Perhaps it isn't that difficult.
I'm only afraid about
> *a lot* of work when I read articles like "Handling Shell Data Transfer
Scenarios" from MSDN.

Most of the scenarios are irrelevant (I read them all).

> > Second problem is that the VT will delete nodes if ActiveX.DoDragDrop
> > returns DROPEFFECT_MOVE. I was forced to comment out these lines in
> > the VT version at my company. The nodes may only be deleted when the
> > database says yes to that operation. I would like to see this optional
> > or completely removed... Any chance?
>
> Unlikely. The flag DROPEFFECT_MOVE has only one meaning when returned from
ActiveX.DoDragDrop: to
> remove the source data. I would break part of the normal chain when removing
the handling for it.
> You could also ask for reordering selected nodes after dd, it would have a
similar effect (->
> confusion). If you want to prevent deleting the source nodes then simply do
not return
> DROPEFFECT_MOVE. If you do not have control over the drag process then do not
allow a MOVE
> operation. It makes no sense to allow a MOVE if you never move afterwards.

I am not sure we are still talking into different directions here. I want to
allow the move.
I want to make the move happen (including the delete). But I need more control
on it. You do
nothing with a link drag, why is it so uncomfortable to do nothing with a move
drag and just
inform the user? Ok, this question was academic. I know that you want to keep
that. I can
understand it at least with the context of not breaking existing code.

But, the only place I am required to directly patch the VT source, ever, is
this place. I must
comment these lines (which do the delete on move). To make this optional, and
even keep the
default behaviour if the option is not used, is not much of a problem. To the
contrary.

> > I would like to see an event that fires after a drag and drop (which
> > began on the VT and ended on any OLE drop target) has ended and which
> > contains the real drop effect (including optimized move resolution,
> > thus not only the return value from ActiveX.DoDragDrop since this is
> > DROPEFFECT_NONE for optimized moves (and the shell always uses these)).
>
> Mmh, if you need that.... Please add it to the wish list on YG.

Ok.

Regards,
Werner


re: Buffering updates

From: "Wim van der Vegt" [wvd_vegt@k...]
Date: Tue Aug 14, 2001 11:10 am
Subject: RE: [VirtualTreeview] Buffering updates

Hi,

Did you try the win32 api function LockWindowUpdate() already? It prevents
painting to the windowhandle passed to the function. I also use it sometimes
to set temporary background colors of some controls for printing purposes.

------
Wim van der Vegt

-----Original Message-----
From: [sentto-2425673-3448-997778450-wvd_vegt=knoware.nl@r...]
[mailto:[sentto-2425673-3448-997778450-wvd_vegt=knoware.nl@r...]
m]On Behalf Of Bender Heri
Sent: dinsdag 14 augustus 2001 10:48
To: 'VirtualTreeview@yahoogroups.com'
Subject: RE: [VirtualTreeview] Buffering updates

> To overcome these problems I have created a descendant of
> TCustomVirtualStringTree which
> can optionally take a snapshot of the current VTree view on
> the screen and uses this to
> paint it when needed. Thus the VTree uses BeginUpdate (no
> slowdown) and still looks as if
> frozen, keeping its original content. With an additional
> option the backbuffer is shaded in
> an effect which is similar to the windows shutdown dialog
> desktop effect.

In such situations (during a lengthy tree operation) I usually set the
tree
invisible in conjunction with the hourglass cursor. So the users desktop
is
not that fancy as it could be, but I avoid to have problems with
inconsistent desktops.

Heri

To unsubscribe from this group, send an email to:
VirtualTreeview-unsubscribe@egroups.com

Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.

[Non-text portions of this message have been removed]


re: Buffering updates

From: Werner Lehmann [wl@b...]
Date: Tue Aug 14, 2001 11:16 am
Subject: Re: [VirtualTreeview] Buffering updates

Hi Wim,

> Did you try the win32 api function LockWindowUpdate() already? It prevents
> painting to the windowhandle passed to the function. I also use it sometimes
> to set temporary background colors of some controls for printing purposes.

No, but I know that function. The problem with it is that it forces a refresh
of the desktop if the lock is removed (resulting in a visible flash). It is
better to use WM_SETREDRAW as Mike is already doing (and which I needed to
conditionally change with respect to the options in my descendant). The problem
with both is that you can draw nice patterns on the frozen control with other
windows.

Regards,
Werner


re: Independent treenodes type structure

From: "Wim van der Vegt" [wvd_vegt@k...]
Date: Tue Aug 14, 2001 12:10 pm
Subject: RE: [VirtualTreeview] Independent treenodes type structure

Hi,

I wrote a simple class that holds the mids between a TTreeNode(s) and
TListItem(s) and mimics most of the simple manipulation functions of both.
It's still in development (read pre beta) and doesn't function well on
design time but i'm willing to upload it if someone is interested.

Wim van der Vegt
-----Original Message-----
From:
[sentto-2425673-3430-997724433-wvd_vegt=knoware.nl@r...]
[mailto:[sentto-2425673-3430-997724433-wvd_vegt=knoware.nl@r...]
m]On Behalf Of Tom
Sent: maandag 13 augustus 2001 19:40
To: VirtualTreeview@yahoogroups.com
Subject: Re: [VirtualTreeview] Independent treenodes type structure

Hi again,
At 00:26 10/08/01 +0200, you wrote:
>I am not sure what else you want. A tree is a datastructure of nested
lists.
>So your TList approach is not bad. Sometimes variations with TObjectList,
>dynamic arrays or chained lists may be better, but the principle remains
the
>same.
I was looking for a better class because the nodes in my TList system
didn't have links to their parents and siblings so it would be difficult
(or at least inefficient) to access the tree non-sequentially as I need to
do in OnInitChildren etc. Instead of writing something better I've decided
I dont need a tree at all (the data is stored in hash lists, the tree was
just acting as an intermediate structure).

>BTW, if you want to present one piece of data in different views the
virtual
>treeview is best suited, why still use the TTreeViews which require you
to
>copy some node data? Don't bind your data to any visual control only for
>longer
>periods of time (e.g. longer than a modal dialog is shown).

Actually the only TTreeView I use is a descendant that displays itself in
a
combo box (looks very cool), and I think it's less trouble for me to cater
for using TTreeNodes than trying to make VT do that:)

Thanks again for your help,
Tom

To unsubscribe from this group, send an email to:
VirtualTreeview-unsubscribe@egroups.com

Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.

[Non-text portions of this message have been removed]


re: (Mike, please read) OLE Drag and drop: optimized move and more

From: Jim Kueneman [jimdk@m...]
Date: Tue Aug 14, 2001 1:01 pm
Subject: Re: [VirtualTreeview] (Mike, please read) OLE Drag and drop: optimized move and more

At 12:42 PM 8/14/2001 +0200, you wrote:

>Uhm, Jim, this is contraproductive, I was trying to talk Mike into having
>this feature (implemented by me or him) and you are scaring him away :)

Sorry, just trying to be truthful :^) IDataObject is *extreamly* powerful
but that power comes at the price a extream complexity in using it to it
fullest potential. That was what made me want to create this
component. Using IDataObject is *the* way to pass information especially
across process boundries (including two instances of the same program) and
I wanted to try to make it so it was always my first choice when I needed
to do this task. It really started out as an IDataObject wrapper that
ended up being a D&D wrapper (and when finished a Clipboard wrapper
implementing the "delete on paste" scenarios.

>Apparently you are going the same way as Anders Melander with his drag & drop
>components (because of the WinControl.Handle). This means no tight integration
>into the VT (can the dataobject be used in the VT event OnCreateDataObject?).

Yes it is similar to Anders D&D Suite, but it is more generic . It is
necessary to have window handle to register with the OLE subsystem. I have
not looked into using it with VT. My guess is VT would have to be changed
to get it to work. I have include enough hooks to allow the user to
competlely override anything to do with the D&D. Once I get it working
(well it is working now I am just trying to clean it up) I will see what
needs to be done to VT to use it. It may be possible to turn off D&D in VT
then just use my component attached to it. Have you tried that with D&D Suite?

>Trouble is probably to be expected with the drag image. You rely on the drag
>source helper. Nice on Win2k, but no drag image at all on everything else (but
>XP). And this includes even drag and drop within the same tree. Or am I wrong
>here?

Right now I am using the helpers true but if they are not available I drop
back to the image list base image. It seem like the image list image
dragging gets slower as computers get faster! I may try to "borrow" Mikes
MMX stuff from VT if I get a lot of extra time (ha).

Jim


re: extending lmBands ???

From: "Wim van der Vegt" [wvd_vegt@k...]
Date: Tue Aug 14, 2001 1:19 pm
Subject: RE: [VirtualTreeview] extending lmBands ???

Hi,

Could you not return a (non rectanguar) region, instead of a rectangle in
the event handlers used for the background painting? You could start with
the total rectangle (multiline) and cut out the childnode's rectangles.

Or paint hierachically, if you start at the top/left level and work your way
right/down with background paints, all other nodes should paint fine. This
will however be a major change in architecture i'm afraid.

Wim van der Vegt
-----Original Message-----
From:
[sentto-2425673-3378-997212589-wvd_vegt=knoware.nl@r...]
[mailto:[sentto-2425673-3378-997212589-wvd_vegt=knoware.nl@r...]
m]On Behalf Of Mike Lischke
Sent: dinsdag 7 augustus 2001 21:29
To: VirtualTreeview@yahoogroups.com
Subject: RE: [VirtualTreeview] extending lmBands ???

Moritz,

> mike, could you tell me your opinion about it? is it possible? do you
> have some hints for me how i can do it? i think this would be of
> general use and implementing it into vt could increase vt's worth.

Well, I still have more than 40 mails pending (most require more than a
simple answer) so I do not
want to prefer this particular one. I only want to say that I though about
such things too.
Particularly xml_3.png was in my mind because it allows "Outlook-like"
things. However I have no
idea how to implement this currently and still a lot of other things to do
(including reducing open
bugs :-)). Additionally, I'm on vacation next weekend, so...

But on this list are meanwhile more than 520 people listening. There
should be some more than the 5
enthusiasts which always discuss here to give you an idea.

Ciao, Mike

To unsubscribe from this group, send an email to:
VirtualTreeview-unsubscribe@egroups.com

Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.

[Non-text portions of this message have been removed]

 | Replies | Author | Date
3467 | Re: extending lmBands ??? | Wim van der Vegt | Wed 8/15/2001
3468 | Re: extending lmBands ??? | Wim van der Vegt | Wed 8/15/2001
3486 | Re: extending lmBands ??? | Moritz Franckenstein | Thu 8/16/2001


re: image artifacts

From: Martin Lehmann [martin.lehmann@a...]
Date: Tue Aug 14, 2001 5:07 pm
Subject: Re: [VirtualTreeview] image artifacts

Thanks a lot - the overlay image stuff was the culprit (duh...could've seen
that myself).
As for the AV when using AutoScrollOnExpand - the problem seems to be that I
EXIT the OnExpanding-code in case the child nodes have already been loaded
(my app is DB based, thus I load the data only when needed, i. e.
"OnFirstExpand"). While that's odd, it's certainly not a show stopper, so I
will deal with it later...

Thanks again

Martin

----- Original Message -----
From: "Jim Kueneman" [jimdk@m...]
To: <VirtualTreeview@yahoogroups.com>
Sent: Monday, August 13, 2001 17:43
Subject: Re: [VirtualTreeview] image artifacts

> At 11:25 PM 8/13/2001 +0000, you wrote:
> >Hi there,
> >
> >I just upgraded from 1.3.1 to 2.5.15 (since the new version is so
> >much more frugal when it comes to GDI resource consumption) but I
> >encountered one problem that I've been unable to solve:
> >in some cases (meaning for certain images) the images in my VTs are
> >corrupted (like somebody overlayed a white line on that image).
> >
> >What am I doing wrong?
>
> Make sure you are checking for what image is being requested in the
> event. The new version has a flag for normal, selected, overlay etc.
Only
> change the return result at the right time.
>
> >Also, enabling AutoScrollOnExpand causes an AV when a node
> >gets "reexpanded" (i. e. expand the node, collapse it, expand
> >again..and bang)
>
> You are likely doing something in the expanding events that is recursive
> with AutoScroll (speaking from experience <g>)
>
> Jim
>
>
> To unsubscribe from this group, send an email to:
> VirtualTreeview-unsubscribe@egroups.com
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>

 | Replies | Author | Date
3466 | Minor Bugreport | Wim van der Vegt | Wed 8/15/2001
3501 | Re: Minor Bugreport | Mike Lischke | Sat 8/18/2001


Node property editor in C++ Builder

From: [sigis@c...]
Date: Tue Aug 14, 2001 6:24 pm
Subject: Node property editor in C++ Builder

Hi all,

I use BCB 5 and I'm just wondering if it is possible to create
property editor for virtual string tree. Problem is very simple, C++
Builder doesn't allow to derive from multiply classes
(TInterfacedObject, IVTEditLink). Is here another way to do that?
All what I need is drop down list (combo box) and/or edit
component with certain restrictions depending on node level. Thank
you for any suggestion.

Sig

 | Replies | Author | Date
3514 | Re: Node property editor in C++ Builder | Werner Lehmann | Sun 8/19/2001
3518 | Re: Node property editor in C++ Builder | Jim Kueneman | Sun 8/19/2001


How to reduce GDI resource consumption?

From: [martin.lehmann@a...]
Date: Tue Aug 14, 2001 8:22 pm
Subject: How to reduce GDI resource consumption?

Hi there,

I currently develop a mid size custom client-server application for
order/purchasing/customer/inventory management (barcodes, credit
cards, the whole bit). I COULD NOT HAVE DONE THIS WITHOUT VT. To give
just one example: after trying every SQL optimization in the book,
just changing the backend from TListView to VT increased data loading
speed by about a factor of 4! (3500 records, 10 of so fields).

The only problem I have is the stupid GDI resource limitations in
Windows9x/ME. Even though 2.5.x is WAY BETTER than 1.3.1 which I had
before, the software still can bring Win9x to its knees.

Is there an easy way (maybe turning off some options...) to reduce
GDI resource consumption? Any idea would be highly apprechiated....

TIA

Martin

 | Replies | Author | Date
3459 | Re: How to reduce GDI resource consumption? | Werner Lehmann | Tue 8/14/2001
3460 | Re: How to reduce GDI resource consumption? | Martin Lehmann | Wed 8/15/2001
3464 | Re: How to reduce GDI resource consumption? | [helge@e...] | Wed 8/15/2001
3465 | Re: How to reduce GDI resource consumption? | Werner Lehmann | Wed 8/15/2001


re: How to reduce GDI resource consumption?

From: Werner Lehmann [wl@b...]
Date: Tue Aug 14, 2001 9:49 pm
Subject: Re: [VirtualTreeview] How to reduce GDI resource consumption?

Hi Martin,

> Is there an easy way (maybe turning off some options...) to reduce
> GDI resource consumption? Any idea would be highly apprechiated....

Are you really sure that VT is the source of your resource problems?
Do you have many forms all with VT's on them and create them already
at application start up (autocreate)?

Werner


re: How to reduce GDI resource consumption?

From: Martin Lehmann [martin.lehmann@a...]
Date: Wed Aug 15, 2001 2:14 am
Subject: Re: [VirtualTreeview] How to reduce GDI resource consumption?

Yes, I am fairly sure. I tested the controls most commonly used in my
project (TPageControl, TComboBox, TBitButton, TVirtualStringTree) by just
putting 30 each on separated dialogs that can dynamically be created from a
main window, and monitored GDI resources while doing so. The biggest impact
was clearly when opening the dialog with the Treeviews. (And no, my app does
not autocreate any form but the main form.)

It's not really excessive (the 30 TreeViews take about 7% of the GDI
resources - btw, with 1.3.1 that number was somewhere in the 20s), but since
I use I lot of them AND they have the biggest impact AND i can talk to the
developer(s) it seems the logical choice to try to optimize here.

A lot of the TreeViews are in PageControls and they're only filled with data
"OnShow" of the page they're in. If I could somehow release some Handles
while the Treeviews are not visible anyways, that would probably help.

Thanks for your input,

Martin

----- Original Message -----
From: "Werner Lehmann" [wl@b...]
To: [VirtualTreeview@yahoogroups.com>
Sent: Tuesday, August 14, 2001 14:49
Subject: Re: [VirtualTreeview] How to reduce GDI resource consumption?

> Hi Martin,
>
> > Is there an easy way (maybe turning off some options...) to reduce
> > GDI resource consumption? Any idea would be highly apprechiated....
>
> Are you really sure that VT is the source of your resource problems?
> Do you have many forms all with VT's on them and create them already
> at application start up (autocreate)?
>
> Werner
>
> To unsubscribe from this group, send an email to:
> VirtualTreeview-unsubscribe@egroups.com
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>

Replies Author Date


Need help to install Latest VT in C++ Builder 5 Pro

From: [csphua@t...]
Date: Wed Aug 15, 2001 2:37 am
Subject: Need help to install Latest VT in C++ Builder 5 Pro

Dear All,

I'm using VT 1.x version. It compiles fine in C++ Builder 5 Pro.
However, after I'd downloaded VT ver. 2.5.15, I failed to compile and
install the design time package. The error occurs is can't find the
unit named StrEdit.dcu

I know some one had asked the same questions, and the answer is to
find where is StrEdit by including more libraries. Well, I had add in
all .lib that I can find in C++ Builder 5 Pro, still the problem
exists.

Calling for all C++ Builder 5 Pro users out there, please help me,
because I want to remain as a proud user of VirtualTree.

regards,
C.S. Phua


re: Some observations regarding the source...

From: Ralf Junker [ralfjunker@g...]
Date: Tue Aug 14, 2001 7:53 am
Subject: RE: [VirtualTreeview] Some observations regarding the source...

Hi Theodor, Hi Mike,

you are both right about about the EXE size from your respective point of view.
Anyway, I would like to jump in with an idea about how to solve the tradeoff
between size and functionality:

I would like to suggest that the virtual string tree's clipborad functionality
could be handled by clipboard objects which descend from a basic clipboard
class. The idea is very similar to the SynEdit highlighters. Even though there
many many highlighters, the initial EXE size stays quite small and increases
only with the number of highlighters used.

If a virtual string tree user wants to use clipboard operations, s/he would
have to drop the appropriate clipboard component on the from and tell the tree
to use it. The tree would then iterate all registered clipboard formats for the
required action.

Another solution could be to handle clipboard formats like Delphi handles
various image formats. Simply add the unit to your project's uses clause and
the clipboard format will automatically register itself with all the trees.

Both approaches also have the benefit to separate clipboard code from the
tree's code, so one can be modified without necessarily touching the other.
Also, people could then write their own clipboard formats if the wish to
without digging deeply into the tree's code...

I must admit that I am not very familiar with clipboard formats, but I do not
see why this approach should not work?

-- Ralf

At 22:33 13.08.2001, you wrote:
>>Upon further investigation I found the culprit to be TVirtualStringTree. When
using only a
>TVirtualDrawTree the
>> overall size impact is only 149KB, but TVirtualStringTree is still
>> partially linked in. When commenting lines 5063-5065 (which should
>> rather be handled by a virtual method IMO) and lines 25221-25227 (since
>> I don't require the extended clipboard formats support) the size impact
>> drops to 128KB.
>
>This could well be, yes. But what happens if you need it? Should I wrap
everything with loads of
>conditional symbols so everyone can pick what is needed (and recompile their
packages afterwards)?
>
>
>> Since I'm sure there are many users who would like the tree to
>> automatically paint strings but don't require the extended clipboard
>> formats, I think the current TVirtualStringTree should be split in two.
>> The extended clipboard functionality can be added in a descendant of
>> TVirtualStringTree. Anyone else agree with this?
>
>It seems there are not many people who like this idea (judged from the lack of
response). It is your
>personal preference to have that stuff out. Other people might want to get
something else out and
>other things in. It is impossible to make everyone happy. You are
unfortunately in a situation where
>you care for that little bit more size, but other people are happy not to have
to care about
>clipboard stuff and so on but simply can use it.

 | Replies | Author | Date
3500 | Re: Some observations regarding the source... | Mike Lischke | Sat 8/18/2001


re: Need help to install Latest VT in C++ Build er 5 Pro

From: Vandrovec Milan [milan_va@s...]
Date: Wed Aug 15, 2001 7:49 am
Subject: RE: [VirtualTreeview] Need help to install Latest VT in C++ Build er 5 Pro

Hi again.

I have uploaded a package for C++ Builder as "VT2.5.15 for CPPB.zip".
Replace files of zero length with original versions (done to save space at
Yahoo), add the $HPPEMIT line to VirtualTrees.pas, open CBuilder, compile
VirtualTreeView.bpk, compile and install VirtualTreeViewD.bpk. It should all
work fine.
Let me know if there are any problems that could be solved. You may have
to create some directories, but this should be easy.

> I'm using VT 1.x version. It compiles fine in C++ Builder 5 Pro.
> However, after I'd downloaded VT ver. 2.5.15, I failed to compile and
> install the design time package. The error occurs is can't find the
> unit named StrEdit.dcu
>
> Calling for all C++ Builder 5 Pro users out there, please help me

Happy to be useful at last...

Milan Vandrovec


re: How to reduce GDI resource consumption?

From: [helge@e...]
Date: Wed Aug 15, 2001 8:23 am
Subject: Re: How to reduce GDI resource consumption?

> A lot of the TreeViews are in PageControls and they're only
> filled with data "OnShow" of the page they're in. If I could
> somehow release some Handles while the Treeviews are not visible
> anyways, that would probably help.
>

You can create the TreeViews dynamically when the pages are shown the
first time ... but that'll be a bit more work...

Helge.


re: How to reduce GDI resource consumption?

From: Werner Lehmann [wl@b...]
Date: Wed Aug 15, 2001 8:44 am
Subject: Re: [VirtualTreeview] How to reduce GDI resource consumption?

Hi Martin,

> It's not really excessive (the 30 TreeViews take about 7% of the GDI
> resources - btw, with 1.3.1 that number was somewhere in the 20s), but since
> I use I lot of them AND they have the biggest impact AND i can talk to the
> developer(s) it seems the logical choice to try to optimize here.

Sure. But 30 TV ~ 7% seems to be ok. I mean it's not that excessive. At
that rate you could use another 180 TV until you need 50% for your app :)

> A lot of the TreeViews are in PageControls and they're only filled with data
> "OnShow" of the page they're in. If I could somehow release some Handles
> while the Treeviews are not visible anyways, that would probably help.

Well, back in D1 and Win3.11 there was the same problem. One could easily
get OutOfResources with a page control ("TNotebook") and putting an average
number of controls on not too many pages. It was possible to overcome this
by releasing the handles of all controls when a page was not visible anymore.
This was possible by just iterating the component array and releasing the
handles of the wincontrols. As far as I recall.

Don't have any code for this at the moment (maybe it's still on Deja), and
I don't know if this works with VTree (maybe it relies on allocated handle
when there wouldn't be one anymore at some places, these need a HandleAllocated
check then).

Are your pages similar? You could just use a VT (and some other controls) on
a frame which is created only in OnShow of a page and may be even destroyed
at OnShow of another page. Depends on how much data has to be filled into the
controls each time. Of course, if your pages are not similar you can still do
this with VT itself (not using frames, just dynamically create VT instances).

Regards,
Werner


Minor Bugreport

From: "Wim van der Vegt" [wvd_vegt@k...]
Date: Wed Aug 15, 2001 11:01 am
Subject: Minor Bugreport

Hi,

I noticed that in linemode is lmbands the left part of the band grid is
painten in the color of the treeline color and the left part in the gridline
color. I think it should both be gridline color in the case of lmbands mode.

----------------
Wim van der Vegt

[Non-text portions of this message have been removed]

 | Replies | Author | Date
3501 | Re: Minor Bugreport | Mike Lischke | Sat 8/18/2001


re: extending lmBands ???

From: "Wim van der Vegt" [wvd_vegt@k...]
Date: Wed Aug 15, 2001 11:01 am
Subject: RE: [VirtualTreeview] extending lmBands ???

Hi,

Solved the lmbands color problem i think. Try the following code (should
require some work for bdRightToLeft mode as i have no idea what i should do
there) :

--------------
Wim van der Vegt

----------<cut here

procedure TXMLTree.DoBeforeCellPaint(Canvas: TCanvas; Node: PVirtualNode;
Column: Integer; CellRect: TRect);
var
Ind : Integer;
OtherRect: TRect;
tmpNode : PVirtualNode;
i : Integer;
BackColor: TColor;
begin
if LineMode = lmBands
then
begin
if Column = Header.MainColumn
then
begin
Ind:= GetNodeLevel(Node) * Indent;

if Header.Columns[Column].BiDiMode = bdRightToLeft
then Dec(CellRect.Right, Ind-2)
else Inc(CellRect.Left , Ind );

OtherRect:=CellRect;
OtherRect.Right:=OtherRect.Left+Indent;
Inc(OtherRect.Bottom,1);

tmpNode:=Node;
for i:=1 to GetNodeLevel(Node) do
begin
Dec(OtherRect.Left, Indent);
Dec(OtherRect.Right, Indent);
DoGetBackColor(tmpNode.Parent,BackColor);
Canvas.Brush.Color:=BackColor;
Canvas.FillRect(OtherRect);
tmpNode:=tmpNode.Parent;
end;
end;

DoGetBackColor(Node,BackColor);
Canvas.Brush.Color:=BackColor;
Canvas.FillRect(CellRect);
end;

inherited;
end;

-----Original Message-----
From:
[sentto-2425673-3456-997795140-wvd_vegt=knoware.nl@r...]
[mailto:[sentto-2425673-3456-997795140-wvd_vegt=knoware.nl@r...]
m]On Behalf Of Wim van der Vegt
Sent: dinsdag 14 augustus 2001 15:20
To: [VirtualTreeview@yahoogroups.com
Subject: RE: [VirtualTreeview] extending lmBands ???

Hi,

Could you not return a (non rectanguar) region, instead of a rectangle in
the event handlers used for the background painting? You could start with
the total rectangle (multiline) and cut out the childnode's rectangles.

Or paint hierachically, if you start at the top/left level and work your
way
right/down with background paints, all other nodes should paint fine. This
will however be a major change in architecture i'm afraid.

Wim van der Vegt
-----Original Message-----
From:
[sentto-2425673-3378-997212589-wvd_vegt=knoware.nl@r...]

[mailto:sentto-2425673-3378-997212589-wvd_vegt=knoware.nl@r...]
m]On Behalf Of Mike Lischke
Sent: dinsdag 7 augustus 2001 21:29
To: VirtualTreeview@yahoogroups.com
Subject: RE: [VirtualTreeview] extending lmBands ???

Moritz,

> mike, could you tell me your opinion about it? is it possible? do you
> have some hints for me how i can do it? i think this would be of
> general use and implementing it into vt could increase vt's worth.

Well, I still have more than 40 mails pending (most require more than a
simple answer) so I do not
want to prefer this particular one. I only want to say that I though
about
such things too.
Particularly xml_3.png was in my mind because it allows "Outlook-like"
things. However I have no
idea how to implement this currently and still a lot of other things to
do
(including reducing open
bugs :-)). Additionally, I'm on vacation next weekend, so...

But on this list are meanwhile more than 520 people listening. There
should be some more than the 5
enthusiasts which always discuss here to give you an idea.

Ciao, Mike

To unsubscribe from this group, send an email to:
VirtualTreeview-unsubscribe@egroups.com

Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.

[Non-text portions of this message have been removed]

To unsubscribe from this group, send an email to:
VirtualTreeview-unsubscribe@egroups.com

Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.

[Non-text portions of this message have been removed]

 | Replies | Author | Date
3468 | Re: extending lmBands ??? | Wim van der Vegt | Wed 8/15/2001
3486 | Re: extending lmBands ??? | Moritz Franckenstein | Thu 8/16/2001


re: extending lmBands ???

From: "Wim van der Vegt" [wvd_vegt@k...]
Date: Wed Aug 15, 2001 11:45 am
Subject: RE: [VirtualTreeview] extending lmBands ???

Hi,

Even better (eliminates the gridline below expanded nodes too that i
overlooked)

-----------<cut here

procedure TXMLTree.DoBeforeCellPaint(Canvas: TCanvas; Node: PVirtualNode;
Column: Integer; CellRect: TRect);
var
Ind : Integer;
OtherRect: TRect;
tmpNode : PVirtualNode;
i : Integer;
BackColor: TColor;
begin
if LineMode = lmBands
then
begin
if Column = Header.MainColumn
then
begin
Ind:= GetNodeLevel(Node) * Indent;

if Header.Columns[Column].BiDiMode = bdRightToLeft
then Dec(CellRect.Right, Ind-2)
else Inc(CellRect.Left , Ind );

OtherRect:=CellRect;
OtherRect.Right:=OtherRect.Left+Indent;
Inc(OtherRect.Bottom,1);

if vsExpanded in Node.States
then
begin
DoGetBackColor(Node,BackColor);
Canvas.Brush.Color:=BackColor;
Canvas.FillRect(OtherRect);
end;

tmpNode:=Node;
for i:=1 to GetNodeLevel(Node) do
begin
Dec(OtherRect.Left, Indent);
Dec(OtherRect.Right, Indent);
DoGetBackColor(tmpNode.Parent,BackColor);
Canvas.Brush.Color:=BackColor;
Canvas.FillRect(OtherRect);
tmpNode:=tmpNode.Parent;
end;
end;

DoGetBackColor(Node,BackColor);
Canvas.Brush.Color:=BackColor;
Canvas.FillRect(CellRect);
end;

inherited;
end;

[Non-text portions of this message have been removed]

 | Replies | Author | Date
3486 | Re: extending lmBands ??? | Moritz Franckenstein | Thu 8/16/2001


re: OnKeyPress problem

From: "Mike Lischke" [lists@l...]
Date: Wed Aug 15, 2001 4:01 pm
Subject: RE: [VirtualTreeview] OnKeyPress problem

Hi Kent,

> I just upgraded from VT 2.5.9 to 2.5.15 and rebuilt my project. However, the
> OnKeyPress event now doesn't fire when an alphanumeric key is pressed. It
> does still fire with the spacebar, enter key, etc. I have IncrementalSearch
> set to isNone and I looked through the changes posted in the source file but
> didn't see anything there that looked relevant to my problem. Any ideas as
> to what changes between 2.5.9 and 2.5.15 would have caused this?

Haven't you already asked this question recently? I'm sure I wrote you that I
have fixed that
meanwhile. It was the problem with the inherited call of WM_CHAR which was too
limited.

Ciao, Mike


re: Bug fix report

From: "Mike Lischke" [lists@l...]
Date: Wed Aug 15, 2001 4:01 pm
Subject: RE: [VirtualTreeview] Bug fix report

Hi Vadim,

> So, there was a bug with assertion in AllocateInternalDataArea... Sorry. I
> think that you switch to allocation of the root node in AfterConstruction
> only.

I have to do both. If there is no internal allocation then I have to make sure
FRoot is initialized
anyway. *If* there is an allocation of internal data then I have to reallocate
FRoot to avoid extra
checks because every other node has this internal data. It does not harm
anything and is only called
very few times.

> > Btw: using ReallocMem instead the current solution requires to clear the
> root node record explicitly.
> > So it makes no sense.
> It makes real sense, because internal data that can be already set will be
> preserved.

The point is that I need to clear the record after allocation. ReallocMem does
not clear it so I
would have to do it explicitly (keep in mind that the initial allocation would
be done by ReallocMem
too). Btw: what data would you like to preserve in FRoot?

> Without ReallocMem we can say that internal data inaccessible during
> construction. In this case call to InitRootNode from
> AllocateInternalDataArea makes no sense at all...

It is not easy but I think I understood now. You are pointing to the fact the
InitRoot is called
from AllocateInternalDataArea before it is called from AfterConstruction (for
string trees). So the
second call is useless in this case (although I do not understand what this has
to do with
ReallocMem). Fact is that the second call only needs to be made if FRoot is
still nil after
construction (otherwise it has been allocated by descentant tree when using
AllocateInternalDataArea). I have put it a check to avoid the second call.

Ciao, Mike


re: New Folders needed

From: "Mike Lischke" [lists@l...]
Date: Wed Aug 15, 2001 4:01 pm
Subject: RE: [VirtualTreeview] New Folders needed

Hi Adem,

> I know this is not that important,
> but Files section has become way too
> cluttered.

Good idea. Would you like to reorder the file area a bit (and perhaps look for
it once in a while)?

Ciao, Mike


re: working on selected nodes

From: "Mike Lischke" [lists@l...]
Date: Wed Aug 15, 2001 4:01 pm
Subject: RE: [VirtualTreeview] working on selected nodes

> Aha. I regret this somewhat. Getting the nodes from the array should be
faster.
> Magnitudes. I know you will say 1e6 nodes - 350ms :) Did not check that
figure. Still it appears
like resource
> wasting to browse 1..n nodes only to learn that node n is selected. The
search could at least stop
if
> SelectedCount nodes are found. In GetSortedSelection.

It isn't that sad. Before a binary search in the array was needed to find the
given node and return
the following one. Now only determining the first selected node might be a bit
time consuming. But
since selected nodes are usually close together the following calls will not
eat so much time. On
the other hand I had serious trouble that nodes where not returned in logical
order. They appeared
totally random at times (depending on the order they were created). This was
very annoying.

Additionally, perhaps the selection array can be ommitted one day.

Ciao, Mike


re: Tree options in descendants

From: "Mike Lischke" [lists@l...]
Date: Wed Aug 15, 2001 4:01 pm
Subject: RE: [VirtualTreeview] Tree options in descendants

Hi Werner,

> I believe when you made a custom version of the tree options class you had
> in mind that descendants can inherit their options from this custom version
> and override the TreeOptions property. This approach is not bad and probably
> the best I can think of (provided that options should be toggleable in the
> OI but also be fast in access). Unfortunately it does not work unless I am
> missing something (quite possible of course).

No, you are not missing something. Indeed I had forgotten two small things
which are needed to make
customizing tree options possible. To prove the concept I have done something I
should have done
already in the first place: the string options are no longer part of the base
options but placed in
an own options class which is derived from the base tree options (and only used
in the string tree).
The two missing points were:

- a virtual method which tells the base tree what option class to create, which
can be overriden by
descentants
- individual setter and getter classes for property TreeOptions to return the
correct class
(important also for the OI)

Thank you for digging into this stuff, Werner. Please test the new
implementation when it is
available.

Ciao, Mike


re: (Mike, please read) OLE Drag and drop: optimized move and more

From: "Mike Lischke" [lists@l...]
Date: Wed Aug 15, 2001 4:01 pm
Subject: RE: [VirtualTreeview] (Mike, please read) OLE Drag and drop: optimized move and more

Hi Jim,

> Mike and Werner, I currently am working on a slick (IMHO) wrapper for
> IDataObject and OLE Drag/Drop It includes implementation of SetData for
> the IDragSourceHelper image in Win2k. Give me a week or so more to clean
> up the details.

This sounds very interesting. Perhaps we can work out a kind of plug in scheme
for this interface.
Would be cool, but I prefer not to have too much work with it. You know, I'm
always too busy :-)
(although I've got a free day today I haven't had yet the opportunity to
continue documenting the
tree. I'm answering eMails since noon and now it is 6, the time before noon was
spent installing
Kylix).

Ciao, Mike


re: Bug with mouse wheel

From: "Mike Lischke" [lists@l...]
Date: Wed Aug 15, 2001 4:01 pm
Subject: RE: [VirtualTreeview] Bug with mouse wheel

Hi Danil,

> I have found a bug in handling mouse wheel by flat scrollbars. If the
> window with VT is not enabled (about box is displayed, for
> example), i still can scroll the VT using mouse wheel, and this
> makes the modal window to lost it focus. I have not tested it with
> normal scrollbars, maybe this bug will be in normal scrollbars too.

Unfortunately, I cannot reproduce this problem with either scrollbar style. Can
you please send me a
demo showing this effect?

> And a suggestion to ToDo list: - Mike, is it possible to make a
> publised property Flat Scrollbars, in which i can change the colors
> for flat scfrollbar? Or include this in the colors property? AFAIK, flat
> scrollbar colors can be easily customized.

I'll add it on your behalf.

Ciao, Mike


re: Re: Right way to use VT

From: "Mike Lischke" [lists@l...]
Date: Wed Aug 15, 2001 4:01 pm
Subject: RE: [VirtualTreeview] Re: Right way to use VT

Hi Jim,

> A big congratulations is in order, it could not have gone to a more
> deserving person.

Thank you, thank you :o] Note that the JEDI project as a whole got this award,
although about 20
most active people got individual certificates directly from Borland.

> So three happily wedded years for you. How many for your wife?
> <vbg>

She refused to answer ...;-)

Ciao, Mike


re: OnKeyPress problem

From: Kent Briggs [kbriggs@b...]
Date: Wed Aug 15, 2001 4:21 pm
Subject: Re: [VirtualTreeview] OnKeyPress problem

Mike Lischke wrote:

> Hi Kent,
>
> > I just upgraded from VT 2.5.9 to 2.5.15 and rebuilt my project. However,
the
> > OnKeyPress event now doesn't fire when an alphanumeric key is pressed. It
> > does still fire with the spacebar, enter key, etc. I have IncrementalSearch
> > set to isNone and I looked through the changes posted in the source file but
> > didn't see anything there that looked relevant to my problem. Any ideas as
> > to what changes between 2.5.9 and 2.5.15 would have caused this?
>
> Haven't you already asked this question recently?

No, but apparently someone else did before me. I just didn't see it at the
time.

--
Kent Briggs, [kbriggs@b...]
Briggs Softworks, http://www.briggsoft.com


Installation of VT on BCB 3.0...

From: [hammadmajeed@h...]
Date: Wed Aug 15, 2001 6:31 pm
Subject: Installation of VT on BCB 3.0...

Hi All BCB Gurus,

Can anyone tell me is there any way by which i can install this VT on
BCB 3.0, as this component is for BCB4.0(above).

Pls Help Me, I will be highly obliged,
Thanx in advance.

Hammad.


A little suggestion for OnGetText...

From: [martin.lehmann@a...]
Date: Wed Aug 15, 2001 8:26 pm
Subject: A little suggestion for OnGetText...

Hi there,

I noticed that in some cases (re-expanding a node when
AutoScrollOnExpand is ON and GridExtensions are OFF, hitting <CTRL-
END> / <CTRL-HOME>) the OnGetText handler is called with its
parameter <Column> being -1 ("NoColumn"). Unless this is needed
somewhere else, it might be a good idea to prevent that.

Martin

 | Replies | Author | Date
3525 | Re: A little suggestion for OnGetText... | Mike Lischke | Sun 8/19/2001


An idea for the documentation...

From: [martin.lehmann@a...]
Date: Wed Aug 15, 2001 8:33 pm
Subject: An idea for the documentation...

Hi there,

I think it might be a good idea to remind programmers (especially
novices like me ;-)) that STRINGs are dynamically allocated.
Therefore, if you use a STRING in your NodeData, you need to free the
allocated memory manually in the OnFreeNode event (using SetLength).
Otherwise you got yourself a nice memory leak (I think I have seen
this mistake in one of the (1.3.1) examples, too).

Cheers

Martin

 | Replies | Author | Date
3484 | Re: An idea for the documentation... | Jim Kueneman | Wed 8/15/2001
3487 | Re: An idea for the documentation... | [martin.lehmann@a...] | Thu 8/16/2001
3527 | Re: An idea for the documentation... | Mike Lischke | Sun 8/19/2001


Selection problems

From: Kent Briggs [kbriggs@b...]
Date: Wed Aug 15, 2001 10:14 pm
Subject: Selection problems

I've come across a couple of node selection problems that I can reproduce
with a simple app as follows:

1. Drop a VirtualStringTree component on a new form and align it to client.
2. Set rootnodecount to 10 and multiselect to true.
3. Create this OnShow event:

procedure TForm1.FormShow(Sender: TObject);
var
node: pvirtualnode;
begin
with virtualstringtree1 do
begin
node:=getfirst;
node:=getnext(node);
focusednode:=node;
selected[node]:=true;
end;
end;

When you run the application, you should see the second node selected and
focused. Now hold the Shift key down and click on a lower node. You would
expect the selection block to start from the second node but instead it
starts from the first node.

Now here's another anomoly: Click a middle node so that it is the only one
selected. Hold the Shift key down and hit the down arrow key a couple of
times. The selection block grows as expected but keeping the Shift key down,
hit the up arrow key a couple of times. The selection block does not shrink
back to one node as expected.

--
Kent Briggs, [kbriggs@b...]
Briggs Softworks, http://www.briggsoft.com

 | Replies | Author | Date
3483 | Re: Selection problems | Werner Lehmann | Wed 8/15/2001
3488 | Re: Selection problems | Werner Lehmann | Fri 8/17/2001
3521 | Re: Selection problems | Mike Lischke | Sun 8/19/2001


re: Selection problems

From: Werner Lehmann [wl@b...]
Date: Wed Aug 15, 2001 11:01 pm
Subject: Re: [VirtualTreeview] Selection problems

Hi Kent,

> I've come across a couple of node selection problems that I can reproduce
> with a simple app as follows:

...

> When you run the application, you should see the second node selected and
> focused. Now hold the Shift key down and click on a lower node. You would
> expect the selection block to start from the second node but instead it
> starts from the first node.

very good, I have seen this phenomenon once but could not reproduce it. Thought
it has been fixed... now we have simple test app.

> Now here's another anomoly: Click a middle node so that it is the only one
> selected. Hold the Shift key down and hit the down arrow key a couple of
> times. The selection block grows as expected but keeping the Shift key down,
> hit the up arrow key a couple of times. The selection block does not shrink
> back to one node as expected.

Also correct. It appears that the selection anchor (which was selected first)
and the immediate previous and next siblings keep their selection once they
have been selected no matter what.

Regards,
Werner


re: An idea for the documentation...

From: "Jim Kueneman" [jimdk@m...]
Date: Wed Aug 15, 2001 11:26 pm
Subject: Re: An idea for the documentation...

--- In [VirtualTreeview@y...], [martin.lehmann@a...] wrote:
> Hi there,
>
> I think it might be a good idea to remind programmers (especially
> novices like me ;-)) that STRINGs are dynamically allocated.
> Therefore, if you use a STRING in your NodeData, you need to free
the
> allocated memory manually in the OnFreeNode event (using
SetLength).

Martin,

A better way to do this is to call Initialize and Finalize on your
allocated node structure. This will handle any strings or dynamic
arrays you may add in the future and you forget to do the above. The
reason this is true is because VT uses AllocMem (which uses GetMem)
and that method of memory allocation does not reconize the dynamic
strings and arrays using New and Dispose does.

Jim

 | Replies | Author | Date
3487 | Re: An idea for the documentation... | [martin.lehmann@a...] | Thu 8/16/2001


re: Bug fix report

From: "Vadim Sedulin" [wsntrl@o...]
Date: Thu Aug 16, 2001 1:41 am
Subject: Re: [VirtualTreeview] Bug fix report

Hello Mike!

> > > Btw: using ReallocMem instead the current solution requires to clear
the
> > root node record explicitly.
> > > So it makes no sense.
> > It makes real sense, because internal data that can be already set will
be
> > preserved.
>
> The point is that I need to clear the record after allocation. ReallocMem
does not clear it so I
> would have to do it explicitly (keep in mind that the initial allocation
would be done by ReallocMem
> too).

And what? You need to clear NewSize - OldSize bytes only. I think ReallocMem
+ FillChar will be much faster than call to InitRootNode.

> Btw: what data would you like to preserve in FRoot?

I think all data must be preserved (TVirtualNode + all its internal data
that was aleready allocated).
For example:

TMyTree1 = class(TVirtualStringTree)
...
constructor Create(AOwner: TComponent); override;
...
end;

TMyTree2 = class(TMyTree1)
...
constructor Create (AOwner: TComponent); override;
...
end;

constructor TMyTree1.Create (AOwner: TComponent);
begin
inherited;
FDataOffset := AllocateInternalDataArea(SizeOf(Pointer));
PPointer(Cardinal(FRoot) + FDataOffset)^ := TList.Create;
end;

constructor TMyTree2.Create (AOwner: TComponent);
begin
inherited;
FAdditionalDataOffset := AllocateInternalDataArea(SizeOf(Integer));
.......
end;

> It is not easy but I think I understood now. You are pointing to the fact
the InitRoot is called
> from AllocateInternalDataArea before it is called from AfterConstruction
(for string trees). So the
> second call is useless in this case (although I do not understand what
this has to do with
> ReallocMem). Fact is that the second call only needs to be made if FRoot
is still nil after
> construction (otherwise it has been allocated by descentant tree when
using
> AllocateInternalDataArea). I have put it a check to avoid the second call.

No. Let's try again...
I expect that internal data for the root node can be set right after
allocation (AllocateInternalDataArea).
In current implementation it's impossible, because descendant can override
constructor and allocate its own internal data and my data will be lost (set
to 0 by next InitRootNode).
In such case I don't see any reason for InitRootNode in
AllocateInternalDataArea, because caller must NOT access allocated data
before AfterConstruction because it can be lost. (ufff)

Bye.

Vadim Sedulin
E-Mail: [wsntrl@o...]

 | Replies | Author | Date
3528 | Re: Bug fix report | Mike Lischke | Sun 8/19/2001
3529 | Re: Bug fix report | Jim Kueneman | Sun 8/19/2001
3582 | Re: Bug fix report | Mike Lischke | Fri 8/24/2001


re: extending lmBands ???

From: "Moritz Franckenstein" [franckenstein@a...]
Date: Thu Aug 16, 2001 12:30 pm
Subject: Re: extending lmBands ???

--- In [VirtualTreeview@y...], "Wim van der Vegt" [wvd_vegt@k...] wrote:
> Hi,
>
> Even better (eliminates the gridline below expanded nodes too that i
> overlooked)
>
> -----------<cut here

thank you, i have changed your implementation a little bit and
included it into my xmltree component:

http://groups.yahoo.com/group/VirtualTreeview_de/files

-moritz


re: An idea for the documentation...

From: [martin.lehmann@a...]
Date: Thu Aug 16, 2001 5:17 pm
Subject: Re: An idea for the documentation...

--- In [VirtualTreeview@y...], "Jim Kueneman" [jimdk@m...] wrote:
> --- In [VirtualTreeview@y...], [martin.lehmann@a...] wrote:
> > Hi there,
> >
> > I think it might be a good idea to remind programmers (especially
> > novices like me ;-)) that STRINGs are dynamically allocated.
> > Therefore, if you use a STRING in your NodeData, you need to free
> the
> > allocated memory manually in the OnFreeNode event (using
> SetLength).
>
>
> Martin,
>
> A better way to do this is to call Initialize and Finalize on
your
> allocated node structure. This will handle any strings or dynamic
> arrays you may add in the future and you forget to do the above.
The
> reason this is true is because VT uses AllocMem (which uses GetMem)
> and that method of memory allocation does not reconize the dynamic
> strings and arrays using New and Dispose does.
>
> Jim

Thanks for the input!

Martin


re: Selection problems

From: Werner Lehmann [wl@b...]
Date: Fri Aug 17, 2001 9:21 am
Subject: Re: [VirtualTreeview] Selection problems

Hi Kent,

> When you run the application, you should see the second node selected and
> focused. Now hold the Shift key down and click on a lower node. You would
> expect the selection block to start from the second node but instead it
> starts from the first node.

Here's a fix:

In procedure TBaseVirtualTree.WMKeyDown(var Message: TWMKeyDown):

begin
// Make form key preview work and let application modify the key if it wants
this.
inherited;

with Message do
begin
...
// Keep old focused node for range selection.
LastFocused := FFocusedNode;
// Set an initial range anchor if there is not yet one.
if FRangeAnchor = nil then
begin ||
FRangeAnchor := FFocusedNode; ||
if FRangeAnchor = nil then ||
FRangeAnchor := FRoot.FirstChild; ||
end; ||
...
end;

> Now here's another anomoly: Click a middle node so that it is the only one
> selected. Hold the Shift key down and hit the down arrow key a couple of
> times. The selection block grows as expected but keeping the Shift key down,
> hit the up arrow key a couple of times. The selection block does not shrink
> back to one node as expected.

Here's a fix, same procedure:

with Message do
begin
...
// Determine new focused node.
case CharCode of
...
VK_UP:
begin
...
if HandleMultiSelect and (CompareNodePositions(LastFocused
{Node}, FRangeAnchor) > 0) then
RemoveFromSelection(FFocusedNode);
...
end;
VK_DOWN:
begin
...
if HandleMultiSelect and (CompareNodePositions(LastFocused
{Node}, FRangeAnchor) < 0) then
RemoveFromSelection(FFocusedNode);
...
end;

This is only a partial fix, unfortunately, because there is another problem
which has
been there before (only now discovered). In explorer, if you ctrl-click-select
some
nodes which are not immediate siblings (thus leaving gaps between), and then
use shift-
up/down the selection is cleared and only set to the last clicked node (which
is the
focused one) and then expanded with respect to if up or down was pressed.

In VT the selection is not cleared and we get some weird behaviour, selection
states
are toggled, sometimes only cleared. The required fix may need more than a
'quickfix'...

Regards,
Werner

 | Replies | Author | Date
3521 | Re: Selection problems | Mike Lischke | Sun 8/19/2001


BCB5, Using VT in Forms in Packages

From: [Andree.Hayen@t...]
Date: Fri Aug 17, 2001 1:21 pm
Subject: BCB5, Using VT in Forms in Packages

Installation in BCB5 well done, no problems so far on using VT on a
form.
But using VT on a form in a package results at runtime in exception
while creating.
(My Delphi 6 Enterprise test installation complains missing dclusr
while compiling. So I can't see if this a problem in Delphi too.)

I scanned the group, but found nothing special about installing in
BCB. Any idea? Have I overseen something?

Regards
Andree

 | Replies | Author | Date
3494 | Re: BCB5, Using VT in Forms in Packages | Werner Lehmann | Fri 8/17/2001


How to use the Editors

From: [helge@e...]
Date: Fri Aug 17, 2001 8:48 pm
Subject: How to use the Editors

Could anybody explain me how the editors in TVirtualStringTree work?

I looked in the advanced-demo but that's a bit complicated for a
VirtualStringTree-beginner like me. I need the ability to edit the
node with TEdit and TComboBox (e.g. Column 1 needs TEdit, Column 2+3
need TComboBox and Column 4 needs again TEdit).

Maybe someone has a simple demo or something. If it's commented it
would be better and if it's in German (I know there's a German
newsgroup also but it doesn't seem as active as this English one) it
would be the best ;-))

Maybe there are somewhere some tutorials on the net?

Helge.
([helge@e...])

 | Replies | Author | Date
3493 | Re: How to use the Editors | Werner Lehmann | Fri 8/17/2001
3496 | Re: How to use the Editors | [helge@e...] | Sat 8/18/2001
3504 | Re: How to use the Editors | Jim Kueneman | Sat 8/18/2001
3505 | Re: How to use the Editors | Mike Lischke | Sat 8/18/2001
3506 | Re: How to use the Editors | [helge@e...] | Sat 8/18/2001
3510 | Re: How to use the Editors | [helge@e...] | Sun 8/19/2001
3532 | Re: How to use the Editors | Mike Lischke | Sun 8/19/2001
3536 | Re: How to use the Editors | Werner Lehmann | Sun 8/19/2001


Coloring rows

From: [helge@e...]
Date: Fri Aug 17, 2001 8:54 pm
Subject: Coloring rows

Maybe I'm only missing a property but I'm trying to set the
background of the row depending on if the node is a root node or not.
I tried several events (OnBeforeItemPaint, OnBeforeCellPaint,
OnPaintBackground, OnPaintText) but none of these seems to work with
this code:

if not PBelegPosition(Sender.GetNodeData(Node))^.Alternativposition
then
Canvas.Brush.Color := $02f0f0f0
else
Canvas.Brush.Color := clWhite;

The code is compiled and run without any error. I also tried to
change the color values to clLime and clRed in order to prevent not-
seeing a correct result - no matter.

Any help for me stupid VirtualStringTree-beginner???

Helge.

 | Replies | Author | Date
3492 | Re: Coloring rows | Werner Lehmann | Fri 8/17/2001
3495 | Re: Coloring rows | Moritz Franckenstein | Sat 8/18/2001
3531 | Re: Coloring rows | Mike Lischke | Sun 8/19/2001
3549 | Re: Coloring rows | Moritz Franckenstein | Mon 8/20/2001
3550 | Re: Coloring rows | Moritz Franckenstein | Mon 8/20/2001


re: Coloring rows

From: Werner Lehmann [wl@b...]
Date: Fri Aug 17, 2001 10:24 pm
Subject: Re: [VirtualTreeview] Coloring rows

Hi Helge,

try this:

procedure TForm1.VirtualStringTree1BeforeItemErase(
Sender: TBaseVirtualTree; Canvas: TCanvas; Node: PVirtualNode;
ItemRect: TRect; var Color: TColor; var EraseAction: TItemEraseAction);
begin
if Node.Parent = Sender.RootNode then
begin
Color := $02f0f0f0;
EraseAction := eaColor;
end;
end;

Regards,
Werner

 | Replies | Author | Date
3495 | Re: Coloring rows | Moritz Franckenstein | Sat 8/18/2001
3531 | Re: Coloring rows | Mike Lischke | Sun 8/19/2001
3549 | Re: Coloring rows | Moritz Franckenstein | Mon 8/20/2001
3550 | Re: Coloring rows | Moritz Franckenstein | Mon 8/20/2001


re: How to use the Editors

From: Werner Lehmann [wl@b...]
Date: Fri Aug 17, 2001 10:58 pm
Subject: Re: [VirtualTreeview] How to use the Editors

Hi Helge,

> Could anybody explain me how the editors in TVirtualStringTree work?

You implement the interface IVTEditLink and return an instance of an
implementing class in OnCreateEditor.

The interface may look a little bit intimidating at first but once you
really implement the functions one by one you'll see that it's not as
hard as it looked like.

> I looked in the advanced-demo but that's a bit complicated for a
> VirtualStringTree-beginner like me. I need the ability to edit the
> node with TEdit and TComboBox (e.g. Column 1 needs TEdit, Column 2+3
> need TComboBox and Column 4 needs again TEdit).

A TEdit node editor is included in the string tree. The combobox is
up to you. You might almost get away with replacing TEdit by TCombobox
in your version of TStringEditLink. AFAIR Roland has made some samples,
available from YG.

Werner

 | Replies | Author | Date
3496 | Re: How to use the Editors | [helge@e...] | Sat 8/18/2001
3504 | Re: How to use the Editors | Jim Kueneman | Sat 8/18/2001
3505 | Re: How to use the Editors | Mike Lischke | Sat 8/18/2001
3506 | Re: How to use the Editors | [helge@e...] | Sat 8/18/2001
3510 | Re: How to use the Editors | [helge@e...] | Sun 8/19/2001
3532 | Re: How to use the Editors | Mike Lischke | Sun 8/19/2001


re: BCB5, Using VT in Forms in Packages

From: Werner Lehmann [wl@b...]
Date: Fri Aug 17, 2001 11:00 pm
Subject: Re: [VirtualTreeview] BCB5, Using VT in Forms in Packages

[Andree.Hayen@t...] wrote:
>
> (My Delphi 6 Enterprise test installation complains missing dclusr
> while compiling. So I can't see if this a problem in Delphi too.)

Dclusr should not be required for VTree. Check if it's not in the
'requires' part of any package you use. And check that the package
is not an active design time package in 'Component | Install Packages'.

Regards,
Werner


re: Coloring rows

From: "Moritz Franckenstein" [franckenstein@a...]
Date: Sat Aug 18, 2001 9:39 am
Subject: Re: Coloring rows

--- In [VirtualTreeview@y...], Werner Lehmann [wl@b...] wrote:

> try this:
>
> procedure TForm1.VirtualStringTree1BeforeItemErase(
> Sender: TBaseVirtualTree; Canvas: TCanvas; Node: PVirtualNode;
> ItemRect: TRect; var Color: TColor; var EraseAction:
TItemEraseAction);
> begin
> if Node.Parent = Sender.RootNode then
> begin
> Color := $02f0f0f0;
> EraseAction := eaColor;
> end;
> end;

hi, with exactly this implementation i have had the problem that
after some days it suddenly stopped to work. the cells were no longer
colored. this happend two times until now, one time several weeks ago
and one time some days ago. i have tried a lot of things, stepped
through everything for some hours but did not find the problem. i
have then (both times) made a screenshot of all settings in the
object inspector, deleted the treeview from my form, put a new on it
and set all properties again. the problem was gone without changes in
the source. now everything is colored again. i dont know how to
reproduce it. did anyone notice similar things?

-moritz

 | Replies | Author | Date
3531 | Re: Coloring rows | Mike Lischke | Sun 8/19/2001
3549 | Re: Coloring rows | Moritz Franckenstein | Mon 8/20/2001
3550 | Re: Coloring rows | Moritz Franckenstein | Mon 8/20/2001


re: How to use the Editors

From: [helge@e...]
Date: Sat Aug 18, 2001 11:38 am
Subject: Re: How to use the Editors

> A TEdit node editor is included in the string tree.

And how I can activate it? Sorry - I'm really a bit confused about
this editor-things...

VirtualTreeView seems to be quite difficult and complex ... good -
sorry- very good work, Mike!

> AFAIR Roland has made some samples, available from YG.

Yes, I saw them. First they seem to be for BCB and there's something
with the zip-file ... WinRAR and WinACE told me that it was damaged
or incomplete... will try to download again...

Helge.

 | Replies | Author | Date
3504 | Re: How to use the Editors | Jim Kueneman | Sat 8/18/2001
3505 | Re: How to use the Editors | Mike Lischke | Sat 8/18/2001
3506 | Re: How to use the Editors | [helge@e...] | Sat 8/18/2001
3510 | Re: How to use the Editors | [helge@e...] | Sun 8/19/2001
3532 | Re: How to use the Editors | Mike Lischke | Sun 8/19/2001


Stupid newbie alert..

From: "John" [john_sco@h...]
Date: Sat Aug 18, 2001 4:03 pm
Subject: Stupid newbie alert..

Im completly new to all this and im having some probs implementing VT
in my program. I have a dynamic array of my own record type, that i
wish to display in VT, but im having probs trying to follow the
samples. Could someone explain how i would go about this? do i have
to scrap the array of records?? i've noticed in most of these
samples you use multi-dimensional arrays.. is this just a
coincidence??

any help would be greatly appreciated, and sorry for being so
stupid. :-)

John

 | Replies | Author | Date
3502 | Re: Stupid newbie alert.. | Jim Kueneman | Sat 8/18/2001
3503 | Re: Stupid newbie alert.. | Jim Kueneman | Sat 8/18/2001


re: Possible bug?

From: "Mike Lischke" [lists@l...]
Date: Sat Aug 18, 2001 4:09 pm
Subject: RE: [VirtualTreeview] Possible bug?

Hi Dragan,

> When during expansion I create n nodes,
> if I do not use BeginUpdate/EndUpdate, and later if I press down
> arrow to move the seleciton, after n nodes (counted from after the
> last added one, that is, from the next first-level node), the tree
> starts (in OnGetText) working with a node that is n nodes up from the
> selected one, instead with the selected one.

The problem is that you use the AddChild method which does some extra work if
you did not call
BeginUpdate. Is your tree sorted?

I recommend to use BeginUpdateEndUpdate or entirely skip using AddChild and
instead use the event
OnInitChildren which is called in ToggleNode too.

Ciao, Mike


re: Redraw problem in large trees during keyboard scrolling

From: "Mike Lischke" [lists@l...]
Date: Sat Aug 18, 2001 4:09 pm
Subject: RE: [VirtualTreeview] Redraw problem in large trees during keyboard scrolling

Hi Werner,

> PS: I have found something significant. If I set the rootnodecount in
FormCreate (only) the
> phenomenon does not occur. Regardless if 50000 or 1000000. But if the count
is set in OI (as
> described) the effect happens. With 1.000.000 nodes right from the OI the
tree is very slow
> at the last nodes. Changing focus takes about 5s then.

Aaaaargh, this brought me to the problem. I'm the incompetent idot who caused
this. I tried to be
clever and do no validation if the tree is still loading (from DFM) but forgot
that I need the
validation if there was a root node count set at design time. This is fixed now.

> I suspect that this might be a memory manager problem. I have noticed (on
other occasions)
> that if large portions of memory are freed reallocation right after that is
sloooow. So if
> the 50000 rootnodes are create twice during startup if set up in the OI it
might be this
> problem. Don't know if they are really created twice, just a guess.

If I can nothing else praise but the memory manager is good. I don't say it
could not go faster
(Vadim sent me his own version and only because of some limitations in the
implementation I could
not use it), but providing an application with 1e6 pieces of 60 bytes each,
allocated individually
instead of a large block, within under one second, this is in my eyes an
excellent result and I lift
my hat to the implementor. There might be some worst cases but generally the MM
does a very good job
and I could not brag about how fast VT is without this manager.

Ciao, Mike


re: Some observations regarding the source...

From: "Mike Lischke" [lists@l...]
Date: Sat Aug 18, 2001 4:09 pm
Subject: RE: [VirtualTreeview] Some observations regarding the source...

Hi Ralf,

> I would like to suggest that the virtual string tree's clipborad
functionality could be
> handled by clipboard objects which descend from a basic clipboard class. The
idea is very
> similar to the SynEdit highlighters. Even though there many many
highlighters, the
> initial EXE size stays quite small and increases only with the number of
highlighters used.

Although I doubt that you can make the clipboard code responsible for the
larger tree memory size I
think using an external class is a good idea. I have already thought about this
a while ago (when I
started implementing the OLE drag'n drop and clipboard handling). However,
drag'n drop and clipboard
handling are very closely related and use a lot of structures together. Anyway,
I think the idea is
worth to be kept. Enter it into the wish list at YG if you like.

Ciao, Mike


re: Minor Bugreport

From: "Mike Lischke" [lists@l...]
Date: Sat Aug 18, 2001 4:09 pm
Subject: RE: [VirtualTreeview] Minor Bugreport

Hi Wim,

> I noticed that in linemode is lmbands the left part of the band grid is
> painten in the color of the treeline color and the left part in the gridline
> color. I think it should both be gridline color in the case of lmbands mode.

Well, you can always adjust the colors so they fit. I thought that there is no
reason to force a
particular color if you can adjust it.

Ciao, Mike


re: Stupid newbie alert..

From: Jim Kueneman [jimdk@m...]
Date: Sat Aug 18, 2001 5:34 pm
Subject: Re: [VirtualTreeview] Stupid newbie alert..

At 04:03 PM 8/18/2001 +0000, you wrote:
>Im completly new to all this and im having some probs implementing VT
>in my program. I have a dynamic array of my own record type, that i
>wish to display in VT, but im having probs trying to follow the
>samples. Could someone explain how i would go about this? do i have
>to scrap the array of records?? i've noticed in most of these
>samples you use multi-dimensional arrays.. is this just a
>coincidence??
>
>any help would be greatly appreciated, and sorry for being so
>stupid. :-)

John,

Nothing to be sorry about VT takes a bit to get use to. It does not fit
very well with the "normal" way you have gotten use to with Delphi.

You really have to bend VT to work if you are using a sequencial data
array, ie like a Virtual Listview where the items are retrieved by index so
an array works well. VT nodes are linked lists so the best way to think
about VT is to think like you deal with OOP and classes... What does a node
(class) have to know to be able to handle itself and its children
(decendants)? The key events in VT are OnInitNode and OnInitChildren. Up
unitl OnInitNode all that VT knows is that there is a node, nothing
else. At this point you can allocate some memory or use the built in
memory allocation for a node and store the relavent data needed for the
node. The internal data is retrieved through GetNodeData and is allocated
through the NodeDataSize property (unless you are creating a decendant of
VT then look at the stringtree to see how to reserve node data). During
the OnInitNode call the "properties" of the node are set through the
InitialState parameter such as does this node have children? Do you want it
expanded? Is it enabled? Is it selected?
Now the user clicks the + sign on a node that is expandable. VT now calls
OnInitChildren. The "pure" VT way would be only to return the number of
children the node has. From there VT will call OnInitNode for each
child. It is also possible to use AddChild in the OnInitChildren event to
add the children and setup their data structures there then return how may
were added.

This all only deals with the structure of the tree. Now you have to use
other events to deal with the drawing of VT such as OnGetText,
OnGetImageIndex, etc. Here this info should be stored in the data
structure retrieved by GetNodeData.

I hope this clears up some of your confusion.
Jim

 | Replies | Author | Date
3503 | Re: Stupid newbie alert.. | Jim Kueneman | Sat 8/18/2001


re: Stupid newbie alert..

From: Jim Kueneman [jimdk@m...]
Date: Sat Aug 18, 2001 5:39 pm
Subject: Re: [VirtualTreeview] Stupid newbie alert..

At 10:34 AM 8/18/2001 -0700, you wrote:

>This all only deals with the structure of the tree. Now you have to use
>other events to deal with the drawing of VT such as OnGetText,
>OnGetImageIndex, etc. Here this info should be stored in the data
>structure retrieved by GetNodeData.
>
>I hope this clears up some of your confusion.
>Jim

Sorry forgot on more point. If you have to use the array the best way I
can think to do it is to allocate some node data then use some sort of a
lookup index to look up the data in the array, just don't try to use the
"index" of a node to map to the array, Mike added some methods to do it
this, like AbsoluteIndex, but it is far from using VT the "right" way.

Jim


re: How to use the Editors

From: "Jim Kueneman" [jimdk@m...]
Date: Sat Aug 18, 2001 7:21 pm
Subject: Re: How to use the Editors

Helge,

I uploaded *very* simple example that creates a combobox for an
editor.

http://groups.yahoo.com/group/VirtualTreeview/files/Examples/DelphiExa
mples/IVTEditLink/

I also cleaned up the file area. Better?

Jim

 | Replies | Author | Date
3505 | Re: How to use the Editors | Mike Lischke | Sat 8/18/2001
3506 | Re: How to use the Editors | [helge@e...] | Sat 8/18/2001
3510 | Re: How to use the Editors | [helge@e...] | Sun 8/19/2001


re: Re: How to use the Editors

From: "Mike Lischke" [lists@l...]
Date: Sat Aug 18, 2001 9:46 pm
Subject: RE: [VirtualTreeview] Re: How to use the Editors

> I also cleaned up the file area. Better?

Oh yes, much better. I wanted to make this already but got caught by some
redecoration today. Thank
you Jim.

Ciao, Mike


re: How to use the Editors

From: [helge@e...]
Date: Sat Aug 18, 2001 10:19 pm
Subject: Re: How to use the Editors

> I uploaded *very* simple example that creates a combobox for an
> editor.
>

Many many many many many thanks!!!

I just went trough it and it really doesn't seem too difficult...

But tonight (it's half past midnight) I won't do anything any more.
I'll inform you tomorrow how great it worked for me.

Again: thank you.

Helge.

 | Replies | Author | Date
3510 | Re: How to use the Editors | [helge@e...] | Sun 8/19/2001


re: Redraw problem in large trees during keyboard scrolling

From: Werner Lehmann [wl@b...]
Date: Sat Aug 18, 2001 10:20 pm
Subject: Re: [VirtualTreeview] Redraw problem in large trees during keyboard scrolling

Hi Mike,

> Aaaaargh, this brought me to the problem. I'm the incompetent idot who caused
this. I tried to be
> clever and do no validation if the tree is still loading (from DFM) but
forgot that I need the
> validation if there was a root node count set at design time. This is fixed
now.

You are kidding and not incompetent, I hope :) Please keep on being clever... I
cannot say that
I understand why missing validation caused these delays (although the
connection OI <-> DFM is
clear) but as long as it works... Anyway, noone with a sane brain will set the
rootnodecount to >
5000 at design time (after all that's the reason why only I discovered the
problem so late (and
I know what this implies :)).

> If I can nothing else praise but the memory manager is good. I don't say it
could not go faster
> (Vadim sent me his own version and only because of some limitations in the
implementation I could
> not use it), but providing an application with 1e6 pieces of 60 bytes each,
allocated individually
> instead of a large block, within under one second, this is in my eyes an
excellent result and I lift
> my hat to the implementor. There might be some worst cases but generally the
MM does a very good job
> and I could not brag about how fast VT is without this manager.

Hey, this wasn't meant to be a general bashing on the mem manager. And btw,
recently I checked out
an alternative mem manager (from www.optimalcode.com, that site is to be
recommended too, but you'll
probably know it already). Without code change I got a speedup of 15% at very
string intensive operations.

Regards,
Werner

 | Replies | Author | Date
3578 | Re: Redraw problem in large trees during keyboard | Mike Lischke | Fri 8/24/2001


How to switch VirtualTreeView between tree-view and list-view?

From: Danny Gao [dannygao2000@y...]
Date: Sun Aug 19, 2001 7:56 am
Subject: How to switch VirtualTreeView between tree-view and list-view?

Hello,

I'm using VirtualTreeView to do a email client.

The VirtualTreeView is used to show the mail list. It is very perfect
when showing mails in "thread", which means the related mails can be shown
as a tree structure. However, I get some problems when I try to show
mails as a list(no tree structure), then mails can be sorted by date,
size or some other fields.

I need your help.

Thanks.

Forgive my poor english

Danny

 | Replies | Author | Date
3512 | Re: How to switch VirtualTreeView between tree-vi | Werner Lehmann | Sun 8/19/2001


redraw efficiency question

From: [hnjemanze@s...]
Date: Sun Aug 19, 2001 8:50 am
Subject: redraw efficiency question

Hi,

I am a newbie, as I have only been using VirtualTreeview for two
weeks. First let me say I think VT is fantastic! Hats off to Mike and
everyone involved.
For the question below I am using vt2.5.1 with C++ Builder 5, and
VirtualStringTree in particular.

My question has to do with the number of times GetText is called
when displaying tooltips or resizing columns. I am using VT as a
grid, and for example if I display 10 columns by 25 rows it takes
1,000 calls to GetText to refresh the panel (apparently four calls
are made for each cell, I haven't studied the code yet to learn why).
I am not writing to complain about this, but rather to mention that
when tooltips are enabled (and the text is long enough to trigger
them, the entire panel is continuously repainted as the mouse moves
over new tooltips, 1,000 GetText calls at a time. Also if the columns
are resized by dragging the header dividers, all columns following
the resized column plus one column previous are continuously
repainted via GetText calls. In other words, if you resize column 3,
then columns 2 thru 10 are refreshed throughout the operation (900
calls per 'pixel delta' while dragging).
My question is wouldn't it be more efficient to save and restore
the bitmap under the tooltip for tooltip events, and also for resize
events maybe a bitmap of subsequent columns could be pushed back and
forth (and clipped at the panel boundary). For the previous and
current columns, GetText could be done once to cache a full length
copy of the affected strings, since those are the only ones whose
disply width changes during the drag to resize operation.

I make these suggestions under the assumption that to maintain the
highest performance we want to involve the client of the tree as
little as possible in these kind of interactive display operations
since we do not know how expensive a call to GetText might actually
be (for example if it involves a network lookup). Of course the
implementor of the GetText call could add their own layer of
buffering and caching but then each app would have to reinvent a
solution...

A simple way to demonstrate the behaviour I describe above is to
temporarily modify GetText to return the value of a counter that
increments on each call as it's Text value (along with enough extra
static text to invoke tooltips for an appropriately sized column).
In my experiments it only takes a few seconds of mouse hovering and
column resizing to approach a million GetText calls for a 250 cell
grid.

Again, I think VirtualTreeview is incredible and I am only making
these suggestions in the hope of making it even better. Please let me
know if I am missing the point of how the redraw works, or if I am
using the grid mode incorrectly. Or maybe this has already been
addressed in a subsequent build or an earlier posting?

Thanks,
Hugh Njemanze

 | Replies | Author | Date
3513 | Re: redraw efficiency question | Werner Lehmann | Sun 8/19/2001
3547 | Re: redraw efficiency question | [hnjemanze@s...] | Mon 8/20/2001
3581 | Re: redraw efficiency question | Mike Lischke | Fri 8/24/2001


re: How to use the Editors

From: [helge@e...]
Date: Sun Aug 19, 2001 9:56 am
Subject: Re: How to use the Editors

> I'll inform you tomorrow how great it worked for me.
>

Just tried it out and: it works!!! Thanks again...

Only one problem: I want to use FullRowSelect - but with it enabled I
can't edit anything. Where's the problem painting the complete line
e.g. blue and then showing the edit or combobox on it's place? You
have the extended focus so I can't see any problems any more.

Helge.


Selecting nodes??

From: "John" [john_sco@h...]
Date: Sun Aug 19, 2001 10:58 am
Subject: Selecting nodes??

Sorry for yet another stupid question, but now that i have managed to
fill VT with my data, although not the 'proper' way, im having
problems with a part of my program. Using my old treeview my program
was able to store the last selected node as an integer value in the
registry and then on next start up, it would select that node again.
I'd like to keep this feature, but how do i select a node?? Do i
use 'focusednode', or 'selected'? i tried this -

if reg.ValueExists('RomIndex') then
begin
Romindex := reg.ReadInteger('RomIndex');
if (high(roms)-1) > Romindex then begin

romlist.FocusedNode.Index := RomIndex;
romlist.ScrollIntoView(romlist.FocusedNode);

end;
end;

unsurprisingly it didnt work. :-)

John

 | Replies | Author | Date
3516 | Re: Selecting nodes?? | Werner Lehmann | Sun 8/19/2001


re: How to switch VirtualTreeView between tree-view and list-view?

From: Werner Lehmann [wl@b...]
Date: Sun Aug 19, 2001 10:54 am
Subject: Re: [VirtualTreeview] How to switch VirtualTreeView between tree-view and list-view?

Hi Danny,

> The VirtualTreeView is used to show the mail list. It is very perfect
> when showing mails in "thread", which means the related mails can be shown
> as a tree structure. However, I get some problems when I try to show
> mails as a list(no tree structure), then mails can be sorted by date,
> size or some other fields.
>
> I need your help.

You really need to be more specific. What is the current problem?

> Forgive my poor english

Your english seems ok to me.

Regards,
Werner


re: redraw efficiency question

From: Werner Lehmann [wl@b...]
Date: Sun Aug 19, 2001 11:22 am
Subject: Re: [VirtualTreeview] redraw efficiency question

Hi Hugh,

> For the question below I am using vt2.5.1 with C++ Builder 5, and
> VirtualStringTree in particular.

BCB... don't you have any problems with AddChild and its default parameter?

> My question has to do with the number of times GetText is called
> when displaying tooltips or resizing columns. I am using VT as a
> grid, and for example if I display 10 columns by 25 rows it takes
> 1,000 calls to GetText to refresh the panel (apparently four calls
> are made for each cell, I haven't studied the code yet to learn why).
> I am not writing to complain about this, but rather to mention that
> when tooltips are enabled (and the text is long enough to trigger
> them, the entire panel is continuously repainted as the mouse moves
> over new tooltips, 1,000 GetText calls at a time. Also if the columns
> are resized by dragging the header dividers, all columns following
> the resized column plus one column previous are continuously
> repainted via GetText calls. In other words, if you resize column 3,
> then columns 2 thru 10 are refreshed throughout the operation (900
> calls per 'pixel delta' while dragging).

Your observations are correct. IMO this is what the virtual paradigm is
about (although other people including Mike AFAIK refer to this when they
talk about node initialization with OnInitNode and co.). The application
holds the data and is asked by the tree.

In a more conventional design the tree would store the strings and the
data. You won't get a chance to count how often the string queries the
strings it would store on its own. There is a good chance that the tree
would still need access to each string 4 times per cell.

> My question is wouldn't it be more efficient to save and restore
> the bitmap under the tooltip for tooltip events, and also for resize
> events maybe a bitmap of subsequent columns could be pushed back and
> forth (and clipped at the panel boundary). For the previous and
> current columns, GetText could be done once to cache a full length
> copy of the affected strings, since those are the only ones whose
> disply width changes during the drag to resize operation.

This can be done. In theory. But there are many side effects which have to
be considered. For example, the previous column in your example may have nodes
whose text has to abbreviated (ellipsis). You won't get anywhere with a static
bitmap in this case. Even if you had such a bitmap you would still have to use
GetText to learn when the bitmap does not suffice anymore and a fallback to
the current way must be done.

Also with column resizing, we may have an autosize column (which may be any
of the columns to the right of resizing column). No chance to do this with
a static bitmap.

With respect to the tooltip backbuffering... I see a better chance of
realizing this. You might want to add this to request table of the database
section at yahoo groups. The general problem is that we want to get to some
final and releasable version soon. Any new code must be written and tested
and delays this release.

> I make these suggestions under the assumption that to maintain the
> highest performance we want to involve the client of the tree as
> little as possible in these kind of interactive display operations
> since we do not know how expensive a call to GetText might actually
> be (for example if it involves a network lookup). Of course the
> implementor of the GetText call could add their own layer of
> buffering and caching but then each app would have to reinvent a
> solution...

The tree is only displaying your data. Your data resides in your own data
structures and this can't be done by the tree because each app uses different
data structures. The tree could only cache the strings but this would destroy
a good deal of what the 'virtual' (in my understand of the word for VTree)
is all about. And it would duplicate the memory required by these strings.

You just have to hold the required infos in your own structure. And if
possible init this data as late as possible (via OnInitNode) to possibly
avoid initialization (and fetching the data) for many nodes at all.

Whether the data comes via network or database, if access is too slow for
high frequency fetching you need to cache it on your own.

> A simple way to demonstrate the behaviour I describe above is to
> temporarily modify GetText to return the value of a counter that
> increments on each call as it's Text value (along with enough extra
> static text to invoke tooltips for an appropriately sized column).
> In my experiments it only takes a few seconds of mouse hovering and
> column resizing to approach a million GetText calls for a 250 cell
> grid.

I could imagine that the GetText may could be decreased by some factor.
During a single paint cycle per node / cell the string might be queried
only once and then be used as a short time cache. But Mike himself can
judge the chances (and consequences) of this far better.

> Again, I think VirtualTreeview is incredible and I am only making
> these suggestions in the hope of making it even better. Please let me
> know if I am missing the point of how the redraw works, or if I am
> using the grid mode incorrectly. Or maybe this has already been
> addressed in a subsequent build or an earlier posting?

Yes, there was a dicussion some time ago. There was a 18-postings thread
with subject 'OnGetText: Called so often only moving the focus' starting
on 10th of July. You can access these postings at yahoo groups.

Regards,
Werner

 | Replies | Author | Date
3547 | Re: redraw efficiency question | [hnjemanze@s...] | Mon 8/20/2001
3581 | Re: redraw efficiency question | Mike Lischke | Fri 8/24/2001


re: Node property editor in C++ Builder

From: Werner Lehmann [wl@b...]
Date: Sun Aug 19, 2001 11:25 am
Subject: Re: [VirtualTreeview] Node property editor in C++ Builder

Hi Sig,

> I use BCB 5 and I'm just wondering if it is possible to create
> property editor for virtual string tree. Problem is very simple, C++
> Builder doesn't allow to derive from multiply classes
> (TInterfacedObject, IVTEditLink). Is here another way to do that?
> All what I need is drop down list (combo box) and/or edit
> component with certain restrictions depending on node level. Thank
> you for any suggestion.

About the combo, you may want to check out what Jim has recently uploaded.
I am really surprised on the statement that 'C++ Builder doesn't allow to
derive from multiply classes'. AFAIK C++ supports multiple inheritance (in
opposition to Delphi). And Roland has done node editors in C++B (also avail.
at YG) and I did not read a complaint about this subject...

Regards,
Werner

 | Replies | Author | Date
3518 | Re: Node property editor in C++ Builder | Jim Kueneman | Sun 8/19/2001


re: (Mike, please read) OLE Drag and drop: optimized move and more

From: Werner Lehmann [wl@b...]
Date: Sun Aug 19, 2001 11:36 am
Subject: Re: [VirtualTreeview] (Mike, please read) OLE Drag and drop: optimized move and more

Hi Jim,

> Yes it is similar to Anders D&D Suite, but it is more generic . It is
> necessary to have window handle to register with the OLE subsystem. I have
> not looked into using it with VT. My guess is VT would have to be changed
> to get it to work. I have include enough hooks to allow the user to

It sounds as if Mike likes the idea :) (see his (old) reply in this thread)

> competlely override anything to do with the D&D. Once I get it working
> (well it is working now I am just trying to clean it up) I will see what

Any news on the current state of it?

> needs to be done to VT to use it. It may be possible to turn off D&D in VT
> then just use my component attached to it. Have you tried that with D&D
Suite?

No. But if I switch toAcceptOLEDrop off the tree handle is not registered for
drag and drop, at least not by the tree itself. I don't see why it should not
work.

> >Trouble is probably to be expected with the drag image. You rely on the drag
> >source helper. Nice on Win2k, but no drag image at all on everything else
(but
> >XP). And this includes even drag and drop within the same tree. Or am I wrong
> >here?
>
> Right now I am using the helpers true but if they are not available I drop
> back to the image list base image. It seem like the image list image
> dragging gets slower as computers get faster! I may try to "borrow" Mikes
> MMX stuff from VT if I get a lot of extra time (ha).

I am a little bit confused. What was the reason why Mike did implement his own
way? Was it really the speed problem you talk about, or was it the missing
alpha
blending in the image list (AFAIK!)? I would love to have a drag image if a node
is dragged not only on a VTree. Changes of the window content below could be
detected via the DROPEFFECT_SCROLL (sp?). And if someone really needs to drag
the
image over an autohiding taskbar or the windows analog clock I would not bother
too much (if someone still cares there could be an option to turn the image off
if not on VTree).

Regards,
Werner

 | Replies | Author | Date
3519 | Re: (Mike, please read) OLE Drag and drop: optimi | Jim Kueneman | Sun 8/19/2001


re: Selecting nodes??

From: Werner Lehmann [wl@b...]
Date: Sun Aug 19, 2001 11:51 am
Subject: Re: [VirtualTreeview] Selecting nodes??

Hi John,

> Sorry for yet another stupid question, but now that i have managed to
> fill VT with my data, although not the 'proper' way, im having
> problems with a part of my program. Using my old treeview my program
> was able to store the last selected node as an integer value in the
> registry and then on next start up, it would select that node again.
> I'd like to keep this feature, but how do i select a node?? Do i
> use 'focusednode', or 'selected'? i tried this -
>
> if reg.ValueExists('RomIndex') then
> begin
> Romindex := reg.ReadInteger('RomIndex');
> if (high(roms)-1) > Romindex then begin
>
> romlist.FocusedNode.Index := RomIndex;
> romlist.ScrollIntoView(romlist.FocusedNode);
>
> end;
> end;
>
> unsurprisingly it didnt work. :-)

No, that cannot work. You assign the index manually when it is only managed
by the tree itself. This means you don't change the focus. The scrollintoview
just scrolls the old focused node (if one is set) into view.

To focus a node you must assign it to the FocusedNode property:

RomList.FocusedNode := MyNode;

The problem is still how to know which node MyNode is. You may get along if
you get the RomIndex before you init any nodes and then check on each node
init if the current node to-be init'ed is also the to-be-focused node. Otherwise
you need to do a search in the tree. Access by index or ID is expensive in
chained
lists.

Note that the node is still not selected if you focus it that way. That would
need one more line with the Selected[] property.

Regards,
Werner


re: Minor Bugreport

From: "Wim van der Vegt" [wvd_vegt@k...]
Date: Sun Aug 19, 2001 12:05 pm
Subject: Re: [VirtualTreeview] Minor Bugreport

Hi Mike,

Sure i can adjust but when you toggle between modes you have to adjust these
colors everytime.

Besides that the left part painted isn't the treeline in my opinion but looks
more like a part of the grid. I guess the same holds for the pattern of the
treeline/grid. In lmband mode you expect them to be the same. In lmbands mode
you only have a grid.

As a last remark it's also poorly visible (took me some time to see it and
figuring out what caused it on my flatscreen monitor) and might easlily end up
in a finished application.

Thats why i asked this minor change because it seems more logical (it should
not be more than a single if statement ....).

Wim van der Vegt.
----- Original Message -----
From: Mike Lischke
To: VirtualTreeview@yahoogroups.com
Sent: Saturday, August 18, 2001 06:09 PM
Subject: RE: [VirtualTreeview] Minor Bugreport

Hi Wim,

> I noticed that in linemode is lmbands the left part of the band grid is
> painten in the color of the treeline color and the left part in the gridline
> color. I think it should both be gridline color in the case of lmbands mode.

Well, you can always adjust the colors so they fit. I thought that there is
no reason to force a
particular color if you can adjust it.

Ciao, Mike

Yahoo! Groups Sponsor

To unsubscribe from this group, send an email to:
VirtualTreeview-unsubscribe@egroups.com

Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.

[Non-text portions of this message have been removed]

 | Replies | Author | Date
3520 | Re: Minor Bugreport | Mike Lischke | Sun 8/19/2001
3530 | Re: Minor Bugreport | Wim van der Vegt | Sun 8/19/2001


re: Node property editor in C++ Builder

From: Jim Kueneman [jimdk@m...]
Date: Sun Aug 19, 2001 12:32 pm
Subject: Re: [VirtualTreeview] Node property editor in C++ Builder

At 01:25 PM 8/19/2001 +0200, you wrote:
>Hi Sig,
>
> > I use BCB 5 and I'm just wondering if it is possible to create
> > property editor for virtual string tree. Problem is very simple, C++
> > Builder doesn't allow to derive from multiply classes
> > (TInterfacedObject, IVTEditLink). Is here another way to do that?
> > All what I need is drop down list (combo box) and/or edit
> > component with certain restrictions depending on node level. Thank
> > you for any suggestion.
>
>About the combo, you may want to check out what Jim has recently uploaded.
>I am really surprised on the statement that 'C++ Builder doesn't allow to

Doubt if it will work in BCB

>derive from multiply classes'. AFAIK C++ supports multiple inheritance (in
>opposition to Delphi). And Roland has done node editors in C++B (also avail.
>at YG) and I did not read a complaint about this subject...

I recall others stating that BCB does not undertand how to deal with this
aspect of Delphi. I recall mike thinking about changing it to a class
instead of an interface since his thought was an interface would make it
more C++ friendly, which does not seem to be the case <g>.

Roland did upload this:
http://groups.yahoo.com/group/VirtualTreeview/files/Examples/BCB_Examples/Proper\
ty_Editors/
it is called:
"for BCB5: show how to use IVTEditLink with VT 2.4.21 and greater"

Sounds like exactly what you need.

Jim


re: (Mike, please read) OLE Drag and drop: optimized move and more

From: Jim Kueneman [jimdk@m...]
Date: Sun Aug 19, 2001 12:45 pm
Subject: Re: [VirtualTreeview] (Mike, please read) OLE Drag and drop: optimized move and more

At 01:36 PM 8/19/2001 +0200, you wrote:
>Hi Jim,
>
>It sounds as if Mike likes the idea :) (see his (old) reply in this thread)

It is encouraging <g>

>Any news on the current state of it?

I have gotten distracted with finishing the documentation for VET, figuring
out how to add checkboxes to VET, writing IVTEditLinks, finding bugs in
VET, getting a RollDown VET working and spending time with the family this
weekend so the answer is.... It works but it can be simplified greatly
although will take a fair amout of work to do it. The problem was I
generated a help file for it and was shocked at the number of classes
(mostly redundant) it used. <g>

> > Right now I am using the helpers true but if they are not available I drop
> > back to the image list base image. It seem like the image list image
> > dragging gets slower as computers get faster! I may try to "borrow" Mikes
> > MMX stuff from VT if I get a lot of extra time (ha).
>
>I am a little bit confused. What was the reason why Mike did implement his own
>way? Was it really the speed problem you talk about, or was it the missing
>alpha

From what I recall it initially was the speed issue. He is dragging a
farily big image and man is it slow even on my newest fastest
machine. Remember how the mouse cursor image lagged behind on old notepad
computers? That is how the image list based drag image is if it is larger
than about 50 pixels. Now that he has the alpha blending he is spoiled and
won't go back to the image it anyway.

>blending in the image list (AFAIK!)? I would love to have a drag image if
>a node
>is dragged not only on a VTree. Changes of the window content below could be
>detected via the DROPEFFECT_SCROLL (sp?). And if someone really needs to
>drag the
>image over an autohiding taskbar or the windows analog clock I would not
>bother
>too much (if someone still cares there could be an option to turn the
>image off
>if not on VTree).

I found that the image list image is not perfect either, it detects the
autohide taskbar but if it is in the area of the Start Menu and that pops
up it leaves a big blank hole in the menu!

Jim


re: Minor Bugreport

From: "Mike Lischke" [lists@l...]
Date: Sun Aug 19, 2001 3:03 pm
Subject: RE: [VirtualTreeview] Minor Bugreport

Wim,

> Thats why i asked this minor change because it seems more logical (it should
not be more
> than a single if statement ....).

It is not the point to change the bahavior but to unnessecarily force the user
to have it this way
if (s)he could choose. But I guess nobody will have two different colors there
as it looks, hm,
strange then.

Btw: could you please look at your bug report (#34). You have not finished the
description so I
don't know what to do. Or is it this very problem which are just discussing?

Ciao, Mike


re: Selection problems

From: "Mike Lischke" [lists@l...]
Date: Sun Aug 19, 2001 3:27 pm
Subject: RE: [VirtualTreeview] Selection problems

> > When you run the application, you should see the second node selected and
> > focused. Now hold the Shift key down and click on a lower node. You would
> > expect the selection block to start from the second node but instead it
> > starts from the first node.
>
> Here's a fix:

Thank you Werner, for your fixes. The first one finally ended up in another
place, but the second
fix was perfect and precisely observed. VT should now select as expected. Note:
at least in W2K the
selection in Explorer is not entirely cleared after the sequence:

- click
- shift click for a range
- control click (will set a new range anchor now)
- ctrl+shift+click to create a new range
...
- shift+arrow down key

It will keep the last range and clear all others. VT behaves now the same way.

Ciao, Mike


New file uploaded to VirtualTreeview

From: [VirtualTreeview@yahoogroups.com>
Date: Sun Aug 19, 2001 3:35 pm
Subject: New file uploaded to VirtualTreeview

Hello,

This email message is a notification to let you know that
a file has been uploaded to the Files area of the VirtualTreeview
group.

File : /VirtualTree_2.5.18.zip
Uploaded by : [lists@l...]
Description : Beta version

You can access this file at the URL

http://groups.yahoo.com/group/VirtualTreeview/files/VirtualTree_2.5.18.zip

To learn more about file sharing for your group, please visit

http://help.yahoo.com/help/us/groups/files

Regards,

lists@l...]

 | Replies | Author | Date
3523 | Re: New file uploaded to VirtualTreeview | Mike Lischke | Sun 8/19/2001


re: New file uploaded to VirtualTreeview

From: "Mike Lischke" [lists@l...]
Date: Sun Aug 19, 2001 3:52 pm
Subject: RE: [VirtualTreeview] New file uploaded to VirtualTreeview

> This email message is a notification to let you know that
> a file has been uploaded to the Files area of the VirtualTreeview
> group.

This time only some bug fixes happend. Moritz, can you please check again for
bug #36. Is it still
there?

Ciao, Mike


re: (Mike, please read) OLE Drag and drop: optimized move and more

From: Werner Lehmann [wl@b...]
Date: Sun Aug 19, 2001 3:57 pm
Subject: Re: [VirtualTreeview] (Mike, please read) OLE Drag and drop: optimized move and more

Hi Jim,

> >Any news on the current state of it?
>
> I have gotten distracted with finishing the documentation for VET, figuring
> out how to add checkboxes to VET, writing IVTEditLinks, finding bugs in
> VET, getting a RollDown VET working and spending time with the family this
> weekend so the answer is.... It works but it can be simplified greatly
> although will take a fair amout of work to do it. The problem was I
> generated a help file for it and was shocked at the number of classes
> (mostly redundant) it used. <g>

I didn't mean to get pushy on you. It's only each time I look on my TODO list
the first item is 'get DnD to work'. Currently the shell (re)moves files
silently (optimized, but I don't know when without my own data object) and thus
I had to disallow node moving which in turn cuts down application internal
dragging.

> >I am a little bit confused. What was the reason why Mike did implement his
own
> >way? Was it really the speed problem you talk about, or was it the missing
> >alpha
>
> From what I recall it initially was the speed issue. He is dragging a
> farily big image and man is it slow even on my newest fastest
> machine. Remember how the mouse cursor image lagged behind on old notepad
> computers? That is how the image list based drag image is if it is larger
> than about 50 pixels. Now that he has the alpha blending he is spoiled and
> won't go back to the image it anyway.

That's gross. 50 pixel already too big? What is this code doing behind the cur-
tains? That it is getting worse on faster machines is hard to understand unless
they have some completely misleaded Mhz dependent code in there.

> I found that the image list image is not perfect either, it detects the
> autohide taskbar but if it is in the area of the Start Menu and that pops
> up it leaves a big blank hole in the menu!

Oops. Well, now that should convince everyone that these small glitches cannot
be avoided if someone really puts effort in finding them. And since the problem
is only temporal (XP will probably rule the world and it has layered window
based
drag images (with the drag helpers)) please lets get a dragimage regardless
whether
the drag is over a VT or not... please? :)

Regards,
Werner

 | Replies | Author | Date
3537 | Re: (Mike, please read) OLE Drag and drop: optimi | Jim Kueneman | Sun 8/19/2001


re: A little suggestion for OnGetText...

From: "Mike Lischke" [lists@l...]
Date: Sun Aug 19, 2001 4:01 pm
Subject: RE: [VirtualTreeview] A little suggestion for OnGetText...

Hi Martin,

> I noticed that in some cases (re-expanding a node when
> AutoScrollOnExpand is ON and GridExtensions are OFF, hitting <CTRL-
> END> / <CTRL-HOME>) the OnGetText handler is called with its
> parameter <Column> being -1 ("NoColumn"). Unless this is needed
> somewhere else, it might be a good idea to prevent that.

This is fixed now too (for the next upload, not in 2.5.18).

Btw: there is a database area for the mailing list on YG. There you will find a
table which is
supposed to keep all bug reports and also tells you if anything related was
already reported. Please
use this in the future for bug reports

Ciao, Mike


Feature requests (To Martin Lehmann & Helge Jung)

From: Werner Lehmann [wl@b...]
Date: Sun Aug 19, 2001 4:06 pm
Subject: Feature requests (To Martin Lehmann & Helge Jung)

Martin,

> Enable "hiding" of nodes from
> display while keeping the data (i.e.
> they are just not rendered on the
> screen)

Isn't this already solved with the Visible[] property?

Helge,

> A property named "Colors" being a
> array of all colors ever needed in
> the tree. What about a color for the
> selected cell/row?

In what way is this different from the properties Colors.*Selection*?

Regards,
Werner

 | Replies | Author | Date
3539 | Re: Feature requests (To Martin Lehmann & Helge J | [martin.lehmann@a...] | Sun 8/19/2001
3540 | Re: Feature requests (To Martin Lehmann & Helge J | Jim Kueneman | Sun 8/19/2001
3556 | Re: Feature requests (To Martin Lehmann & Helge J | [helge@e...] | Mon 8/20/2001
3557 | Re: Feature requests (To Martin Lehmann & Helge J | Jim Kueneman | Mon 8/20/2001
3584 | Re: Feature requests (To Martin Lehmann & Helge J | Mike Lischke | Fri 8/24/2001


re: An idea for the documentation...

From: "Mike Lischke" [lists@l...]
Date: Sun Aug 19, 2001 4:07 pm
Subject: RE: [VirtualTreeview] An idea for the documentation...

> I think it might be a good idea to remind programmers (especially
> novices like me ;-)) that STRINGs are dynamically allocated.
> Therefore, if you use a STRING in your NodeData, you need to free the
> allocated memory manually in the OnFreeNode event (using SetLength).
> Otherwise you got yourself a nice memory leak (I think I have seen
> this mistake in one of the (1.3.1) examples, too).

Although you already got a reply let me answer too. Normally you always have to
take care that
memory is correctly freed which you allocated. The VCL will help in various
places but for
dynamically allocated records this is difficult. I found the use of Dispose
extremely helpful in
this context because it takes care to release any non-class/interface member of
the record. This
includes strings as well as dynamic arrays. If you pass a typed pointer to
Dispose then it will
implicitly call Finalize on it.

In the age of interfaces and automatic garbage collection where memory is freed
implicitely there
might be an increasing number of programmers who simply do not know about this.
So I guess your
suggestion is a good idea and I should include at least a warning in the docs
about this.

Ciao, Mike


re: Bug fix report

From: "Mike Lischke" [lists@l...]
Date: Sun Aug 19, 2001 4:34 pm
Subject: RE: [VirtualTreeview] Bug fix report

Hi Vadim,

> And what? You need to clear NewSize - OldSize bytes only. I think ReallocMem
> + FillChar will be much faster than call to InitRootNode.

About what times do we speak? InitRootNode is called about two times in a usual
tree.

> I expect that internal data for the root node can be set right after
> allocation (AllocateInternalDataArea). In current implementation it's
impossible, because
descendant can override
> constructor and allocate its own internal data and my data will be lost (set
to 0 by next
InitRootNode).
> In such case I don't see any reason for InitRootNode in
AllocateInternalDataArea, because caller
must NOT access allocated data
> before AfterConstruction because it can be lost. (ufff)

Aaaah, we are getting closer. This time I understood (I think :-)). OK, I agree
that you would
expect to use the internal data area of the root node after its allocation but
this can be
overwritten by additional allocations in descentant trees. However by using
this space which is only
there to make checks faster (and could well get overwritten or misinterpreted,
call DoGetNodeWidth
with FRoot) you are implementing a hack to store information which you could
easily store in a local
variable.

I still do not agree that data should be preserved in InitRootNode because it
only allows to store
stuff in the root node which should not be there. But since it does not harm
anything I'd say so be
it then. I will change it the way you want it, but in the future I'd prefer to
waste my time on more
interesting things ;-)

Ciao, Mike

 | Replies | Author | Date
3529 | Re: Bug fix report | Jim Kueneman | Sun 8/19/2001
3582 | Re: Bug fix report | Mike Lischke | Fri 8/24/2001


re: Bug fix report

From: Jim Kueneman [jimdk@m...]
Date: Sun Aug 19, 2001 4:55 pm
Subject: RE: [VirtualTreeview] Bug fix report

At 06:34 PM 8/19/2001 +0200, you wrote:

>I still do not agree that data should be preserved in InitRootNode because
>it only allows to store
>stuff in the root node which should not be there. But since it does not
>harm anything I'd say so be
>it then. I will change it the way you want it, but in the future I'd
>prefer to waste my time on more
>interesting things ;-)

Mike,

Before doing anything hasty here I am using the RootNode to store data
so try not to mess me up <g>. I am using it to implement the "Hide Root
Node" option. Basiclly what I do is make the Root Namespace Node the
RootNode. As far as VET is concerned it is just a plain node and stores
the same info as if it were not. This way the Root VET Node is not show
since the VT RootNode is invisible. I know it is a bit of a hack but to
impliment it right was a *lot* of work on my part, and I dislike work <g>

Jim

 | Replies | Author | Date
3582 | Re: Bug fix report | Mike Lischke | Fri 8/24/2001


re: Minor Bugreport

From: "Wim van der Vegt" [wvd_vegt@k...]
Date: Sun Aug 19, 2001 5:14 pm
Subject: Re: [VirtualTreeview] Minor Bugreport

Hi,

Yep. the problem we're discussing. I can imagine two distinct colors if you use
treelines. Not if you use bands. Problem there is that one could use two colors
if they would run up to the border of the first column and you could choose
colors go with the backgroundcolor of the columns. (currently the left part of
the bands stops where one would expect the treelines to halt). Thats also a
reason for my request.

Btw the YG database works kinda funny. I added a record with an existing number
and it just appended it to the existing one. Unfortunately i can't edit/delete
my own entries.
----- Original Message -----
From: Mike Lischke
To: VirtualTreeview@yahoogroups.com
Sent: Sunday, August 19, 2001 05:03 PM
Subject: RE: [VirtualTreeview] Minor Bugreport

Wim,

> Thats why i asked this minor change because it seems more logical (it
should not be more
> than a single if statement ....).

It is not the point to change the bahavior but to unnessecarily force the
user to have it this way
if (s)he could choose. But I guess nobody will have two different colors
there as it looks, hm,
strange then.

Btw: could you please look at your bug report (#34). You have not finished
the description so I
don't know what to do. Or is it this very problem which are just discussing?

Ciao, Mike

Yahoo! Groups Sponsor

To unsubscribe from this group, send an email to:
VirtualTreeview-unsubscribe@egroups.com

Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.

[Non-text portions of this message have been removed]


re: Re: Coloring rows

From: "Mike Lischke" [lists@l...]
Date: Sun Aug 19, 2001 6:20 pm
Subject: RE: [VirtualTreeview] Re: Coloring rows

Hi Moritz,

> hi, with exactly this implementation i have had the problem that
> after some days it suddenly stopped to work. the cells were no longer
> colored. this happend two times until now, one time several weeks ago
> and one time some days ago.

This sounds a bit vague. Why should this suddenly stop working? Without more
information I can't do
anything.

Ciao, Mike

 | Replies | Author | Date
3549 | Re: Coloring rows | Moritz Franckenstein | Mon 8/20/2001
3550 | Re: Coloring rows | Moritz Franckenstein | Mon 8/20/2001


re: Re: How to use the Editors

From: "Mike Lischke" [lists@l...]
Date: Sun Aug 19, 2001 6:20 pm
Subject: RE: [VirtualTreeview] Re: How to use the Editors

> And how I can activate it? Sorry - I'm really a bit confused about
> this editor-things...

You can read a description about the invokation of the editor in the help files
located on YG or
online via www.lischke-online.de/VirtualTreeview/!VTMain.html. Look into
section "Inner
fundamentals" -> "Editors and editing".

Ciao, Mike


New file uploaded to VirtualTreeview

From: [VirtualTreeview@yahoogroups.com>
Date: Sun Aug 19, 2001 6:21 pm
Subject: New file uploaded to VirtualTreeview

Hello,

This email message is a notification to let you know that
a file has been uploaded to the Files area of the VirtualTreeview
group.

File : /Descendants/VirtualTreesEx.zip
Uploaded by : [wl@b...]
Description : This string tree descendant provides redraw capability during
BeginUpdate/EndUpdate.

You can access this file at the URL

http://groups.yahoo.com/group/VirtualTreeview/files/Descendants/VirtualTreesEx.z\
ip

To learn more about file sharing for your group, please visit

http://help.yahoo.com/help/us/groups/files

Regards,

wl@b...]


re: Buffering updates

From: Werner Lehmann [wl@b...]
Date: Sun Aug 19, 2001 6:10 pm
Subject: Re: [VirtualTreeview] Buffering updates

Werner Lehmann wrote:
>
> I have uploaded the code and a sample exe (requires runtime package
vcl50.bpl, D5 SP1) to
> YG for anyone who is interested. There are some problems left so I recommend
not to use it
> already in this state:

The demo has been replaced with a new version (component source only). This
requires VTree
2.5.18 or higher. The tree options work now and MMX is properly respected
(thanks for making
the variable 'public', Mike). Thus this version is now suitable for the
scenario 'modal dialog
on top of a beginupdate/endupdate tree'.

Included in the zip is a register unit. You may want to
* add VirtualTreesExReg.pas to the package VirtualTreesD?D.dpk and
* add VirtualTreesEx.pas to the package VirtualTreesD?.dpk.

Werner


re: Tree options in descendants

From: Werner Lehmann [wl@b...]
Date: Sun Aug 19, 2001 6:03 pm
Subject: Re: [VirtualTreeview] Tree options in descendants

Hi Mike,

> No, you are not missing something. Indeed I had forgotten two small things
which are needed to make
> customizing tree options possible. To prove the concept I have done something
I should have done
> already in the first place: the string options are no longer part of the base
options but placed in
> an own options class which is derived from the base tree options (and only
used in the string tree).
> The two missing points were:
>
> - a virtual method which tells the base tree what option class to create,
which can be overriden by
> descentants
> - individual setter and getter classes for property TreeOptions to return the
correct class
> (important also for the OI)
>
> Thank you for digging into this stuff, Werner. Please test the new
implementation when it is
> available.

I have done this test right now since I want to publish the TreeOptions in the
company's
descendent of the string tree :)

Everything works so far and the concept with the options class is better than
what
I suggested (making FOptions protected). At least if we neglect the computing
time
for a chain of GetOptions calls (of course FOptions can still be made protected
to
get away with hardcasts and avoid the GetOptions chain, as you already do with
the
string tree (since you can access the private FOptions of the base tree in the
same
unit))).

There is only one issue left: without a TCustom* ancestor of the string options
there
is no way to inherit from the (custom) string tree and *not* publish some of
the base
tree options. And the hardcasts in lines 24160 + 24396 and the dynamic cast in
line
24328 should be changed to the TCustom* string options descendant (which is to
be added
IMO). All this custom / published stuff is annoying, I know that, but still
important.

Regards,
Werner

PS: Forget what I said about the described GetOptions chain, if TreeOptions are
never
published in the TCustom* ancestors as demonstrated in the string tree code
efficiency
is the same as with a protected FOptions field.

 | Replies | Author | Date
3579 | Re: Tree options in descendants | Mike Lischke | Fri 8/24/2001


re: Re: How to use the Editors

From: Werner Lehmann [wl@b...]
Date: Sun Aug 19, 2001 6:27 pm
Subject: Re: [VirtualTreeview] Re: How to use the Editors

Hi Jim,

> I also cleaned up the file area. Better?

I hope you don't mind but I have created a top level folder 'Descendants' and
moved the db trees (as well as my own 3 KB :) to it. I believe that the
descendants are not only of interest to Delphi users and are not (only) examples
so they fit better here than in Examples / Delphi_Examples IMO.

Regards,
Werner


re: (Mike, please read) OLE Drag and drop: optimized move and more

From: Jim Kueneman [jimdk@m...]
Date: Sun Aug 19, 2001 7:25 pm
Subject: Re: [VirtualTreeview] (Mike, please read) OLE Drag and drop: optimized move and more

At 05:57 PM 8/19/2001 +0200, you wrote:
>Hi Jim,
>
>I didn't mean to get pushy on you. It's only each time I look on my TODO list
>the first item is 'get DnD to work'. Currently the shell (re)moves files
>silently (optimized, but I don't know when without my own data object) and
>thus

I did not take it that way, don't worry.

To Mike and those using BCB.

My implementation of the DataObject uses interfaces to deal with writing
"clipboard format handlers" after a recent post I was reminded that BCB
does not like the way Delphi has implementing multiple interfaces. Has
this been solved? If not my implemention may not go over well with Mike
since it will be very BCB unfriendly.

Comments?

Jim


Initialization of StandardOLEFormat and ActiveForms

From: [agallero@n...]
Date: Sun Aug 19, 2001 9:16 pm
Subject: Initialization of StandardOLEFormat and ActiveForms

Hi,

Well, I'm not sure if this is a problem with the ActiveX framework
or with the treeview control, but I report it as is easy to fix.

The problem I'm having is that when you have an ActiveX working
inside Internet explorer and the user press 'Refresh', the full
activeform is reloaded, but the global variables (the ones defined
with "var xx: yy = zz ' are NOT re-initialized.

I've seen the problem with activeforms, but think it might happen too
when using dlls in some cases where the classes are recreated, and in
general the only solution I've found is to avoid using this
construct, by loading the value on the initializaion section, or
putting it inside a class.

I dont know if you want me to send an example app, but it is not
difficult to do, just an activeform with a treeview on it, see it in
ie, refresh, and thats it.

The fix I'm temporary using is to have this initialization:

initialization
with StandardOLEFormat do
begin
cfFormat:= 0;
ptd:=nil;
dwAspect:= DVASPECT_CONTENT;
lindex:= -1;
tymed:= TYMED_HGLOBAL
end;
//all the other stuff
.
.
.

Hope it's useful. Thanks a lot and keep on with the great work!
Best regards,
Adrian.

 | Replies | Author | Date
3580 | Re: Initialization of StandardOLEFormat and Activ | Mike Lischke | Fri 8/24/2001
3619 | Re: Initialization of StandardOLEFormat and Activ | [agallero@n...] | Mon 8/27/2001
3649 | Re: Initialization of StandardOLEFormat and Activ | Mike Lischke | Tue 9/4/2001


re: Feature requests (To Martin Lehmann & Helge Jung)

From: [martin.lehmann@a...]
Date: Sun Aug 19, 2001 9:27 pm
Subject: Re: Feature requests (To Martin Lehmann & Helge Jung)

--- In [VirtualTreeview@y...], Werner Lehmann [wl@b...] wrote:
> Martin,
>
> > Enable "hiding" of nodes from
> > display while keeping the data (i.e.
> > they are just not rendered on the
> > screen)
>
> Isn't this already solved with the Visible[] property?
>

Yes it is - my bad. Could somebody (whoever has permission, I guess
that's Mike) please remove that request?

Thanks,

Martin

 | Replies | Author | Date
3540 | Re: Feature requests (To Martin Lehmann & Helge J | Jim Kueneman | Sun 8/19/2001


re: Re: Feature requests (To Martin Lehmann & Helge Jung)

From: Jim Kueneman [jimdk@m...]
Date: Sun Aug 19, 2001 9:38 pm
Subject: Re: [VirtualTreeview] Re: Feature requests (To Martin Lehmann & Helge Jung)

At 09:27 PM 8/19/2001 +0000, you wrote:

>Yes it is - my bad. Could somebody (whoever has permission, I guess
>that's Mike) please remove that request?

Granted.

Jim


Options Hierarchy

From: [crcowan@a...]
Date: Sun Aug 19, 2001 11:11 pm
Subject: Options Hierarchy

Mike:

First, thanks for an outstanding component. I have found many uses
for it. By the way, I am particularly interested in multi-line text
capability - I could even do it as a descendant class if there were
the ability to set the node height with the mouse like you can set
column width (there should probably be an option to allow the nodes
to grow to accomodate the text, or to allow the user to set the size
with the mouse and have the text truncate). That would be wonderful.

The reason for this post is a problem with the fact that the
TStringTreeOptions and TVirtualTreeOptions both descend from
TCustomVirtualTreeOptions, but in the code to do an assign it checks
against TVirtualTreeOptions rather than TCustomVirtualTreeOptions. I
changed the code as follows and I think this fixed the problem:

procedure TCustomVirtualTreeOptions.AssignTo(Dest: TPersistent);

begin
// if Dest is TVirtualTreeOptions then {CRC Change}
if Dest is TCustomVirtualTreeOptions then
begin
// with Dest as TVirtualTreeOptions do {CRC Change}
with Dest as TCustomVirtualTreeOptions do
begin
PaintOptions := Self.PaintOptions;
AnimationOptions := Self.AnimationOptions;
AutoOptions := Self.AutoOptions;
SelectionOptions := Self.SelectionOptions;
MiscOptions := Self.MiscOptions;
end;
end
else
inherited;
end;

I hope I am correct in this. I have found that the only way to set
options in a descendant of TCustomVirtualStringTree now is to create
a "temporary options class", set the options in the temporary and
then use assign to set the TreeOptions property -- that is how I
found this problem. Perhaps there is a better way? Thanks!

C. R. Cowan

 | Replies | Author | Date
3542 | Re: Options Hierarchy | Werner Lehmann | Sun 8/19/2001
3543 | Re: Options Hierarchy | Jim Kueneman | Sun 8/19/2001
3544 | Re: Options Hierarchy | [crcowan@a...] | Mon 8/20/2001
3545 | Re: Options Hierarchy | Jim Kueneman | Mon 8/20/2001
3555 | Re: Options Hierarchy | Werner Lehmann | Mon 8/20/2001
3558 | Re: Options Hierarchy | Jim Kueneman | Mon 8/20/2001
3585 | Re: Options Hierarchy | Mike Lischke | Fri 8/24/2001


re: Options Hierarchy

From: Werner Lehmann [wl@b...]
Date: Sun Aug 19, 2001 11:50 pm
Subject: Re: [VirtualTreeview] Options Hierarchy

Hi C.R.,

> I hope I am correct in this. I have found that the only way to set

Yes, thank you. I believe you are :)

> options in a descendant of TCustomVirtualStringTree now is to create
> a "temporary options class", set the options in the temporary and
> then use assign to set the TreeOptions property -- that is how I
> found this problem. Perhaps there is a better way? Thanks!

Did you override GetOptionsClass? You can see at the stringtree itself
how the options are derived for a new descendant. You can also download
my VirtualTreesEx.zip (uploaded today into the Descendants folder on YG)
to see how new options can be installed (without temporary options).

Apart from the problem you found we also need a custom version of the
string options class. Then it should be perfect :)

Regards,
Werner


re: Options Hierarchy

From: Jim Kueneman [jimdk@m...]
Date: Mon Aug 20, 2001 12:03 am
Subject: Re: [VirtualTreeview] Options Hierarchy

At 11:11 PM 8/19/2001 +0000, you wrote:
> I hope I am correct in this. I have found that the only way to set
>options in a descendant of TCustomVirtualStringTree now is to create
>a "temporary options class", set the options in the temporary and
>then use assign to set the TreeOptions property -- that is how I
>found this problem. Perhaps there is a better way? Thanks!

I had this problem with VET (if I am reading this right). Even though
VirtualStringTree creates an instance of TStringTreeOptions the TreeOptions
refers to TCustomVirtualTreeOptions so this sort of thing fails

if (toMyNewOptionInADerivedOptionClass in TreeOption.NewOptions) then
.....

What I did was this:

In my decendant VirtualTree create my options class (or use the
TStringTreeOptions for the VirtualStringTree):

TMyNewOption = class(TCustomVirtualTreeOptions )
NewOptions: TMyOptions;
end;

Now in the VT decendant redefine the TreeOptions to your new options type,
you must override both getting and setter to do this. Then in the Getter
type cast the inherited TreeOptions into your new Options type. Now any
reference to TreeOptions can access your new options. Note all this can be
done using the TStringTreeOptions to make a decendant access the new
options added in by TVirtualStringTree easily.

I hope this all makes sense.

Jim

TMyNewVT = class(TBaseVirtualTree)
private
function GetTreeOptions: TMyNewOption ;
procedure SetTreeOptions(const Value: TMyNewOption );
published
{override the property}
property TreeOptions: TMyNewOption
read GetTreeOptions write SetTreeOptions;
end;

function TMyNewVT .GetTreeOptions: TStringTreeOptions;
begin
Result := TMyNewOption ( inherited TreeOptions)
end;

procedure TMyNewVT .SetTreeOptions(
const Value: TStringTreeOptions);
begin
inherited TreeOptions := Value
end;


re: Options Hierarchy

From: [crcowan@a...]
Date: Mon Aug 20, 2001 1:20 am
Subject: Re: Options Hierarchy

Werner/Jim:

Thanks so much for your prompt replies. Actually what I wanted to
do was much simpler. My subclass is not yet complex enough to need
it's own options (perhaps that is in the future, though). All I
really wanted to do was, in the constructor, to set some of the
regular options provided by the parent class (a string tree). I
hadn't even bothered to create a real component (and thus expose the
properties through the form designer) and thus was setting up the
tree the way I wanted to in the constructor, like this:

.
.
.
var TempTreeOptions: TStringTreeOptions;
begin;
inherited Create(aOwner);
{ Tell the tree to allocate our additional space for every node. }
NodeDataSize:=SizeOf(TMyNodeData);
.
.
.
// and setup the tree as we like it
with self do
begin
oncolumnresize := ColumnResize;
EditDelay := 200;
TempTreeOptions := TStringTreeOptions.Create(TBaseVirtualTree
(aOwner));
try
TempTreeOptions.PaintOptions:= TempTreeOptions.PaintOptions +
[toShowHorzGridLines,toShowTreeLines,
toShowVertGridLines,toShowRoot];
TempTreeOptions.MiscOptions := TempTreeOptions.MiscOptions +
[toGridExtensions];
TreeOptions.Assign(TempTreeOptions);
finally
FreeAndNil( TempTreeOptions);
end;
.
.
.

Not too elegant but I couldn't figure any other way to do it.

(it was very easy to set the options (something like this ...
options := options + [opt1,opt2,opt3]; )
before the new option classes -- but I understand the advantages of
going this way).

Thanks again.

Charles Cowan

 | Replies | Author | Date
3545 | Re: Options Hierarchy | Jim Kueneman | Mon 8/20/2001


re: Re: Options Hierarchy

From: Jim Kueneman [jimdk@m...]
Date: Mon Aug 20, 2001 2:04 am
Subject: Re: [VirtualTreeview] Re: Options Hierarchy

At 01:20 AM 8/20/2001 +0000, you wrote:
>really wanted to do was, in the constructor, to set some of the
>regular options provided by the parent class (a string tree). I
>hadn't even bothered to create a real component (and thus expose the
>properties through the form designer) and thus was setting up the
>tree the way I wanted to in the constructor, like this:

Cowan,

The way I outlined and the way Werner implemented it in his example are
exactly what you need to do I understand:

NOTE this work becaue TVirtualStringTree creates an instance of
TStringTreeOptions by default. I think Mike should do this in
TVirtualStringTree anyway.

TMyStringTree = class(TVirtualStringTree)
private
function GetTreeOptions: TStringTreeOptions;
procedure SetTreeOptions(const Value: TStringTreeOptions);
published
property TreeOptions: TStringTreeOptions read GetTreeOptions write
SetTreeOptions;
end;

function TCustomVirtualExplorerTree.GetTreeOptions: TStringTreeOptions;
begin
Result := TStringTreeOptions( inherited TreeOptions)
end;

procedure TCustomVirtualExplorerTree.SetTreeOptions(
const Value: TStringTreeOptions);
begin
inherited TreeOptions := Value
end;

Now your assignments work directly

TreeOptions.PaintOptions:= TreeOptions.PaintOptions +
[toShowHorzGridLines,toShowTreeLines, toShowVertGridLines,toShowRoot];

TreeOptions.MiscOptions := TreeOptions.MiscOptions + [toGridExtensions];

Jim


Hints not working in 2.5.18

From: [MJLeaver@n...]
Date: Mon Aug 20, 2001 3:48 am
Subject: Hints not working in 2.5.18

Just upgraded VTree to the latest version, and now find my hints are
not working.

Unless I set HintAnimation to hatNone and HintMode to hmHint, the
hints won't even appear (ShowHint is TRUE).

When I do get them to appear, they are the wrong size and the text is
cut off. Sometimes the hint is completely empty even though I've set
the text.

Get the problem on Windows 2000 and Windows 98.

 | Replies | Author | Date
3583 | Re: Hints not working in 2.5.18 | Mike Lischke | Fri 8/24/2001


re: redraw efficiency question

From: [hnjemanze@s...]
Date: Mon Aug 20, 2001 4:54 am
Subject: Re: redraw efficiency question

Hi Werner,

Thanks for your very prompt response. While I completely agree with
your comments about the virtual philosophy of VT, in my opinion the
main purpose of the virtual implementation is to avoid having VT
store one million strings (and other app node data) if you have a
million node tree, and I don't think the virtual paradigm is broken
if it caches the strings that represent just the screen content while
it is performing refresh intensive operations. In fact I really can't
think of a reason why it might not cache all strings that are on
screen all the time. To my way of thinking that would be a better
balance of keeping the right working set of data close to the logic
that needs it, and would address the very good point you also make
about breaking the autosize and related considerations mentioned
below. The only semantics that would change would be if the client
app relied on the side effects of mouse movements and tooltip redraws
to track unreported changes in the client content, which I don't
imagine to be a design goal. I've interspersed further comments
below. Again, none of my comments are intended to pick an argument
against the way things are being done now, just to try to understand
and propose possible improvements.

Thanks, Hugh

--- In [VirtualTreeview@y...], Werner Lehmann [wl@b...] wrote:
> Hi Hugh,
>
> > For the question below I am using vt2.5.1 with C++ Builder 5,
and
> > VirtualStringTree in particular.
>
> BCB... don't you have any problems with AddChild and its default
parameter?
>
It took me a few hours of solo research to figure out how to get
2.5.1 to build and run correctly with BCB <g>.

> > My question has to do with the number of times GetText is called
> > when displaying tooltips or resizing columns. I am using VT as a
> > grid, and for example if I display 10 columns by 25 rows it takes
> > 1,000 calls to GetText to refresh the panel (apparently four calls
> > are made for each cell, I haven't studied the code yet to learn
why).
> > I am not writing to complain about this, but rather to mention
that
> > when tooltips are enabled (and the text is long enough to trigger
> > them, the entire panel is continuously repainted as the mouse
moves
> > over new tooltips, 1,000 GetText calls at a time. Also if the
columns
> > are resized by dragging the header dividers, all columns following
> > the resized column plus one column previous are continuously
> > repainted via GetText calls. In other words, if you resize column
3,
> > then columns 2 thru 10 are refreshed throughout the operation (900
> > calls per 'pixel delta' while dragging).
>
> Your observations are correct. IMO this is what the virtual
paradigm is
> about (although other people including Mike AFAIK refer to this
when they
> talk about node initialization with OnInitNode and co.). The
application
> holds the data and is asked by the tree.
>
> In a more conventional design the tree would store the strings and
the
> data. You won't get a chance to count how often the string queries
the
> strings it would store on its own. There is a good chance that the
tree
> would still need access to each string 4 times per cell.
>
> > My question is wouldn't it be more efficient to save and
restore
> > the bitmap under the tooltip for tooltip events, and also for
resize
> > events maybe a bitmap of subsequent columns could be pushed back
and
> > forth (and clipped at the panel boundary). For the previous and
> > current columns, GetText could be done once to cache a full length
> > copy of the affected strings, since those are the only ones whose
> > disply width changes during the drag to resize operation.
>
> This can be done. In theory. But there are many side effects which
have to
> be considered. For example, the previous column in your example may
have nodes
> whose text has to abbreviated (ellipsis). You won't get anywhere
with a static
> bitmap in this case. Even if you had such a bitmap you would still
have to use
> GetText to learn when the bitmap does not suffice anymore and a
fallback to
> the current way must be done.
>

I agree about not relying on bitmaps for the resize operation, but I
think a cache of the on screen strings would address those concerns
without compromising the virtualness of the tree.

> Also with column resizing, we may have an autosize column (which
may be any
> of the columns to the right of resizing column). No chance to do
this with
> a static bitmap.
>

Ditto

> With respect to the tooltip backbuffering... I see a better chance
of
> realizing this. You might want to add this to request table of the
database
> section at yahoo groups. The general problem is that we want to get
to some
> final and releasable version soon. Any new code must be written and
tested
> and delays this release.
>
> > I make these suggestions under the assumption that to maintain
the
> > highest performance we want to involve the client of the tree as
> > little as possible in these kind of interactive display operations
> > since we do not know how expensive a call to GetText might
actually
> > be (for example if it involves a network lookup). Of course the
> > implementor of the GetText call could add their own layer of
> > buffering and caching but then each app would have to reinvent a
> > solution...
>
> The tree is only displaying your data. Your data resides in your
own data
> structures and this can't be done by the tree because each app uses
different
> data structures. The tree could only cache the strings but this
would destroy
> a good deal of what the 'virtual' (in my understand of the word for
VTree)
> is all about. And it would duplicate the memory required by these
strings.
>
> You just have to hold the required infos in your own structure. And
if
> possible init this data as late as possible (via OnInitNode) to
possibly
> avoid initialization (and fetching the data) for many nodes at all.
>
> Whether the data comes via network or database, if access is too
slow for
> high frequency fetching you need to cache it on your own.
>

OK.

> > A simple way to demonstrate the behaviour I describe above is to
> > temporarily modify GetText to return the value of a counter that
> > increments on each call as it's Text value (along with enough
extra
> > static text to invoke tooltips for an appropriately sized column).
> > In my experiments it only takes a few seconds of mouse hovering
and
> > column resizing to approach a million GetText calls for a 250 cell
> > grid.
>
> I could imagine that the GetText may could be decreased by some
factor.
> During a single paint cycle per node / cell the string might be
queried
> only once and then be used as a short time cache. But Mike himself
can
> judge the chances (and consequences) of this far better.
>
> > Again, I think VirtualTreeview is incredible and I am only
making
> > these suggestions in the hope of making it even better. Please
let me
> > know if I am missing the point of how the redraw works, or if I am
> > using the grid mode incorrectly. Or maybe this has already been
> > addressed in a subsequent build or an earlier posting?
>
> Yes, there was a dicussion some time ago. There was a 18-postings
thread
> with subject 'OnGetText: Called so often only moving the focus'
starting
> on 10th of July. You can access these postings at yahoo groups.
>
> Regards,
> Werner

Best regards, Hugh

 | Replies | Author | Date
3581 | Re: redraw efficiency question | Mike Lischke | Fri 8/24/2001


XMLTree broken on 2.5.18?

From: [wvd_vegt@k...]
Date: Mon Aug 20, 2001 8:24 am
Subject: XMLTree broken on 2.5.18?

Hi,

Just a quick warning, XMLTree is broken on 2.5.18. If you change line
73 so it's derived from TVirtualStringTree instead of
TCustomVirtualStringTree it compiles again.

It has to do with the new 2.5/18 TreeOptions implementation.

----------
Wim van der Vegt


re: Coloring rows

From: "Moritz Franckenstein" [franckenstein@a...]
Date: Mon Aug 20, 2001 8:54 am
Subject: Re: Coloring rows

--- In [VirtualTreeview@y...], "Mike Lischke" [lists@l...] wrote:
> > hi, with exactly this implementation i have had the problem that
> > after some days it suddenly stopped to work. the cells were no
longer
> > colored. this happend two times until now, one time several weeks
ago
> > and one time some days ago.
>
> This sounds a bit vague. Why should this suddenly stop working?
Without more information I can't do anything.

i know, but thats all what i can tell about it. of course it was not
really suddenly, it happened after some work on the application
including installing new vt versions.

-moritz

 | Replies | Author | Date
3550 | Re: Coloring rows | Moritz Franckenstein | Mon 8/20/2001


re: Coloring rows

From: "Moritz Franckenstein" [franckenstein@a...]
Date: Mon Aug 20, 2001 9:18 am
Subject: Re: Coloring rows

> > This sounds a bit vague. Why should this suddenly stop working?
> Without more information I can't do anything.
>
> i know, but thats all what i can tell about it. of course it was
not
> really suddenly, it happened after some work on the application
> including installing new vt versions.

i have now found the problem. it was the parentcolor option in the
columns. it somehow has been changed to false... sorry...

-moritz


TreeOptions?

From: "Moritz Franckenstein" [franckenstein@a...]
Date: Mon Aug 20, 2001 10:02 am
Subject: TreeOptions?

TVirtualStringTree = class(TCustomVirtualStringTree)
published
property TreeOptions: TStringTreeOptions read GetOptions write
SetOptions;

hi mike,

i dont understand why you put this line here and not into the
custom... version. what will i have to do in my descendant to get it
to work?

i thought, everything has to be in the custom...class and this one
only publishes it.

-moritz

 | Replies | Author | Date
3554 | Re: TreeOptions? | Werner Lehmann | Mon 8/20/2001
3586 | Re: TreeOptions? | Mike Lischke | Fri 8/24/2001


New file uploaded to VirtualTreeview

From: [VirtualTreeview@yahoogroups.com>
Date: Mon Aug 20, 2001 10:24 am
Subject: New file uploaded to VirtualTreeview

Hello,

This email message is a notification to let you know that
a file has been uploaded to the Files area of the VirtualTreeview
group.

File : /Screen shots/moritz/rtl-lines-bug2.png
Uploaded by : [franckenstein@a...]
Description : this shot shows the one pixel zu weit rechts bug (#36)... can
anyone translate this into english, please :) mike, it is unchanged in 2.5.18

You can access this file at the URL

http://groups.yahoo.com/group/VirtualTreeview/files/Screen%20shots/moritz/rtl-li\
nes-bug2.png

To learn more about file sharing for your group, please visit

http://help.yahoo.com/help/us/groups/files

Regards,

franckenstein@a...]

 | Replies | Author | Date
3553 | Re: New file uploaded to VirtualTreeview | Roger Olsson | Mon 8/20/2001
3561 | Installl VT2.5.18 on D4Std | Torsten Schult | Tue 8/21/2001
3597 | Re: Installl VT2.5.18 on D4Std | Mike Lischke | Sat 8/25/2001
3601 | Re: Installl VT2.5.18 on D4Std | Jim Kueneman | Sat 8/25/2001


re: New file uploaded to VirtualTreeview

From: "Roger Olsson" [roger@f...]
Date: Mon Aug 20, 2001 12:21 pm
Subject: Re: New file uploaded to VirtualTreeview

> Description : this shot shows the one pixel zu weit rechts bug
(#36)... can anyone translate this into english, please :)

'Zu weit rechts' means 'too far to the right'

Roger

 | Replies | Author | Date
3561 | Installl VT2.5.18 on D4Std | Torsten Schult | Tue 8/21/2001
3597 | Re: Installl VT2.5.18 on D4Std | Mike Lischke | Sat 8/25/2001
3601 | Re: Installl VT2.5.18 on D4Std | Jim Kueneman | Sat 8/25/2001


re: TreeOptions?

From: Werner Lehmann [wl@b...]
Date: Mon Aug 20, 2001 12:37 pm
Subject: Re: [VirtualTreeview] TreeOptions?

Hi Moritz,

> TVirtualStringTree = class(TCustomVirtualStringTree)
> published
> property TreeOptions: TStringTreeOptions read GetOptions write
> SetOptions;
>
> hi mike,
>
> i dont understand why you put this line here and not into the
> custom... version. what will i have to do in my descendant to get it
> to work?
>
> i thought, everything has to be in the custom...class and this one
> only publishes it.

Usually correct. There is one advantage here why Mike does this different.
If I understand it correctly this is what you do if you want your own options:

- derive options class from custom options class of the ancestor (string options
class has no custom version *yet*, you need to derive from tstringtreeoptions
for the time being and cannot unpublish any base tree options)

- override GetOptionsClass and return the class type of your derived custom
options class, this is needed to enable the base tree to create an instance
of your options class

- add methods GetOptions and SetOptions like this:

function TCustomVirtualStringTreeEx.GetOptions: TVirtualTreeExOptions;
begin
result := TVirtualTreeExOptions(inherited TreeOptions);
end;

procedure TCustomVirtualStringTreeEx.SetOptions(const Value:
TVirtualTreeExOptions);
begin
(inherited TreeOptions).Assign(Value);
end;

- do NOT publish TreeOptions in your custom descendant

- to access any option including your own ones, cast TreeOptions (which is
inherited
from the base tree which has created the correct instance) to your own custom
options
class, or directly use above defined GetOptions method

- create the usual descendent from your custom tree class, publish everything
you
want and also publish TreeOptions, this time with your own getter and setter
method
defined in the custom class

The last step ensures that potential other classes, which inherit from your
custom
tree class, do not have to implicitly use your tree option getter and setter
when
they access the TreeOptions. Instead they just access the base tree TreeOptions
property
and cast it to their options class. This is compiled into a direct access to
the base
tree's FOptions field. If you would declare the TreeOptions property with your
own
options class type and getters and setters already in your custom tree class
all
descendants would have to access TreeOptions like this (pseudo code call stack):

MyXMLTree.GetOptions(CustomXMLTree.GetOptions(CustomStringTree.GetOptions(BaseTr\
ee.GetOptions)))

...compiles into

MyXMLTree.GetOptions(CustomXMLTree.GetOptions(CustomStringTree.GetOptions(FOptio\
ns)))

etc. This is avoided now. We have this instead:

MyXMLTree.GetOptions(FOptions)

Hope I could make myself clear and that this is what Mike has had in mind :)
You can
always check out my stringtree descendant on YG which demonstrates this.

Regards,
Werner


re: Re: Options Hierarchy

From: Werner Lehmann [wl@b...]
Date: Mon Aug 20, 2001 12:45 pm
Subject: Re: [VirtualTreeview] Re: Options Hierarchy

Hi Jim,

> The way I outlined and the way Werner implemented it in his example are
> exactly what you need to do I understand:
>
> NOTE this work becaue TVirtualStringTree creates an instance of
> TStringTreeOptions by default. I think Mike should do this in
> TVirtualStringTree anyway.
>
> TMyStringTree = class(TVirtualStringTree)
> private
> function GetTreeOptions: TStringTreeOptions;
> procedure SetTreeOptions(const Value: TStringTreeOptions);
> published
> property TreeOptions: TStringTreeOptions read GetTreeOptions write
> SetTreeOptions;
> end;
>
> function TCustomVirtualExplorerTree.GetTreeOptions: TStringTreeOptions;
> begin
> Result := TStringTreeOptions( inherited TreeOptions)
> end;
>
> procedure TCustomVirtualExplorerTree.SetTreeOptions(
> const Value: TStringTreeOptions);
> begin
> inherited TreeOptions := Value
> end;
>
> Now your assignments work directly
>
> TreeOptions.PaintOptions:= TreeOptions.PaintOptions +
> [toShowHorzGridLines,toShowTreeLines, toShowVertGridLines,toShowRoot];
>
> TreeOptions.MiscOptions := TreeOptions.MiscOptions + [toGridExtensions];

unless I am missing something there is no need for custom getters and setters
if the stringtree options are not to be changed. This will do in the
constructor:

with TStringTreeOptions(inherited TreeOptions) do
PaintOptions := PaintOptions + [toShowHorzGridLines,toShowTreeLines,
toShowVertGridLines,toShowRoot];
MiscOptions := MiscOptions + [toGridExtensions];

And as I explained my reply to Moritz, getter and setter in a custom tree class
can be counter productive (for example as in a TCustomVirtualExplorerTree like
above).

And if the new class inherits from TVirtualStringTree and the options still
should not
be changed there is not even a need for this cast since the TVirtualStringTree
already
has a casting getter.

Regards,
Werner

 | Replies | Author | Date
3558 | Re: Options Hierarchy | Jim Kueneman | Mon 8/20/2001


re: Feature requests (To Martin Lehmann & Helge Jung)

From: [helge@e...]
Date: Mon Aug 20, 2001 1:07 pm
Subject: Re: Feature requests (To Martin Lehmann & Helge Jung)

> In what way is this different from the properties
Colors.*Selection*?
>

You're right ... I only saw the word "Color" and didn't realized that
there were two of them *g*

My fault. Could anybody delete my entry in the db?

BTW: Why can't I edit/delete my own entries???

Helge.

 | Replies | Author | Date
3557 | Re: Feature requests (To Martin Lehmann & Helge J | Jim Kueneman | Mon 8/20/2001
3584 | Re: Feature requests (To Martin Lehmann & Helge J | Mike Lischke | Fri 8/24/2001


re: Re: Feature requests (To Martin Lehmann & Helge Jung)

From: Jim Kueneman [jimdk@m...]
Date: Mon Aug 20, 2001 1:30 pm
Subject: Re: [VirtualTreeview] Re: Feature requests (To Martin Lehmann & Helge Jung)

At 01:07 PM 8/20/2001 +0000, you wrote:
>You're right ... I only saw the word "Color" and didn't realized that
>there were two of them *g*
>
>My fault. Could anybody delete my entry in the db?

Granted

>BTW: Why can't I edit/delete my own entries???

Don't know.

Jim


re: Re: Options Hierarchy

From: Jim Kueneman [jimdk@m...]
Date: Mon Aug 20, 2001 1:36 pm
Subject: Re: [VirtualTreeview] Re: Options Hierarchy

At 02:45 PM 8/20/2001 +0200, you wrote:
>unless I am missing something there is no need for custom getters and setters
>if the stringtree options are not to be changed. This will do in the
>constructor:
>
> with TStringTreeOptions(inherited TreeOptions) do
> PaintOptions := PaintOptions + [toShowHorzGridLines,toShowTreeLines,
> toShowVertGridLines,toShowRoot];
> MiscOptions := MiscOptions + [toGridExtensions];
>
>And as I explained my reply to Moritz, getter and setter in a custom tree
>class
>can be counter productive (for example as in a TCustomVirtualExplorerTree
>like above).

The proverbial light comes on and I agree (gotta fix
TCustomVirtualExplorerTree)

BTW:

I spent half the night reworking the EasyDataObject (catchy huh <g>)
component and cut the amount of code in half, and it seems to work
still! I should have something for you to look at in a day or two.

Jim


Loading data from database

From: "Roger Olsson" [roger@f...]
Date: Mon Aug 20, 2001 9:56 pm
Subject: Loading data from database

Hi

Can someone send me an example in Delphi how to load Virtual Treeview
with data from a database? I bet someone got a small sample project
just ready to share. :-)

I know I need to read the database recursively and feed it all to the
TreeView. Its only about 1000 records so I put it all in memory. (I
use Paradox)

Roger

 | Replies | Author | Date
3560 | Re: Loading data from database | Torsten Schult | Tue 8/21/2001
3565 | Re: Loading data from database | [allen_oneill@h...] | Thu 8/23/2001


re: Loading data from database

From: Torsten Schult [Schult@P...]
Date: Tue Aug 21, 2001 8:49 am
Subject: Re: [VirtualTreeview] Loading data from database

At 21:56 20.08.01 +0000, you wrote:
>Hi
>
>Can someone send me an example in Delphi how to load Virtual Treeview
>with data from a database? I bet someone got a small sample project
>just ready to share. :-)

No, not realy ready to share but i can show you a liddle example of how to
make what you want:

The main idea is, that a (Virtual)Tree is nothing else than a List. Every
node has a parent identified by an id. Rootnodes have no parent, so that
the parent is "-1" or NIL. Because of performance you load only the
treepard that is nessesary to be displayed. If the User Opens a Node the
SubNodes will add first on this time.

The funktion to load the Nodes is very easy, it's like this:

procedure TProjectManager.getContent(Owner: Integer; OwnerNode: PVirtualNode);
var data: TMyData;
begin
if Assigned(FFIBDataset)then
begin
FFIBDataset.SelectSQL.Clear;

//load all nodes with the parent determined by Owner
FFIBDataset.SelectSQL.Add('select * from tree_Content where
Owner = '+sql(Owner)+' order by typ,name asc');
FFIBDataset.open;

FFIBDataset.first;
while not FFIBDataset.Eof do
begin
//add a node
data := VTree.GetNodeData(VTree.addChild(OwnerNode));
//fill data
data.caption :=
FFIBDataset.Fields.FieldByName('Caption').AsInteger;
//...

FFIBDataset.next;
end;

FFIBDataset.Close;
FFIBDataSet.SelectSQL.clear;
end;
end;

If you want the Root-Nodes you call the function with -1 and nil as parameter!

I hope i could help you!

bye Torsten


Installl VT2.5.18 on D4Std

From: Torsten Schult [Schult@P...]
Date: Tue Aug 21, 2001 9:02 am
Subject: Installl VT2.5.18 on D4Std

Hi,

I tried to install VT2.5.18 on D4 Standard (Update Pack 3) but I don't have
the Units: ColnEdit and StrEdit... Where can I get them?

gruss, Torsten

 | Replies | Author | Date
3597 | Re: Installl VT2.5.18 on D4Std | Mike Lischke | Sat 8/25/2001
3601 | Re: Installl VT2.5.18 on D4Std | Jim Kueneman | Sat 8/25/2001


TreeOptions (Mike...)

From: [wl@b...]
Date: Tue Aug 21, 2001 4:44 pm
Subject: TreeOptions (Mike...)

Hi Mike,

another issue with the tree options in the stringtree. A descendant
of the custom stringtree cannot publish the unchanged treeoptions
without implementing its own getter and setter even if these do all
the same as your versions in the custom stringtree. But your versions
are private and cannot be used in another unit.

I summarize the IMO needed changes to the options mechanism:
- create a custom ancestor of the string options
- GetOptionsClass should only return the custom option class (at
least if implemented in a custom tree)
- all casts (hard or dynamic) of the options should cast to the
custom options class (which is also returned by GetOptionsClass)
- in custom trees the getter and setter for the treeoptions should
be protected, not private, to allow non-custom descendants to use
these when publishing unchanged treeoptions

Very cumbersome topic... hopefully it will be solved soon. If this
is done the only flaw I can see is that a custom tree always has to
cast the treeoptions to his own options class. Its more of an
"optical" flaw though :)

Regards,
Werner

 | Replies | Author | Date
3563 | Re: TreeOptions (Mike...) | [wl@b...] | Tue 8/21/2001
3564 | Re: TreeOptions (Mike...) | [wl@b...] | Wed 8/22/2001
3598 | Re: TreeOptions (Mike...) | Mike Lischke | Sat 8/25/2001


re: TreeOptions (Mike...)

From: [wl@b...]
Date: Tue Aug 21, 2001 5:15 pm
Subject: Re: TreeOptions (Mike...)

Hi,

I must already revoke one of the points:

> - GetOptionsClass should only return the custom option class (at
> least if implemented in a custom tree)

This is wrong, it must return the 'publishing' version of the options
class. That means, your code is correct, IMO. The reason is that
descendants which have no own options and want to publish the tree
options unchanged, can do so only if the correct class instance is
created (the publishing one). Descendants which want to change the
options in any way have to override GetOptionsClass anyway.

Sorry for the confusion.

Regards,
Werner


re: TreeOptions (Mike...)

From: [wl@b...]
Date: Wed Aug 22, 2001 2:09 pm
Subject: Re: TreeOptions (Mike...)

One more thing (yes).

I cannot access the Owner of my tree options. Please add a read only
protected property:

TCustomVirtualTreeOptions = class(TPersistent)
...
protected
...
property Owner: TBaseVirtualTree read FOwner;
...
end;

Regards,
Werner


re: Loading data from database

From: [allen_oneill@h...]
Date: Thu Aug 23, 2001 3:10 am
Subject: Re: Loading data from database

Here u go...

Declare a record struct for your data (in my case its a contact list)

type
pContact = ^Contact;
Contact = Packed Record
Company : String[100];
Addr1 : string[100];
end;

Then create your header columns (in my case two)

The following I put under a button click to load it all in

procedure TForm1.Button1Click(Sender: TObject);
var
pCon : pContact;
begin

lvContacts.Clear;

lvContacts.BeginUpdate;

with table1 do
begin
open; first; EmptyTable;
append;
FieldByName('Company').AsString := 'ABC';
FieldByName('Addr1').AsString := 'ABC Addr';
post;
append;
FieldByName('Company').AsString := '123';
FieldByName('Addr1').AsString := '123 Addr';
post;
append;
FieldByName('Company').AsString := '567';
FieldByName('Addr1').AsString := '567 Addr';
post; First;
end;
// set data size

//lvContacts.RootNodeCount := 1;
lvContacts.NodeDataSize := SizeOf(Contact);
// loop thru table and add a child node for each record

while not Table1.eof do
begin
pCon := lvContacts.GetNodeData(lvContacts.AddChild(nil));
pCon.Company := Table1.FieldByName('Company').AsString;
pCon.Addr1 := Table1.FieldByName('Addr1').AsString;
Table1.Next;
end;

lvContacts.FullExpand(lvContacts.TopNode);

lvContacts.EndUpdate;

end;

Finally, to get the text from the DATA onto screen use the OnGetText
event...

procedure TForm1.lvContactsGetText(Sender: TBaseVirtualTree;
Node: PVirtualNode; Column: Integer; TextType: TVSTTextType;
var Text: WideString);
var
pCon : pContact;
begin
pCon := lvContacts.GetNodeData(Node);
if Column = 0 then
Text := pCon.Company else
if Column = 1 then
Text := pCon.Addr1
else
exit;
end;

HTH,

Allen.

--- In [VirtualTreeview@y...], "Roger Olsson" [roger@f...] wrote:
> Hi
>
> Can someone send me an example in Delphi how to load Virtual
Treeview
> with data from a database? I bet someone got a small sample project
> just ready to share. :-)
>


DBVirtualTree for Delphi?

From: "Ray" [bigsighstudios@y...]
Date: Thu Aug 23, 2001 8:03 am
Subject: DBVirtualTree for Delphi?

Hi everyone
are there any plans to convert DBVirtualTree for use with Delphi?
has anyone started work on this for their own use?
thanks
Ray Jensen
[bigsigh@o...]


AddChild vs OnInitNode

From: Kent Briggs [kbriggs@b...]
Date: Thu Aug 23, 2001 8:35 pm
Subject: AddChild vs OnInitNode

I've got an application where I'm filling a list with file names in a specified
directory. I know that OnInitNode is the
preferred way to fill a VT with data but it's more intuitive to use AddChild in
my case because I've got to run a
FindFirst/FindNext loop to fetch the filenames and putting them onto the VT in
that loop makes the most sense. The
problem is that AddChild is dog slow. It's taking 5 seconds just to add 300
nodes even inside a BeginUpdate/EndUpdate
block. How would I go about converting this routine to use OnInitNode? It
would seem to me that I would have to allocate
a global array, fill it with filenames from a FindFirst/FindNext loop, then set
RootNodeCount to my file count, then in
OnInitNode I would have to use node.index to access my global array to fetch
the data, and then somehow know when that's
all over to free up that global array. That seems like such a backassward way
of doing things that I must be missing a
more obvious way to do it.

--
Kent Briggs, [kbriggs@b...]
Briggs Softworks, http://www.briggsoft.com

 | Replies | Author | Date
3568 | Re: AddChild vs OnInitNode | Werner Lehmann | Thu 8/23/2001
3569 | Re: AddChild vs OnInitNode | Jim Kueneman | Fri 8/24/2001
3572 | Re: AddChild vs OnInitNode | Kent Briggs | Fri 8/24/2001
3573 | Re: AddChild vs OnInitNode | Jim Kueneman | Fri 8/24/2001
3589 | Re: AddChild vs OnInitNode | Kent Briggs | Fri 8/24/2001
3593 | Re: AddChild vs OnInitNode | Jim Kueneman | Sat 8/25/2001
3594 | Re: AddChild vs OnInitNode | Ariel | Sat 8/25/2001
3595 | Re: AddChild vs OnInitNode | Kent Briggs | Sat 8/25/2001
3596 | Re: AddChild vs OnInitNode | Kent Briggs | Sat 8/25/2001


re: AddChild vs OnInitNode

From: Werner Lehmann [wl@b...]
Date: Thu Aug 23, 2001 10:07 pm
Subject: Re: [VirtualTreeview] AddChild vs OnInitNode

Hi Kent,

> I've got an application where I'm filling a list with file names in a
specified directory. I know that OnInitNode is the
> preferred way to fill a VT with data but it's more intuitive to use AddChild
in my case because I've got to run a
> FindFirst/FindNext loop to fetch the filenames and putting them onto the VT
in that loop makes the most sense. The
> problem is that AddChild is dog slow. It's taking 5 seconds just to add 300
nodes even inside a BeginUpdate/EndUpdate
> block. How would I go about converting this routine to use OnInitNode? It
would seem to me that I would have to allocate
> a global array, fill it with filenames from a FindFirst/FindNext loop, then
set RootNodeCount to my file count, then in
> OnInitNode I would have to use node.index to access my global array to fetch
the data, and then somehow know when that's
> all over to free up that global array. That seems like such a backassward
way of doing things that I must be missing a
> more obvious way to do it.

a question similar to this one was the first one I asked in this forum. I was
directed to look at the advanced demo. The draw tree example also uses
FindFirst +
FindNext. It uses InitChildren to loop through the contents of a folder and add
them one by one using - AddChild(). It does not set the initialized flag though,
so that in OnInitNode a thumbnail can be created, only when needed.

I used to be a big friend of AddChild, too, until I saw how much overhead is in-
volved. Since I almost always know how many subnodes I need I can simply set the
ChildCount[] and iterate manually through all nodes.

Well, this 'backassward' way sounds not very promising. You would have to keep
the temporary list around until all items have been accessed. If you say that
AddChild is the slow part of the operation then I suggest this to add the
contents
of a filesystem folder as children to a node:

BeginUpdate;
ChildCount[Parent] := 50;
Node := Parent.FirstChild;
while (Node <> nil) and More_Files_Available do
begin
Init data of node with current file object.
Get next file.
if (Node.NextSibling = nil) and More_Files_Available then
ChildCount[Parent] := Parent.ChildCount + 50;
Node := Node.NextSibling;
end;
if Node <> nil then
ChildCount[Parent] := Node.Index;
EndUpdate;

This way you cut down the amount of AddChild's by a factor of 50 or more if you
want.

Regards,
Werner


re: AddChild vs OnInitNode

From: "Jim Kueneman" [jimdk@m...]
Date: Thu Aug 23, 2001 11:12 pm
Subject: Re: AddChild vs OnInitNode

--- In [VirtualTreeview@y...], Kent Briggs [kbriggs@b...] wrote:
> I've got an application where I'm filling a list with file names in
a specified directory. I know that OnInitNode is the
> preferred way to fill a VT with data but it's more intuitive to use
AddChild in my case because I've got to run a
> FindFirst/FindNext loop to fetch the filenames and putting them onto
the VT in that loop makes the most sense. The
> problem is that AddChild is dog slow. It's taking 5 seconds just to
add 300 nodes even inside a BeginUpdate/EndUpdate

How fast is VET in that folder?

Jim


BeginUpdate EndUpdate Problems

From: "Adam Clarke" [adam@a...]
Date: Fri Aug 24, 2001 1:18 pm
Subject: BeginUpdate EndUpdate Problems

Hi

I have a piece of code which goes through a loop adding nodes to a tree
view. The adding code is as follows

NodeToAdd := DLList.InsertNode(nil,amAddChildLast);

TheFile := DLList.GetNodeData(NodeToAdd);

Then I populate the 'TheFile' structure with details about that node. I have
nothing in OnInitNode, as this seems to work quite well.

Normal when this code is executed, the list isn't visible, so the code is
very quick. If the tree is visible, then it becomes very slow. I have tried
using BeginUpdate and EndUpdate at the start and end of my loop, but the
when the nodes are added, they appear with none of the data in 'TheFile'
filled in.

Can anyone explain why this is?

Also does anyone have any information on what the BeginUpdate and EndUpdate
actually does.

BTW. I'm using TVirtualStringTree v1.31 (Is there anywhere to download the
2.x version yet?)

Thanks

Adam Clarke

 | Replies | Author | Date
3571 | Re: BeginUpdate EndUpdate Problems | Jim Kueneman | Fri 8/24/2001
3576 | Re: BeginUpdate EndUpdate Problems | Werner Lehmann | Fri 8/24/2001


re: BeginUpdate EndUpdate Problems

From: Jim Kueneman [jimdk@m...]
Date: Fri Aug 24, 2001 2:08 pm
Subject: Re: [VirtualTreeview] BeginUpdate EndUpdate Problems

At 02:18 PM 8/24/2001 +0100, you wrote:

>BTW. I'm using TVirtualStringTree v1.31 (Is there anywhere to download the
>2.x version yet?)

I'd try the new version first.

http://groups.yahoo.com/group/VirtualTreeview/files/

Also "TheFile" implies my VirtualExplorerTree may be what you are doing:

http://groups.yahoo.com/group/VirtualExplorerTree

Jim


re: Re: AddChild vs OnInitNode

From: Kent Briggs [kbriggs@b...]
Date: Fri Aug 24, 2001 2:06 pm
Subject: Re: [VirtualTreeview] Re: AddChild vs OnInitNode

Jim Kueneman wrote:

> --- In [VirtualTreeview@y...], Kent Briggs [kbriggs@b...] wrote:
> > I've got an application where I'm filling a list with file names in
> a specified directory. I know that OnInitNode is the
> > preferred way to fill a VT with data but it's more intuitive to use
> AddChild in my case because I've got to run a
> > FindFirst/FindNext loop to fetch the filenames and putting them onto
> the VT in that loop makes the most sense. The
> > problem is that AddChild is dog slow. It's taking 5 seconds just to
> add 300 nodes even inside a BeginUpdate/EndUpdate
>
> How fast is VET in that folder?

I don't have VET installed so I haven't tried it. My test was just in my
Windows directory which has about 300
files in it. You have to do the test after a fresh boot else the cache will
affect the performance.

--
Kent Briggs, [kbriggs@b...]
Briggs Softworks, http://www.briggsoft.com

 | Replies | Author | Date
3573 | Re: AddChild vs OnInitNode | Jim Kueneman | Fri 8/24/2001


re: AddChild vs OnInitNode

From: "Jim Kueneman" [jimdk@m...]
Date: Fri Aug 24, 2001 2:55 pm
Subject: Re: AddChild vs OnInitNode

--- In [VirtualTreeview@y...], Kent Briggs [kbriggs@b...] wrote:

> I don't have VET installed so I haven't tried it. My test was just
in my Windows directory which has about 300
> files in it. You have to do the test after a fresh boot else the
cache will affect the performance.

But that is something you nor VT have control over, so is the 5
seconds after the 300 files have been read once?

The reason I asked what when developing VET I had a test folder with
about 5000 files in it to stress VET and it would enumerate that
folder in under a second on a 733Mhz after having read it once, the
first time was about significantly longer (maybe 4-5 seconds?).

I just ran a test on my D drive( which I had not accessed yet this
morning):

1Ghz Compaq 40G harddrive.
5,301 Files
511 Folders
641 MB

Time to fully populate VET (full expand)
~ 1 second (while watching clock hit '*', by the time I looked down
VET was fully expanded)

Is it string manipulation that is killing you? VET only create
TNamespace objects during the enumeration and only deals with strings
when VT requests them?

Jim


GetTreeNodeAt flaw in 2.5.18

From: [kvds@g...]
Date: Fri Aug 24, 2001 3:42 pm
Subject: GetTreeNodeAt flaw in 2.5.18

Great component :)
But there is a problem with the GetTreeNodeAt(X,Y) function, I think.
This function works normally, but when the scrollbars are shown, and
you are say, 10 nodes down, you still get the node as if the
scrollbar were all the way up.
Is there any way to get the position of the scrollbar, or do I have
to use another function if I want to translate MouseDown/Up/Move X,Y
coordinates into a node?

Thanks for your help and keep up the good work!

Koen van de Sande

 | Replies | Author | Date
3575 | Re: GetTreeNodeAt flaw in 2.5.18 | Werner Lehmann | Fri 8/24/2001
3577 | Re: GetTreeNodeAt flaw in 2.5.18 | [kvds@g...] | Fri 8/24/2001
3587 | Re: GetTreeNodeAt flaw in 2.5.18 | Mike Lischke | Fri 8/24/2001


re: GetTreeNodeAt flaw in 2.5.18

From: Werner Lehmann [wl@b...]
Date: Fri Aug 24, 2001 5:19 pm
Subject: Re: [VirtualTreeview] GetTreeNodeAt flaw in 2.5.18

Hi Koen,

> But there is a problem with the GetTreeNodeAt(X,Y) function, I think.

You must mean this function:

function TBaseVirtualTree.GetNodeAt(X, Y: Integer; Relative: Boolean; var
NodeTop: Integer): PVirtualNode;

> This function works normally, but when the scrollbars are shown, and
> you are say, 10 nodes down, you still get the node as if the
> scrollbar were all the way up.

That's what the Relative-Param is for.

> Is there any way to get the position of the scrollbar, or do I have
> to use another function if I want to translate MouseDown/Up/Move X,Y
> coordinates into a node?

You can get the scrollbar pos with properties OffsetX / OffsetY / OffsetXY.

Regards,
Werner

 | Replies | Author | Date
3577 | Re: GetTreeNodeAt flaw in 2.5.18 | [kvds@g...] | Fri 8/24/2001
3587 | Re: GetTreeNodeAt flaw in 2.5.18 | Mike Lischke | Fri 8/24/2001


re: BeginUpdate EndUpdate Problems

From: Werner Lehmann [wl@b...]
Date: Fri Aug 24, 2001 5:24 pm
Subject: Re: [VirtualTreeview] BeginUpdate EndUpdate Problems

Hi Adam,

> Also does anyone have any information on what the BeginUpdate and EndUpdate
> actually does.

Between Begin/EndUpdate (which can be nested) all drawing of the tree is
suspended. If you change the tree structure a lot (adding deleting or moving
many nodes) you call BeginUpdate before and EndUpdate after to have the change
drawn only once instead of after each single operation. Speeds up things.

Werner


re: GetTreeNodeAt flaw in 2.5.18

From: [kvds@g...]
Date: Fri Aug 24, 2001 6:12 pm
Subject: Re: GetTreeNodeAt flaw in 2.5.18

--- In [VirtualTreeview@y...], Werner Lehmann [wl@b...] wrote:
> Hi Koen,
>
> > But there is a problem with the GetTreeNodeAt(X,Y) function, I
think.
>
> You must mean this function:
>
> function TBaseVirtualTree.GetNodeAt(X, Y: Integer; Relative:
Boolean; var NodeTop: Integer): PVirtualNode;
>
> > This function works normally, but when the scrollbars are shown,
and
> > you are say, 10 nodes down, you still get the node as if the
> > scrollbar were all the way up.
>
> That's what the Relative-Param is for.
>

> > Is there any way to get the position of the scrollbar, or do I
have
> > to use another function if I want to translate MouseDown/Up/Move
X,Y
> > coordinates into a node?
>
> You can get the scrollbar pos with properties OffsetX / OffsetY /
OffsetXY.
>
> Regards,
> Werner

Right. Relative-Param. Perhaps it should be in the help file, what
these parameters actually do? Or perhaps I should think about what
the parameters should do, before asking ;)

But thanks very much for your help! Now I can continue my program
(which is going to rely a lot on VirtualTreeView :)

Koen

 | Replies | Author | Date
3587 | Re: GetTreeNodeAt flaw in 2.5.18 | Mike Lischke | Fri 8/24/2001


re: Redraw problem in large trees during keyboard scrolling

From: "Mike Lischke" [lists@l...]
Date: Fri Aug 24, 2001 6:58 pm
Subject: RE: [VirtualTreeview] Redraw problem in large trees during keyboard scrolling

Hi Werner,

> You are kidding and not incompetent, I hope :)

This is my way of expressing how it sounds when I beat my head with the hand ;-)

>I cannot say that
> I understand why missing validation caused these delays (although the
connection OI <-> DFM is
> clear) but as long as it works...

Very simple: with "validation" I meant the validation of the node cache which
is crucial for the
speed. With about 5000 or more nodes painting and navigation gets really slow
(you can see this with
the socalled RapidTree or FlyTree which suffer from this problem).

> Hey, this wasn't meant to be a general bashing on the mem manager. And btw,
recently I checked out
> an alternative mem manager (from www.optimalcode.com, that site is to be
recommended too,
> but you'll probably know it already). Without code change I got a speedup of
15% at very string
> intensive operations.

Yep, I know the site, but I wasn't there recently. Seems it is time to visit it
again. Thank you for
mentioning it.

Ciao, Mike


re: Tree options in descendants

From: "Mike Lischke" [lists@l...]
Date: Fri Aug 24, 2001 6:58 pm
Subject: RE: [VirtualTreeview] Tree options in descendants

Hi Werner,

> There is only one issue left: without a TCustom* ancestor of the string
options there
> is no way to inherit from the (custom) string tree and *not* publish some of
the base
> tree options. And the hardcasts in lines 24160 + 24396 and the dynamic cast
in line
> 24328 should be changed to the TCustom* string options descendant (which is
to be added
> IMO). All this custom / published stuff is annoying, I know that, but still
important.

Somehow I missed the point to republish TreeOptions in the custom string tree
instead of the string
tree. This was also the reason why I needed the type casts. This is now fixed.

Ciao, Mike

PS: I also made the owner of the options public as you requested in another
post.


re: Initialization of StandardOLEFormat and ActiveForms

From: "Mike Lischke" [lists@l...]
Date: Fri Aug 24, 2001 6:58 pm
Subject: RE: [VirtualTreeview] Initialization of StandardOLEFormat and ActiveForms

Hi Adrian,

> The problem I'm having is that when you have an ActiveX working
> inside Internet explorer and the user press 'Refresh', the full
> activeform is reloaded, but the global variables (the ones defined
> with "var xx: yy = zz ' are NOT re-initialized.

This report is very interesting. I always told people not to double the work
the compiler does when
using initialized variables because it is guaranteed they have their values on
startup. Does your
report mean that we no longer can rely on this fact? This would be a quite
serious matter then.

What I don't understand is how a DLL/OCX can be reloaded without getting also
initialized (which
means to load its image from physical storage, which in turn means to restore
global memory
objects). What happens in your case? Can you make sure the problem comes from
not reinitialized
variables? Btw. when it is only the StandardOLEFormat then it should not matter
because only one
field is changed and this field is always set before the structure is used.

Ciao, Mike

 | Replies | Author | Date
3619 | Re: Initialization of StandardOLEFormat and Activ | [agallero@n...] | Mon 8/27/2001
3649 | Re: Initialization of StandardOLEFormat and Activ | Mike Lischke | Tue 9/4/2001


re: Re: redraw efficiency question

From: "Mike Lischke" [lists@l...]
Date: Fri Aug 24, 2001 6:58 pm
Subject: RE: [VirtualTreeview] Re: redraw efficiency question

Hi Hugh,

> it is performing refresh intensive operations. In fact I really can't
> think of a reason why it might not cache all strings that are on
> screen all the time.

Simply because the application is responsible for its data and has to cache the
text anyway
somewhere. Why adding another layer of complexity which has to be kept in synch
with scrolling etc.?
Because of the variable node height and auto sizing etc. it is difficult to
know the exact number of
strings which must be cached at every given moment. And this number may vary
greatly depending on
how the tree is scrolled. If the application manages its tree strings carefully
(e.g. not rebuilding
them with Format(..) all the time) then there will be only marginal anticipated
speed improvements.
Well, on average there would likely be some improvements but I doubt they
justify this extra
implementation.

Ciao, Mike


re: Bug fix report

From: "Mike Lischke" [lists@l...]
Date: Fri Aug 24, 2001 6:58 pm
Subject: RE: [VirtualTreeview] Bug fix report

Hi Jim,

> Before doing anything hasty here I am using the RootNode to store data
> so try not to mess me up <g>.

Don't worry. I doubt you will even realized that something has changed there
(unless I produced a
hidden bug ...).

Ciao, Mike


re: Hints not working in 2.5.18

From: "Mike Lischke" [lists@l...]
Date: Fri Aug 24, 2001 6:58 pm
Subject: RE: [VirtualTreeview] Hints not working in 2.5.18

> When I do get them to appear, they are the wrong size and the text is
> cut off. Sometimes the hint is completely empty even though I've set
> the text.

Sorry, my fault. This is fixed now. Btw: please enter bug reports into the bug
list table in the
database area of the mailing list on YG.

Ciao, Mike


re: Re: Feature requests (To Martin Lehmann & Helge Jung)

From: "Mike Lischke" [lists@l...]
Date: Fri Aug 24, 2001 6:58 pm
Subject: RE: [VirtualTreeview] Re: Feature requests (To Martin Lehmann & Helge Jung)

> My fault. Could anybody delete my entry in the db?
> BTW: Why can't I edit/delete my own entries???

Because I want to avoid that by accident somebody deletes an entry which does
not belong to him.
Unfortunately, the system does only allow global granting or revoking the right
to delete.

Ciao, Mike


re: Options Hierarchy

From: "Mike Lischke" [lists@l...]
Date: Fri Aug 24, 2001 6:58 pm
Subject: RE: [VirtualTreeview] Options Hierarchy

Hi C.R.

> By the way, I am particularly interested in multi-line text
> capability

Yes, this is already in the wish list. The main problem is that single line
text must be aligned
vertically but multiline text cannot (without expensive preprocessing of the
text). So I'm still not
sure how to make this both possible.

> (there should probably be an option to allow the nodes
> to grow to accomodate the text, or to allow the user to set the size
> with the mouse and have the text truncate). That would be wonderful.

Automatic growing is difficult because this would require to resize the tree
during the paint event
(slow down, side effects etc.). Using ellipsises to indicate truncation if
there is not enough room
should be much easier.

> against TVirtualTreeOptions rather than TCustomVirtualTreeOptions. I
> changed the code as follows and I think this fixed the problem:
>
> procedure TCustomVirtualTreeOptions.AssignTo(Dest: TPersistent);
>
> begin
> // if Dest is TVirtualTreeOptions then {CRC Change}
> if Dest is TCustomVirtualTreeOptions then

Thank you for letting me know. This was indeed wrong and your fix is OK. I have
changed it this way.

Ciao, Mike


re: TreeOptions?

From: "Mike Lischke" [lists@l...]
Date: Fri Aug 24, 2001 6:58 pm
Subject: RE: [VirtualTreeview] TreeOptions?

> i dont understand why you put this line here and not into the
> custom... version. what will i have to do in my descendant to get it
> to work?

You are totally right. My fault and fixed already.

Ciao, Mike


re: Re: GetTreeNodeAt flaw in 2.5.18

From: "Mike Lischke" [lists@l...]
Date: Fri Aug 24, 2001 7:09 pm
Subject: RE: [VirtualTreeview] Re: GetTreeNodeAt flaw in 2.5.18

> Right. Relative-Param. Perhaps it should be in the help file, what
> these parameters actually do? Or perhaps I should think about what
> the parameters should do, before asking ;)

You are right. I'm already working on the new docs.

> But thanks very much for your help! Now I can continue my program
> (which is going to rely a lot on VirtualTreeView :)

Seems to be a general tendency :-) In my company we replace more and more stuff
with VT (including
grids and list boxes). And judging by the fact that we already sold > 900000
copies of our main
products this year which use VT as the main navigation control without getting
much complains about
instability I can proudly say VT is rock solid on every Win32 system.

Ciao, Mike


New file uploaded to VirtualTreeview

From: [VirtualTreeview@yahoogroups.com>
Date: Fri Aug 24, 2001 7:20 pm
Subject: New file uploaded to VirtualTreeview

Hello,

This email message is a notification to let you know that
a file has been uploaded to the Files area of the VirtualTreeview
group.

File : /VirtualTree_2.5.21.zip
Uploaded by : [lists@l...]
Description : Beta version

You can access this file at the URL

http://groups.yahoo.com/group/VirtualTreeview/files/VirtualTree_2.5.21.zip

To learn more about file sharing for your group, please visit

http://help.yahoo.com/help/us/groups/files

Regards,

lists@l...]


re: Re: AddChild vs OnInitNode

From: Kent Briggs [kbriggs@b...]
Date: Fri Aug 24, 2001 8:39 pm
Subject: Re: [VirtualTreeview] Re: AddChild vs OnInitNode

Jim Kueneman wrote:

> --- In [VirtualTreeview@y...], Kent Briggs [kbriggs@b...] wrote:
>
> > I don't have VET installed so I haven't tried it. My test was just
> in my Windows directory which has about 300
> > files in it. You have to do the test after a fresh boot else the
> cache will affect the performance.
>
> But that is something you nor VT have control over, so is the 5
> seconds after the 300 files have been read once?

I first read all the file data in a findfirst/findnext loop and store the info
in my own array. This takes no time at all even in
my Windows dir. I then start a separate loop inside a beginupdate block and
add my nodes using the data from my own array and
AddChild. This part is taking the 5 seconds on the first run and about 1.5
seconds on subsequent runs.

> Is it string manipulation that is killing you? VET only create
> TNamespace objects during the enumeration and only deals with strings
> when VT requests them?

Beats me. My node data structure looks like this:

TTreeData = record
path: string;
name: string;
alias: string;
size: int64;
attr: string[5];
isdir: boolean;
modified,accessed,created: string;
nimage,simage: integer;
compressed: boolean;
end;

--
Kent Briggs, [kbriggs@b...]
Briggs Softworks, http://www.briggsoft.com

 | Replies | Author | Date
3593 | Re: AddChild vs OnInitNode | Jim Kueneman | Sat 8/25/2001


Bug entries

From: "Mike Lischke" [lists@l...]
Date: Fri Aug 24, 2001 8:51 pm
Subject: Bug entries

Question/comments to some bug entries:

#39 Is this still an issue or can I mark this as not a bug after I found what I
wrote you?

#40 Did you perhaps modify a node's size in OnInitNode?

#41 (Please keep the description to the minimum. Reasons can be discussed in
the list). DefaultNodeHeight affects only new nodes, not already existing nodes.

Ciao, Mike

 | Replies | Author | Date
3607 | Re: Bug entries | Wim van der Vegt | Sun 8/26/2001
3651 | Re: Bug entries | Mike Lischke | Tue 9/4/2001
3625 | Re: Bug entries | [hj_schnorrenberg@y...] | Tue 8/28/2001


re: Redraw problem in large trees during keyboard scrolling

From: [anders@t...]
Date: Fri Aug 24, 2001 9:25 pm
Subject: Re: [VirtualTreeview] Redraw problem in large trees during keyboard scrolling

Hi Mike,
Is the redrawing problem Werner had, supposed to be fixed in the new
version?

I'm asking since I still have a very annoying painting problem with
the tree when using about 8000 nodes.
The error only happens when all the nodes are visible, and the
problem is excatly like the demo I send you a long time ago (don't
know if you remember).
In the demo the problem was, that it used ReInitNode(nil, true) and
the OnInitNode to determine wether or not the node should be visible.
This is not what I'm doing now.
I'm using begin/endupdate and in there I iterate through all the
nodes.
But the effect is the same as in the demo I send you.
If you wan't I can resend you the demo. Or else maybe we can work
something else out.

Regards,
Anders Thomsen

 | Replies | Author | Date
3599 | Re: Redraw problem in large trees during keyboard | Mike Lischke | Sat 8/25/2001


re: Tree options in descendants

From: Werner Lehmann [wl@b...]
Date: Fri Aug 24, 2001 10:43 pm
Subject: Re: [VirtualTreeview] Tree options in descendants

Hi Mike,

> > There is only one issue left: without a TCustom* ancestor of the string
options there
> > is no way to inherit from the (custom) string tree and *not* publish some
of the base
> > tree options. And the hardcasts in lines 24160 + 24396 and the dynamic cast
in line
> > 24328 should be changed to the TCustom* string options descendant (which is
to be added
> > IMO). All this custom / published stuff is annoying, I know that, but still
important.
>
> Somehow I missed the point to republish TreeOptions in the custom string tree
instead of the string
> tree. This was also the reason why I needed the type casts. This is now fixed.

Big hm. I really believed that you did that intentionally. I don't know if you
read my
other posting in this thread, and especially the PS. But if you do it like in
.21 we
have a potentially deep GetOptions chain with each TreeOptions access. For a
direct
descendant of the string tree this is already 3 functions calls deep without
much work
in each of the functions (just casts). With .18 I could access the TreeOptions
from the
base tree directly (getter is an immediate FOptions) and avoid that chain.
Anyhow, maybe
this is not interesting on today GHz CPU's.

But there is another problem (I already mentioned but you silently ignored it,
and also ignored
my detailed explanation in thread "TreeOptions?" which is a let down but I put
this in the no-time
category).

If I inherit from the string tree I can only publish all tree options or none.
I don't under-
stand why you use a custom option class for the base tree options but not for
the string
tree options. I don't need to hide any options desperately, now, but why
challenge destiny
and potential future demand unnecessarily.

> PS: I also made the owner of the options public as you requested in another
post.

Thank you.

Werner

 | Replies | Author | Date
3600 | Re: Tree options in descendants | Mike Lischke | Sat 8/25/2001


re: Re: AddChild vs OnInitNode

From: Jim Kueneman [jimdk@m...]
Date: Sat Aug 25, 2001 1:14 am
Subject: Re: [VirtualTreeview] Re: AddChild vs OnInitNode

At 03:39 PM 8/24/2001 -0500, you wrote:
>Beats me. My node data structure looks like this:
>
>TTreeData = record
> path: string;
> name: string;
> alias: string;
> size: int64;
> attr: string[5];
> isdir: boolean;
> modified,accessed,created: string;
> nimage,simage: integer;
> compressed: boolean;
> end;

What are nimage and simage? Are they the system image list indexes? They
can be *sloooow* Are you filling every entry during the FindFirst/FindNext
loop? I would do the FindFirst/FindNext for the expanding node in the
OnInitChildren event, make a copy of the Win32_Find_Data and store it with
each new node then return the number of files. Then in the OnInitNode take
the info from the Win32_Find_Data and fill in the above record. That the
minimal amout of work is being done during the loop and the time consuming
work is done only when the node is first displayed.

Jim


re: AddChild vs OnInitNode

From: "Ariel" [asel98@y...]
Date: Sat Aug 25, 2001 1:42 am
Subject: Re: AddChild vs OnInitNode

why u dont use VirtualExplorerTree?


re: Re: AddChild vs OnInitNode

From: Kent Briggs [kbriggs@b...]
Date: Sat Aug 25, 2001 4:17 am
Subject: Re: [VirtualTreeview] Re: AddChild vs OnInitNode

Jim Kueneman wrote:

> What are nimage and simage? Are they the system image list indexes? They
> can be *sloooow*

Doh! That was it. Nevermind, it's fetching those image indexes that's the
bottleneck, not so much AddChild. I'm using
VT in two modes, similar to how Windows Explorer has a folder tree on the left
and a file list on the right. The file
list doesn't have child nodes so OnInitChildren wouldn't apply there but I'll
look for other ways to speed up my loop with
the image indexes. Thanks for the help.

--
Kent Briggs, [kbriggs@b...]
Briggs Softworks, http://www.briggsoft.com


re: Re: AddChild vs OnInitNode

From: Kent Briggs [kbriggs@b...]
Date: Sat Aug 25, 2001 4:20 am
Subject: Re: [VirtualTreeview] Re: AddChild vs OnInitNode

Ariel wrote:

> why u dont use VirtualExplorerTree?

I'm building my own file manager. It's actually an upgrade to an existing
shareware program (File
Maven 95).

--
Kent Briggs, [kbriggs@b...]
Briggs Softworks, http://www.briggsoft.com


re: Installl VT2.5.18 on D4Std

From: "Mike Lischke" [lists@l...]
Date: Sat Aug 25, 2001 10:25 am
Subject: RE: [VirtualTreeview] Installl VT2.5.18 on D4Std

Hi Torsten,

> I tried to install VT2.5.18 on D4 Standard (Update Pack 3) but I don't have
> the Units: ColnEdit and StrEdit... Where can I get them?

Really? They do not exist in D4? If not then I would have to create a separate
registration unit (to
avoid nesting conditional defines too much) and you would loose some design
time support. Is anybody
on this list who can confirm that those units (in D4 Standard) are missing? How
about D4
professional and C/S?

Ciao, Mike

 | Replies | Author | Date
3601 | Re: Installl VT2.5.18 on D4Std | Jim Kueneman | Sat 8/25/2001


re: TreeOptions (Mike...)

From: "Mike Lischke" [lists@l...]
Date: Sat Aug 25, 2001 10:25 am
Subject: RE: [VirtualTreeview] TreeOptions (Mike...)

Hi Werner,

> another issue with the tree options in the stringtree. A descendant
> of the custom stringtree cannot publish the unchanged treeoptions
> without implementing its own getter and setter even if these do all
> the same as your versions in the custom stringtree. But your versions
> are private and cannot be used in another unit.

This problem should now be gone. The custom string tree defines its TreeOptions
property as being
TCustomStringTreeOptions with appropriate setter and getter methods. The string
tree then redeclares
this property to being TStringTreeOptions (also with own getter and setter
methods). If you have a
descentant of TCustomVirtualStringTree and want to publish the custom options
unchanged then simply
list them in its published section. Publishing the base options class in such a
descentant is not
possible and also makes no sense since the string tree needs the string options
for some tasks.

> - create a custom ancestor of the string options

Done.

> - GetOptionsClass should only return the custom option class (at
> least if implemented in a custom tree)

Done. This required however that I have now for each tree class own getter and
setter to have the
correct class used for TreeOptions.

> - all casts (hard or dynamic) of the options should cast to the
> custom options class (which is also returned by GetOptionsClass)

Gone. There are now only (dynamic) casts in the getter and AssignTo methods.

> - in custom trees the getter and setter for the treeoptions should
> be protected, not private, to allow non-custom descendants to use
> these when publishing unchanged treeoptions

This should not be necessary (see comment above).

> Very cumbersome topic... hopefully it will be solved soon. If this
> is done the only flaw I can see is that a custom tree always has to
> cast the treeoptions to his own options class. Its more of an
> "optical" flaw though :)

With the current implementation no cast must be done anymore unless I
overlooked something
important.

Ciao, Mike


re: Redraw problem in large trees during keyboard scrolling

From: "Mike Lischke" [lists@l...]
Date: Sat Aug 25, 2001 10:25 am
Subject: RE: [VirtualTreeview] Redraw problem in large trees during keyboard scrolling

Anders,

> Is the redrawing problem Werner had, supposed to be fixed in the new
> version?

I don't know what paint problem you mean. You see me very surprised that there
is any at all.

> If you wan't I can resend you the demo. Or else maybe we can work
> something else out.

Yes, please send me the demo. I will have a look what's going on there.

Ciao, Mike


re: Tree options in descendants

From: "Mike Lischke" [lists@l...]
Date: Sat Aug 25, 2001 10:26 am
Subject: RE: [VirtualTreeview] Tree options in descendants

Werner,

> Big hm. I really believed that you did that intentionally.

Yes, of course I had my reasons to do as I did, but the concept was still not
fully developed so I
implemented in wrong.

>I don't know if you read my
> other posting in this thread, and especially the PS. But if you do it like in
.21 we
> have a potentially deep GetOptions chain with each TreeOptions access.

Yes I read all the mails, but I don't know why you partout want to call the
inherited methods. This
is not necessary as long as I can directly access the FOptions member of the
base class. If this
becomes a problem (I'm just porting my company's lib to D6 and found some
warnings about access to
private members not being compatible with BCB) then I can either move FOptions
to the protected
section or (my preferred solution) add another dummy property (protected). The
last one is preferred
because it does not add any overhead (except the one declaration) as the access
is internally
resolved to direct access of the member variable.

> But there is another problem (I already mentioned but you silently ignored
it, and also ignored
> my detailed explanation in thread "TreeOptions?" which is a let down but I
put this in
> the no-time category).

I'm sorry if I caused bad feeling here, but some messages have been delayed and
answered later and I
also thougth that this large thread was all about the same matter. In such
cases I only keep a key
message to reply to but still answer to the whole thread.

> If I inherit from the string tree I can only publish all tree options or
none. I don't under-
> stand why you use a custom option class for the base tree options but not for
the string
> tree options. I don't need to hide any options desperately, now, but why
challenge destiny
> and potential future demand unnecessarily.

I know, you took all 5 fingers when I gave you one :o] This problem should now
be fixed. Please
check the latest source again (tomorrow, I want to change a few more things).

Ciao, Mike


re: Installl VT2.5.18 on D4Std

From: Jim Kueneman [jimdk@m...]
Date: Sat Aug 25, 2001 12:32 pm
Subject: RE: [VirtualTreeview] Installl VT2.5.18 on D4Std

At 12:25 PM 8/25/2001 +0200, you wrote:
>Hi Torsten,
>
> > I tried to install VT2.5.18 on D4 Standard (Update Pack 3) but I don't have
> > the Units: ColnEdit and StrEdit... Where can I get them?
>
>Really? They do not exist in D4? If not then I would have to create a
>separate registration unit (to
>avoid nesting conditional defines too much) and you would loose some
>design time support. Is anybody
>on this list who can confirm that those units (in D4 Standard) are
>missing? How about D4
>professional and C/S?

I asked this question (about StrEdit) on the Delphi newsgroups and no one
answered, so I am still at a loss about it in D4 standard.

Jim


re: Installl VT2.5.18 on D4Std

From: "Colin Meeks" [colin@p...]
Date: Sat Aug 25, 2001 12:38 pm
Subject: Re: [VirtualTreeview] Installl VT2.5.18 on D4Std

I actually brought this up ages ago. Both units are not part of Delphi 4,
meaning you cannot install. I'm using D4 C/S.

Colin

----- Original Message -----
From: "Mike Lischke" [lists@l...]
To: <VirtualTreeview@yahoogroups.com>
Sent: Saturday, August 25, 2001 6:25 AM
Subject: RE: [VirtualTreeview] Installl VT2.5.18 on D4Std

> Hi Torsten,
>
> > I tried to install VT2.5.18 on D4 Standard (Update Pack 3) but I don't
have
> > the Units: ColnEdit and StrEdit... Where can I get them?
>
> Really? They do not exist in D4? If not then I would have to create a
separate registration unit (to
> avoid nesting conditional defines too much) and you would loose some
design time support. Is anybody
> on this list who can confirm that those units (in D4 Standard) are
missing? How about D4
> professional and C/S?
>
> Ciao, Mike
>
>
>
> To unsubscribe from this group, send an email to:
> VirtualTreeview-unsubscribe@egroups.com
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>
>

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.273 / Virus Database: 143 - Release Date: 16/08/2001

 | Replies | Author | Date
3606 | Re: Installl VT2.5.18 on D4Std | Mike Lischke | Sun 8/26/2001
3608 | Re: Installl VT2.5.18 on D4Std | Marco Klemm | Sun 8/26/2001
3648 | Re: Installl VT2.5.18 on D4Std | Mike Lischke | Tue 9/4/2001


ScrollBar refresh

From: "Ariel" [asel98@y...]
Date: Sat Aug 25, 2001 9:51 pm
Subject: ScrollBar refresh

hello,

suppose u have too many nodes, that use more than the height of the
control; if u change the visible state to false of too many nodes...
the scrollbar keeps the last size (doesnt refresh).
i think theres a problem with the refresh of the scrollbar, because
that, and because if u use .text[node,c] for some reason (im trying
find why) when u finish the endupdate, the scrollbar refresh each
time a node is updated. i mean, u change the visible state of all the
nodes to false. then u change it to true (for each node). btw
beginupdate and endupdate,... the scrollbar shows u how VT is
updating every node, so the scrolls start at the top, and moves until
the bottom.
im not sure, but it seams vt is updating the scrollbar for each node,
and the scrollbar is refreshing the control each time.

tnx

note: sorry for the english...

 | Replies | Author | Date
3604 | Re: ScrollBar refresh | Ariel | Sat 8/25/2001
3605 | Re: ScrollBar refresh | Mike Lischke | Sun 8/26/2001


re: ScrollBar refresh

From: "Ariel" [asel98@y...]
Date: Sat Aug 25, 2001 11:34 pm
Subject: Re: ScrollBar refresh

my fault... i were using vsVisible... and not IsVisible[].
btw theres any way to use vsVisible, and then get a refresh. beacuse
isvisible[] expands all the tree. :(

thanks

--- In [VirtualTreeview@y...], "Ariel" [asel98@y...] wrote:
> hello,
>


re: ScrollBar refresh

From: "Mike Lischke" [lists@l...]
Date: Sun Aug 26, 2001 8:05 am
Subject: RE: [VirtualTreeview] ScrollBar refresh

Hi Ariel,

> suppose u have too many nodes, that use more than the height of the
> control; if u change the visible state to false of too many nodes...
> the scrollbar keeps the last size (doesnt refresh).
> i think theres a problem with the refresh of the scrollbar, because
> that, and because if u use .text[node,c] for some reason (im trying
> find why) when u finish the endupdate, the scrollbar refresh each
> time a node is updated.

I'm sorry, but I'm not sure I understood you correctly. Do you try to say that
you have called
BeginUpdate, then modfied the visible state of many nodes and finally called
EndUpdate and that when
modifying the visibility of the nodes the tree is still updated for each change?

If yes then you see me a bit perplex. The code definately uses the update count
as switch. Can you
describe the problem at more detail or send me a little demo showing the effect?

Ciao, Mike


re: Installl VT2.5.18 on D4Std

From: "Mike Lischke" [lists@l...]
Date: Sun Aug 26, 2001 8:16 am
Subject: RE: [VirtualTreeview] Installl VT2.5.18 on D4Std

Hi Colin,

> I actually brought this up ages ago. Both units are not part of Delphi 4,
> meaning you cannot install. I'm using D4 C/S.

I'm sorry. I have already forgotten this fact. Do you know whether there are
alternative
packages/units which could be used? Somehow it must be possible to execute the
collection editor. If
not, would you please be so kind and create and test a D4 only registration
unit?

Ciao, Mike


re: Bug entries

From: "Wim van der Vegt" [wvd_vegt@k...]
Date: Sun Aug 26, 2001 10:33 am
Subject: Re: [VirtualTreeview] Bug entries

Hi,

#41 DefaultNodeHeight affects only new nodes, not already existing nodes.

Not totally true, if you increment Rootnodecount in the property editor it
stays the same for all nodes, old and new.

Wim van der Vegt

 | Replies | Author | Date
3651 | Re: Bug entries | Mike Lischke | Tue 9/4/2001


re: Installl VT2.5.18 on D4Std

From: Marco Klemm [DonLuigi@g...]
Date: Sun Aug 26, 2001 11:00 am
Subject: Re: [VirtualTreeview] Installl VT2.5.18 on D4Std

Hi Mike

Mike Lischke wrote:
>
> Hi Colin,
>
> > I actually brought this up ages ago. Both units are not part of Delphi 4,
> > meaning you cannot install. I'm using D4 C/S.
>
> I'm sorry. I have already forgotten this fact. Do you know whether there are
> alternative packages/units which could be used? Somehow it must be possible
> to execute the collection editor. If not, would you please be so kind and
> create and test a D4 only registration unit?

The unit "colnedit" is defined in dclstd40.dcp that has to be inserted
manually in the required-list of the registration package.

Ciao, Marco

 | Replies | Author | Date
3648 | Re: Installl VT2.5.18 on D4Std | Mike Lischke | Tue 9/4/2001


A Fake Root Node

From: [subscribedlists@b...]
Date: Sun Aug 26, 2001 11:34 am
Subject: A Fake Root Node

Often nil is passed as the parent node to event handlers. I want to
create a fake root node that I can use in these cases, however how do
I create the fake node? Using create/free doesn't work because of
the way the data section is added.

How do I create and allocate memory for this fake node and its data
area? The node is never shown on the tree. I just want to use it
like so:

if ParentNode <> nil then
LocalParentNode := FakeRootNode
else
LocalParentNode := ParentNode;

Making a local ParentNode works well for some of my algorithms, I
need to make tests on the root node's data area which I intend to
stuff with useful data. Any ideas on how to implement a local global
substitute root node that can have its data area filled like normal
nodes? Any help on memory allocation/deallocation would be
appreciated.

 | Replies | Author | Date
3610 | Re: A Fake Root Node | [subscribedlists@b...] | Sun 8/26/2001
3611 | Re: A Fake Root Node | Mike Lischke | Sun 8/26/2001


re: A Fake Root Node

From: [subscribedlists@b...]
Date: Sun Aug 26, 2001 11:46 am
Subject: Re: A Fake Root Node

> if ParentNode <> nil then

Sorry, this should be "=" and not "<>". I think you can get the idea
of what I wish to do. I'm just having a memory allocation problem.

Thanks,

Doug


re: A Fake Root Node

From: "Mike Lischke" [lists@l...]
Date: Sun Aug 26, 2001 1:14 pm
Subject: RE: [VirtualTreeview] A Fake Root Node

Doug,

> Often nil is passed as the parent node to event handlers. I want to
> create a fake root node that I can use in these cases, however how do
> I create the fake node? Using create/free doesn't work because of
> the way the data section is added.

Have you already considered using the built-in root node? You can access it via
Tree.RootNode. You
should keep in mind however that using a fake node might produce serious
trouble if you use it with
the tree.

Ciao, Mike


SetFocus

From: "Ariel" [asel98@y...]
Date: Mon Aug 27, 2001 1:11 am
Subject: SetFocus

in:
procedure TBaseVirtualTree.HandleMouseDown(var Message: TWMMouse;
const HitInfo: THitInfo);
.
.
.
// focus change
if not IsFocused then
begin
SetFocus;
IsFocused := Focused;
end;
.
.
.

if u use VT in a DropDownWindow type, Setfocus makes some problems...
can u use add a "Try ... finnaly end;" to solve them. (?)

tnx

 | Replies | Author | Date
3613 | Re: SetFocus | Ariel | Mon 8/27/2001
3652 | Re: SetFocus | Mike Lischke | Tue 9/4/2001
3653 | Re: SetFocus | Ariel | Tue 9/4/2001


re: SetFocus

From: "Ariel" [asel98@y...]
Date: Mon Aug 27, 2001 1:23 am
Subject: Re: SetFocus

or better...
if CanFocus then
SetFocus;


Tree/GridLineColor and lmBands

From: "Moritz Franckenstein" [franckenstein@a...]
Date: Mon Aug 27, 2001 9:12 am
Subject: Tree/GridLineColor and lmBands

hi mike,

is it true that you agreed to change the painting of the bands so
that only GridLineColor ist used for both types of lines?

if yes, it doesnt work. if no, also :)

-moritz

 | Replies | Author | Date
3616 | Re: Tree/GridLineColor and lmBands | [wvd_vegt@k...] | Mon 8/27/2001
3617 | Re: Tree/GridLineColor and lmBands | [wvd_vegt@k...] | Mon 8/27/2001
3650 | Re: Tree/GridLineColor and lmBands | Mike Lischke | Tue 9/4/2001
3618 | Re: Tree/GridLineColor and lmBands | Werner Lehmann | Mon 8/27/2001
3622 | Re: Tree/GridLineColor and lmBands | Wim van der Vegt | Mon 8/27/2001


XMLTree 2.5.21 bug

From: [wvd_vegt@k...]
Date: Mon Aug 27, 2001 10:39 am
Subject: XMLTree 2.5.21 bug

Hi,

Got a strange exception in the latest version of XMLTree (2.5.21) in
the TXMLTree.DoBeforeCellPaint routine. Ind:=-Indent generates a
Integer overflow error on my w2k machine.

So I changed :

begin Inc(CellRect.Left, Ind); Ind:= -Indent; end;

into :

begin Inc(CellRect.Left, Ind); Ind:= -1*Indent; end;

and the bug dissapeared.

Wim van der Vegt

 | Replies | Author | Date
3620 | Re: XMLTree 2.5.21 bug | Moritz Franckenstein | Mon 8/27/2001
3621 | Re: XMLTree 2.5.21 bug | [wvd_vegt@k...] | Mon 8/27/2001
3623 | Re: XMLTree 2.5.21 bug | Moritz Franckenstein | Mon 8/27/2001
3624 | Re: XMLTree 2.5.21 bug | Wim van der Vegt | Mon 8/27/2001


re: Tree/GridLineColor and lmBands

From: [wvd_vegt@k...]
Date: Mon Aug 27, 2001 11:23 am
Subject: Re: Tree/GridLineColor and lmBands

Hi,

Something has gone wrong i guess, so a piece of PaintTreeLines:

case FLineMode of
lmBands:
..code ommitted
PaintInfo.Canvas.Font.Color := FColors.TreeLineColor;
..code ommitted
end;
end;
else // lmBands
PaintInfo.Canvas.Font.Color := FColors.GridLineColor;
..code ommitted

It's exactly the wrong way. I guess the treelines get the gridcolor.

Even after swapping the colors, the Treelinecolor only seems to show
up around the buttons, not the dotted treelines themselves.

Tracing it further down i get into the DrawDottedH/VLine where the
color of the control is taken together with a FDottedBrush which
seems to be responsible the 2nd color. Changing the brush color in
DrawDottedH/VLine shows the color but also grey in between. After
that i'm stuck with tracing the phenomena.

Guess my simple request turns out to be a lot more work than
expected.

Wim van der Vegt

 | Replies | Author | Date
3617 | Re: Tree/GridLineColor and lmBands | [wvd_vegt@k...] | Mon 8/27/2001
3650 | Re: Tree/GridLineColor and lmBands | Mike Lischke | Tue 9/4/2001


re: Tree/GridLineColor and lmBands

From: [wvd_vegt@k...]
Date: Mon Aug 27, 2001 11:47 am
Subject: Re: Tree/GridLineColor and lmBands

Hi,

I finnaly found what goes wrong with the tree/gridlines in lmbands
mode. Besides some problems during debugging caused by an old
xmltreetest source that resets the treeline color it turns out that

a) the color assignment in PaintTreeLines is indeed swapped

b) in both DrawDOttedH/Vline the with statement is :

with PaintInfo, Canvas do

and should read :

with PaintInfo, PaintInfo.Canvas do

This way the color is taken from the wrong canvas (The PaintInfo
canvas is assigned the correct color).

Wim van der Vegt

 | Replies | Author | Date
3650 | Re: Tree/GridLineColor and lmBands | Mike Lischke | Tue 9/4/2001


re: Re: Tree/GridLineColor and lmBands

From: Werner Lehmann [wl@b...]
Date: Mon Aug 27, 2001 1:12 pm
Subject: Re: [VirtualTreeview] Re: Tree/GridLineColor and lmBands

Wim,

I have reported this bug already two days ago and according to the database
on YG it is fixed for 2.5.22.

Werner

 | Replies | Author | Date
3622 | Re: Tree/GridLineColor and lmBands | Wim van der Vegt | Mon 8/27/2001


re: Initialization of StandardOLEFormat and ActiveForms

From: [agallero@n...]
Date: Mon Aug 27, 2001 1:43 pm
Subject: Re: Initialization of StandardOLEFormat and ActiveForms

--- In [VirtualTreeview@y...], "Mike Lischke" [lists@l...] wrote:
>Does your
> report mean that we no longer can rely on this fact? This would be
a quite serious matter then.

Hi Mike,

I agree with you it is a strange thing. I first noticed with my
forms (I had them declared in the intefece of the units and called
"if formxx=nil then formxx:=TFormxx.Create" whenever I needed them)
Well, after a refresh all of them would give access errors, and it
was because the form had been destroyed, but the var formxx had not
been reset to nil.

Then I moved all the declararions inside another objects as private
members (for example if forma uses formb, I would declare formb as a
member of forma), and everything went ok... except for the virtual
string grids that continued to raise AV in timed intervals. Since I
added the initialization I told you, I have had no more problems.

I can't assert this problem exists with all the versions of ie and
windows, but with my configuration (win2000, ie5, d5), surely
happens, and its easy to see.

1) Create an active form
2) put this code in the implementation:

implementation
uses ComObj, ComServ;
{$R *.DFM}
var
ptn:pointer=nil;

3) drop a button at the form, and add this line

procedure TACTV.Button1Click(Sender: TObject);
begin
if Ptn=nil then showmessage('Nil - ok') else showmessage('not nil-
not ok');
getmem(ptn,10);
end;

4) Push the button and press refresh as many times as you want -
at least in my computer it never displays the message('Nil - Ok')
again.

If you want me to send this activeform as an attachment, please tell
me where and I will.

> What I don't understand is how a DLL/OCX can be reloaded without
getting also initialized (which
> means to load its image from physical storage, which in turn means
to restore global memory
> objects). What happens in your case? Can you make sure the problem
comes from not reinitialized
> variables?

I think the problem is just that. The image is not reloaded from
physical storage. Just the program pointer is reset to start again,
but the initialized data remains. Of course, it only affects global
vars, because all the vars declared inside an object will be
reinitializated in TObject.Create.

Btw. when it is only the StandardOLEFormat then it should not matter
because only one
> field is changed and this field is always set before the structure
is used.

Not sure about this, but I believe that maybe the 'ptd' member of
TFormatEtc does not reset to nil, and point to a memory no longer
exists. My problems really finished when I initialized that var.

Best regards and thanks for you time,
Adrian.

 | Replies | Author | Date
3649 | Re: Initialization of StandardOLEFormat and Activ | Mike Lischke | Tue 9/4/2001


re: XMLTree 2.5.21 bug

From: "Moritz Franckenstein" [franckenstein@a...]
Date: Mon Aug 27, 2001 2:00 pm
Subject: Re: XMLTree 2.5.21 bug

--- In [VirtualTreeview@y...], [wvd_vegt@k...] wrote:
> Hi,
>
> Got a strange exception in the latest version of XMLTree (2.5.21)
in
> the TXMLTree.DoBeforeCellPaint routine. Ind:=-Indent generates a
> Integer overflow error on my w2k machine.
>
> So I changed :
>
> begin Inc(CellRect.Left, Ind); Ind:= -Indent; end;
>
> into :
>
> begin Inc(CellRect.Left, Ind); Ind:= -1*Indent; end;
>
> and the bug dissapeared.
>
> Wim van der Vegt

that is really strange. i think, it didnt happen on my machine,
because range checking was off.

btw. i have it always off, because i think, it could make problems.
what do you think?

i think, i will change the line into
Ind:= -Integer(Indent);

but could you please find out what value has been in indent when it
happened? i dont understand this bug.

-moritz

 | Replies | Author | Date
3621 | Re: XMLTree 2.5.21 bug | [wvd_vegt@k...] | Mon 8/27/2001
3623 | Re: XMLTree 2.5.21 bug | Moritz Franckenstein | Mon 8/27/2001
3624 | Re: XMLTree 2.5.21 bug | Wim van der Vegt | Mon 8/27/2001


re: XMLTree 2.5.21 bug

From: [wvd_vegt@k...]
Date: Mon Aug 27, 2001 2:54 pm
Subject: Re: XMLTree 2.5.21 bug

--- In [VirtualTreeview@y...], "Moritz Franckenstein"
[franckenstein@a...] wrote:
> --- In [VirtualTreeview@y...], [wvd_vegt@k...] wrote:
> > Hi,
> >
> > Got a strange exception in the latest version of XMLTree (2.5.21)
> in
> > the TXMLTree.DoBeforeCellPaint routine. Ind:=-Indent generates a
> > Integer overflow error on my w2k machine.
> >
> > So I changed :
> >
> > begin Inc(CellRect.Left, Ind); Ind:= -Indent; end;
> >
> > into :
> >
> > begin Inc(CellRect.Left, Ind); Ind:= -1*Indent; end;
> >
> > and the bug dissapeared.
> >
> > Wim van der Vegt
>
>
> that is really strange. i think, it didnt happen on my machine,
> because range checking was off.

See below.

> btw. i have it always off, because i think, it could make problems.
> what do you think?

I always leave it on, together with all the other checks. I seldomly
need the performance and like see as much errors during
compiling/runtime.

I also use a routine that gives a postmortem stackdump (exceptional
magic), so i (have to) leave somewhat stripped td32 debugging info in
as well (together with outputdebugstring code etc).

Reasons are that my software is very low volume (high priced though ;-
)) and i want to give the customer a better feeling than a non
descript access violation. Besides that if they mail me the
postmortem i can repair bugs very quickly. I leave outputdebugstrings
(and my private mailslot based stuff in) so i can instruct customers
to run a monitor and report whats going on in the software.

I also intend do a standard code coverage again (to find the dusty
corners in the code). Perhaps it's an idea for VT too as i can't
imagine 900k of code to be alive and kicking.

> i think, i will change the line into
> Ind:= -Integer(Indent);

Should do too i guess.

> but could you please find out what value has been in indent when it
> happened? i dont understand this bug.

The ident was standard 18.

> -moritz


re: Re: Tree/GridLineColor and lmBands

From: "Wim van der Vegt" [wvd_vegt@k...]
Date: Mon Aug 27, 2001 2:57 pm
Subject: RE: [VirtualTreeview] Re: Tree/GridLineColor and lmBands

Hi,

Sorry i missed it (the e-group databases are not very user-friendly).

Wim van der Vegt

-----Original Message-----
From: [sentto-2425673-3619-998918047-wvd_vegt=knoware.nl@r...]
[mailto:[sentto-2425673-3619-998918047-wvd_vegt=knoware.nl@r...]
m]On Behalf Of Werner Lehmann
Sent: maandag 27 augustus 2001 15:12
To: VirtualTreeview@yahoogroups.com
Subject: Re: [VirtualTreeview] Re: Tree/GridLineColor and lmBands

Wim,

I have reported this bug already two days ago and according to the database
on YG it is fixed for 2.5.22.

Werner

Yahoo! Groups Sponsor

To unsubscribe from this group, send an email to:
VirtualTreeview-unsubscribe@egroups.com

Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


re: XMLTree 2.5.21 bug

From: "Moritz Franckenstein" [franckenstein@a...]
Date: Mon Aug 27, 2001 3:06 pm
Subject: Re: XMLTree 2.5.21 bug

> but could you please find out what value has been in indent when it
> happened? i dont understand this bug.

i have enabled overflow checking now and it happens here also... the
value of indent was 18. i dont understand how -18 cannot fit into an
integer...

it is fixed and uploaded now... there was also another bug...

-moritz

 | Replies | Author | Date
3624 | Re: XMLTree 2.5.21 bug | Wim van der Vegt | Mon 8/27/2001


re: Re: XMLTree 2.5.21 bug

From: "Wim van der Vegt" [wvd_vegt@k...]
Date: Mon Aug 27, 2001 3:35 pm
Subject: RE: [VirtualTreeview] Re: XMLTree 2.5.21 bug

Hi,

I guess when you look into the assembler code generated the 'integer'
typecast is performed after a unsigned integer (cardinal) is negated. I
havn't seen this type of errors for a long time (since the good old days
that is ;-) so am equally surpised. This are very nasty bugs if they show up
in production code....

------
Wim van der Vegt

-----Original Message-----
From: [sentto-2425673-3624-998925659-wvd_vegt=knoware.nl@r...]
[mailto:[sentto-2425673-3624-998925659-wvd_vegt=knoware.nl@r...]
m]On Behalf Of Moritz Franckenstein
Sent: maandag 27 augustus 2001 17:06
To: VirtualTreeview@yahoogroups.com
Subject: [VirtualTreeview] Re: XMLTree 2.5.21 bug

> but could you please find out what value has been in indent when it
> happened? i dont understand this bug.

i have enabled overflow checking now and it happens here also... the
value of indent was 18. i dont understand how -18 cannot fit into an
integer...

it is fixed and uploaded now... there was also another bug...

-moritz

Yahoo! Groups Sponsor

To unsubscribe from this group, send an email to:
VirtualTreeview-unsubscribe@egroups.com

Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.

[Non-text portions of this message have been removed]


re: Bug entries

From: [hj_schnorrenberg@y...]
Date: Tue Aug 28, 2001 4:09 pm
Subject: Re: Bug entries

> #39 Is this still an issue or can I mark this as not a bug after I
found what I wrote you?

I will write a testprogram, and will try to find a solution (At the
moment I have a little bit stress, but I promise, I do not forget
this problem!)

Hans-Jürgen Schnorrenberg


VirtualTreeView as Grid with AutosizeRow?

From: [ur@i...]
Date: Thu Aug 30, 2001 2:59 pm
Subject: VirtualTreeView as Grid with AutosizeRow?

Hi,
I wonder if it is possible to use VirtualTreeView as a StringGrid
with an AutoRowSize feature, means to make the whole multiline
content of each cell in a row visible by adjusting the row height.

Anyone knows?

Best regards
Uwe Raabe


Vacation

From: "Mike Lischke" [lists@l...]
Date: Thu Aug 30, 2001 7:52 pm
Subject: Vacation

Hi all,

just to let you know so nobody wonders: I'm not online until sunday evening.
Have a nice weekend.

Ciao, Mike


VirtualTree as a ListView

From: [JirkaHajek@s...]
Date: Fri Aug 31, 2001 8:44 am
Subject: VirtualTree as a ListView

Hi,

I would like to use VirtualTree in my application not just as a tree,
but also as a ListView with FullRowSelect option. It works quite
well, but there are some problems:

- when dragging an item, the background image gets corrupted
- dragging starts just when the mouse pointer is on a text, if it's
on unused part of a row, it starts rectangular selecting instead
- when an item is dragged and mouse is on another item, it gets
focus and because full row is selected the whole thing is a little
bit confusing (for example Dropmark is hidden because of the full row
selection)

Thank you for your help,
Jiri Hajek

 | Replies | Author | Date
3629 | Re: VirtualTree as a ListView | Jim Kueneman | Fri 8/31/2001
3630 | Re: VirtualTree as a ListView | Jiri Hajek | Fri 8/31/2001
3631 | Re: VirtualTree as a ListView | Werner Lehmann | Fri 8/31/2001
3643 | Re: VirtualTree as a ListView | Jiri Hajek | Tue 9/4/2001
3644 | Re: VirtualTree as a ListView | Werner Lehmann | Tue 9/4/2001
3645 | Re: VirtualTree as a ListView | Jiri Hajek | Tue 9/4/2001


re: VirtualTree as a ListView

From: Jim Kueneman [jimdk@m...]
Date: Fri Aug 31, 2001 1:01 pm
Subject: Re: [VirtualTreeview] VirtualTree as a ListView

At 08:44 AM 8/31/2001 +0000, you wrote:
>Hi,
>
>I would like to use VirtualTree in my application not just as a tree,
>but also as a ListView with FullRowSelect option. It works quite
>well, but there are some problems:
>
> - when dragging an item, the background image gets corrupted
> - dragging starts just when the mouse pointer is on a text, if it's
>on unused part of a row, it starts rectangular selecting instead
> - when an item is dragged and mouse is on another item, it gets
>focus and because full row is selected the whole thing is a little
>bit confusing (for example Dropmark is hidden because of the full row
>selection)

What version are you using? The latest is 2.5.21 at

http://groups.yahoo.com/group/VirtualTreeview/files/

I know that this was screwy until just a few versions ago

Jim

 | Replies | Author | Date
3630 | Re: VirtualTree as a ListView | Jiri Hajek | Fri 8/31/2001


re: VirtualTree as a ListView

From: "Jiri Hajek" [JirkaHajek@s...]
Date: Fri Aug 31, 2001 2:07 pm
Subject: RE: [VirtualTreeview] VirtualTree as a ListView

> >I would like to use VirtualTree in my application not just as a tree,
> >but also as a ListView with FullRowSelect option. It works quite
> >well, but there are some problems:
> >
> > - when dragging an item, the background image gets corrupted
> > - dragging starts just when the mouse pointer is on a text, if it's
> >on unused part of a row, it starts rectangular selecting instead
> > - when an item is dragged and mouse is on another item, it gets
> >focus and because full row is selected the whole thing is a little
> >bit confusing (for example Dropmark is hidden because of the full row
> >selection)
>
> What version are you using? The latest is 2.5.21 at
>
> http://groups.yahoo.com/group/VirtualTreeview/files/
>
> I know that this was screwy until just a few versions ago

Yes, I use the newest version (2.5.21), but there are still the problems
described above.

Jiri


re: VirtualTree as a ListView

From: Werner Lehmann [wl@b...]
Date: Fri Aug 31, 2001 4:18 pm
Subject: Re: [VirtualTreeview] VirtualTree as a ListView

Hi Jiri,

> - when dragging an item, the background image gets corrupted

did not notice this one but there is another problem: VCL dragging from
another control of the VTree smears on the VTree.

> - dragging starts just when the mouse pointer is on a text, if it's
> on unused part of a row, it starts rectangular selecting instead

This one is by design (on my request). I wanted to keep drag selection.
But if every click (even not on node text) starts a drag there can not
be a drag selection. Thus we have this agreement: drag start on node text
(and icon), draw selection on empty part of node.

> - when an item is dragged and mouse is on another item, it gets
> focus and because full row is selected the whole thing is a little
> bit confusing (for example Dropmark is hidden because of the full row
> selection)

I do not really understand this one. Maybe I'll check it out tonight or
tomorrow...

Regards,
Werner

 | Replies | Author | Date
3643 | Re: VirtualTree as a ListView | Jiri Hajek | Tue 9/4/2001


VST Cloning

From: "Frank van den Bergh" [frankvdbergh@y...]
Date: Sat Sep 1, 2001 6:54 pm
Subject: VST Cloning

Hi To you all,

Does someone know what the best way is to make a clone of a tree?

Do I have to use Assign, CopyTo, SaveToStream, or is there another
option?

Thanks in advance,

Frank van den Bergh

 | Replies | Author | Date
3633 | Re: VST Cloning | [kvds@g...] | Sat 9/1/2001
3634 | Re: VST Cloning | [helge@e...] | Sat 9/1/2001
3637 | Re: VST Cloning | Frank van den Bergh | Sun 9/2/2001
3638 | Re: VST Cloning | [subscribedlists@b...] | Mon 9/3/2001
3647 | Re: VST Cloning | Frank van den Bergh | Tue 9/4/2001
3635 | Re: VST Cloning | Ariel | Sat 9/1/2001
3636 | Re: VST Cloning | Jim Kueneman | Sun 9/2/2001


re: VST Cloning

From: [kvds@g...]
Date: Sat Sep 1, 2001 8:26 pm
Subject: Re: VST Cloning

--- In [VirtualTreeview@y...], "Frank van den Bergh"
[frankvdbergh@y...] wrote:
> Hi To you all,
>
> Does someone know what the best way is to make a clone of a tree?
>
> Do I have to use Assign, CopyTo, SaveToStream, or is there another
> option?
>
> Thanks in advance,
>
> Frank van den Bergh

I think it's Assign. But I'm no expert, this is the first time I'm
answering a question on VT.
I'm not really sure if the NodeData is copied too. (has to be... but
don't know for certain)

Koen

 | Replies | Author | Date
3634 | Re: VST Cloning | [helge@e...] | Sat 9/1/2001
3637 | Re: VST Cloning | Frank van den Bergh | Sun 9/2/2001
3638 | Re: VST Cloning | [subscribedlists@b...] | Mon 9/3/2001
3647 | Re: VST Cloning | Frank van den Bergh | Tue 9/4/2001


re: VST Cloning

From: [helge@e...]
Date: Sat Sep 1, 2001 9:24 pm
Subject: Re: VST Cloning

> I think it's Assign.

It's not. It results in an invalid typecast - and an AV when closing
the form (I just checked it out).

> But I'm no expert, this is the first time I'm answering a question
on VT.

There's always a first time ... doesn't matter if it's wrong or
right - we all make mistakes (but we should learn from them) *g*

Helge.

 | Replies | Author | Date
3637 | Re: VST Cloning | Frank van den Bergh | Sun 9/2/2001
3638 | Re: VST Cloning | [subscribedlists@b...] | Mon 9/3/2001
3647 | Re: VST Cloning | Frank van den Bergh | Tue 9/4/2001


re: VST Cloning

From: "Ariel" [asel98@y...]
Date: Sat Sep 1, 2001 11:08 pm
Subject: Re: VST Cloning

where is the "real" data?
i mean, how u fill it for first time?

just do it again...

note: if u only need to move it, change the parent.
hth

--- In [VirtualTreeview@y...], "Frank van den Bergh"
[frankvdbergh@y...] wrote:
> Hi To you all,
>
> Does someone know what the best way is to make a clone of a tree?
>
> Do I have to use Assign, CopyTo, SaveToStream, or is there another
> option?
>
> Thanks in advance,
>
> Frank van den Bergh


re: VST Cloning

From: "Jim Kueneman" [jimdk@m...]
Date: Sun Sep 2, 2001 2:02 am
Subject: Re: VST Cloning

--- In [VirtualTreeview@y...], "Frank van den Bergh"
[frankvdbergh@y...] wrote:
> Hi To you all,
>
> Does someone know what the best way is to make a clone of a tree?
>
> Do I have to use Assign, CopyTo, SaveToStream, or is there another
> option?

I would say savetostream/readfromstream since that is what it is for,
saving the tree to disk so it can be recreated. Just use a
TMemoryStream and try it.

Jim


re: VST Cloning

From: "Frank van den Bergh" [frankvdbergh@y...]
Date: Sun Sep 2, 2001 8:53 am
Subject: Re: VST Cloning

Hi Jim, Koen, Ariel and Helge

Thanks for your replies.

Basically I have two treeviews on different forms.

The suggestion of reloading the data is -of course- possible, just
like LoadFromStream/SaveToStream. But like all programmers I am
wondering what the most efficient way is. About using the Assign I
got an error as well.

The suggestion of sharing the Parent sounds good (I trust you mean
RootNode), however its property is ReadOnly.

Looking further,

Frank.

 | Replies | Author | Date
3638 | Re: VST Cloning | [subscribedlists@b...] | Mon 9/3/2001
3647 | Re: VST Cloning | Frank van den Bergh | Tue 9/4/2001


re: VST Cloning

From: [subscribedlists@b...]
Date: Mon Sep 3, 2001 6:33 pm
Subject: Re: VST Cloning

> The suggestion of sharing the Parent sounds good (I trust you mean
> RootNode), however its property is ReadOnly.

Remember that everything you *see* in windows is a window. Every
window has a parent which is where it will be drawn. If only one
form is visible at a time then you should be able to move the parent
property to the area on the other form.

Just remember two things. Firstly ownership is different from being a
parent. Owners will delete the owned object while being destroyed
themselves, parents will not. Parentage is only about where the
visible object will be drawn on the screen. Second, you might want to
place the VST on a separate form or frame and just pop the parent of
the form/frame into whatever form is visible at the time. Then the
attached combo boxes or other items can move from form to form on-the-
fly also.

later.....

Doug

 | Replies | Author | Date
3647 | Re: VST Cloning | Frank van den Bergh | Tue 9/4/2001


Column Text Alignment

From: [uefsilencer@g...]
Date: Mon Sep 3, 2001 6:37 pm
Subject: Column Text Alignment

Hi,
is it possible to change the alignment of the column text?

I tried it with "Columns[x].Alignment := taRightJustify", but it
doesn't work.

Silencer.

 | Replies | Author | Date
3640 | Re: Column Text Alignment | [helge@e...] | Mon 9/3/2001
3641 | Re: Column Text Alignment | [uefsilencer@g...] | Mon 9/3/2001
3642 | Re: Column Text Alignment | Jim Kueneman | Tue 9/4/2001


re: Column Text Alignment

From: [helge@e...]
Date: Mon Sep 3, 2001 6:58 pm
Subject: Re: Column Text Alignment

> is it possible to change the alignment of the column text?

I can't see your problem. In property
TVirtualStringTree.Header.Columns you can set an Alignment for each
column - and the column title and the data is drawn as set in the
Alignment property. Setting the property at runtime is no problem,
too.

Do you try to draw your columns/cells yourself? Then you have to take
care of that, of course. But I can't see the necessity for drawing
cells by hand either.

Helge.

 | Replies | Author | Date
3641 | Re: Column Text Alignment | [uefsilencer@g...] | Mon 9/3/2001
3642 | Re: Column Text Alignment | Jim Kueneman | Tue 9/4/2001


re: Column Text Alignment

From: [uefsilencer@g...]
Date: Mon Sep 3, 2001 7:09 pm
Subject: Re: Column Text Alignment

--- In [VirtualTreeview@y...], [helge@e...] wrote:
> > is it possible to change the alignment of the column text?
>
> I can't see your problem. In property
> TVirtualStringTree.Header.Columns you can set an Alignment for each
> column - and the column title and the data is drawn as set in the
> Alignment property. Setting the property at runtime is no problem,
> too.
>
> Do you try to draw your columns/cells yourself? Then you have to
take
> care of that, of course. But I can't see the necessity for drawing
> cells by hand either.
>
> Helge.

Here's the source:

Procedure TForm1.FormCreate(Sender : TObject);
Begin
StringTree.Header.Columns[0].Alignment:=taRightJustify;
End;

If I try to compile it, Delphi says that "Alignment" is an undeclared
identifier.

Cya, Silencer.

 | Replies | Author | Date
3642 | Re: Column Text Alignment | Jim Kueneman | Tue 9/4/2001


re: Re: Column Text Alignment

From: Jim Kueneman [jimdk@m...]
Date: Tue Sep 4, 2001 1:30 am
Subject: Re: [VirtualTreeview] Re: Column Text Alignment

At 07:09 PM 9/3/2001 +0000, you wrote:

>If I try to compile it, Delphi says that "Alignment" is an undeclared
>identifier.

Hi Silencer,

This compiles for me (and works), are you using the newest beta version?

http://groups.yahoo.com/group/VirtualTreeview

in the files area.

Jim


re: VirtualTree as a ListView

From: "Jiri Hajek" [JirkaHajek@s...]
Date: Tue Sep 4, 2001 8:20 am
Subject: RE: [VirtualTreeview] VirtualTree as a ListView

Hi Werner,

I will try to describe my problems in more details.

> > - when dragging an item, the background image gets corrupted
>
> did not notice this one but there is another problem: VCL dragging from
> another control of the VTree smears on the VTree.

When I drag a node that is shown then as a transparent bitmap under the
mouse pointer, the background bitmap is not redrawn properly. Seems that
horizontal offset is calculated correctly, but the redrawed part of
background is vertically misaligned. It is solved just when the whole
background bitmap is redrawn.

> > - dragging starts just when the mouse pointer is on a text, if it's
> > on unused part of a row, it starts rectangular selecting instead
>
> This one is by design (on my request). I wanted to keep drag selection.
> But if every click (even not on node text) starts a drag there can not
> be a drag selection. Thus we have this agreement: drag start on node text
> (and icon), draw selection on empty part of node.

Actually you are right, that's what TListView does. However there is another
problem: when FullRowSelected options is set, draw selection selects just
nodes whose text falls into the selection, while in TListView it selects all
nodes which are at least partially covered by the selection.

> > - when an item is dragged and mouse is on another item, it gets
> > focus and because full row is selected the whole thing is a little
> > bit confusing (for example Dropmark is hidden because of the full row
> > selection)
>
> I do not really understand this one. Maybe I'll check it out tonight or
> tomorrow...

Shortly, when I drag a node, another node, that is currently under the mouse
pointer, is focused. Possibly it is on purpose, but I see it as a problem,
because:
- it hides dragged bitmap
- it hides Dropmark (when the option for showing it is on)

Best regards,
Jiri


re: VirtualTree as a ListView

From: Werner Lehmann [wl@b...]
Date: Tue Sep 4, 2001 9:16 am
Subject: Re: [VirtualTreeview] VirtualTree as a ListView

Hi Jiri,

> When I drag a node that is shown then as a transparent bitmap under the
> mouse pointer, the background bitmap is not redrawn properly. Seems that
> horizontal offset is calculated correctly, but the redrawed part of
> background is vertically misaligned. It is solved just when the whole
> background bitmap is redrawn.

I can confirm that problem. I should have said that the reason why I did not
notice that one is because I do not use a background image.

You should add this bug to the bug database on yahoo groups.

> Actually you are right, that's what TListView does. However there is another
> problem: when FullRowSelected options is set, draw selection selects just
> nodes whose text falls into the selection, while in TListView it selects all
> nodes which are at least partially covered by the selection.

Hm. I did not compare with a fullrowselect listview. But in VTree with f.r.s.
a node is selected during draw selection when it is partially within the
selection
rectangle. At least in my tests. So what is the problem?

> Shortly, when I drag a node, another node, that is currently under the mouse
> pointer, is focused. Possibly it is on purpose, but I see it as a problem,
> because:
> - it hides dragged bitmap
> - it hides Dropmark (when the option for showing it is on)

The 'other' node is not focused (or do you receive a focus change event?), this
is the droptarget node visualization. And it is done on purpose, yes. I do not
experience that the dragimage is being hidden. And also, the dropmark is visible
when you drag on an empty space (e.g. to the right of the node text). But that
is usual behaviour which you also get without f.r.s. The only difference that
I can see is that even with f.r.s. the droptarget is not full row selected when
the drag cursor is node on a node text. Still, this is consistent with the usual
dropmark behaviour.

Werner

 | Replies | Author | Date
3645 | Re: VirtualTree as a ListView | Jiri Hajek | Tue 9/4/2001


re: VirtualTree as a ListView

From: "Jiri Hajek" [JirkaHajek@s...]
Date: Tue Sep 4, 2001 10:45 am
Subject: RE: [VirtualTreeview] VirtualTree as a ListView

Hi Werner,

> Hm. I did not compare with a fullrowselect listview. But in VTree
> with f.r.s.
> a node is selected during draw selection when it is partially
> within the selection
> rectangle. At least in my tests. So what is the problem?

Possibly I did something wrong, but I have the same results both with
fullrowselect or without it - a node is selected if at least part of the
text in the first column is in the selection. However I think that in
fullrowselect case the node should be selected when any part of any of its
columns is within the selection. Am I wrong?

> The 'other' node is not focused (or do you receive a focus change
> event?), this
> is the droptarget node visualization. And it is done on purpose,
> yes. I do not
> experience that the dragimage is being hidden. And also, the
> dropmark is visible
> when you drag on an empty space (e.g. to the right of the node
> text). But that
> is usual behaviour which you also get without f.r.s. The only
> difference that
> I can see is that even with f.r.s. the droptarget is not full row
> selected when
> the drag cursor is node on a node text. Still, this is consistent
> with the usual
> dropmark behaviour.

I think that I have some problems in terminology and can't explain exactly
the idea. I will check it on my home computer and send a better description
(possibly with a small screenshot) later.

Best regards,
Jiri


Drag and Drop

From: [walter_falby@c...]
Date: Tue Sep 4, 2001 3:38 pm
Subject: Drag and Drop

I am new to this group, so this may be an old question. I have an
application with multiple columns in a treeview. I want to select a
column other than the item name and still perform a drag and drop
operation. I saw that in the demo for this control that this works.
Where in the source code is this done? I downloaded what I believed
to be the source, but I am unsure. The files have a PAS extension.
Thanks for your help.

Walter

 | Replies | Author | Date
3665 | Re: Drag and Drop | Mike Lischke | Sat 9/8/2001


re: VST Cloning

From: "Frank van den Bergh" [frankvdbergh@y...]
Date: Tue Sep 4, 2001 8:02 pm
Subject: Re: VST Cloning

Thanks Doug,

I followed your suggestion of changing the parent control. Costs me
some work (event handlers, gettext, etc). BUT it works ok.

Frank.


re: Installl VT2.5.18 on D4Std

From: "Mike Lischke" [lists@l...]
Date: Tue Sep 4, 2001 8:12 pm
Subject: RE: [VirtualTreeview] Installl VT2.5.18 on D4Std

> The unit "colnedit" is defined in dclstd40.dcp that has to be inserted
> manually in the required-list of the registration package.

I have this change already, but perhaps I forgot to update the Delphi 4 design
time package in the
release zip. This is now done. Additionally, Vadim sent me some more code and
suggestions to make VT
better working in D4. This has also been included.

Ciao, Mike


re: Re: Initialization of StandardOLEFormat and ActiveForms

From: "Mike Lischke" [lists@l...]
Date: Tue Sep 4, 2001 8:12 pm
Subject: RE: [VirtualTreeview] Re: Initialization of StandardOLEFormat and ActiveForms

Hi Adrian,

> Btw. when it is only the StandardOLEFormat then it should not matter
> because only one field is changed and this field is always set before the
structure
> is used.
>
> Not sure about this, but I believe that maybe the 'ptd' member of
> TFormatEtc does not reset to nil, and point to a memory no longer
> exists. My problems really finished when I initialized that var.

I think the main problem is that you assume that a refresh in IE does reload
all DLLs (and OCXes are
also DLLs). But this is not the case, only the page is reloaded, the DLL remain
in memory (e.g. the
initialization section is also not called on refresh).

Btw: the ptd member is not used in VT, so I don't know where it could get
modified.

Ciao, Mike


re: Re: Tree/GridLineColor and lmBands

From: "Mike Lischke" [lists@l...]
Date: Tue Sep 4, 2001 8:12 pm
Subject: RE: [VirtualTreeview] Re: Tree/GridLineColor and lmBands

Hi Wim,

> a) the color assignment in PaintTreeLines is indeed swapped

This is already fixed.

> b) in both DrawDOttedH/Vline the with statement is :
> with PaintInfo, Canvas do
>
> and should read :
>
> with PaintInfo, PaintInfo.Canvas do

This should not be necessary since the with statement is cascading. This means
Canvas is taken from
the first structure which supports it looking "up" at this point. And the first
structure is
PaintInfo. I have successfully used this behavior throughout VT.

But the bands painting works now anyway...

Ciao, Mike


re: Bug entries

From: "Mike Lischke" [lists@l...]
Date: Tue Sep 4, 2001 8:12 pm
Subject: RE: [VirtualTreeview] Bug entries

Hi Wim,

> #41 DefaultNodeHeight affects only new nodes, not already existing nodes.
>
> Not totally true, if you increment Rootnodecount in the property editor it
> stays the same for all nodes, old and new.

Not with the code I have. I set a new default node height and when I increase
the root node count
then the new nodes get the new height. Only existing nodes stay as high as they
are.

Ciao, Mike


re: SetFocus

From: "Mike Lischke" [lists@l...]
Date: Tue Sep 4, 2001 8:12 pm
Subject: RE: [VirtualTreeview] SetFocus

Hi Ariel,

> // focus change
> if not IsFocused then
> begin
> SetFocus;
> IsFocused := Focused;
> end;
> if u use VT in a DropDownWindow type, Setfocus makes some problems...
> can u use add a "Try ... finnaly end;" to solve them. (?)

Mmmh, I'm not at all in favour of this solution. When a simple SetFocus call
makes problems which
cause an exception then I think these problems should be worked out as they
must be quite serious.
Simply fixing the result instead the cause is not a good practice I think.

Ciao, Mike

 | Replies | Author | Date
3653 | Re: SetFocus | Ariel | Tue 9/4/2001


re: SetFocus

From: "Ariel" [asel98@y...]
Date: Tue Sep 4, 2001 8:55 pm
Subject: Re: SetFocus

i posted other reply after that, saying a solution:
"if canfocus then"

the problem is that i cant handle that problem outside the VT code,
because it happen when the form is in hiding mode (when it cant
handle focus events).

tnx

--- In [VirtualTreeview@y...], "Mike Lischke" [lists@l...] wrote:
> Hi Ariel,
>
> > // focus change
> > if not IsFocused then
> > begin
> > SetFocus;
> > IsFocused := Focused;
> > end;
> > if u use VT in a DropDownWindow type, Setfocus makes some
problems...
> > can u use add a "Try ... finnaly end;" to solve them. (?)
>
> Mmmh, I'm not at all in favour of this solution. When a simple
SetFocus call makes problems which
> cause an exception then I think these problems should be worked out
as they must be quite serious.
> Simply fixing the result instead the cause is not a good practice I
think.
>
> Ciao, Mike


Beta Install problem

From: [squidsrus85@y...]
Date: Wed Sep 5, 2001 1:40 am
Subject: Beta Install problem

Hi guys,

Just found this amazing component and installed the older version
then found out about the beta.

This is obviously of my own doing and not a problem with the VTree
but maybe someone can help. When I installed the older version I
changed Register to "3rd party" where I keep all my new stuff until I
decide if I want to keep it installed.

I uninstalled and then tried installing using the VirtualTreesReg.pas
but this time I left Register at "virtual components" but it still
installed into 3rd party but now without the icons, it just shows the
delhpi standard component icon.

I scanned the registry looking for a key or something there but drew
a blank. Any suggestions on how I can put this right? It's all
working just looks funny with the standard icons.

Thanks

 | Replies | Author | Date
3655 | Re: Beta Install problem | GIANNAKOPOULOS KOSTAS | Wed 9/5/2001
3657 | Re: Beta Install problem | [squidsrus85@y...] | Wed 9/5/2001
3659 | Re: Beta Install problem | Jim Kueneman | Wed 9/5/2001
3658 | Re: Beta Install problem | Vandrovec Milan | Wed 9/5/2001
3660 | Re: Beta Install problem | [helge@e...] | Wed 9/5/2001


re: Beta Install problem

From: GIANNAKOPOULOS KOSTAS [kyan@s...]
Date: Wed Sep 5, 2001 7:35 am
Subject: RE: [VirtualTreeview] Beta Install problem

To change the palette:

1. Close all projects in Delphi.
2. Uninstall and remove your design-time package.
3. Start Regedit, go to
HKEY_CURRENT_USER\Software\Borland\Delphi\X.0\Palette and delete the value
named "3rd Party" or edit its value so that it doesn't contain any virtual
tree components.
4. Start Delphi and reinstall your package.

As for the icons make sure that the design-time package you are installing
has the line

{$R 'VirtualTrees.dcr'}

in its source code right after the {$R *.RES} line. This resource file
contains the component glyphs for the palette.

> This is obviously of my own doing and not a problem with the VTree
> but maybe someone can help. When I installed the older version I
> changed Register to "3rd party" where I keep all my new stuff until I
> decide if I want to keep it installed.
>
> I uninstalled and then tried installing using the VirtualTreesReg.pas
> but this time I left Register at "virtual components" but it still
> installed into 3rd party but now without the icons, it just shows the
> delhpi standard component icon.
>
> I scanned the registry looking for a key or something there but drew
> a blank. Any suggestions on how I can put this right? It's all
> working just looks funny with the standard icons.

 | Replies | Author | Date
3657 | Re: Beta Install problem | [squidsrus85@y...] | Wed 9/5/2001
3659 | Re: Beta Install problem | Jim Kueneman | Wed 9/5/2001


VT + Kylix ?

From: "antoine.boegli" [boegli@t...]
Date: Wed Sep 5, 2001 7:53 am
Subject: VT + Kylix ?

Hello,

Any project to port VirtualTreeview in CLX then in Kylix ?

--
Antoine Boegli
IT-development
MD Online SA / tmbm.com
+4121/3116152
mailto: [boegli@t...]
visit: www.talkmusic.ch

 | Replies | Author | Date
3667 | Re: VT + Kylix ? | Mike Lischke | Sat 9/8/2001


re: Beta Install problem

From: [squidsrus85@y...]
Date: Wed Sep 5, 2001 1:55 pm
Subject: Re: Beta Install problem

--- In [VirtualTreeview@y...], GIANNAKOPOULOS KOSTAS [kyan@s...] wrote:
> To change the palette:
>
> 3. Start Regedit, go to
> HKEY_CURRENT_USER\Software\Borland\Delphi\X.0\Palette and delete
the value
> named "3rd Party" or edit its value so that it doesn't contain any
virtual

Hi Kostas,

I had already done that, but just checked again and sure enough there
is nothing in there associated with vtree. In fact a full search of
the registry shows nothing on vtree or components.

I am using d5 any other suggestions?

 | Replies | Author | Date
3659 | Re: Beta Install problem | Jim Kueneman | Wed 9/5/2001


re: Re: Beta Install problem

From: Vandrovec Milan [milan_va@s...]
Date: Wed Sep 5, 2001 2:27 pm
Subject: RE: [VirtualTreeview] Re: Beta Install problem

Hi.

>
> I had already done that, but just checked again and sure enough there
> is nothing in there associated with vtree. In fact a full search of
> the registry shows nothing on vtree or components.
>
> I am using d5 any other suggestions?
>

I am pretty sure it is not in registry. Try deleting all temporary files (if
I remember correctly, Delphi uses only .dcu), download again original
VirtualTrees.dcr and VirtualTreesReg.pas, VirtualTreesD5*.* (they might got
corrupted, or you modified them). I believe you have moved .dcr into a
different directory than the .dpk's directory and didn't change it in the
project file. Perhaps you renamed the components, Delphi checks if the name
of icon specified in resource matches the component's name (check with
Delphi Image Editor on VirtualTrees.dcr).

Milan


re: Beta Install problem

From: "Jim Kueneman" [jimdk@m...]
Date: Wed Sep 5, 2001 3:47 pm
Subject: Re: Beta Install problem

> I am using d5 any other suggestions?

This little exersise is more painfull than it need be.

-Close all projects
-Uninstall the VT package, and 3rd Party package.
-Right click on the component tab area
-Select properties
-Look through the pages
-I bet 3rd Party is still there, delete it and Virtual Controls if it
is there
-Close Delphi
-Look through the registry again and delete anything necessary
-Reopen Delphi reinstall both packages

Jim


re: Beta Install problem

From: [helge@e...]
Date: Wed Sep 5, 2001 4:45 pm
Subject: Re: Beta Install problem

Be sure that you don't have any .dcu or .bpl files of your package/VT
left. Delete all. Then Run->Build should do the trick.

Maybe you have to disable/delete the package from the package list
(see the other replies). ".bpl"-files are normally in $(DELPHI)
\Projects\Bpl, the ".dcu" are normally in either $(DELPHI)\Lib or in
the directory of the ".pas"-file.

It's just a thought but helps when I've trouble like this.

Helge.


Another sort problem

From: [jogador3@y...]
Date: Thu Sep 6, 2001 11:17 am
Subject: Another sort problem

Hello!

I use VirtualTree version 2.5.9 and I can not sort the tree(this is
the question!).

I use the Virtual tree as a grid, with more than 1 column just to
display the text and not hold my data (as should be in the Virtual
paradigm). My HeaderClick method and OnCompareNodes are shown next. I
do not "Init nodes", since I only use the tree to show the text, so,
OnGetText I use the index and get the text in my own data structure.

Why the sort doesn't work? I tryed with autosort only, with Tree.Sort
only and here I use both.

//--------------------------------------------------------------
procedure TfMain.vst1HeaderClick(Sender: TBaseVirtualTree;
Column: Integer);
begin
vst1.TreeOptions.AutoOptions := vst1.TreeOptions.AutoOptions +
[toAutoSort];
vst1.Header.SortDirection := sdAscending;//for example
vst1.Header.SortColumn := Column;
vst1.Sort(nil, vst1.Header.SortColumn, vst1.Header.SortDirection,
false);
//vst1.Sort(vst1.RootNode, vst1.Header.SortColumn,
//vst1.Header.SortDirection, false);
end;

//--------------------------------------------------------------
procedure TfMain.vst1CompareNodes(Sender: TBaseVirtualTree; Node1,
Node2: PVirtualNode; Column: Integer;
var Result: Integer);
var lT1, lT2: WideString;
begin
vst1GetText(vst1, Node1, Column, ttNormal, lT1);
vst1GetText(vst1, Node2, Column, ttNormal, lT2);
Result := AnsiCompareStr(lT1, lT2);
end;
//--------------------------------------------------------------

 | Replies | Author | Date
3662 | Re: Another sort problem | Moritz Franckenstein | Thu 9/6/2001
3666 | Re: Another sort problem | Mike Lischke | Sat 9/8/2001


re: Another sort problem

From: "Moritz Franckenstein" [franckenstein@a...]
Date: Thu Sep 6, 2001 11:38 am
Subject: Re: Another sort problem

--- In [VirtualTreeview@y...], [jogador3@y...] wrote:
> OnGetText I use the index and get the text in my own data structure.
>
> Why the sort doesn't work? I tryed with autosort only, with
Tree.Sort
> only and here I use both.

hi, i am not sure, but could it be that the index of a node changes
when it is sorted? i mean, after the sorting, the top node has index
0 again?
if that is true, you have to store your own index in the data area of
a node.

moritz

 | Replies | Author | Date
3666 | Re: Another sort problem | Mike Lischke | Sat 9/8/2001


DataObject in OnDragOver

From: Werner Lehmann [wl@b...]
Date: Thu Sep 6, 2001 10:37 pm
Subject: DataObject in OnDragOver

Hi,

I may be thick-witted but how do I get a hold of the DataObject during
OLE drag and drop in the OnDragOver event? IDropTarget.DragEnter() passes
the DragObject but it does not seem to be stored. I suggest to add a
DataObject parameter to the OnDragOver event. Or make the DataObject
a public property if the event signature conflicts with the usual VCL
drag and drop parameter list...

Regards,
Werner

 | Replies | Author | Date
3668 | Re: DataObject in OnDragOver | Mike Lischke | Sat 9/8/2001


New file uploaded to VirtualTreeview

From: [VirtualTreeview@yahoogroups.com>
Date: Sat Sep 8, 2001 5:02 pm
Subject: New file uploaded to VirtualTreeview

Hello,

This email message is a notification to let you know that
a file has been uploaded to the Files area of the VirtualTreeview
group.

File : /VirtualTree_2.5.27.zip
Uploaded by : [lists@l...]
Description : Beta version

You can access this file at the URL

http://groups.yahoo.com/group/VirtualTreeview/files/VirtualTree_2.5.27.zip

To learn more about file sharing for your group, please visit

http://help.yahoo.com/help/us/groups/files

Regards,

[lists@l...]

Replies | Author | Date
3669 | Re: New file uploaded to VirtualTreeview | Mike Lischke | Sat 9/8/2001
3682 | Re: New file uploaded to VirtualTreeview | [hj_schnorrenberg@y...] | Sun 9/9/2001
3709 | Re: New file uploaded to VirtualTreeview | Mike Lischke | Thu 9/13/2001
3721 | Re: New file uploaded to VirtualTreeview | [hj_schnorrenberg@y...] | Fri 9/14/2001
3745 | Re: New file uploaded to VirtualTreeview | Mike Lischke | Sat 9/15/2001


re: Drag and Drop

From: "Mike Lischke" [lists@l...]
Date: Sat Sep 8, 2001 5:02 pm
Subject: RE: [VirtualTreeview] Drag and Drop

Hi Walter,

> I am new to this group, so this may be an old question. I have an
> application with multiple columns in a treeview. I want to select a
> column other than the item name and still perform a drag and drop
> operation.

Welcome to the list. It has been quite silent the passed days but I think you
will get help here
whenever you need it. To your problem: enable extened focussing (see
toExtendedFocus in
TreeOptions.SelectionOptions). Then you can focus any column. You need the
latest source for this to
work. So go to the file area of the VT mailing list and download the
VirtualTree_2.x.xx.zip which
contains everything you need. Note that the demos are not updated yet to work
with that version, but
you can simply start with an empty form and a VT on it.

Ciao, Mike


re: Re: Another sort problem

From: "Mike Lischke" [lists@l...]
Date: Sat Sep 8, 2001 5:02 pm
Subject: RE: [VirtualTreeview] Re: Another sort problem

Hi Moritz,

> hi, i am not sure, but could it be that the index of a node changes
> when it is sorted? i mean, after the sorting, the top node has index
> 0 again?
> if that is true, you have to store your own index in the data area of
> a node.

This is true. The index always must correspond to the actual child position and
since references are
exchanged when doing a sort also the indices must be updated.

Ciao, Mike


re: VT + Kylix ?

From: "Mike Lischke" [lists@l...]
Date: Sat Sep 8, 2001 5:02 pm
Subject: RE: [VirtualTreeview] VT + Kylix ?

Hi Antoine,

> Any project to port VirtualTreeview in CLX then in Kylix ?

Very unlikely. There is too much code which depends on Windows (window regions,
OLE etc.). I have
done a lot of low level work to get VT working as it does. However, if somebody
would take the
burden to try to port it, then I would help where I can.

Ciao, Mike


re: DataObject in OnDragOver

From: "Mike Lischke" [lists@l...]
Date: Sat Sep 8, 2001 5:02 pm
Subject: RE: [VirtualTreeview] DataObject in OnDragOver

Hi Werner,

> I may be thick-witted but how do I get a hold of the DataObject during
> OLE drag and drop in the OnDragOver event? IDropTarget.DragEnter() passes
> the DragObject but it does not seem to be stored. I suggest to add a
> DataObject parameter to the OnDragOver event. Or make the DataObject
> a public property if the event signature conflicts with the usual VCL
> drag and drop parameter list...

Since I hesitate to change the (public) parameter lists again I have extended
the already existing
DataObject property of the drag manager (which is a public property of VT).
This manager will keep a
reference to the given data object on drag enter and return it via
IDragManager.DataObject. However
if you query this property when the owner tree is not the current drag target
then it will create
and return a new data object (without storing a reference). This behavior is
used when the owner
tree starts the drag operation.

Hope this helps you.

Ciao, Mike


re: New file uploaded to VirtualTreeview

From: "Mike Lischke" [lists@l...]
Date: Sat Sep 8, 2001 5:38 pm
Subject: RE: [VirtualTreeview] New file uploaded to VirtualTreeview

Hi all,

> This email message is a notification to let you know that
> a file has been uploaded to the Files area of the VirtualTreeview
> group.

Again an update is there with some changes. Here is the list:

- fixed most of the bugs listed in the bug list
- included the feature to use an alpha blended selection rectangle instead of
dotted lines (this is
part of my efforts to make VT XP compatible)
- included an option to switch the interior of the tree buttons (tree color,
clWindow and shaded,
the last one is also the standard in XP)

Notes to some bug entries:

- Generally I recommend that everyone who has entered bugs into the bug list
have a look if they are
fixed. There were some I cannot reproduce and I will not take any further
action until somebody
comes up with them again (and perhaps a demo application).

- #45: I don't know what is meant there. The TreeOptions subproperties are
already published.
- #46: This is not a bug. Set the auto index field after you filled in your
columns.
- #47: I have not understood this request and mark as not being a bug, but will
reopen it if you
explain to me what the real problem is.
- #55: Very tough problem, I don't know if I can solve that and it could be I
have to rework much of
the drag image handling (which I will avoid if possible). The problem is the
nesting of images which
produces wrong vertical offsets for the background. This can take a while to
solve it.

Have a nice weekend.

Ciao, Mike

 | Replies | Author | Date
3682 | Re: New file uploaded to VirtualTreeview | [hj_schnorrenberg@y...] | Sun 9/9/2001
3709 | Re: New file uploaded to VirtualTreeview | Mike Lischke | Thu 9/13/2001
3721 | Re: New file uploaded to VirtualTreeview | [hj_schnorrenberg@y...] | Fri 9/14/2001
3745 | Re: New file uploaded to VirtualTreeview | Mike Lischke | Sat 9/15/2001
3691 | Re: New file uploaded to VirtualTreeview | [hj_schnorrenberg@y...] | Tue 9/11/2001


re: New file uploaded to VirtualTreeview

From: Kent Briggs [kbriggs@b...]
Date: Sat Sep 8, 2001 6:18 pm
Subject: Re: [VirtualTreeview] New file uploaded to VirtualTreeview

Mike Lischke wrote:

> Hi all,
>
> > This email message is a notification to let you know that
> > a file has been uploaded to the Files area of the VirtualTreeview
> > group.
>
> Again an update is there with some changes. Here is the list:

Mike,

I tried installing the new 2.5.27 version but got this compile error in Delphi
5:

VirtualTrees.pas(3836): Inline assembler syntax error

There were numerous similar errors on subsequent lines. This is the first asm
instruction inside
procedure AlphaBlendLineMasterAndColor().

--
Kent Briggs, [kbriggs@b...]
Briggs Softworks, http://www.briggsoft.com

 | Replies | Author | Date
3671 | Re: New file uploaded to VirtualTreeview | Mike Lischke | Sat 9/8/2001


re: New file uploaded to VirtualTreeview

From: "Mike Lischke" [lists@l...]
Date: Sat Sep 8, 2001 6:27 pm
Subject: RE: [VirtualTreeview] New file uploaded to VirtualTreeview

Hi Kent,

> I tried installing the new 2.5.27 version but got this compile error in
Delphi 5:
>
> VirtualTrees.pas(3836): Inline assembler syntax error

Wow, you are fast.... and you are right. I forgot that Delphi 5 and lower do
not understand MMX
assembler (and I only used Delphi 6 two or three weeks, amazing how fast one
can get used to it
:-)).

I will install MMXExport form Hiroyuki Hori and convert the MMX assembler to
DBs. After this I will
upload a new build.

Ciao, Mike


re: New file uploaded to VirtualTreeview

From: Werner Lehmann [wl@b...]
Date: Sat Sep 8, 2001 6:43 pm
Subject: Re: [VirtualTreeview] New file uploaded to VirtualTreeview

Hi Mike,

> - fixed most of the bugs listed in the bug list
> - included the feature to use an alpha blended selection rectangle instead of
dotted lines (this is
> part of my efforts to make VT XP compatible)

Cute. Now I have to find out which colors look good as selection, as selection
interior
and (especially) at the blended intersection of draw selection rectangle and
node selection.
Currently it's a quite dirty color :) But it is a nice effect.

I have uploaded a demo for bug #53 (drag image smearing). I am not using VCL
dragging anymore
but at the company VCL drag is still employed for some components. And even if
the VTree's do
not accept VCL drags it should be avoided that the VCL dragimage can smear on
them... (oh yes,
and the smearing happens also when VCL dragtype is enabled).

BTW, is there any way to get the dragimage, from outside, or at least for
descendants? Prepare-
Dragimage is private... And there is still the problem how to access the
DataObject which is
passed by the system in OnDragOver. Unless I am missing something (see my
previous posting on
this topic). At the company I have applied a quick-hack and added the
DataObject to the OnDragOver
event, but only if State is dsDragEnter. It is nil otherwise. Not pretty but I
needed a quick
solution. I would appreciate if I could replace that by an official one.

I have also reported a new bug (droptarget painting) which has also been in the
previous public
version. I suppose it is easy to fix.

Regards,
Werner

 | Replies | Author | Date
3674 | Re: New file uploaded to VirtualTreeview | Mike Lischke | Sat 9/8/2001


New file uploaded to VirtualTreeview

From: [VirtualTreeview@yahoogroups.com>
Date: Sat Sep 8, 2001 6:46 pm
Subject: New file uploaded to VirtualTreeview

Hello,

This email message is a notification to let you know that
a file has been uploaded to the Files area of the VirtualTreeview
group.

File : /VirtualTree_2.5.28.zip
Uploaded by : [lists@l...]
Description : Beta version

You can access this file at the URL

http://groups.yahoo.com/group/VirtualTreeview/files/VirtualTree_2.5.28.zip

To learn more about file sharing for your group, please visit

http://help.yahoo.com/help/us/groups/files

Regards,

lists@l...]

 | Replies | Author | Date
3675 | Re: New file uploaded to VirtualTreeview | Mike Lischke | Sat 9/8/2001


re: New file uploaded to VirtualTreeview

From: "Mike Lischke" [lists@l...]
Date: Sat Sep 8, 2001 6:54 pm
Subject: RE: [VirtualTreeview] New file uploaded to VirtualTreeview

Hi Werner,

> Cute. Now I have to find out which colors look good as selection, as
selection interior
> and (especially) at the blended intersection of draw selection rectangle and
node selection.
> Currently it's a quite dirty color :) But it is a nice effect.

I like it too, but it is quite expensive, in terms of CPU power. Although I
have written an
optimized assembler routine (the one which caused the short time D5
incompatibility) it is still
quite demanding if you have a large rectangle. For normal sized selections
(only what is displayed
in the client area counts) however it should be reasonably fast.

> I have uploaded a demo for bug #53 (drag image smearing). I am not using VCL
dragging anymore
> but at the company VCL drag is still employed for some components. And even
if the VTree's do
> not accept VCL drags it should be avoided that the VCL dragimage can smear on
them... (oh yes,
> and the smearing happens also when VCL dragtype is enabled).

Thank you. I will look at this.

> BTW, is there any way to get the dragimage, from outside, or at least for
descendants? Prepare-
> Dragimage is private...

Can you explain more please? What do you mean with "... dragimage, from
outside"? Do you mean from
Explorer?

>And there is still the problem how to access the DataObject which is
> passed by the system in OnDragOver.

Have you tried VT.DragManager.DataObject in OnDragOver?

> I have also reported a new bug (droptarget painting) which has also been in
the previous public
> version. I suppose it is easy to fix.

OK, I will look at it tomorrow.

Ciao, Mike


re: New file uploaded to VirtualTreeview

From: "Mike Lischke" [lists@l...]
Date: Sat Sep 8, 2001 6:56 pm
Subject: RE: [VirtualTreeview] New file uploaded to VirtualTreeview

> This email message is a notification to let you know that
> a file has been uploaded to the Files area of the VirtualTreeview
> group.

This version only contains a changed assembler routine (compared with build 27,
which does not make
it into the museum). All MMX code is converted into DB (define byte) sequences
to stay D4/5
compatible.

Ciao, Mike


to Mike

From: "Wiktor Sadowski" [wiktor@w...]
Date: Sat Sep 8, 2001 6:00 pm
Subject: to Mike

Mike,
I still have problems with downloading files from Yahoogroups.
Could you place the newest version of VT on
www.lischke-online.de/Downloads/Betas?

many thanks in advance,
Wiktor Sadowski

 | Replies | Author | Date
3677 | Re: to Mike | Mike Lischke | Sat 9/8/2001
3681 | Re: to Mike | Wiktor Sadowski | Sun 9/9/2001
3768 | to Mike | Wiktor Sadowski | Sun 9/16/2001
3795 | Re: to Mike | Mike Lischke | Tue 9/18/2001
3852 | to Mike | Oleg Kraynov | Thu 9/27/2001
3858 | Re: to Mike | Mike Lischke | Thu 9/27/2001


re: to Mike

From: "Mike Lischke" [lists@l...]
Date: Sat Sep 8, 2001 8:30 pm
Subject: RE: [VirtualTreeview] to Mike

> I still have problems with downloading files from Yahoogroups.
> Could you place the newest version of VT on
> www.lischke-online.de/Downloads/Betas?

Ah yes. I will do it immediately. Btw: I know that you will get an empty file
if you left click on
the link in YG, but by using right-click and save target as... you can still
save the correct file.
Have you tried that?

Ciao, Mike


re: New file uploaded to VirtualTreeview

From: Werner Lehmann [wl@b...]
Date: Sat Sep 8, 2001 8:12 pm
Subject: Re: [VirtualTreeview] New file uploaded to VirtualTreeview

Hi Mike, Lischke wrote:
>
> > BTW, is there any way to get the dragimage, from outside, or at least for
descendants? Prepare-
> > Dragimage is private...
>
> Can you explain more please? What do you mean with "... dragimage, from
outside"? Do you mean from
> Explorer?

No, inside application, outside the VTree. You may remember that Jim is making
a new and
generally usable OLE drag and drop component, which knows optimized moves, has
drag image
support with three different methods (depending on the OS) and more. Currently
it is not
so easy to provide a decent VT dragimage to this non visual component.

> >And there is still the problem how to access the DataObject which is
> > passed by the system in OnDragOver.
>
> Have you tried VT.DragManager.DataObject in OnDragOver?

Yes. But it was nil (if I remember correctly, and the code suggests that I do).
Throughout
the whole source there is only one assignment for FDragObject and that is a nil
assignment.
My guess is that it was forgotten to be stored in DragEnter. I cannot check
before Monday
if that is correct.

Regards,
Werner

 | Replies | Author | Date
3716 | Re: New file uploaded to VirtualTreeview | Mike Lischke | Fri 9/14/2001
3724 | Re: New file uploaded to VirtualTreeview | Jim Kueneman | Fri 9/14/2001
3756 | Re: New file uploaded to VirtualTreeview | Mike Lischke | Sat 9/15/2001
3760 | Re: New file uploaded to VirtualTreeview | Jim Kueneman | Sat 9/15/2001
3765 | Re: New file uploaded to VirtualTreeview | Mike Lischke | Sun 9/16/2001


Repaint problems with 2.5.27

From: Werner Lehmann [wl@b...]
Date: Sat Sep 8, 2001 11:40 pm
Subject: Repaint problems with 2.5.27

Hi Mike,

here is another problem which surfaces only with the new version. I am showing
a dialog
on top of a tree, then call beginupdate, add nodes, when done endupdate. When
the dialog
is closed only the part where nodes are is being fully refreshed. The left
bottom corner
of the dialog is still visible.

Looks as if not everything below nodes in the client area is repainted. Was not
easy to
reproduce and I am not sure if the test project (uploaded to YG) contains the
minimal
number of steps, but it is quite small. Doubleclick on the tree in Form1, Form2
will
open modal, click both buttons, Form2 will close and you see the problem.

There are also two other problems. The first one is similar to the previously
described
one. I am using the VTree in a splitter control (custom splitter, not the
delphi one).
After start up of the app the right part is not painted correctly, it contains
a copy
of the controls right beside it. Apparently the VTree does not notice that the
splitter
is moved right (by program init code) and its clientarea has become wider. I
could not
reproduce this is in a small - 3rd party component free - app. But I hope that
it is related
to the previous problem. One more note, if I use the horz scrollbar under these
circum-
stances, I can scroll the 'debris' to the left and get more of the same kind.
Just as
if the window is copied to the left (ScrollWindow) and then the same (wrong)
stuff is
painted again on the right part. The faulty part is wider than the NC area
(vert scrollbar).

I could confirm that this (both) did not happen with 2.5.21. With 2.5.27 I get
it on each
app start.

The third problem is an AV when I close my app (read of address nil + $18). It
does not
come always. And it has been there also with 2.5.21, if I apply some code from
Jim, which
would *almost* fix the VCL dragimage smear problem (#53). (As a base for your
debugging
I append Jim's code below, I am confident that he does not mind)

So, the AV is not reproducible, but it is somehow related to the VTree, but it
could also
be my incorrect use of them. Only when it happens, it is nasty: the app window
is already
gone, and if I kill the program from delphi, nothing happens and I have to even
kill D6.
I know that you cannot do anything with this little information, but maybe if
someone
else has the same problems...

Regards,
Werner

------------------- Everything below is from Jim, as mentioned above.

Add a global variable

var
VCLDrag: Boolean;

Go to the CMDrag handler and insert this

case DragMessage of
dmDragEnter, dmDragLeave, dmDragMove:
begin

{ Fix for VCL Image smearing..... Jim Kueneman 7.9.01 }
if DragMessage = dmDragEnter then
begin
VCLDrag := True;
ImageList_DragEnter(0, Mouse.CursorPos.x, Mouse.CursorPos.y);
end;
if DragMessage = dmDragLeave then
begin
VCLDrag := False;
ImageList_DragLeave(0);
{ Return it to the VCL's little questionable trick state }
ImageList_DragEnter(GetDesktopWindow, Mouse.CursorPos.x,
Mouse.CursorPos.y);
end;
if (DragMessage = dmDragMove) and VCLDrag then
ImageList_DragMove(Mouse.CursorPos.x, Mouse.CursorPos.y);
{ End Fix for VCL Image smearing..... Jim Kueneman 7.9.01 }
.....
.....

Go to the WMPaint handler and replace it with this:

procedure TBaseVirtualTree.WMPaint(var Message: TWMPaint);

begin
ControlState := ControlState + [csCustomPaint];
{ Fix for VCL Image smearing..... Jim Kueneman 7.9.01 }
if VCLDrag then
ImageList_DragShowNolock(False);
{ End Fix for VCL Image smearing..... Jim Kueneman 7.9.01 }
inherited;
{ Fix for VCL Image smearing..... Jim Kueneman 7.9.01 }
if VCLDrag then
ImageList_DragShowNolock(True);
{ End Fix for VCL Image smearing..... Jim Kueneman 7.9.01 }
ControlState := ControlState - [csCustomPaint];
end;

It is 99.99% better. If you drag to the left fast you can sometimes get a
little piece of the DropMark left infont of the text, I am not sure why
that is. The VCL does a dirty little trick to make the image work over any
window (did you notice that) It makes it a bit tricky to have a window
that does not have access to the DragImage within the controls.pas unit
deal with the image.

The right way of course is to set the VCLDragging state flag but if I do
that the VT starts to scroll immediately (Did you notice externally
initiated VCL dragging does not scroll the VT window), I will leave that
as an excersice for the student to figure out <g>

 | Replies | Author | Date
3680 | Re: Repaint problems with 2.5.27 | [wl@b...] | Sat 9/8/2001
3690 | Re: Repaint problems with 2.5.27 | Kent Briggs | Tue 9/11/2001
3692 | Re: Repaint problems with 2.5.27 | [wvd_vegt@k...] | Tue 9/11/2001
3695 | Help to beginers | [avr555@m...] | Tue 9/11/2001
3696 | Re: Help to beginers | Jim Kueneman | Tue 9/11/2001
3714 | Re: Repaint problems with 2.5.27 | Mike Lischke | Fri 9/14/2001
3715 | Re: Repaint problems with 2.5.27 | Mike Lischke | Fri 9/14/2001
3734 | Re: Repaint problems with 2.5.27 | Werner Lehmann | Fri 9/14/2001


re: Repaint problems with 2.5.27

From: [wl@b...]
Date: Sat Sep 8, 2001 11:47 pm
Subject: Re: Repaint problems with 2.5.27

--- In [VirtualTreeview@y...], Werner Lehmann [wl@b...] wrote:
> here is another problem which surfaces only with the new version....

Martin Lehmann has filed this already as bug #57. I have uploaded
the test project anyway.

Werner


re: to Mike

From: "Wiktor Sadowski" [wiktor@w...]
Date: Sat Sep 8, 2001 11:43 pm
Subject: RE: [VirtualTreeview] to Mike

>Ah yes. I will do it immediately. Btw: I know that you will get an empty
file if you left click on
>the link in YG, but by using right-click and save target as... you can
still save the correct file.
>Have you tried that?

Yes, I have tried left, midddle and right-clicks many times.
Looks like they(-ahoo) don't like me.
Thanks for uploading and of course for the great components.

Wiktor


re: New file uploaded to VirtualTreeview

From: [hj_schnorrenberg@y...]
Date: Sun Sep 9, 2001 8:23 am
Subject: Re: New file uploaded to VirtualTreeview

>
> - #45: I don't know what is meant there. The TreeOptions
subproperties are already published.

Sorry, I think, I used an old version, since 2.5.18 I can attach
these properties.

> - #46: This is not a bug. Set the auto index field after you filled
in your columns.

I have written some descendents of VT, which should have columns by
default. Therefore, I initialized the columns in the constructor of
the VT. But creating columns and intializing the properties of the
columns in the constructor is difficult, because it is neccessary to
initialize the properties of the columns in a special order, which I
do not know (and which should be demonstrated by the example).
Perhaps it is possible to test csCreating of the ComponentState in
the corresponding set-methods of the properties, so that the result
of initializing columns properties in a constructor does not depend
on the order?

> - #47: I have not understood this request and mark as not being a
bug, but will reopen it if you

I create nodes dynamically, and the node data contains objects and
strings, which have to be initialized. AddChildNode returns a Node
with nonintialized Data, which is ok, because, in order to save
resources, the objects in the node data should only be created, when
neccessary. However, I have to intorduce InitNode directly after the
AddChildNode method, because the method GetNodeData does not check
the vsInitialized flag of the node, and therefore GetNodeData can
yield initialized and noninitalized data. So, I waste resources,
because only few nodes need to be initialized.

IMO, InitNode should be call for unintialized nodes in the
GetNodeData method like InitNode is called for nonintialized nodes by
the method GetVisible (and a component user have not to know, when it
is neccessary to call InitNode explicietly).

I hope, I could succeed in explaining the problems more clearly

Hans-Jürgen Schnorrenberg

 | Replies | Author | Date
3709 | Re: New file uploaded to VirtualTreeview | Mike Lischke | Thu 9/13/2001
3721 | Re: New file uploaded to VirtualTreeview | [hj_schnorrenberg@y...] | Fri 9/14/2001
3745 | Re: New file uploaded to VirtualTreeview | Mike Lischke | Sat 9/15/2001


Clipboard

From: [MJLeaver@n...]
Date: Mon Sep 10, 2001 7:04 am
Subject: Clipboard

How do I support cut, copy, and paste within the tree itself (i.e.
for nodes)?

Also, how do I support the clipboard for external apps? I can already
do drag & drop (using CF_IDLIST and CF_HDrop). Is it relatively
simple to add on clipboard support?

Thanks for any help.

 | Replies | Author | Date
3708 | Re: Clipboard | Mike Lischke | Thu 9/13/2001


Can't Edit Nodes.(In Some Circumstances)

From: "Simon Moscrop" [SimonMoscrop@H...]
Date: Mon Sep 10, 2001 3:22 pm
Subject: Can't Edit Nodes.(In Some Circumstances)

Hello,

I have an MDI application which has 2(+) forms in it, each form has 2
or more Virtual String Trees on it.

If i open form1 and edit the nodes, then open form2 and edit the
nodes then return to form1 the tree wont allow me to edit until i
have set the focus elsewhere and then clicked back on th tree again.
Have you any idea what i might be doing wrong?

- Please forgive the very general nature of this query - I am using
v.2.5.21 of the tree (I tried 2.5.28 but i couldn't get it to load
without a division by zero error).

- Thanks for nay help you can give me
- Simon Moscrop
Applications Developer

 | Replies | Author | Date
3687 | Re: Can't Edit Nodes.(In Some Circumstances) | Jim Kueneman | Tue 9/11/2001
3712 | Re: Can't Edit Nodes.(In Some Circumstances) | Mike Lischke | Fri 9/14/2001


IterateSubTree confusion

From: [squidsrus85@y...]
Date: Mon Sep 10, 2001 7:12 pm
Subject: IterateSubTree confusion

Hi Mike,

An excellent component. I am just learning how to use it and
ExplorerTree.

I need to iterate through all of the tree. Some nodes have checkboxes
and some don't and that all works fine. I think this more a VTree
question than a VET.

According to themy understanding of the help file leaving the Node =
nil and an empty set it will iterate through all nodes, childern,
grandchildern but it is currently only do =ing visible node and not
all nodes visible or not.

Where am I going wrong???

Node:=vetText.TopNode;
vetTest.Selected[Node];
vetTest.IterateSubTree(nil,CheckIfChecked,nil,[],False);
...
...
procedure TfrmMain.CheckIfChecked(
Sender: TBaseVirtualTree; Node: PVirtualNode;
Data: Pointer; var Abort: Boolean);
var
NS : TNameSpace;
begin
if Node.CheckType = ctCheckBox then
begin
vetTest.ValidateNamespace(Node,NS);
if Node.CheckState = csChecked then
lbTest.Items.Add(NS.NameForParsing);
end;
end;

Greg

 | Replies | Author | Date
3688 | Re: IterateSubTree confusion | Jim Kueneman | Tue 9/11/2001
3689 | Re: IterateSubTree confusion | Ariel | Tue 9/11/2001


[no subject]

From: "Tanzim Husain" [unreal@d...]
Date: Tue Sep 11, 2001 12:15 am
Subject:


re: Can't Edit Nodes.(In Some Circumstances)

From: Jim Kueneman [jimdk@m...]
Date: Tue Sep 11, 2001 1:12 am
Subject: Re: [VirtualTreeview] Can't Edit Nodes.(In Some Circumstances)

At 03:22 PM 9/10/2001 +0000, you wrote:
>Hello,
>
>I have an MDI application which has 2(+) forms in it, each form has 2
>or more Virtual String Trees on it.
>
>If i open form1 and edit the nodes, then open form2 and edit the
>nodes then return to form1 the tree wont allow me to edit until i
>have set the focus elsewhere and then clicked back on th tree again.
>Have you any idea what i might be doing wrong?
>
>- Please forgive the very general nature of this query - I am using
>v.2.5.21 of the tree (I tried 2.5.28 but i couldn't get it to load
>without a division by zero error).

Can you make a simple app that exibits this.

Jim


re: IterateSubTree confusion

From: Jim Kueneman [jimdk@m...]
Date: Tue Sep 11, 2001 1:23 am
Subject: Re: [VirtualTreeview] IterateSubTree confusion

At 07:12 PM 9/10/2001 +0000, you wrote:
>Hi Mike,
>
>According to themy understanding of the help file leaving the Node =
>nil and an empty set it will iterate through all nodes, childern,
>grandchildern but it is currently only do =ing visible node and not
>all nodes visible or not.
>
>Where am I going wrong???

Another way is to get the Root node and just walk the tree using
GetFirstXXXX and GetNextXXXX properties

Jim


re: IterateSubTree confusion

From: "Ariel" [asel98@y...]
Date: Tue Sep 11, 2001 3:06 am
Subject: Re: IterateSubTree confusion

IterateSubTree(nil,CheckIfChecked,nil,[],False);

you mean all the visible, or all the initialized nodes?
try changing the DoInit=False to True

if is the case, then is better to make your own iterate funtion.
and dont get inside the subnodes that arent checked. because now u
are accessing all the nodes, including the subtrees of the unchecked
nodes. (well... if u are using 3state checks).

--- In [VirtualTreeview@y...], [squidsrus85@y...] wrote:
> Hi Mike,
>
> An excellent component. I am just learning how to use it and
> ExplorerTree.
>
> I need to iterate through all of the tree. Some nodes have
checkboxes
> and some don't and that all works fine. I think this more a VTree
> question than a VET.
>
> According to themy understanding of the help file leaving the Node
=
> nil and an empty set it will iterate through all nodes, childern,
> grandchildern but it is currently only do =ing visible node and not
> all nodes visible or not.
>
> Where am I going wrong???
>
> Node:=vetText.TopNode;
> vetTest.Selected[Node];
> vetTest.IterateSubTree(nil,CheckIfChecked,nil,[],False);
> ...
> ...
> procedure TfrmMain.CheckIfChecked(
> Sender: TBaseVirtualTree; Node: PVirtualNode;
> Data: Pointer; var Abort: Boolean);
> var
> NS : TNameSpace;
> begin
> if Node.CheckType = ctCheckBox then
> begin
> vetTest.ValidateNamespace(Node,NS);
> if Node.CheckState = csChecked then
> lbTest.Items.Add(NS.NameForParsing);
> end;
> end;
>
> Greg


re: Repaint problems with 2.5.27

From: Kent Briggs [kbriggs@b...]
Date: Tue Sep 11, 2001 1:22 am
Subject: Re: [VirtualTreeview] Repaint problems with 2.5.27

Werner Lehmann wrote:

> Hi Mike,
>
> here is another problem which surfaces only with the new version. I am
showing a dialog
> on top of a tree, then call beginupdate, add nodes, when done endupdate. When
the dialog
> is closed only the part where nodes are is being fully refreshed. The left
bottom corner
> of the dialog is still visible.

I'm having similar repaint problems with 2.5.28. I'm either getting parts of
the dialog box that I just closed
on top of a VT getting left behind or parts of a node underneath where the
dialog box was are still there but
should have been deleted. I reinstalled 2.5.21 and those problems disappeared.

--
Kent Briggs, [kbriggs@b...]
Briggs Softworks, http://www.briggsoft.com

 | Replies | Author | Date
3692 | Re: Repaint problems with 2.5.27 | [wvd_vegt@k...] | Tue 9/11/2001
3695 | Help to beginers | [avr555@m...] | Tue 9/11/2001
3696 | Re: Help to beginers | Jim Kueneman | Tue 9/11/2001
3714 | Re: Repaint problems with 2.5.27 | Mike Lischke | Fri 9/14/2001


re: New file uploaded to VirtualTreeview

From: [hj_schnorrenberg@y...]
Date: Tue Sep 11, 2001 11:25 am
Subject: Re: New file uploaded to VirtualTreeview

> - #45: I don't know what is meant there. The TreeOptions
subproperties are already published.

property Options of TCustomStringTree is of type
TCustomStringTreeOptions, and in this type, PaintOptions, etc, are
declared as protected (in contrast to TStringTree, where type of
Options is TStringTreeOptions with PaintOptions, etc, decalred as
published).

Therefore, in a descendent of TCustomStringTree, it is not possible
to attach PaintOptions, ..., etc without a cracker! The subproperties
of TCustomStringTreeOptions should be declared as public.

Hans-Jürgen Schnorrenberg


re: Repaint problems with 2.5.27

From: [wvd_vegt@k...]
Date: Tue Sep 11, 2001 1:02 pm
Subject: Re: Repaint problems with 2.5.27

I'm having repaint problems too with 2.58, even when no
begin/endupdate is used, only doublebuffered:=true is used.
When i use the horizontal scrollbar of a window that contains a vt
sized to the client area i get unpainted areas (black).

I've uploaded a sample image and added a database bug entry.

--------
Wim van der Vegt

 | Replies | Author | Date
3695 | Help to beginers | [avr555@m...] | Tue 9/11/2001
3696 | Re: Help to beginers | Jim Kueneman | Tue 9/11/2001
3714 | Re: Repaint problems with 2.5.27 | Mike Lischke | Fri 9/14/2001


re: Autosort on DoubleClick

From: [wvd_vegt@k...]
Date: Tue Sep 11, 2001 2:37 pm
Subject: Re: Autosort on DoubleClick

--- In [VirtualTreeview@y...], [wvd_vegt@k...] wrote:
> Hi,
>
> What option do i use to turn of the automatic sorting when i
> doubleclick a node's column (not the header).
>
> Wim van de Vegt

Oops, my fault it was my program that sorted it underneath. So no
answer needed.

Wim van der Vegt


Help to beginers

From: [avr555@m...]
Date: Tue Sep 11, 2001 3:00 pm
Subject: [VirtualTreeview] Help to beginers

Hi, All!

Please help me! I see that this is incredible component. Before I use
standart TreeView component. And now I have problem. I can't change
node information (Caption). What I do wrong?

...
type
PMyRec = ^TMyRec;
TMyRec = record
Caption: WideString;
end;
...

procedure TForm1.Button1Click(Sender: TObject);
var
NodeData:PMyRec;
Node:PVirtualNode;

begin
Node := tvwWareTo.AddChild(nil);

NodeData := tvwWareTo.GetNodeData(Node);
NodeData.Caption := '123';

end;

And I receive message 'Access violation'!

--
Best regards,
Alexander Rudenko mailto:[avr555@m...]

 | Replies | Author | Date
3696 | Re: Help to beginers | Jim Kueneman | Tue 9/11/2001


re: Help to beginers

From: "Jim Kueneman" [jimdk@m...]
Date: Tue Sep 11, 2001 3:57 pm
Subject: Re: Help to beginers

See inline

> Please help me! I see that this is incredible component. Before I
use
> procedure TForm1.Button1Click(Sender: TObject);
> var
> NodeData:PMyRec;
> Node:PVirtualNode;
>
> begin

// Tell VT you are using extra data
tvwWareTo.NodeDataSize := Sizeof(TMyRec);

// speed things up
tvwWareTo.BeginUpdate;

> Node := tvwWareTo.AddChild(nil);
>
> NodeData := tvwWareTo.GetNodeData(Node);
> NodeData.Caption := '123';

// speed things up
tvwWareTo.EndUpdate;
>
> end;

{ Now get your text when asked }
procedure TForm1.tvwWareToGetText(Sender: TBaseVirtualTree;
Node: PVirtualNode; Column: Integer; TextType: TVSTTextType;
var Text: WideString);
var
NodeData:PMyRec;
begin
NodeData := tvwWareTo.GetNodeData(Node);
Text := NodeData.Caption;
end;

Jim


re: Re: New file uploaded to VirtualTreeview

From: Werner Lehmann [wl@b...]
Date: Tue Sep 11, 2001 8:29 pm
Subject: Re: [VirtualTreeview] Re: New file uploaded to VirtualTreeview

Hi Hans-Jürgen,

> Therefore, in a descendent of TCustomStringTree, it is not possible
> to attach PaintOptions, ..., etc without a cracker! The subproperties
> of TCustomStringTreeOptions should be declared as public.

I am not sure if I get your point correctly. But to declare them as
public is not to be desired. Once they're public there is no way to
make them 'unpublic' again. I suggest that you don't use a 'cracker'
but simply create your own tree options class which inherits from
the custom string tree options. This way you can access everything
and declare as public or published to your liking.

If I did not understand you correctly, maybe you can show a simplified
code example of the problem?

Werner

 | Replies | Author | Date
3698 | Re: New file uploaded to VirtualTreeview | [hj_schnorrenberg@y...] | Wed 9/12/2001
3699 | Access violation when program is shotdown | [avr555@m...] | Wed 9/12/2001
3702 | Re: Access violation when program is shotdown | Michael Valentiner=Branth | Thu 9/13/2001
3703 | Re[2]: [VirtualTreeview] Access violation when pr | [avr555@m...] | Thu 9/13/2001
3705 | Re: Access violation when program is shotdown | Ariel | Thu 9/13/2001
3723 | Re: Access violation when program is shotdown | Michael Valentiner=Branth | Fri 9/14/2001


re: New file uploaded to VirtualTreeview

From: [hj_schnorrenberg@y...]
Date: Wed Sep 12, 2001 9:15 am
Subject: Re: New file uploaded to VirtualTreeview

Hi Werner,

> I am not sure if I get your point correctly. But to declare them as
> public is not to be desired. Once they're public there is no way to
> make them 'unpublic' again.

There is no way to protect anything by the protected decaltration in
Delphi. For example, Click method of TControl is protected, it is
only neccessary to declare a cracker in your unit:

type
TControlCracker = class(TControl);
now you can access every protected method or property of a control:

e.g.

TControlCracker(AControl).Click;
or
TControlCracker(AControl).OnMouseDown := MyMouseDownHandler;

>I suggest that you don't use a 'cracker'
> but simply create your own tree options class which inherits from
> the custom string tree options. This way you can access everything
> and declare as public or published to your liking.

Because there does not exist any protection, I declared the properties
as public in the source of VirtualTreeView.

> If I did not understand you correctly, maybe you can show a
simplified
> code example of the problem?

At first, my intention:

In my descendent of a VirtualTree I want control, which properties
does occur in the property editor and which does not. Therefore, I
have to use TCustomStringTree as ancestor. Now I want to initialize
properties in the constructor:

e.g.
constructor MyStringTree.create(AOwner: TComponent);
inherited;
with TreeOptions do
begin
PaintOptions := [toShowButtons, toShowDropmark, toShowTreeLines,
toShowVertGridLines];
MiscOptions := [toCheckSupport, toEditable, toToggleOnDblClick];
SelectionOptions := [toMultiSelect, toSiblingSelectConstraint];
end;

I want to use the component with minimal work. But I can not attach
TreeOptions.PaintOptions, because PaintOptions are declared as
protected.

I do not want to declare a own descendent of TTreeOptions, only to
attach PaintOptions, this is to much work. Furthermore, I think, the
method to declare a own descentdent in order to attach the properties
is not wellknown, so a component writer have first to learn about how
to use TreeOptions.

And there is no real protection by protected, so why do not declare
PaintOptions, ..., etc, as public, you will only win.

Hans-Jürgen Schnorrenberg

 | Replies | Author | Date
3699 | Access violation when program is shotdown | [avr555@m...] | Wed 9/12/2001
3702 | Re: Access violation when program is shotdown | Michael Valentiner=Branth | Thu 9/13/2001
3703 | Re[2]: [VirtualTreeview] Access violation when pr | [avr555@m...] | Thu 9/13/2001
3705 | Re: Access violation when program is shotdown | Ariel | Thu 9/13/2001
3723 | Re: Access violation when program is shotdown | Michael Valentiner=Branth | Fri 9/14/2001


Access violation when program is shotdown

From: [avr555@m...]
Date: Wed Sep 12, 2001 5:17 pm
Subject: [VirtualTreeview] Access violation when program is shotdown

Hi All,
When I use this component I have problem with closing my application.
When I try do this I receive 'Access Violation'

I use 2 VirtulTreeView on the same form.

When I test with 1 object all was right.

What happened?

Best regards,
Alexander Rudenko mailto:[avr555@m...]

 | Replies | Author | Date
3702 | Re: Access violation when program is shotdown | Michael Valentiner=Branth | Thu 9/13/2001
3703 | Re[2]: [VirtualTreeview] Access violation when pr | [avr555@m...] | Thu 9/13/2001
3705 | Re: Access violation when program is shotdown | Ariel | Thu 9/13/2001
3723 | Re: Access violation when program is shotdown | Michael Valentiner=Branth | Fri 9/14/2001


re: Re: New file uploaded to VirtualTreeview

From: Werner Lehmann [wl@b...]
Date: Wed Sep 12, 2001 6:58 pm
Subject: Re: [VirtualTreeview] Re: New file uploaded to VirtualTreeview

Hi Hans-Jürgen,

> > I am not sure if I get your point correctly. But to declare them as
> > public is not to be desired. Once they're public there is no way to
> > make them 'unpublic' again.
>
> There is no way to protect anything by the protected decaltration in
> Delphi. For example, Click method of TControl is protected, it is
> only neccessary to declare a cracker in your unit:

I know what cracker classes are.

> >I suggest that you don't use a 'cracker'
> > but simply create your own tree options class which inherits from
> > the custom string tree options. This way you can access everything
> > and declare as public or published to your liking.
>
> Because there does not exist any protection, I declared the properties
> as public in the source of VirtualTreeView.

So your final point is that the protected directive itself does not make
any sense if it can be circumvented. There are also dirty tricks to access
private class members, probably the private directive is also unnecessary...

> At first, my intention:
>
> In my descendent of a VirtualTree I want control, which properties
> does occur in the property editor and which does not. Therefore, I
> have to use TCustomStringTree as ancestor. Now I want to initialize
> properties in the constructor:
>
> e.g.
> constructor MyStringTree.create(AOwner: TComponent);
> inherited;
> with TreeOptions do
> begin
> PaintOptions := [toShowButtons, toShowDropmark, toShowTreeLines,
> toShowVertGridLines];
> MiscOptions := [toCheckSupport, toEditable, toToggleOnDblClick];
> SelectionOptions := [toMultiSelect, toSiblingSelectConstraint];
> end;
>
> I want to use the component with minimal work. But I can not attach
> TreeOptions.PaintOptions, because PaintOptions are declared as
> protected.
>
> I do not want to declare a own descendent of TTreeOptions, only to
> attach PaintOptions, this is to much work. Furthermore, I think, the
> method to declare a own descentdent in order to attach the properties
> is not wellknown, so a component writer have first to learn about how
> to use TreeOptions.

It's not so secret as you might think...

> And there is no real protection by protected, so why do not declare
> PaintOptions, ..., etc, as public, you will only win.

No. I loose the opportunity to restrict access to some option categories.
If they were public they were visible without problems with code insight.
The user of my tree descendant can just type "TreeOptions.", press ctrl+
space and sees the options which I don't want him to use. I would have to
override these option properties and block changes. Which would require
a new options descendant. So, why not use one in the first place.

You must also override the GetOptionClass method (in either case, when
you derive from a custom tree and want to provide a non custom tree). And
you always must publish the TreeOptions with new getter and setter which
work on non custom variants of the tree options. You can just use this
published property then to access your options in the constructor.

To make options public only because you want to change them most easily
in a minimal descendant is not reason enough. IMO. (And would still require
the other changes, or to get rid of the custom options altogether.)

Werner

 | Replies | Author | Date
3701 | Re: New file uploaded to VirtualTreeview | [hj_schnorrenberg@y...] | Thu 9/13/2001
3704 | Trouble with FocusedNode | Ralf Junker | Thu 9/13/2001
3713 | Re: Trouble with FocusedNode | Mike Lischke | Fri 9/14/2001


re: New file uploaded to VirtualTreeview

From: [hj_schnorrenberg@y...]
Date: Thu Sep 13, 2001 6:46 am
Subject: Re: New file uploaded to VirtualTreeview

Hi Werner,

I accept Your point of view.

Especially, there is no need for a further discussion, because the
source is free, and I only need to shift three lines of code every
new version.

(In my personal opion, I'm glad, that VT-source is free, and no
component writer can decide, which properties and methods I'm allowed
to access and which not.)

Hans-Jürgen

 | Replies | Author | Date
3704 | Trouble with FocusedNode | Ralf Junker | Thu 9/13/2001
3713 | Re: Trouble with FocusedNode | Mike Lischke | Fri 9/14/2001


re: Access violation when program is shotdown

From: Michael Valentiner=Branth [MichaelVB@g...]
Date: Thu Sep 13, 2001 7:13 am
Subject: Re: [VirtualTreeview] Access violation when program is shotdown

Hello Alexander,

> When I use this component I have problem with closing my application.
> When I try do this I receive 'Access Violation'
>
> I use 2 VirtulTreeView on the same form.
>
> When I test with 1 object all was right.
>
> What happened?
>
Maybe, you took pieces of code from the first VT and used it for the second
one. Then you forgot to change the VTs name at one or more places in the code
...
I had several 'Access Violations' for that reason, not only on shutdown.

Hope that helps.
Michael

 | Replies | Author | Date
3703 | Re[2]: [VirtualTreeview] Access violation when pr | [avr555@m...] | Thu 9/13/2001
3705 | Re: Access violation when program is shotdown | Ariel | Thu 9/13/2001
3723 | Re: Access violation when program is shotdown | Michael Valentiner=Branth | Fri 9/14/2001


Re[2]: Access violation when program is shotdown

From: [avr555@m...]
Date: Thu Sep 13, 2001 5:14 pm
Subject: Re[2]: [VirtualTreeview] Access violation when program is shotdown

Hello Michael,

Thursday, September 13, 2001, 10:13:51 AM, you wrote:

MVB> Hello Alexander,

>> When I use this component I have problem with closing my application.
>> When I try do this I receive 'Access Violation'
>>
>> I use 2 VirtulTreeView on the same form.
>>
>> When I test with 1 object all was right.
>>
>> What happened?
>>
MVB> Maybe, you took pieces of code from the first VT and used it for the
second one. Then you forgot to change the VTs name at one or more places in the
code ...
MVB> I had several 'Access Violations' for that reason, not only on shutdown.

MVB> Hope that helps.
MVB> Michael

If I understand right When I change version some pieces of code in
my program may conflict with new version of TV?

In my program I simple fill the trees and nothing else.
When I put in second tree nodes after root node I receive 'Access
Violation'. When I fill only root node all OK.

Can anybody explain me this?

--
Best regards,
Alexander Rudenko mailto:[avr555@m...]

 | Replies | Author | Date
3705 | Re: Access violation when program is shotdown | Ariel | Thu 9/13/2001
3723 | Re: Access violation when program is shotdown | Michael Valentiner=Branth | Fri 9/14/2001


Trouble with FocusedNode

From: Ralf Junker [ralfjunker@g...]
Date: Thu Sep 13, 2001 1:41 pm
Subject: Trouble with FocusedNode

Hi,

the FocusedNode property does not seem to be updated after decreasing the
RootNodeCount if FocusedNode points to one of the nodes which will be deleted
as a result.

After decreasing RootNodeCount, FocusedNode still points to the same address,
i.e. to a node which has just been deleted. Is this intended?

I think it would be more straightforward if the FocusedNode would be (visibly)
adjusted just as it is when calling DeleteNode. My first guess is that some
call to DoFocusNode is missing in SetChildCount.

Regards,

-- Ralf

 | Replies | Author | Date
3713 | Re: Trouble with FocusedNode | Mike Lischke | Fri 9/14/2001


re: Access violation when program is shotdown

From: "Ariel" [asel98@y...]
Date: Thu Sep 13, 2001 8:39 pm
Subject: Re: Access violation when program is shotdown

are u using free or dispose of any record before closing the appl?
are u using rootnodecounts, addchild?
can you post some parts of your code?

--- In [VirtualTreeview@y...], [avr555@m...] wrote:
> Hello Michael,
>
> Thursday, September 13, 2001, 10:13:51 AM, you wrote:
>
> MVB> Hello Alexander,
>
> >> When I use this component I have problem with closing my
application.
> >> When I try do this I receive 'Access Violation'
> >>
> >> I use 2 VirtulTreeView on the same form.
> >>
> >> When I test with 1 object all was right.
> >>
> >> What happened?
> >>
> MVB> Maybe, you took pieces of code from the first VT and used it
for the second one. Then you forgot to change the VTs name at one or
more places in the code ...
> MVB> I had several 'Access Violations' for that reason, not only on
shutdown.
>
> MVB> Hope that helps.
> MVB> Michael
>
>
> If I understand right When I change version some pieces of code in
> my program may conflict with new version of TV?
>
> In my program I simple fill the trees and nothing else.
> When I put in second tree nodes after root node I receive 'Access
> Violation'. When I fill only root node all OK.
>
> Can anybody explain me this?
>
>
>
>
>
>
>
>
> --
> Best regards,
> Alexander Rudenko mailto:[avr555@m...]


New file uploaded to VirtualTreeview

From: [VirtualTreeview@yahoogroups.com>
Date: Thu Sep 13, 2001 8:48 pm
Subject: New file uploaded to VirtualTreeview

Hello,

This email message is a notification to let you know that
a file has been uploaded to the Files area of the VirtualTreeview
group.

File : /VirtualTree_2.5.31.zip
Uploaded by : [lists@l...]
Description : Release candidate 1

You can access this file at the URL

http://groups.yahoo.com/group/VirtualTreeview/files/VirtualTree_2.5.31.zip

To learn more about file sharing for your group, please visit

http://help.yahoo.com/help/us/groups/files

Regards,

lists@l...]

 | Replies | Author | Date
3710 | Re: New file uploaded to VirtualTreeview | Mike Lischke | Thu 9/13/2001


New file uploaded to VirtualTreeview

From: [VirtualTreeview@yahoogroups.com>
Date: Thu Sep 13, 2001 8:52 pm
Subject: New file uploaded to VirtualTreeview

Hello,

This email message is a notification to let you know that
a file has been uploaded to the Files area of the VirtualTreeview
group.

File : /Advanced.zip
Uploaded by : [lists@l...]
Description : Compiled advanced demo

You can access this file at the URL

http://groups.yahoo.com/group/VirtualTreeview/files/Advanced.zip

To learn more about file sharing for your group, please visit

http://help.yahoo.com/help/us/groups/files

Regards,

lists@l...]

 | Replies | Author | Date
3711 | Re: New file uploaded to VirtualTreeview | Mike Lischke | Thu 9/13/2001
3718 | TListView.ViewStyle support | Theodor Kleynhans | Fri 9/14/2001
3725 | Re: TListView.ViewStyle support | Jim Kueneman | Fri 9/14/2001
3743 | Re: TListView.ViewStyle support | Mike Lischke | Sat 9/15/2001


re: Clipboard

From: "Mike Lischke" [lists@l...]
Date: Thu Sep 13, 2001 8:47 pm
Subject: RE: [VirtualTreeview] Clipboard

Hi MJ,

> How do I support cut, copy, and paste within the tree itself (i.e.
> for nodes)?

There are at least two ways. Starting with Delphi 5 you can use the standard
actions TCutAction,
TCopyAction etc. which are supported by VT. Another way is to create some
normal actions (with hot
keys) or a simple key down handler for the tree and call VT.CopyToClipboard or
VT.CutToClipboard.

> Also, how do I support the clipboard for external apps? I can already
> do drag & drop (using CF_IDLIST and CF_HDrop). Is it relatively
> simple to add on clipboard support?

Well, I made some effort to allow descentants of VT or applications to provide
their own clipboard
formats. For instance look at the OnGetUserClipboardFormats event which allows
applications to
specify their own formats and OnRenderOLEData to render the data to OLE storage
when needed (VT uses
socalled delayed rendering, which means the data is only put onto the clipboard
when a consumer
requests it).

Ciao, Mike


re: Re: New file uploaded to VirtualTreeview

From: "Mike Lischke" [lists@l...]
Date: Thu Sep 13, 2001 8:47 pm
Subject: RE: [VirtualTreeview] Re: New file uploaded to VirtualTreeview

> columns in the constructor is difficult, because it is neccessary to
> initialize the properties of the columns in a special order, which I
> do not know (and which should be demonstrated by the example).

It is not that difficult. The order dependance is a speciality of the auto size
feature and part of
its nature. Other properties do not depend on the order they are set.

> Perhaps it is possible to test csCreating of the ComponentState in
> the corresponding set-methods of the properties, so that the result
> of initializing columns properties in a constructor does not depend
> on the order?

Well, this would (perhaps) fix your problem now, but what about other ways of
creating the columns?
No, I rather think a developer should be aware that things depend on each other
(sometimes) and act
accordingly.

> I create nodes dynamically, and the node data contains objects and
> strings, which have to be initialized. AddChildNode returns a Node
> with nonintialized Data, which is ok, because, in order to save
> resources, the objects in the node data should only be created, when
> neccessary. However, I have to intorduce InitNode directly after the
> AddChildNode method, because the method GetNodeData does not check
> the vsInitialized flag of the node, and therefore GetNodeData can
> yield initialized and noninitalized data. So, I waste resources,
> because only few nodes need to be initialized.

Mmmmh, this is a difficult question. If I understand you correctly then you
expect GetNodeData
always to return a node's data initialized. But this is problematic because
this very method is also
called to initialized a node the first time (e.g. usually in OnInitNode).
GetNodeData is meant to
provide access to the node data regardless of its actual state. If you really
want to make use of
the virtual and memory sparing nature of VT then do not use AddChild but write
a handlere for
OnInitNode. This event is triggered whenever you ask for it (e.g. with
ValidateNode) or when the
tree needs a node initialized (e.g. for painting, expanding, iterating).

> IMO, InitNode should be call for unintialized nodes in the
> GetNodeData method like InitNode is called for nonintialized nodes by
> the method GetVisible (and a component user have not to know, when it
> is neccessary to call InitNode explicietly).

Indeed, the user should not call InitNode, but if an application relies on
initialized data then it
must initialize the particular node explicitly (and looses so a part of its
virtuality). The deal
between the tree and the application is: the app. provides all data, but the
tree asks only for it
if absolutely necessary. Demand of the application is something the tree cannot
know about, so the
app. has to tell the tree what it needs.

Ciao, Mike

 | Replies | Author | Date
3721 | Re: New file uploaded to VirtualTreeview | [hj_schnorrenberg@y...] | Fri 9/14/2001
3745 | Re: New file uploaded to VirtualTreeview | Mike Lischke | Sat 9/15/2001


re: New file uploaded to VirtualTreeview

From: "Mike Lischke" [lists@l...]
Date: Thu Sep 13, 2001 8:54 pm
Subject: RE: [VirtualTreeview] New file uploaded to VirtualTreeview

Hi all,

> This email message is a notification to let you know that
> a file has been uploaded to the Files area of the VirtualTreeview
> group.

Here we are again with a new update. Only a few things happend there:

- bug fixes (mainly the paint problems mentioned)
- Windows XP style painting is finished, still the scrollbar issue is not yet
decided (I still have
paint problems on XP RC1, will check again on the first public release in
October)

Ciao, Mike


re: New file uploaded to VirtualTreeview

From: "Mike Lischke" [lists@l...]
Date: Thu Sep 13, 2001 9:03 pm
Subject: RE: [VirtualTreeview] New file uploaded to VirtualTreeview

> This email message is a notification to let you know that
> a file has been uploaded to the Files area of the VirtualTreeview
> group.
>
> File : /Advanced.zip
> Uploaded by : [lists@l...]
> Description : Compiled advanced demo

I have uploaded the new version of the "main" demo, but only as executable
(source will be available
too of course). I would very much appreciate if some of the 650 lurkers on this
list could have a
look and tell me what they would like to have changed. Let me know what you
like and what not (most
liked: ready-to-built-in source code). Note: drag'n drop/cut'n paste is
addressed in another demo.
Also a very simple "getting started" demo will be provided. Additionally, I
will rework Marian
Aldenhovel's object tree demo and would like to include Jim's VET into the main
distribution.

Other stuff I plan to include are:

- BDE and IBO aware tree variants
- most of the stuff located in the "Descentants" and "Examples" folders of YG
(this includes the XML
tree from Moritz)

Have a nice evening and

Ciao, Mike

 | Replies | Author | Date
3718 | TListView.ViewStyle support | Theodor Kleynhans | Fri 9/14/2001
3725 | Re: TListView.ViewStyle support | Jim Kueneman | Fri 9/14/2001
3743 | Re: TListView.ViewStyle support | Mike Lischke | Sat 9/15/2001


re: Can't Edit Nodes.(In Some Circumstances)

From: "Mike Lischke" [lists@l...]
Date: Thu Sep 13, 2001 8:47 pm
Subject: RE: [VirtualTreeview] Can't Edit Nodes.(In Some Circumstances)

Hi Simon,

> If i open form1 and edit the nodes, then open form2 and edit the
> nodes then return to form1 the tree wont allow me to edit until i
> have set the focus elsewhere and then clicked back on th tree again.
> Have you any idea what i might be doing wrong?

Sounds unusual. Could you place a small demo showing the effect into the file
area of the VT mailing
list? This way I can probably find out what is wrong.

Ciao, Mike


re: Trouble with FocusedNode

From: "Mike Lischke" [lists@l...]
Date: Thu Sep 13, 2001 8:50 pm
Subject: RE: [VirtualTreeview] Trouble with FocusedNode

Hi Ralf,

> I think it would be more straightforward if the FocusedNode would be
(visibly) adjusted
> just as it is when calling DeleteNode. My first guess is that some call to
DoFocusNode is
> missing in SetChildCount.

Yes, good point. Would you please add it to the bug table?

Ciao, Mike


re: Re: Repaint problems with 2.5.27

From: "Mike Lischke" [lists@l...]
Date: Thu Sep 13, 2001 8:47 pm
Subject: RE: [VirtualTreeview] Re: Repaint problems with 2.5.27

> I'm having repaint problems too with 2.58, even when no
> begin/endupdate is used, only doublebuffered:=true is used.
> When i use the horizontal scrollbar of a window that contains a vt
> sized to the client area i get unpainted areas (black).

This should be fixed with the latest update.

Ciao, Mike


re: Repaint problems with 2.5.27

From: "Mike Lischke" [lists@l...]
Date: Thu Sep 13, 2001 8:47 pm
Subject: RE: [VirtualTreeview] Repaint problems with 2.5.27

Hi Werner

> here is another problem which surfaces only with the new version. I am
showing a dialog
> on top of a tree, then call beginupdate, add nodes, when done endupdate. When
the dialog
> is closed only the part where nodes are is being fully refreshed. The left
bottom corner
> of the dialog is still visible.

This should be fixed now. The changes I did to allow the blended selection
rectangle required also
changes in the general background handling. This process took a while to be
finished. Also the other
problems you described should now be gone.

> The third problem is an AV when I close my app (read of address nil + $18).
It does not
> come always. And it has been there also with 2.5.21, if I apply some code
from Jim, which
> would *almost* fix the VCL dragimage smear problem (#53). (As a base for your
debugging
> I append Jim's code below, I am confident that he does not mind)

Well, the AV is mysterious. It is not clear to me why it appears. Please try
the new version and
tell me what happens. Also the drag image problem is now solved thank your and
Jim's suggestions. I
made it a bit easier and it looks like it works for all cases now. Btw: there
aren't many cases. How
many VCL controls actually use a drag image?

Ciao, Mike


re: New file uploaded to VirtualTreeview

From: "Mike Lischke" [lists@l...]
Date: Thu Sep 13, 2001 8:47 pm
Subject: RE: [VirtualTreeview] New file uploaded to VirtualTreeview

Hi Werner,

> No, inside application, outside the VTree. You may remember that Jim is
making a new and
> generally usable OLE drag and drop component, which knows optimized moves,
has drag image
> support with three different methods (depending on the OS) and more.
Currently it is not
> so easy to provide a decent VT dragimage to this non visual component.

Aha, this is what you mean. Well, Jim already requested this quite a while ago.
Look closer at
VT.DragImage.Image.

> Yes. But it was nil (if I remember correctly, and the code suggests that I
do). Throughout
> the whole source there is only one assignment for FDragObject and that is a
nil assignment.
> My guess is that it was forgotten to be stored in DragEnter. I cannot check
before Monday
> if that is correct.

Strange, I thought I had already the assignment in TVTDragManager.DragEnter and
it is there....

Ciao, Mike

 | Replies | Author | Date
3724 | Re: New file uploaded to VirtualTreeview | Jim Kueneman | Fri 9/14/2001
3756 | Re: New file uploaded to VirtualTreeview | Mike Lischke | Sat 9/15/2001
3760 | Re: New file uploaded to VirtualTreeview | Jim Kueneman | Sat 9/15/2001
3765 | Re: New file uploaded to VirtualTreeview | Mike Lischke | Sun 9/16/2001


re: Access violation when program is shotdown

From: Werner Lehmann [wl@b...]
Date: Thu Sep 13, 2001 7:47 pm
Subject: Re: [VirtualTreeview] Access violation when program is shotdown

Hi Alexander,

> In my program I simple fill the trees and nothing else.
> When I put in second tree nodes after root node I receive 'Access
> Violation'. When I fill only root node all OK.

Sounds as if you code provide small sample code? If so, you may upload
it to YG and I'll have a look at it.

Regards,
Werner

 | Replies | Author | Date
3728 | Re[2]: [VirtualTreeview] Access violation when pr | [avr555@m...] | Fri 9/14/2001
3730 | Re: Access violation when program is shotdown | Werner Lehmann | Fri 9/14/2001
3762 | Re[2]: [VirtualTreeview] Access violation when pr | [avr555@m...] | Sun 9/16/2001
3771 | Re: Access violation when program is shotdown | Werner Lehmann | Sun 9/16/2001


TListView.ViewStyle support

From: "Theodor Kleynhans" [theodor.yahoogroups@s...]
Date: Fri Sep 14, 2001 12:40 am
Subject: [VirtualTreeview] TListView.ViewStyle support

Hi there,

I'm thinking of replacing all TListViews in an application with
(phenominally excellent) TVirtualStringTrees. Although most users don't
use it, we need to support the vsLargeIcons, vsSmallIcons and vsList
viewstyles supported by TListView (via the "ViewStyle" property).

How hard would it be to get TVirtualTreeView to support these modes?
I've started to implement it as a TVirtualStringTree descendant, but I
suppose it would be best to directly add the support to the
TBaseVirtualTree class (that way all other descendant classes can have
the support as well). I'd appreciate some help from the VT gurus out
there...

Regards,
Theodor

 | Replies | Author | Date
3725 | Re: TListView.ViewStyle support | Jim Kueneman | Fri 9/14/2001
3743 | Re: TListView.ViewStyle support | Mike Lischke | Sat 9/15/2001


re: New file uploaded to VirtualTreeview

From: Werner Lehmann [wl@b...]
Date: Thu Sep 13, 2001 10:23 pm
Subject: Re: [VirtualTreeview] New file uploaded to VirtualTreeview

Hi Mike,

> Here we are again with a new update. Only a few things happend there:

Release Candidate 1 :)

> - bug fixes (mainly the paint problems mentioned)

The 'area not covered with nodes is not repainted' problem is gone apparently
(confirmed). But the
VCL drag image problem is only partially fixed (although the database entry is
still 'cannot repro-
duce'). When the tree autoscrolls under the drag image it is scrolled too and
thus is duplicated.
I have no idea if there is any way to hide the VCL drag image during the
scrolling, just to let you
know (I hate it to be this constant pain in the - you know where - and always
just point out the bugs).

> - Windows XP style painting is finished, still the scrollbar issue is not yet
decided (I still have
> paint problems on XP RC1, will check again on the first public release in
October)

I like it. Unfortunately it does not fit too well into the Win2k style GUI. But
that's not a problem,
gives just the opportunity to adjust the look & feel to XP when the app runs on
XP. Thanks.

Mike, one more thing. You remember the todo item about removing the +/- button
from nodes with
all invisible children? It is very likely that I need this soon at the company
to provide tree
filtering. Invisible nodes are good, but the +/- is not really acceptable in
the mentioned case.
Maybe I am going to look into this and try to overcome it. Is there a
particular problem why you
delay it (and which I should be aware of) or is it just a matter of time and to
get it done?

Werner

 | Replies | Author | Date
3726 | Re: New file uploaded to VirtualTreeview | Jim Kueneman | Fri 9/14/2001
3755 | Re: New file uploaded to VirtualTreeview | Mike Lischke | Sat 9/15/2001
3727 | Re: New file uploaded to VirtualTreeview | [pdagosta@c...] | Fri 9/14/2001
3732 | Re: New file uploaded to VirtualTreeview | Ariel | Fri 9/14/2001
3744 | Re: New file uploaded to VirtualTreeview | Mike Lischke | Sat 9/15/2001
3749 | Re: New file uploaded to VirtualTreeview | Mike Lischke | Sat 9/15/2001


Bug in TCustomVirtualStringTree.ContentToText

From: Ralf Junker [ralfjunker@g...]
Date: Thu Sep 13, 2001 10:21 pm
Subject: Bug in TCustomVirtualStringTree.ContentToText

Hi,

a bug in TCustomVirtualStringTree.ContentToText can be fixed easily. The
following causes an access vialoation if MaxLevel = 0, because Length(Tabs) = 0.

SetLength(Tabs, MaxLevel);
* Bug: FillChar(Tabs[1], MaxLevel, Separator);

Instead of passing the first char (which sometimes does not exist), simply pass
the dereferenced pointer of the string. This is also the fastest, since no
behind-the scenes-conversion takes place.

SetLength(Tabs, MaxLevel);
* Fix: FillChar(Pointer(Tabs)^, MaxLevel, Separator);

Regards,

-- Ralf

 | Replies | Author | Date
3750 | Re: Bug in TCustomVirtualStringTree.ContentToText | Mike Lischke | Sat 9/15/2001


re: New file uploaded to VirtualTreeview

From: [hj_schnorrenberg@y...]
Date: Fri Sep 14, 2001 8:18 am
Subject: Re: New file uploaded to VirtualTreeview

Hello Mr. Lischke,

I think, there exists a misunderstanding:

Personally, I do not have any problems with protected properies,
GetNodeData or initialization order of properties.

I try to express my point of view as a commercial software
developper, taking into account having also non Mr. Lischkes as
employes (in our language 'den Eda, also der eh da ist').

That means:

1.Every additional line of code,which is neccessary to write, does
cost money and time.

2.Every additional line of code, which is neccessary to write, means
an additional potential bug.

3.Make it as simple as possible for employes as stupid as possible.

4.Do not expect more than standard (e.g. Initialization in
constructor in a arbitary order of initialization the properties).

5.Do not hide anything, because nobody (in commercial world) will use
code, which is hiding anything. If there exists a bug in the
code, you cannot find a workaround, when there is hidden to much (and
VT has bugs, too, as every software has bugs).

IMO, one of Borland's main problems is, to take into account OOP's
sophistical problems, but do not accept the requirements of
commercial software developpers as bugfixing and concentrating on a
robust software (although I do not know any better alternatives).

Perhaps, there is a way to satisfy both, the wishes of OOP's freaks
and the wishes of commercial developpers?

But all these points should only be considered as suggestions (and
not as bugs, but I think, it make no sense to open a further list).

@OOP's freaks: Personally, I'm an OOP freak, too!

Hans-Jürgen Schnorrenberg

 | Replies | Author | Date
3745 | Re: New file uploaded to VirtualTreeview | Mike Lischke | Sat 9/15/2001


re: TListView.ViewStyle support

From: Werner Lehmann [wl@b...]
Date: Fri Sep 14, 2001 10:04 am
Subject: Re: [VirtualTreeview] TListView.ViewStyle support

Hi Theodor,

> I'm thinking of replacing all TListViews in an application with
> (phenominally excellent) TVirtualStringTrees. Although most users don't
> use it, we need to support the vsLargeIcons, vsSmallIcons and vsList
> viewstyles supported by TListView (via the "ViewStyle" property).
>
> How hard would it be to get TVirtualTreeView to support these modes?
> I've started to implement it as a TVirtualStringTree descendant, but I
> suppose it would be best to directly add the support to the
> TBaseVirtualTree class (that way all other descendant classes can have
> the support as well). I'd appreciate some help from the VT gurus out
> there...

I believe you underestimate the amount of work. Please look at posting 828,
the question came up earlier in this list. I would like a virtual listview
along the lines of the virtual treeview as well. But if it should be more
than the virtual listview we are already having (provided by MS) and should
provide all the features VT offers (where applicable of course) there is much
much work ahead down the road. And it should not be based on VTree IMO.

Werner


re: Access violation when program is shotdown

From: Michael Valentiner=Branth [MichaelVB@g...]
Date: Fri Sep 14, 2001 7:32 am
Subject: Re: [VirtualTreeview] Access violation when program is shotdown

Hello Alexander,

> If I understand right When I change version some pieces of code in
> my program may conflict with new version of TV?
>
No, I think you didn't understand me right.

I thought of the following:
You have VT1, with Data1: PNodeData etc.

Now for VT2 you copy pieces of code of VT1 (those things you often need like
Node1 := VT1.AddChild;
Data1 := GetNodeData(Node1);)

But somewhere in the new code you forget to change "VT1" to "VT2" or "Data1" to
Data2" or ...
(this often happens to me, when I copy pieces of code)

So your program then may try to add a "Node2" to "VT1".

The above example might not lead exactly to your error; there are a lot of
similar cases imagible.

Hope that helps,
Michael


re: New file uploaded to VirtualTreeview

From: Jim Kueneman [jimdk@m...]
Date: Fri Sep 14, 2001 3:00 am
Subject: RE: [VirtualTreeview] New file uploaded to VirtualTreeview

Hi Mike,

> > support with three different methods (depending on the OS) and more.
> Currently it is not
> > so easy to provide a decent VT dragimage to this non visual component.
>
>Aha, this is what you mean. Well, Jim already requested this quite a while
>ago. Look closer at
>VT.DragImage.Image.

Unfortunately that was not enough and at that time I felt I had bothered
you enough. The problem is VT must be preparing to do a drag before this
image is created. I copied a bit of code from VT to VET to deal with
it. What we really need is the method that creates the drag image to be
accessable.

> > Yes. But it was nil (if I remember correctly, and the code suggests
> that I do). Throughout
> > the whole source there is only one assignment for FDragObject and that
> is a nil assignment.
> > My guess is that it was forgotten to be stored in DragEnter. I cannot
> check before Monday
> > if that is correct.
>
>Strange, I thought I had already the assignment in
>TVTDragManager.DragEnter and it is there....

The call to DataObject is working in VET so it must be set somewhere

Jim

 | Replies | Author | Date
3756 | Re: New file uploaded to VirtualTreeview | Mike Lischke | Sat 9/15/2001
3760 | Re: New file uploaded to VirtualTreeview | Jim Kueneman | Sat 9/15/2001
3765 | Re: New file uploaded to VirtualTreeview | Mike Lischke | Sun 9/16/2001


re: TListView.ViewStyle support

From: Jim Kueneman [jimdk@m...]
Date: Fri Sep 14, 2001 3:37 am
Subject: Re: [VirtualTreeview] TListView.ViewStyle support

At 01:40 AM 9/14/2001 +0100, you wrote:
>Hi there,
>
>I'm thinking of replacing all TListViews in an application with
>(phenominally excellent) TVirtualStringTrees. Although most users don't
>use it, we need to support the vsLargeIcons, vsSmallIcons and vsList
>viewstyles supported by TListView (via the "ViewStyle" property).
>
>How hard would it be to get TVirtualTreeView to support these modes?
>I've started to implement it as a TVirtualStringTree descendant, but I
>suppose it would be best to directly add the support to the
>TBaseVirtualTree class (that way all other descendant classes can have
>the support as well). I'd appreciate some help from the VT gurus out
>there...

I pondered that too but Werner talked me out of it. It would not be
trivial to make it act like a listview (but it would it be sweet if it did <g>)

Jim


re: New file uploaded to VirtualTreeview

From: Jim Kueneman [jimdk@m...]
Date: Fri Sep 14, 2001 4:37 am
Subject: Re: [VirtualTreeview] New file uploaded to VirtualTreeview

Hi Mike,

>The 'area not covered with nodes is not repainted' problem is gone
>apparently (confirmed). But the
>VCL drag image problem is only partially fixed (although the database
>entry is still 'cannot repro-
>duce'). When the tree autoscrolls under the drag image it is scrolled too
>and thus is duplicated.
>I have no idea if there is any way to hide the VCL drag image during the
>scrolling, just to let you
>know (I hate it to be this constant pain in the - you know where - and
>always just point out the bugs).

Unfortunately the code I had in the CM_DRAG handler needs to be there, the
ImageList_DragEnter and DragLeave calls. The probem I believe is during
the auto scroll you have captured the mouse. For some reason once that
happens the ImageList_DragShowNoLock will not respond unless your window
has taken control of the ImageList through ImageList_DragEnter. (It may be
necessary to to ImageList_DragLeave/ImageList_DragEnter before and after
the paint but that may be just the DAD_DragEnter/DAD_DragLeave calls so
don't quote me)

Jim

 | Replies | Author | Date
3755 | Re: New file uploaded to VirtualTreeview | Mike Lischke | Sat 9/15/2001


re: New file uploaded to VirtualTreeview

From: [pdagosta@c...]
Date: Fri Sep 14, 2001 12:25 pm
Subject: Re: New file uploaded to VirtualTreeview

> Mike, one more thing. You remember the todo item about removing the
+/- button from nodes with
> all invisible children? It is very likely that I need this soon at
the company to provide tree
> filtering. Invisible nodes are good, but the +/- is not really
acceptable in the mentioned case.
> Maybe I am going to look into this and try to overcome it. Is there
a particular problem why you
> delay it (and which I should be aware of) or is it just a matter of
time and to get it done?
>
> Werner

When this is implemented, I would request that it be added as an
option. I currently have a VT that only allows for children nodes on
specific nodes. To make it visually obvious which nodes can have
children I add an invisible node to force the +/- to appear.

Thanks,
Paul D'Agosta

 | Replies | Author | Date
3732 | Re: New file uploaded to VirtualTreeview | Ariel | Fri 9/14/2001
3744 | Re: New file uploaded to VirtualTreeview | Mike Lischke | Sat 9/15/2001


Re[2]: Access violation when program is shotdown

From: [avr555@m...]
Date: Fri Sep 14, 2001 12:34 pm
Subject: Re[2]: [VirtualTreeview] Access violation when program is shotdown

Hello Werner,

Thursday, September 13, 2001, 10:47:27 PM, you wrote:

WL> Hi Alexander,

>> In my program I simple fill the trees and nothing else.
>> When I put in second tree nodes after root node I receive 'Access
>> Violation'. When I fill only root node all OK.

WL> Sounds as if you code provide small sample code? If so, you may upload
WL> it to YG and I'll have a look at it.

WL> Regards,
WL> Werner

WL> To unsubscribe from this group, send an email to:
WL> [VirtualTreeview-unsubscribe@egroups.com

WL> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/

This is my my Short program

unit Unit1;

interface

uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
ExtCtrls, StdCtrls, ComCtrls, fileTreeView, VirtualTrees, Db,
Grids, DBGrids, ADODB, ImgList ;

type
PMyRec = ^TMyRec;
TMyRec = record
Caption: WideString;
Code:string;
SourceID : integer;
ImageIndex :integer;
end;

type
PRecTo = ^TRecTo;
TRecTo = record
Name : WideString;
Code:string;
SourceID : integer;
ImageIndex :integer;
end;

type
TForm1 = class(TForm)
tvwWareFrom: TVirtualStringTree;
ADOConnection1: TADOConnection;
CatQuery: TADOQuery;
DataSource1: TDataSource;
ImageList1: TImageList;
Splitter1: TSplitter;
tvwWareTo: TVirtualStringTree;
ImageList2: TImageList;
procedure Button1Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure tvwWareFromGetText(Sender: TBaseVirtualTree;
Node: PVirtualNode; Column: Integer; TextType: TVSTTextType;
var Text: WideString);
procedure tvwWareFromExpanding(Sender: TBaseVirtualTree;
Node: PVirtualNode; var Allowed: Boolean);
procedure FormDestroy(Sender: TObject);
procedure tvwWareFromGetImageIndex(Sender: TBaseVirtualTree;
Node: PVirtualNode; Kind: TVTImageKind; Column: Integer;
var Ghosted: Boolean; var Index: Integer);
procedure tvwWareToGetImageIndex(Sender: TBaseVirtualTree;
Node: PVirtualNode; Kind: TVTImageKind; Column: Integer;
var Ghosted: Boolean; var Index: Integer);
procedure tvwWareToGetText(Sender: TBaseVirtualTree;
Node: PVirtualNode; Column: Integer; TextType: TVSTTextType;
var Text: WideString);
procedure FillWareTo();
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
gbFlag: boolean; //Ãëîáàëüíûé ôëàã ïî ïåðåòàñêèâàíèþ
x1,y1 : integer;
implementation
{$R *.DFM}
procedure TForm1.Button1Click(Sender: TObject);
var
NodeData:PMyRec;
Node:PVirtualNode;
Node1:PVirtualNode;
begin
Node1:=tvwWareFrom.GetFirst;
while not CatQuery.Eof do
begin
Node := tvwWareFrom.AddChild(Node1);
NodeData := tvwWareFrom.GetNodeData(Node);
NodeData.Caption := CatQuery.Fields[1].Text;
NodeData.sourceID := 1;
NodeData.code := CatQuery.Fields[0].Text;
NodeData.ImageIndex:=1;
if StrToInt(CatQuery.Fields[2].Text)>0 then
begin
Node := tvwWareFrom.AddChild(Node);
NodeData := tvwWareFrom.GetNodeData(Node);
NodeData.Caption := '&?&';
end;
CatQuery.Next;
end; // while
end;

procedure TForm1.FormCreate(Sender: TObject);
var
Node:PVirtualNode;
NodeData:PMyRec;
begin
tvwWareFrom.NodeDataSize := SizeOf(TMyRec);
tvwWareTo.NodeDataSize := SizeOf(PRecTo);
Node:=tvwWareFrom.AddChild(nil);
NodeData := tvwWareFrom.GetNodeData(Node);
NodeData.Caption:= 'Äîñòóïíûå òîâàðû';
NodeData.ImageIndex:=0;
Button1Click(Sender);
FillWareTo;
end;
procedure TForm1.tvwWareFromGetText(Sender: TBaseVirtualTree;
Node: PVirtualNode; Column: Integer; TextType: TVSTTextType;
var Text: WideString);
var NodeData :PMyRec;
begin
NodeData := tvwWareFrom.GetNodeData(Node);
Text:= NodeData.Caption;
end;
procedure TForm1.tvwWareFromExpanding(Sender: TBaseVirtualTree;
Node: PVirtualNode; var Allowed: Boolean);
var
NodeData:PMyRec;
lcSql : WideString;
Node1:PVirtualNode;
begin
lcSql :='';
NodeData := tvwWareFrom.GetNodeData(Node.FirstChild);
if NodeData.Caption = '&?&' then
begin
tvwWareFrom.DeleteChildren(Node);
CatQuery.Active:=false;
CatQuery.SQL.Clear;
NodeData :=tvwWareFrom.GetNodeData(Node);
lcSql:= 'SELECT DISTINCT c.code_category,
dbo_languages_category.category_s_name, (SELECT COUNT(*) FROM dbo_category
WHERE code_high_category = c.code_category ) AS cat_count';
CatQuery.SQL.Add(lcSql);
lcSql:= 'FROM dbo_category AS c , dbo_search_category, dbo_category_wares,
dbo_languages_category';
CatQuery.SQL.Add(lcSql);
lcSql:='WHERE dbo_languages_category.code_language=1 AND
dbo_search_category.code_category_sub = dbo_category_wares.code_category AND ';
lcSql:=lcSql+'c.code_category = dbo_search_category.code_category_high AND
c.code_category = dbo_languages_category.code_category AND
c.code_high_category='+ NodeData.code;
CatQuery.SQL.Add(lcSql);
lcSql:='ORDER BY category_s_name';
CatQuery.SQL.Add(lcSql);
CatQuery.Active:=true;
while not CatQuery.Eof do
begin
Node1 := tvwWareFrom.AddChild(Node);
NodeData := tvwWareFrom.GetNodeData(Node1);
NodeData.Caption := CatQuery.Fields[1].Text;
NodeData.sourceID := 1;
NodeData.code := CatQuery.Fields[0].Text;
NodeData.ImageIndex:=1;
if StrToInt(CatQuery.Fields[2].Text)>0 then
begin
Node1 := tvwWareFrom.AddChild(Node1);
NodeData := tvwWareFrom.GetNodeData(Node1);
NodeData.Caption := '&?&';
end
else
begin
NodeData.ImageIndex:=3;
Node1 := tvwWareFrom.AddChild(Node1);
NodeData := tvwWareFrom.GetNodeData(Node1);
NodeData.Caption := 'W?W'; //Çíà÷îê, ÷òî íóæíî çàíîñèòü òîâàðû
end;
CatQuery.Next;
end; // while
end //if
else
if NodeData.Caption = 'W?W' then
begin
tvwWareFrom.DeleteChildren(Node);
CatQuery.Active:=false;
CatQuery.SQL.Clear;
NodeData :=tvwWareFrom.GetNodeData(Node);
lcSql:='SELECT dbo_languages_wares.code_ware,
dbo_languages_wares.ware_s_name';
CatQuery.SQL.Add(lcSql);
lcSql:='FROM dbo_category_wares INNER JOIN dbo_languages_wares ON
dbo_category_wares.code_ware = dbo_languages_wares.code_ware';
CatQuery.SQL.Add(lcSql);
lcSql:='WHERE dbo_languages_wares.code_language=1 AND
dbo_category_wares.code_category='+NodeData.code;
CatQuery.SQL.Add(lcSql);
lcSql:='ORDER BY ware_s_name';
CatQuery.SQL.Add(lcSql);
CatQuery.Active:=true;
while not CatQuery.Eof do
begin
Node1 := tvwWareFrom.AddChild(Node);
NodeData := tvwWareFrom.GetNodeData(Node1);
NodeData.Caption := CatQuery.Fields[1].Text;
NodeData.sourceID := 2;
NodeData.code := CatQuery.Fields[0].Text;
NodeData.ImageIndex:=2;
CatQuery.Next;
end; // while
end; //if
end;

procedure TForm1.FormDestroy(Sender: TObject);
begin
tvwWareTo.Clear;
// tvwWareTo.Destroy;
end;

procedure TForm1.tvwWareFromGetImageIndex(Sender: TBaseVirtualTree;
Node: PVirtualNode; Kind: TVTImageKind; Column: Integer;
var Ghosted: Boolean; var Index: Integer);
var
NodeData:PMyRec;
begin
NodeData:= Sender.GetNodeData(Node);
index:=NodeData.ImageIndex;
end;

procedure TForm1.tvwWareToGetImageIndex(Sender: TBaseVirtualTree;
Node: PVirtualNode; Kind: TVTImageKind; Column: Integer;
var Ghosted: Boolean; var Index: Integer);
var
NodeData:PRecTo;
begin
NodeData:= tvwWareTo.GetNodeData(Node);
index:=NodeData.ImageIndex;
Ghosted:=false;
end;

procedure TForm1.tvwWareToGetText(Sender: TBaseVirtualTree;
Node: PVirtualNode; Column: Integer; TextType: TVSTTextType;
var Text: WideString);
var
NodeData:PRecTo;
begin
NodeData:= Sender.GetNodeData(Node);
Text:=NodeData.Name;
end;

procedure TForm1.FillWareTo();
var
Node1, Node2:PVirtualNode;
NodeData1:PRecTo;
lcSql: WideString;

begin
Node2:=tvwWareTo.AddChild(nil);
NodeData1 := tvwWareTo.GetNodeData(Node2);
NodeData1.Name := 'Ýêñïîðòèðîâàííûå òîâàðû ïîëüçîâàòåëÿ';
NodeData1.ImageIndex:=0;

CatQuery.Active:=false;
CatQuery.SQL.Clear;

lcSql := 'SELECT ThereID, s_name, rosnprice FROM TmpStorage';
CatQuery.SQL.Add(lcSql);
CatQuery.Active:=true;

while not CatQuery.Eof do
begin
Node1 := tvwWareFrom.AddChild(node2); //When I coment this
lines - all rirght
NodeData1 := tvwWareTo.GetNodeData(Node1);//When I coment this
lines - all rirght
NodeData1.Name := CatQuery.Fields[1].Text;//When I coment this
lines - all rirght
NodeData1.code := CatQuery.Fields[0].Text;//When I coment this
lines - all rirght
NodeData1.ImageIndex:=1;//When I coment this
lines - all rirght
NodeData1.SourceID := 1;//When I coment this
lines - all rirght
CatQuery.Next;
end; // while
end;
end.

--
Best regards,
Alexander Rudenko mailto:avr555@m...]


Bug entry 49

From: [pdagosta@c...]
Date: Fri Sep 14, 2001 12:42 pm
Subject: Bug entry 49

I've uploaded a demo demonstrating bug 49.
The first child of all of the root nodes is invisible. The right
arrow key correctly expands the node. However, when you hit the right
arrow key a second time, it should move to the first visible
child, which is not always the first child.

Thanks for your time,
Paul D'Agosta

 | Replies | Author | Date
3746 | Re: Bug entry 49 | Mike Lischke | Sat 9/15/2001


re: Access violation when program is shotdown

From: Werner Lehmann [wl@b...]
Date: Fri Sep 14, 2001 2:01 pm
Subject: Re: [VirtualTreeview] Access violation when program is shotdown

Hi Alexander,

> This is my my Short program

...

> type
> PRecTo = ^TRecTo;
> TRecTo = record
> Name : WideString;
> Code:string;
> SourceID : integer;
> ImageIndex :integer;
> end;

...

> tvwWareFrom.NodeDataSize := SizeOf(TMyRec);
> tvwWareTo.NodeDataSize := SizeOf(PRecTo);

I have not tested your code yet, but this is obviously wrong. Try:

tvwWareTo.NodeDataSize := SizeOf(TRecTo);

Werner

 | Replies | Author | Date
3762 | Re[2]: [VirtualTreeview] Access violation when pr | [avr555@m...] | Sun 9/16/2001


Hint Size Limitation?

From: "Tom Hahn" [thahn@h...]
Date: Fri Sep 14, 2001 4:04 pm
Subject: Hint Size Limitation?

I intend to use VirtualStringTree in an application that will show a tree
view with several columns. Two of the columns will contain either an icon or
a short string. When the mouse hovers over one of these icons, I want to
display a multi-line string that could be several hundred characters in
length. Since this is very similar to "hint", that would be an easy way to
accomplish this. The questions that arise are:

1. Is there a limit on the length of the hint string when furnished in
response to OnGetHint?

2. Is there a way to get line wrap in the hint string if wider than the
screen (or would the application have to insert line breaks)?

3. Is there a limit on the number of lines?

4. Is there a way to make the hint display persistent until the mouse moves
(rather than setting the delay to some high value)?

5. Is there a better way to do this than using "hint"?

Tom

---------------------------------
Thomas Hahn
Hahn Technology, Inc.
mailto:[thahn@h...]
http://www.hahntech.com
---------------------------------
The home of:
Scan: Hardware/Software Inventory
WebBank: URL Manager
---------------------------------

 | Replies | Author | Date
3751 | Re: Hint Size Limitation? | Mike Lischke | Sat 9/15/2001


re: New file uploaded to VirtualTreeview

From: "Ariel" [asel98@y...]
Date: Fri Sep 14, 2001 7:30 pm
Subject: Re: New file uploaded to VirtualTreeview

if you add (manually) the vsHasChildren to node.states, it shows the
+/- with or without subnodes (childrens).

--- In [VirtualTreeview@y...], [pdagosta@c...] wrote:
>
> > Mike, one more thing. You remember the todo item about removing
the
> +/- button from nodes with
> > all invisible children? It is very likely that I need this soon
at
> the company to provide tree
> > filtering. Invisible nodes are good, but the +/- is not really
> acceptable in the mentioned case.
> > Maybe I am going to look into this and try to overcome it. Is
there
> a particular problem why you
> > delay it (and which I should be aware of) or is it just a matter
of
> time and to get it done?
> >
> > Werner
>
> When this is implemented, I would request that it be added as an
> option. I currently have a VT that only allows for children nodes
on
> specific nodes. To make it visually obvious which nodes can have
> children I add an invisible node to force the +/- to appear.
>
> Thanks,
> Paul D'Agosta


re: New file uploaded to VirtualTreeview

From: Werner Lehmann [wl@b...]
Date: Fri Sep 14, 2001 9:12 am
Subject: Re: [VirtualTreeview] New file uploaded to VirtualTreeview

Hi Mike,

> Aha, this is what you mean. Well, Jim already requested this quite a while
ago. Look closer at
> VT.DragImage.Image.

Ok, I'll do that.

> > Yes. But it was nil (if I remember correctly, and the code suggests that I
do). Throughout
> > the whole source there is only one assignment for FDragObject and that is a
nil assignment.
> > My guess is that it was forgotten to be stored in DragEnter. I cannot check
before Monday
> > if that is correct.
>
> Strange, I thought I had already the assignment in TVTDragManager.DragEnter
and it is there....

It wasn't there in 2.5.27 but now it is :)

Werner


re: Repaint problems with 2.5.27

From: Werner Lehmann [wl@b...]
Date: Fri Sep 14, 2001 9:17 am
Subject: Re: [VirtualTreeview] Repaint problems with 2.5.27

Hi Mike,

> Well, the AV is mysterious. It is not clear to me why it appears. Please try
the new version and
> tell me what happens. Also the drag image problem is now solved thank your
and Jim's suggestions. I
> made it a bit easier and it looks like it works for all cases now. Btw: there
aren't many cases. How
> many VCL controls actually use a drag image?

I have not seen the AV since. Hopefully it stays where it came from or becomes
reproducable :)
All listviews and treeviews provide dragimage IIRC, even when they are
comctrls. And because
VT cannot fully replace a TListview, some people will still use it. There may
be some cases where
the VCL dragimage problem might surface then.

Werner


Lurker Report (was: New file uploaded to VirtualTreeview)

From: "Mark Watts" [mwatts@s...]
Date: Fri Sep 14, 2001 8:43 pm
Subject: Lurker Report (was: New file uploaded to VirtualTreeview)

>I have uploaded the new version of the "main" demo, but only as executable
(source will be available
>too of course). I would very much appreciate if some of the 650 lurkers on
this list could have a
>look and tell me what they would like to have changed.

Mike,
First, let me say you have done a very nice job with this component. Thank
you for all the time and hard work you (and others) have put into VTV.

All comments reference the demo Advanced.exe.

Bug(s)
1. Goto the "Property Tree Simulation", the third demo select the value for
the Title property, type anything ('x'), click any other property,
immediately click to go to another demo and you will get the following error
message:
---------------------------
Advanced
---------------------------
Cannot focus a disabled or invisible window.
---------------------------
OK
---------------------------

2. Select the forth demo, "Hide and show nodes".
This demo was especially unstable. I am unable to produce a set number of
steps, but simply by clicking around on the different options I was able to
cause the following:
a. An assert would fire warning that Node can not be nul. This would always
happen when I clicked in the TreeView area with the "hide nodes with
children only" option and there was nothing showing in the view, which would
often happen.
---------------------------
Advanced
---------------------------
Node must not be nil. (V:\Library\VirtualTree\VirtualTrees.pas, line 20730)
---------------------------
OK
---------------------------

b. An AV with an integer overflow.

3. Go to the 6th demo "Tree in Grid simulation" and select any date for
editing. Change the date using the drop down editor and then click on
another row. This error occurs
---------------------------
Advanced
---------------------------
Invalid variant type conversion.
---------------------------
OK
---------------------------

Other
1. In the "Paint Tree as a directory Tree" demo with the Toggle Grid Lines
off, the grid lines are still displayed on to the left of the tree item
images.

Just some things from a lurker (as requested)
Thanks
Mark

 | Replies | Author | Date
3739 | Addition/more details on the "Lurker Report" | [helge@e...] | Sat 9/15/2001
3740 | Some other things | [helge@e...] | Sat 9/15/2001
3747 | Re: Some other things | Mike Lischke | Sat 9/15/2001
3753 | Re: Lurker Report (was: New file uploaded to Virt | Mike Lischke | Sat 9/15/2001
3767 | Re: Lurker Report (was: New file uploaded to Virt | Wim van der Vegt | Sun 9/16/2001
3794 | Re: Lurker Report (was: New file uploaded to Virt | Mike Lischke | Tue 9/18/2001
3808 | Re: Lurker Report (was: New file uploaded to Virt | Wim van der Vegt | Wed 9/19/2001
3822 | Re: Lurker Report (was: New file uploaded to Virt | Mike Lischke | Sat 9/22/2001
3850 | Re: Lurker Report (was: New file uploaded to Virt | Moritz Franckenstein | Thu 9/27/2001


re: Re: New file uploaded to VirtualTreeview

From: Werner Lehmann [wl@b...]
Date: Fri Sep 14, 2001 9:08 pm
Subject: Re: [VirtualTreeview] Re: New file uploaded to VirtualTreeview

Hi Paul,

> When this is implemented, I would request that it be added as an
> option. I currently have a VT that only allows for children nodes on
> specific nodes. To make it visually obvious which nodes can have
> children I add an invisible node to force the +/- to appear.

Well, I am not anywhere near to an 'implemented' status. But IMO this is
a misuse of the +/-. Wouldn't it be much better to add an 'Add node'
child to every node where children can be added? The user would double
click on these nodes and have a new node then (possibly after a dialog
has been presented).

Werner

 | Replies | Author | Date
3782 | Re: New file uploaded to VirtualTreeview | [pdagosta@c...] | Mon 9/17/2001


re: Re: New file uploaded to VirtualTreeview

From: Werner Lehmann [wl@b...]
Date: Fri Sep 14, 2001 9:30 pm
Subject: Re: [VirtualTreeview] Re: New file uploaded to VirtualTreeview

Ariel wrote:
>
> if you add (manually) the vsHasChildren to node.states, it shows the
> +/- with or without subnodes (childrens).

Hm, thanks for the suggestion. The problem is only, that I'd still have to
iterate through the children to see if all are invisible. Would be better
if the component did that itself (and once for all). Also, what is when I
double click on such a node with (manually) removed + button. Isn't it added
again?

Maybe each node can get some internal data which says whether all children
are invisible? The paint routine would then check this internal data every-
where where currently vsHasChildren is checked. The internal data would serve
as a 'cache' and would avoid that the children have to be examined over and
over again for each paint cycle. The hard part, actually hiding the nodes, is
already done by Mike.

Werner


BCB5

From: [NRYJGUSFSVEY@s...]
Date: Fri Sep 14, 2001 8:29 pm
Subject: BCB5

Hi,

I still have to include the line:

{$HPPEMIT 'struct TCacheEntry;'}

To compile the created .hpp file successfully with BCB5. As this is
Release Candidate 1, I guess you could implement it now :).

Bye

Marco Loos

--
NJ0Y - Marco Loos, 48165 Münster
http://nj0y.de
PWGen - Der Passwortverwalter: http://www.pwgen.de

Sie haben die Position des Mauszeigers verändert.
Starten Sie Windows neu, damit die Änderungen wirksam werden.

 | Replies | Author | Date
3748 | Re: BCB5 | Mike Lischke | Sat 9/15/2001


Addition/more details on the "Lurker Report"

From: [helge@e...]
Date: Sat Sep 15, 2001 8:06 am
Subject: Addition/more details on the "Lurker Report"

> b. An AV with an integer overflow.
>

It happens when you have hidden all nodes with "hide only nodes
having children" and/or "hide all". As soon as you try to change
the "hide-status" you get the integer overflow. And after this you
aren't able to switch to another demo any more - you get "Access
violation at address 00366E6F. Read of address 00366E6F.". When you
try to close the program Windows says the following:

Error in application: The command in "0x00000000" refers on memory
in "0x00000000". The command "read" couldn't be processed on the
memory. Press "OK" to abort the program. Press "Cancel" to debug the
program.

Afterwards you get an "Exception EAccessViolation in module
Advanced.exe at 00000000. Access violation at address 00000000. Read
of address 00000000."

Maybe it's important to you that I'm using W2K.

Helge.

P.S. Be aware! I'll test it out further as soon as I've posted this
message! *g*


Some other things

From: [helge@e...]
Date: Sat Sep 15, 2001 8:18 am
Subject: Some other things

It would be cool to select a row by clicking on the image in the
XPdemo - I haven't tested it in any other demos ... but I would like
it (maybe only as an option).

Aside of all the complaining here: The demo looks well and of course:
the underlying VirtualTreeView is for me one of the best done
components ever!

Helge.

 | Replies | Author | Date
3747 | Re: Some other things | Mike Lischke | Sat 9/15/2001


Hints (2.5.31)

From: [NRYJGUSFSVEY@s...]
Date: Sat Sep 15, 2001 8:38 am
Subject: Hints (2.5.31)

Hi,

when I move my mouse over an entry where a hint appears (because the
text is too long) and I move my mouse to another entry where a hint
should appear BEFORE THE FIRST HINT IS COMPLETELY FADED IN, the second
hint does not appear.

Greetz

Marco Loos

--
NJ0Y - Marco Loos, 48165 Münster
http://nj0y.de
PWGen - Der Passwortverwalter: http://www.pwgen.de

Sie haben die Position des Mauszeigers verändert.
Starten Sie Windows neu, damit die Änderungen wirksam werden.

 | Replies | Author | Date
3754 | Re: Hints (2.5.31) | Mike Lischke | Sat 9/15/2001


Editing (2.5.31)

From: [NRYJGUSFSVEY@s...]
Date: Sat Sep 15, 2001 10:29 am
Subject: Editing (2.5.31)

Hi,

when editing a node's caption in 1-column-mode with a column width
larger than visible, the window is scrolled to the right, so that the
caption is not visible any longer.

This problem did already exist some versions ago, and the bug was fixed
by Mike. Now it is there again.

Mike, if you still have my old mails, it was on May 15th, version was
2.5.9. Your answer from May 16th:

"War nur ein ganz kleines Problem. Ich habe für die Grid Extension das
ScrollIntoView erweitert, ohne darauf Rücksicht zu nehmen, dass für normale
Trees nicht so weit gescrolled werden darf (nur das Textrect ist wichtig
dabei, nicht die ganze Spalte). Das ist jetzt gefixt."

Greetz

Marco Loos

--
NJ0Y - Marco Loos, 48165 Münster
http://nj0y.de
PWGen - Der Passwortverwalter: http://www.pwgen.de

Sie haben die Position des Mauszeigers verändert.
Starten Sie Windows neu, damit die Änderungen wirksam werden.

 | Replies | Author | Date
3757 | Re: Editing (2.5.31) | Mike Lischke | Sat 9/15/2001


re: TListView.ViewStyle support

From: "Mike Lischke" [lists@l...]
Date: Sat Sep 15, 2001 5:40 pm
Subject: RE: [VirtualTreeview] TListView.ViewStyle support

Hi Theodor,

> How hard would it be to get TVirtualTreeView to support these modes?
> I've started to implement it as a TVirtualStringTree descendant, but I
> suppose it would be best to directly add the support to the
> TBaseVirtualTree class (that way all other descendant classes can have
> the support as well). I'd appreciate some help from the VT gurus out
> there...

Although I would love to see such a control I don't think it would be a good
idea to use VT as
ancestor. There are too many things different between listviews and treeviews
when you consider the
large icon etc. modes.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: Re: New file uploaded to VirtualTreeview

From: "Mike Lischke" [lists@l...]
Date: Sat Sep 15, 2001 5:40 pm
Subject: RE: [VirtualTreeview] Re: New file uploaded to VirtualTreeview

Hi Paul,

> When this is implemented, I would request that it be added as an
> option.

Of course. There is now an toAutoHideButtons option.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: Re: New file uploaded to VirtualTreeview

From: "Mike Lischke" [lists@l...]
Date: Sat Sep 15, 2001 5:40 pm
Subject: RE: [VirtualTreeview] Re: New file uploaded to VirtualTreeview

Hello,

although I'm currently not in the mood to discuss serious OOP design decisions
let me at least add
some comments.

> 1.Every additional line of code,which is neccessary to write, does
> cost money and time.

Don't forget in this calculation what you save by using existing code. Assume
at least a man year of
work for VT (it was actually 2 1/2, but I did not work every day on it and when
then not 8 hours a
day on average). This means at least $50000 for this control you get for free
(admittedly, less the
work you need to make it usable in your projects).

> 2.Every additional line of code, which is neccessary to write, means
> an additional potential bug.

Yes, and? If you want to avoid that then you cannot write software.

> 3.Make it as simple as possible for employes as stupid as possible.

Not quite. The rule is: as simple as possible and as complex as necessary. Or
too speak with Albert
Einstein: make it as simple as possible, but not simpler.

> 4.Do not expect more than standard (e.g. Initialization in
> constructor in a arbitary order of initialization the properties).

If I only can expect standard abilities then I can only write a standard
control. Everything has two
sides, VT's other one is its complexity (and incompatiblity with the standard
TTreeview).

> 5.Do not hide anything, because nobody (in commercial world) will use
> code, which is hiding anything.

This is usually not only in the commercial world so. The meaning of hiding
something *is* to prevent
its use.

>If there exists a bug in the
> code, you cannot find a workaround, when there is hidden to much (and
> VT has bugs, too, as every software has bugs).

As usually in software development: if you cannot find the problem on a
particluar level then go one
down until you find it. From the component development's point of view one
level down means going
directly to the full component source. I guess you would never use a component
for which you have
not got the source.

> IMO, one of Borland's main problems is, to take into account OOP's
> sophistical problems, but do not accept the requirements of
> commercial software developpers as bugfixing and concentrating on a
> robust software (although I do not know any better alternatives).

Looks to me as would you want to swim without making yourself wet. I hope I do
not need to discuss
the advantages of OOP here (and it is also not the right forum), but it is
similar to using a
version control system: for the additional functionality, security, etc. etc.
you have to spend more
time to learn or have additional work. That's the nature of the world, not only
software development
(in such contexts I love to cite the ying-yang prinicple, but here it would be
far off topic).

> Perhaps, there is a way to satisfy both, the wishes of OOP's freaks
> and the wishes of commercial developpers?

:o] I wouldn't even separate both groups. I'm actually both in personal union
and there are many
people like me. Finally, it is always a matter of priorities, isn't it?

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: Bug entry 49

From: "Mike Lischke" [lists@l...]
Date: Sat Sep 15, 2001 5:40 pm
Subject: RE: [VirtualTreeview] Bug entry 49

> The first child of all of the root nodes is invisible. The right
> arrow key correctly expands the node. However, when you hit the right
> arrow key a second time, it should move to the first visible
> child, which is not always the first child.

Ok, this time I got it. I have fixed this bug now.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: Some other things

From: "Mike Lischke" [lists@l...]
Date: Sat Sep 15, 2001 5:40 pm
Subject: RE: [VirtualTreeview] Some other things

Hi Helge,

> It would be cool to select a row by clicking on the image in the
> XPdemo - I haven't tested it in any other demos ... but I would like
> it (maybe only as an option).

:o] This is a little trick. I used the state images (with a smaller size) for
the sub items. Clicks
on state images do not focus a node (same as clicks on check images) while
clicks on normal icons do
this.

> Aside of all the complaining here: The demo looks well and of course:
> the underlying VirtualTreeView is for me one of the best done
> components ever!

Thank you :o] However I do not consider the reports here as complains (at least
most of the time).
The people here were the best beta testers I have had for any of my software!
And if critics are
constructive and meaningful then I always welcome them.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: BCB5

From: "Mike Lischke" [lists@l...]
Date: Sat Sep 15, 2001 5:40 pm
Subject: RE: [VirtualTreeview] BCB5

Hi Marco,

> {$HPPEMIT 'struct TCacheEntry;'}
> To compile the created .hpp file successfully with BCB5. As this is
> Release Candidate 1, I guess you could implement it now :).

Where should this compiler command be placed? Is the immediately before the
interface uses clause a
good place (together with {$HPPEMIT '#include <objidl.h>'}?

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: New file uploaded to VirtualTreeview

From: "Mike Lischke" [lists@l...]
Date: Sat Sep 15, 2001 5:40 pm
Subject: RE: [VirtualTreeview] New file uploaded to VirtualTreeview

Hi Werner,

> Release Candidate 1 :)

Jaaaha. I have no intention to add more functionality before releasing the next
public version
(except that I did include the auto hide button stuff for invisible child
nodes). Only bug fixes,
the demos and the documentation left.

> The 'area not covered with nodes is not repainted' problem is gone apparently
(confirmed). But the
> VCL drag image problem is only partially fixed.

Yes, I forgot the autoscroll case. Also this seems now to be fixed.

> I have no idea if there is any way to hide the VCL drag image during the
scrolling, just
> to let you know

It is, indeed. I have included the same checks from VT.WMPaint into
DoSetOffsetXY and appearantly it
works.

>(I hate it to be this constant pain in the - you know where - and always just
point
> out the bugs).

~ :o]

> I like it. Unfortunately it does not fit too well into the Win2k style GUI.
But that's
> not a problem, gives just the opportunity to adjust the look & feel to XP
when the app runs on XP.
Thanks.

Exactly, it is meant only for XP because of the self drawn header including the
XP manifest does not
automatically turn the header into XP style (as it does with standard Delphi
controls). I found
however a little bug, which I can still have to fix (one color does not appear
as expected).

> Mike, one more thing. You remember the todo item about removing the +/-
button from nodes with
> all invisible children? It is very likely that I need this soon at the
company to provide tree
> filtering. Invisible nodes are good, but the +/- is not really acceptable in
the mentioned case.

Well, now also this feature is built in. I had to touch the code anyway because
of a difficult
problem related to hiding/showing nodes. So you can happily look forward your
own implementation
(unless I put in a new bug) :o].

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: Bug in TCustomVirtualStringTree.ContentToText

From: "Mike Lischke" [lists@l...]
Date: Sat Sep 15, 2001 5:40 pm
Subject: RE: [VirtualTreeview] Bug in TCustomVirtualStringTree.ContentToText

Hi Ralf,

> a bug in TCustomVirtualStringTree.ContentToText can be fixed easily. The
following causes
> an access vialoation if MaxLevel = 0, because Length(Tabs) = 0.

Thank you for the report. I have fixed the problem.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: Hint Size Limitation?

From: "Mike Lischke" [lists@l...]
Date: Sat Sep 15, 2001 5:40 pm
Subject: RE: [VirtualTreeview] Hint Size Limitation?

Hi Tom,

> 1. Is there a limit on the length of the hint string when furnished in
> response to OnGetHint?

No, there is no limit.

> 2. Is there a way to get line wrap in the hint string if wider than the
> screen (or would the application have to insert line breaks)?

You have to insert the line breaks since automatic line breaks for Unicode text
is very complex.

> 3. Is there a limit on the number of lines?

Also there: no limit. However I have never tried to fade in a screen sized hint
:-)

> 4. Is there a way to make the hint display persistent until the mouse moves
> (rather than setting the delay to some high value)?

Never heard of one, but then I didn't search either. Perhaps you can set the
hint hide timeout to -1
or something like this? Try the OH or search www.google.com.

> 5. Is there a better way to do this than using "hint"?

No, hints are perfect for this purpose.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


Bug reports

From: "Mike Lischke" [lists@l...]
Date: Sat Sep 15, 2001 5:40 pm
Subject: Bug reports

Werner, I cannot reproduce what you wrote in entry #56. Please try it with the
new demo (use the second or eighth demo).
Martin, entry #58 is also nothing I can reproduce. Perhaps you have enabled the
auto column span feature?
Wim, entry #59 is indeed related to #58 (this number is used twice) and already
fixed. Btw: never use double buffering with VT, you only double efforts (VT has
its own double buffering, which is much more effective).
Jim, entry #60 is a bit unexpected. Can you reproduce the drag image problem
with the new demo? If not, where did you encounter it?

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net

 | Replies | Author | Date
3761 | Re: Bug reports | Jim Kueneman | Sat 9/15/2001
3776 | Re: Bug reports | Werner Lehmann | Sun 9/16/2001


re: Lurker Report (was: New file uploaded to VirtualTreeview)

From: "Mike Lischke" [lists@l...]
Date: Sat Sep 15, 2001 5:40 pm
Subject: RE: [VirtualTreeview] Lurker Report (was: New file uploaded to VirtualTreeview)

Hi Mark,

> First, let me say you have done a very nice job with this component. Thank
> you for all the time and hard work you (and others) have put into VTV.

You are welcome :o] and thank you for sending the report. See below for my
comments.

> 1. Goto the "Property Tree Simulation", the third demo select the value for
> the Title property, type anything ('x'), click any other property,
> Cannot focus a disabled or invisible window.

Fixed.

> This demo was especially unstable. I am unable to produce a set number of
> steps, but simply by clicking around on the different options I was able to
> cause the following:

I put some effort today into this problem and think it is save now. There was
some confusion when a
node's parents must be updated when the node became visible or invisble.

> 3. Go to the 6th demo "Tree in Grid simulation" and select any date for
> editing. Change the date using the drop down editor and then click on
> another row. This error occurs

This is something I cannot reproduce. It works fine on my machine. Let's keep
that for a while until
I can give out the demo source.

> 1. In the "Paint Tree as a directory Tree" demo with the Toggle Grid Lines
> off, the grid lines are still displayed on to the left of the tree item
> images.

The option to switch off grid lines will be removed as the bands will always
show lines.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: Hints (2.5.31)

From: "Mike Lischke" [lists@l...]
Date: Sat Sep 15, 2001 5:40 pm
Subject: RE: [VirtualTreeview] Hints (2.5.31)

> when I move my mouse over an entry where a hint appears (because the
> text is too long) and I move my mouse to another entry where a hint
> should appear BEFORE THE FIRST HINT IS COMPLETELY FADED IN, the second
> hint does not appear.

This is by design. Otherwise it will come to serious trouble because of nested
animation loops. If
you do not like this effect then set animation to a very short time (Microsoft
recommends 200 ms,
which is the default value in VT) or disable it entirely.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: New file uploaded to VirtualTreeview

From: "Mike Lischke" [lists@l...]
Date: Sat Sep 15, 2001 5:40 pm
Subject: RE: [VirtualTreeview] New file uploaded to VirtualTreeview

> Unfortunately the code I had in the CM_DRAG handler needs to be there, the
> ImageList_DragEnter and DragLeave calls. The probem I believe is during
> the auto scroll you have captured the mouse.

As soon as I have uploaded the next update you can try out what I did.
Hopefully this works then.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: New file uploaded to VirtualTreeview

From: "Mike Lischke" [lists@l...]
Date: Sat Sep 15, 2001 5:40 pm
Subject: RE: [VirtualTreeview] New file uploaded to VirtualTreeview

> Unfortunately that was not enough and at that time I felt I had bothered
> you enough. The problem is VT must be preparing to do a drag before this
> image is created. I copied a bit of code from VT to VET to deal with
> it. What we really need is the method that creates the drag image to be
> accessable.

Jim, let me know what you need. Why is TVTDragImage.Image not enough? As soon
as PrepareDrag is
called the image is available. I can add a kind of notification scheme to tell
a registered consumer
what's going on in the drag image (creation, start/stop, hiding, moving etc.).

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net

 | Replies | Author | Date
3760 | Re: New file uploaded to VirtualTreeview | Jim Kueneman | Sat 9/15/2001
3765 | Re: New file uploaded to VirtualTreeview | Mike Lischke | Sun 9/16/2001


re: Editing (2.5.31)

From: "Mike Lischke" [lists@l...]
Date: Sat Sep 15, 2001 6:02 pm
Subject: RE: [VirtualTreeview] Editing (2.5.31)

> This problem did already exist some versions ago, and the bug was fixed
> by Mike. Now it is there again.

You are right, I'm very surprised. It seems I have somehow undone the changes
to fix that problem.
At least it is now again fixed...

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


BCB5 II

From: [NRYJGUSFSVEY@s...]
Date: Sat Sep 15, 2001 8:27 pm
Subject: BCB5 II

Hi!

> > {$HPPEMIT 'struct TCacheEntry;'}
> > To compile the created .hpp file successfully with BCB5. As this is
> > Release Candidate 1, I guess you could implement it now :).
>
> Where should this compiler command be placed?

Here:

type

{$HPPEMIT 'struct TCacheEntry;'}

PCardinal = ^Cardinal;

// Limits the speed interval which can be used for auto scrolling
(milliseconds).
TAutoScrollInterval = 1..1000;

That was the suggestion of one of the newsgroup's readers, I don't
remember who. He uploaded a files that made VTV compilable with BCB, but
this file was deleted when you cleaned up some time ago :).

But this is the only line that has to be added.

Greetz

Marco Loos

--
NJ0Y - Marco Loos, 48165 Münster
http://nj0y.de
PWGen - Der Passwortverwalter: http://www.pwgen.de

Sie haben die Position des Mauszeigers verändert.
Starten Sie Windows neu, damit die Änderungen wirksam werden.

 | Replies | Author | Date
3763 | Re: BCB5 II | Mike Lischke | Sun 9/16/2001


Hints II

From: [NRYJGUSFSVEY@s...]
Date: Sat Sep 15, 2001 8:28 pm
Subject: Hints II

Hi!

> > when I move my mouse over an entry where a hint appears (because the
> > text is too long) and I move my mouse to another entry where a hint
> > should appear BEFORE THE FIRST HINT IS COMPLETELY FADED IN, the second
> > hint does not appear.
>
> This is by design. Otherwise it will come to serious trouble because of
> nested animation loops. If you do not like this effect then set
> animation to a very short time (Microsoft recommends 200 ms,
> which is the default value in VT) or disable it entirely.

Hmmm, that is not very satisfying. Is it not possible to abort the first
loop?

Bye

Marco

--
NJ0Y - Marco Loos, 48165 Münster
http://nj0y.de
PWGen - Der Passwortverwalter: http://www.pwgen.de

Sie haben die Position des Mauszeigers verändert.
Starten Sie Windows neu, damit die Änderungen wirksam werden.

 | Replies | Author | Date
3764 | Re: Hints II | Mike Lischke | Sun 9/16/2001


re: New file uploaded to VirtualTreeview

From: Jim Kueneman [jimdk@m...]
Date: Sat Sep 15, 2001 8:44 pm
Subject: RE: [VirtualTreeview] New file uploaded to VirtualTreeview

At 07:40 PM 9/15/2001 +0200, you wrote:
> > Unfortunately that was not enough and at that time I felt I had bothered
> > you enough. The problem is VT must be preparing to do a drag before this
> > image is created. I copied a bit of code from VT to VET to deal with
> > it. What we really need is the method that creates the drag image to be
> > accessable.
>
>Jim, let me know what you need. Why is TVTDragImage.Image not enough? As
>soon as PrepareDrag is
>called the image is available. I can add a kind of notification scheme to
>tell a registered consumer
>what's going on in the drag image (creation, start/stop, hiding, moving etc.).

The problem is VT calls DoDragging and then calls PrepareDragImage. Now
if the DragImageKind = none then the function never builds the image and
returns immediately. But if I set the DragImageKind to something other
than none and force the bitmap to be created I can't stop VT from
displaying it own drag image, in effect I get two drag images on top of
each other (yours and the IDragSourceHelpers) . We need to be able to call
TBaseTreeview.PrepareDragImage and force it to create the image but not let
it use the image for a drag if the DragImageKind <> none.

Does that make sense?

Jim

 | Replies | Author | Date
3765 | Re: New file uploaded to VirtualTreeview | Mike Lischke | Sun 9/16/2001


re: Bug reports

From: Jim Kueneman [jimdk@m...]
Date: Sat Sep 15, 2001 8:48 pm
Subject: Re: [VirtualTreeview] Bug reports

Mike,

>Jim, entry #60 is a bit unexpected. Can you reproduce the drag image
>problem with the new demo? If not, where did you encounter it?

Never mind it is my ignorance of computer graphics and is in my rendition
of the IDragSourceHelper call. Fixed.

Jim


Re[2]: Access violation when program is shotdown

From: [avr555@m...]
Date: Sun Sep 16, 2001 11:59 am
Subject: Re[2]: [VirtualTreeview] Access violation when program is shotdown

WL> Hi Alexander,

>> This is my my Short program

WL> ...

>> type
>> PRecTo = ^TRecTo;
>> TRecTo = record
>> Name : WideString;
>> Code:string;
>> SourceID : integer;
>> ImageIndex :integer;
>> end;

WL> ...

>> tvwWareFrom.NodeDataSize := SizeOf(TMyRec);
>> tvwWareTo.NodeDataSize := SizeOf(PRecTo);

WL> I have not tested your code yet, but this is obviously wrong. Try:

WL> tvwWareTo.NodeDataSize := SizeOf(TRecTo);

WL> Werner

No changes. I still receive message 'Access violation'.

--
Best regards,
Alexander Rudenko mailto:[avr555@m...]


re: BCB5 II

From: "Mike Lischke" [lists@l...]
Date: Sun Sep 16, 2001 11:59 am
Subject: RE: [VirtualTreeview] BCB5 II

> type
> {$HPPEMIT 'struct TCacheEntry;'}
>
> PCardinal = ^Cardinal;
>
> But this is the only line that has to be added.

Okey, dokey.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: Hints II

From: "Mike Lischke" [lists@l...]
Date: Sun Sep 16, 2001 11:59 am
Subject: RE: [VirtualTreeview] Hints II

> Hmmm, that is not very satisfying. Is it not possible to abort the first
> loop?

Unfortunately not. VT is acting in a context it cannot come around (the VCL).
In order to stay
responsive VT has to let through all messages to the application during
animation. This however may
cause the start of a new animation loop when the previous one is still in
progress. I cannot cancel
it yet because the new run is called from the old run and is executed next time
first after the
second run finished. But then it is already too late and often the tree
crashes. Believe me, many
things in the tree are there because it makes a lot of sense ;o]

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: New file uploaded to VirtualTreeview

From: "Mike Lischke" [lists@l...]
Date: Sun Sep 16, 2001 11:59 am
Subject: RE: [VirtualTreeview] New file uploaded to VirtualTreeview

Hi Jim,

> But if I set the DragImageKind to something other
> than none and force the bitmap to be created I can't stop VT from
> displaying it own drag image, in effect I get two drag images on top of
> each other (yours and the IDragSourceHelpers) . We need to be able to call
> TBaseTreeview.PrepareDragImage and force it to create the image but not let
> it use the image for a drag if the DragImageKind <> none.
>
> Does that make sense?

Yes, this time I got it. I have made the following changes and hope this is
something you can work
with:

- CanShowDragImage is now virtual and can be overridden
- there is a new parameter for DragImage.PrepareDrag which tells the drag image
to pretent it is not
preprared although it has a valid image

The consequences for you are:

- Override CanShowDragImage and return True regardless of the drag image kind
setting.
- Do not publish DragImageKind and set it to diNoImage.

So as soon as VT has called PrepareDragImage (in DoDragging) there is valid
image for you without
that it will be shown by VT itself.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


New file uploaded to VirtualTreeview

From: [VirtualTreeview@yahoogroups.com>
Date: Sun Sep 16, 2001 12:09 pm
Subject: New file uploaded to VirtualTreeview

Hello,

This email message is a notification to let you know that
a file has been uploaded to the Files area of the VirtualTreeview
group.

File : /VirtualTree_2.5.34.zip
Uploaded by : [lists@l...]
Description : Release candidate 1

You can access this file at the URL

http://groups.yahoo.com/group/VirtualTreeview/files/VirtualTree_2.5.34.zip

To learn more about file sharing for your group, please visit

http://help.yahoo.com/help/us/groups/files

Regards,

lists@l...]


re: Lurker Report (was: New file uploaded to VirtualTreeview)

From: "Wim van der Vegt" [wvd_vegt@k...]
Date: Sun Sep 16, 2001 12:24 pm
Subject: Re: [VirtualTreeview] Lurker Report (was: New file uploaded to VirtualTreeview)

My Comments on Advanced.exe

1. No comment, still a powerfull reason to chose vt. Perhaps extend the demo so
it also shows how fast it is in the other modes like tree+columns and columns
only. Perhaps also show the memory load if there is any. The down arrow buttons
are confusing as they don't do a thing.

2. General Abilities and features Demo
- Perhaps it's me but i really have the faintest idea what the alpha
blended rectangle should look like. Does it work under win98se at all? If not,
disable the radiogroup.

3. Still impressive as always.

4. The demo below is not explained well. Is it made of two sync scrolling vt's?
In that case also mention that because it scrolls in sync VERY well.

5. No comment, nice that it works but not my style.

6. Nice, Perhaps add sorting too. Also add some other gridline style (solid for
instance).

7. Nice but it tries to access the floppy drive which is annoying as you chose
the demo because you don't see anything when it happens. I also find the
XMLtree demo a much more powerfull demo of the lmbands style show in this demo.
Is it ExplorerTree Based btw?

8. No comment other then impressive (can't read two of the three columns ;-).
Hottrack doesn't seem to work (if i'm correct it should automatically select
the item under the mouse?)

9. Combine with 7? Then it's alive at least. I finnaly found what the alpha
blended selection means (after i tried to drag a selection rectangle).

--------
Wim van der Vegt

[Non-text portions of this message have been removed]

 | Replies | Author | Date
3794 | Re: Lurker Report (was: New file uploaded to Virt | Mike Lischke | Tue 9/18/2001
3808 | Re: Lurker Report (was: New file uploaded to Virt | Wim van der Vegt | Wed 9/19/2001
3822 | Re: Lurker Report (was: New file uploaded to Virt | Mike Lischke | Sat 9/22/2001
3850 | Re: Lurker Report (was: New file uploaded to Virt | Moritz Franckenstein | Thu 9/27/2001


to Mike

From: "Wiktor Sadowski" [wiktor@w...]
Date: Sun Sep 16, 2001 11:16 am
Subject: to Mike

Hi Mike,
I can't find the newest version of VT on
http://www.lischke-online.de/download/Betas/ -:)

Also , there is WM_SYNCPAINT ,an "undocumented" message, which is finally
defined in VC++ 6.0
and maybe could be somehow useful for VT complex painting tasks.(maybe not)

#ifndef WM_SYNCPAINT
# define WM_SYNCPAINT 0x0088

WM_SYNCPAINT: InvalidateRect(hWnd,0,FALSE)

"When dragging a full window, MSWindows on 'slow'
machines can lose track of the window refresh area. It sends some kind
of panic message to the desktop that in turn sends this message on to
all applications." taken from FLTK GUI toolkit source.

best regards
Wiktor

 | Replies | Author | Date
3795 | Re: to Mike | Mike Lischke | Tue 9/18/2001


Smearing

From: "Roger Olsson" [roger@f...]
Date: Sun Sep 16, 2001 4:20 pm
Subject: Smearing

Hi

At both runtime and designtime there is smearing of TVirtualStringTree
when moving other forms over it. No smearing appears in other components
I have on the form. Why is this so? Attached a 3kb JPEG showing the
phenomenon.

Roger

[Non-text portions of this message have been removed]

 | Replies | Author | Date
3770 | Re: Smearing | Jim Kueneman | Sun 9/16/2001
3773 | Re: Smearing | Werner Lehmann | Sun 9/16/2001
3796 | Re: Smearing | Mike Lischke | Tue 9/18/2001


re: Smearing

From: Jim Kueneman [jimdk@m...]
Date: Sun Sep 16, 2001 4:43 pm
Subject: Re: [VirtualTreeview] Smearing

At 06:20 PM 9/16/2001 +0200, you wrote:
>Hi
>
>At both runtime and designtime there is smearing of TVirtualStringTree
>when moving other forms over it. No smearing appears in other components
>I have on the form. Why is this so? Attached a 3kb JPEG showing the
>phenomenon.

Attachments are not allowed. Upload it to

http://groups.yahoo.com/group/VirtualTreeview/files/

Jim


re: Access violation when program is shotdown

From: Werner Lehmann [wl@b...]
Date: Sun Sep 16, 2001 4:27 pm
Subject: Re: [VirtualTreeview] Access violation when program is shotdown

Hi,

> No changes. I still receive message 'Access violation'.

Ok, you have another bug. In the part at the end where you
say 'If I comment...' you use AddChild from Tree tvwWareFrom
to add a childnode to a node from tvwWareTo.

That should be it. Otherwise, please make a test project that
compiles without 3rd party components and does not require a db
connection.

Regards,
Werner


re: New file uploaded to VirtualTreeview

From: Werner Lehmann [wl@b...]
Date: Sun Sep 16, 2001 5:04 pm
Subject: Re: [VirtualTreeview] New file uploaded to VirtualTreeview

Hi Mike,

> > Release Candidate 1 :)
>
> Jaaaha. I have no intention to add more functionality before releasing the
next public version
> (except that I did include the auto hide button stuff for invisible child
nodes). Only bug fixes,
> the demos and the documentation left.

I am happy that the last officially added feature was something that I needed
;) I agree that
it is about time to get a fixed state, aka release.

> > Mike, one more thing. You remember the todo item about removing the +/-
button from nodes with
> > all invisible children? It is very likely that I need this soon at the
company to provide tree
> > filtering. Invisible nodes are good, but the +/- is not really acceptable
in the mentioned case.
>
> Well, now also this feature is built in. I had to touch the code anyway
because of a difficult
> problem related to hiding/showing nodes. So you can happily look forward your
own implementation
> (unless I put in a new bug) :o].

This is really great. I had given up hope that it would happen before the
release. I cannot put
my initials in the TODO-Database of YG now but that's a small price :)

Regards,
Werner


re: Smearing

From: Werner Lehmann [wl@b...]
Date: Sun Sep 16, 2001 5:08 pm
Subject: Re: [VirtualTreeview] Smearing

Hi Roger,

> At both runtime and designtime there is smearing of TVirtualStringTree
> when moving other forms over it. No smearing appears in other components
> I have on the form. Why is this so? Attached a 3kb JPEG showing the
> phenomenon.

attachments are not allowed in this group because someone posted a meg or so
to all members. You may upload the screenshot to the appropriate folder
in the file section on YG.

The smearing was a problem with version 2.5.27 and has been fixed since
then. Which version are you using?

Regards,
Werner


re: New file uploaded to VirtualTreeview

From: Werner Lehmann [wl@b...]
Date: Sun Sep 16, 2001 5:32 pm
Subject: Re: [VirtualTreeview] New file uploaded to VirtualTreeview

Hi Mike,

> The consequences for you are:
>
> - Override CanShowDragImage and return True regardless of the drag image kind
setting.
> - Do not publish DragImageKind and set it to diNoImage.
>
> So as soon as VT has called PrepareDragImage (in DoDragging) there is valid
image for you without
> that it will be shown by VT itself.

As far as I am concerned this is not only about VET. Jim's OLEDragManager is a
general
purpose component which can be associated to any visual control with a window
handle.
The component handles the drag image management with the help of the drag image
functions
provided by the current OS. The point I am trying to make is that it is
external to the
VTree. With your latest modifications we would need a descendent of the VTree
to get
public access to the drag image, to provide it to the drag manager. The drag
manager
could not get the drag image from a plain off-the-palette VTree (at least not
without an
VTree imposer class on each VTree form).

I have not checked the code and the necessities this might imply but couldn't
there be
a public (read only) property (or function) that simply provides a bitmap? Not
sure how
the alpha blending fits in here...

Werner

 | Replies | Author | Date
3797 | Re: New file uploaded to VirtualTreeview | Mike Lischke | Tue 9/18/2001
3804 | Re: New file uploaded to VirtualTreeview | Jim Kueneman | Tue 9/18/2001
3821 | Re: New file uploaded to VirtualTreeview | Mike Lischke | Sat 9/22/2001


re: New file uploaded to VirtualTreeview

From: Werner Lehmann [wl@b...]
Date: Sun Sep 16, 2001 6:32 pm
Subject: Re: [VirtualTreeview] New file uploaded to VirtualTreeview

Hi Mike,

> It is, indeed. I have included the same checks from VT.WMPaint into
DoSetOffsetXY and appearantly it
> works.

Confirmed.

> Well, now also this feature is built in. I had to touch the code anyway
because of a difficult
> problem related to hiding/showing nodes. So you can happily look forward your
own implementation
> (unless I put in a new bug) :o].

Ok, there are a few things.

- Hiding all 5000 children of a node takes now about 3-5s with 100% CPU. It is
obvious why this
is the case (when I look at SetVisible, 5000x GetVisiblePath, 1+2+3+..+5000
loop cycles (=12502500)).
I suppose that this is what you expected and why you hesitated to do it in
the first place but I
wonder if there isn't something we could do about it. The easiest thing which
comes to my mind is
to check the current state of vsAllChildrenHidden: if a node is about to be
hidden and the flag is
present it would not be necessary to loop thru all children. Unless there is
a bug in the VTree flag
handling it is clear that this flag can only be set by the application prior
to SetVisible(., false).

I admit that this is quite obfuscating. And requires in depth knowledge from
new users who don't
know this trick, at least when they have a problem with the performance, only
relevant if there are
many siblings, of course. Another way would be a Begin/EndUpdate for such
flag maintaining works,
but this would add a huge overhead if the update spans over more than one
(parent) node, and it is
somehow kludgy to add these helper procs.

I would favour the first 'workaround'. People who know what they are doing
can restrict the
search for a visible node to one time only.

A third possibility would be a proc UpdateAllChildrenHidden(Node), the
developer would manipulate
the visibility properties of some nodes (siblings), then call that proc to
let the checking loop
run only once. And a proc HideAllChildren(Node) for this special case. Not
exactly pretty. Any
other ideas?

- If a node is made visible it is instead made fully visible (all parents
expanded). I remember
why you added it some time ago, someone complained that the node wasn't
visible after he had
explicitly issued "Visible[Node] := true;". But that's what MakeVisible and
FullyVisible[] are
for. I cannot base a tree filtering on the vsVisible flag when each
'unfiltering' lets nodes
auto-expand all over the tree.

Another problem I have to solve in my own applications is with "never expanded
nodes which have
vsHasChildren set". If the filter is applied I have to check if the
vsAllChildrenHidden flag
has to be set manually in order to hide the plus button... There is probably no
way how the treeview
can help here.

Regards,
Werner

 | Replies | Author | Date
3783 | Re: New file uploaded to VirtualTreeview | [pdagosta@c...] | Mon 9/17/2001
3802 | Re: New file uploaded to VirtualTreeview | Mike Lischke | Tue 9/18/2001
3798 | Re: New file uploaded to VirtualTreeview | Mike Lischke | Tue 9/18/2001


re: Bug reports

From: Werner Lehmann [wl@b...]
Date: Sun Sep 16, 2001 6:38 pm
Subject: Re: [VirtualTreeview] Bug reports

Hi Mike,

> Werner, I cannot reproduce what you wrote in entry #56. Please try it with
the new demo (use the second or eighth demo).

it does not happen in the advanced demo and I could not reproduce it in a small
app (yet).
The problem is still there, however. I am investigating this further.

Regards,
Werner


Athlon, Win2K; D5; L1496

From: [adembaba@e...]
Date: Mon Sep 17, 2001 4:46 am
Subject: Athlon, Win2K; D5; L1496

Hi,

If I remember correctly, a few days ago, there
was some remark about some assembly code causing
non-compilation with Athlon CPUs.

Whether or not it is the problem, I have been
unable to compile (and install) VT ever since.

I keep getting 'Fatal Error L1496'.

Can anyone suggest some solution toi this.

Cheers,
Adem

 | Replies | Author | Date
3781 | Re: Athlon, Win2K; D5; L1496 | Jim Kueneman | Mon 9/17/2001
3785 | Re: Athlon, Win2K; D5; L1496 | [adembaba@e...] | Tue 9/18/2001
3790 | Re: Athlon, Win2K; D5; L1496 | [ebolefeysot@b...] | Tue 9/18/2001
3788 | Re: Athlon, Win2K; D5; L1496 | [subscribedlists@b...] | Tue 9/18/2001
3799 | Re: Athlon, Win2K; D5; L1496 | Mike Lischke | Tue 9/18/2001


VT 2.5.34 --HasMMX

From: [adembaba@e...]
Date: Mon Sep 17, 2001 5:19 am
Subject: VT 2.5.34 --HasMMX

Hi Mike,

Apparently, checking for MMX in Initialization
is not entertained when CPU is Athlon (D5 + SP2;
Win2K Pro + SP2).

I found out about this the hard way as kept
getting L1496 errors.

Worked around it by adding

Const
HasMMX: Boolean = False;

and commenting out
Function HasMMX: Boolean;

The interesting thing (from Sisoft Sandra)
is that this CPU supposedly supports
'Extended AMD MMX Technology..

Another extend & embrace?

Cheers,
Adem

 | Replies | Author | Date
3780 | Re: VT 2.5.34 --HasMMX | GIANNAKOPOULOS KOSTAS | Mon 9/17/2001
3792 | Re: VT 2.5.34 --HasMMX | [wvd_vegt@k...] | Tue 9/18/2001
3793 | Re: VT 2.5.34 --HasMMX | [adembaba@e...] | Tue 9/18/2001
3800 | Re: VT 2.5.34 --HasMMX | Mike Lischke | Tue 9/18/2001
3807 | Re: VT 2.5.34 --HasMMX | [adembaba@e...] | Tue 9/18/2001


Still smearing in 2.5.31

From: [subscribedlists@b...]
Date: Mon Sep 17, 2001 6:34 am
Subject: Still smearing in 2.5.31

Any writing to a TMemo from within the OnGetText handler will cause
smearing within the tree, provided the tree is later scrolled
horizontally. If there is no code to write to the memo like:

Memo1.Lines.Add('OnGetText Handler entered...');

Then everything works okay.

Is this caused because writing a line to a TMemo changes focus within
the OnGetText handler? I've read some earlier postings regarding
problems with the VTree when focus is changed within OnGetText. Is
this the problem or is it something else? Does OnGetText have to be
very fast to work during horizontal scrolling? I tried to
add "Application.ProcessMessages" before and after the Memo writing
code line to no avail.

Any ideas would be appreciated. I need the memo lines for
troubleshooting. I could try sending post messages or perhaps use a
thread to write to the memo, but it seems that should not be
necessary.

Thanks,

Douglas Counts

 | Replies | Author | Date
3801 | Re: Still smearing in 2.5.31 | Mike Lischke | Tue 9/18/2001


re: VT 2.5.34 --HasMMX

From: GIANNAKOPOULOS KOSTAS [kyan@s...]
Date: Mon Sep 17, 2001 10:12 am
Subject: RE: [VirtualTreeview] VT 2.5.34 --HasMMX

Searching in MSDN for MMX+Detect i came accross this code snippet that
allegedly detects MMX capabilities. Hope it helps.

BOOL CMMXSampleDlg::HasMMXTechnology()
{
// We load the CPU-detection DLL. If we aren't able to load the DLL,
// we'll have to assume that MMX Technology is not present, just to
// be safe.

HINSTANCE hLibrary = LoadLibrary(_T("CPUINF32.DLL"));
if (!hLibrary)
return FALSE;

typedef DWORD (FAR* VOIDFUNC)();
VOIDFUNC WinCPUFeatures =
(VOIDFUNC)GetProcAddress(hLibrary, "wincpufeatures");

// MMX(tm) Technology has been assigned bit 23 of the feature flags.

const DWORD MMXTECHNOLOGY_FLAG = 0x00800000;
BOOL bResult = WinCPUFeatures != NULL &&
(WinCPUFeatures() & MMXTECHNOLOGY_FLAG);

FreeLibrary(hLibrary);
return bResult;
}

<KY>

> Apparently, checking for MMX in Initialization
> is not entertained when CPU is Athlon (D5 + SP2;
> Win2K Pro + SP2).
>
> I found out about this the hard way as kept
> getting L1496 errors.
>
> Worked around it by adding
>
> Const
> HasMMX: Boolean = False;
>
> and commenting out
> Function HasMMX: Boolean;
>
> The interesting thing (from Sisoft Sandra)
> is that this CPU supposedly supports
> 'Extended AMD MMX Technology..
>
> Another extend & embrace?

 | Replies | Author | Date
3792 | Re: VT 2.5.34 --HasMMX | [wvd_vegt@k...] | Tue 9/18/2001
3793 | Re: VT 2.5.34 --HasMMX | [adembaba@e...] | Tue 9/18/2001


re: Athlon, Win2K; D5; L1496

From: Jim Kueneman [jimdk@m...]
Date: Mon Sep 17, 2001 12:53 pm
Subject: Re: [VirtualTreeview] Athlon, Win2K; D5; L1496

At 04:46 AM 9/17/2001 +0000, you wrote:
>Hi,
>
>If I remember correctly, a few days ago, there
>was some remark about some assembly code causing
>non-compilation with Athlon CPUs.
>
>Whether or not it is the problem, I have been
>unable to compile (and install) VT ever since.
>
>I keep getting 'Fatal Error L1496'.

The last version of VT gave a 1Ghz Compaq using NT4 fits too. I got a
whole host of Lxxx errors. The only why I fixed it was remove all
components that used VT and VET. Delete everything in the
$DELPHI\Projects\Bpl folder that had to due with any of these packages. Go
to the folder that contains the source for any of these packages and delete
everything but what is zipped up in VT or VET, ie delete all the *.dsk,
*.dof, *.dcu, *.cfg, *.res and *.map files. Quit out of Delphi then
restart in case it has cached something. Reopen then go to your VT folder
open the *.dpk file and recomile and install it is the order of dependance
VT -> VET -> and so on.

This really showed up when trying to recompile a package that was dependant
on VET (in turn dependant on VT). Once I did this it works fine. Just
deleteing the *.bpl files as I have mentioned in the past was not enough.

Jim

 | Replies | Author | Date
3785 | Re: Athlon, Win2K; D5; L1496 | [adembaba@e...] | Tue 9/18/2001
3790 | Re: Athlon, Win2K; D5; L1496 | [ebolefeysot@b...] | Tue 9/18/2001


re: New file uploaded to VirtualTreeview

From: [pdagosta@c...]
Date: Mon Sep 17, 2001 1:31 pm
Subject: Re: New file uploaded to VirtualTreeview

--- In [VirtualTreeview@y...], Werner Lehmann [wl@b...] wrote:
> Hi Paul,
>
> > When this is implemented, I would request that it be added as an
> > option. I currently have a VT that only allows for children nodes
on
> > specific nodes. To make it visually obvious which nodes can have
> > children I add an invisible node to force the +/- to appear.
>
> Well, I am not anywhere near to an 'implemented' status. But IMO
this is
> a misuse of the +/-. Wouldn't it be much better to add an 'Add node'
> child to every node where children can be added? The user would
double
> click on these nodes and have a new node then (possibly after a
dialog
> has been presented).
>
> Werner

I agree that this is a hack, but the display functionality that I need
is a parent with a +/- but with no children. The data is not directly
entered into the tree by users. A real-time stream populates the
tree.

I like Ariel's suggestion of manually adding vsHasChildren to the
Node.States (it was actually my first approach) but I couldn't find
where to place all of the assignments to guarantee that the +/- never
went away (ie when you expand a node with no children vsHasChildren is
removed). At least with the invisible place-holder node the +/- is
*always* visible (at least for right now :) ). Also the invisible
node is programmatically easy to implement/maintain.

Thanks,
Paul


re: New file uploaded to VirtualTreeview

From: [pdagosta@c...]
Date: Mon Sep 17, 2001 2:51 pm
Subject: Re: New file uploaded to VirtualTreeview

--- In [VirtualTreeview@y...], Werner Lehmann [wl@b...] wrote:

> - Hiding all 5000 children of a node takes now about 3-5s with 100%
CPU. It is obvious why this
> is the case (when I look at SetVisible, 5000x GetVisiblePath,
1+2+3+..+5000 loop cycles (=12502500)).
> I suppose that this is what you expected and why you hesitated to
do it in the first place but I
> wonder if there isn't something we could do about it. The easiest
thing which comes to my mind is
> to check the current state of vsAllChildrenHidden: if a node is
about to be hidden and the flag is
> present it would not be necessary to loop thru all children.
Unless there is a bug in the VTree flag
> handling it is clear that this flag can only be set by the
application prior to SetVisible(., false).
>
> I admit that this is quite obfuscating. And requires in depth
knowledge from new users who don't
> know this trick, at least when they have a problem with the
performance, only relevant if there are
> many siblings, of course. Another way would be a Begin/EndUpdate
for such flag maintaining works,
> but this would add a huge overhead if the update spans over more
than one (parent) node, and it is
> somehow kludgy to add these helper procs.
>
> I would favour the first 'workaround'. People who know what they
are doing can restrict the
> search for a visible node to one time only.
>
> A third possibility would be a proc UpdateAllC
hildrenHidden(Node),
the developer would manipulate
> the visibility properties of some nodes (siblings), then call
that
proc to let the checking loop
> run only once. And a proc HideAllChildren(Node) for this special
case. Not exactly pretty. Any
> other ideas?
>

I have not looked at the code, but it seems to me that maintaining a
Invisible Child Count would be sufficient in determining if all
children are invisible. The count would be incremented when a child
is changed from visible to invisible.

Just a thought.

Paul

 | Replies | Author | Date
3802 | Re: New file uploaded to VirtualTreeview | Mike Lischke | Tue 9/18/2001


Advanced Demo Bug

From: [wvd_vegt@k...]
Date: Mon Sep 17, 2001 3:51 pm
Subject: Advanced Demo Bug

Hi,

On my w2k machine i get an Integer Overflow Error when i Select the 4
radio buttons in th eHide/Show Demo in top down order.

Wim van der Vegt

 | Replies | Author | Date
3786 | Re: Advanced Demo Bug | [adembaba@e...] | Tue 9/18/2001
3803 | Re: Advanced Demo Bug | Mike Lischke | Tue 9/18/2001


re: Athlon, Win2K; D5; L1496

From: [adembaba@e...]
Date: Mon Sep 17, 2001 8:51 pm
Subject: Re: Athlon, Win2K; D5; L1496

> >I keep getting 'Fatal Error L1496'.
>
> The last version of VT gave a 1Ghz Compaq using NT4 fits too.
> I got a whole host of Lxxx errors. The only why I fixed it
> was remove all components that used VT and VET.
> Delete everything in the $DELPHI\Projects\Bpl folder that
> had to due with any of these packages.
>
> This really showed up when trying to recompile a package
> that was dependant on VET (in turn dependant on VT).
> Once I did this it works fine. Just deleteing the
> *.bpl files as I have mentioned in the past was not enough.

Jim,

You got off lightly ;-)

I did all that. But was not enough.
I uninstalled and install Delphi5 over again.
I hated it, but I ended up having a clean setup :-)

Cheers,
Adem

 | Replies | Author | Date
3790 | Re: Athlon, Win2K; D5; L1496 | [ebolefeysot@b...] | Tue 9/18/2001


re: Advanced Demo Bug

From: [adembaba@e...]
Date: Tue Sep 18, 2001 2:06 am
Subject: Re: Advanced Demo Bug

> On my w2k machine i get an Integer Overflow Error when
> i Select the 4 radio buttons in th eHide/Show Demo in
> top down order.

Ditto.

Cheers,
Adem


2.5.34 New Package Build and TFormatArray

From: [sales@d...]
Date: Tue Sep 18, 2001 4:55 am
Subject: 2.5.34 New Package Build and TFormatArray

Build VT packages, install and run OK in D6.

Have new package which requires VirtualTreesD6.dcp. New instance of
VT defined in new package and has defined a DragDrop event handler.
Compiler will not build the package. "TFormatArray" is not
recognised yet the same code will build and run directly from the IDE
in a form. Package will build and run OK if I remove the DragDrop
event handler.

Any clues?

 | Replies | Author | Date
3909 | Bug! | Kirill Zinov | Wed 10/3/2001
3930 | Re: Bug! | Jim Kueneman | Thu 10/4/2001


re: Athlon, Win2K; D5; L1496

From: [subscribedlists@b...]
Date: Tue Sep 18, 2001 5:12 am
Subject: Re: Athlon, Win2K; D5; L1496

--- In [VirtualTreeview@y...], [adembaba@e...] wrote:
> Hi,
>
> If I remember correctly, a few days ago, there
> was some remark about some assembly code causing
> non-compilation with Athlon CPUs.
>
> Whether or not it is the problem, I have been
> unable to compile (and install) VT ever since.
>
> I keep getting 'Fatal Error L1496'.
>
> Can anyone suggest some solution toi this.
>

I have an Athlon and it works great. I prefer it to my
other Intel based workstations. To fix the errors of
this type on *any* component package requires some very
basic steps and understanding of how Delphi and BCB work
with components and packages.

Always think ahead that a problem can arise and place
the sources (*.pas, *.dpk, *.dpr, etc.) into their own
directories. Otherwise you have to walk the path that
Delphi uses because it may see an outdated DCU or PAS
before the one that you are changing or working on.

Now the fix. First, I always unregister the component
package from within Delphi so that it is no longer on
the palette. Also, check the palette properties and look
for *hidden* related components and make sure to unregister
them also. Next close down Delphi. Now unzip the new
files over the old ones using the same directory the old
components were in. Lastly, start up Delphi and recompile
the packages.

If you ever have problems doing this compile, here are
some tips that work with all component packages. If you
are getting some "DCU not found error" when you also have
the PAS unit file, open up the package file and write down
the units that it uses. Next delete the packages and all
DCUs that have related PAS files. Now just make your own
package using the source PAS files. Compile and register
the package; then you should be good to go. This will make
new compiled DCUs and new BPLs.

Rebuilding a package from scratch after unregistering,
then deleting related DCUs and DPKs has always worked
for me. If you do not have all the PAS files but only
DCUs instead, this will also work by adding the DCUs
to the package.

Gotchas: When having problems like this you *must* delete
the original package source files at a minimum. Just
removing DCUs and PAS files from the package and then
adding them again will often not work. Delphi seems to
keep the old paths and will often fail on the package
compile with "cannot find" type errors even though the
file is on your hard drive.

You should never have to reinstall Delphi because you
added a component. I try many FREEWARE components that
have proven unreliable. I have always been able to
fix my problems using this technique without ever having
to do a reinstall of Delphi.

Hope this is helpful to someone,

Douglas Counts


Lurker report (was: New file uploaded to Virtua lTreeview)

From: Vandrovec Milan [milan_va@s...]
Date: Tue Sep 18, 2001 7:46 am
Subject: [VirtualTreeview] Lurker report (was: New file uploaded to Virtua lTreeview)

Hello all.

I have played for a while with the Advanced paint demo ("A paint tree as
directory tree"). My comments:
1. It looks a bit corrupted if the first demo selected is this one: the
header is placed in the middle of the VT, but is quickly repainted. I can
make a printscreen of this if you can't reproduce it (W2K, P3 600 MHz). I
cannot imagine a reason for this.
2. I agree with Bug 65 (hint shadow is not animated with
AnimationType=hatSlide).
3. GIF images are not shown at all, and they should. Also, PNG not shown,
only BMPs and JPEGs are.

Milan Vandrovec

 | Replies | Author | Date
3819 | Re: Lurker report | Mike Lischke | Sat 9/22/2001


re: Athlon, Win2K; D5; L1496

From: [ebolefeysot@b...]
Date: Tue Sep 18, 2001 12:53 pm
Subject: Re: Athlon, Win2K; D5; L1496

--- In [VirtualTreeview@y...], [adembaba@e...] wrote:
> > >I keep getting 'Fatal Error L1496'.
> >
> > The last version of VT gave a 1Ghz Compaq using NT4 fits too.
> > I got a whole host of Lxxx errors. The only why I fixed it
> > was remove all components that used VT and VET.
> > Delete everything in the $DELPHI\Projects\Bpl folder that
> > had to due with any of these packages.
> >
> > This really showed up when trying to recompile a package
> > that was dependant on VET (in turn dependant on VT).
> > Once I did this it works fine. Just deleteing the
> > *.bpl files as I have mentioned in the past was not enough.
>
> Jim,
>
> You got off lightly ;-)
>
> I did all that. But was not enough.
> I uninstalled and install Delphi5 over again.
> I hated it, but I ended up having a clean setup :-)
>
> Cheers,
> Adem

Hi Jim

Here is how I solve this problem in my case, it is very simple.

* close delphi
* go into your vtreeview component folder and delete
- vtreeview.dcu
- vtreeviewreg.dcu
* open delphi (sometime it complains about a bpl which is damaged...
click yes in all warning
* Open the dpk where your vtreeview is installed (dclusr50.dpk for me)
* Click the install button (don't use the compil button because it
doesn't work, and you will have to start again the process).
* delphi install all components in ide.

I have a two level descendant of vtreeview, and this method solve the
L1496 problem. Note also that it happens on my athlon 1Go win me, and
on my p3 450 Nt4 as well.

Hope this help
--
Eric
www.romcenter.com


Alt * to expand node ?

From: [ebolefeysot@b...]
Date: Tue Sep 18, 2001 1:30 pm
Subject: Alt * to expand node ?

Hi Mike

One more shortcut to add ;)

"Alt *" expands all node below selected one.

Good job anyway. What about your picture gallery ?

 | Replies | Author | Date
3820 | Re: Alt * to expand node ? | Mike Lischke | Sat 9/22/2001


re: VT 2.5.34 --HasMMX

From: [wvd_vegt@k...]
Date: Tue Sep 18, 2001 2:16 pm
Subject: Re: VT 2.5.34 --HasMMX

Hi,

--- In [VirtualTreeview@y...], GIANNAKOPOULOS KOSTAS [kyan@s...] wrote:
> Searching in MSDN for MMX+Detect i came accross this code snippet
that
> allegedly detects MMX capabilities. Hope it helps.
>
>
> BOOL CMMXSampleDlg::HasMMXTechnology()
> {
> // We load the CPU-detection DLL. If we aren't able to load
the DLL,
> // we'll have to assume that MMX Technology is not present,
just to
> // be safe.
>
> HINSTANCE hLibrary = LoadLibrary(_T("CPUINF32.DLL"));
> if (!hLibrary)
> return FALSE;

Nice dll but where did you find it. I Searched my w2k machine but
didn't find anything alike. So my P4 would end up without MMX.

Searching MSDN i found the article and it also says :

"While you're welcome to use our algorithm in your own code—
we've 'included the DLL with the sample code for the article—you'll
want to check out the Intel Developer Web site
(http://www.developer.intel.com) for the complete CPUINFO
documentation and license information."

So this would lead to installing a dll together with every app that
uses VT.
-----
Wim van de Vegt


re: VT 2.5.34 --HasMMX

From: [adembaba@e...]
Date: Tue Sep 18, 2001 7:04 pm
Subject: Re: VT 2.5.34 --HasMMX

Hi,

As I don't have CPUINF32.DLL, I am not sure I should
pursue this. But, MiTeC System Information Component
(aka MSystemInfo) should offer some pure delphi ways
of finding out similar information. I hope to be able
to look at its code and borrow some ideas from it
when I can.

Cheers,
Adem,

--- In [VirtualTreeview@y...], GIANNAKOPOULOS KOSTAS [kyan@s...] wrote:
> Searching in MSDN for MMX+Detect i came accross this code snippet
that
> allegedly detects MMX capabilities. Hope it helps.
>
>
> BOOL CMMXSampleDlg::HasMMXTechnology()
> {
> // We load the CPU-detection DLL. If we aren't able to load
the DLL,
> // we'll have to assume that MMX Technology is not present,
just to
> // be safe.
>
> HINSTANCE hLibrary = LoadLibrary(_T("CPUINF32.DLL"));
> if (!hLibrary)
> return FALSE;
>
> typedef DWORD (FAR* VOIDFUNC)();
> VOIDFUNC WinCPUFeatures =
> (VOIDFUNC)GetProcAddress(hLibrary, "wincpufeatures");
>
> // MMX(tm) Technology has been assigned bit 23 of the feature
flags.
>
> const DWORD MMXTECHNOLOGY_FLAG = 0x00800000;
> BOOL bResult = WinCPUFeatures != NULL &&
> (WinCPUFeatures() & MMXTECHNOLOGY_FLAG);
>
> FreeLibrary(hLibrary);
> return bResult;
> }
>
>
> <KY>
>
> > Apparently, checking for MMX in Initialization
> > is not entertained when CPU is Athlon (D5 + SP2;
> > Win2K Pro + SP2).
> >
> > I found out about this the hard way as kept
> > getting L1496 errors.
> >
> > Worked around it by adding
> >
> > Const
> > HasMMX: Boolean = False;
> >
> > and commenting out
> > Function HasMMX: Boolean;
> >
> > The interesting thing (from Sisoft Sandra)
> > is that this CPU supposedly supports
> > 'Extended AMD MMX Technology..
> >
> > Another extend & embrace?


re: Lurker Report (was: New file uploaded to VirtualTreeview)

From: "Mike Lischke" [lists@l...]
Date: Tue Sep 18, 2001 7:06 pm
Subject: RE: [VirtualTreeview] Lurker Report (was: New file uploaded to VirtualTreeview)

Hi Wim,

> My Comments on Advanced.exe

Thank you for heading back for some comments.

> 1. No comment, still a powerfull reason to chose vt. Perhaps extend the demo
so it also
> shows how fast it is in the other modes like tree+columns and columns only.

This will likely make no difference as the main task of this demo is to show
how fast you can modify
the content in the best case. You can't get VT faster than what is shown in
this demo. Every other
manipulation (be it different options or columns or whatever) will make VT
slower.

>Perhaps also show the memory load if there is any.

Good idea. Will do that.

>The down arrow buttons are confusing as they don't do a thing.

What arrow buttons do you mean? Or is it the second demo?

> 2. General Abilities and features Demo
> - Perhaps it's me but i really have the faintest idea what the alpha
blended
> rectangle should look like. Does it work under win98se at all? If not,
disable the radiogroup.

Well it even works with Win95. Today I alpha tested a new product I wrote and
had all kind of
machines running it fine with the alpha blending (Win95, Win98, WinME, NT4,
W2K, WinXP).

> 3. Still impressive as always.

I also think everything additional will make it harder to see the keyfeatures
demonstrated by this
demo.

> 4. The demo below is not explained well. Is it made of two sync scrolling
vt's? In that
> case also mention that because it scrolls in sync VERY well.

This page is not yet ready. Its description/name is "Hide and show nodes", but
actually, there is
also the synchronization of two trees. I'm not yet sure whether to place this
on an own page (and in
an own unit). The simpler the demos are the better they can be understood.

> 5. No comment, nice that it works but not my style.

I'd be interested whether I should keep the animation tree in the advanced demo
or not.

> 6. Nice, Perhaps add sorting too. Also add some other gridline style (solid
for instance).

Yep, good ideas.

> 7. Nice but it tries to access the floppy drive which is annoying as you
chose the demo
> because you don't see anything when it happens.

Well it is only a little annoyance, isn't it? The main task to show here is how
to draw content into
a draw tree. This is the only draw tree I have so far and had no better idea
yet how to use it.

>I also find the XMLtree demo a much more
> powerfull demo of the lmbands style show in this demo. Is it ExplorerTree
Based btw?

Firstly, the bands style is only there because it is nowhere else and I wanted
to show it in this
demo as it is the "main" demo of the VT package. Secondly, if Moritz does agree
then I will add his
XML tree to the demos distribution. Thirdly, you are totally right. His bands
idea and also the kind
of drawing he invented looks very appealing (I have used a similar style in the
product I mentioned
above).

Finally, no the draw tree demo is not based on the explorer tree. It just does
an enumeration using
FindFirst/FindNext and reads folders and graphic files.

> 8. No comment other then impressive (can't read two of the three columns ;-).
Hottrack
> doesn't seem to work (if i'm correct it should automatically select the item
under the mouse?)

This is to show not only VT's full bidi and alignment implementation (which was
a really tough task,
btw.) but also its Unicode awareness. The hot track feature is meant for the
header (the check box
is placed into the "Header options:" group).

> 9. Combine with 7? Then it's alive at least. I finnaly found what the alpha
blended
> selection means (after i tried to drag a selection rectangle).

Mmh, combining would be an option, but there are different things I want to
demonstrate. Here the
WindowsXP drawing style of the string tree and there the draw tree. You should
keep in mind that
people will also look at the source and as it is now the XP demo is very small
and clean, so even
beginners will understand it very well. The enumeration code of the draw tree
is something much
heavier.

Ciao, Mike

 | Replies | Author | Date
3808 | Re: Lurker Report (was: New file uploaded to Virt | Wim van der Vegt | Wed 9/19/2001
3822 | Re: Lurker Report (was: New file uploaded to Virt | Mike Lischke | Sat 9/22/2001
3850 | Re: Lurker Report (was: New file uploaded to Virt | Moritz Franckenstein | Thu 9/27/2001


re: to Mike

From: "Mike Lischke" [lists@l...]
Date: Tue Sep 18, 2001 7:08 pm
Subject: RE: [VirtualTreeview] to Mike

Hi Wiktor,

> I can't find the newest version of VT on
> http://www.lischke-online.de/download/Betas/ -:)

Is there now.

> Also , there is WM_SYNCPAINT ,an "undocumented" message, which is finally
> defined in VC++ 6.0
> and maybe could be somehow useful for VT complex painting tasks.(maybe not)

Thank you for pointing this out but I don't think it is of help for VT. This
message is meant for
top level windows (in Delphi: forms).

Ciao, Mike


re: Smearing

From: "Mike Lischke" [lists@l...]
Date: Tue Sep 18, 2001 7:13 pm
Subject: RE: [VirtualTreeview] Smearing

Hi Roger,

> At both runtime and designtime there is smearing of TVirtualStringTree
> when moving other forms over it. No smearing appears in other components
> I have on the form. Why is this so? Attached a 3kb JPEG showing the
> phenomenon.

Which version do you use? With build 34 this problem should be gone.

Ciao, Mike


re: New file uploaded to VirtualTreeview

From: "Mike Lischke" [lists@l...]
Date: Tue Sep 18, 2001 7:15 pm
Subject: RE: [VirtualTreeview] New file uploaded to VirtualTreeview

Hi Werner,

> I have not checked the code and the necessities this might imply but couldn't
there be
> a public (read only) property (or function) that simply provides a bitmap?
Not sure how
> the alpha blending fits in here...

I think you have missed something there. DragImage in VT as well as
TVTDragImage.Image are both
public already.

Ciao, Mike

 | Replies | Author | Date
3804 | Re: New file uploaded to VirtualTreeview | Jim Kueneman | Tue 9/18/2001
3821 | Re: New file uploaded to VirtualTreeview | Mike Lischke | Sat 9/22/2001


re: New file uploaded to VirtualTreeview

From: "Mike Lischke" [lists@l...]
Date: Tue Sep 18, 2001 7:28 pm
Subject: RE: [VirtualTreeview] New file uploaded to VirtualTreeview

> - Hiding all 5000 children of a node takes now about 3-5s with 100% CPU. It
is obvious why this
> is the case (when I look at SetVisible, 5000x GetVisiblePath, 1+2+3+..+5000
loop cycles
> (=12502500)). I suppose that this is what you expected and why you hesitated
to do it in the
first place but I
> wonder if there isn't something we could do about it.

Exactly :o] The major problem with every of such enhancements is that the price
for this convinciene
becomes higher and higher each time.

>The easiest thing which comes to my mind is to check the current state of
vsAllChildrenHidden: if
a node is about to be hidden and
> the flag is present it would not be necessary to loop thru all children.

I thought about this already, but this case can never happen (except for
corrupt flag settings). If
the vsAllChildrenHidden flag is set then all child nodes are already hidden. So
setting the
visibility of any of those child nodes to hidden will not be a change in its
state and already
caught in the initial line of the code.

> I would favour the first 'workaround'. People who know what they are doing
can restrict the
> search for a visible node to one time only.

There is a much better way: set the visibility of the child nodes backwards,
starting with the last
child. This way the loop will stop quite soon and will not cost too much time
(except there are
already many nodes hidden). Another improvement could be to include a method
into VT to set all
children of a node to invisible.

> - If a node is made visible it is instead made fully visible (all parents
expanded).

Oops, I forgot that I also had this property. I removed the expand part from
the SetVisible method.

Ciao, Mike


re: Athlon, Win2K; D5; L1496

From: "Mike Lischke" [lists@l...]
Date: Tue Sep 18, 2001 7:33 pm
Subject: RE: [VirtualTreeview] Athlon, Win2K; D5; L1496

Hi Adem,

> If I remember correctly, a few days ago, there
> was some remark about some assembly code causing
> non-compilation with Athlon CPUs.

Well, in this case you brain is not serving you well ;o] It was so that I had
left the original MMX
assembler code in the VT code which will be compiled by Delphi 6 but not by
earlier Delphi versions.
I had to convert it into define byte (DB) sequences.

> Whether or not it is the problem, I have been
> unable to compile (and install) VT ever since.
> I keep getting 'Fatal Error L1496'.

I also have this problem from time to time but with Delphi 6 and DB assembler
code. This is an error
in the linker of Delphi not the VT code and simply doing a new compile solves
usually the problem.

Ciao, Mike


re: VT 2.5.34 --HasMMX

From: "Mike Lischke" [lists@l...]
Date: Tue Sep 18, 2001 7:35 pm
Subject: RE: [VirtualTreeview] VT 2.5.34 --HasMMX

> Apparently, checking for MMX in Initialization
> is not entertained when CPU is Athlon (D5 + SP2;
> Win2K Pro + SP2).

This must be a very specific problem of your machine. VT is being developed on
an Athlon 650MHz,
with Win2K, SP2 and Delphi 5/6 (now more D6 than D5) and everything is to my
full satisfaction.

> Worked around it by adding
> Const
> HasMMX: Boolean = False;
> and commenting out
> Function HasMMX: Boolean;

Instead removing the code try renaming it. Perhaps there is a naming conflict
(perhaps other third
party code or even an internal function from Delphi?).

Ciao, Mike

 | Replies | Author | Date
3807 | Re: VT 2.5.34 --HasMMX | [adembaba@e...] | Tue 9/18/2001


re: Still smearing in 2.5.31

From: "Mike Lischke" [lists@l...]
Date: Tue Sep 18, 2001 7:39 pm
Subject: RE: [VirtualTreeview] Still smearing in 2.5.31

Hi Douglas,

> If there is no code to write to the memo like:
> Memo1.Lines.Add('OnGetText Handler entered...');
> Then everything works okay.
>
> Is this caused because writing a line to a TMemo changes focus within
> the OnGetText handler?

This could very well be because changing the focus to another control will
trigger a repaint from
within the paint handler (since OnGetText is called as part of the painting).

> Any ideas would be appreciated. I need the memo lines for
> troubleshooting. I could try sending post messages or perhaps use a
> thread to write to the memo, but it seems that should not be
> necessary.

Have you ever heard about OutputDebugString? The result of such a call will be
shown in the Delphi
event log. Another option is to set a breakpoint and instead letting it break
you can just log a
message (this is my preferred one since you can switch it on and off without
changing code).

Ciao, Mike


re: Re: New file uploaded to VirtualTreeview

From: "Mike Lischke" [lists@l...]
Date: Tue Sep 18, 2001 7:39 pm
Subject: RE: [VirtualTreeview] Re: New file uploaded to VirtualTreeview

> I have not looked at the code, but it seems to me that maintaining a
> Invisible Child Count would be sufficient in determining if all
> children are invisible. The count would be incremented when a child
> is changed from visible to invisible.

:-) This was the first idea I had but it requires an additional field in the
node record. So it is
not an option.

Ciao, Mike


re: Advanced Demo Bug

From: "Mike Lischke" [lists@l...]
Date: Tue Sep 18, 2001 7:40 pm
Subject: RE: [VirtualTreeview] Advanced Demo Bug

Hi Wim,

> On my w2k machine i get an Integer Overflow Error when i Select the 4
> radio buttons in th eHide/Show Demo in top down order.

This problem was already mentioned and is also already fixed. When I have more
significant changes
then I will upload a new version of the demo.

Ciao, Mike


re: New file uploaded to VirtualTreeview

From: "Jim Kueneman" [jimdk@m...]
Date: Tue Sep 18, 2001 9:00 pm
Subject: Re: New file uploaded to VirtualTreeview

Hi Mike,

>
> I think you have missed something there. DragImage in VT as well as
TVTDragImage.Image are both
> public already.

Let me claify (as I would like this too <g>) The drag image relies on
VT initiating the drag. What Werner and I would like is to be able
to call TBaseVirtualTree.PrepareDragImage at anytime to create the
drag image. Then we can get the bitmap from TVTDragImage.Image.

Jim

 | Replies | Author | Date
3821 | Re: New file uploaded to VirtualTreeview | Mike Lischke | Sat 9/22/2001


re: New file uploaded to VirtualTreeview

From: Werner Lehmann [wl@b...]
Date: Tue Sep 18, 2001 11:32 pm
Subject: Re: [VirtualTreeview] New file uploaded to VirtualTreeview

Hi Mike,

> Exactly :o] The major problem with every of such enhancements is that the
price for this convinciene
> becomes higher and higher each time.

Agreed. But after you introduced the visibility feature (and I am grateful for
it) it was only
logical to complete it with this +/- addition.

> >The easiest thing which comes to my mind is to check the current state of
vsAllChildrenHidden: if
> a node is about to be hidden and
> > the flag is present it would not be necessary to loop thru all children.
>
> I thought about this already, but this case can never happen (except for
corrupt flag settings). If
> the vsAllChildrenHidden flag is set then all child nodes are already hidden.
So setting the
> visibility of any of those child nodes to hidden will not be a change in its
state and already
> caught in the initial line of the code.

Yes, I am aware of this. That's why I wrote

"Unless there is a bug in the VTree flag handling it is clear that this flag
can only be
set by the application prior to SetVisible(., false)."

It would just be set by the application developer to hint VT on not looking
further for visible
nodes. But I like your suggestion about hiding the nodes backwardly much better.

Werner


re: Re: New file uploaded to VirtualTreeview

From: Werner Lehmann [wl@b...]
Date: Tue Sep 18, 2001 11:20 pm
Subject: Re: [VirtualTreeview] Re: New file uploaded to VirtualTreeview

Hi Paul,

> I have not looked at the code, but it seems to me that maintaining a
> Invisible Child Count would be sufficient in determining if all
> children are invisible. The count would be incremented when a child
> is changed from visible to invisible.

I come too late with my answer but I would have written something similar to
Mike's
answer. Personally I would not mind the extra 4 bytes for each node but this is
clearly ballast for most applications which do not use the visibility feature.
So there would better be a way to do this in a descendant (well there is, but
not
without some code copying).

Anyway, Mike also suggested to hide all nodes backward. That idea was too simple
for me to get it, but it is the best solution probably. The worst case is now
a very large amount of siblings, many of them hidden under the first siblings,
and
only a few (thousand) new become hidden. If I should really face that problem
some-
time (doesn't look like currently) I would code that flag changes (and related
stuff) manually.

Werner


re: VT 2.5.34 --HasMMX

From: [adembaba@e...]
Date: Tue Sep 18, 2001 11:42 pm
Subject: Re: VT 2.5.34 --HasMMX

> > Apparently, checking for MMX in Initialization
> > is not entertained when CPU is Athlon (D5 + SP2;
> > Win2K Pro + SP2).
>
> This must be a very specific problem of your machine.
> VT is being developed on an Athlon 650MHz, with Win2K,
> SP2 and Delphi 5/6 (now more D6 than D5) and everything
> is to my full satisfaction.

Thanks Mike; I am inclined to agree.

While the rest of the box is pretty well endowed ;-)
(800 MHz, 1Gig ECC RAM, 2 RAIDs etc.), the graphic
card is an old AccelStar II s**t. It is probably
due to this card.

Can anyone suggest a good graphics card for under
200 bucks (preferably with a good support for OpenGL).

Cheers,
Adem


re: Lurker Report (was: New file uploaded to VirtualTreeview)

From: "Wim van der Vegt" [wvd_vegt@k...]
Date: Wed Sep 19, 2001 12:57 pm
Subject: RE: [VirtualTreeview] Lurker Report (was: New file uploaded to VirtualTreeview)

Hi,

> >The down arrow buttons are confusing as they don't do a thing.

>What arrow buttons do you mean? Or is it the second demo?

2nd Demo indeed (the arrows in the treecontro).

> > 2. General Abilities and features Demo
> > - Perhaps it's me but i really have the faintest idea what the alpha
blended
> > rectangle should look like. Does it work under win98se at all? If not,
disable the radiogroup.

> Well it even works with Win95. Today I alpha tested a new product I wrote
and had all kind
> of machines running it fine with the alpha blending (Win95, Win98, WinME,
NT4, W2K, WinXP).

I know, i found out what it is, but to novices it's hard to find what to do
(mainly caused by the description 'Draw Selection Mode:') I have no better
suggestion at the moment. Perhaps add a tooltop that says try selecting one
or more nodes.

> > 4. The demo below is not explained well. Is it made of two sync
scrolling vt's? In that
> > case also mention that because it scrolls in sync VERY well.

> This page is not yet ready. Its description/name is "Hide and show nodes",
but actually, there is
> also the synchronization of two trees. I'm not yet sure whether to place
this on an own page (and in
> an own unit). The simpler the demos are the better they can be understood.

Please place it on a 2nd page. It's great to see the trees move together
that good.

> > 5. No comment, nice that it works but not my style.

> I'd be interested whether I should keep the animation tree in the advanced
demo or not.

I can't think of anything usefull for this feature besides perhaps a windows
like flashlite (ie wait, wait & wait).

Perhaps try to show some of the built-in windows animations with there names
instead (like the copy file & trashbin animations).

> > 7. Nice but it tries to access the floppy drive which is annoying as you
chose the demo
> > because you don't see anything when it happens.

> Well it is only a little annoyance, isn't it? The main task to show here
is how to draw content into
> a draw tree. This is the only draw tree I have so far and had no better
idea yet how to use it.

If so, please only use the local harddisks as they should always be there.
Perhaps just show all files and draw there icons full size. That way you
won't have to look for pictures (i don't keep em near the root of a disk).

> >I also find the XMLtree demo a much more
> > powerfull demo of the lmbands style show in this demo. Is it
ExplorerTree Based btw?

> Firstly, the bands style is only there because it is nowhere else and I
wanted to show it in this
> demo as it is the "main" demo of the VT package. Secondly, if Moritz does
agree then I will add his
> XML tree to the demos distribution. Thirdly, you are totally right. His
bands idea and also the kind
> of drawing he invented looks very appealing (I have used a similar style
in the product I mentioned
> above).

Well i'm not sure you should add XMLtree itself to the demo as it requires
external software (IE) to be installed. Just a quick and dirty emulation of
the look would be better. Btw I'm not sure he 'invented' it (have a look at
XMLSpy which had this view for a long time).

Btw i got a pretty handy demo/ideas too. I tied the VT directly to a
TStringList (get the lines in the OnGetText) and add all lines as rootnodes.
This way i get a kind of read-only memo with great performance and virtually
unlimited size. I also got one that takes the name=value typed lines and
dump them into 2 columns. Simple and fast.

Another idea is to create a ini file browser based on VT (rootnode=sections,
childnodes are the keys and their values).

> > 8. No comment other then impressive (can't read two of the three columns
;-). Hottrack
> > doesn't seem to work (if i'm correct it should automatically select the
item under the mouse?)

> This is to show not only VT's full bidi and alignment implementation
(which was a really tough task,
> btw.) but also its Unicode awareness. The hot track feature is meant for
the header (the check box
> is placed into the "Header options:" group).

Saw it after i sent the email.

> > 9. Combine with 7? Then it's alive at least. I finnaly found what the
alpha blended
> > selection means (after i tried to drag a selection rectangle).

> Mmh, combining would be an option, but there are different things I want
to demonstrate. Here the
> WindowsXP drawing style of the string tree and there the draw tree. You
should keep in mind that
> people will also look at the source and as it is now the XP demo is very
small and clean, so even
> beginners will understand it very well. The enumeration code of the draw
tree is something much
> heavier.

I can understand that, but it's so very useless when you open the root
icons. Perhaps an idea is to show the real disk locations of the special
folders and some drive/folder characteristics like the actual size. At the
moment it's not linked to the machine it's running on which makes the demo
(besides the XP look ;) a bit annoying.

-----------
Wim van der Vegt

 | Replies | Author | Date
3822 | Re: Lurker Report (was: New file uploaded to Virt | Mike Lischke | Sat 9/22/2001


Parent-child-relationship over 2 columns

From: [NRYJGUSFSVEY@s...]
Date: Thu Sep 20, 2001 7:59 am
Subject: Parent-child-relationship over 2 columns

Hi,

I need a 2-columns-tree with the same parent-child-relationship on the
left and on the right. That means when some nodes are childs of other
nodes, the same nodes are childs on the right, too, and the plus sign
and the lines shall be painted the same way on the right as on the left.

I do not use two trees, because the trees shall be scrolled and focused
simultaneously.

Is that somehow possible with the current version of VirtualTrees?

Thanks!

Bye

Marco

--
NJ0Y - Marco Loos, 48165 Münster
http://nj0y.de
PWGen - Das Webmastertool: http://www.pwgen.de

... und als ich nach draussen ging, regnete es!
Aber Microsoft sagte, es regnet nicht ...
... also wurde ich nicht nass!


Coloured cell background

From: [NRYJGUSFSVEY@s...]
Date: Thu Sep 20, 2001 7:59 am
Subject: Coloured cell background

Hi,

how are the cells coloured in the Advanced demo in "Tree in Grid
simulation"? (Sourcecode not yet available?)

Bye

Marco

--
NJ0Y - Marco Loos, 48165 Münster
http://nj0y.de
PWGen - Das Webmastertool: http://www.pwgen.de

... und als ich nach draussen ging, regnete es!
Aber Microsoft sagte, es regnet nicht ...
... also wurde ich nicht nass!


Cursor keys in 2.5.34

From: [NRYJGUSFSVEY@s...]
Date: Thu Sep 20, 2001 7:59 am
Subject: Cursor keys in 2.5.34

Hi,

in fewer versions, I could move between the columns with the cursor left
and cursor right keys. The same project, recompiled with the current
VirtualTrees version, does not have this feature any more. Does anyone
know why?

Greetz

Marco

--
NJ0Y - Marco Loos, 48165 Münster
http://nj0y.de
PWGen - Das Webmastertool: http://www.pwgen.de

... und als ich nach draussen ging, regnete es!
Aber Microsoft sagte, es regnet nicht ...
... also wurde ich nicht nass!

 | Replies | Author | Date
3812 | Re: Cursor keys in 2.5.34 | Ariel | Thu 9/20/2001


re: Cursor keys in 2.5.34

From: "Ariel" [asel98@y...]
Date: Thu Sep 20, 2001 8:07 am
Subject: Re: Cursor keys in 2.5.34

see xxxExtendedFocus in options. (change it to true)

--- In [VirtualTreeview@y...], [NRYJGUSFSVEY@s...] wrote:
> Hi,
>
> in fewer versions, I could move between the columns with the cursor
left
> and cursor right keys. The same project, recompiled with the current
> VirtualTrees version, does not have this feature any more. Does
anyone
> know why?
>
> Greetz
>
>
> Marco
>
> --
> NJ0Y - Marco Loos, 48165 Münster
> http://nj0y.de
> PWGen - Das Webmastertool: http://www.pwgen.de
>
> ... und als ich nach draussen ging, regnete es!
> Aber Microsoft sagte, es regnet nicht ...
> ... also wurde ich nicht nass!


New file uploaded to VirtualTreeview

From: [VirtualTreeview@yahoogroups.com>
Date: Thu Sep 20, 2001 10:05 am
Subject: New file uploaded to VirtualTreeview

Hello,

This email message is a notification to let you know that
a file has been uploaded to the Files area of the VirtualTreeview
group.

File : /Descendants/VTStuff.zip
Uploaded by : [wvd_vegt@k...]
Description : Simple VT Descendants including one with TListItems/TTreeNodes
Emulation (no src)

You can access this file at the URL

http://groups.yahoo.com/group/VirtualTreeview/files/Descendants/VTStuff.zip

To learn more about file sharing for your group, please visit

http://help.yahoo.com/help/us/groups/files

Regards,

wvd_vegt@k...]

 | Replies | Author | Date
3815 | Re: New file uploaded to VirtualTreeview | Wim van der Vegt | Thu 9/20/2001
3823 | Re: New file uploaded to VirtualTreeview | Mike Lischke | Sat 9/22/2001


unsubscribe

From: "Tanzim Husain" [unreal@d...]
Date: Thu Sep 20, 2001 10:32 am
Subject: unsubscribe

[Non-text portions of this message have been removed]


re: New file uploaded to VirtualTreeview

From: "Wim van der Vegt" [wvd_vegt@k...]
Date: Thu Sep 20, 2001 10:56 am
Subject: RE: [VirtualTreeview] New file uploaded to VirtualTreeview

Hi,

Comments Please (usefull?, other releated ideas?)....

The source is not included yet because the TTreeNodes/TListItems emulation
still has problems
on designtime (storing/editing doesn't work properly).

-----------------
Wim van der Vegt
-----Original Message-----
From:
[sentto-2425673-3814-1000980309-wvd_vegt=knoware.nl@r...]
[mailto:[sentto-2425673-3814-1000980309-wvd_vegt=knoware.nl@r...]
om]On Behalf Of [VirtualTreeview@yahoogroups.com
Sent: donderdag 20 september 2001 12:05
To: [VirtualTreeview@yahoogroups.com
Subject: [VirtualTreeview] New file uploaded to VirtualTreeview

Hello,

This email message is a notification to let you know that
a file has been uploaded to the Files area of the VirtualTreeview
group.

File : /Descendants/VTStuff.zip
Uploaded by : wvd_vegt@k...]
Description : Simple VT Descendants including one with
TListItems/TTreeNodes Emulation (no src)

You can access this file at the URL

http://groups.yahoo.com/group/VirtualTreeview/files/Descendants/VTStuff.zip

To learn more about file sharing for your group, please visit

http://help.yahoo.com/help/us/groups/files

Regards,

wvd_vegt@k...]

Yahoo! Groups Sponsor
ADVERTISEMENT

To unsubscribe from this group, send an email to:
VirtualTreeview-unsubscribe@egroups.com

Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.

[Non-text portions of this message have been removed]

 | Replies | Author | Date
3823 | Re: New file uploaded to VirtualTreeview | Mike Lischke | Sat 9/22/2001


Parent-child-relationship over 2 columns II

From: [NRYJGUSFSVEY@s...]
Date: Thu Sep 20, 2001 11:56 am
Subject: Parent-child-relationship over 2 columns II

Hi,

the problem is not existing any longer, I solved it by using two trees
with many events that do everything in the one tree that is done in the
other.

Bye

Marco

--
NJ0Y - Marco Loos, 48165 Münster
http://nj0y.de
PWGen - Das Webmastertool: http://www.pwgen.de

... und als ich nach draussen ging, regnete es!
Aber Microsoft sagte, es regnet nicht ...
... also wurde ich nicht nass!


Node must already be initialized

From: [lholmes@s...]
Date: Fri Sep 21, 2001 5:19 pm
Subject: Node must already be initialized

Sometimes and not everytime do i get the message
"Node must already be initialized"

What am i doing wrong?

Thanks,
Mark

from the Keyaction eventhandler

if ExplorerImages.ValidateNamespace(ExplorerImages.FocusedNode,Data)
then
begin
ExplorerImages.ReInitNode(ExplorerImages.FocusedNode, false);
NextNode := ExplorerImages.GetNext(ExplorerImages.FocusedNode);
if ExplorerImages.ValidateNamespace(NextNode,Data) then
begin
ExplorerImages.DeleteSelectedNodes;
ExplorerImages.ClearSelection;
ExplorerImages.FocusedNode := NextNode;
ExplorerImages.Selected[ExplorerImages.FocusedNode] := True;
end;
end;
end;

 | Replies | Author | Date
3818 | Re: Node must already be initialized | Jim Kueneman | Fri 9/21/2001


re: Node must already be initialized

From: Jim Kueneman [jimdk@m...]
Date: Fri Sep 21, 2001 8:41 pm
Subject: Re: [VirtualTreeview] Node must already be initialized

Hi Mark,

Guess the ReInitNode did not get it all.

The first thing that jumps out at me:

What happens if DeleteSelectedNodes deletes the NextNode? (unless it is
not multi-select)

A few suggestions:

It also will be more efficent to make this check before calling ReInitNode
as well, if it is initialized then ReInitNode won't help.

if not (vsInitialized in ExplorerImages.FocusedNode.State) then
ExplorerImages.ReInitNode(ExplorerImages.FocusedNode, false);

Also make sure NextNode is initialized

if not (vsInitialized in NextNode.State) then
ExplorerImages.ReInitNode(NextNode, false);

Hope that helps.

Jim

>from the Keyaction eventhandler
>
>if ExplorerImages.ValidateNamespace(ExplorerImages.FocusedNode,Data)
>then
> begin
> ExplorerImages.ReInitNode(ExplorerImages.FocusedNode, false);
> NextNode := ExplorerImages.GetNext(ExplorerImages.FocusedNode);
> if ExplorerImages.ValidateNamespace(NextNode,Data) then
> begin
> ExplorerImages.DeleteSelectedNodes;
> ExplorerImages.ClearSelection;
> ExplorerImages.FocusedNode := NextNode;
> ExplorerImages.Selected[ExplorerImages.FocusedNode] := True;
> end;
> end;
> end;


re: Lurker report

From: "Mike Lischke" [lists@l...]
Date: Sat Sep 22, 2001 2:40 pm
Subject: RE: [VirtualTreeview] Lurker report

Hi Milan,

> 1. It looks a bit corrupted if the first demo selected is this one: the
> header is placed in the middle of the VT, but is quickly repainted. I can
> make a printscreen of this if you can't reproduce it (W2K, P3 600 MHz). I
> cannot imagine a reason for this.

This seems to be related to the delayed painting when the tree tries to access
a floppy drive. It
has already been suggested to change this.

> 2. I agree with Bug 65 (hint shadow is not animated with
> AnimationType=hatSlide).

Well, this is not a bug but designed. My thoughts were that it would cost too
much CPU power to
animated the shadow too (which is several rectangles/lines overlaid). Please
add this as suggestion
to the wish list in the database area of the mailing list.

> 3. GIF images are not shown at all, and they should. Also, PNG not shown,
> only BMPs and JPEGs are.

I compiled the demo without GraphicEx, so only the built-in image formats are
supported. The next
beta version will be compiled again as the public version so you will be able
to load gif, png, tga,
pcx, pcd, pdd and many others formats.

Ciao, Mike


re: Alt * to expand node ?

From: "Mike Lischke" [lists@l...]
Date: Sat Sep 22, 2001 2:40 pm
Subject: RE: [VirtualTreeview] Alt * to expand node ?

Hi,

> "Alt *" expands all node below selected one.

Try without "Alt" (in both VT and Explorer) :o]

> Good job anyway. What about your picture gallery ?

I have got already some contributions and will launch the gallery together with
the next public
version (hopefully yet this year).

Ciao, Mike


re: Re: New file uploaded to VirtualTreeview

From: "Mike Lischke" [lists@l...]
Date: Sat Sep 22, 2001 2:40 pm
Subject: RE: [VirtualTreeview] Re: New file uploaded to VirtualTreeview

Hi Jim,

> Let me claify (as I would like this too <g>) The drag image relies on
> VT initiating the drag. What Werner and I would like is to be able
> to call TBaseVirtualTree.PrepareDragImage at anytime to create the
> drag image. Then we can get the bitmap from TVTDragImage.Image.

Aaah, sorry for being so ignorant. Yes, of course, when you need this feature
then I will move
PrepareDragImage to the public section (in fact already done).

Ciao, Mike


re: Lurker Report (was: New file uploaded to VirtualTreeview)

From: "Mike Lischke" [lists@l...]
Date: Sat Sep 22, 2001 2:40 pm
Subject: RE: [VirtualTreeview] Lurker Report (was: New file uploaded to VirtualTreeview)

Hi Wim,

> 2nd Demo indeed (the arrows in the treecontro).

OK, I will think about some demo for this button too (perhaps the drop down
menu?).

> I know, i found out what it is, but to novices it's hard to find what to do
> (mainly caused by the description 'Draw Selection Mode:') I have no better
> suggestion at the moment. Perhaps add a tooltop that says try selecting one
> or more nodes.

Aha, good point. It is difficult to describe the features. The place is limited
and too much text
will deter people.

> Please place it on a 2nd page. It's great to see the trees move together
> that good.

Funny how importance for people differ. I wasn't even sure to include this
feature as demo. It is so
simple.... But when I think about the demos then I have the impression I find
most important what
needed the most work and was the most difficult (not always but often).

> If so, please only use the local harddisks as they should always be there.
> Perhaps just show all files and draw there icons full size. That way you
> won't have to look for pictures (i don't keep em near the root of a disk).

:-) The point however is that I want to show a typical draw tree. When I leave
out the images then I
can also use a normal string tree (or, much better, Jim's explorer tree).

> Well i'm not sure you should add XMLtree itself to the demo as it requires
> external software (IE) to be installed. Just a quick and dirty emulation of
> the look would be better. Btw I'm not sure he 'invented' it (have a look at
> XMLSpy which had this view for a long time).

Aha, I did not know this, but he at least mentioned it first to me and it was
his engagement that I
finally implemented it. Anyway, the XML tree will not be part of the Advanced
Demo, but a separate
application.

> Btw i got a pretty handy demo/ideas too.

I already looked at your demos and will answer separately for them.

> I can understand that, but it's so very useless when you open the root
> icons.

Well, depends on what it should demonstrate. Of this tree only the header is
important. Everything
else is to give it a nice frame. The dummy child nodes are only there to cause
the node buttons to
appear to show their different look. But I will think about a better solution.

Ciao, Mike


re: New file uploaded to VirtualTreeview

From: "Mike Lischke" [lists@l...]
Date: Sat Sep 22, 2001 2:40 pm
Subject: RE: [VirtualTreeview] New file uploaded to VirtualTreeview

> Comments Please (usefull?, other releated ideas?)....

It reminds me that I wanted to write a comfortable registry editor for a long
time.

Ciao, Mike


Cell background problem

From: [NRYJGUSFSVEY@s...]
Date: Sat Sep 22, 2001 3:48 pm
Subject: Cell background problem

Hi,

I have a tree with one column.

When I fill the cell background in OnBeforeCellPaint with FillRect
and the visible area of the Treeview is larger in width than the
column width, the area right of the column is painted in another
colour than TVirtualStringView.Color.

Is this an bug or a feature? How can I avoid this?

Bye

Marco


re: Lurker Report (was: New file uploaded to VirtualTreeview)

From: "Wim van der Vegt" [wvd_vegt@k...]
Date: Sat Sep 22, 2001 4:00 pm
Subject: Re: [VirtualTreeview] Lurker Report (was: New file uploaded to VirtualTreeview)

Hi,

>OK, I will think about some demo for this button too (perhaps the drop down
menu?).

At least either change the image used. Drop down menu's are already present
in the 3rd demo. Maybe a simple one to change the color of a branch will do.

>Funny how importance for people differ. I wasn't even sure to include this
feature as demo. It is so
>simple.... But when I think about the demos then I have the impression I
find most important what
>needed the most work and was the most difficult (not always but often).

We'll the problem is simple, the things you've always tried (no matter how
simple they may look) are perhaps the most impressive.

For me VT scores on a number of things:
- The no-size limit combined with it's speed (try that with a Common
Control).
- The combination of tree/list, which is the reason i found VT in the first
place (needed to group measurements).
- The fact it can be programmed to be flicker free (the sync scrolling for
instance)
- The sheer number of gui options like lmbands (of cource i only use a few
percentage of them),
- unicode arrangement of columns,
- bidi mode support etc.
- Source is available, so no major problems with new compiler versions etc.

Only weak point is the size of the source. Statisically there must be lots
of errors in it even if you archieve 1 errror/1000 lines which is alrady
quite good. Personally i would favor splitting it into several smaller units
that have options you can add-in or leave out. Not so much by recompiling
with conditional defines but by linking objects (bit like the DB Aware stuff
in Delphi). For instance i would like to be able to leave out Ole drag/drop
and most of the time editing to obtain pure vcl code without com objects.
I'm not sure if it's possible though because you've used a lot of
inheritance.

>:-) The point however is that I want to show a typical draw tree. When I
leave out the images then I
>can also use a normal string tree (or, much better, Jim's explorer tree).

Try showing full size icons for each file. That way will still be a draw
tree, but show drawtree content the moment you see it.

> Well i'm not sure you should add XMLtree itself to the demo as it requires
> external software (IE) to be installed. Just a quick and dirty emulation
of
> the look would be better. Btw I'm not sure he 'invented' it (have a look
at
> XMLSpy which had this view for a long time).

Aha, I did not know this, but he at least mentioned it first to me and it
was his engagement that I
finally implemented it. Anyway, the XML tree will not be part of the
Advanced Demo, but a separate
application.

-------
Wim van der Vegt

 | Replies | Author | Date
3847 | Re: Lurker Report | Mike Lischke | Wed 9/26/2001


Header draw problem

From: [F.vdwestelaken@c...]
Date: Mon Sep 24, 2001 9:14 am
Subject: Header draw problem

Hi,

after updating from 2.5.28 to 2.5.34 (problem also exists in 2.5.31),
my program doesn't correctly draw the header of a VT grid anymore
(see Drawheaderproblem.zip in the BugDemos area). Before, the 3d look
was fine, now all what's left is a white rectangle with the text
inside.

Franc.

 | Replies | Author | Date
3862 | Re: Header draw problem | Mike Lischke | Thu 9/27/2001
3864 | Re: Header draw problem | Franc van de Westelaken | Thu 9/27/2001
3865 | Re: Header draw problem | Mike Lischke | Thu 9/27/2001
3953 | Re: Header draw problem | [wvd_vegt@k...] | Sat 10/6/2001
4127 | Re: Header draw problem | Mike Lischke | Sat 10/20/2001


Windows XP

From: Werner Lehmann [wl@b...]
Date: Mon Sep 24, 2001 11:21 am
Subject: Windows XP

Hi,

this may be of interest to someone. Windows XP supports GUI theming, MS calls
this
'Visual Style' and it is similar to what WindowBlinds achieves. All common
controls
paint themselves in a different, more colorful (MS: fresh) way. During the last
VT
versions Mike has added support for some of these effects which make sense for
the
component (column background color, alpha blended draw selection, shaded expand
buttons, yellow header rollover effect).

I believe that it makes sense to show these only on WinXP. It is not sufficient
to
detect if the current OS is WinXP (anyone knows how? Win32MajorVersion is still
5
and to use the build no. does not seem right). This is because XP also supports
a
classic look and feel which makes it very similar to Win2K, visually. It can
even
switch between style during runtime, hence your app must know this. The code
below
detects if a 'theme' is currently active. This can be used to adjust the VT
look &
feel.

BTW, the shaded column denotes the currently sorted column. It is not
necessarily
always the main column. And the header painting is not quite 'perfect'. It is
all
ok to me, I just wanted to mention it. MS provides a very helpful article to
all who
want to support XP's style. It describes the new GUI elements and styles in
detail
and even provides exact RGB values for all effects, including the different
states
of a listview header.

http://msdn.microsoft.com/library/default.asp?url=/nhp/default.asp?contentid=280\
00524
http://www.microsoft.com/hwdev/windowsxp/downloads/

http://www.microsoft.com/hwdev/windowsxp/downloads/WindowsXP_DesignGuidelines.zi\
p
(5.2 MB, this has many pictures and the RGB details)

BTW-2, delphi applications do not support the new GUI out of the box, even on a
themed
XP the look of them will be the same as on Win2K, except for the window NC area
(caption,
scrollbar etc). To enable the new look for your delphi app you have to include
a manifest
either as an extra file (exename + '.manifest') or as a resource with a certain
name.
The manifest is just an XML which describes that your app wants to use the new
comctrl32
Version 6 dll. Here is a component which does this for you:

http://www.tmssoftware.com/winxp.zip

Regards,
Werner

================================================================================\
====

Detect if visual style is applied:

uXPSupport.pas:

//------------------------------------------------------------------------------\
----------------------------------------
//
// Partial conversion of header file uxtheme.h with dynamic loading of
// uxtheme.dll to allow usage under non-XP OS's.
//
// Portions of this file are Copyright (c) Microsoft Corporation.
//
//------------------------------------------------------------------------------\
----------------------------------------

unit uXPSupport;

interface

uses
Windows, SysUtils;

//------------------------------------------------------------------------------\
----------------------------------------

const
uxThemeDLL = 'uxtheme.dll';

WM_THEMECHANGED = $031A;

//------------------------------------------------------------------------------\
----------------------------------------

var
//---------------------------------------------------------------------------
// IsAppThemed() - returns TRUE if a theme is active and available to
// the current process
//---------------------------------------------------------------------------
IsAppThemed: function: BOOL; stdcall = nil;

//---------------------------------------------------------------------------
// GetCurrentThemeName()
// - Get the name of the current theme in-use.
// Optionally, return the ColorScheme name and the
// Size name of the theme.
//
// pszThemeFileName - receives the theme path & filename
// cchMaxNameChars - max chars allowed in pszNameBuff
//
// pszColorBuff - (optional) receives the canonical color scheme name
// (not the display name)
// cchMaxColorChars - max chars allowed in pszColorBuff
//
// pszSizeBuff - (optional) receives the canonical size name
// (not the display name)
// cchMaxSizeChars - max chars allowed in pszSizeBuff
//---------------------------------------------------------------------------
GetCurrentThemeName: procedure(
pszThemeFileName: PWideChar; cchMaxNameChars: Integer;
pszColorBuff: PWideChar; cchMaxColorChars: Integer;
pszSizeBuff: PWideChar; cchMaxSizeChars: Integer); stdcall = nil;

var
IsWin9x, IsWinNT, IsWin2K, IsWinXP: Boolean;

//------------------------------------------------------------------------------\
----------------------------------------

implementation

var
uxTheme: HMODULE = 0;

//------------------------------------------------------------------------------\
----------------------------------------

procedure InitOSVars;
begin
IsWin9x := (Win32Platform and VER_PLATFORM_WIN32_WINDOWS) <> 0;
IsWinNT := (Win32Platform and VER_PLATFORM_WIN32_NT) <> 0;
IsWin2K := IsWinNT and (Win32MajorVersion > 4);
IsWinXP := IsWinNT and (Win32MajorVersion > 5); // does not work
end;

//------------------------------------------------------------------------------\
----------------------------------------

procedure UninitThemeAPI;
begin
if uxTheme <> 0 then
begin
FreeLibrary(uxTheme);
uxTheme := 0;
end;
end;

//------------------------------------------------------------------------------\
----------------------------------------

procedure InitThemeAPI;
begin
UninitThemeAPI;
uxTheme := LoadLibrary(uxThemeDLL);
if uxTheme <> 0 then
begin
IsAppThemed := GetProcAddress(uxTheme, 'IsAppThemed');
GetCurrentThemeName := GetProcAddress(uxTheme, 'GetCurrentThemeName');
end;
end;

//------------------------------------------------------------------------------\
----------------------------------------

initialization
InitOSVars;
InitThemeAPI;
finalization
UninitThemeAPI;
end.

================================================================================\
====

Unit1.pas (Usage example):

uses
..., uXPSupport, ...

TForm1 = class(TForm)
...
procedure FormCreate(Sender: TObject);
private
procedure UpdateThemeStatus;
procedure WMThemeChanged(var Msg: TMessage); message WM_THEMECHANGED;
public
...
end;

procedure TForm1.FormCreate(Sender: TObject);
begin
UpdateThemeStatus;
end;

procedure TForm1.WMThemeChanged(var Msg: TMessage);
begin
inherited;
UpdateThemeStatus;
end;

procedure TForm1.UpdateThemeStatus;
var
pszThemeFileName, pszColorBuff, pszSizeBuff: array[0..255] of WideChar;
begin
Memo.Lines.Clear;
if not assigned(IsAppThemed) or not IsAppThemed then
Label2.Caption := 'not themed.'
else begin
Label2.Caption := 'themed.';
if assigned(GetCurrentThemeName) then
begin
GetCurrentThemeName(pszThemeFileName, 255, pszColorBuff, 255,
pszSizeBuff, 255);
Memo.Lines.Values['ThemeFileName'] := pszThemeFileName;
Memo.Lines.Values['ColorBuff'] := pszColorBuff;
Memo.Lines.Values['SizeBuff'] := pszSizeBuff;
end;
end;
end;

 | Replies | Author | Date
3829 | Re: Windows XP | Richard Scholz | Mon 9/24/2001
3830 | Re: Windows XP | [NRYJGUSFSVEY@s...] | Mon 9/24/2001
3831 | Re: Windows XP | Jiri Hajek | Mon 9/24/2001
3832 | Re: Windows XP | Werner Lehmann | Mon 9/24/2001
3848 | Re: Windows XP | Mike Lischke | Wed 9/26/2001


re: Windows XP

From: "Richard Scholz" [richard.scholz@b...]
Date: Mon Sep 24, 2001 11:46 am
Subject: Re: [VirtualTreeview] Windows XP

----- Original Message -----
From: "Werner Lehmann" [wl@b...]
To: "VirtualTreeview" <VirtualTreeview@yahoogroups.com>
Sent: Monday, September 24, 2001 1:23 PM
Subject: [VirtualTreeview] Windows XP

> Hi,
>
> this may be of interest to someone. Windows XP supports GUI theming, MS
calls this
> 'Visual Style' and it is similar to what WindowBlinds achieves. All common
controls
> paint themselves in a different, more colorful (MS: fresh) way. During the
last VT
> versions Mike has added support for some of these effects which make sense
for the
> component (column background color, alpha blended draw selection, shaded
expand
> buttons, yellow header rollover effect).
...

Hi Werner,

danke für den Beitrag. Wirklich gut!
gruss
Richard


re: Windows XP

From: [NRYJGUSFSVEY@s...]
Date: Mon Sep 24, 2001 11:48 am
Subject: Re: Windows XP

Hi!

> detect if the current OS is WinXP (anyone knows how?
Win32MajorVersion is still 5
> and to use the build no. does not seem right).

> procedure InitOSVars;
> begin
> IsWin9x := (Win32Platform and VER_PLATFORM_WIN32_WINDOWS) <> 0;
> IsWinNT := (Win32Platform and VER_PLATFORM_WIN32_NT) <> 0;
> IsWin2K := IsWinNT and (Win32MajorVersion > 4);
> IsWinXP := IsWinNT and (Win32MajorVersion > 5); // does not work
> end;

In Windows XP, the minor version number is 1 (in 2000 it is 0). So it
reports version 5.1.

Bye

Marco


re: Windows XP

From: "Jiri Hajek" [JirkaHajek@s...]
Date: Mon Sep 24, 2001 1:07 pm
Subject: RE: [VirtualTreeview] Windows XP

> detect if the current OS is WinXP (anyone knows how?
> Win32MajorVersion is still 5
> and to use the build no. does not seem right).

> procedure InitOSVars;
> begin
> IsWin9x := (Win32Platform and VER_PLATFORM_WIN32_WINDOWS) <> 0;
> IsWinNT := (Win32Platform and VER_PLATFORM_WIN32_NT) <> 0;
> IsWin2K := IsWinNT and (Win32MajorVersion > 4);
> IsWinXP := IsWinNT and (Win32MajorVersion > 5); // does not work
> end;

Everything about detecting Windows version is at:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sysinfo/sys
info_92jy.asp

Jiri


re: Windows XP

From: Werner Lehmann [wl@b...]
Date: Mon Sep 24, 2001 9:28 pm
Subject: Re: [VirtualTreeview] Windows XP

Jiri Hajek wrote:
>
> Everything about detecting Windows version is at:
>
>
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sysinfo/sysinfo\
_92jy.asp

Thank you. I have seen that page but somehow overlooked the XP reference.

Werner


New file uploaded to VirtualTreeview

From: [VirtualTreeview@yahoogroups.com>
Date: Tue Sep 25, 2001 6:33 am
Subject: New file uploaded to VirtualTreeview

Hello,

This email message is a notification to let you know that
a file has been uploaded to the Files area of the VirtualTreeview
group.

File : /VTHeaderPopup_1.0.zip
Uploaded by : [ralfjunker@g...]
Description : A popup menu descendant to assign to a VirtualTree Header. It
lists all columns and allows to hide / show them with a click. Images
supported.

You can access this file at the URL

http://groups.yahoo.com/group/VirtualTreeview/files/VTHeaderPopup_1.0.zip

To learn more about file sharing for your group, please visit

http://help.yahoo.com/help/us/groups/files

Regards,

ralfjunker@g...]


Data Aware version of VT?

From: [eljarec@y...]
Date: Tue Sep 25, 2001 10:03 am
Subject: Data Aware version of VT?

Hi,

I found VT today...uh...wow...speechless...

One quick question though, coming here I see a DBVT in the files area
but I can't do anything with it as I don't have Borland C++. Then I
tried installing the pre-compiled BPL, but it appearantly is based on
a customized VT as it seems to have trouble locating an entrypoint for

@[$xp$27Virtualtrees@T...] in the VirtualTreeview.bpl...

Kindof the same I would type when D5 throws a fit again... :)

 | Replies | Author | Date
3836 | Re: Data Aware version of VT? | Werner Lehmann | Tue 9/25/2001


Ctrl+ support

From: [eljarec@y...]
Date: Tue Sep 25, 2001 11:13 am
Subject: Ctrl+ support

Hi,

I've been trying to find some info on this, I could not find anything
that indicates if VT supports this for listviews/gridviews...
Is it supported? If not, does anyone have a routine lying around to
implement this easily into VT?

TIA
JarC

 | Replies | Author | Date
3837 | Re: Ctrl+ support | Jim Kueneman | Tue 9/25/2001
3838 | Re: Ctrl+ support | [eljarec@y...] | Tue 9/25/2001
3840 | Re: Ctrl+ support | Jim Kueneman | Tue 9/25/2001
3845 | Re: Ctrl+ support | [eljarec@y...] | Wed 9/26/2001
3846 | Re: Ctrl+ support | Jim Kueneman | Wed 9/26/2001
3839 | Re: Ctrl+ support | Bender Heri | Tue 9/25/2001
3841 | Re: Ctrl+ support | Werner Lehmann | Tue 9/25/2001
3842 | Re: Ctrl+ support | Richard Scholz | Tue 9/25/2001


re: Data Aware version of VT?

From: Werner Lehmann [wl@b...]
Date: Tue Sep 25, 2001 11:15 am
Subject: Re: [VirtualTreeview] Data Aware version of VT?

Hi,

[eljarec@y...] wrote:
>
> Kindof the same I would type when D5 throws a fit again... :)

DBVT has been build on/for a deprecated VTree version. I am not sure for which
one though.

Werner


re: Ctrl+ support

From: Jim Kueneman [jimdk@m...]
Date: Tue Sep 25, 2001 12:49 pm
Subject: Re: [VirtualTreeview] Ctrl+ support

>I've been trying to find some info on this, I could not find anything
>that indicates if VT supports this for listviews/gridviews...
>Is it supported? If not, does anyone have a routine lying around to
>implement this easily into VT?

Just to be the stupid looking one..... What is Ctrl + uppose to do?

Jim

 | Replies | Author | Date
3838 | Re: Ctrl+ support | [eljarec@y...] | Tue 9/25/2001
3840 | Re: Ctrl+ support | Jim Kueneman | Tue 9/25/2001
3845 | Re: Ctrl+ support | [eljarec@y...] | Wed 9/26/2001
3846 | Re: Ctrl+ support | Jim Kueneman | Wed 9/26/2001


re: Ctrl+ support

From: [eljarec@y...]
Date: Tue Sep 25, 2001 1:24 pm
Subject: Re: Ctrl+ support

--- In [VirtualTreeview@y...], Jim Kueneman [jimdk@m...] wrote:
>
> >I've been trying to find some info on this, I could not find
anything
> >that indicates if VT supports this for listviews/gridviews...
> >Is it supported? If not, does anyone have a routine lying around to
> >implement this easily into VT?
>
> Just to be the stupid looking one..... What is Ctrl + uppose to do?
>
> Jim

Well, why don't you open up anything that has a _listview_ and try?
(Like Explorer)

To save you the trouble :) Ctrl+ is the official WinHotKey to
autosize a listview so it fits the columnwidth to the largest visible
value in each column

JarC

 | Replies | Author | Date
3840 | Re: Ctrl+ support | Jim Kueneman | Tue 9/25/2001
3845 | Re: Ctrl+ support | [eljarec@y...] | Wed 9/26/2001
3846 | Re: Ctrl+ support | Jim Kueneman | Wed 9/26/2001


re: Re: Ctrl+ support

From: Bender Heri [HBender@E...]
Date: Tue Sep 25, 2001 1:44 pm
Subject: RE: [VirtualTreeview] Re: Ctrl+ support

> To save you the trouble :) Ctrl+ is the official WinHotKey to
> autosize a listview so it fits the columnwidth to the largest visible
> value in each column

BTW: Where can I find a list of this official WinHotKeys?

Heri


re: Re: Ctrl+ support

From: Jim Kueneman [jimdk@m...]
Date: Tue Sep 25, 2001 1:44 pm
Subject: Re: [VirtualTreeview] Re: Ctrl+ support

> > Jim
>
>Well, why don't you open up anything that has a _listview_ and try?
>(Like Explorer)

I did and nothing happened, but now I see it only works with the + on the
numeric keypad. Like I said to be the stupid looking one.

I remember some discussion about this, did you do a search on past threads?

Jim

 | Replies | Author | Date
3845 | Re: Ctrl+ support | [eljarec@y...] | Wed 9/26/2001
3846 | Re: Ctrl+ support | Jim Kueneman | Wed 9/26/2001


re: Re: Ctrl+ support

From: Werner Lehmann [wl@b...]
Date: Tue Sep 25, 2001 2:04 pm
Subject: Re: [VirtualTreeview] Re: Ctrl+ support

Hi,

> BTW: Where can I find a list of this official WinHotKeys?

Mike has documented his implemented shortcuts in the help file.

Werner


re: Re: Ctrl+ support

From: "Richard Scholz" [richard.scholz@b...]
Date: Tue Sep 25, 2001 2:10 pm
Subject: Re: [VirtualTreeview] Re: Ctrl+ support

Heri,

I don't know if this is what you are looking for,
but the following link contains two downloadable
Word-Files with the Win95 resp. Win98
Keyboard layout guidelines.

http://www.microsoft.com/enable/products/winkeyboard.htm

By the way, visit

http://www.microsoft.com/enable/products/docs/default.htm

for accessible software design, which you must follow
in case you want a Windows Logo.

greetings
Richard

----- Original Message -----
From: "Bender Heri" [HBender@E...]
To: <VirtualTreeview@yahoogroups.com>
Sent: Tuesday, September 25, 2001 3:44 PM
Subject: RE: [VirtualTreeview] Re: Ctrl+ support

> > To save you the trouble :) Ctrl+ is the official WinHotKey to
> > autosize a listview so it fits the columnwidth to the largest visible
> > value in each column
>
> BTW: Where can I find a list of this official WinHotKeys?
>
> Heri
>
>
> To unsubscribe from this group, send an email to:
> VirtualTreeview-unsubscribe@egroups.com
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>


FullExpand / FullCollapse

From: Werner Lehmann [wl@b...]
Date: Tue Sep 25, 2001 10:16 pm
Subject: FullExpand / FullCollapse

Hi Mike,

could you make these both virtual? I can optimize the full expand a lot for my
database 'connected' tree if I precache the full tree before the full expand
takes place. If the method is virtual I can simply override it and even the
numpad-block-* will use it. Also, I have still the need to override / reintro-
duce the fullcollapse because of an issue which has been discussed earlier but
did not led to a change...

Werner

 | Replies | Author | Date
3844 | Re: FullExpand / FullCollapse | Jim Kueneman | Tue 9/25/2001
3859 | Re: FullExpand / FullCollapse | Mike Lischke | Thu 9/27/2001


re: FullExpand / FullCollapse

From: "Jim Kueneman" [jimdk@m...]
Date: Tue Sep 25, 2001 10:31 pm
Subject: Re: FullExpand / FullCollapse

--- In [VirtualTreeview@y...], Werner Lehmann [wl@b...] wrote:
> Hi Mike,
>
> could you make these both virtual? I can optimize the full expand a
lot for my
> database 'connected' tree if I precache the full tree before the
full expand
> takes place. If the method is virtual I can simply override it and
even the
> numpad-block-* will use it. Also, I have still the need to
override / reintro-
> duce the fullcollapse because of an issue which has been discussed
earlier but
> did not led to a change...

Hi Werner,

I have been meaning to tell you that Mike looked at my VET code and
*finally* has seen the light. He is changing it so it does not
validate all the nodes before collapse.

Jim


re: Ctrl+ support

From: [eljarec@y...]
Date: Wed Sep 26, 2001 12:17 am
Subject: Re: Ctrl+ support

--- In [VirtualTreeview@y...], Jim Kueneman [jimdk@m...] wrote:
>
>
> I remember some discussion about this, did you do a search on past
threads?
>

Yup, turned up nothing...but another reply mentioned it being in the
help file. Since the included one has no mention of hotkeys
whatsoever, he probably meant the online version, which indeed has
this hotkey listed as being supported (among loads of others), but
alas it looks like these are features of the planned new version...

Thnx

Crasher

 | Replies | Author | Date
3846 | Re: Ctrl+ support | Jim Kueneman | Wed 9/26/2001


re: Ctrl+ support

From: "Jim Kueneman" [jimdk@m...]
Date: Wed Sep 26, 2001 3:45 am
Subject: Re: Ctrl+ support

> Yup, turned up nothing...but another reply mentioned it being in
the
> help file. Since the included one has no mention of hotkeys
> whatsoever, he probably meant the online version, which indeed has
> this hotkey listed as being supported (among loads of others), but
> alas it looks like these are features of the planned new version...

It works in 2.5.34 with VET. I looked at the source and there is no
options to set it should always work.

The latest version (2.5.34) is in the Files area on the Yahoo Group.

Jim


re: Lurker Report

From: "Mike Lischke" [lists@l...]
Date: Wed Sep 26, 2001 9:00 pm
Subject: RE: [VirtualTreeview] Lurker Report

Hi Wim,

> Only weak point is the size of the source. Statisically there must be lots
> of errors in it even if you archieve 1 errror/1000 lines which is alrady
> quite good.

But if you consider statistics here then you should consider the entire source
code of the world.
Not sure if the rule still applies in this case but then it looks more than
good for VT :-)

>Personally i would favor splitting it into several smaller units
> that have options you can add-in or leave out.

This will not bring many advantages. The linker does already a good job and to
make it work right
many things are very tightly bound together, so you would trade leaving out
features with very
complex conditional compilation. Additionally, why are several files better
than one (given that
there are many more anyway for management e.g. packages or also demos etc.)?
With such a tool like
our beloved Delphi/BCB IDE you can easily navigate between various code parts.
Together with search
(both: liniear and incremental), some hotkey etc. I'm extremley fast within the
code. And I haven't
even started using the code explorer.

> in Delphi). For instance i would like to be able to leave out Ole drag/drop
> and most of the time editing to obtain pure vcl code without com objects.
> I'm not sure if it's possible though because you've used a lot of
> inheritance.

If it is only because of the size then I wouldn't care about the OLE stuff. It
is very mighty and a
good control should support OLE. The only reason why *I* would like to disable
it optionally is for
porting VT to Kylix.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: Windows XP

From: "Mike Lischke" [lists@l...]
Date: Wed Sep 26, 2001 9:01 pm
Subject: RE: [VirtualTreeview] Windows XP

Hi Werner,

> this may be of interest to someone. Windows XP supports GUI theming, MS calls
this
> 'Visual Style' and it is similar to what WindowBlinds achieves. All common
controls
> paint themselves in a different, more colorful (MS: fresh) way. During the
last VT
> versions Mike has added support for some of these effects which make sense
for the
> component (column background color, alpha blended draw selection, shaded
expand
> buttons, yellow header rollover effect).

Thank you very much for letting us know. I will download the stuff and
carefully look through it :-)
For the theme change: I will leave that to the application developer. If an
application wants to
support themes on XP then it has to check everything anyway, and so it is only
a tiny task to switch
VT's header and button drawing too.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


how to get a dragimage from a vcl component

From: "Moritz Franckenstein" [franckenstein@a...]
Date: Thu Sep 27, 2001 9:34 am
Subject: how to get a dragimage from a vcl component

hello,

i know, this is not really a vt related question, but i hope someone
can help me...

i want to have a pallet with some icons on my form that represent
possible node types that can be created in the tree.
these icons should be dragged and dropped into the tree to create a
new node.

currently i have chosen a toolbar with toolbuttons and set
DragMode=dmAutomatic. now the buttons can be dragged to the tree. but
only the standard drag cursor is shown during drag.

how can i drag the image of the icon?
is there a better component for this?

i have seen the onStartDrag event and the DragObject but dont find
out how to use it.

thanks in advance,
moritz

 | Replies | Author | Date
3855 | Re: how to get a dragimage from a vcl component | Jim Kueneman | Thu 9/27/2001


re: Lurker Report (was: New file uploaded to VirtualTreeview)

From: "Moritz Franckenstein" [franckenstein@a...]
Date: Thu Sep 27, 2001 9:48 am
Subject: Re: Lurker Report (was: New file uploaded to VirtualTreeview)

hi mike,

> Secondly, if Moritz does agree then I will add his
> XML tree to the demos distribution. Thirdly, you are totally right.
His bands idea and also the kind
> of drawing he invented looks very appealing

of course i agree :)

-moritz


TVTHeader Popup Notification missing

From: Ralf Junker [ralfjunker@g...]
Date: Wed Sep 26, 2001 11:01 am
Subject: TVTHeader Popup Notification missing

Hi Mike,

the TVTHeader.Popup property does not call FreeNotification when assigning a
new Popup menu (latest version). Something like the following is missing:

procedure TVTHeader.SetPopupMenu(Value: TPopupMenu);
begin
if FPopupMenu = Value then Exit;
{$IFDEF COMPILER_5+}
if FPopupMenu <> nil then FPopupMenu.RemoveFreeNotification(Self);
{$ENDIF}
FPopupMenu := Value;
if Value <> nil then Value.FreeNotification(Self);
end;

Regards,

-- Ralf

 | Replies | Author | Date
3860 | Re: TVTHeader Popup Notification missing | Mike Lischke | Thu 9/27/2001


to Mike

From: Oleg Kraynov [olegvkr@y...]
Date: Thu Sep 27, 2001 10:38 am
Subject: to Mike

Hi, Mike.

Please, add in TVirtualStringTree and TVirtualDrawTree of line:

{$ifdef COMPILER_5+}
property OnContextPopup;
{$endif}

--
Best regards,
Oleg

_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com

 | Replies | Author | Date
3858 | Re: to Mike | Mike Lischke | Thu 9/27/2001


Cant Edit node.

From: "Simon Moscrop" [SimonMoscrop@H...]
Date: Thu Sep 27, 2001 11:22 am
Subject: Cant Edit node.

Hi,

I am using VirtualTrees 2.5.34 (RC1)

I wonder if anyone out there can help me. I have an MDI app which
contains a number of child forms that have multiple
TVirtualStringTree instances on them.

For explanation purposes lets call the child forms FormA and FormB.

1.If I open FormA and try to edit the VST I can - OK.
2.Then, leaving FormA open, I open FormB and try to edit the VST I
can - everything is still OK.
3.However, if i then bring FormA back to the front (using
bringToFront) I cannot edit the treeview(though i can navigate it)
until i have clicked elsewhere - then back on the TreeView.

I have noticed this problem gets worse if I put try to fo
VST.SetFocus on form.Activate - if i try this then i try set 1 edit,
again, does not happen until i have clicked elsewhere then back onto
the VST.

I have tried to replicate this behaviour in a smaller application,
(so far, unsuccsefully) so that i could upload it to the 'files' area.
Could anyone have a guess at what i may be doing wrong.

(PS. allowEdit in OnEditing is set to true all the time)

Cheers for any help
- Simon Moscrop

 | Replies | Author | Date
3854 | Re: Cant Edit node. | Jim Kueneman | Thu 9/27/2001
3856 | Re: Cant Edit node. | [NRYJGUSFSVEY@s...] | Thu 9/27/2001
3857 | Re: Cant Edit node. | [pdagosta@c...] | Thu 9/27/2001
3861 | Re: Cant Edit node. | Mike Lischke | Thu 9/27/2001
3872 | Re: Cant Edit node. | Simon Moscrop | Fri 9/28/2001


re: Cant Edit node.

From: Jim Kueneman [jimdk@m...]
Date: Thu Sep 27, 2001 1:02 pm
Subject: Re: [VirtualTreeview] Cant Edit node.

>I have noticed this problem gets worse if I put try to fo
>VST.SetFocus on form.Activate - if i try this then i try set 1 edit,
>again, does not happen until i have clicked elsewhere then back onto
>the VST.

You are not the first with this problem, I think the other was a MDI
application too so that could be a clue. I think we are going to need a
small demo in order to find it. Keep trying <g>

Jim

 | Replies | Author | Date
3856 | Re: Cant Edit node. | [NRYJGUSFSVEY@s...] | Thu 9/27/2001


re: how to get a dragimage from a vcl component

From: Jim Kueneman [jimdk@m...]
Date: Thu Sep 27, 2001 1:31 pm
Subject: Re: [VirtualTreeview] how to get a dragimage from a vcl component

Hi Mortiz,

What you basiclly have to do is create a decendant of DragObject that
overrides and implements GetDragImages. Here is a snippit from something I
am working on for OLE drag converted for the VCL drag

type
TImagedDragImage = class(TDragImage)
protected
FImageSourceWindow: TWinControl;
FImageRect: TRect;
function TImagedDragImage .CreateDragImageFromRect(Window: TWinControl;
ImageRect: TRect): HBitmap;
function GetDragImages: TDragImageList; override;
public
constructor Create(ImageSourceWindow: TWinControl; ImageRect: TRect);
end;

function TImagedDragImage .CreateDragImageFromRect: HBitmap;
var
DC, MemDC: hDc;
Bits, OldBits: HBitmap;
W, H: integer;
begin
W := FImageRect.Right - FImageRect.Left;
H := FImageRect.Bottom - FImageRect.Top;
DC := GetDC(FImageSourceWindow.Handle);
Bits := CreateCompatibleBitmap(DC, W, H);
MemDC := CreateCompatibleDC(DC);
OldBits := SelectObject(MemDC, Bits);
BitBlt(MemDc, 0, 0, W, H, DC, FImageRect.Left, FImageRect.Top, srcCopy);
Result := SelectObject(MemDc, OldBits);
DeleteDC(MemDC);
ReleaseDC(FImageSourceWindow.Handle, DC);
end;

function TImagedDragImage .GetDragImages: TDragImageList;
var
Image: TBitmap;
begin
Result := TDragImageList.Create(nil); // Not sure who should own
this check that is is destroyed
Image := TBitmap.Create;
Image.Handle := CreateDragImageFromRect;
Result.AddMasked(Image, FImageSourceWindow.Color);
end;

Now note the event is for the Toolbutton but we need a TWinControl
decendant for the drag image so send the Toolbar with the ToolButton's
rectange with respect to the toolbar so the right image is drawn.

TForm1.ToolButton1OnDragStart (Sender: TObject; var DragObject: TDragObject);
begin
DragObject := TImagedDragImage.Create(Toolbar1, ToolButton1.BoundsRect);
end;

Do the same for each buttons event.

This is totally untested so hopefully it is enough to get you started.

Jim


re: Cant Edit node.

From: [NRYJGUSFSVEY@s...]
Date: Thu Sep 27, 2001 2:29 pm
Subject: Re: Cant Edit node.

Hi!

> I think we are going to need a small demo in order to find it.

Have you copied the Tree using the clipboard? So it is guaranteed
that all options are included. Then copy all event sources to the
smaller application.

Bye

Marco


re: Cant Edit node.

From: [pdagosta@c...]
Date: Thu Sep 27, 2001 4:27 pm
Subject: Re: Cant Edit node.

--- In [VirtualTreeview@y...], "Simon Moscrop" [SimonMoscrop@H...]
wrote:

> I have tried to replicate this behaviour in a smaller application,
> (so far, unsuccsefully) so that i could upload it to the 'files'
area.
> Could anyone have a guess at what i may be doing wrong.
>

Hi Simon,

I have seen strange focus problems with MDI apps. I'm not sure that
I've seen the exact focus problem you've described.

Sample Demo desciption of a MDI problem:
Create a MDI parent form with a memo TopAligned in it
Create a MDI children form with a VT in it(with some nodes of course).
Run the app
open 2 children
Window->tilehorizontal
click on one vt (a node should be blue--showing focus)
click on the memo (the node in the vt should be gray)
click on the same vt (the node will not show focus)
click on the second vt (it will gain focus)
click on the original vt (focus is shown again)

This problem is easy to recreate and may be symptomatic of the same
problem you are experiencing. My original thought was that it was a
problem of MDI, but I'm beginning to think it may be in VT.

Paul

 | Replies | Author | Date
3861 | Re: Cant Edit node. | Mike Lischke | Thu 9/27/2001
3872 | Re: Cant Edit node. | Simon Moscrop | Fri 9/28/2001


re: to Mike

From: "Mike Lischke" [lists@l...]
Date: Thu Sep 27, 2001 8:21 pm
Subject: RE: [VirtualTreeview] to Mike

Hi Oleg,

> Please, add in TVirtualStringTree and TVirtualDrawTree of line:
> {$ifdef COMPILER_5+}
> property OnContextPopup;
> {$endif}

Done.

Ciao, Mike


re: FullExpand / FullCollapse

From: "Mike Lischke" [lists@l...]
Date: Thu Sep 27, 2001 8:21 pm
Subject: RE: [VirtualTreeview] FullExpand / FullCollapse

Hi Werner,

> could you make these both virtual? I can optimize the full expand a lot for my
> database 'connected' tree if I precache the full tree before the full expand
> takes place.

Sure, no problem. It is usually not very frequently called so it should have no
significant impact
on the tee's performance.

Done

Ciao, Mike


re: TVTHeader Popup Notification missing

From: "Mike Lischke" [lists@l...]
Date: Thu Sep 27, 2001 8:21 pm
Subject: RE: [VirtualTreeview] TVTHeader Popup Notification missing

Hi Ralf,

> the TVTHeader.Popup property does not call FreeNotification when assigning a
new Popup
> menu (latest version). Something like the following is missing:
>
> procedure TVTHeader.SetPopupMenu(Value: TPopupMenu);
> begin
> if FPopupMenu = Value then Exit;
> {$IFDEF COMPILER_5+}
> if FPopupMenu <> nil then FPopupMenu.RemoveFreeNotification(Self);
> {$ENDIF}
> FPopupMenu := Value;
> if Value <> nil then Value.FreeNotification(Self);
> end;

This does not work because TVTHeader is not a component, but I have added a
check in the tree's
Notification method which catches this dangerous case. Thank your for pointing
that out.

Ciao, Mike


re: Re: Cant Edit node.

From: "Mike Lischke" [lists@l...]
Date: Thu Sep 27, 2001 8:21 pm
Subject: RE: [VirtualTreeview] Re: Cant Edit node.

Hi Paul and Simon,

> This problem is easy to recreate and may be symptomatic of the same
> problem you are experiencing. My original thought was that it was a
> problem of MDI, but I'm beginning to think it may be in VT.

Your first feeling was right, Paul. The problem raises from the fact that in
this special case
TWinControl.GetFocused does not return a valid value (at least from the view of
VT). The tree is
left in the believe that it does not have the focus. I don't know if that can
be but this is what
the TWinControl.Focused property returns. I can't do anything to prevent this
wrong behavior.

When the user clicks into the tree window then it gets correctly the focus. If
you want to check
further then look into TBaseVirtualTree.PrepareCell. Below the comment "// Fill
the selection
rectangle." there is a branch "if Focused or (toPopupMode in
FOptions.FPaintOptions) then" which
always returns False in the MDI case because Focused returns False (leave out
the popup mode for the
moment).

Ciao, Mike

 | Replies | Author | Date
3872 | Re: Cant Edit node. | Simon Moscrop | Fri 9/28/2001


re: Header draw problem

From: "Mike Lischke" [lists@l...]
Date: Thu Sep 27, 2001 8:23 pm
Subject: RE: [VirtualTreeview] Header draw problem

Hi Franc,

> after updating from 2.5.28 to 2.5.34 (problem also exists in 2.5.31),
> my program doesn't correctly draw the header of a VT grid anymore
> (see Drawheaderproblem.zip in the BugDemos area). Before, the 3d look
> was fine, now all what's left is a white rectangle with the text
> inside.

Do you use owner draw for the header? I have changed the code so that the frame
is no longer drawn
if owner draw is active for a column. In this case you have to draw the frame
yourself.

Ciao, Mike

 | Replies | Author | Date
3864 | Re: Header draw problem | Franc van de Westelaken | Thu 9/27/2001
3865 | Re: Header draw problem | Mike Lischke | Thu 9/27/2001
3953 | Re: Header draw problem | [wvd_vegt@k...] | Sat 10/6/2001
4127 | Re: Header draw problem | Mike Lischke | Sat 10/20/2001


Bug entry #56

From: "Mike Lischke" [lists@l...]
Date: Thu Sep 27, 2001 8:29 pm
Subject: Bug entry #56

Werner,

I cannot reproduce what you wrote in your bug entry. You can check yourself
with the demo executable I uploaded recently. It works fine for me and also
uses OnPaintText (see general abilities page).

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: Header draw problem

From: "Franc van de Westelaken" [F.vdwestelaken@c...]
Date: Thu Sep 27, 2001 8:30 pm
Subject: RE: [VirtualTreeview] Header draw problem

Hi Mike,

yes I'm using owner draw in the header since I have to write on multiple
lines (and use sub and superscript characters). Is it perhaps possible
to include a boolean or option somewhere to specify if the frame has to
be drawn or not. If this is not possible could you send me the code to
draw the frame so I can implement it in my ownerdraw routine ?

Thanks,
Franc.

Do you use owner draw for the header? I have changed the code so that
the frame is no longer drawn
if owner draw is active for a column. In this case you have to draw the
frame yourself.

[Non-text portions of this message have been removed]

 | Replies | Author | Date
3865 | Re: Header draw problem | Mike Lischke | Thu 9/27/2001


re: Header draw problem

From: "Mike Lischke" [lists@l...]
Date: Thu Sep 27, 2001 8:35 pm
Subject: RE: [VirtualTreeview] Header draw problem

> If this is not possible could you send me the code to
> draw the frame so I can implement it in my ownerdraw routine ?

Drawing the frame is very easy. See in Header.PaintHeader after the comment "//
Draw button
edge/divider only if not owner draw.". The DrawEdge API is the key.

Ciao, Mike


Bug entry #57

From: "Mike Lischke" [lists@l...]
Date: Thu Sep 27, 2001 8:38 pm
Subject: Bug entry #57

Hi Martin,

I cannot reproduce the effect you mentioned in your bug entry.
OnBeforeCellPaint is called in PrepareCell which in turn is triggered by
PaintTree. PrepareCell is called for every cell in a node unless column
spanning is enabled. Please check if this is the case in your application (see
TreeOptions.AutoOptions.toAutoSpanColumns).

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


Bug entry #63

From: "Mike Lischke" [lists@l...]
Date: Thu Sep 27, 2001 8:49 pm
Subject: Bug entry #63

Hi Jim,

I cannot reproduce the bug you mentioned in #63. On my machine and with your
latest demo everything is fine regarding the hit test. Is your bug entry still
valid?

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


Bug entry #66

From: "Mike Lischke" [lists@l...]
Date: Thu Sep 27, 2001 8:52 pm
Subject: Bug entry #66

Hi all,

can somebody else reroduce this bug? TFormatArray is declared in the VT unit,
so it should never give any problems like being not declared!

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


Bug entry #68

From: "Mike Lischke" [lists@l...]
Date: Thu Sep 27, 2001 8:55 pm
Subject: Bug entry #68

Hi Hans-Jürgen,

what you mentioned in your bug entry is true but basically by design. The
constain features depend on some anchors set which may not when Ctrl+A is
pressed. In order to avoid confusions for the user I left the full selection in
there. Perhaps handling Ctrl+A would be an acceptable solution (see
OnKeyAction)?

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


Best Way To Build A Tree?

From: "Tom Hahn" [thahn@h...]
Date: Thu Sep 27, 2001 10:58 pm
Subject: Best Way To Build A Tree?

I have an application which consists of the following table structure:

Level1 Level2 Level3 Name Data
Level1 Level2 Level3 Name Data

An example might be:

A B C Name1 Data
A B D Name2 Data
A E Name3 Data
G Name4 Data

I would like to step through the array, creating nodes sequentially and
assigning data during the same sequence of steps. I am unsure how to
proceed, using OnInitNode and OnInitChildren.

Any guidance would be appreciated.

Tom

 | Replies | Author | Date
3874 | Re: Best Way To Build A Tree? | Werner Lehmann | Fri 9/28/2001
3875 | Re: Best Way To Build A Tree? | Tom Hahn | Fri 9/28/2001
3876 | Re: Best Way To Build A Tree? | Werner Lehmann | Fri 9/28/2001
3877 | Re: Best Way To Build A Tree? | Tom Hahn | Sat 9/29/2001


Autoexpand/autocollapse question

From: [njlo555@h...]
Date: Fri Sep 28, 2001 7:58 am
Subject: Autoexpand/autocollapse question

Hi!

It seems to me that the a auto-option Autoexpand does also auto
collapse. Is this intentional?

Nikolaj

 | Replies | Author | Date
3879 | Re: Autoexpand/autocollapse question | Mike Lischke | Sat 9/29/2001


re: Cant Edit node.

From: "Simon Moscrop" [SimonMoscrop@H...]
Date: Fri Sep 28, 2001 11:26 am
Subject: Re: Cant Edit node.

Paul & Mike

Thanks for your input on this matter. I have some further information
for you (that may, or may not prove useful) - The symptoms i have
described seemed only to happen when i was bringing the child windows
to the front using controls that were using up some of the MDI form
client area. If i use a TMenu to bring the screens to the front the
problem i have described disappears. ... Wierd.

I am currently investigating this matter using the setup that was
sugested by Paul and will get back in touch if i get any further
towards resolving this matter.

Thanks again for your input on this matter.

Should i bother uploading a demo of this as per pauls example - i'm
pretty sure we're looking at different symptoms of the same bug (not
even keypresses get passed into the wndproc).

--- In [VirtualTreeview@y...], "Mike Lischke" [lists@l...] wrote:
> Hi Paul and Simon,
>
> > This problem is easy to recreate and may be symptomatic of the
same
> > problem you are experiencing. My original thought was that it
was a
> > problem of MDI, but I'm beginning to think it may be in VT.
>
> Your first feeling was right, Paul. The problem raises from the
fact that in this special case
> TWinControl.GetFocused does not return a valid value (at least from
the view of VT). The tree is
> left in the believe that it does not have the focus. I don't know
if that can be but this is what
> the TWinControl.Focused property returns. I can't do anything to
prevent this wrong behavior.
>
> When the user clicks into the tree window then it gets correctly
the focus. If you want to check
> further then look into TBaseVirtualTree.PrepareCell. Below the
comment "// Fill the selection
> rectangle." there is a branch "if Focused or (toPopupMode in
FOptions.FPaintOptions) then" which
> always returns False in the MDI case because Focused returns False
(leave out the popup mode for the
> moment).
>
> Ciao, Mike


Cant Focus/Edit Node bug (Possible fix)

From: "Simon Moscrop" [SimonMoscrop@H...]
Date: Fri Sep 28, 2001 1:59 pm
Subject: Cant Focus/Edit Node bug (Possible fix)

Mike, Paul, & All.

I have found a work around for the problem that i have described
earlier - let me know your views as to whether this is an appropriate
fix or not.

Its just one routine that ensures that the focus gets killed (fully).

Cheers

- Simon Moscrop

procedure TBaseVirtualTree.WMKillFocus(var Msg: TWMKillFocus);

//------------------------------------------------------------
procedure DefocusControl;
var
P : TComponent;
found : boolean;
begin

P := Owner;

found := false;
while assigned(P) and not found do
begin

// Search through controls owners until a TForm descendant is
found.
iF p IS TForm THEN
BEGIN
found := true;
// Check if it is an MDIChild.
if TForm(p).FormStyle = fsMDIChild then
begin
// If so sets its active child to nil - which will force
// correct set focus procedure later.
TForm(p).ActiveControl := nil;
end;
END
else
p := P.Owner;

end;
end;
//------------------------------------------------------------

begin
inherited;

DefocusControl;

etc.....

 | Replies | Author | Date
3880 | Re: Cant Focus/Edit Node bug (Possible fix) | Mike Lischke | Sat 9/29/2001
3881 | Re: Cant Focus/Edit Node bug (Possible fix) | Simon Moscrop | Sat 9/29/2001
3897 | Re: Cant Focus/Edit Node bug (Possible fix) | Mike Lischke | Tue 10/2/2001


re: Best Way To Build A Tree?

From: Werner Lehmann [wl@b...]
Date: Fri Sep 28, 2001 5:19 pm
Subject: Re: [VirtualTreeview] Best Way To Build A Tree?

Hi Tom,

> I have an application which consists of the following table structure:
>
> Level1 Level2 Level3 Name Data
> Level1 Level2 Level3 Name Data
>
> An example might be:
>
> A B C Name1 Data
> A B D Name2 Data
> A E Name3 Data
> G Name4 Data
>
> I would like to step through the array, creating nodes sequentially and
> assigning data during the same sequence of steps. I am unsure how to
> proceed, using OnInitNode and OnInitChildren.

I don't believe that you get far with only these two events. There's at
least some preparation required. You need the number of root nodes. This
is not simply the size of your array, but the number o farray entries with
different Level1 field. The same principle applies to the other two levels.
And when you have this you have still the problem in OnInitNode to know
which of the array entries has to be used know for the currently passed
node.

Your data can be used to extract a hierarchical structure, but it does not
provide it ready to be used. Thus you need another data structure which
is more directly usable by the init events. Or, alternatively, init the
tree all at once and use its TVirtualNode records to build this hierarchical
structure explicitly.

Regards,
Werner

 | Replies | Author | Date
3875 | Re: Best Way To Build A Tree? | Tom Hahn | Fri 9/28/2001


re: Best Way To Build A Tree?

From: "Tom Hahn" [thahn@h...]
Date: Fri Sep 28, 2001 7:06 pm
Subject: RE: [VirtualTreeview] Best Way To Build A Tree?

Hi Werner

> > I have an application which consists of the following table structure:
> >
> > Level1 Level2 Level3 Name Data
> > Level1 Level2 Level3 Name Data
> >
> > An example might be:
> >
> > A B C Name1 Data
> > A B D Name2 Data
> > A E Name3 Data
> > G Name4 Data
> >
> > I would like to step through the array, creating nodes sequentially and
> > assigning data during the same sequence of steps. I am unsure how to
> > proceed, using OnInitNode and OnInitChildren.
>
> I don't believe that you get far with only these two events. There's at
> least some preparation required. You need the number of root nodes. This
> is not simply the size of your array, but the number o farray entries with
> different Level1 field. The same principle applies to the other
> two levels.
> And when you have this you have still the problem in OnInitNode to know
> which of the array entries has to be used know for the currently passed
> node.
>
> Your data can be used to extract a hierarchical structure, but it does not
> provide it ready to be used. Thus you need another data structure which
> is more directly usable by the init events. Or, alternatively, init the
> tree all at once and use its TVirtualNode records to build this
> hierarchical
> structure explicitly.
>
> Regards,
> Werner

Thank you for responding!

I think what you are suggesting is what I want to do - in other words, can I
create a tree without using the OnInitNode and OnInitChildren events. (I
should have explained this betetr in my original message.)

I have been considering something like the following (untested psuedeo
code}:

type
pTree : ^Tree;
Tree = record
Indx : integer;
Level : integer:
end;

var
x : constant;
L1Node,
L2Node,
L3Node,
NameNode : pVirtualNode;
Data : pTree;

LastLevel1,
LastLevel2,
LastLevel3 : string;

(Array of dated called Entry, with HiEntry = last item)

BeginUpdate;
for x : 0 to HiEntry do
begin
if (Entry[x].Level1 <> '') and (Entry[x].Level1 <> LastLevel1) then
begin
// create Level 1 node
LastLevel1 := Entry[x].Level1;
LastLevel2 := '';
LastLevel3 := '';
L2Node := nil;
L1Node := AddChild(nil);
Data := GetNodeData(L1Node);
Data.Indx := x;
Data.Level := 1;
end;
if (Entry[x].Level2 <> '') and (Entry[x].Level2 <> LastLevel2) then
begin
// create Level 2 node
LastLevel2 := Entry[x].Level2;
LastLevel3 := '';
L3Node := nil;
L2Node := AddChild(L1Node);
Data := GetNodeData(L2Node);
Data.Indx := x;
Data.Level := 2;
end;
if (Entry[x].Level3 <> '') and (Entry[x].Level3 <> LastLevel3) then
begin
// create Level 3 node
LastLevel3 := Entry[x].Level3;
L3Node := AddChild(L2Node);
Data := GetNodeData(L3Node);
Data.Indx := x;
Data.Level := 3;
end;
// create normal node
if L3Node <> nil then
begin
NameNode := AddChild(L3Node);
Data := GetNodeData(NameNode);
Data.Indx := x;
Data.Level := 4;
end
else
if L2Node <> nil then
begin
NameNode := AddChild(L2Node);
Data := GetNodeData(NameNode);
Data.Indx := x;
Data.Level := 4;
end
else
begin
NameNode := AddChild(L1Node);
Data := GetNodeData(NameNode);
Data.Indx := x;
Data.Level := 4;
end;
end;
EndUpdate;

I would then use the OnGetText text event to supply the text for the nodes
by keying off the Indx and Level.

Does this kind of approach make sense? Is there a better way? Part of my
confusion is a lack of understanding about when the various "events" (e.g.
OnInitNode and OnInitChildren) are fired.

Regards,
Tom


re: Best Way To Build A Tree?

From: Werner Lehmann [wl@b...]
Date: Fri Sep 28, 2001 8:18 pm
Subject: Re: [VirtualTreeview] Best Way To Build A Tree?

Hi Tom,

> I think what you are suggesting is what I want to do - in other words, can I
> create a tree without using the OnInitNode and OnInitChildren events. (I
> should have explained this betetr in my original message.)

No problem.

> I have been considering something like the following (untested psuedeo
> code}:

Something along these lines, yes. I have not analyzed the last little bit out
of that
code but it seems to me that this assumes a certain sorted order in the array.

> I would then use the OnGetText text event to supply the text for the nodes
> by keying off the Indx and Level.

Sure. Both Indx and Level are just indices into a 2 dimensional data structure.

> Does this kind of approach make sense? Is there a better way? Part of my
> confusion is a lack of understanding about when the various "events" (e.g.
> OnInitNode and OnInitChildren) are fired.

OnInitNode is fired when the text of a node (or whatever) is needed first. This
is usually when it is visible on the screen, or when the tree should be sorted.
OnInitChildren is fired when the children of a node need to be known for the
first time. The standard example is here the expansion of the parent node. If
you init all your nodes manually you can safely ignore these events. The method
of 'late initialization' is most important when you have *very* many nodes, and
maybe if you won't need most of them ever.

Werner

 | Replies | Author | Date
3877 | Re: Best Way To Build A Tree? | Tom Hahn | Sat 9/29/2001


re: Best Way To Build A Tree?

From: "Tom Hahn" [thahn@h...]
Date: Sat Sep 29, 2001 3:49 am
Subject: RE: [VirtualTreeview] Best Way To Build A Tree?

Hi Werner,

Thank you for your insight.

> Something along these lines, yes. I have not analyzed the last
> little bit out of that
> code but it seems to me that this assumes a certain sorted order
> in the array.
>
The array is in order by Level1, Level2, Level3, and Name which are really
four node levels.

> OnInitNode is fired when the text of a node (or whatever) is
> needed first. This
> is usually when it is visible on the screen, or when the tree
> should be sorted.
> OnInitChildren is fired when the children of a node need to be
> known for the
> first time. The standard example is here the expansion of the
> parent node. If
> you init all your nodes manually you can safely ignore these
> events. The method
> of 'late initialization' is most important when you have *very*
> many nodes, and
> maybe if you won't need most of them ever.
>

Your explanation makes things a lot clearer. I am proceeding with the
approach that I outlined and it seems to be working.

The number of nodes will be usually be less than several thousand. In most
cases, a major part of the tree will probably be accessed so based upon your
explanation, I would not expect to be sacrificing much efficiency by
creating the entire tree at the start of processing.

Tom


Ownerdraw Dropmak on HeaderDragging

From: "Anders Thomsen" [anders@t...]
Date: Sat Sep 29, 2001 12:40 pm
Subject: Ownerdraw Dropmak on HeaderDragging

Hi,

I'm using ownerdraw to draw the header columns in a tree.
I would also like to draw the dropmarks when a header is dragged, how can I do
this?
Could OnHeaderDraw maybe be changed to something like:
HeaderDraw(Sender: TVTHeader; Canvas: TCanvas;
Column: TVirtualTreeColumn; R: TRect; Hover, Pressed, DropMarkLeft,
DropMarkRight: Boolean);

Best regards,
Anders Thomse

[Non-text portions of this message have been removed]

 | Replies | Author | Date
3898 | Re: Ownerdraw Dropmak on HeaderDragging | Mike Lischke | Tue 10/2/2001


re: Autoexpand/autocollapse question

From: "Mike Lischke" [lists@l...]
Date: Sat Sep 29, 2001 3:09 pm
Subject: RE: [VirtualTreeview] Autoexpand/autocollapse question

Hi Nikolaj,

> It seems to me that the a auto-option Autoexpand does also auto
> collapse. Is this intentional?

Yes, this is intented so. The task is to collapse the node which looses the
focus and expand the one
which gets the focus. See also: TBaseVirtualTree.DoFocusNode.

Ciao, Mike


re: Cant Focus/Edit Node bug (Possible fix)

From: "Mike Lischke" [lists@l...]
Date: Sat Sep 29, 2001 3:09 pm
Subject: RE: [VirtualTreeview] Cant Focus/Edit Node bug (Possible fix)

Hi Simon,

> I have found a work around for the problem that i have described
> earlier - let me know your views as to whether this is an appropriate
> fix or not.
> Its just one routine that ensures that the focus gets killed (fully).

Thank you for your idea. I have it implemented slightly different and used:

Form := GetParentForm(Self);
if Assigned(Form) then
with Form as TForm do
if (FormStyle = fsMDIChild) and not Active then
ActiveControl := nil;

Since GetParentForm returns already the form we do not need to iterate all
controls manually.
Another point is that we should only reset the active control if another form
is activated, but not
when the focus only goes from one control to another on the same form.

Ciao, Mike

 | Replies | Author | Date
3881 | Re: Cant Focus/Edit Node bug (Possible fix) | Simon Moscrop | Sat 9/29/2001
3897 | Re: Cant Focus/Edit Node bug (Possible fix) | Mike Lischke | Tue 10/2/2001


re: Cant Focus/Edit Node bug (Possible fix)

From: "Simon Moscrop" [SimonMoscrop@H...]
Date: Sat Sep 29, 2001 3:52 pm
Subject: Re: Cant Focus/Edit Node bug (Possible fix)

Mike,

Cheers for that.. please forgive my inept hacking as a remedy to the
solution ( I completely forgot, ow simply didn't know, abouth the
getparentform function). your solution is much more elegant and
robust.. I'll incoroprate the changes into my version of the source
for now.

Do you have another release planned for the near future?

Thanks v much

Si

 | Replies | Author | Date
3897 | Re: Cant Focus/Edit Node bug (Possible fix) | Mike Lischke | Tue 10/2/2001


Select Node Based Upon Index?

From: "Tom Hahn" [thahn@h...]
Date: Sat Sep 29, 2001 9:57 pm
Subject: Select Node Based Upon Index?

Sorry for what is probably a very basic question! Unfortunately, I can't
seem to find the answer.

How do I select a node for which the AbsoluteIndex is available? In other
words, how do I go to a node based upon its index position in the tree?

Tom

 | Replies | Author | Date
3883 | Re: Select Node Based Upon Index? | Werner Lehmann | Sat 9/29/2001
3884 | Re: Select Node Based Upon Index? | Tom Hahn | Sun 9/30/2001


re: Select Node Based Upon Index?

From: Werner Lehmann [wl@b...]
Date: Sat Sep 29, 2001 10:43 pm
Subject: Re: [VirtualTreeview] Select Node Based Upon Index?

Hi Tom,

> How do I select a node for which the AbsoluteIndex is available? In other
> words, how do I go to a node based upon its index position in the tree?

Part of what the VT makes fast is its chained list structure. But chained
lists are not good at index based access. Either you iterate the nodes until
you find the one you are looking for - or - you store a reference to the
VirtualNode in your data, not (only) the absolute index (recommended).

Werner

 | Replies | Author | Date
3884 | Re: Select Node Based Upon Index? | Tom Hahn | Sun 9/30/2001


re: Select Node Based Upon Index?

From: "Tom Hahn" [thahn@h...]
Date: Sun Sep 30, 2001 3:19 am
Subject: RE: [VirtualTreeview] Select Node Based Upon Index?

Hi Werner.

Thank you for the suggestion. I will give that a try.

Tom

> > How do I select a node for which the AbsoluteIndex is
> available? In other
> > words, how do I go to a node based upon its index position in the tree?
>
> Part of what the VT makes fast is its chained list structure. But chained
> lists are not good at index based access. Either you iterate the
> nodes until
> you find the one you are looking for - or - you store a reference to the
> VirtualNode in your data, not (only) the absolute index (recommended).
>
> Werner
>


Todo / Feature Requests

From: "Wim van der Vegt" [wvd_vegt@k...]
Date: Sun Sep 30, 2001 11:07 am
Subject: Todo / Feature Requests

Hi Mike,

When the list of bugs gets shorter, will you have a look at (and comment on)
the todo/feature request database?

Wim van der Vegt

[Non-text portions of this message have been removed]

 | Replies | Author | Date
3887 | Re: Todo / Feature Requests | Mike Lischke | Mon 10/1/2001
3896 | Re: Todo / Feature Requests | Mike Lischke | Tue 10/2/2001


New file uploaded to VirtualTreeview

From: [VirtualTreeview@yahoogroups.com>
Date: Mon Oct 1, 2001 11:38 am
Subject: New file uploaded to VirtualTreeview

Hello,

This email message is a notification to let you know that
a file has been uploaded to the Files area of the VirtualTreeview
group.

File : /VirtualTree_2.5.40.zip
Uploaded by : [lists@l...]
Description : Release candidate 1

You can access this file at the URL

http://groups.yahoo.com/group/VirtualTreeview/files/VirtualTree_2.5.40.zip

To learn more about file sharing for your group, please visit

http://help.yahoo.com/help/us/groups/files

Regards,

[lists@l...]

Replies | Author | Date
3888 | Re: New file uploaded to VirtualTreeview | Mike Lischke | Mon 10/1/2001
3889 | Re: New file uploaded to VirtualTreeview | Mike Lischke | Mon 10/1/2001
3890 | Re: New file uploaded to VirtualTreeview | Michael Beck | Mon 10/1/2001
3892 | Re: New file uploaded to VirtualTreeview | Mike Lischke | Mon 10/1/2001


re: Todo / Feature Requests

From: "Mike Lischke" [lists@l...]
Date: Mon Oct 1, 2001 11:40 am
Subject: RE: [VirtualTreeview] Todo / Feature Requests

Hi Wim,

> When the list of bugs gets shorter, will you have a look at (and comment on)
the
> todo/feature request database?

I cannot promise anything. I'm fully loaded with the documentation, which is
both horribly boring
and extremly time consuming.

Ciao, Mike


re: New file uploaded to VirtualTreeview

From: "Mike Lischke" [lists@l...]
Date: Mon Oct 1, 2001 12:10 pm
Subject: RE: [VirtualTreeview] New file uploaded to VirtualTreeview

Hi all,

> This email message is a notification to let you know that
> a file has been uploaded to the Files area of the VirtualTreeview
> group.

Although I did not want to add more functionality I have been convinced to do
some final
improvements :o] Here is what is new in build 40:

- Windows XP style check images
- more available check images
- MDI child parent form problem work around in TBaseVirtualTree.WMKillFocus
- check for destruction of the header popup
- published OnContextPopup
- stop draw selection mode before inherited mouse button up handler opens a
popup menu
- corrected some spelling errors
- SetVisible improvements
- FullCollapse changed again, it does not initialize nodes anymore
- synchronous update mode (BeginSynch, EndSynch, tsSynch, usBeginSynch,
usSynch, usEndSynch)
- toReportMode in TreeOptions.MiscOptions
- TVTDropMarkMode for header custom draw

Just a few words to the new synch mode:

This mode has been introduced to allow a tree to be synchronized with itself or
other controls e.g.
when the user navigates the tree. Often you have to set and reset or enable
states, open new windows
or do other things which could create a race condition when something in the
chain (usually the
delayed change events) are not in synch with the rest of the application. You
can even get such
strange situations that an open dialog (although modally shown) is behind all
other windows of the
application because another (stay-on-top) form has been created in a change
handler.

To improve such situations in the future simply call BeginSynch when you start
activating states
(end EndSynch to stop the mode), open forms, navigate forms etc. (which perhaps
in turn modify
something in the tree) and reject any further modification as long as the
tsSynchMode flag is set in
the tree states. Regardless of the settings for ChangeDelay all change events
will triggered
immediately instead using a timer, as long as the tree is in synch mode. The
synch mode can be used
in parallel to the normal update mode (BeginUpdate/EndUpdate), but BeginSynch
will stop all timers
and handle possibly pending change events before returning and no change events
will be called at
all when the normal update mode is active. The synch update mode does not lock
painting.

Finally a note not related to the update: From tomorrow on I will be on
vacation for the next two
weeks (visiting Antalya in south Turkey) and likely not be able to read any
eMails nor to help in
the mailing list. I'm sure you will make do without me :-) In case there is
trouble with YG please
ask Werner or Jim, both have moderator access to the mailing list.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net

 | Replies | Author | Date
3889 | Re: New file uploaded to VirtualTreeview | Mike Lischke | Mon 10/1/2001
3890 | Re: New file uploaded to VirtualTreeview | Michael Beck | Mon 10/1/2001
3892 | Re: New file uploaded to VirtualTreeview | Mike Lischke | Mon 10/1/2001
3894 | Rant [was Re: New file uploaded to VirtualTreevie | [adembaba@e...] | Mon 10/1/2001


re: New file uploaded to VirtualTreeview

From: "Mike Lischke" [lists@l...]
Date: Mon Oct 1, 2001 12:24 pm
Subject: RE: [VirtualTreeview] New file uploaded to VirtualTreeview

> To improve such situations in the future simply call BeginSynch when you
start activating states
> (end EndSynch to stop the mode), open forms, navigate forms etc. (which
perhaps in turn modify
> something in the tree) and reject any further modification as long as the
tsSynchMode
> flag is set in the tree states.

A long sentence, no wonder that there are errors :-)

To improve such situations in the future simply call BeginSynch (and EndSynch
to stop the mode)
before you start activating states, open forms, navigate forms etc. (which
perhaps in turn modify
something in the tree) and reject any further modification as long as the
tsSynchMode flag is set in
the tree states.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: New file uploaded to VirtualTreeview

From: "Michael Beck" [mbeck1@c...]
Date: Mon Oct 1, 2001 12:57 pm
Subject: RE: [VirtualTreeview] New file uploaded to VirtualTreeview

> -----Original Message-----
> From: Mike Lischke
> Sent: Monday, October 01, 2001 08:10

> Finally a note not related to the update: From tomorrow on I
> will be on vacation for the next two
> weeks (visiting Antalya in south Turkey)

You forgot to say "well deserved" vacation!
Enjoy Antalya - it's nice over there, and as I said, you absolutely deserve it.

Michael

 | Replies | Author | Date
3892 | Re: New file uploaded to VirtualTreeview | Mike Lischke | Mon 10/1/2001


re: New file uploaded to VirtualTreeview

From: "Richard Scholz" [richard.scholz@b...]
Date: Mon Oct 1, 2001 1:36 pm
Subject: Re: [VirtualTreeview] New file uploaded to VirtualTreeview

>
> Finally a note not related to the update: From tomorrow on I will be on
vacation for the next two
> weeks (visiting Antalya in south Turkey) and likely not be able to read
any eMails nor to help in
> the mailing list.

Mike,
have a nice vacation!
greetings
Richard


re: New file uploaded to VirtualTreeview

From: "Mike Lischke" [lists@l...]
Date: Mon Oct 1, 2001 3:31 pm
Subject: RE: [VirtualTreeview] New file uploaded to VirtualTreeview

Michael, Richard,

> You forgot to say "well deserved" vacation!
> Enjoy Antalya - it's nice over there, and as I said, you absolutely deserve
it.

Thanks for your wishes. I still do not understand how one can recover on
vacation without computer.
I fear serious syndroms of abstinence, but I'll still try :o]

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


By design or display bug?

From: [pdagosta@c...]
Date: Mon Oct 1, 2001 5:48 pm
Subject: By design or display bug?

Before posting this as a display issue, I would like to get other
opinions.

When a *centered* header column is set as the sort column and the
showsortglyphs is enabled, the ellipses (...) are sometimes displayed
IMO unnecessarily.

Should the header use the extra space opposite of the sort glyph
before resorting to ellipses?

 | Replies | Author | Date
4122 | Re: By design or display bug? | Mike Lischke | Sat 10/20/2001


Rant [was Re: New file uploaded to VirtualTreeview]

From: [adembaba@e...]
Date: Mon Oct 1, 2001 9:40 pm
Subject: Rant [was Re: New file uploaded to VirtualTreeview]

Hi all,

Could we be a little more imaginative than
to use 'New file uploaded to VirtualTreeview'
as subject..

I mean, we have just about ended one thread
with that subject line that seemed to go on
nearly forever, only to be followed by another.

</rant.

I feel calm now... ;-)

Cheers,
Adem


Hiding form (2.5.34)

From: [NRYJGUSFSVEY@s...]
Date: Tue Oct 2, 2001 6:11 am
Subject: Hiding form (2.5.34)

Hi,

there is an error when I'm hiding a form while I'm editing a node
text of a VTV on this form. This happens because I minimize my
application to the system tray, so the form is hidden, and if I am
currently editing a node, I get the message "a deactivate or
insivible form cannot get the focus".

You can reproduce this by creating an application, placing a
VirtualStringTree on it, setting RootNodeCount to 1, making
TreeOptions.MiscOptions.toEditable true and creating an event for
OnNewText:

void __fastcall TForm1::VirtualStringTree1NewText(TBaseVirtualTree
*Sender,
PVirtualNode Node, int Column, WideString Text)
{
Hide();
}

Now run the application and edit the node text (enter one letter) and
press enter. You will get the message.

Bye

Marco

 | Replies | Author | Date
3904 | Re: Hiding form (2.5.34) | Werner Lehmann | Wed 10/3/2001
3905 | Re: Hiding form (2.5.34) | [NRYJGUSFSVEY@s...] | Wed 10/3/2001
3907 | Re: Hiding form (2.5.34) | Jim Kueneman | Wed 10/3/2001
3913 | Re: Hiding form (2.5.34) | Werner Lehmann | Wed 10/3/2001
3914 | Re: Hiding form (2.5.34) | Werner Lehmann | Wed 10/3/2001
3915 | Re: Hiding form (2.5.34) | Jim Kueneman | Thu 10/4/2001
3917 | Re: Hiding form (2.5.34) | [NRYJGUSFSVEY@s...] | Thu 10/4/2001
3929 | Re: Hiding form (2.5.34) | Jim Kueneman | Thu 10/4/2001
3918 | Re: Hiding form (2.5.34) | Werner Lehmann | Thu 10/4/2001


re: Todo / Feature Requests

From: "Mike Lischke" [lists@l...]
Date: Mon Oct 1, 2001 9:00 am
Subject: RE: [VirtualTreeview] Todo / Feature Requests

Hi Wim,

> When the list of bugs gets shorter, will you have a look at (and comment on)
the
> todo/feature request database?

I cannot promise anything. I'm fully loaded with the documentation, which is
both horrible boring
and at the same time extremly time consuming.

Ciao, Mike


re: Re: Cant Focus/Edit Node bug (Possible fix)

From: "Mike Lischke" [lists@l...]
Date: Mon Oct 1, 2001 9:00 am
Subject: RE: [VirtualTreeview] Re: Cant Focus/Edit Node bug (Possible fix)

> Do you have another release planned for the near future?

Yes, today I'll upload a new build.

Ciao, Mike


re: Ownerdraw Dropmak on HeaderDragging

From: "Mike Lischke" [lists@l...]
Date: Mon Oct 1, 2001 9:00 am
Subject: RE: [VirtualTreeview] Ownerdraw Dropmak on HeaderDragging

Hi Anders,

> I'm using ownerdraw to draw the header columns in a tree.
> I would also like to draw the dropmarks when a header is dragged, how can I
do this?
> Could OnHeaderDraw maybe be changed to something like:
> HeaderDraw(Sender: TVTHeader; Canvas: TCanvas;
> Column: TVirtualTreeColumn; R: TRect; Hover, Pressed, DropMarkLeft,
DropMarkRight: Boolean);

This is an interesting suggestion. Although it will change again an event
signature I have it
implemented since it was so easy and is indeed important. I used a slightly
different approach,
though, by introducing TVTDropMarkMode (which is either dmmNone, dmmLeft or
dmmRight).

Ciao, Mike


Fatal Error When Compiling VirtualTreesD5

From: [istais2001@y...]
Date: Tue Oct 2, 2001 10:52 am
Subject: Fatal Error When Compiling VirtualTreesD5

Hi Group!

I'm trying to install the latest version of VirtualTrees for D5.
When I open the package and compile it I get following error from
compiler:
[Fatal Error] Internal error: L1496

Do you know what's the problem?
Have anybody allready installed it?

Tnx, Aljosa

 | Replies | Author | Date
3900 | Re: Fatal Error When Compiling VirtualTreesD5 | [NRYJGUSFSVEY@s...] | Tue 10/2/2001
3901 | Re: Fatal Error When Compiling VirtualTreesD5 | Jim Kueneman | Tue 10/2/2001


re: Fatal Error When Compiling VirtualTreesD5

From: [NRYJGUSFSVEY@s...]
Date: Tue Oct 2, 2001 12:24 pm
Subject: Re: Fatal Error When Compiling VirtualTreesD5

--- In [VirtualTreeview@y...], [istais2001@y...] wrote:
> Hi Group!
>
> I'm trying to install the latest version of VirtualTrees for D5.
> When I open the package and compile it I get following error from
> compiler:
> [Fatal Error] Internal error: L1496
>
> Do you know what's the problem?
> Have anybody allready installed it?
>
> Tnx, Aljosa

Hi,

this problem has already been posted here. Just compile it again, it
should work then.

Bye

 | Replies | Author | Date
3901 | Re: Fatal Error When Compiling VirtualTreesD5 | Jim Kueneman | Tue 10/2/2001


re: Fatal Error When Compiling VirtualTreesD5

From: "Jim Kueneman" [jimdk@m...]
Date: Tue Oct 2, 2001 2:06 pm
Subject: Re: Fatal Error When Compiling VirtualTreesD5

> Hi,
>
> this problem has already been posted here. Just compile it again,
it
> should work then.

You may have to uninstall your VT packages (and VET if you are using
it) and delete the *.bpl and *.dcp files that have to do with VT or
VET in the Delphi\Projects\Bpl folder, plus any *.dcu's in the VT
and/or VET folders. In extreme cases delete all the files and only
use what comes in the downloaded ZIP. Close Delphi and reopen then
try recomiling and reinstalling the package

Jim


Confirmation

From: "Illya Kysil" [ikysil@m...]
Date: Tue Oct 2, 2001 6:56 pm
Subject: Confirmation

Just to confirm a subscription

Regards
Illya Kysil, software developer
"If it is not SOURCE - it is not a SOFTWARE" (C) NASA

 | Replies | Author | Date
3903 | Re: Confirmation | Andres Ledesma | Wed 10/3/2001


re: Confirmation

From: Andres Ledesma [alchir@y...]
Date: Wed Oct 3, 2001 6:24 am
Subject: Re: [VirtualTreeview] Confirmation

Thank you Illya !

Andres.

__________________________________________________
Do You Yahoo!?
Listen to your Yahoo! Mail messages from any phone.
http://phone.yahoo.com


re: Hiding form (2.5.34)

From: Werner Lehmann [wl@b...]
Date: Wed Oct 3, 2001 9:19 am
Subject: Re: [VirtualTreeview] Hiding form (2.5.34)

Hi,

> void __fastcall TForm1::VirtualStringTree1NewText(TBaseVirtualTree
> *Sender,
> PVirtualNode Node, int Column, WideString Text)
> {
> Hide();
> }

If this is really the place where you hide your form (and not just an example)
I would not say that this is a bug. At least the explanation is as if I would
say 'if I kill my app in the taskman the app window is suddenly gone'. Asking
for trouble means getting it.

The usual workaround for these problems is to post (not send) a message to your
own form and only in the handler of that message do the stuff asynchronously.

Werner

 | Replies | Author | Date
3905 | Re: Hiding form (2.5.34) | [NRYJGUSFSVEY@s...] | Wed 10/3/2001


re: Hiding form (2.5.34)

From: [NRYJGUSFSVEY@s...]
Date: Wed Oct 3, 2001 9:25 am
Subject: Re: Hiding form (2.5.34)

Hi Werner,

> > void __fastcall TForm1::VirtualStringTree1NewText
(TBaseVirtualTree
> > *Sender,
> > PVirtualNode Node, int Column, WideString Text)
> > {
> > Hide();
> > }
>
> If this is really the place where you hide your form (and not just
an example)

This is of course not my real code :).

In my application, when I click on the minimize icon (the one left
of the maximize icon and the close icon in the title bar), it gets
hidden and a system tray icon appears. I do that with TCoolTrayIcon
(you will find it on the usual Delphi pages).

When I'm currently editing a node and clicking on the minimize icon,
the error message appears and the VirtualTreeview component is
damaged until I restart the program.

Bye

Marco


How to simply add to a VT

From: [skip.bremer@t...]
Date: Wed Oct 3, 2001 1:28 pm
Subject: How to simply add to a VT

I have been programming for a long time and just don't seem to "get
it" as far as building a tree with this component. I use the old
TreeNT for many things and would like to start using VT. I don't do
databases. What I do do is to build trees programmatically. Normally
I read a text file and then parse the individual lines in code and
then add them to the tree based on certain criteria. Sometimes I have
data hardcoded and use that to build the tree. My trees are always
readonly for my users (no changes after they are built).

But I can't seem to figure out how to simply add data to a VT, and I
have been looking for examples with no success. Mike's examples are
all based on known data sets. In my case, each node will be
different. I hope I am making some sense here.

Anyway, does anyone out there have a simple example of how to build a
tree in VT with varying data? I really need this I guess to get
myself jumpstarted on this. Thanks.

 | Replies | Author | Date
3912 | Re: How to simply add to a VT | [pdagosta@c...] | Wed 10/3/2001


re: Hiding form (2.5.34)

From: Jim Kueneman [jimdk@m...]
Date: Wed Oct 3, 2001 2:56 pm
Subject: Re: [VirtualTreeview] Hiding form (2.5.34)

>You can reproduce this by creating an application, placing a
>VirtualStringTree on it, setting RootNodeCount to 1, making
>TreeOptions.MiscOptions.toEditable true and creating an event for
>OnNewText:
>
>void __fastcall TForm1::VirtualStringTree1NewText(TBaseVirtualTree
>*Sender,
> PVirtualNode Node, int Column, WideString Text)
>{
> Hide();
>}
>
>Now run the application and edit the node text (enter one letter) and
>press enter. You will get the message.

Hi,

Ok here is the problem;

- You hit the Enter key in the edit box
- TVTEdit.WMKeyDown is called with VK_RETURN that calls FLink.FTree.DoEndEdit
- DoEndEdit calls the DoNewText handler wher you Hide the Form
- Now inTBaseVirtualTree.DoEndEdit the following is called
if CanFocus then
SetFocus;
- CanFocus it a TWinControl method
- Look at this method
Apparently it gets the Form then starts with the instance of the
TWinControl and starts walking up the parent chain looking for any parent
that is hidden or disabled. The problem is it does *NOT* check if the FORM
is enabled. Is this a Bug??? I would tend to think so. The Form.Visible
is False at this point so it should return false. I think it should be a
REPEAT UNTIL call looking for the Form.

function TWinControl.CanFocus: Boolean;
var
Control: TWinControl;
Form: TCustomForm;
begin
Result := False;
Form := GetParentForm(Self);
if Form <> nil then
begin
Control := Self;
while Control <> Form do
begin
if not (Control.FVisible and Control.Enabled) then Exit;
Control := Control.Parent;
end;
Result := True;
end;
end;

What is interesting if you break on the Hide call then let it run through
the error is not there! Must be because of the interaction of the IDE
hiding the Form for debugging?

All I can see to do easily and not change the VT source is to Hide the VT
control at the same time as hiding the Form and doing the reverse when showing.

Later,
Jim


OnColumnResize Event

From: "Tom Hahn" [thahn@h...]
Date: Wed Oct 3, 2001 4:58 pm
Subject: OnColumnResize Event

I am trying to capture column widths (in VirtualStringTree) during an
OnColumnResize event with code such as

ColOne := Headers.Columns[0].Width;
ColTwo := Headers.Columns[1].Width;
etc.

but I am ending up with 0 values for width. What am I doing wrong?

Tom

 | Replies | Author | Date
3910 | Re: OnColumnResize Event | Brett Fleming | Wed 10/3/2001
3911 | Re: OnColumnResize Event | Tom Hahn | Wed 10/3/2001


Bug!

From: Kirill Zinov [kirill@a...]
Date: Wed Oct 3, 2001 6:02 pm
Subject: Bug!

Hello All,

When DragType := dtVCL,
OnEndDrag event does not raises.

--
Best regards,
Kirill mailto:[kirill@a...]

 | Replies | Author | Date
3930 | Re: Bug! | Jim Kueneman | Thu 10/4/2001


re: OnColumnResize Event

From: Brett Fleming [bfleming@r...]
Date: Wed Oct 3, 2001 6:45 pm
Subject: RE: [VirtualTreeview] OnColumnResize Event

I can't duplicate the problem here. The following code works correctly. Do
you have hoVisible included in options? If not, then the Rect for the header
is assumed to be 0.

procedure TMainForm.MainGridColumnResize(Sender: TBaseVirtualTree;
Column: Integer);
var
x: integer;
begin
x := MainGrid.Header.Columns[Column].Width;
end;

> -----Original Message-----
> From: Tom Hahn [mailto:[thahn@h...]]
> Sent: Wednesday, October 03, 2001 12:58 PM
> To: VirtualTreeview
> Subject: [VirtualTreeview] OnColumnResize Event
>
>
> I am trying to capture column widths (in VirtualStringTree) during an
> OnColumnResize event with code such as
>
> ColOne := Headers.Columns[0].Width;
> ColTwo := Headers.Columns[1].Width;
> etc.
>
> but I am ending up with 0 values for width. What am I doing wrong?
>
> Tom
>
>
> To unsubscribe from this group, send an email to:
> VirtualTreeview-unsubscribe@egroups.com
>
>
>
> Your use of Yahoo! Groups is subject to
> http://docs.yahoo.com/info/terms/
>
>

 | Replies | Author | Date
3911 | Re: OnColumnResize Event | Tom Hahn | Wed 10/3/2001


re: OnColumnResize Event

From: "Tom Hahn" [thahn@h...]
Date: Wed Oct 3, 2001 7:19 pm
Subject: RE: [VirtualTreeview] OnColumnResize Event

Brett,

Thanks for responding. It turned out to be an idiot mistake unrelated to
what I thought was causing the problem.

Tom

> I can't duplicate the problem here. The following code works correctly. Do
> you have hoVisible included in options? If not, then the Rect for
> the header
> is assumed to be 0.
>
> procedure TMainForm.MainGridColumnResize(Sender: TBaseVirtualTree;
> Column: Integer);
> var
> x: integer;
> begin
> x := MainGrid.Header.Columns[Column].Width;
> end;

> >
> > I am trying to capture column widths (in VirtualStringTree) during an
> > OnColumnResize event with code such as
> >
> > ColOne := Headers.Columns[0].Width;
> > ColTwo := Headers.Columns[1].Width;
> > etc.
> >
> > but I am ending up with 0 values for width. What am I doing wrong?
> >


re: How to simply add to a VT

From: [pdagosta@c...]
Date: Wed Oct 3, 2001 8:20 pm
Subject: Re: How to simply add to a VT

> What I do do is to build trees programmatically. Normally
> I read a text file and then parse the individual lines in code and
> then add them to the tree based on certain criteria. Sometimes I
have
> data hardcoded and use that to build the tree. My trees are always
> readonly for my users (no changes after they are built).

I am using VT in a similar (read-only) way. My data comes from a
tcp/ip socket instead of a file, though.

>
> But I can't seem to figure out how to simply add data to a VT, and I
> have been looking for examples with no success. Mike's examples are
> all based on known data sets. In my case, each node will be
> different. I hope I am making some sense here.

What do you mean by each node is different? If you are using columns,
each node must have data (possibly '') for each column. If you are
not using columns, then you build a free formatted string depending on
each node.

The mechanics of adding a node are simple.

1) Find parent node. (GetFirst*, GetNext*)
2) Add node. (AddChild)
3) Initialize node data. (GetNodeData)

The only thing left is writing a OnGetText event to display the data.

If you want to delay the full parsing of the file until the node is
actually used (displayed/sorted), then store the raw text somewhere
(possibily in the node data area), store a way to access it in the
node data area, and write an OnInitNode event to handle the
full parsing.

Hope this helps,
Paul


re: Re: Hiding form (2.5.34)

From: Werner Lehmann [wl@b...]
Date: Wed Oct 3, 2001 10:34 pm
Subject: Re: [VirtualTreeview] Re: Hiding form (2.5.34)

Hi Marco,

> This is of course not my real code :).

Ok ;)

> When I'm currently editing a node and clicking on the minimize icon,
> the error message appears and the VirtualTreeview component is
> damaged until I restart the program.

Hm, I am not able to reproduce this with the advanced demo. Maybe you can put
together a very simple example which shows the problem?

Werner


re: Hiding form (2.5.34)

From: Werner Lehmann [wl@b...]
Date: Wed Oct 3, 2001 10:35 pm
Subject: Re: [VirtualTreeview] Hiding form (2.5.34)

Hi Jim,

> Ok here is the problem;
>
> - You hit the Enter key in the edit box

If I understand the last mail from Marco correctly he does NOT call Hide; from
within the NewText handler but simply clicks on the minimize icon in the
caption.

Werner

 | Replies | Author | Date
3915 | Re: Hiding form (2.5.34) | Jim Kueneman | Thu 10/4/2001
3917 | Re: Hiding form (2.5.34) | [NRYJGUSFSVEY@s...] | Thu 10/4/2001
3929 | Re: Hiding form (2.5.34) | Jim Kueneman | Thu 10/4/2001


re: Hiding form (2.5.34)

From: Jim Kueneman [jimdk@m...]
Date: Thu Oct 4, 2001 2:14 am
Subject: Re: [VirtualTreeview] Hiding form (2.5.34)

At 12:35 AM 10/4/2001 +0200, you wrote:
>Hi Jim,
>
> > Ok here is the problem;
> >
> > - You hit the Enter key in the edit box
>
>If I understand the last mail from Marco correctly he does NOT call Hide; from
>within the NewText handler but simply clicks on the minimize icon in the
>caption.

Hi Werner,

I followed his example (calling Hide in the handler) unless I am not
interperting C correctly (a possibility <g>) and I am reproducing the error.

Jim

 | Replies | Author | Date
3917 | Re: Hiding form (2.5.34) | [NRYJGUSFSVEY@s...] | Thu 10/4/2001
3929 | Re: Hiding form (2.5.34) | Jim Kueneman | Thu 10/4/2001


Possible bug in TVTHeader.Invalidate

From: "Ralf Melles" [rmelles@g...]
Date: Thu Oct 4, 2001 7:19 am
Subject: Possible bug in TVTHeader.Invalidate

check line 8885:

procedure TVTHeader.Invalidate(Column: TVirtualTreeColumn);

// Because the header is in the non-client area of the tree it needs
some special handling in order to initiate its
// repainting.

var
R, RW: TRect;

begin
if (hoVisible in FOptions) and Treeview.HandleAllocated then
begin

-->> next line sets Column to NIL, so parameter isn´t used!!!

Column := nil;
if Column = nil then
R := Treeview.GetHeaderRect
else
R := Column.GetRect;
...

 | Replies | Author | Date
3926 | Re: Possible bug in TVTHeader.Invalidate | Brett Fleming | Thu 10/4/2001
4124 | Re: Possible bug in TVTHeader.Invalidate | Mike Lischke | Sat 10/20/2001


re: Hiding form (2.5.34)

From: [NRYJGUSFSVEY@s...]
Date: Thu Oct 4, 2001 9:33 am
Subject: Re: Hiding form (2.5.34)

Hi!

@ Jim

> I followed his example (calling Hide in the handler) unless I am
not
> interperting C correctly (a possibility <g>) and I am reproducing
the error.

Yes, I tried to simplify my problem as much as possible, so I tried
this. I do not actually call Hide in OnNewText, but Hide is called
while editing a text.

@ Werner

> Hm, I am not able to reproduce this with the advanced demo. Maybe
you can put
> together a very simple example which shows the problem?

It would result in either a C source that needs TCoolTrayIcon to
reproduce the _EXACT_ problem or a C source that I already wrote to
reproduce a _NEAR_ problem. Or it would result in a EXE file. But I
don't know what you want to see there... you can download PWGen from
http://www.pwgen.com to see the problem in action (1.7 MB).

This is the code that TCoolTrayIcon uses to hide the main form:

// Hide the form itself (and thus any child windows)
Application.MainForm.Visible := False;
{ Hide application's TASKBAR icon (not the traybar icon).
Do this AFTER the mainform is hidden, or any child windows
will redisplay the taskbar icon if they are visible. }
ShowWindow(Application.Handle, SW_HIDE);

Bye

Marco

 | Replies | Author | Date
3929 | Re: Hiding form (2.5.34) | Jim Kueneman | Thu 10/4/2001


re: Re: Hiding form (2.5.34)

From: Werner Lehmann [wl@b...]
Date: Thu Oct 4, 2001 10:32 am
Subject: Re: [VirtualTreeview] Re: Hiding form (2.5.34)

HI Marco,

> Yes, I tried to simplify my problem as much as possible, so I tried
> this. I do not actually call Hide in OnNewText, but Hide is called
> while editing a text.

Hm, why are you doing this? Sounds strange. User is editing the node text,
suddenly
the form vanishes...

> > Hm, I am not able to reproduce this with the advanced demo. Maybe
> you can put
> > together a very simple example which shows the problem?
>
> It would result in either a C source that needs TCoolTrayIcon to
> reproduce the _EXACT_ problem or a C source that I already wrote to
> reproduce a _NEAR_ problem. Or it would result in a EXE file. But I
> don't know what you want to see there... you can download PWGen from
> http://www.pwgen.com to see the problem in action (1.7 MB).
>
> This is the code that TCoolTrayIcon uses to hide the main form:
>
> // Hide the form itself (and thus any child windows)
> Application.MainForm.Visible := False;
> { Hide application's TASKBAR icon (not the traybar icon).
> Do this AFTER the mainform is hidden, or any child windows
> will redisplay the taskbar icon if they are visible. }
> ShowWindow(Application.Handle, SW_HIDE);

An exe would not help much to debug the problem. I would opt for the near
problem
C source. But only if it's short (I have to translate it to OPAL) and is 3rd
party
component free. Upload to the appropriate folder in the files area on YG. Of
course
I cannot promise anything, it may well be that there are times when you don't
want
to hide the form. The VTree could subclass the form it sits on and detect when
the
form is being hidden (to take the necessary measures) but I would rather not do
that.

I am still not sure where you call Hide. It's not in OnNewText. If you have a
button
somewhere which initiates the hide the VT would loose focus and the edit should
be
cancelled before. Only if it is a speedbutton which cannot take focus we may
have a
problem. Anyway, your demo will show that.

Werner

 | Replies | Author | Date
3920 | Re: Hiding form (2.5.34) | [NRYJGUSFSVEY@s...] | Thu 10/4/2001
3924 | Re: Hiding form (2.5.34) | [NRYJGUSFSVEY@s...] | Thu 10/4/2001


Division by zero when installing VT 2.5.40 to BCB

From: Vandrovec Milan [milan_va@s...]
Date: Thu Oct 4, 2001 10:50 am
Subject: Division by zero when installing VT 2.5.40 to BCB

Hello.

I have tried to update my VTxx_for_CPPB, but when intalling VirtualTrees
2.5.40 (runtime), I got Division by zero. After some interval-halving, I
found it is caused in
1. initialization
2. InitializeGlobalStructures
3. ConvertImageList(LightCheckImages, 'VT_CHECK_LIGHT');
4. for I := 0 to (Images.Width div Images.Height) - 1 do
where Images.Width and Images.Height are both 0. This is right, because
VT_CHECK_LIGHT are searched for in BCB.exe (HInstance), and they aren't
there. Adding a check like

if (Images.Width<>0) and (Images.Height<>0) then //line 4139

around the loop fixes it.

Milan Vandrovec

 | Replies | Author | Date
3921 | Re: Division by zero when installing VT 2.5.40 to | Ralf Melles | Thu 10/4/2001
3922 | Re: Division by zero when installing VT 2.5.40 to | Ralf Melles | Thu 10/4/2001
3965 | Re: Division by zero when installing VT 2.5.40 to | Roland | Wed 10/10/2001
3966 | Re: Division by zero when installing VT 2.5.40 to | Ralf Melles | Wed 10/10/2001
3969 | Re: Division by zero when installing VT 2.5.40 to | Roland | Wed 10/10/2001
3974 | Re: Division by zero when installing VT 2.5.40 to | [adembaba@e...] | Wed 10/10/2001
3975 | Re: Division by zero when installing VT 2.5.40 to | Ariel | Thu 10/11/2001
3976 | Re: Division by zero when installing VT 2.5.40 to | Roland | Thu 10/11/2001
4131 | Re: Division by zero when installing VT 2.5.40 to | Mike Lischke | Sat 10/20/2001


re: Hiding form (2.5.34)

From: [NRYJGUSFSVEY@s...]
Date: Thu Oct 4, 2001 11:10 am
Subject: Re: Hiding form (2.5.34)

Hi Werner,

I guess you did not yet understand what I wanted to explain... my
English is not the best. Curious, that I speak to another German in
English :)

> I am still not sure where you call Hide. It's not in OnNewText. If
you have a button
> somewhere which initiates the hide the VT would loose focus and the
edit should be
> cancelled before. Only if it is a speedbutton which cannot take
focus we may have a
> problem.

That's the problem. When I press the minimize button (that is present
in every standard Windows form), the form gets hidden (by the third-
party component TCoolTrayIcon).

Something in VT's editor seems failure on this. When the focus is not
on a VT's node in edit mode, but on another standard edit field,
nothing wrong happens.

I hope I talked clearly now :) ... if not, I will send you a German
private mail.

Bye

Marco

 | Replies | Author | Date
3924 | Re: Hiding form (2.5.34) | [NRYJGUSFSVEY@s...] | Thu 10/4/2001


re: Division by zero when installing VT 2.5.40 to BCB

From: "Ralf Melles" [rmelles@g...]
Date: Thu Oct 4, 2001 11:13 am
Subject: Re: Division by zero when installing VT 2.5.40 to BCB

--- In [VirtualTreeview@y...], Vandrovec Milan [milan_va@s...] wrote:
>
> Hello.
>
> I have tried to update my VTxx_for_CPPB, but when intalling
VirtualTrees
> 2.5.40 (runtime), I got Division by zero. After some interval-
halving, I
> found it is caused in
> 1. initialization
> 2. InitializeGlobalStructures
> 3. ConvertImageList(LightCheckImages, 'VT_CHECK_LIGHT');
> 4. for I := 0 to (Images.Width div Images.Height) - 1 do
> where Images.Width and Images.Height are both 0. This is right,
because
> VT_CHECK_LIGHT are searched for in BCB.exe (HInstance), and they
aren't
> there. Adding a check like
>
> if (Images.Width<>0) and (Images.Height<>0) then //line 4139
>
> around the loop fixes it.
>

I´ve got the same problem in Delphi 5 because i forgot to remove the
old package. Try removing the old VT-package and reinstalling the new
one -> this might work :-)

Ralf

 | Replies | Author | Date
3922 | Re: Division by zero when installing VT 2.5.40 to | Ralf Melles | Thu 10/4/2001


re: Division by zero when installing VT 2.5.40 to BCB

From: "Ralf Melles" [rmelles@g...]
Date: Thu Oct 4, 2001 11:16 am
Subject: Re: Division by zero when installing VT 2.5.40 to BCB

... and don´t forget to overwrite the old VirtualTrees.res file in
your library path!!!


Font problem

From: [jogador3@y...]
Date: Thu Oct 4, 2001 12:19 pm
Subject: Font problem

Hi!

I already searched in archive but I dind't find.
I know that must be somthing simple, but I can't make it work.
I just want to change the font size of all tree! I used VST.Font.Size
but nothing happens! I tried to invalidate, repaint, refresh... Maybe
I forgot some option.

Thank you!

Trevis

 | Replies | Author | Date
3925 | Re: Font problem | Ralf Melles | Thu 10/4/2001
3928 | Re: Font problem | [jogador3@y...] | Thu 10/4/2001
3931 | Re: Font problem | Jim Kueneman | Thu 10/4/2001


re: Hiding form (2.5.34)

From: [NRYJGUSFSVEY@s...]
Date: Thu Oct 4, 2001 12:21 pm
Subject: Re: Hiding form (2.5.34)

Hi,

I tried to reproduce a simple application that copies the exact
behaviour of TCoolTrayIcon... but it did not work. I will try again
later at home.

Bye

Marco


re: Font problem

From: "Ralf Melles" [rmelles@g...]
Date: Thu Oct 4, 2001 12:30 pm
Subject: Re: Font problem

--- In [VirtualTreeview@y...], [jogador3@y...] wrote:
> Hi!
>
> I already searched in archive but I dind't find.
> I know that must be somthing simple, but I can't make it work.
> I just want to change the font size of all tree! I used
VST.Font.Size
> but nothing happens! I tried to invalidate, repaint, refresh...
Maybe
> I forgot some option.
>
> Thank you!
>
> Trevis

Hi Trevis,

which version of VT do you use? Which font is selected? I tried to
change the font in one of my applications at runtime and it worked!
Can you upload a small example?

Ralf

 | Replies | Author | Date
3928 | Re: Font problem | [jogador3@y...] | Thu 10/4/2001
3931 | Re: Font problem | Jim Kueneman | Thu 10/4/2001


re: Possible bug in TVTHeader.Invalidate

From: Brett Fleming [bfleming@r...]
Date: Thu Oct 4, 2001 12:43 pm
Subject: RE: [VirtualTreeview] Possible bug in TVTHeader.Invalidate

That's funny! I noticed the same thing yesterday while tracking doen the 0
column width propblem someone was having. I doesn't affect anything
thankfully, since the incomoing column isn't a var parameter. I though it
was ammusing, but my compiler didn't optimize the following statement out
either. I would guess it got tossed in there while debuggin at some point.

> -----Original Message-----
> From: Ralf Melles [mailto:[rmelles@g...]]
> Sent: Thursday, October 04, 2001 3:19 AM
> To: VirtualTreeview@yahoogroups.com
> Subject: [VirtualTreeview] Possible bug in TVTHeader.Invalidate
>
>
> check line 8885:
>
> procedure TVTHeader.Invalidate(Column: TVirtualTreeColumn);
>
> // Because the header is in the non-client area of the tree it needs
> some special handling in order to initiate its
> // repainting.
>
> var
> R, RW: TRect;
>
> begin
> if (hoVisible in FOptions) and Treeview.HandleAllocated then
> begin
>
> -->> next line sets Column to NIL, so parameter isn´t used!!!
>
> Column := nil;
> if Column = nil then
> R := Treeview.GetHeaderRect
> else
> R := Column.GetRect;
> ...
>
>
> ------------------------ Yahoo! Groups Sponsor
> ---------------------~-->
> Get your FREE VeriSign guide to security solutions for your
> web site: encrypting transactions, securing intranets, and more!
> http://us.click.yahoo.com/UnN2wB/m5_CAA/yigFAA/i7folB/TM
> --------------------------------------------------------------
> -------~->
>
> To unsubscribe from this group, send an email to:
> VirtualTreeview-unsubscribe@egroups.com
>
>
>
> Your use of Yahoo! Groups is subject to
http://docs.yahoo.com/info/terms/


re: Re: Hiding form (2.5.34)

From: GIANNAKOPOULOS KOSTAS [kyan@s...]
Date: Thu Oct 4, 2001 12:27 pm
Subject: RE: [VirtualTreeview] Re: Hiding form (2.5.34)

OK, here's a suggestion:

Place a TApplicationEvents in your main form and in its OnMinimize event
handler do this:

Screen.ActiveControl.Perform(CM_EXIT, 0, 0);

The idea is to make the tree think that it is losing focus, so it will close
the inplace editor.

If Screen.ActiveControl is not enough you can try looping through
Screen.Forms and use Form.ActiveControl to do this trick on every open form.

Hope this works for you.

<KY>

> That's the problem. When I press the minimize button (that is present
> in every standard Windows form), the form gets hidden (by the third-
> party component TCoolTrayIcon).
>
> Something in VT's editor seems failure on this. When the focus is not
> on a VT's node in edit mode, but on another standard edit field,
> nothing wrong happens.

 | Replies | Author | Date
3950 | Re: Hiding form (2.5.34) | [NRYJGUSFSVEY@s...] | Sat 10/6/2001


re: Font problem

From: [jogador3@y...]
Date: Thu Oct 4, 2001 1:13 pm
Subject: Re: Font problem

Hi!

Thanks, Ralf!
The version I use is 2.5.34 and below is one simplified version of my
problem. When I click in btnSetFontSize4 nothing happens!

Thanks again,

Trevis

//---------------------------------------------------------------
unit Unit1;

interface

uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms,
Dialogs,
StdCtrls, VirtualTrees;

type
TForm1 = class(TForm)
vst: TVirtualStringTree;
btnAdd5Nodes: TButton;
btnSetFontSize4: TButton;
procedure btnAdd5NodesClick(Sender: TObject);
procedure btnSetFontSize4Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;

var
Form1: TForm1;

implementation

{$R *.DFM}

procedure TForm1.btnAdd5NodesClick(Sender: TObject);
begin
vst.RootNodeCount := 5;
end;

procedure TForm1.btnSetFontSize4Click(Sender: TObject);
begin
vst.Font.Size := 4;
end;

end.
//---------------------------------------------------------------

--- In [VirtualTreeview@y...], "Ralf Melles" [rmelles@g...] wrote:
> --- In [VirtualTreeview@y...], [jogador3@y...] wrote:
> > Hi!
> >
> > I already searched in archive but I dind't find.
> > I know that must be somthing simple, but I can't make it work.
> > I just want to change the font size of all tree! I used
> VST.Font.Size
> > but nothing happens! I tried to invalidate, repaint, refresh...
> Maybe
> > I forgot some option.
> >
> > Thank you!
> >
> > Trevis
>
> Hi Trevis,
>
> which version of VT do you use? Which font is selected? I tried to
> change the font in one of my applications at runtime and it worked!
> Can you upload a small example?
>
> Ralf

 | Replies | Author | Date
3931 | Re: Font problem | Jim Kueneman | Thu 10/4/2001


re: Re: Hiding form (2.5.34)

From: Jim Kueneman [jimdk@m...]
Date: Thu Oct 4, 2001 1:28 pm
Subject: Re: [VirtualTreeview] Re: Hiding form (2.5.34)

At 09:33 AM 10/4/2001 +0000, you wrote:
>Hi!
>
>@ Jim
>
> > I followed his example (calling Hide in the handler) unless I am
>not
> > interperting C correctly (a possibility <g>) and I am reproducing
>the error.
>
>Yes, I tried to simplify my problem as much as possible, so I tried
>this. I do not actually call Hide in OnNewText, but Hide is called

Hi Marco,

I still think what I said is the problem, the CanFocus call is not
enough of a check because the Form is not tested for being not
visible. Just for a test

- InTBaseVirtualTree.DoEndEdit change this:

if CanFocus then
SetFocus;

to

if CanFocus and (GetParentForm(Self).Visible) then
SetFocus

and see what happens.

Jim


re: Bug!

From: Jim Kueneman [jimdk@m...]
Date: Thu Oct 4, 2001 1:34 pm
Subject: Re: [VirtualTreeview] Bug!

Hi Kirill,

>When DragType := dtVCL,
>OnEndDrag event does not raises.

What version are you using? 2.5.40 seems to fire this event.

http://groups.yahoo.com/group/VirtualTreeview/files/

Jim


re: Re: Font problem

From: Jim Kueneman [jimdk@m...]
Date: Thu Oct 4, 2001 2:02 pm
Subject: Re: [VirtualTreeview] Re: Font problem

At 01:13 PM 10/4/2001 +0000, you wrote:
>Hi!
>
>Thanks, Ralf!
>The version I use is 2.5.34 and below is one simplified version of my
>problem. When I click in btnSetFontSize4 nothing happens!
>
>Thanks again,
>
>Trevis
>
>//---------------------------------------------------------------
>unit Unit1;
>
>interface
>
>uses
> Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms,
>Dialogs,
> StdCtrls, VirtualTrees;
>
>type
> TForm1 = class(TForm)
> vst: TVirtualStringTree;
> btnAdd5Nodes: TButton;
> btnSetFontSize4: TButton;
> procedure btnAdd5NodesClick(Sender: TObject);
> procedure btnSetFontSize4Click(Sender: TObject);
> private
> { Private declarations }
> public
> { Public declarations }
> end;
>
>var
> Form1: TForm1;
>
>implementation
>
>{$R *.DFM}
>
>procedure TForm1.btnAdd5NodesClick(Sender: TObject);
>begin
>vst.RootNodeCount := 5;
>end;
>
>procedure TForm1.btnSetFontSize4Click(Sender: TObject);
>begin
>vst.Font.Size := 4;
>end;

The font does not support the size.

begin
vst.Font.Name := 'Small Font';
vst.Font.Size := 4
end;

works.

Jim


Font in VirtualTree

From: [jogador3@y...]
Date: Thu Oct 4, 2001 2:50 pm
Subject: Font in VirtualTree

Thanks for the help!

My problem was that I was setting a size that doesn't exist fot the
font. Now, any of you know how to get the available sizes for a font
or test if a size exist in a font?

Thanks

Trevor

 | Replies | Author | Date
3939 | Re: Font in VirtualTree | Ralf Melles | Fri 10/5/2001


Hide Levels

From: [d.faessler@p...]
Date: Thu Oct 4, 2001 3:09 pm
Subject: Hide Levels

Hi

Is it possible to hide a level?

I have a TreeView with 3 levels and the user should have the option
to show only one or two levels. So there can be (Level 1 - 3; Level
1; Level 2; Level 3; Level 1 + 2; Level 1 + 3; Level 2 + 3)

Thanks for your help.

Dominik Fässler

 | Replies | Author | Date
3934 | Re: Hide Levels | Werner Lehmann | Thu 10/4/2001
3948 | Re: Hide Levels | [d.faessler@p...] | Fri 10/5/2001
3949 | Re: Hide Levels | Michael Valentiner=Branth | Sat 10/6/2001
3951 | Re: Hide Levels | Werner Lehmann | Sat 10/6/2001
3952 | Re: Hide Levels | [d.faessler@p...] | Sat 10/6/2001


re: Hide Levels

From: Werner Lehmann [wl@b...]
Date: Thu Oct 4, 2001 4:58 pm
Subject: Re: [VirtualTreeview] Hide Levels

Hi,

> Is it possible to hide a level?

Only if there are no levels below it - or if you want to hide these too.

> I have a TreeView with 3 levels and the user should have the option
> to show only one or two levels. So there can be (Level 1 - 3; Level
> 1; Level 2; Level 3; Level 1 + 2; Level 1 + 3; Level 2 + 3)

You can offer 1-3, 1-2, 1. The others require you to actually restructure
the tree (not your data!). You may get it for cheap if you delete all
levels under the last visible level (DeleteChildren) and then use
OnInitChildren and OnInitNode to add stuff below as you want and is needed.

Precondition: the index based access to such a virtual-virtual node is easy
and reliable (non volatile data, reproducible enumeration of child nodes
across combined levels). If the tree data changes you might be better off with
ignoring the init events and simply built the changed tree parts all at once.

Werner

 | Replies | Author | Date
3948 | Re: Hide Levels | [d.faessler@p...] | Fri 10/5/2001


Mulit Select Event

From: "Jim Kueneman" [jimdk@m...]
Date: Thu Oct 4, 2001 9:50 pm
Subject: Mulit Select Event

Does anyone have any idea how to get notificiations during
multiselect? I want to update the selection count but OnMouseMove
does not get fired during the selection (because the inhertied
MouseMove is not called during a selection). I stepped through the
code and nothing is obvious. Before spending a lot of time stepping
through the code I thought it is something someone would have done
already.

Jim

 | Replies | Author | Date
3937 | Re: Mulit Select Event | Werner Lehmann | Fri 10/5/2001
3938 | Re: Mulit Select Event | Jim Kueneman | Fri 10/5/2001


Header class descendant...

From: Werner Lehmann [wl@b...]
Date: Fri Oct 5, 2001 12:24 am
Subject: Header class descendant...

Hi Mike,

I'd like to use my own TVTHeader descendant. Could you add / change these
please:

function TBaseVirtualTree.GetHeaderClass: TVTHeaderClass;
begin
Result := TVTHeader;
end;

constructor TBaseVirtualTree.Create(AOwner: TComponent);
...
FHeader := GetHeaderClass.Create(Self);
...

Regards,
Werner

 | Replies | Author | Date
4125 | Re: Header class descendant... | Mike Lischke | Sat 10/20/2001


re: Mulit Select Event

From: Werner Lehmann [wl@b...]
Date: Fri Oct 5, 2001 12:27 am
Subject: Re: [VirtualTreeview] Mulit Select Event

Hi Jim,

> Does anyone have any idea how to get notificiations during
> multiselect? I want to update the selection count but OnMouseMove
> does not get fired during the selection (because the inhertied
> MouseMove is not called during a selection). I stepped through the
> code and nothing is obvious. Before spending a lot of time stepping
> through the code I thought it is something someone would have done
> already.

I am not sure if I understand you right. But it sounds as if you simply could
use
OnChange and SelectedCount. The former fires during (draw) selection and the
latter
is then updated.

Regards,
Werner

 | Replies | Author | Date
3938 | Re: Mulit Select Event | Jim Kueneman | Fri 10/5/2001


re: Mulit Select Event

From: Jim Kueneman [jimdk@m...]
Date: Fri Oct 5, 2001 12:35 am
Subject: Re: [VirtualTreeview] Mulit Select Event

At 02:27 AM 10/5/2001 +0200, you wrote:
>Hi Jim,
>
>I am not sure if I understand you right. But it sounds as if you simply
>could use
>OnChange and SelectedCount. The former fires during (draw) selection and
>the latter
>is then updated.

Duh, thanks Werner.

Jim


re: Font in VirtualTree

From: "Ralf Melles" [rmelles@g...]
Date: Fri Oct 5, 2001 9:43 am
Subject: Re: Font in VirtualTree

--- In [VirtualTreeview@y...], [jogador3@y...] wrote:
> Thanks for the help!
>
> My problem was that I was setting a size that doesn't exist fot the
> font. Now, any of you know how to get the available sizes for a
font
> or test if a size exist in a font?
>
> Thanks
>
> Trevor

Hi Trevor,

if your are using TrueType Fonts, you don´t have a problem with
invalid sizes. The system can rescale these fonts! So make shure that
the user only selects TT-Fonts.

Regards
Ralf


Advanced Demo source code

From: [subscribedlists@b...]
Date: Fri Oct 5, 2001 10:32 am
Subject: Advanced Demo source code

How about sharing the source code for the advanced demo? Are there
plans to do this in the future?

Thanks,

Doug

 | Replies | Author | Date
3941 | Re: Advanced Demo source code | [helge@e...] | Fri 10/5/2001


re: Advanced Demo source code

From: [helge@e...]
Date: Fri Oct 5, 2001 10:38 am
Subject: Re: Advanced Demo source code

> How about sharing the source code for the advanced demo? Are there
> plans to do this in the future?
>

IIRC Mike said as he published the demo that he'll publish the source
of the demo, too, as soon he has tidied it up.

Helge.


Sorting VirtualStringTree

From: "Helge Jung \(ECO-Logic\)" [helge@e...]
Date: Fri Oct 5, 2001 10:49 am
Subject: Sorting VirtualStringTree

I've a VirtualStringTree (the latest version - 2.5.40). I've filled it up
with data from a file - no problems. Now I want to sort it. This is the data
structure (for the VST and the file):

type
TETBItemType = (itFeature, itBug, itRequest, itHint, itOther);
TETBItemStatus = (isWorkInProgress, isPlanning, isQueued, isDone,
isRejected);

PETBItem = ^TETBItem;
TETBItem = packed record // für VST und die Datei
Module, Funktion : string[30];
ItemType : TETBItemType;
Description : shortstring;
Status : TETBItemStatus;
end;

Could somebody tell me how to implement the sorting? I assume I've to use
OnCompareNodes - I've tried that already and I got an other tree (with only
2 text columns for testing) ordered but I don't know how that worked (just
experimented and one time it worked half way) ;-))

First of all, I want to sort by the Status field: isWorkInProgress,
isQueued, isPlanning, isDone, is Rejected (isWorkingInProgress should be at
the top). Second, it should be sorted by the Module (MAIN,SERVER,...) and
then after the Funktion (there are many strings possible). If there are
still equal nodes (all are at level 0 - no children) I want to sort by the
ItemType (Feature, Bug, Request, Hint) and then after the Description.

I searched the help available in the Files section but I could find an
example for OnCompareNodes (maybe I didn't search deep enough).

I know what I want is possible but I don't know how. Maybe someone can point
me in the right direction...

TIA,
Helge.

 | Replies | Author | Date
3943 | Re: Sorting VirtualStringTree | Ralf Melles | Fri 10/5/2001
3946 | Re: Sorting VirtualStringTree | [helge@e...] | Fri 10/5/2001
3944 | Re: Sorting VirtualStringTree | Werner Lehmann | Fri 10/5/2001
3945 | Re: Sorting VirtualStringTree | [helge@e...] | Fri 10/5/2001
4126 | Re: Sorting VirtualStringTree | Mike Lischke | Sat 10/20/2001


re: Sorting VirtualStringTree

From: "Ralf Melles" [rmelles@g...]
Date: Fri Oct 5, 2001 11:27 am
Subject: Re: Sorting VirtualStringTree

--- In [VirtualTreeview@y...], "Helge Jung \(ECO-Logic\)" [helge@e...]
wrote:
> I've a VirtualStringTree (the latest version - 2.5.40). I've filled
it up
> with data from a file - no problems. Now I want to sort it. This is
the data
> structure (for the VST and the file):
>
> type
> TETBItemType = (itFeature, itBug, itRequest, itHint, itOther);
> TETBItemStatus = (isWorkInProgress, isPlanning, isQueued, isDone,
> isRejected);
>
> PETBItem = ^TETBItem;
> TETBItem = packed record // für VST und die Datei
> Module, Funktion : string[30];
> ItemType : TETBItemType;
> Description : shortstring;
> Status : TETBItemStatus;
> end;
>
> Could somebody tell me how to implement the sorting? I assume I've
to use
> OnCompareNodes - I've tried that already and I got an other tree
(with only
> 2 text columns for testing) ordered but I don't know how that
worked (just
> experimented and one time it worked half way) ;-))
>
> First of all, I want to sort by the Status field: isWorkInProgress,
> isQueued, isPlanning, isDone, is Rejected (isWorkingInProgress
should be at
> the top). Second, it should be sorted by the Module
(MAIN,SERVER,...) and
> then after the Funktion (there are many strings possible). If there
are
> still equal nodes (all are at level 0 - no children) I want to sort
by the
> ItemType (Feature, Bug, Request, Hint) and then after the
Description.
>
> I searched the help available in the Files section but I could find
an
> example for OnCompareNodes (maybe I didn't search deep enough).
>
> I know what I want is possible but I don't know how. Maybe someone
can point
> me in the right direction...
>
> TIA,
> Helge.

Hi Helge,

this is only a fast "maybe" solution! I didn´t got the time to check
this code in an example application.

begin
Data1:=Sender.GetNodeData(Node1);
Data2:=Sender.GetNodeData(Node2);

// Sort by Status
Result:=PETBItem(Data1)^.Status-PETBItem(Data2)^.Status;
if Result<>0 then Exit;

// Sort by Module
Result:=CompareText(PETBItem(Data1)^.Module, PETBItem(Data2)
^.Module);
if Result<>0 then Exit;

// Sort by Funktion
Result:=CompareText(PETBItem(Data1)^.Funktion, PETBItem(Data2)
^.Funktion);
if Result<>0 then Exit;

// Sort by ItemType
Result:=PETBItem(Data1)^.ItemType-PETBItem(Data2)^.ItemType;
if Result<>0 then Exit;

// Sort by Description
Result:=CompareText(PETBItem(Data1)^.Description, PETBItem(Data2)
^.Description);
end;

Hope this one solves your problem!!!

Bye
Ralf

 | Replies | Author | Date
3946 | Re: Sorting VirtualStringTree | [helge@e...] | Fri 10/5/2001


re: Sorting VirtualStringTree

From: Werner Lehmann [wl@b...]
Date: Fri Oct 5, 2001 11:31 am
Subject: Re: [VirtualTreeview] Sorting VirtualStringTree

Hi Helge,

> I know what I want is possible but I don't know how. Maybe someone can point
> me in the right direction...

OnCompareNodes is correct. In the event handler just get the data for both
nodes,
and compare with respect to your sort criteria. To compare strings, use
AnsiCompareText, to compare ints just return the difference of them, same with
floats (of course truncated, but be sure to preserve the sign of the result).

In short, if the result is < 0, Node1 will be 'smaller' than Node2, > 0 vice
versa,
= 0 no change / don't care. To implement secondary sort criteria simply check if
the primary comparison results in 0 and then compare again using other values.

Is this what you wanted to know? (it's pretty straightforward as with every
compare
function)

Werner

 | Replies | Author | Date
3945 | Re: Sorting VirtualStringTree | [helge@e...] | Fri 10/5/2001
4126 | Re: Sorting VirtualStringTree | Mike Lischke | Sat 10/20/2001


re: Sorting VirtualStringTree

From: [helge@e...]
Date: Fri Oct 5, 2001 1:28 pm
Subject: Re: Sorting VirtualStringTree

> In short, if the result is < 0, Node1 will be 'smaller' than Node2,
> 0 vice versa, = 0 no change / don't care. To implement secondary
> sort criteria simply check if the primary comparison results in 0
> and then compare again using other values.
>
> Is this what you wanted to know? (it's pretty straightforward as
> with every compare function)
>

Thanks, that is was. I didn't know how to set the Result ... thanks
again!

Helge.

P.S. A question regarding YahooGroups: If I answer to a message from
this YG with Outlook, is it appended as a answer to the message or is
it taken as a new post? My problem is that when I post or reply from
the web, my e-mail address is taken as Sender adress - I want to see
my name there.

 | Replies | Author | Date
4126 | Re: Sorting VirtualStringTree | Mike Lischke | Sat 10/20/2001


re: Sorting VirtualStringTree

From: [helge@e...]
Date: Fri Oct 5, 2001 1:31 pm
Subject: Re: Sorting VirtualStringTree

> Hope this one solves your problem!!!
>

Yes. Thanks! Now I understood the system...

Here's my (now working) code:

type
TETBItemType = (itFeature, itBug, itDatabase, itRequest, itHint,
itOther);
TETBItemStatus = (isWorkInProgress, isQueued, isPlanning, isDone,
isRejected);
[...]

procedure TfrmMain.VSTCompareNodes(Sender: TBaseVirtualTree; Node1,
Node2: PVirtualNode; Column: Integer; var Result: Integer);
var
Data1, Data2: TETBItem;

function CheckStatus : integer;
begin
CheckStatus := Integer(Data2.Status) - Integer(Data1.Status);
end;

function CheckModule : integer;
begin
CheckModule := AnsiCompareText (Data2.Module, Data1.Module);
end;

function CheckFunktion : integer;
begin
CheckFunktion := AnsiCompareText (Data2.Funktion, Data1.Funktion);
end;

function CheckItemType : integer;
begin
CheckItemType := Integer(Data2.ItemType) - Integer(Data1.ItemType);
end;

function CheckDescription : integer;
begin
CheckDescription := AnsiCompareText (Data2.Description,
Data1.Description);
end;

begin
Data1 := PETBItem (Sender.GetNodeData(Node1))^;
Data2 := PETBItem (Sender.GetNodeData(Node2))^;

case Column of
1 : Result := CheckModule;
2 : Result := CheckFunktion;
3 : Result := CheckItemType;
4 : Result := CheckDescription;
5 : Result := CheckStatus;
end;
if Result <> 0 then Exit;

Result := CheckStatus;
if Result <> 0 then Exit;

Result := CheckModule;
if Result <> 0 then Exit;

Result := CheckFunktion;
if Result <> 0 then Exit;

Result := CheckItemType;
if Result <> 0 then Exit;

Result := CheckDescription;
end;


CustomDraw Headers

From: "Wim van der Vegt" [wvd_vegt@k...]
Date: Fri Oct 5, 2001 4:12 pm
Subject: CustomDraw Headers

Hi,

Is it possible to add a method to TVirtualStringTree that performs the default
painting of a header panel, i mean the splitter, sortmarker & background &
images but not the text. Personally I'm only interested in painting the text of
the head as i need multiline ones for my applications.

I read earlier comments that painting the splitter is simple, it indeed is but
not if you have to take into account all types of header panels/buttons, images
and sortmarkers. Painting a complete header background is a lot of work and
consists of copying almost the whole header drawing procedure from VT every
after update you download.

--------
Wim van der Vegt

[Non-text portions of this message have been removed]


re: Hide Levels

From: [d.faessler@p...]
Date: Fri Oct 5, 2001 5:16 pm
Subject: Re: Hide Levels

Hi

Thank you for your answer. I'm not really good in handling pointers
and so on. Can you show me an example for OnInitNode and
OnInitChildren?

Thanks.

Dominik Fässler

--- In [VirtualTreeview@y...], Werner Lehmann [wl@b...] wrote:
> Hi,
>
> > Is it possible to hide a level?
>
> Only if there are no levels below it - or if you want to hide these
too.
>
> > I have a TreeView with 3 levels and the user should have the
option
> > to show only one or two levels. So there can be (Level 1 - 3;
Level
> > 1; Level 2; Level 3; Level 1 + 2; Level 1 + 3; Level 2 + 3)
>
> You can offer 1-3, 1-2, 1. The others require you to actually
restructure
> the tree (not your data!). You may get it for cheap if you delete
all
> levels under the last visible level (DeleteChildren) and then use
> OnInitChildren and OnInitNode to add stuff below as you want and is
needed.
>
> Precondition: the index based access to such a virtual-virtual node
is easy
> and reliable (non volatile data, reproducible enumeration of child
nodes
> across combined levels). If the tree data changes you might be
better off with
> ignoring the init events and simply built the changed tree parts
all at once.
>
> Werner


re: Hide Levels

From: Michael Valentiner=Branth [MichaelVB@g...]
Date: Sat Oct 6, 2001 7:44 am
Subject: Re: [VirtualTreeview] Hide Levels

Hello Dominik,

> Is it possible to hide a level?
>
> I have a TreeView with 3 levels and the user should have the option
> to show only one or two levels. So there can be (Level 1 - 3; Level
> 1; Level 2; Level 3; Level 1 + 2; Level 1 + 3; Level 2 + 3)
>
It is possible (I tried it once) to individually set the NodeHeight of a parent
node to zero, so that only it's children are visible.

But, these children are still seperated by their parents, not in one whole list
that could for example be sorted in whole.

Michael


re: Hiding form (2.5.34)

From: [NRYJGUSFSVEY@s...]
Date: Sat Oct 6, 2001 10:28 am
Subject: Re: Hiding form (2.5.34)

Hi,

I suddenly tried this:

--- In [VirtualTreeview@y...], GIANNAKOPOULOS KOSTAS [kyan@s...] wrote:
> Place a TApplicationEvents in your main form and in its OnMinimize
event
> handler do this:
>
> Screen.ActiveControl.Perform(CM_EXIT, 0, 0);

And this:

--- In [VirtualTreeview@y...], Jim Kueneman [jimdk@m...] wrote:
> Just for a test
>
> - InTBaseVirtualTree.DoEndEdit change this:
>
> if CanFocus then
> SetFocus;
>
> to
>
> if CanFocus and (GetParentForm(Self).Visible) then
> SetFocus
>
> and see what happens.

Sorry, neither work.

Perhaps I should try to get a position in my source BEFORE the form
is hidden and exit the node editor, perhaps that is already done
when Application.OnMinimize is called. I will try later today or
tomorrow.

Thanks anyway!

Bye

Marco


re: Re: Hide Levels

From: Werner Lehmann [wl@b...]
Date: Sat Oct 6, 2001 11:47 am
Subject: Re: [VirtualTreeview] Re: Hide Levels

Hi,

> Thank you for your answer. I'm not really good in handling pointers
> and so on. Can you show me an example for OnInitNode and
> OnInitChildren?

A simple OnInitNode / Children example won't help you much (explanation
can be found in the help file, sample code in the demos section of YG (but
might not be 100% compilable with current VT beta version)).

Basically with OnInitChildren and RootNodeCount you say how many nodes are
there and where they are (the 'structure' of the tree). You don't say (at
least you don't have to) what the content of these nodes is. This is where
OnInitNode comes into the game: as soon as a node must be displayed the tree
initializes it (once!): OnInitNode is fired and you have to fill in the
record data for that node. This is not always possible or efficient enough
because the connection of your data with this node (TVirtualNode) can only be
based on the Node.Index among its siblings, the data of its parent(s) and the
surrounding tree structure. This is for example a good approach if you have
already all data in your own data structures and can access it via indices.

For your problem I would hold an internal tree, with all levels and all data.
A bunch of objects with Parent and ChildCount and Children properties or records
or something like that, it does not really matter for the treeview. Then I
would build a second level on it (still talking about the data, only, not the
treeview) which allows me to hide levels. That is, if a node is part of a hidden
level, its children appear to be children of the parent of that node. It would
be advantageous if this abstraction layer would use the same interface (you can
actuall declare and implement an interface) as the underlying data structure.

It is also possible to add a 'Hidden' property to your treenode objects. If that
property is true the node is hidden and the ChildCount property would return the
total number of grandchildren, the Children property would return all these
grand-
children in a fixed order and so on.

If you have all this the rest is easy and you can fill your treeview.

This may be a little bit too tough (I don't know but your remark about the
pointers suggests this to me). Please understand that although it is perfectly
doable I cannot devote the necessary time to this problem and provide full
example code to you...

Werner

 | Replies | Author | Date
3952 | Re: Hide Levels | [d.faessler@p...] | Sat 10/6/2001


re: Hide Levels

From: [d.faessler@p...]
Date: Sat Oct 6, 2001 4:05 pm
Subject: Re: Hide Levels

Hi

Thank you Werner for your informations. I will post this example for
those who are interested. If you have any corrections, please mail me
([d.faessler@p...])

Create a new application with

2 Buttons
1 VirtualStringTree
3 Checkboxes

// ------------ Code

unit Unit1;

interface

uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms,
Dialogs,
VirtualTrees, StdCtrls;

type PTreeData = ^TTreeData;
TTreeData = record
Descript: String[50];
Parent: PTreeData;
ChildCount: Integer;
Level: Integer;
end;

type
TForm1 = class(TForm)
Button1: TButton;
MyTree: TVirtualStringTree;
Button2: TButton;
CheckBoxL1: TCheckBox;
CheckBoxL2: TCheckBox;
CheckBoxL3: TCheckBox;
procedure FormCreate(Sender: TObject);
procedure Button1Click(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure MyTreeGetText(Sender: TBaseVirtualTree; Node:
PVirtualNode;
Column: Integer; TextType: TVSTTextType; var Text: WideString);
procedure Button2Click(Sender: TObject);
private
{ Private-Deklarationen}
List: TList;
Index: Integer;
public
{ Public-Deklarationen }
procedure FillMyTree;
procedure AddNode(ParentNode: PVirtualNode);
end;

var
Form1: TForm1;

implementation

{$R *.DFM}

procedure TForm1.FillMyTree;
begin
MyTree.Clear;
Index := 0;
AddNode(nil);
end;

procedure TForm1.AddNode(ParentNode: PVirtualNode);
var node: PVirtualNode;
L: PTreeData;
count, i, Level: Integer;
b: Boolean;
begin
count := PTreeData(List.Items[Index])^.ChildCount;
for i := 0 to count - 1 do
begin
Inc(Index);
Level := PTreeData(List.Items[Index])^.Level;
case level of
1: b := CheckBoxL1.Checked;
2: b := CheckBoxL2.Checked;
3: b := CheckBoxL3.Checked;
end;
if b = true then
begin
node := MyTree.AddChild(ParentNode);
L := MyTree.GetNodeData(node);
L^ := PTreeData(List.Items[Index])^;
end
else
begin
node := ParentNode;
end;
if PTreeData(List.Items[Index])^.ChildCount > 0 then
AddNode(node);
end;
end;

procedure TForm1.FormCreate(Sender: TObject);
begin
MyTree.NodeDataSize := SizeOf(TTreeData);
List := TList.Create;
end;

procedure TForm1.Button1Click(Sender: TObject);
var i, j, k: Integer;
L0, L1, L2, L3: PTreeData;
begin
New(L0);
L0^.Parent := nil;
L0^.ChildCount := 20;
List.Add(L0);
for i := 1 to 20 do
begin
New(L1);
L1^.Descript := 'Example Level 1: ' + IntToStr(i);
L1^.Parent := L0;
L1^.ChildCount := 10;
L1^.Level := 1;
List.Add(L1);
for j := 1 to 10 do
begin
New(L2);
L2^.Descript := 'Example Level 2: ' + IntToStr(j);
L2^.Parent := L1;
L2^.ChildCount := 5;
L2^.Level := 2;
List.Add(L2);
for k := 1 to 5 do
begin
New(L3);
L3^.Descript := 'Example Level 3: ' + IntToStr
(k);
L3^.Parent := L2;
L3^.ChildCount := 0;
L3^.Level := 3;
List.Add(L3);
end;
end;
end;
end;

procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);
begin
List.Free;
end;

procedure TForm1.MyTreeGetText(Sender: TBaseVirtualTree;
Node: PVirtualNode; Column: Integer; TextType: TVSTTextType;
var Text: WideString);
var dat: PTreeData;
begin
dat := Sender.GetNodeData(node);
Text := dat.Descript;
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
FillMyTree;
end;

end.

--- In [VirtualTreeview@y...], Werner Lehmann [wl@b...] wrote:
> Hi,
>
> > Thank you for your answer. I'm not really good in handling
pointers
> > and so on. Can you show me an example for OnInitNode and
> > OnInitChildren?
>
> A simple OnInitNode / Children example won't help you much
(explanation
> can be found in the help file, sample code in the demos section of
YG (but
> might not be 100% compilable with current VT beta version)).
>
> Basically with OnInitChildren and RootNodeCount you say how many
nodes are
> there and where they are (the 'structure' of the tree). You don't
say (at
> least you don't have to) what the content of these nodes is. This
is where
> OnInitNode comes into the game: as soon as a node must be displayed
the tree
> initializes it (once!): OnInitNode is fired and you have to fill in
the
> record data for that node. This is not always possible or efficient
enough
> because the connection of your data with this node (TVirtualNode)
can only be
> based on the Node.Index among its siblings, the data of its parent
(s) and the
> surrounding tree structure. This is for example a good approach if
you have
> already all data in your own data structures and can access it via
indices.
>
> For your problem I would hold an internal tree, with all levels and
all data.
> A bunch of objects with Parent and ChildCount and Children
properties or records
> or something like that, it does not really matter for the treeview.
Then I
> would build a second level on it (still talking about the data,
only, not the
> treeview) which allows me to hide levels. That is, if a node is
part of a hidden
> level, its children appear to be children of the parent of that
node. It would
> be advantageous if this abstraction layer would use the same
interface (you can
> actuall declare and implement an interface) as the underlying data
structure.
>
> It is also possible to add a 'Hidden' property to your treenode
objects. If that
> property is true the node is hidden and the ChildCount property
would return the
> total number of grandchildren, the Children property would return
all these grand-
> children in a fixed order and so on.
>
> If you have all this the rest is easy and you can fill your
treeview.
>
> This may be a little bit too tough (I don't know but your remark
about the
> pointers suggests this to me). Please understand that although it
is perfectly
> doable I cannot devote the necessary time to this problem and
provide full
> example code to you...
>
> Werner


re: Header draw problem

From: [wvd_vegt@k...]
Date: Sat Oct 6, 2001 4:40 pm
Subject: Re: Header draw problem

Hi Mike,

I found the change not so handy in my case,i 'only' need a double
textline in the header fields but want the other default as well.

So is it possible to turn the default dawing of a header into a
public function so it's easier to do only ownerdrawn text on them?
I've looked in the code and if i do it myself it involves copying a
fair number of lines to get it correct (i mean including sortglyphs
etc).

Perhaps a public function with a set as parameter would be nice so
you can choose what vt should drawn and what it shouldn't (i mean you
can tell it to draw the backgroud, edges, pressed state, sortglyphs
and or text). It would certainly make onwerdrawn stuff more easier to
use. If you tel it to paint all, it turns into non ownerdrawn again.
All you need is a pre and after this function event (as is already
the case in most ownerdraw parts).

> Do you use owner draw for the header? I have changed the code so
that the frame is no longer drawn
> if owner draw is active for a column. In this case you have to draw
the frame yourself.

Wim van der Vegt

 | Replies | Author | Date
4127 | Re: Header draw problem | Mike Lischke | Sat 10/20/2001


Coloring the header

From: "Helge Jung \(ECO-Logic\)" [helge@e...]
Date: Mon Oct 8, 2001 12:34 pm
Subject: Coloring the header

I'm using VT 2.5.40 and I want to color the header because hxXPStyle doesn't
seem to work properly on W2K any more (in run-time it exits with "unable to
read property" or so). Maybe I'm only missing something but where can I find
the property to set the color of the header??? Maybe a tiny code snippet?

Thanks in advance,
Helge.

P.S. Again my question regarding YahooGroups: If I answer to a message from
this YG with Outlook, is it appended as a answer to the message or is it
taken as a new post? My problem is that when I post or reply from the web,
my e-mail address is taken as Sender adress - I want to see my name instead.

 | Replies | Author | Date
3955 | Re: Coloring the header | [helge@e...] | Mon 10/8/2001
3961 | Re: Coloring the header | [pdagosta@c...] | Tue 10/9/2001
4128 | Re: Coloring the header | Mike Lischke | Sat 10/20/2001


re: Coloring the header

From: [helge@e...]
Date: Mon Oct 8, 2001 1:21 pm
Subject: Re: Coloring the header

Okay, I changed a few things in the source:

TVTColors = class(TPersistent)
private
[...]
FColors: array[0..14] of TColor;
[...]
public
[...]
published
[...]
property HeaderColor: TColor index 14 read GetColor write SetColor
default clBtnFace;
end;

[...]

procedure TVirtualTreeColumns.PaintHeader(DC: HDC; R: TRect; HOffset:
Integer);
[...]
begin
[...]
// at about line 7983 in VT2.5.40 (just before the comment about
creating clip region)

Brush.Color := Owner.Header.FOwner.Colors.HeaderColor;
Brush.Style := bsSolid;
FillRect (ButtonR);

[...]
end;

It works with a few exceptions:
- Default of HeaderColor is set to clBlack (why???)
- Changes on HeaderColor in Objectinspector aren't seen immediately
(move form out of the screen or move another form over it repaints
the header and shows the new color)

I'd suggest that you can set up the color for each column separately.
My solution works for me in the moment but I can think of a situation
where I could need different colors of the column headers...

Helge.

 | Replies | Author | Date
3961 | Re: Coloring the header | [pdagosta@c...] | Tue 10/9/2001


Autosizing columns without cutting off the header title.

From: [ilan@s...]
Date: Mon Oct 8, 2001 6:10 pm
Subject: Autosizing columns without cutting off the header title.

Is it possible to autosize the columns to their contents without
cutting off the header title? When I use AutoFitColumns() and a
column is empty, the title of the header disappears.

Ilan Shemes


Urgent: Displaying Chinese characters in VTree

From: [MJLeaver@n...]
Date: Tue Oct 9, 2001 4:32 am
Subject: Urgent: Displaying Chinese characters in VTree

I've got a demo to do in 24 hours and I want to be able to
show Chinese characters in our VTree component.

As you've guessed, I'm having a few problems. I can
enter Chinese characters, but they are not displayed in
Chinese. In the edit control (in the VTree) it shows in
Chinese, but as soon as the edit is over it displays in
corrupted English.

Changing the charset only affects the edit control, but
not the display. Do I need to do something special in
OnPaintText?

I'm using the English version of Windows 2000.

Pretty please help me, I'm desperate! :)

 | Replies | Author | Date
3958 | Re: Urgent: Displaying Chinese characters in VTre | Jim Kueneman | Tue 10/9/2001


re: Urgent: Displaying Chinese characters in VTree

From: Jim Kueneman [jimdk@m...]
Date: Tue Oct 9, 2001 5:45 am
Subject: Re: [VirtualTreeview] Urgent: Displaying Chinese characters in VTree

At 04:32 AM 10/9/2001 +0000, you wrote:
>I've got a demo to do in 24 hours and I want to be able to
>show Chinese characters in our VTree component.
>
>As you've guessed, I'm having a few problems. I can
>enter Chinese characters, but they are not displayed in
>Chinese. In the edit control (in the VTree) it shows in
>Chinese, but as soon as the edit is over it displays in
>corrupted English.
>
>Changing the charset only affects the edit control, but
>not the display. Do I need to do something special in
>OnPaintText?
>
>I'm using the English version of Windows 2000.
>
>Pretty please help me, I'm desperate! :)

Just a guess (though I don't understand why it displays it while typing) is
the VCL components ie. Edit, are all ANSI
version of the controls so they work on Win9x and can only display 255
characters.

Take a look at this and see if it helps

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platfor\
m/CommCtls/Common/messages/CCM_SETUNICODEFORMAT.asp

Jim


re: Urgent: Displaying Chinese characters in VTree

From: [MJLeaver@n...]
Date: Tue Oct 9, 2001 5:42 am
Subject: Re: [VirtualTreeview] Urgent: Displaying Chinese characters in VTree

I think I found the problem. The database (SQL Server) was not
set up to store unicode. Of course, I changed it to use
unicode (NVARCHAR) and found out BDE cannot handle unicode
with SQL Server.

> At 04:32 AM 10/9/2001 +0000, you wrote:
> >I've got a demo to do in 24 hours and I want to be able to
> >show Chinese characters in our VTree component.
> >
> >As you've guessed, I'm having a few problems. I can
> >enter Chinese characters, but they are not displayed in
> >Chinese. In the edit control (in the VTree) it shows in
> >Chinese, but as soon as the edit is over it displays in
> >corrupted English.
> >
> >Changing the charset only affects the edit control, but
> >not the display. Do I need to do something special in
> >OnPaintText?
> >
> >I'm using the English version of Windows 2000.
> >
> >Pretty please help me, I'm desperate! :)
>
> Just a guess (though I don't understand why it displays it while
> typing) is
> the VCL components ie. Edit, are all ANSI
> version of the controls so they work on Win9x and can only display 255
>
> characters.
>
> Take a look at this and see if it helps
>
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shell
> cc/platform/CommCtls/Common/messages/CCM_SETUNICODEFORMAT.asp
>
> Jim
>
>
>
> ------------------------ Yahoo! Groups Sponsor
> ---------------------~-->
> Get your FREE VeriSign guide to security solutions for your web site:
> encrypting transactions, securing intranets, and more!
> http://us.click.yahoo.com/UnN2wB/m5_CAA/yigFAA/i7folB/TM
> ---------------------------------------------------------------------~
> ->
>
> To unsubscribe from this group, send an email to:
> VirtualTreeview-unsubscribe@egroups.com
>
>
>
> Your use of Yahoo! Groups is subject to
> http://docs.yahoo.com/info/terms/
>
>


Combobox in VirtualTree

From: [jogador3@y...]
Date: Tue Oct 9, 2001 8:24 am
Subject: Combobox in VirtualTree

Hi!

I need do insert calendars, comboboxes, etc in the VirtualTree. I
know that I have to use a property editor or something like that.
Does anybody have a simple demo where I can find out how to do that?

Thanks a lot,
Trevis

 | Replies | Author | Date
3963 | Re: Combobox in VirtualTree | [d.faessler@p...] | Tue 10/9/2001
3964 | Re: Combobox in VirtualTree | Jim Kueneman | Tue 10/9/2001
4129 | Re: Combobox in VirtualTree | Mike Lischke | Sat 10/20/2001


re: Coloring the header

From: [pdagosta@c...]
Date: Tue Oct 9, 2001 12:28 pm
Subject: Re: Coloring the header

> TVTColors = class(TPersistent)
> private
> [...]
> FColors: array[0..14] of TColor;
> [...]
> public
> [...]
> published
> [...]
> property HeaderColor: TColor index 14 read GetColor write SetColor
> default clBtnFace;
> end;

> - Default of HeaderColor is set to clBlack (why???)

The default parameter of the property is only for the OI to know what
values to store in the .dfm file. If you change the color to anything
but clBtnFace then it will store it in the .dfm. If the color is
clBtnFace then it does not store the field in the .dfm.

To set the default value in the OI, you must add a line to the
constructor(s) setting the field.

Paul


Problem: show/hide columns

From: Oleg Kraynov [olegvkr@y...]
Date: Tue Oct 9, 2001 2:03 pm
Subject: Problem: show/hide columns

Example:
VirtualStringTree(2.5.40) columns:
| 1(visible) | 2(visible) | 3(NOT visible) | 4(visible) |

Switch the columns 2 and 3(2 - hide, 3 - show).

Result:
| column 1 | column 3 | column 4 |
| data of col1 | EMPTY! | data of col3 | data of col4 |

Refresh, Repaint, InvalidateColumn - no effect!

Help!

Thanks in advance,
Oleg

_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com

 | Replies | Author | Date
4130 | Re: Problem: show/hide columns | Mike Lischke | Sat 10/20/2001
4153 | Re[2]: [VirtualTreeview] Problem: show/hide colum | Oleg Kraynov | Sat 10/20/2001
4204 | Re: Re[2]: [VirtualTreeview] Problem: show/hide c | Mike Lischke | Mon 10/22/2001
4220 | Re[4]: [VirtualTreeview] Problem: show/hide colum | Oleg Kraynov | Tue 10/23/2001
4287 | Re: Re[4]: [VirtualTreeview] Problem: show/hide c | Mike Lischke | Sat 10/27/2001


re: Combobox in VirtualTree

From: [d.faessler@p...]
Date: Tue Oct 9, 2001 2:22 pm
Subject: Re: Combobox in VirtualTree

Hi

AFAIK there are any examples under Files/Examples in this group.

CU

Dominik Fässler

--- In [VirtualTreeview@y...], [jogador3@y...] wrote:
> Hi!
>
> I need do insert calendars, comboboxes, etc in the VirtualTree. I
> know that I have to use a property editor or something like that.
> Does anybody have a simple demo where I can find out how to do that?
>
> Thanks a lot,
> Trevis


re: Combobox in VirtualTree

From: "Jim Kueneman" [jimdk@m...]
Date: Tue Oct 9, 2001 3:00 pm
Subject: Re: Combobox in VirtualTree

--- In [VirtualTreeview@y...], [jogador3@y...] wrote:
> Hi!
>
> I need do insert calendars, comboboxes, etc in the VirtualTree. I
> know that I have to use a property editor or something like that.
> Does anybody have a simple demo where I can find out how to do that?

http://groups.yahoo.com/group/VirtualTreeview/files/Examples/Delphi_Ex
amples/IVTEditLink/

Jim


re: Division by zero when installing VT 2.5.40 to BCB

From: "Roland" [Beduerftig@S...]
Date: Wed Oct 10, 2001 2:43 pm
Subject: Re: Division by zero when installing VT 2.5.40 to BCB

Hello Milan,

> VT_CHECK_LIGHT are searched for in BCB.exe (HInstance), and they
aren't
> there. Adding a check like
>
> if (Images.Width<>0) and (Images.Height<>0) then //line 4139
>
> around the loop fixes it.

I had the same problem, and your tip to include the if in line 4139
will fix the problem.

Question to Mike:

Can you build in this if for example with
{$ifdef CPPB}
if (Images.Width<>0) and (Images.Height<>0) then
{$endif}
for I := 0 to (Images.Width div Images.H........
before line 4139 for the Cpp-User.

thanks for the tip
Roland

 | Replies | Author | Date
3966 | Re: Division by zero when installing VT 2.5.40 to | Ralf Melles | Wed 10/10/2001
3969 | Re: Division by zero when installing VT 2.5.40 to | Roland | Wed 10/10/2001
3974 | Re: Division by zero when installing VT 2.5.40 to | [adembaba@e...] | Wed 10/10/2001
3975 | Re: Division by zero when installing VT 2.5.40 to | Ariel | Thu 10/11/2001
3976 | Re: Division by zero when installing VT 2.5.40 to | Roland | Thu 10/11/2001
4131 | Re: Division by zero when installing VT 2.5.40 to | Mike Lischke | Sat 10/20/2001


re: Division by zero when installing VT 2.5.40 to BCB

From: "Ralf Melles" [rmelles@g...]
Date: Wed Oct 10, 2001 3:00 pm
Subject: Re: Division by zero when installing VT 2.5.40 to BCB

--- In [VirtualTreeview@y...], "Roland" [Beduerftig@S...] wrote:
> Hello Milan,
>
> > VT_CHECK_LIGHT are searched for in BCB.exe (HInstance), and they
> aren't
> > there. Adding a check like
> >
> > if (Images.Width<>0) and (Images.Height<>0) then //line 4139
> >
> > around the loop fixes it.
>
> I had the same problem, and your tip to include the if in line 4139
> will fix the problem.
>
> Question to Mike:
>
> Can you build in this if for example with
> {$ifdef CPPB}
> if (Images.Width<>0) and (Images.Height<>0) then
> {$endif}
> for I := 0 to (Images.Width div Images.H........
> before line 4139 for the Cpp-User.
>

Hi,

as I wrote in a message before, you do NOT need this line! Make sure,
that you replace ALL old files of virtualtreeview before updating.
It´s an old version of the .res-file that causes this error, because
the included bitmaps for the checkstates have changed.

Best regards,
Ralf

 | Replies | Author | Date
3969 | Re: Division by zero when installing VT 2.5.40 to | Roland | Wed 10/10/2001
3974 | Re: Division by zero when installing VT 2.5.40 to | [adembaba@e...] | Wed 10/10/2001
3975 | Re: Division by zero when installing VT 2.5.40 to | Ariel | Thu 10/11/2001
3976 | Re: Division by zero when installing VT 2.5.40 to | Roland | Thu 10/11/2001


re: Re: Division by zero when installing VT 2.5 .40 to BCB

From: Vandrovec Milan [milan_va@s...]
Date: Wed Oct 10, 2001 3:21 pm
Subject: RE: [VirtualTreeview] Re: Division by zero when installing VT 2.5 .40 to BCB

So, again from me.

> > > there. Adding a check like
> > > if (Images.Width<>0) and (Images.Height<>0) then //line 4139
> > > around the loop fixes it.
> >
> > Question to Mike:
> >
> > Can you build in this if for example with
> > {$ifdef CPPB}
> > if (Images.Width<>0) and (Images.Height<>0) then
> > {$endif}
> > for I := 0 to (Images.Width div Images.H........
> > before line 4139 for the Cpp-User.
> >
>
> as I wrote in a message before, you do NOT need this line! Make sure,
> that you replace ALL old files of virtualtreeview before updating.
> It´s an old version of the .res-file that causes this error, because
> the included bitmaps for the checkstates have changed.
>

I am pretty sure I did remove the old res-files before installing. But
anyway, I think that
a. Adding the check won't hurt, even without {$ifdef CPPB}
b. Adding the check will help (at least three people, I believe this is the
L1496 problem).


re: Re: Division by zero when installing VT 2.5.40 to BCB

From: Marco Klemm [DonLuigi@g...]
Date: Wed Oct 10, 2001 3:37 pm
Subject: Re: [VirtualTreeview] Re: Division by zero when installing VT 2.5.40 to BCB

Hi,

Ralf Melles wrote:
>
> > Can you build in this if for example with
> > {$ifdef CPPB}
> > if (Images.Width<>0) and (Images.Height<>0) then
> > {$endif}
> > for I := 0 to (Images.Width div Images.Height) - 1 do...
> > before line 4139 for the Cpp-User.
>
> as I wrote in a message before, you do NOT need this line! Make sure,
> that you replace ALL old files of virtualtreeview before updating.
> It´s an old version of the .res-file that causes this error, because
> the included bitmaps for the checkstates have changed.

I think, it is a good idea to check at least Images.Height - independent
on Delphi or CPPB or any Resource file.

if Images.Height <> 0 then
for I := 0 to (Images.Width div Images.Height) - 1 do...

Ciao, Marco

 | Replies | Author | Date
4132 | Re: Division by zero when installing VT 2.5.40 to | Mike Lischke | Sat 10/20/2001
4182 | Re: Division by zero when installing VT 2.5.40 to | Roland | Mon 10/22/2001


re: Division by zero when installing VT 2.5.40 to BCB

From: "Roland" [Beduerftig@S...]
Date: Wed Oct 10, 2001 4:02 pm
Subject: Re: Division by zero when installing VT 2.5.40 to BCB

Hi Ralf,

> Hi,
>
> as I wrote in a message before, you do NOT need this line! Make
sure,
> that you replace ALL old files of virtualtreeview before updating.
> It´s an old version of the .res-file that causes this error,
because
> the included bitmaps for the checkstates have changed.

of course I read your message before I build the changes, I uninstall
the old packages, then I delete all temp files also the resfile, then
I copy the new files from the zip in the source directory, compile
without any error or warnings and now I install the new library

but

the divide by zero error will schown when I compile and run and older
project, which used the VT.

best regards
Roland

 | Replies | Author | Date
3974 | Re: Division by zero when installing VT 2.5.40 to | [adembaba@e...] | Wed 10/10/2001
3975 | Re: Division by zero when installing VT 2.5.40 to | Ariel | Thu 10/11/2001
3976 | Re: Division by zero when installing VT 2.5.40 to | Roland | Thu 10/11/2001


New file uploaded to VirtualTreeview

From: [VirtualTreeview@yahoogroups.com>
Date: Wed Oct 10, 2001 4:09 pm
Subject: New file uploaded to VirtualTreeview

Hello,

This email message is a notification to let you know that
a file has been uploaded to the Files area of the VirtualTreeview
group.

File :
/Examples/BCB_Examples/Property_Editors/PropertyEditor2_5_40.zip
Uploaded by : [Beduerftig@S...]
Description : for BCB5: show how to use IVTEditLink with VT 2.5.40

You can access this file at the URL

http://groups.yahoo.com/group/VirtualTreeview/files/Examples/BCB_Examples/Proper\
ty_Editors/PropertyEditor2_5_40.zip

To learn more about file sharing for your group, please visit

http://help.yahoo.com/help/us/groups/files

Regards,

Beduerftig@S...]


Autosizing columns without cutting off the header title

From: [ilan@s...]
Date: Wed Oct 10, 2001 6:31 pm
Subject: Autosizing columns without cutting off the header title

Is it possible to autosize the columns to their contents without
cutting off the header title? When I use AutoFitColumns() and a
column is empty, the title of the header disappears.

Ilan Shemes

 | Replies | Author | Date
3973 | Re: Autosizing columns without cutting off the he | Jim Kueneman | Wed 10/10/2001
3994 | Re: Autosizing columns without cutting off the he | [ilan@s...] | Sat 10/13/2001
3997 | Re: Autosizing columns without cutting off the he | Ilan Shemes | Sat 10/13/2001


translate DPVT : C-> Delphi

From: [benoit.caillaud@f...]
Date: Wed Oct 10, 2001 6:48 pm
Subject: translate DPVT : C-> Delphi

Hello,

Sorry for my poor english

I recovered file DPVT that explains how to connect a table to
VirtualTreeview: Terrific.
Unfortunately, sources are in C ;-(((.
Someone would have it translates in Delphi (I am hopeless in C, a few
better with Delphi) the source.
Besides, I don't manage to install its packet dpvt.bpl, that is
necessary him to add?

Thank you for your help
Regards,
Beniat

 | Replies | Author | Date
4133 | Re: translate DPVT : C-> Delphi | Mike Lischke | Sat 10/20/2001


re: Autosizing columns without cutting off the header title

From: "Jim Kueneman" [jimdk@m...]
Date: Wed Oct 10, 2001 11:04 pm
Subject: Re: Autosizing columns without cutting off the header title

--- In [VirtualTreeview@y...], [ilan@s...] wrote:
> Is it possible to autosize the columns to their contents without
> cutting off the header title? When I use AutoFitColumns() and a
> column is empty, the title of the header disappears.

Now that I look at it can you set the MinWidth for the column to a
size large enough for the title?

The only other way I see is to loop through the columns after the
AutoFitColumns, calcuate the width of the header text add some
padding and reset the width if it is too small.

Jim

 | Replies | Author | Date
3994 | Re: Autosizing columns without cutting off the he | [ilan@s...] | Sat 10/13/2001


re: Division by zero when installing VT 2.5.40 to BCB

From: [adembaba@e...]
Date: Wed Oct 10, 2001 11:10 pm
Subject: Re: Division by zero when installing VT 2.5.40 to BCB

Roland,

This is what I would do: open every single .dfm (not the .pas)
file that the project uses (do not open the .dpr directly) and
once it is in IDE than use 'Show as form'. You will get error
messages if there is anything wrong with the streaming of VT.

This is the best way of seeing if any lingering property is
causing you trouble.

Cheers,
Adem

--- In [VirtualTreeview@y...], "Roland" [Beduerftig@S...] wrote:
> Hi Ralf,
>
> > Hi,
> >
> > as I wrote in a message before, you do NOT need this line! Make
> sure,
> > that you replace ALL old files of virtualtreeview before
updating.
> > It´s an old version of the .res-file that causes this error,
> because
> > the included bitmaps for the checkstates have changed.
>
> of course I read your message before I build the changes, I
uninstall
> the old packages, then I delete all temp files also the resfile,
then
> I copy the new files from the zip in the source directory, compile
> without any error or warnings and now I install the new library
>
> but
>
> the divide by zero error will schown when I compile and run and
older
> project, which used the VT.
>
> best regards
> Roland

 | Replies | Author | Date
3975 | Re: Division by zero when installing VT 2.5.40 to | Ariel | Thu 10/11/2001
3976 | Re: Division by zero when installing VT 2.5.40 to | Roland | Thu 10/11/2001


re: Division by zero when installing VT 2.5.40 to BCB

From: "Ariel" [asel98@y...]
Date: Thu Oct 11, 2001 3:27 am
Subject: Re: Division by zero when installing VT 2.5.40 to BCB

the divide by 0. is because VT doesnt find images inside the .res//
so the image used for checkstates... is empty.

your .res is broken.

--- In [VirtualTreeview@y...], [adembaba@e...] wrote:

 | Replies | Author | Date
3976 | Re: Division by zero when installing VT 2.5.40 to | Roland | Thu 10/11/2001


re: Division by zero when installing VT 2.5.40 to BCB

From: "Roland" [Beduerftig@S...]
Date: Thu Oct 11, 2001 7:32 am
Subject: Re: Division by zero when installing VT 2.5.40 to BCB

--- In [VirtualTreeview@y...], "Ariel" [asel98@y...] wrote:
> the divide by 0. is because VT doesnt find images inside the .res//
> so the image used for checkstates... is empty.
>
> your .res is broken.
>
> --- In [VirtualTreeview@y...], [adembaba@e...] wrote:

Good morning Ariel,

Ok your tip was very good, I checked all my paths and found an
old .res in an other path (I think a copy error of my own few weeks
ago), and the compiler found this old file before the newer.

I deleted all old .res of VT and install VT complet new, and it will
work well.

Thanks all for your help
Roland


Drag and Drop

From: "Helge Jung \(ECO-Logic\)" [helge@e...]
Date: Thu Oct 11, 2001 12:38 pm
Subject: Drag and Drop

Hi there!

I've another problem: I'm trying to implement drag and drop but I'm stuck.
I've two VirtualStringTrees with *exactly* the same data structure. One is
my "database" and the other tree is the "playlist" (it's a database for my
mp3s). Here are some code snippets which might help you to understand/solve
my problem:

procedure TfrmMain.PlaylistDragAllowed(Sender: TBaseVirtualTree;
Node: PVirtualNode; Column: Integer; var Allowed: Boolean);
begin
Allowed := true;
end;

procedure TfrmMain.MP3DBDragAllowed(Sender: TBaseVirtualTree;
Node: PVirtualNode; Column: Integer; var Allowed: Boolean);
begin
Allowed := true;
end;

procedure TfrmMain.MP3DBSaveNode(Sender: TBaseVirtualTree;
Node: PVirtualNode; Stream: TStream);
var
NodeData: TMP3DBEntry;

begin
NodeData := PMP3DBEntry(Sender.GetNodeData(Node))^;

Stream.Write (NodeData, SizeOf (NodeData));
end;

procedure TfrmMain.PlaylistLoadNode(Sender: TBaseVirtualTree;
Node: PVirtualNode; Stream: TStream);
var
DragNodeData: TMP3DBEntry;
NodeData: PMP3DBEntry;

begin
if Sender.DragManager.DragSource = MP3DB then
begin
NodeData := Sender.GetNodeData(Node);
Stream.Read (DragNodeData, SizeOf (DragNodeData));
NodeData^ := DragNodeData;
end;
end;

from the .dfm:

object MP3DB: TVirtualStringTree
[...]
DragMode = dmAutomatic
DragOperations = [doCopy]
DrawSelectionMode = smBlendedRectangle
[...]
TreeOptions.AutoOptions = [toAutoDropExpand, toAutoScrollOnExpand,
toAutoSort, toAutoTristateTracking]
TreeOptions.SelectionOptions = [toFullRowSelect, toRightClickSelect]
[...]
end

object Playlist: TVirtualStringTree
[...]
DragOperations = [doCopy]
DrawSelectionMode = smBlendedRectangle
[...]
TreeOptions.SelectionOptions = [toFullRowSelect, toRightClickSelect]
end

I'm using 2.5.40 if that matters. I searched the help and the
message-history at the YG and couldn't find anything helpful except that
things with OnSaveNode and OnLoadNode. An explanation of this drag'n'drop
stuff would be quite helpful for such beginners like me. BTW: If I've
understodd the system, I could write an explanation for my basic case for
other beginners (in English and German).

Many thanks in advance,
Helge.

 | Replies | Author | Date
3978 | Re: Drag and Drop | Helge Jung (ECO-Logic) | Thu 10/11/2001


re: Drag and Drop

From: "Helge Jung \(ECO-Logic\)" [helge@e...]
Date: Thu Oct 11, 2001 12:55 pm
Subject: Re: [VirtualTreeview] Drag and Drop

> [...] Here are some code snippets which might help you to
> understand/solve my problem: [...]
>
Maybe the data structure plays a role:

type
PMP3DBEntry = ^TMP3DBEntry;
TMP3DBEntry = record
Interpret,Title,Album : widestring;
Length : longword;
Quality : longword;
Size : longword;
FileName : widestring;
end;

If necessary, I could send someone the code or post it in the files-section.
But it's driving me mad.

Helge.

P.S. I tried to answer to the mail with Outlook - let's see if it's linked
correctly to my original post...


re: Drag and Drop

From: Bender Heri [HBender@E...]
Date: Thu Oct 11, 2001 1:19 pm
Subject: RE: [VirtualTreeview] Drag and Drop

I think this structure is the problem. You cannot stream a record with
strings (or widestrings) since these are only pointers. Either you define
them as ShortStrings (in this case they are present with the whole size in
the record, or you refine your StoreXXX and LoadXXX methods:

TMP3DBEntry = record
Interpret,Title,Album : widestring;
Length : longword;
Quality : longword;
Size : longword;
FileName : widestring;
end;

procedure TfrmMain.MP3DBSaveNode(Sender: TBaseVirtualTree;
Node: PVirtualNode; Stream: TStream);

procedure WriteWideString(stream : TStream; const s : WideString);
var
i : integer;
begin
i := Length(s);
stream.Write(i,SizeOf(i));
if i > 0 then
stream.Write(s[1],i);
end;

var
NodeData: TMP3DBEntry;
begin
NodeData := PMP3DBEntry(Sender.GetNodeData(Node))^;

WriteWideString(stream,NodeData.Interpret);
WriteWideString(stream,NodeData.Title);
WriteWideString(stream,NodeData.album);

Stream.Write(@(NodeData.Length)^, 3*SizeOf(Longword));

WriteWideString(stream,NodeData.FileName);
end;

procedure TfrmMain.PlaylistLoadNode(Sender: TBaseVirtualTree;
Node: PVirtualNode; Stream: TStream);

procedure ReadWideString(stream : TStream; var s : WideString);
var
i : integer;
begin
i := stream.read(i,SizeOf(i);
if i > 0 then begin
SetLength(s,i);
Stream.read(s[1],i);
end;
end;

var
DragNodeData: TMP3DBEntry;
NodeData: PMP3DBEntry;

begin
if Sender.DragManager.DragSource = MP3DB then
begin
NodeData := Sender.GetNodeData(Node);

ReadWideString(stream,NodeData.Interpret);
ReadWideString(stream,NodeData.Title);
ReadWideString(stream,NodeData.album);

Stream.Write(@(NodeData.Length)^, 3*SizeOf(Longword));

ReadWideString(stream,NodeData.FileName);

NodeData^ := DragNodeData;
end;
end;

It's just hacked in, not tested at all.

Heri

> -----Original Message-----
> From: Helge Jung (ECO-Logic) [mailto:[helge@e...]]
> Sent: Thursday, October 11, 2001 2:55 PM
> To: VirtualTreeview@yahoogroups.com
> Subject: Re: [VirtualTreeview] Drag and Drop
>
>
> > [...] Here are some code snippets which might help you to
> > understand/solve my problem: [...]
> >
> Maybe the data structure plays a role:
>
> type
> PMP3DBEntry = ^TMP3DBEntry;
> TMP3DBEntry = record
> Interpret,Title,Album : widestring;
> Length : longword;
> Quality : longword;
> Size : longword;
> FileName : widestring;
> end;
>
> If necessary, I could send someone the code or post it in the
> files-section.
> But it's driving me mad.
>
> Helge.
>
> P.S. I tried to answer to the mail with Outlook - let's see
> if it's linked
> correctly to my original post...
>
>
> ------------------------ Yahoo! Groups Sponsor
> ---------------------~-->
> Get your FREE VeriSign guide to security solutions for your
> web site: encrypting transactions, securing intranets, and more!
> http://us.click.yahoo.com/UnN2wB/m5_CAA/yigFAA/i7folB/TM
> --------------------------------------------------------------
> -------~->
>
> To unsubscribe from this group, send an email to:
> VirtualTreeview-unsubscribe@egroups.com
>
>
>
> Your use of Yahoo! Groups is subject to
http://docs.yahoo.com/info/terms/

 | Replies | Author | Date
3980 | Re: Drag and Drop | Helge Jung (ECO-Logic) | Thu 10/11/2001
3981 | Re: Drag and Drop | Jim Kueneman | Thu 10/11/2001
3982 | Re: Drag and Drop | Helge Jung (ECO-Logic) | Thu 10/11/2001
3985 | Re: Drag and Drop | Jim Kueneman | Thu 10/11/2001
3986 | Re: Drag and Drop | Helge Jung (ECO-Logic) | Thu 10/11/2001
3988 | Re: Drag and Drop | Jim Kueneman | Thu 10/11/2001
4021 | Re: Drag and Drop (Example uploaded) | Helge Jung (ECO-Logic) | Mon 10/15/2001
4135 | Re: Drag and Drop | Mike Lischke | Sat 10/20/2001
4146 | Re: Drag and Drop | Helge Jung (ECO-Logic) | Sat 10/20/2001


re: Drag and Drop

From: "Helge Jung \(ECO-Logic\)" [helge@e...]
Date: Thu Oct 11, 2001 1:28 pm
Subject: Re: [VirtualTreeview] Drag and Drop

> I think this structure is the problem. You cannot stream a record with
> strings (or widestrings) since these are only pointers.

I had thought about that also already. After reading my post again I see
that I haven't mentioned that I can start to drag but the cursor becomes the
forbidden-sign and doesn't change either if I'm over the Playlist. BTW: the
main columns are hidden in both trees (I'm using them like improved
Listviews).

> Either you define them as ShortStrings (in this case they are present
> with the whole size in the record, or you refine your StoreXXX and
> LoadXXX methods:

Thanks for the code but sadly it doesn't help ... but I'll let it in because
I think this will work better than mine ;-))

> It's just hacked in, not tested at all.

I had to change @(NodeData.Length)^ to (@NodeData.Length)^ in order to
compile the stuff.

Thanks for your time anyway,
Helge.

 | Replies | Author | Date
3981 | Re: Drag and Drop | Jim Kueneman | Thu 10/11/2001
3982 | Re: Drag and Drop | Helge Jung (ECO-Logic) | Thu 10/11/2001
3985 | Re: Drag and Drop | Jim Kueneman | Thu 10/11/2001
3986 | Re: Drag and Drop | Helge Jung (ECO-Logic) | Thu 10/11/2001
3988 | Re: Drag and Drop | Jim Kueneman | Thu 10/11/2001
4021 | Re: Drag and Drop (Example uploaded) | Helge Jung (ECO-Logic) | Mon 10/15/2001
4135 | Re: Drag and Drop | Mike Lischke | Sat 10/20/2001
4146 | Re: Drag and Drop | Helge Jung (ECO-Logic) | Sat 10/20/2001
4203 | Re: Drag and Drop | Mike Lischke | Mon 10/22/2001


re: Drag and Drop

From: Jim Kueneman [jimdk@m...]
Date: Thu Oct 11, 2001 1:59 pm
Subject: Re: [VirtualTreeview] Drag and Drop

At 03:28 PM 10/11/2001 +0200, you wrote:
>I had thought about that also already. After reading my post again I see
>that I haven't mentioned that I can start to drag but the cursor becomes the
>forbidden-sign and doesn't change either if I'm over the Playlist. BTW: the

Don't forget about OnDragOver and OnDragDrop. You can then use the
DropTargetNode property or GetHitTestInfoAt method to make decisions on
when and where to drop.

Jim

 | Replies | Author | Date
3982 | Re: Drag and Drop | Helge Jung (ECO-Logic) | Thu 10/11/2001
3985 | Re: Drag and Drop | Jim Kueneman | Thu 10/11/2001
3986 | Re: Drag and Drop | Helge Jung (ECO-Logic) | Thu 10/11/2001
3988 | Re: Drag and Drop | Jim Kueneman | Thu 10/11/2001
4021 | Re: Drag and Drop (Example uploaded) | Helge Jung (ECO-Logic) | Mon 10/15/2001
4135 | Re: Drag and Drop | Mike Lischke | Sat 10/20/2001
4146 | Re: Drag and Drop | Helge Jung (ECO-Logic) | Sat 10/20/2001
4203 | Re: Drag and Drop | Mike Lischke | Mon 10/22/2001


re: Drag and Drop

From: "Helge Jung \(ECO-Logic\)" [helge@e...]
Date: Thu Oct 11, 2001 2:47 pm
Subject: Re: [VirtualTreeview] Drag and Drop

> Don't forget about OnDragOver and OnDragDrop. You can then use the
> DropTargetNode property or GetHitTestInfoAt method to make decisions on
> when and where to drop.
>

Okay, now I see the plus-sign when dragging from the MP3DB to the Playlist -
wonderful. But there's still one tiny problem: the node isn't in the
Playlist afterwards... Playlist.OnLoadNode and MP3DB.OnSaveNode aren't even
called (I put breakpoints into them). Breakpoints at other parts in the
program are called so there isn't a problem with the breakpoints - it has to
be my implementation.

What shall I do in OnDragDrop? In OnDragOver I set Allowed to true. The node
shall always be added as long as they come from MP3DB.

Anyway, thanks for your time, too.

Helge.

 | Replies | Author | Date
3985 | Re: Drag and Drop | Jim Kueneman | Thu 10/11/2001
3986 | Re: Drag and Drop | Helge Jung (ECO-Logic) | Thu 10/11/2001
3988 | Re: Drag and Drop | Jim Kueneman | Thu 10/11/2001
4021 | Re: Drag and Drop (Example uploaded) | Helge Jung (ECO-Logic) | Mon 10/15/2001
4135 | Re: Drag and Drop | Mike Lischke | Sat 10/20/2001
4146 | Re: Drag and Drop | Helge Jung (ECO-Logic) | Sat 10/20/2001
4203 | Re: Drag and Drop | Mike Lischke | Mon 10/22/2001


Drag & Drop with toEditing problem

From: "Simon Moscrop" [SimonMoscrop@H...]
Date: Thu Oct 11, 2001 3:35 pm
Subject: Drag & Drop with toEditing problem

Hi,

I am attemting to use the latest version of VTs and am experiencing
a 'wierdism' - I have editing enabled for the treeview, but also want
to use drag & drop... problem is that the tree goes into edit mode on
mousedown rather than mouse up.

This means that if i select a node then pause for a momemt - then
attempt to reselect the node the node goes into edit mode rather than
starting a drag operation.

Thought it may be tree options that i have set up incorrectly
wouldn't it be more normal for the tree to go into edit mode on
MouseUp rather than mousedown.. thereby erradicating the problem.

If you can think of any tree options/code that will stop the above
behaviour Please let me know - Thanks

Si

 | Replies | Author | Date
3987 | Re: Drag & Drop with toEditing problem - Please i | Simon Moscrop | Thu 10/11/2001


Editors 4 beginners

From: [pielord2001@y...]
Date: Thu Oct 11, 2001 4:09 pm
Subject: Editors 4 beginners

Hello,

Have a question regarding editors with virtual Tree View running
as grid. Downloaded examples from this site, setup and working great.

When I edit a cell for example then key down or up the edit
is saved as expected but when next row is selected , the next selected
value is not in edit mode.

Any suggestions??

Cheers in advance

J

 | Replies | Author | Date
3989 | Re: Editors 4 beginners | Roland | Fri 10/12/2001
3990 | Re: Editors 4 beginners | [pielord2001@y...] | Fri 10/12/2001
4017 | Re: Editors 4 beginners | Roland | Mon 10/15/2001


re: Drag and Drop

From: "Jim Kueneman" [jimdk@m...]
Date: Thu Oct 11, 2001 4:13 pm
Subject: Re: Drag and Drop

wonderful. But there's still one tiny problem: the node isn't in the
> Playlist afterwards... Playlist.OnLoadNode and MP3DB.OnSaveNode
aren't even
> called (I put breakpoints into them). Breakpoints at other parts in

Make sure Virtual Tree Data is set to True in ClipboardFormats.

Jim

 | Replies | Author | Date
3986 | Re: Drag and Drop | Helge Jung (ECO-Logic) | Thu 10/11/2001
3988 | Re: Drag and Drop | Jim Kueneman | Thu 10/11/2001
4021 | Re: Drag and Drop (Example uploaded) | Helge Jung (ECO-Logic) | Mon 10/15/2001


re: Re: Drag and Drop

From: "Helge Jung \(ECO-Logic\)" [helge@e...]
Date: Thu Oct 11, 2001 4:21 pm
Subject: Re: [VirtualTreeview] Re: Drag and Drop

> Make sure Virtual Tree Data is set to True in ClipboardFormats.
>
They are set to True in both VirtualStringTrees. But it isn't working... may
I send you my tiny program (as source) so you can have a look at it? Or
maybe has a small example on how to drag'n'drop nodes with the same data
structure between two VST?

Helge.

 | Replies | Author | Date
3988 | Re: Drag and Drop | Jim Kueneman | Thu 10/11/2001
4021 | Re: Drag and Drop (Example uploaded) | Helge Jung (ECO-Logic) | Mon 10/15/2001


re: Drag & Drop with toEditing problem - Please ignore previous message

From: "Simon Moscrop" [SimonMoscrop@H...]
Date: Thu Oct 11, 2001 4:35 pm
Subject: Re: Drag & Drop with toEditing problem - Please ignore previous message

HI,

I AM AN IDIOT.. Set the EditDelay & everything is spot on.

--- In [VirtualTreeview@y...], "Simon Moscrop" [SimonMoscrop@H...]
wrote:
> Hi,
>
> I am attemting to use the latest version of VTs and am experiencing
> a 'wierdism' - I have editing enabled for the treeview, but also
want
> to use drag & drop... problem is that the tree goes into edit mode
on
> mousedown rather than mouse up.
>
> This means that if i select a node then pause for a momemt - then
> attempt to reselect the node the node goes into edit mode rather
than
> starting a drag operation.
>
> Thought it may be tree options that i have set up incorrectly
> wouldn't it be more normal for the tree to go into edit mode on
> MouseUp rather than mousedown.. thereby erradicating the problem.
>
> If you can think of any tree options/code that will stop the above
> behaviour Please let me know - Thanks
>
> Si


re: Drag and Drop

From: "Jim Kueneman" [jimdk@m...]
Date: Thu Oct 11, 2001 4:55 pm
Subject: Re: Drag and Drop

--- In [VirtualTreeview@y...], "Helge Jung \(ECO-Logic\)" [helge@e...]
wrote:
> > Make sure Virtual Tree Data is set to True in ClipboardFormats.
> >
> They are set to True in both VirtualStringTrees. But it isn't
working... may
> I send you my tiny program (as source) so you can have a look at

Upload it to the Files area

Jim

 | Replies | Author | Date
4021 | Re: Drag and Drop (Example uploaded) | Helge Jung (ECO-Logic) | Mon 10/15/2001


re: Editors 4 beginners

From: "Roland" [Beduerftig@S...]
Date: Fri Oct 12, 2001 7:54 am
Subject: Re: Editors 4 beginners

> Have a question regarding editors with virtual Tree View running
> as grid. Downloaded examples from this site, setup and working
great.
>
> When I edit a cell for example then key down or up the edit
> is saved as expected but when next row is selected , the next
selected
> value is not in edit mode.
>
> Any suggestions??

Good morning,

have a look in my demo "propertyeditor" in file area then you see:

void __fastcall TPropertyEditorForm::TreeChange(TBaseVirtualTree
*Sender, PVirtualNode Node) {
if (!Node) return; // only for safety the program !
TPropertyData* Data = (TPropertyData*)Tree->GetNodeData(Node);
if (Data && (Data->PropertyTyp != ptNone))
Sender->EditNode(Node, 2);
}

you check whether an edit is allowed then EditNode(...);

regards
Roland

 | Replies | Author | Date
3990 | Re: Editors 4 beginners | [pielord2001@y...] | Fri 10/12/2001
4017 | Re: Editors 4 beginners | Roland | Mon 10/15/2001


re: Editors 4 beginners

From: [pielord2001@y...]
Date: Fri Oct 12, 2001 9:16 am
Subject: Re: Editors 4 beginners

--- In [VirtualTreeview@y...], "Roland" [Beduerftig@S...] wrote:
> > Have a question regarding editors with virtual Tree View running
> > as grid. Downloaded examples from this site, setup and working
> great.
> >
> > When I edit a cell for example then key down or up the edit
> > is saved as expected but when next row is selected , the next
> selected
> > value is not in edit mode.
> >
> > Any suggestions??
>
> Good morning,
>
> have a look in my demo "propertyeditor" in file area then you see:
>
> void __fastcall TPropertyEditorForm::TreeChange(TBaseVirtualTree
> *Sender, PVirtualNode Node) {
> if (!Node) return; // only for safety the program !
> TPropertyData* Data = (TPropertyData*)Tree->GetNodeData(Node);
> if (Data && (Data->PropertyTyp != ptNone))
> Sender->EditNode(Node, 2);
> }
>
> you check whether an edit is allowed then EditNode(...);
>
> regards
> Roland

Cheers for the reply Roland, neglected to say working with the
Delphi examples VSTEDit.pas / MFEdit.pas

Cheers

J

 | Replies | Author | Date
4017 | Re: Editors 4 beginners | Roland | Mon 10/15/2001


newbie making tree

From: [rhymebusta@h...]
Date: Fri Oct 12, 2001 3:28 pm
Subject: newbie making tree

hi i was wondering if anybody can help me in starting off on how to
use the TVirtualStringTree component. I downloaded the latest
version from Mike's website but I'm using BCB5 and the documentation
is really not that great at all especially for C++(no diss intended).
I've gone through the documentation but i still can't see where to
use certan things. I just wanna know what functions are associated
with what structures -i.e. - tvirtualnode or pvirtualnode
if anyone has compiled an indepth API listing i was wondering if you
could send it to me or post it.
i'm gonna try some stuff but if i can't figure anything out i'll come
back with more detailed questions
-peace

 | Replies | Author | Date
3993 | Re: newbie making tree | Jim Kueneman | Fri 10/12/2001


Sample Code

From: "Wayne Fulcher" [wayne@d...]
Date: Fri Oct 12, 2001 4:29 pm
Subject: Sample Code

I just found the VirtualTree component the other day and I am having a hard
time understanding how to use it.
I have a database with the following columns:
Genre
Artist
Album
Title

I want to build a treeview that looks just like that.
Of course I sort my query in the same order.
Where can I find an example of how to build the tree view based on the
content in a table (where the number of nodes is not known).
I also want the tree view to have checkboxes by every node.

Thanks,
Wayne Fulcher
Digital Dimensions, Inc.
[wayne@d...]

 | Replies | Author | Date
3998 | Re: Sample Code | Jim Kueneman | Sat 10/13/2001
4000 | Re: Sample Code | Jim Kueneman | Sat 10/13/2001
4009 | Re: Sample Code | Werner Lehmann | Sun 10/14/2001


re: newbie making tree

From: "Jim Kueneman" [jimdk@m...]
Date: Fri Oct 12, 2001 6:19 pm
Subject: Re: newbie making tree

> hi i was wondering if anybody can help me in starting off on how to
> use the TVirtualStringTree component. I downloaded the latest
> version from Mike's website but I'm using BCB5 and the documentation

Get 2.5.40 from

http://groups.yahoo.com/group/VirtualTreeview/files/

It is even more confusing <g> (more options) but it will save from
having the pain of upgrading from 1.x

VT is not easy to learn, there are multiple ways to do various things
(usually only 1 or 2 of them are right) but once you get the hang of
it is a great component.

Jim


re: Autosizing columns without cutting off the header title

From: [ilan@s...]
Date: Fri Oct 12, 2001 10:11 pm
Subject: Re: Autosizing columns without cutting off the header title

> Now that I look at it can you set the MinWidth for the column to a
> size large enough for the title?

So easy I slapped my head when I read this. Guess what? It works like
a charm!

Thanks!

Ilan


Hello, anybody home

From: "Wayne Fulcher" [wayne@d...]
Date: Fri Oct 12, 2001 9:02 pm
Subject: Hello, anybody home

I was just wondering if I was able to join this email list.
I sent my first email this morning and have not received any emails from
anyone, not even other peoples request.
If you get this email would you just reply so that I know this is working.

Thanks
Wayne

 | Replies | Author | Date
3999 | Re: Hello, anybody home | Tom Hahn | Sat 10/13/2001


Strange focus behaviour...

From: "Ilan Shemes" [ilan@s...]
Date: Fri Oct 12, 2001 10:07 pm
Subject: Strange focus behaviour...

Consider the following code:

{
TAnalysedItemsData *Node;
TVirtualNode *VNode;
TVirtualNode *VNode2;

VNode = AnalysedItems->GetFirstSelected();
while (VNode)
{
Node = (TAnalysedItemsData *) AnalysedItems->GetNodeData(VNode);
AnalysedItems->FocusedNode = AnalysedItems->GetPrevious(VNode);
VNode2 = VNode;
VNode = AnalysedItems->GetNextSelected(VNode);
AnalysedItems->DeleteNode(VNode2);
AnalysedItems->FocusedNode =
AnalysedItems->GetNext(AnalysedItems->FocusedNode);
}
}

This code removes all selected items from a list. And keeps the focus on the
same line. (I just typed this code as an example, the original code does
more then just deleting the node.)

The problem is that even though the focus stays on the same line after
deleting a single item, when I press SHIFT-DOWN a couple of times I get a
nice selection minus the top 2 items. I'm wondering why the first two items
are skipped by the selection proces? The focus moves over these items, but
it looks like the selection bit does not get set. Does anybody know the
answer to this?

Ilan

 | Replies | Author | Date
4010 | Re: Strange focus behaviour... | Werner Lehmann | Sun 10/14/2001
4013 | Re: Strange focus behaviour... | Ilan Shemes | Sun 10/14/2001
4015 | Re: Strange focus behaviour... | [subscribedlists@b...] | Sun 10/14/2001
4137 | Re: Strange focus behaviour... | Mike Lischke | Sat 10/20/2001


re: Re: Autosizing columns without cutting off the header title

From: "Ilan Shemes" [ilan@s...]
Date: Fri Oct 12, 2001 9:10 pm
Subject: Re: [VirtualTreeview] Re: Autosizing columns without cutting off the header title

> Now that I look at it can you set the MinWidth for the column to a
> size large enough for the title?

So easy I slapped my head when I read this. Guess what? It works like a
charm!

Thanks!

Ilan


re: Sample Code

From: Jim Kueneman [jimdk@m...]
Date: Sat Oct 13, 2001 1:57 am
Subject: Re: [VirtualTreeview] Sample Code

At 12:29 PM 10/12/2001 -0400, you wrote:
>I just found the VirtualTree component the other day and I am having a hard
>time understanding how to use it.
>I have a database with the following columns:
>Genre
> Artist
> Album
> Title
>
>I want to build a treeview that looks just like that.
>Of course I sort my query in the same order.

Are these columns? Or is that the tree structure? If they are columns
then go to the Header > Columns property and create these columns.

Now you must respond to every thing VT ask for though the
events. OnGetText for text and OnGetImageIndex for images. The OnGetText
asks for the text with the column as as parameter.

To store data create a data structure

PMyData = ^TMyData;
TMyData = record
SomeInt: integer;
SomeString: string;
end;

Now in the Form create event tell VT how big this data is

VT.NodeDataSize := SizeOf(TMyData);

now VT will reserve this amount of data in each node. To create a new node
dynamiclly use AddChild(nil) to add to the root for example. The key to VT
is the OnInitNode and OnInitChildren. The node knows nothing until it is
initalized. After the AddChild is called it is simplely a node with no
smarts. The key is when VT is asked to display it or save it to a
stream. It then calls OnInitNode with that node as a parameter. At that
point you can do what ever is necessary like fill in the reserved data
requested earlier.

procedure VST.OnInitNode(Sender: TBaseVirtualTree; ParentNode, Node:
PVirtualNode; var InitialStates: TVirtualNodeInitStates);
var
Data: PMyData;
begin
{ Get the reserved data }
Data := Sender.GetNodeData(Node);
{ Query the database here to save the info }
Data.SomeInt := 56;
Data.SomeString := 'Hi';
{ Note here you can set the node to have virtual children }
InitialStates := [ivsHasChildren];
{ Note when the node is expanded OnInitChildren will be called so you
can reply how many children then OnInitNode will be called for each of
those children }
{ Also the checkboxes are set here }
Node.CheckType := ctCheckBox;
{Check it }
Node.CheckState := csCheckedNormal;
end;

Now in the OnGetText you do the same to retrive the data to show;

procedure VST.OnGetText(....)
var
Data: PMyDAta;
begin
Data := Sender.GetNodeDAta(Node);
Text := Data.SomeString
end;

If you use strings then in the OnFreeNode event you must use Finalize on
your data structure so they are freed. VT does not use New which is
dynamic string aware.

Just keep in mind virtual. Add a new node. When VT is ready it will call
OnInitNode for you to initialize it (what ever that means to you). If you
set the HasChildren state for the node when the user trys to expand it VT
calls OnInitChildren where you respond as to how many children the node has
then VT will call the OnInitNode for each node when it deems it necessary
and so on. There is nothing wrong with initializing the node completely in
the OnInitChildren (VET does this)

Hope this helps somewhat. It is hard to give an example since VT is so
flexable and you can do things so many ways depending on your needs. It is
a learning curve but well worth the time spent.

Jim


re: Hello, anybody home

From: "Tom Hahn" [thahn@h...]
Date: Sat Oct 13, 2001 5:36 am
Subject: RE: [VirtualTreeview] Hello, anybody home

It is working!

> -----Original Message-----
> From: Wayne Fulcher [mailto:[wayne@d...]]
> If you get this email would you just reply so that I know this is working.
>


re: Sample Code

From: "Jim Kueneman" [jimdk@m...]
Date: Sat Oct 13, 2001 2:18 pm
Subject: Re: Sample Code

Wayne,

> I just found the VirtualTree component the other day and I am
having a hard
> time understanding how to use it.
> I have a database with the following columns:

I uploaded an example that may help

http://groups.yahoo.com/group/VirtualTreeview/files/Examples/Delphi_Ex
amples/Misc_Examples/

names VT_Basics.zip

Jim


Fw: [VirtualExplorerTree] Re: VT replacement ListView

From: "Wim van der Vegt" [wvd_vegt@k...]
Date: Sat Oct 13, 2001 3:27 pm
Subject: Fw: [VirtualExplorerTree] Re: VT replacement ListView

----- Original Message -----
From: Wim van der Vegt
To: [VirtualExplorerTree@yahoogroups.com
Sent: Saturday, October 13, 2001 05:17 PM
Subject: Re: [VirtualExplorerTree] Re: VT replacement ListView

Hi,

I wrote a VT descandant that has a data structure and routines just like
TTreeView and TListView (you can even mix both). So it emulates both for simple
cases. If anyone is interested i will consider uploading it (even if it's not
100% finished/debugged yet).

-----------
Wim van der Vegt
----- Original Message -----
From: Jim Kueneman
To: VirtualExplorerTree@yahoogroups.com
Sent: Saturday, October 13, 2001 04:29 AM
Subject: [VirtualExplorerTree] Re: VT replacement ListView

>
> I want to replace all TListViews on my application by VT,
because

Probably more work than you think. VT is completely different.

>
> I get the example code, but i really cant found a way to
rewrite
> this code for use with VT.

This really should be in the VT here on the Yahoo Groups list. I
just replied to another new user of VT there and it should give you
an idea of how to get started. Poke around for a day or two to get
the feel if how VT works. It is almost impossible to give an fits
all example cause there are many ways to use VT depending on the data.

Jim

Yahoo! Groups Sponsor

To unsubscribe from this group, send an email to:
VirtualExplorerTree-unsubscribe@yahoogroups.com

Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.

[Non-text portions of this message have been removed]

Yahoo! Groups Sponsor

To unsubscribe from this group, send an email to:
VirtualExplorerTree-unsubscribe@yahoogroups.com

Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.

[Non-text portions of this message have been removed]

Replies | Author | Date
4002 | Re: Fw: [VirtualExplorerTree] Re: VT replacement | Carlos Eduardo Borrero | Sat 10/13/2001
4003 | Re: Fw: [VirtualExplorerTree] Re: VT replacement | Wim van der Vegt | Sat 10/13/2001


re: Fw: [VirtualExplorerTree] Re: VT replacement ListView

From: "Carlos Eduardo Borrero" [cbarrer@e...]
Date: Sat Oct 13, 2001 4:33 pm
Subject: RE: [VirtualTreeview] Fw: [VirtualExplorerTree] Re: VT replacement ListView

Hello Wim:

> If anyone is interested i will consider uploading it (even if it's not
100% finished/debugged yet).

Excellent, I am interested.

Kind regards,

Carlos Borrero


re: Fw: [VirtualExplorerTree] Re: VT replacement ListView

From: "Wim van der Vegt" [wvd_vegt@k...]
Date: Sat Oct 13, 2001 5:50 pm
Subject: Re: [VirtualTreeview] Fw: [VirtualExplorerTree] Re: VT replacement ListView

Hi,

I uploaded the demo (with no src) some weeks agoo as vtstuff.zip. Though some
comments have dissapeared the last tab shows the emulation at work (and in the
memo beneath it the code lines used for doing it).

I will propably upload it tomorrow or monday as i have to check it to compile
with the latest version and add some form of documentation. I think i will
upload al components in the vtstuff demo (even if some are not so usefull).

----
Wim van der Vegt

----- Original Message -----
From: Carlos Eduardo Borrero
To: VirtualTreeview@yahoogroups.com
Sent: Saturday, October 13, 2001 06:33 PM
Subject: RE: [VirtualTreeview] Fw: [VirtualExplorerTree] Re: VT replacement
ListView

Hello Wim:

> If anyone is interested i will consider uploading it (even if it's not
100% finished/debugged yet).

Excellent, I am interested.

Kind regards,

Carlos Borrero

Yahoo! Groups Sponsor

To unsubscribe from this group, send an email to:
VirtualTreeview-unsubscribe@egroups.com

Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.

[Non-text portions of this message have been removed]


Auto Edit mode

From: [gabe@g...]
Date: Sat Oct 13, 2001 7:34 pm
Subject: Auto Edit mode

I am trying to use a Virtual Tree as a grid (see Tree as grid example
in Advanced demo), which is working out great. However, I want to be
able to edit the cells without hitting 'F2' or clicking twice on the
cell with the mouse, especially when the user is entering in the
values for the new node.

Any ideas?

Gabriel Padilla

 | Replies | Author | Date
4011 | Re: Auto Edit mode | Werner Lehmann | Sun 10/14/2001
4018 | Re: Auto Edit mode | Roland | Mon 10/15/2001


Notes on dropmarkMode

From: "Anders Thomsen" [anders@t...]
Date: Sat Oct 13, 2001 8:38 pm
Subject: Notes on dropmarkMode

Hi Mike,

Thanks for adding the dropmarkMode to HeaderDraw.
I've found a little problem with it though, when dragging a column, the DDM
should be
none if the column is the dragged column.

if draggedColumn = column then dmm := dmmNone : )

-Thomsen

[Non-text portions of this message have been removed]

 | Replies | Author | Date
4139 | Re: Notes on dropmarkMode | Mike Lischke | Sat 10/20/2001


How to make drag image look like standard image?

From: [subscribedlists@b...]
Date: Sat Oct 13, 2001 11:13 pm
Subject: How to make drag image look like standard image?

I like the Alpha blended drag images, but they are not always
appropriate for the application. How can I make OLE drag images look
like the standard VCL drag images. I still want to use OLE Drag-N-
Drop, I just want the standard VCL Drag-N-Drop image to be used.

My guess is that there must be a way to turn off the drag images and
then just change the cursor to the drag cursor. However, I have been
unable to turn off the images.

Thanks for any help or insights provided.

Doug

 | Replies | Author | Date
4140 | Re: How to make drag image look like standard ima | Mike Lischke | Sat 10/20/2001


Fw: [VirtualExplorerTree] Re: VT replacement ListView

From: [subscribedlists@b...]
Date: Sat Oct 13, 2001 11:29 pm
Subject: Fw: [VirtualExplorerTree] Re: VT replacement ListView

--- In [VirtualTreeview@y...], "Wim van der Vegt" [wvd_vegt@k...] wrote:
> I wrote a VT descandant that has a data structure and routines just
like TTreeView and TListView (you can even mix both). So it emulates
both for simple cases. If anyone is interested i will consider
uploading it (even if it's not 100% finished/debugged yet).

Yes please share your work with us. Software is never 100% anyway.
Development work merely stops or a new project is started. Even all
the Virtual Tree releases are all titled "betas". I would suggest
just leaving a comment block at the beginning of each unit mentioning
any weaknesses that still need some work.

Thanks, and I look forward to testing/reviewing your adapter for VT.

Doug


Can the tree's lines be replaced with images?

From: [subscribedlists@b...]
Date: Sat Oct 13, 2001 11:34 pm
Subject: Can the tree's lines be replaced with images?

I've seen some very nice trees with small pipe-like images used for
drawing the lines between the nodes on the tree. Is there easy
access to a way to draw these with bitmaps?

Thanks for any insights,

Doug

 | Replies | Author | Date
4012 | Re: Can the tree's lines be replaced with images? | Werner Lehmann | Sun 10/14/2001
4014 | Re: Can the tree's lines be replaced with images? | [subscribedlists@b...] | Sun 10/14/2001
4141 | Re: Can the tree's lines be replaced with images? | Mike Lischke | Sat 10/20/2001


re: Sample Code

From: Werner Lehmann [wl@b...]
Date: Sun Oct 14, 2001 9:04 pm
Subject: Re: [VirtualTreeview] Sample Code

Hi Wayne,

> I just found the VirtualTree component the other day and I am having a hard
> time understanding how to use it.
> I have a database with the following columns:
> Genre
> Artist
> Album
> Title

Jim has already told you some basics. For the database connection no
one-serves-all
recipes can be given. As a rule of thumb: if you number of rows is small and/or
your
database is fast (i.e. local etc) you are best off if you query the whole table
and
add all to a local data structure and (if you want) to the tree.

If the data is bigger or may grow to a point where this is not possible you
have to
do some late initialization somehow. A cheap way to do this is to the get just
the
first or the first two / three levels (to cut down the amount of data
required), add
this to data structure and tree (either at once or in OnExpanding /
OnInitChildren)
and get missing data only when it's needed by you or the tree.

If you have specific questions feel free to ask them.

> I want to build a treeview that looks just like that.
> Of course I sort my query in the same order.

I suppose you are able to iterate your sorted dataset and add nodes recursively?

> Where can I find an example of how to build the tree view based on the
> content in a table (where the number of nodes is not known).

Well one approach to use is AddChild(). Another one is to read the data into
your
local structures (records, classes etc) and only if you have one node complete
(the
list of siblings) add it to the tree. At this time you know the number of
siblings
already.

Just one hint: I have seen code which uses an always-open dataset with lots of
locate's.
Don't do that, it will slow things down tremendously.

> I also want the tree view to have checkboxes by every node.

Enable the appropriate TreeOptions property (CheckSupport) and use CheckState[]
and
CheckType[] properties on the nodes you want to have checkboxes.

Werner


re: Strange focus behaviour...

From: Werner Lehmann [wl@b...]
Date: Sun Oct 14, 2001 9:07 pm
Subject: Re: [VirtualTreeview] Strange focus behaviour...

Hi Ilan,

I have seen similar effects but never reproducable. I hope I'll be able
to test your code in Delphi in the next days. It always helps to build
a test project (minimal of course, and better delphi... neither Mike nor
me have BCB but understand C of course) and file a bug report in the
database section on YG.

Werner


re: Auto Edit mode

From: Werner Lehmann [wl@b...]
Date: Sun Oct 14, 2001 9:10 pm
Subject: Re: [VirtualTreeview] Auto Edit mode

Hi Gabriel,

> I am trying to use a Virtual Tree as a grid (see Tree as grid example
> in Advanced demo), which is working out great. However, I want to be
> able to edit the cells without hitting 'F2' or clicking twice on the
> cell with the mouse, especially when the user is entering in the
> values for the new node.

I would hook OnFocusChanged and try this:

Sender.EditNode(Node, Column);

(untested)

Werner

 | Replies | Author | Date
4018 | Re: Auto Edit mode | Roland | Mon 10/15/2001


re: Can the tree's lines be replaced with images?

From: Werner Lehmann [wl@b...]
Date: Sun Oct 14, 2001 9:48 pm
Subject: Re: [VirtualTreeview] Can the tree's lines be replaced with images?

Hi Doug,

[subscribedlists@b...] wrote:
>
> I've seen some very nice trees with small pipe-like images used for
> drawing the lines between the nodes on the tree. Is there easy
> access to a way to draw these with bitmaps?

I can not really imagine how this would look like (what about a small PNG
screenshot in the screenshots folder? :).

But these are the alternatives you can choose from currently:
- LineStyle := lsCustomStyle, OnGetLineStyle (no pipes with this way)
- OnBeforeItemPaint / OnBeforeCellPaint, you will have to do all the drawing
probably
- turn toShowRoot and toShowTreeLines off, and misuse the state images to draw
the
pipes (add 'building blocks' to your state imagelist)

Werner

 | Replies | Author | Date
4014 | Re: Can the tree's lines be replaced with images? | [subscribedlists@b...] | Sun 10/14/2001
4141 | Re: Can the tree's lines be replaced with images? | Mike Lischke | Sat 10/20/2001


re: Strange focus behaviour...

From: "Ilan Shemes" [ilan@s...]
Date: Sun Oct 14, 2001 10:07 pm
Subject: Re: [VirtualTreeview] Strange focus behaviour...

Thanks Werner.

I hope you can reproduce the problem.

Ilan Shemes


re: Can the tree's lines be replaced with images?

From: [subscribedlists@b...]
Date: Sun Oct 14, 2001 10:44 pm
Subject: Re: Can the tree's lines be replaced with images?

>Werner Lehmann [wl@b...] wrote:
>
> I can not really imagine how this would look like (what about a
> small PNG screenshot in the screenshots folder? :).

Done. Look in Files > Screen shots > Competitive_Trees for a
screenshot of a tree with *pipes* and special icons for + and -.

Any ideas on how to replicate something like that with the Virtual
Tree component?

Thanks,

Doug

 | Replies | Author | Date
4141 | Re: Can the tree's lines be replaced with images? | Mike Lischke | Sat 10/20/2001


re: Strange focus behaviour...

From: [subscribedlists@b...]
Date: Sun Oct 14, 2001 11:09 pm
Subject: Re: Strange focus behaviour...

>
> VNode = AnalysedItems->GetFirstSelected();
> VNode = AnalysedItems->GetNextSelected(VNode);
>

I've noticed problems also going through the selected nodes and
noticed that the first selected node is not always the upper node (if
you understand my meaning). If you were to select three nodes by
dragging or ctrl-clicking the GetFirstSelected node can be the last
node in the selection (the one last clicked on which is lower on the
tree). I've noticed that clicking again on the upper node of the
selection allows me to then walk through the nodes as I expected.

Even stranger, if you have three sibling nodes, try ctrl-clicking
on them in the order of 1-3-2 instead or 1-2-3 and the order of the
selected nodes you will obtain from GetFirstSelected and
GetNextSelected will be entirely different, even though the selection
list contains the same three nodes.

So it is entirely possible that GetNextSelected will return NIL
after calling GetFirstSelected even though there are more nodes
contained in the selection.

Solution:

I've usually fixed this by moving the focus back to the very first
node that was initially selected. And then calling the
GetFirstSelected and GetNextSelected methods to walk the nodes. Your
moving the focus around while walking through the selected nodes
probably exacerbates your problem.

Hope my reply helps you in some regard,

Doug

 | Replies | Author | Date
4137 | Re: Strange focus behaviour... | Mike Lischke | Sat 10/20/2001


CheckType question

From: [ljee@s...]
Date: Mon Oct 15, 2001 1:29 am
Subject: CheckType question

Is it possible to have checkboxes in other columns, not column 0?
Thanks

 | Replies | Author | Date
4142 | Re: CheckType question | Mike Lischke | Sat 10/20/2001
4145 | Re: Node data question | Lucian | Sat 10/20/2001
4149 | Re: Node data question | [subscribedlists@b...] | Sat 10/20/2001


re: Editors 4 beginners

From: "Roland" [Beduerftig@S...]
Date: Mon Oct 15, 2001 6:29 am
Subject: Re: Editors 4 beginners

Good morning,

> Cheers for the reply Roland, neglected to say working with the
> Delphi examples VSTEDit.pas / MFEdit.pas

yes it's like the same. I wrote in the first place in CPPB, but the
code looks like Delphi-Code the name of the methods and variables are
the same.

When you look at the sample of propertyeditor for CPPB then you see
the redefine of IVTEditLink, and under Delphi is not necessary to do
this you can use IVTEditLink directly, see at the orginal
VirtualTrees.pas, here is the internal editor of the VT.

regards
Roland


re: Auto Edit mode

From: "Roland" [Beduerftig@S...]
Date: Mon Oct 15, 2001 6:32 am
Subject: Re: Auto Edit mode

Hi Gabriel,

> > I am trying to use a Virtual Tree as a grid (see Tree as grid
example
> > in Advanced demo), which is working out great. However, I want
to be
> > able to edit the cells without hitting 'F2' or clicking twice on
the
> > cell with the mouse, especially when the user is entering in the
> > values for the new node.
>
> I would hook OnFocusChanged and try this:
>
> Sender.EditNode(Node, Column);
>
> (untested)
>
> Werner

the tip of werner is good, you can see a complet demo on file area.
Look at "property-editor", this sample is writen in CPPB but the
names of methods and variables are the same in delphi, and you can
use it directly.

regards
Roland


New file uploaded to VirtualTreeview

From: [VirtualTreeview@yahoogroups.com>
Date: Mon Oct 15, 2001 6:45 am
Subject: New file uploaded to VirtualTreeview

Hello,

This email message is a notification to let you know that
a file has been uploaded to the Files area of the VirtualTreeview
group.

File : /DCR_complet_with_HeaderPopup.zip
Uploaded by : [Beduerftig@S...]
Description : Bitmap (DCR) for HeaderPopup

You can access this file at the URL

http://groups.yahoo.com/group/VirtualTreeview/files/DCR_complet_with_HeaderPopup\
.zip

To learn more about file sharing for your group, please visit

http://help.yahoo.com/help/us/groups/files

Regards,

Beduerftig@S...]

 | Replies | Author | Date
4020 | Re: New file uploaded to VirtualTreeview | Roland | Mon 10/15/2001


re: New file uploaded to VirtualTreeview

From: "Roland" [Beduerftig@S...]
Date: Mon Oct 15, 2001 6:48 am
Subject: Re: New file uploaded to VirtualTreeview

Hello to all,
>
> This email message is a notification to let you know that
> a file has been uploaded to the Files area of the VirtualTreeview
> group.
>
> File : /DCR_complet_with_HeaderPopup.zip
> Uploaded by : [Beduerftig@S...]
> Description : Bitmap (DCR) for HeaderPopup
>
> You can access this file at the URL

I am added the Bitmap for VTHeaderPopup in the file area, now this
component will looks like a family of Vxxx-components.

regards
Roland


re: Re: Drag and Drop (Example uploaded)

From: "Helge Jung \(ECO-Logic\)" [helge@e...]
Date: Mon Oct 15, 2001 8:57 am
Subject: Re: [VirtualTreeview] Re: Drag and Drop (Example uploaded)

> > They are set to True in both VirtualStringTrees. But it isn't
> > working... may I send you my tiny program (as source) so you
> > can have a look at
>
> Upload it to the Files area
>

Ok, I did: http://groups.yahoo.com/group/VirtualTreeview/files/Misc/

Sorry, this comes a bit late, but I had some problems with my internet
connnection during the last days. The complete problem was that I want to
drag an entry from the top VST to the bottom VST (only copy, not move). But
I had some difficulties.

In the ZIP file there's a short Information. Don't be afraid of a missing
TVTColors.HeaderColor - that's my tiny change which I "discussed" here some
days ago and can be ignored, too.

Thanks for your time,
Helge.


New file uploaded to VirtualTreeview

From: [VirtualTreeview@yahoogroups.com>
Date: Mon Oct 15, 2001 9:49 am
Subject: New file uploaded to VirtualTreeview

Hello,

This email message is a notification to let you know that
a file has been uploaded to the Files area of the VirtualTreeview
group.

File : /Descendants/VirtualStuff2.zip
Uploaded by : [wvd_vegt@k...]
Description : VT based TStringList/Ini file Viewers + TTreeNodes/TListItems
emulation with src.

You can access this file at the URL

http://groups.yahoo.com/group/VirtualTreeview/files/Descendants/VirtualStuff2.zi\
p

To learn more about file sharing for your group, please visit

http://help.yahoo.com/help/us/groups/files

Regards,

wvd_vegt@k...]


re: New file uploaded to VirtualTreeview

From: "Wim van der Vegt" [wvd_vegt@k...]
Date: Mon Oct 15, 2001 10:12 am
Subject: Re: [VirtualTreeview] New file uploaded to VirtualTreeview

Hi,

My upload contains a number of descendants that might be usefull (either to use
them or as a samples of how to create decendants).

The package contains 3 descendants (TVirtualMemo, TVirtialNumberedMemo and
TVirtualList) that show a TStringList member in various ways (as a plain list,
a numbered list and in 2 columns based on names/values of the TstringList). In
all cases the internal GetText event handler is tied directly to the
TStringList for data retrieval.

Furthermore, VirtualIniTree is a Ini File Viewer that shows an ini file as a 2
column tree. This one is very virtual as the internal GetText is tied directly
to the Ini File Api and thus no data is stored internally in this component
(other than setting the rootnodecount). On Windows NT it's slow and can show
more than the ini file itself contains as NT can store parts of ini files in
the registry.

The third example (TVirtualStringTreeData) is a descandant that emulates both
the Nodes & Items of the TTreeView and TListView (ie a TTreeNodes and a
TListItems collections). This allows a quicker port from the MS controls to VT.
Note that this component isn't completely finished (I would like to emulate
more like the selected property etc too). Due to differences between the two
emulated collections one should take care when mixing the two in use (it's
allowed though) as a TListItems always works with indexes and a TTreeNodes
always works on a TTreeNode (so an object).

In all cases the Nodes collection should not be used for manipluations as the
objects and their data will go out of sync.

All components (especially the TVirtualStringTreeData) are lightly tested but
not fully debugged and ready so usage is at your own risk. If you find
bugs/ommissions or can tell me why the editing on designtime of the
TVirtualStringTreeData fails let me know.

So again, have fun with them and let me know your opinion.

----------------
Wim van der Vegt
----- Original Message -----
From: [VirtualTreeview@yahoogroups.com
To: [VirtualTreeview@yahoogroups.com
Sent: Monday, October 15, 2001 11:49 AM
Subject: [VirtualTreeview] New file uploaded to VirtualTreeview

Hello,

This email message is a notification to let you know that
a file has been uploaded to the Files area of the VirtualTreeview
group.

File : /Descendants/VirtualStuff2.zip
Uploaded by : wvd_vegt@k...]
Description : VT based TStringList/Ini file Viewers + TTreeNodes/TListItems
emulation with src.

You can access this file at the URL

http://groups.yahoo.com/group/VirtualTreeview/files/Descendants/VirtualStuff2.zi\
p

To learn more about file sharing for your group, please visit

http://help.yahoo.com/help/us/groups/files

Regards,

wvd_vegt@k...]

To unsubscribe from this group, send an email to:
VirtualTreeview-unsubscribe@egroups.com

Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.

[Non-text portions of this message have been removed]


Working Drag and drop demo

From: [jogador3@y...]
Date: Mon Oct 15, 2001 10:13 am
Subject: Working Drag and drop demo

Hi!

Does anyboby has a working (for version 2.5.34) drag and drop demo?

Thanks,

Trevis

 | Replies | Author | Date
4143 | Re: Working Drag and drop demo | Mike Lischke | Sat 10/20/2001


[no subject]

From: [rhymebusta@h...]
Date: Mon Oct 15, 2001 4:16 pm
Subject:

hi i was wondering if anybody knew how to change the text of a node.
The TVirtualNode struct/record has no "text" field and i can't find
any functions/methods for the VirtualString that allows one to change
the text of a specific node.


Drag'nDrop, Please help...

From: [robertlau_z@y...]
Date: Mon Oct 15, 2001 4:21 pm
Subject: Drag'nDrop, Please help...

hello everyone,
I had a problem with the Drag'nDrop (node moving) implementation in
release Version 2.5.34
it seems that on node moving never calls the onsave and onload prior
to node moving so user could get its own data to define whether the
move is valid or not. I changed the MoveTo (I should have override
but it is not virtual) from the base to reflect the way that was
working for copyto and it works correctly.
Please let me know if there are any better way to do it or if this is
ok?

here is the modified ver:

procedure TBaseVirtualTree.MoveTo(Source, Target: PVirtualNode; Mode:
TVTNodeAttachMode; ChildrenOnly: Boolean);
Var
TargetTree: TBaseVirtualTree;
Allowed: Boolean;
NewNode: PVirtualNode;
Stream: TMemoryStream;

begin
Assert(TreeFromNode(Source) = Self, 'The source tree must contain
the source node.');

if (Mode <> amNowhere) and Assigned(Source) and (Source <> FRoot)
and (Source <> Target) then
begin
if Target = nil then
begin
TargetTree := Self;
Target := FRoot;
Mode := amAddChildFirst;
end
else
TargetTree := TreeFromNode(Target);

if Target = TargetTree.FRoot then
begin
case Mode of
amInsertBefore:
Mode := amAddChildFirst;
amInsertAfter:
Mode := amAddChildLast;
end;
end;

Stream := TMemoryStream.Create;
try
if not ChildrenOnly then
WriteNode(Stream, Source)
else
begin
Source := Source.FirstChild;
while Assigned(Source) do
begin
WriteNode(Stream, Source);
Source := Source.NextSibling;
end;
end;
TargetTree.BeginUpdate;
try
Stream.Position := 0;
while Stream.Position < Stream.Size do
begin
NewNode := TargetTree.InsertNode(Target, Mode);
TargetTree.InternalAddFromStream(Stream,
VTTreeStreamVersion, NewNode);
end;
finally
TargetTree.EndUpdate;
end;
finally
Stream.Free;
end;
if Target = TargetTree.FRoot then
Allowed := DoNodeMoving(NewNode, nil)
else
Allowed := DoNodeMoving(NewNode, Target);

if Allowed then
begin
BeginUpdate;
try
if ChildrenOnly then
DeleteChildren(Source)
else
DeleteNode(Source);
finally
EndUpdate;
end;
DoNodeMoved(NewNode);
end
else
DeleteNode(NewNode);
InvalidateCache;
if (FUpdateCount = 0) and Allowed then
begin
ValidateCache;
UpdateScrollBars(True);
Invalidate;
if TargetTree <> Self then
TargetTree.Invalidate;
StructureChange(Source, crNodeMoved);
end
else
Include(FStates, tsStructureChangePending);
end;
end;

 | Replies | Author | Date
4157 | Re: Drag'nDrop, Please help... | Mike Lischke | Sun 10/21/2001
4188 | Re: Drag'nDrop, Please help... | [robertlau_z@y...] | Mon 10/22/2001
4228 | Re: Drag'nDrop, Please help... | Mike Lischke | Tue 10/23/2001
4309 | Copying part of a tree to another tree | Franc van de Westelaken | Sat 10/27/2001
4321 | Re: Copying part of a tree to another tree | Mike Lischke | Sun 10/28/2001
4323 | Re: Copying part of a tree to another tree | Franc van de Westelaken | Sun 10/28/2001
4331 | Re: Copying part of a tree to another tree | Paul D'Agosta | Mon 10/29/2001


Changing TvirtualNode text or changin a Node's text in a tree

From: [rhymebusta@h...]
Date: Mon Oct 15, 2001 4:21 pm
Subject: Changing TvirtualNode text or changin a Node's text in a tree

Sorry i forgot to put the subject when i first posted this.

hi i was wondering if anybody knew how to change the text of a node.
The TVirtualNode struct/record has no "text" field and i can't find
any functions/methods for the VirtualString that allows one to change
the text of a specific node.

 | Replies | Author | Date
4028 | Re: Changing TvirtualNode text or changin a Node' | [rhymebusta@h...] | Mon 10/15/2001
4029 | Re: Changing TVirtualNode text or changin a Node' | Helge Jung (ECO-Logic) | Mon 10/15/2001
4030 | Re: Changing TVirtualNode text or changin a Node' | Helge Jung (ECO-Logic) | Mon 10/15/2001
4031 | Re: Changing TVirtualNode text or changin a Node' | [rhymebusta@h...] | Mon 10/15/2001
4032 | Re: Node text (URLs of the YG) | Helge Jung (ECO-Logic) | Mon 10/15/2001
4033 | Re: Node text (URLs of the YG) | [rhymebusta@h...] | Mon 10/15/2001
4037 | Re: Changing TvirtualNode text or changin a Node' | Werner Lehmann | Mon 10/15/2001


re: Changing TvirtualNode text or changin a Node's text in a tree

From: [rhymebusta@h...]
Date: Mon Oct 15, 2001 4:23 pm
Subject: Re: Changing TvirtualNode text or changin a Node's text in a tree

--- In [VirtualTreeview@y...], [rhymebusta@h...] wrote:
> Sorry i forgot to put the subject when i first posted this.
>
> hi i was wondering if anybody knew how to change the text of a node.
> The TVirtualNode struct/record has no "text" field and i can't find
> any functions/methods for the VirtualString that allows one to
change
> the text of a specific node.

i meant VirtualStringTree not VirtualString


re: Changing TVirtualNode text or changin a Node's text in a tree

From: "Helge Jung \(ECO-Logic\)" [helge@e...]
Date: Mon Oct 15, 2001 4:50 pm
Subject: Re: [VirtualTreeview] Changing TVirtualNode text or changin a Node's text in a tree

> hi i was wondering if anybody knew how to change the text of a node.
> The TVirtualNode struct/record has no "text" field and i can't find
> any functions/methods for the VirtualStringTree that allows one to
> change the text of a specific node.
>

I suppose you look in the help file of VST (available in the Files-Section
of the YG). There's an article called "Getting started" or "First steps" -
that should help you on the way: you see the definition of your own data
structure and the use of the OnGetText event - for a first test, simply set
the Text variable in OnGetText to something you like (e.g. "Text := IntToStr
(Node^.Index);").

VT is virtual - that means that all Images and texts is assigned when
needed - you can store the data of a node and read it when you need to give
the tree the information it needs. Again: Read that instruction in the help
file.

Helge.

 | Replies | Author | Date
4030 | Re: Changing TVirtualNode text or changin a Node' | Helge Jung (ECO-Logic) | Mon 10/15/2001
4031 | Re: Changing TVirtualNode text or changin a Node' | [rhymebusta@h...] | Mon 10/15/2001
4032 | Re: Node text (URLs of the YG) | Helge Jung (ECO-Logic) | Mon 10/15/2001
4033 | Re: Node text (URLs of the YG) | [rhymebusta@h...] | Mon 10/15/2001


re: Changing TVirtualNode text or changin a Node's text in a tree

From: "Helge Jung \(ECO-Logic\)" [helge@e...]
Date: Mon Oct 15, 2001 4:53 pm
Subject: Re: [VirtualTreeview] Changing TVirtualNode text or changin a Node's text in a tree

> I suppose you look in the help file of VST (available in the Files-Section
> of the YG).

Damn... I meant "I suggest you look in the help file of VST..." - sorry ;-))

Helge.


re: Changing TVirtualNode text or changin a Node's text in a tree

From: [rhymebusta@h...]
Date: Mon Oct 15, 2001 5:12 pm
Subject: Re: Changing TVirtualNode text or changin a Node's text in a tree

--- In [VirtualTreeview@y...], "Helge Jung \(ECO-Logic\)" [helge@e...]
wrote:
> > hi i was wondering if anybody knew how to change the text of a
node.
> > The TVirtualNode struct/record has no "text" field and i can't
find
> > any functions/methods for the VirtualStringTree that allows one to
> > change the text of a specific node.
> >
>
> I suppose you look in the help file of VST (available in the Files-
Section
> of the YG). There's an article called "Getting started" or "First
steps" -
> that should help you on the way: you see the definition of your own
data
> structure and the use of the OnGetText event - for a first test,
simply set
> the Text variable in OnGetText to something you like (e.g. "Text :=
IntToStr
> (Node^.Index);").
>
> VT is virtual - that means that all Images and texts is assigned
when
> needed - you can store the data of a node and read it when you need
to give
> the tree the information it needs. Again: Read that instruction in
the help
> file.
>
> Helge.

sorry if this sounds stupid but....i downloaded the latest version
(v2.4) of VirtualTree and the help files that came with it, which
aren't very helpful. I also don't know what u mean by the Files-
Section of YG...what does YG stand for?

 | Replies | Author | Date
4032 | Re: Node text (URLs of the YG) | Helge Jung (ECO-Logic) | Mon 10/15/2001
4033 | Re: Node text (URLs of the YG) | [rhymebusta@h...] | Mon 10/15/2001


re: Re: Node text (URLs of the YG)

From: "Helge Jung \(ECO-Logic\)" [helge@e...]
Date: Mon Oct 15, 2001 5:21 pm
Subject: Re: [VirtualTreeview] Re: Node text (URLs of the YG)

> sorry if this sounds stupid but....i downloaded the latest version
> (v2.4) of VirtualTree and the help files that came with it, which
> aren't very helpful. I also don't know what u mean by the Files-
> Section of YG...what does YG stand for?
>

YG stands for YahooGroups ... the service you're currently using...

Here is the link to the YG itself:
http://groups.yahoo.com/group/VirtualTreeview

Here is the Files-Section (or -Area, I don't know exactly):
http://groups.yahoo.com/group/VirtualTreeview/files

Here's the direct link to the help file:
http://groups.yahoo.com/group/VirtualTreeview/files/Help/Virtual%20Tree%20He
lp.zip

Helge.

 | Replies | Author | Date
4033 | Re: Node text (URLs of the YG) | [rhymebusta@h...] | Mon 10/15/2001


re: Node text (URLs of the YG)

From: [rhymebusta@h...]
Date: Mon Oct 15, 2001 5:28 pm
Subject: Re: Node text (URLs of the YG)

--- In [VirtualTreeview@y...], "Helge Jung \(ECO-Logic\)" [helge@e...]
wrote:
> > sorry if this sounds stupid but....i downloaded the latest version
> > (v2.4) of VirtualTree and the help files that came with it, which
> > aren't very helpful. I also don't know what u mean by the Files-
> > Section of YG...what does YG stand for?
> >
>
> YG stands for YahooGroups ... the service you're currently using...
>
> Here is the link to the YG itself:
> http://groups.yahoo.com/group/VirtualTreeview
>
> Here is the Files-Section (or -Area, I don't know exactly):
> http://groups.yahoo.com/group/VirtualTreeview/files
>
> Here's the direct link to the help file:
> http://groups.yahoo.com/group/VirtualTreeview/files/Help/Virtual%
20Tree%20He
> lp.zip

my bad.......thanks...i'll take a look there.
>
> Helge.


User changing Node Text

From: [rhymebusta@h...]
Date: Mon Oct 15, 2001 6:46 pm
Subject: User changing Node Text

hi i was wondering how come the text that the user enters into the
Node's text field doesn't stay....it reverts to the default text
of "Node" or whatever is placed in the Default Text property.
Is there flags that i'm missing that aren't allowing the text to
remain? or do i have to handle some event callback?

 | Replies | Author | Date
4035 | Re: User changing Node Text | Helge Jung (ECO-Logic) | Mon 10/15/2001
4036 | Re: User changing Node Text | Jim Kueneman | Mon 10/15/2001
4038 | Re: User changing Node Text | Werner Lehmann | Mon 10/15/2001
4039 | Re: User changing Node Text | Helge Jung (ECO-Logic) | Mon 10/15/2001
4144 | Re: User changing Node Text | Mike Lischke | Sat 10/20/2001
4040 | Re: User changing Node Text | [rhymebusta@h...] | Mon 10/15/2001
4041 | Re: User changing Node Text | Jim Kueneman | Tue 10/16/2001
4060 | Re: User changing Node Text | [rhymebusta@h...] | Tue 10/16/2001


re: User changing Node Text

From: "Helge Jung \(ECO-Logic\)" [helge@e...]
Date: Mon Oct 15, 2001 7:11 pm
Subject: Re: [VirtualTreeview] User changing Node Text

> hi i was wondering how come the text that the user enters into the
> Node's text field doesn't stay....it reverts to the default text
> of "Node" or whatever is placed in the Default Text property.
> Is there flags that i'm missing that aren't allowing the text to
> remain? or do i have to handle some event callback?
>

Of course you have to handle some events: OnEdited, OnEditing,
OnEditCancelled, OnCreateEditor and maybe there are some more (just of my
mind). The only one needed for you in the moment should be OnCreateEditor -
in the Files-Section Jim has uploaded a demo for EditLinks a while ago...
they should help you to understand how the stuff works.

Helge.

 | Replies | Author | Date
4036 | Re: User changing Node Text | Jim Kueneman | Mon 10/15/2001


re: User changing Node Text

From: "Jim Kueneman" [jimdk@m...]
Date: Mon Oct 15, 2001 7:41 pm
Subject: Re: User changing Node Text

--- In [VirtualTreeview@y...], "Helge Jung \(ECO-Logic\)" [helge@e...]
wrote:
> > hi i was wondering how come the text that the user enters into the
> > Node's text field doesn't stay....it reverts to the default text
> > of "Node" or whatever is placed in the Default Text property.
> > Is there flags that i'm missing that aren't allowing the text to
> > remain? or do i have to handle some event callback?
> >
>

Don't forget that the tree knows nothing of the text right? It does
not store *anything* so of course you have to trap the change and
modify your data so the update is reflected. The OnEditxxx events
are what you need to look at as Helge suggested.

Also do yourself a favor and download the latest version from the YG
2.4.40 or so, there are a fair amount of changes. Mike is planning
on the offical release very soon.

Jim


re: Changing TvirtualNode text or changin a Node's text in a tree

From: Werner Lehmann [wl@b...]
Date: Mon Oct 15, 2001 6:32 pm
Subject: Re: [VirtualTreeview] Changing TvirtualNode text or changin a Node's text in a tree

[rhymebusta@h...] wrote:
>
> hi i was wondering if anybody knew how to change the text of a node.
> The TVirtualNode struct/record has no "text" field and i can't find
> any functions/methods for the VirtualString that allows one to change
> the text of a specific node.

Change the text in your data structure (Node record or whatever) and call
InvalidateNode() with the appropriate PVirtualNode.

Werner


re: User changing Node Text

From: Werner Lehmann [wl@b...]
Date: Mon Oct 15, 2001 7:40 pm
Subject: Re: [VirtualTreeview] User changing Node Text

"Helge Jung (ECO-Logic)" wrote:
>
> > hi i was wondering how come the text that the user enters into the
> > Node's text field doesn't stay....it reverts to the default text
> > of "Node" or whatever is placed in the Default Text property.
> > Is there flags that i'm missing that aren't allowing the text to
> > remain? or do i have to handle some event callback?
> >
>
> Of course you have to handle some events: OnEdited, OnEditing,
> OnEditCancelled, OnCreateEditor and maybe there are some more (just of my
> mind). The only one needed for you in the moment should be OnCreateEditor -
> in the Files-Section Jim has uploaded a demo for EditLinks a while ago...
> they should help you to understand how the stuff works.

I would say onyl the OnNewText event is needed. Store the edited text in your
data record. That's all.

Werner

 | Replies | Author | Date
4039 | Re: User changing Node Text | Helge Jung (ECO-Logic) | Mon 10/15/2001
4144 | Re: User changing Node Text | Mike Lischke | Sat 10/20/2001
4040 | Re: User changing Node Text | [rhymebusta@h...] | Mon 10/15/2001
4041 | Re: User changing Node Text | Jim Kueneman | Tue 10/16/2001
4060 | Re: User changing Node Text | [rhymebusta@h...] | Tue 10/16/2001


re: User changing Node Text

From: "Helge Jung \(ECO-Logic\)" [helge@e...]
Date: Mon Oct 15, 2001 8:38 pm
Subject: Re: [VirtualTreeview] User changing Node Text

> I would say only the OnNewText event is needed. Store the edited
> text in your data record. That's all.
>

Cool. I didn't know about that - okay, I haven't thought about OnNewText
until now, anyway ;-))

Thanks for the information,
Helge.

 | Replies | Author | Date
4144 | Re: User changing Node Text | Mike Lischke | Sat 10/20/2001


re: User changing Node Text

From: [rhymebusta@h...]
Date: Mon Oct 15, 2001 9:36 pm
Subject: Re: User changing Node Text

--- In [VirtualTreeview@y...], Werner Lehmann [wl@b...] wrote:
> "Helge Jung (ECO-Logic)" wrote:
> >
> > > hi i was wondering how come the text that the user enters into
the
> > > Node's text field doesn't stay....it reverts to the default text
> > > of "Node" or whatever is placed in the Default Text property.
> > > Is there flags that i'm missing that aren't allowing the text to
> > > remain? or do i have to handle some event callback?
> > >
> >
> > Of course you have to handle some events: OnEdited, OnEditing,
> > OnEditCancelled, OnCreateEditor and maybe there are some more
(just of my
> > mind). The only one needed for you in the moment should be
OnCreateEditor -
> > in the Files-Section Jim has uploaded a demo for EditLinks a
while ago...
> > they should help you to understand how the stuff works.
>
> I would say onyl the OnNewText event is needed. Store the edited
text in your
> data record. That's all.
>
> Werner

right now i'm only testing things out......i don't need to store any
info.... i just want to know how to be able to display(keep) the same
text in the node that the user entered.

 | Replies | Author | Date
4041 | Re: User changing Node Text | Jim Kueneman | Tue 10/16/2001
4060 | Re: User changing Node Text | [rhymebusta@h...] | Tue 10/16/2001


re: Re: User changing Node Text

From: Jim Kueneman [jimdk@m...]
Date: Tue Oct 16, 2001 2:18 am
Subject: Re: [VirtualTreeview] Re: User changing Node Text

>right now i'm only testing things out......i don't need to store any
>info.... i just want to know how to be able to display(keep) the same
>text in the node that the user entered.

You are missing the point of VT. It works under the notion that only you
know what it should display. It stores *nothing*. Default text property
is not anything like the Text or Caption property you are use to in the
VCL. It is only there to make the node have something displayed if you
don't supply it with text.

You MUST use the OnGetText and YOU must store any strings. The usual way
to use VT is to declare a record that holds your data like:

PMyData = ^TMyData;
TMyData = record
NodeString: string;
NodeImage: integer
end;

Now tell VT the size of this structure with NodeDataSize and get a pointer
to the data structure for each node with GetNodeData.

Download this minimal example and study it.

http://groups.yahoo.com/group/VirtualTreeview/files/Examples/Delphi_Examples/Mis\
c_Examples/VT_Basics.zip

To change the text respond to OnNewText, per Werner, get the pointer to the
data with GetNodeData

var
Data := PMyData;
begin
Data := PMyData( GetNodeData(Node));
Data. NodeString := Text;
InvalidateNode(Node);
end

now the next time VT calls OnGetText when you get the string to display it
will be the new text.

This all may seem weird at first but after you understand it you will not
go back to TTreeview or TListview.

Jim

 | Replies | Author | Date
4060 | Re: User changing Node Text | [rhymebusta@h...] | Tue 10/16/2001


Turning off the OLE drag alpha blended image.

From: [subscribedlists@b...]
Date: Tue Oct 16, 2001 3:42 am
Subject: Turning off the OLE drag alpha blended image.

Does any one know how to do OLE drag-and-drop without
having to use the alpha blended images. I need to use
the standard drag-and-drop cursors.

Is there a setting that turns off the alpha blended
drag-and-drop images? I still need the alpha blending
for dragging columns. I just want to change it to
the old standard cursors for dragging nodes around.

Thanks,

Doug

 | Replies | Author | Date
4043 | Re: Turning off the OLE drag alpha blended image. | Jim Kueneman | Tue 10/16/2001


re: Turning off the OLE drag alpha blended image.

From: Jim Kueneman [jimdk@m...]
Date: Tue Oct 16, 2001 4:36 am
Subject: Re: [VirtualTreeview] Turning off the OLE drag alpha blended image.

At 03:42 AM 10/16/2001 +0000, you wrote:
>Does any one know how to do OLE drag-and-drop without
>having to use the alpha blended images. I need to use
>the standard drag-and-drop cursors.
>
>Is there a setting that turns off the alpha blended
>drag-and-drop images? I still need the alpha blending
>for dragging columns. I just want to change it to
>the old standard cursors for dragging nodes around.

Are you talking about the DragImageKind property ? Set that to diNoImage
to get rid of the drag image. If you are talking about using your own
image I am not sure if you can do that or not.

Jim


Pin Pointing Nodes inVT

From: [fitz12345uk@y...]
Date: Tue Oct 16, 2001 7:17 am
Subject: Pin Pointing Nodes inVT

Hi could sombody give me an example of how to find/identify nodes in
a VT.

The reason I am asking is because I am placing a whole bunch of
AddChilds in a recursive loop. Now when I add a child I need to be
able to say 'Parent =', I will have no way of knowing this except
through the information stored in the node how can I code.....

AddChild(Tree1.Node.ID, NewNode) //this points to the correct parent
node and adds its child.

Hope that made sense,
Cheers

 | Replies | Author | Date
4045 | Re: Pin Pointing Nodes inVT | Vandrovec Milan | Tue 10/16/2001
4048 | Re: Pin Pointing Nodes inVT | [fitz12345uk@y...] | Tue 10/16/2001
4049 | Re: Pin Pointing Nodes inVT | Bender Heri | Tue 10/16/2001
4065 | Re: Pin Pointing Nodes inVT | [subscribedlists@b...] | Wed 10/17/2001


re: Pin Pointing Nodes inVT

From: Vandrovec Milan [milan_va@s...]
Date: Tue Oct 16, 2001 7:39 am
Subject: RE: [VirtualTreeview] Pin Pointing Nodes inVT

Hi.

> AddChilds in a recursive loop. Now when I add a child I need to be
> able to say 'Parent =', I will have no way of knowing this except
> through the information stored in the node how can I code.....
>
> AddChild(Tree1.Node.ID, NewNode) //this points to the correct parent
> node and adds its child.
>
> Hope that made sense,

I am not sure what you need. Why TVirtualNode.Parent is not enough for you?

Milan

 | Replies | Author | Date
4048 | Re: Pin Pointing Nodes inVT | [fitz12345uk@y...] | Tue 10/16/2001


Unicode and VirtualStringTree

From: [MJLeaver@n...]
Date: Tue Oct 16, 2001 7:49 am
Subject: Unicode and VirtualStringTree

I'll say up front that I am totally clueless about Unicode.
Absolutely know nothing about it.

I want to use the IME in Windows 2000 Professional (English
version) to edit a node and type in Chinese characters. At
the moment it always displays the text as question marks
(e.g. '???')

Do I need to set the component to use some special font?
Any special settings? Something to do in Windows?

I realise that I still need to retrieve and store the
Unicode in a database (going to be a bit of a problem
because I use BDE - will switch to ADO), but thats for
another day.

Thanks for any help!

 | Replies | Author | Date
4159 | Re: Unicode and VirtualStringTree | Mike Lischke | Sun 10/21/2001


BUG: copying to clipboard

From: Oleg Kraynov [olegvkr@y...]
Date: Tue Oct 16, 2001 9:08 am
Subject: BUG: copying to clipboard

Hi

At copying to clipboard if there are invisible columns, header is copied
correct, but nodes wrong.
The data of nodes are copied without checking the Column.Options coVisible.

--
Best regards,
Oleg

_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com

 | Replies | Author | Date
4161 | Re: BUG: copying to clipboard | Mike Lischke | Sun 10/21/2001


re: Pin Pointing Nodes inVT

From: [fitz12345uk@y...]
Date: Tue Oct 16, 2001 9:11 am
Subject: Re: Pin Pointing Nodes inVT

OK sorry I am probably not explaining very well, firstly can I tell
you that I am a new user of VT so maybe something you think might be
obvious is what I need to know.

If I have a record structure assigned to each node that includes an
ID value lets say. When I come to add a new child my only point of
reference of which node that child belongs to is that ID value. So
without parsing through the whole of the tree, assigning the pointer
then checking the record value how do I call the correct node.

If you still don't know what I'm talking about, could you perhaps
show some example code of how you would call 'AddChild' to a specific
node without using the GetLast or GetFocused or any such call like
that.

Hope I made myself at least a little clearer.


re: Re: Pin Pointing Nodes inVT

From: Bender Heri [HBender@E...]
Date: Tue Oct 16, 2001 9:32 am
Subject: RE: [VirtualTreeview] Re: Pin Pointing Nodes inVT

> If I have a record structure assigned to each node that includes an
> ID value lets say. When I come to add a new child my only point of
> reference of which node that child belongs to is that ID value. So
> without parsing through the whole of the tree, assigning the pointer
> then checking the record value how do I call the correct node.

I think this is the way to go. Parsing the whole tree until you find the
node with the desired ID.

If this is too time consuming you have to maintain an index yourself with a
reference to the PVirtualNode.

Unless the tree is very big, this parsing does not take that amount of time
to worry about.

Heri

>
> If you still don't know what I'm talking about, could you perhaps
> show some example code of how you would call 'AddChild' to a specific
> node without using the GetLast or GetFocused or any such call like
> that.
>
> Hope I made myself at least a little clearer.
>
>
>
>
> ------------------------ Yahoo! Groups Sponsor
> ---------------------~-->
> Get your FREE VeriSign guide to security solutions for your
> web site: encrypting transactions, securing intranets, and more!
> http://us.click.yahoo.com/UnN2wB/m5_CAA/yigFAA/i7folB/TM
> --------------------------------------------------------------
> -------~->
>
> To unsubscribe from this group, send an email to:
> [VirtualTreeview-unsubscribe@egroups.com
>
>
>
> Your use of Yahoo! Groups is subject to
> http://docs.yahoo.com/info/terms/
>
>

Replies Author Date


BUG(BCB5): Text & wchar_t

From: Oleg Kraynov [olegvkr@y...]
Date: Tue Oct 16, 2001 9:57 am
Subject: BUG(BCB5): Text & wchar_t

Hi,

OnGetText (... WideString& Text)
Text = "Data"; (const char*) - all OK!
--
Text = L"Data"; (const wchar_t*)

AuoFit main column on double click:
Show the raw data of nodes in this column!!!

--
Best regards,
Oleg

_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com

 | Replies | Author | Date
4162 | Re: BUG(BCB5): Text & wchar_t | Mike Lischke | Sun 10/21/2001
4170 | Re[2]: [VirtualTreeview] BUG(BCB5): Text & wchar_ | Oleg Kraynov | Sun 10/21/2001


for older history see help file

From: "Moritz Franckenstein" [franckenstein@a...]
Date: Tue Oct 16, 2001 10:36 am
Subject: for older history see help file

hi mike,

in virtualtrees.pas you say "for older history see help file"; could
you put this history somewhere (or let it stay in the .pas file for
longer) until the helpfile is available? or did i oversee something?

currently, i wonder where to find a note about the csChecked ->
csCheckedNormal renaming... or wasnt there any?

thanks,
-moritz

 | Replies | Author | Date
4052 | Re: for older history see help file | Moritz Franckenstein | Tue 10/16/2001
4053 | DBVT For Delphi 6 | prog-fr | Tue 10/16/2001
4147 | Re: for older history see help file | Mike Lischke | Sat 10/20/2001


re: for older history see help file

From: "Moritz Franckenstein" [franckenstein@a...]
Date: Tue Oct 16, 2001 10:48 am
Subject: Re: for older history see help file

does anyone have a vt version between 2.5.34 and 2.5.40 ?

history:

// 01-OCT-2001 ml:
// - synchronous update mode (BeginSynch, EndSynch, tsSynch,
usBeginSynch, usSynch, usEndSynch)
// - toReportMode in TreeOptions.MiscOptions
// - TVTDropMarkMode for header custom draw
// 30-SEP-2001 ml:
// - small changes

??? something missing ???

// 16-SEP-2001:
// - CanShowDragImage is now virtual
// - changes to provide a drag image of the tree without showing it
(for descentants which have own image handling)
// 15-SEP-2001:
...

 | Replies | Author | Date
4053 | DBVT For Delphi 6 | prog-fr | Tue 10/16/2001


DBVT For Delphi 6

From: prog-fr [prog-fr@n...]
Date: Tue Oct 16, 2001 12:18 pm
Subject: DBVT For Delphi 6

I am searching DBVT for Delphi 6 ...


Installing 2.5.4 in BCB5

From: [rhymebusta@h...]
Date: Tue Oct 16, 2001 1:43 pm
Subject: Installing 2.5.4 in BCB5

Hi i was wondering if anybody had come across a problem installing
v2.5.4 in BCB5 before.
I followed the instructions in the readme file( from
VT2.5.40_for_CPPB.zip that is supplied in the YG) but when i get to
the last step of: 6. Compile and Install VirtualTreeViewD.bpk
there is a compiling error that i don't understand.
the error says:
[Pascal Fatal Error] VirtualTreesReg.pas(15): File not
found: 'DsgnIntf.dcu'
what the hell is that? what file is it looking for? i remember that i
had the same problem when i tried installing TreeNT but i had no
problems when i installed VT v2.0 or 2.4

thanks

 | Replies | Author | Date
4057 | Re: Installing 2.5.4 in BCB5 | Vandrovec Milan | Tue 10/16/2001
4058 | Re: Installing 2.5.4 in BCB5 | [rhymebusta@h...] | Tue 10/16/2001
4059 | Re: Installing 2.5.4 in BCB5 | [rhymebusta@h...] | Tue 10/16/2001
4061 | Re: Installing 2.5.4 in BCB5 | Oleg Kraynov | Tue 10/16/2001
4074 | Re: Installing 2.5.4 in BCB5 | Vandrovec Milan | Wed 10/17/2001
4083 | Re: Installing 2.5.4 in BCB5 | [rhymebusta@h...] | Wed 10/17/2001
4093 | Re: Installing 2.5.4 in BCB5 | [rhymebusta@h...] | Thu 10/18/2001
4094 | Re: Installing 2.5.4 in BCB5 | Vandrovec Milan | Thu 10/18/2001
4102 | Re: Installing 2.5.4 in BCB5 | [rhymebusta@h...] | Fri 10/19/2001


Licensing?

From: Sanjay Kanade [skanade@v...]
Date: Tue Oct 16, 2001 3:17 pm
Subject: Licensing?

This component is great and I want to use it in my commercial application
(EXE only). what I need to do for licensing? I can't make sense of the
license. Can someone simplify it for me in one sentence? If I make no
modifications to it and use it in my EXE, what do I need to do?

 | Replies | Author | Date
4056 | Re: Licensing? | Werner Lehmann | Tue 10/16/2001
4163 | Re: Licensing? | Mike Lischke | Sun 10/21/2001


re: Licensing?

From: Werner Lehmann [wl@b...]
Date: Tue Oct 16, 2001 3:16 pm
Subject: Re: [VirtualTreeview] Licensing?

Hi Sanjay,

> This component is great and I want to use it in my commercial application
> (EXE only). what I need to do for licensing? I can't make sense of the
> license. Can someone simplify it for me in one sentence? If I make no
> modifications to it and use it in my EXE, what do I need to do?

Nothing else. Use it, maybe give credit to Mike, but do not redistribute
a changed source. AFAIK.

Werner

 | Replies | Author | Date
4163 | Re: Licensing? | Mike Lischke | Sun 10/21/2001


re: Installing 2.5.4 in BCB5

From: Vandrovec Milan [milan_va@s...]
Date: Tue Oct 16, 2001 3:39 pm
Subject: RE: [VirtualTreeview] Installing 2.5.4 in BCB5

Hi.

> [Pascal Fatal Error] VirtualTreesReg.pas(15): File not
> found: 'DsgnIntf.dcu'
> what the hell is that? what file is it looking for? i remember that i
> had the same problem when i tried installing TreeNT but i had no
> problems when i installed VT v2.0 or 2.4

If you have professional or Enterprise edition, then add
$(BCB)\Source\ToolsAPI and
$(BCB)\Projects\Intermed
to your Library path (Tools-Environment Options-Library-Library Path), or to
the project's Include Path (it should be there already).

Probably the Projects\Intermed should do the trick, I will add it to the
readme if this is it.

If you have BCB Standard, then maybe someone else can explain us both how to
use the compiled dsnide50.bpi.

Milan Vandrovec

 | Replies | Author | Date
4058 | Re: Installing 2.5.4 in BCB5 | [rhymebusta@h...] | Tue 10/16/2001
4059 | Re: Installing 2.5.4 in BCB5 | [rhymebusta@h...] | Tue 10/16/2001
4061 | Re: Installing 2.5.4 in BCB5 | Oleg Kraynov | Tue 10/16/2001


re: Installing 2.5.4 in BCB5

From: [rhymebusta@h...]
Date: Tue Oct 16, 2001 5:12 pm
Subject: Re: Installing 2.5.4 in BCB5

> If you have professional or Enterprise edition, then add
> $(BCB)\Source\ToolsAPI and
> $(BCB)\Projects\Intermed
> to your Library path (Tools-Environment Options-Library-Library
Path), or to
> the project's Include Path (it should be there already).
>
> Probably the Projects\Intermed should do the trick, I will add it
to the
> readme if this is it.
>
> If you have BCB Standard, then maybe someone else can explain us
both how to
> use the compiled dsnide50.bpi.
>
> Milan Vandrovec

Does it matter that i'm using the trial version of BCB5 right now?
Borland says that it comes with all the features for 60 days.
hopefully it's not because i'm using the trial

 | Replies | Author | Date
4059 | Re: Installing 2.5.4 in BCB5 | [rhymebusta@h...] | Tue 10/16/2001
4061 | Re: Installing 2.5.4 in BCB5 | Oleg Kraynov | Tue 10/16/2001


re: Installing 2.5.4 in BCB5

From: [rhymebusta@h...]
Date: Tue Oct 16, 2001 5:24 pm
Subject: Re: Installing 2.5.4 in BCB5

--- In [VirtualTreeview@y...], [rhymebusta@h...] wrote:
> > If you have professional or Enterprise edition, then add
> > $(BCB)\Source\ToolsAPI and
> > $(BCB)\Projects\Intermed
> > to your Library path (Tools-Environment Options-Library-Library
> Path), or to
> > the project's Include Path (it should be there already).
> >
> > Probably the Projects\Intermed should do the trick, I will add it
> to the
> > readme if this is it.
> >
> > If you have BCB Standard, then maybe someone else can explain us
> both how to
> > use the compiled dsnide50.bpi.
> >
> > Milan Vandrovec
>
> Does it matter that i'm using the trial version of BCB5 right now?
> Borland says that it comes with all the features for 60 days.
> hopefully it's not because i'm using the trial

i tried what u said but it keeps giving the same error....it's on
line 19 of VirtualTreesReg.pas file here's the snippet of code:

unit VirtualTreesReg;

// This unit is an addendum to VirtualTrees.pas and contains code of
design time editors as well as
// for theirs and the tree's registration.

interface

{$include Compilers.inc}

{$IFDEF CPPB}
{$DEFINE dont_use_StrColnEdit} //in Delphi, you wont get Columns
editor registered with VT-doubleclick
{$ENDIF}

uses
Windows, Classes,
{$ifdef COMPILER_6+}
DesignIntf, DesignEditors, VCLEditors,
{$else}
DsgnIntf, <-----this is where the error that i stated
earlier occurs

 | Replies | Author | Date
4061 | Re: Installing 2.5.4 in BCB5 | Oleg Kraynov | Tue 10/16/2001


re: User changing Node Text

From: [rhymebusta@h...]
Date: Tue Oct 16, 2001 6:11 pm
Subject: Re: User changing Node Text

--- In [VirtualTreeview@y...], Jim Kueneman [jimdk@m...] wrote:
>
> >right now i'm only testing things out......i don't need to store
any
> >info.... i just want to know how to be able to display(keep) the
same
> >text in the node that the user entered.
>
>
> You are missing the point of VT. It works under the notion that
only you
> know what it should display. It stores *nothing*. Default text
property
> is not anything like the Text or Caption property you are use to in
the
> VCL. It is only there to make the node have something displayed if
you
> don't supply it with text.
>
> You MUST use the OnGetText and YOU must store any strings. The
usual way
> to use VT is to declare a record that holds your data like:
>
> PMyData = ^TMyData;
> TMyData = record
> NodeString: string;
> NodeImage: integer
> end;
>
> Now tell VT the size of this structure with NodeDataSize and get a
pointer
> to the data structure for each node with GetNodeData.
>
> Download this minimal example and study it.
>
>
http://groups.yahoo.com/group/VirtualTreeview/files/Examples/Delphi_Ex
amples/Misc_Examples/VT_Basics.zip
>
> To change the text respond to OnNewText, per Werner, get the
pointer to the
> data with GetNodeData
>
> var
> Data := PMyData;
> begin
> Data := PMyData( GetNodeData(Node));
> Data. NodeString := Text;
> InvalidateNode(Node);
> end
>
> now the next time VT calls OnGetText when you get the string to
display it
> will be the new text.
>
> This all may seem weird at first but after you understand it you
will not
> go back to TTreeview or TListview.
>
> Jim

No, i understand that the nodes have no text fields...i was just
wondering if there was any way to change the text without having to
create a struct.....guess not....no problem though.


re: Re: Installing 2.5.4 in BCB5

From: Oleg Kraynov [olegvkr@y...]
Date: Tue Oct 16, 2001 7:41 pm
Subject: Re: [VirtualTreeview] Re: Installing 2.5.4 in BCB5

rhc> uses
rhc> Windows, Classes,
rhc> {$ifdef COMPILER_6+}
rhc> DesignIntf, DesignEditors, VCLEditors,
rhc> {$else}
rhc> DsgnIntf, <-----this is where the error that i stated
rhc> earlier occurs

Error:
Open your VirtualTreesC5.bpk:
Find line:
<PFLAGS value=" ... ">
Add in this line
<PFLAGS value=" ... -LUdclstd50">

Columns editor:
If you add in your VirtualTreesC5D.bpk a module dsnide50.bpi, that can
delete from VirtualTreesReg.pas all {$ifndef CPPB} {$endif} -
you get Columns editor registered with VT-doubleclick.

--
Best regards,
Oleg

_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


Image above caption, possible?

From: [ljee@s...]
Date: Wed Oct 17, 2001 2:26 am
Subject: Image above caption, possible?

is it possible to have a image painted above the caption in a VT:

------------------------------
+---------------+
| I |
| M |
| A | > Some ITEM
| G |
| 1 E |
+---------------+
ITEM 1 - CAPTION
------------------------------
+---------------+
| I |
| M |
| A | > Another ITEM
| G |
| 2 E |
+---------------+
ITEM 2 - CAPTION

 | Replies | Author | Date
4067 | Re: Image above caption, possible? | Paul Istrate | Wed 10/17/2001
4080 | Re: Image above caption, possible? | [ljee@s...] | Wed 10/17/2001
4068 | Re: Image above caption, possible? | [subscribedlists@b...] | Wed 10/17/2001


Right justified columns?

From: Sanjay Kanade [skanade@v...]
Date: Wed Oct 17, 2001 5:50 am
Subject: Right justified columns?

One major feature missing is a column property to right justify the text
similar to a list view. This is required if numbers are shown in that column.

Any ideas where to change that?

Thanks,
Sanjay

 | Replies | Author | Date
4069 | Re: Right justified columns? | Werner Lehmann | Wed 10/17/2001
4075 | Re: Right justified columns? | Sanjay Kanade | Wed 10/17/2001
4076 | Re: Right justified columns? | Helge Jung (ECO-Logic) | Wed 10/17/2001
4078 | Re: Right justified columns? | Sanjay Kanade | Wed 10/17/2001
4072 | Re: Right justified columns? | Illya Kysil | Wed 10/17/2001


Using WideStrings with OnSaveNode and OnLoadNode

From: [subscribedlists@b...]
Date: Wed Oct 17, 2001 5:32 am
Subject: Using WideStrings with OnSaveNode and OnLoadNode

I'm attempting to save and load a widestring caption with OnSaveNode
and OnLoadNode. However I can only get this to work if I use PChar
casts instead of PWChar casts. Of course then I have to change my
WideString to an AnsiString which is not acceptable for using other
languages. I'm using a very simple data structure to start with:

type
PNodeData = ^TNodeData;
TNodeData = record
Caption: WideString;
end;

My OnLoadNode and OnSaveNode look like this:

procedure TForm1.LoadNode(Sender: TBaseVirtualTree; Node: VirtualNode;
Stream: TStream);
var
Data: PNodeData;
Len: integer;
begin
Data := Sender.GetNodeData(Node);
Stream.read(Len, SizeOf(Len));
SetLength(Data.Caption, Len);
Stream.read(PWChar(Data.Caption)^, Len);
end;

procedure TForm1.SaveNode(Sender: TBaseVirtualTree; Node: VirtualNode;
Stream: TStream);
var
Data: PNodeData;
Len: integer;
begin
Data := Sender.GetNodeData(Node);
Len := Length(Data.Caption);
Stream.write(Len, SizeOf(Len));
Stream.write(PWChar( Data.Caption)^, Len);
end;

Again, this all works if I use an AnsiString caption with PChar
casts. It seems logical that replacing an AnsiSting with a WideString
and then replacing the PChar casts with PWChar casts should work.
Except the characters get corrupted at the end of the line. Even
while moving just one node. This is with Delphi 5 if that is
important.

Any ideas on what is wrong here? Thanks for any insights.

Doug

 | Replies | Author | Date
4073 | Re: Using WideStrings with OnSaveNode and OnLoadN | Illya Kysil | Wed 10/17/2001


re: Pin Pointing Nodes inVT

From: [subscribedlists@b...]
Date: Wed Oct 17, 2001 6:07 am
Subject: Re: Pin Pointing Nodes inVT

--- In [VirtualTreeview@y...], Bender Heri [HBender@E...] wrote:
> > If I have a record structure assigned to each node that includes
> > an ID value lets say. When I come to add a new child my only
> > point of reference of which node that child belongs to is that
> > ID value. So without parsing through the whole of the tree,
> > assigning the pointer then checking the record value how do I
> > call the correct node.
>
> I think this is the way to go. Parsing the whole tree until you
> find the node with the desired ID.
>
> If this is too time consuming you have to maintain an index
> yourself with a reference to the PVirtualNode.

I you want to quickly search a tree with many nodes you can always
store pointers to specific waypoints within PVirtualNode variables.
Then start your searching from those points. Of course your tree has
to have some kind of structure for this to work. If you store just
the midpoint, you can cut out half the nodes that must be searched.
Store another midpoint and you just cut out another half. Start with
a simple binary search before going node to node.

Also, you do have other references to the node you are looking for.
If you want to add a child node, then perhaps you already have a
sibling. Just use PVirtualNode.Parent to get the parent. If you are
using the mouse to select nodes, then take a look at
GetFirstSelected, GetNextSelected, GetFocusedNode,
GetSortedSelection, etc.

Hope you find something useful here...

Doug


[no subject]

From: [subscribedlists@b...]
Date: Wed Oct 17, 2001 6:27 am
Subject:

I uploaded a screen capture of an interesting tree that I saw in a
Delphi application to:

Files > Screen shots > Competitive_Trees > Interspector_Tree.gif

or the lengthy URL of:

http://groups.yahoo.com/group/VirtualTreeview/files/Screen%
20shots/Competitive_Trees/Interspector_Tree.gif

Please take a look. It is a very graphically pleasing tree. Does
anyone know how tho add these pipe like line graphics to the Virtual
Tree? I really like the imagery of this tree. It would be nice if
there were hooks to Virtual Tree's expand/collapse images and the
line images for easy modification. Perhaps they are already
available within the Virtual Tree, but I haven't found them yet.
Please let me know of any tips that anyone may have.

Thanks,

Doug


re: Image above caption, possible?

From: "Paul Istrate" [istech@c...]
Date: Wed Oct 17, 2001 7:41 am
Subject: Re: [VirtualTreeview] Image above caption, possible?

Hi,

Yes, it is possible, but you should use TVirtualDrawTree (VDT) instead VST.

It provides you OnDrawNode event where you have a TVTPaintInfo structure
with a lot of userfull informations. So, you can draw anything you want in
CellRect (ContentRect), in any position.

Note that you should paint text too and take care of OnGetNodeWidth event
for proper displaying selected (focused) nodes.

Also, be sure that you will set a corect NodeHeight in init stage.

Regards,

Paul Istrate

----- Original Message -----
From: [ljee@s...]
To: [VirtualTreeview@yahoogroups.com>
Sent: Wednesday, October 17, 2001 4:26 AM
Subject: [VirtualTreeview] Image above caption, possible?

> is it possible to have a image painted above the caption in a VT:
>
> ------------------------------
> +---------------+
> | I |
> | M |
> | A | > Some ITEM
> | G |
> | 1 E |
> +---------------+
> ITEM 1 - CAPTION
> ------------------------------
> +---------------+
> | I |
> | M |
> | A | > Another ITEM
> | G |
> | 2 E |
> +---------------+
> ITEM 2 - CAPTION
>
>
>
>
> To unsubscribe from this group, send an email to:
> VirtualTreeview-unsubscribe@egroups.com
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>

Replies Author Date


re: Image above caption, possible?

From: [subscribedlists@b...]
Date: Wed Oct 17, 2001 6:57 am
Subject: Re: Image above caption, possible?

--- In [VirtualTreeview@y...], [ljee@s...] wrote:
> is it possible to have a image painted above the caption in a VT:
>
> ------------------------------
> +---------------+
> | I |
> | M |
> | A | > Some ITEM
> | G |
> | 1 E |
> +---------------+
> ITEM 1 - CAPTION
> ------------------------------
> +---------------+
> | I |
> | M |
> | A | > Another ITEM
> | G |
> | 2 E |
> +---------------+
> ITEM 2 - CAPTION

Custom draw and paint cycles are supported via paint events (for the
entire tree and for each node). Some of the public ones are:

property OnPaintText;
property OnAfterCellPaint;
property OnAfterItemErase;
property OnAfterItemPaint;
property OnAfterPaint;
property OnBeforeCellPaint;
property OnBeforeItemErase;
property OnBeforeItemPaint;
property OnBeforePaint;
property OnEdited;
property OnEditing;
property OnDrawHint;
property OnDrawNode;
property OnEdited;
property OnEditing;

If you need even more control you can inherit from the Virtual Tree
overriding the necessary protected properties or redeclare them as
public. Look for methods prefixed with "Do" as in DoBeforePaint.
However using the public "On" properties should allow you to do
whatever you want within an Item.

Doug


re: Right justified columns?

From: Werner Lehmann [wl@b...]
Date: Wed Oct 17, 2001 7:58 am
Subject: Re: [VirtualTreeview] Right justified columns?

Sanjay Kanade wrote:
>
> One major feature missing is a column property to right justify the text
> similar to a list view. This is required if numbers are shown in that column.
>
> Any ideas where to change that?

What is wrong with Alignment = taRightJustify in the column properties?

Werner

 | Replies | Author | Date
4075 | Re: Right justified columns? | Sanjay Kanade | Wed 10/17/2001
4076 | Re: Right justified columns? | Helge Jung (ECO-Logic) | Wed 10/17/2001
4078 | Re: Right justified columns? | Sanjay Kanade | Wed 10/17/2001


re: Using WideStrings with OnSaveNode and OnLoa dNode

From: Bender Heri [HBender@E...]
Date: Wed Oct 17, 2001 8:53 am
Subject: RE: [VirtualTreeview] Using WideStrings with OnSaveNode and OnLoa dNode

I have not much experience with WideChars, but it seems that you confuse the
logical length of the stream with the real string size in bytes.

From the Delphi help:

"For Unicode (WideString) strings, Length returns the number of bytes
divided by two."

In opposite the Stream.Read or the Stream.Write command counts with each
byte. So you would have to write:

Stream.read(PWChar(Data.Caption)^, Len * 2);

and

Stream.write(PWChar( Data.Caption)^, Len * 2);

BTW: If this would be my code I first would make a test if len > 0 before
reading or writing to or from the stream.

Maybe this was going wrong.

Heri

> -----Original Message-----
> From: [subscribedlists@b...] [mailto:[subscribedlists@b...]]
> Sent: Wednesday, October 17, 2001 7:33 AM
> To: VirtualTreeview@yahoogroups.com
> Subject: [VirtualTreeview] Using WideStrings with OnSaveNode and
> OnLoadNode
>
>
> I'm attempting to save and load a widestring caption with OnSaveNode
> and OnLoadNode. However I can only get this to work if I use PChar
> casts instead of PWChar casts. Of course then I have to change my
> WideString to an AnsiString which is not acceptable for using other
> languages. I'm using a very simple data structure to start with:
>
> type
> PNodeData = ^TNodeData;
> TNodeData = record
> Caption: WideString;
> end;
>
> My OnLoadNode and OnSaveNode look like this:
>
> procedure TForm1.LoadNode(Sender: TBaseVirtualTree; Node: VirtualNode;
> Stream: TStream);
> var
> Data: PNodeData;
> Len: integer;
> begin
> Data := Sender.GetNodeData(Node);
> Stream.read(Len, SizeOf(Len));
> SetLength(Data.Caption, Len);
> Stream.read(PWChar(Data.Caption)^, Len);
> end;
>
> procedure TForm1.SaveNode(Sender: TBaseVirtualTree; Node: VirtualNode;
> Stream: TStream);
> var
> Data: PNodeData;
> Len: integer;
> begin
> Data := Sender.GetNodeData(Node);
> Len := Length(Data.Caption);
> Stream.write(Len, SizeOf(Len));
> Stream.write(PWChar( Data.Caption)^, Len);
> end;
>
> Again, this all works if I use an AnsiString caption with PChar
> casts. It seems logical that replacing an AnsiSting with a WideString
> and then replacing the PChar casts with PWChar casts should work.
> Except the characters get corrupted at the end of the line. Even
> while moving just one node. This is with Delphi 5 if that is
> important.
>
> Any ideas on what is wrong here? Thanks for any insights.
>
> Doug
>
>
> ------------------------ Yahoo! Groups Sponsor
> ---------------------~-->
> Pinpoint the right security solution for your company- Learn
> how to add 128- bit encryption and to authenticate your web
> site with VeriSign's FREE guide!
> http://us.click.yahoo.com/yQix2C/33_CAA/yigFAA/i7folB/TM
> --------------------------------------------------------------
> -------~->
>
> To unsubscribe from this group, send an email to:
> VirtualTreeview-unsubscribe@egroups.com
>
>
>
> Your use of Yahoo! Groups is subject to
> http://docs.yahoo.com/info/terms/
>
>

 | Replies | Author | Date
4071 | Re: Using WideStrings with OnSaveNode and OnLoa d | Bender Heri | Wed 10/17/2001


re: Using WideStrings with OnSaveNode and OnLoa dNode

From: Bender Heri [HBender@E...]
Date: Wed Oct 17, 2001 8:59 am
Subject: RE: [VirtualTreeview] Using WideStrings with OnSaveNode and OnLoa dNode

> I have not much experience with WideChars, but it seems that
> you confuse the
> logical length of the stream with the real string size in bytes.

Sorry, it should be "...logical length of the string..."

Heri


re: Right justified columns?

From: "Illya Kysil" [ikysil@m...]
Date: Wed Oct 17, 2001 9:51 am
Subject: Re: [VirtualTreeview] Right justified columns?

Sanjay wrote:
> One major feature missing is a column property to right justify the text
> similar to a list view. This is required if numbers are shown in that column.
>
> Any ideas where to change that?
I'd like to see centered columns too.

Regards
Illya Kysil, software developer
If it is NOT SOURCE, it is NOT SOFTWARE. (C) NASA


re: Using WideStrings with OnSaveNode and OnLoadNode

From: "Illya Kysil" [ikysil@m...]
Date: Wed Oct 17, 2001 9:57 am
Subject: Re: [VirtualTreeview] Using WideStrings with OnSaveNode and OnLoadNode

> Again, this all works if I use an AnsiString caption with PChar
> casts. It seems logical that replacing an AnsiSting with a WideString
> and then replacing the PChar casts with PWChar casts should work.
> Except the characters get corrupted at the end of the line. Even
> while moving just one node. This is with Delphi 5 if that is
> important.
>
> Any ideas on what is wrong here? Thanks for any insights.

'Stream.Write( PWChar( Data.Caption )^, Len );' is wrong.
Should be 'Stream.Write( PWChar( Data.Caption )^, Len * SizeOf( WideChar ));'
Length( WideString ) gives a LENGTH not a size of memory.
Latter is Length * SizeOf( WideChar ).

Regards
Illya Kysil, software developer
If it is NOT SOURCE, it is NOT SOFTWARE. (C) NASA


re: Installing 2.5.4 in BCB5

From: Vandrovec Milan [milan_va@s...]
Date: Wed Oct 17, 2001 10:15 am
Subject: Re: Installing 2.5.4 in BCB5

Hi.

> Open your VirtualTreesC5.bpk:
> Find line:
> <PFLAGS value=" ... ">
> Add in this line
> <PFLAGS value=" ... -LUdclstd50">
>
> Columns editor:
> If you add in your VirtualTreesC5D.bpk a module
> dsnide50.bpi, that can
> delete from VirtualTreesReg.pas all {$ifndef CPPB} {$endif} -
> you get Columns editor registered with VT-doubleclick.
>

Could someone with BCB5 Standard or Trial test the new BCB package, which is
at
http://groups.yahoo.com/group/VirtualTreeview/files/Examples/BCB_Examples/Co
mpatibility/,
file
VT2_5_40 for CPPB v2.zip.

Thanks, Milan Vandrovec

 | Replies | Author | Date
4083 | Re: Installing 2.5.4 in BCB5 | [rhymebusta@h...] | Wed 10/17/2001
4093 | Re: Installing 2.5.4 in BCB5 | [rhymebusta@h...] | Thu 10/18/2001


re: Right justified columns?

From: Sanjay Kanade [skanade@v...]
Date: Wed Oct 17, 2001 3:57 pm
Subject: Re: [VirtualTreeview] Right justified columns?

>Sanjay Kanade wrote:
>>
>> One major feature missing is a column property to right justify the text
>> similar to a list view. This is required if numbers are shown in that
column.
>>
>> Any ideas where to change that?
>
>What is wrong with Alignment = taRightJustify in the column properties?
>
>Werner

I can't see any such property for the columns in this component. It
does not appear in column editor. I can't see it in the code either.

Sanjay

 | Replies | Author | Date
4076 | Re: Right justified columns? | Helge Jung (ECO-Logic) | Wed 10/17/2001
4078 | Re: Right justified columns? | Sanjay Kanade | Wed 10/17/2001


re: Right justified columns?

From: "Helge Jung \(ECO-Logic\)" [helge@e...]
Date: Wed Oct 17, 2001 10:31 am
Subject: Re: [VirtualTreeview] Right justified columns?

> >What is wrong with Alignment = taRightJustify in the column properties?
>
> I can't see any such property for the columns in this component. It
> does not appear in column editor. I can't see it in the code either.
>

Which version of VT are you using??? The actual one is 2.5.40 - available
at:

http://groups.yahoo.com/group/VirtualTreeview/files/VirtualTree_2.5.40.zip

There is definitely an property called Alignment in the each Column
(accessible with the Column Editor, too).

Helge.

 | Replies | Author | Date
4078 | Re: Right justified columns? | Sanjay Kanade | Wed 10/17/2001


GetDisplayRect for Header

From: [jogador3@y...]
Date: Wed Oct 17, 2001 12:58 pm
Subject: GetDisplayRect for Header

Hi!

I need to get the text display rect for a column header.

I know that for nodes I can use GetDisplayRect(Node, Column,
TextOnly) and for the header?

Thanks a lot!

Trevis

 | Replies | Author | Date
4164 | Re: GetDisplayRect for Header | Mike Lischke | Sun 10/21/2001
4186 | Re: GetDisplayRect for Header | [jogador3@y...] | Mon 10/22/2001


re: Right justified columns?

From: Sanjay Kanade [skanade@v...]
Date: Wed Oct 17, 2001 1:52 pm
Subject: Re: [VirtualTreeview] Right justified columns?

>Which version of VT are you using??? The actual one is 2.5.40 - available
>at:
>
>http://groups.yahoo.com/group/VirtualTreeview/files/VirtualTree_2.5.40.zip
>
>There is definitely an property called Alignment in the each Column
>(accessible with the Column Editor, too).
>
>Helge.

Oops! I am using a very old version. I downloaded it from Virtual Tree View
web site before coming here and joining. Mike, please take note.

Helge, Thanks a lot.

Sanjay


To any Drag'n Drop guru: please look at my previous post

From: [robertlau_z@y...]
Date: Wed Oct 17, 2001 1:25 pm
Subject: To any Drag'n Drop guru: please look at my previous post

Thank you.


re: Image above caption, possible?

From: [ljee@s...]
Date: Wed Oct 17, 2001 2:35 pm
Subject: Re: Image above caption, possible?

Hi,

> Yes, it is possible, but you should use TVirtualDrawTree (VDT)
I am using VDT. But VDT draws the image before OnDrawEvent ... I was
hoping to let VDT handle the ImageList, it looks like I have to take
care of that too.

> Also, be sure that you will set a corect NodeHeight in init stage.
Yes, this is something I missed. Thanks a lot

Lucian


Back from holiday

From: "Mike Lischke" [lists@l...]
Date: Wed Oct 17, 2001 5:50 pm
Subject: Back from holiday

Hi all,

I just want to let you know that I'm back from Turkey since yesterday (very
nice country, indeed) and will now go through all the eMails I got and answer
them based on their send date. Please be patient since it will take quite a few
days.

Ciao, Mike

PS: Before you ask: no, I had no problem staying away from computers. I rather
took yacht and jeep to have a bit fun and also all those nice hours at the
beach were very comfortable ;-) (I'll upload a couple of pictures to my
homepage in a few days).
--
www.lischke-online.de
www.delphi-unicode.net


WB Mike and a question 4 u

From: [robertlau_z@y...]
Date: Wed Oct 17, 2001 6:49 pm
Subject: WB Mike and a question 4 u

Welcome back Mike, I hope you enjoyed your trip as much as creating
this cool component!
thx in advance!

I'm reposting my previous post to find out the following:

btw, I checked Version 2.5.40 and same result.

hello everyone,
I had a problem with the Drag'nDrop (node moving) implementation in
release Version 2.5.34
it seems that on node moving never calls the onsave and onload prior
to node moving so user could get its own data to define whether the
move is valid or not. I changed the MoveTo (I should have override
but it is not virtual) from the base to reflect the way that was
working for copyto and it works correctly.
Please let me know if there are any better way to do it or if this is
ok?

here is the modified ver:

procedure TBaseVirtualTree.MoveTo(Source, Target: PVirtualNode; Mode:
TVTNodeAttachMode; ChildrenOnly: Boolean);
Var
TargetTree: TBaseVirtualTree;
Allowed: Boolean;
NewNode: PVirtualNode;
Stream: TMemoryStream;

begin
Assert(TreeFromNode(Source) = Self, 'The source tree must contain
the source node.');

if (Mode <> amNowhere) and Assigned(Source) and (Source <> FRoot)
and (Source <> Target) then
begin
if Target = nil then
begin
TargetTree := Self;
Target := FRoot;
Mode := amAddChildFirst;
end
else
TargetTree := TreeFromNode(Target);

if Target = TargetTree.FRoot then
begin
case Mode of
amInsertBefore:
Mode := amAddChildFirst;
amInsertAfter:
Mode := amAddChildLast;
end;
end;

Stream := TMemoryStream.Create;
try
if not ChildrenOnly then
WriteNode(Stream, Source)
else
begin
Source := Source.FirstChild;
while Assigned(Source) do
begin
WriteNode(Stream, Source);
Source := Source.NextSibling;
end;
end;
TargetTree.BeginUpdate;
try
Stream.Position := 0;
while Stream.Position < Stream.Size do
begin
NewNode := TargetTree.InsertNode(Target, Mode);
TargetTree.InternalAddFromStream(Stream,
VTTreeStreamVersion, NewNode);
end;
finally
TargetTree.EndUpdate;
end;
finally
Stream.Free;
end;
if Target = TargetTree.FRoot then
Allowed := DoNodeMoving(NewNode, nil)
else
Allowed := DoNodeMoving(NewNode, Target);

if Allowed then
begin
BeginUpdate;
try
if ChildrenOnly then
DeleteChildren(Source)
else
DeleteNode(Source);
finally
EndUpdate;
end;
DoNodeMoved(NewNode);
end
else
DeleteNode(NewNode);
InvalidateCache;
if (FUpdateCount = 0) and Allowed then
begin
ValidateCache;
UpdateScrollBars(True);
Invalidate;
if TargetTree <> Self then
TargetTree.Invalidate;
StructureChange(Source, crNodeMoved);
end
else
Include(FStates, tsStructureChangePending);
end;
end;

 | Replies | Author | Date
4111 | Re: WB Mike and a question 4 u | [subscribedlists@b...] | Fri 10/19/2001


re: Installing 2.5.4 in BCB5

From: [rhymebusta@h...]
Date: Wed Oct 17, 2001 7:46 pm
Subject: Re: Installing 2.5.4 in BCB5

--- In [VirtualTreeview@y...], Vandrovec Milan [milan_va@s...] wrote:
>
> Hi.
>
> > Open your VirtualTreesC5.bpk:
> > Find line:
> > <PFLAGS value=" ... ">
> > Add in this line
> > <PFLAGS value=" ... -LUdclstd50">
> >
> > Columns editor:
> > If you add in your VirtualTreesC5D.bpk a module
> > dsnide50.bpi, that can
> > delete from VirtualTreesReg.pas all {$ifndef CPPB} {$endif} -
> > you get Columns editor registered with VT-doubleclick.
> >
>
> Could someone with BCB5 Standard or Trial test the new BCB package,
which is
> at
>
http://groups.yahoo.com/group/VirtualTreeview/files/Examples/BCB_Examp
les/Co
> mpatibility/,
> file
> VT2_5_40 for CPPB v2.zip.
>
> Thanks, Milan Vandrovec

i tried it under BCB5 Trial and the initial instructions that come
with it don't work---check the previous posts under the same subject
that i posted(they show the errors that resulted)

 | Replies | Author | Date
4093 | Re: Installing 2.5.4 in BCB5 | [rhymebusta@h...] | Thu 10/18/2001


Bug with KillFocus Workaround

From: "Moritz Franckenstein" [franckenstein@a...]
Date: Thu Oct 18, 2001 10:13 am
Subject: Bug with KillFocus Workaround

procedure TBaseVirtualTree.WMKillFocus(var Msg: TWMKillFocus);
{...}
// Work around for MDI child parent form problem. If the tree lost
the focus
// because another form is activated then it does not get the focus
back even
// if set in code.
Form := GetParentForm(Self);
if Assigned(Form) then
with Form as TForm do // <--
if (FormStyle = fsMDIChild) and not Active then
ActiveControl := nil;
end;

hi mike,

when using VT in TActiveXForm (which is derived from TCustomForm, not
from TForm) you get the error: "Invalid typecast"

i have fixed this temporarily with this change:

if Assigned(Form) and (Form is TForm) then

is this workaround for the workaround ok this way? *g*

-moritz

 | Replies | Author | Date
4086 | Re: Bug with KillFocus Workaround | Anatolix | Thu 10/18/2001
4165 | Re: Bug with KillFocus Workaround | Mike Lischke | Sun 10/21/2001
4176 | Re: Bug with KillFocus Workaround | Theodor Kleynhans | Sun 10/21/2001
4207 | Re: Bug with KillFocus Workaround | Mike Lischke | Mon 10/22/2001
4209 | Re: Bug with KillFocus Workaround | Theodor Kleynhans | Tue 10/23/2001


TVTHeader - Parent Font ?

From: [john.leavey@b...]
Date: Thu Oct 18, 2001 10:49 am
Subject: TVTHeader - Parent Font ?

Is there a way of simulating a ParentFont property for a TVTHeader
object ?

I've just had to go through manually updating all the virtual trees
in my project - the tree itself will pick up the new value when the
form's font is changed, but not the header.

If not, could this be added as a feature in a future version.

Thanks

John Leavey

 | Replies | Author | Date
4166 | Re: TVTHeader - Parent Font ? | Mike Lischke | Sun 10/21/2001


re: Bug with KillFocus Workaround

From: Anatolix [Anatolix@n...]
Date: Thu Oct 18, 2001 2:33 pm
Subject: Re: [VirtualTreeview] Bug with KillFocus Workaround

Hello,

MF> when using VT in TActiveXForm (which is derived from TCustomForm, not
MF> from TForm) you get the error: "Invalid typecast"

MF> i have fixed this temporarily with this change:

MF> if Assigned(Form) and (Form is TForm) then

MF> is this workaround for the workaround ok this way? *g*

I also seen this bug then VirtualTreeView placed on floating
dock form.

i fix it by the same way.

--
Best regards,
Anatolix mailto:[Anatolix@n...]

[ ... Åñëè ñìîòðåòü ñáîêó, òî ñíèçó êàæåòñÿ ÷òî ñâåðõó íè÷åãî íåò ]


TVTHeader.Invalidate Type Bug

From: Ralf Junker [ralfjunker@g...]
Date: Thu Oct 18, 2001 12:59 pm
Subject: TVTHeader.Invalidate Type Bug

Hi,

there seems to be a typo bug in TVTHeader.Invalidate:

Column := nil;
if Column = nil then
R := TreeView.GetHeaderRect
else
R := Column.GetRect;

The if-statement is worthless if Column is set to nil anyway.

-- Ralf

 | Replies | Author | Date
4167 | Re: TVTHeader.Invalidate Type Bug | Mike Lischke | Sun 10/21/2001


VST: Tab key in Edit mode switches focus

From: Ralf Junker [ralfjunker@g...]
Date: Thu Oct 18, 2001 1:01 pm
Subject: VST: Tab key in Edit mode switches focus

Hi,

pressing the TAB key while editing a node in TVirtualStringTree DOES change the
focus to the next control, i.e. the edit window and the tree loose focus.

There is no chance of suppressing this with the tree's key press / down / up
events, because the TAB key is eaten up by the edit control and is not
forwarded to the tree.

This situation is especially confusing to users who try to tab to the next
column like in Excel.

A solution requires some changes to TVtEdit along the following lines:

procedure TVtEdit.WMGetDlgCode(var Message: TWMGetDlgCode);
begin
inherited;
Message.Result := Message.Result or DLGC_WANTTAB;
end;

procedure TVTEdit.WMChar(var Message: TWMChar);
begin
// avoid beep
with Message do
case CharCode of
VK_ESCAPE:
Exit;
VK_TAB: // Prevent focus change
CharCode := 0; // Prevent focus change
end;
inherited;
end;

-- Ralf

 | Replies | Author | Date
4168 | Re: VST: Tab key in Edit mode switches focus | Mike Lischke | Sun 10/21/2001


VST: Pressing Escape key in edit mode

From: Ralf Junker [ralfjunker@g...]
Date: Thu Oct 18, 2001 1:09 pm
Subject: VST: Pressing Escape key in edit mode

Hi,

I was surprised to find the Escape key being forwareded to the tree if pressed
during a VST edit.

My assumption was that the Escape key had done its purpose by ending the edit.
My intention was to close a form when a user presses escape. However, the form
closed as well when aborting the edit.

I have fixed this by checking for IsEditing, but I am still curious to know if
this behaviour is intended?

-- Ralf

 | Replies | Author | Date
4169 | Re: VST: Pressing Escape key in edit mode | Mike Lischke | Sun 10/21/2001
4191 | Re: VST: Pressing Escape key in edit mode | Ralf Junker | Mon 10/22/2001


VST: Size & Position of Edit window in right aligned column

From: Ralf Junker [ralfjunker@g...]
Date: Thu Oct 18, 2001 1:07 pm
Subject: VST: Size & Position of Edit window in right aligned column

Hi,

imagine the following scenario:

* VST with mulitple columns, editable.
* The rightmost column is right aligned.
* The same rightmost column just borders the right side of the tree and the
form.
* Focus is on this rightmost column.
* Now press F2 to enter edit mode.

Observations:

* Edit window is very narrow.
* Entering more than 1 or 2 character hides all other current chars.
* The edit window does not grow with the text typed.

(Comment: Very confusing behaviour to unexperienced users.)

Suggestions:

* Multiple characters entered should be properly displayed.
* If the edit window is right aligned, it should grow to the left (just as left
aligned grows to the right). It should also grow beyond the column's boundaries
(just as when left aligned).
* Also, it would be nice if the edit had the same alignment as the column.
Currently the edit is always left aligned, regardless of the column's alignment.

I know we could write a separate edit to do this, but I feel that it should be
part and parcel of VST itself.

Regards,

-- Ralf

 | Replies | Author | Date
4196 | Re: VST: Size & Position of Edit window in right | Mike Lischke | Mon 10/22/2001


CheckState and Virtual Paradigm?

From: Ralf Junker [ralfjunker@g...]
Date: Thu Oct 18, 2001 1:44 pm
Subject: CheckState and Virtual Paradigm?

Hi,

I am curious to ask why a TVirtualNode's checkstate is taken out of the virtual
paradigm. All right, we are not used to anything different, but I came to the
point where I relied on the virtual paradigm and I was lost the checkstate
issue.

I using a VST to display a TStringList. The checkstate is stored in the
Objects[] property (1/0). Since the paradigm is virtual, to sort the tree I
simply sort the stringlist. Everything works fine, except for the checkstates:
The checkstates are not updated simply because they are not virtual.

Wouldn't the tree benefit from including the checkstates (and maybe also the
checktype and align) element into the virtual paradigm?

Regards,

-- Ralf

 | Replies | Author | Date
4197 | Re: CheckState and Virtual Paradigm? | Mike Lischke | Mon 10/22/2001


Selection AV

From: "Jim Kueneman" [jimdk@m...]
Date: Thu Oct 18, 2001 2:12 pm
Subject: Selection AV

Hi Mike welcome back. I was just about ready to release a new
version of VET when I hit a snag. After a node deletion (of a
selected node) I try to multiselect more nodes I get an AV on line
17976. It appears the FRangeAnchor is still assigned but the address
is invalid, ie the statement

FRangeAnchor.Parent throws an error.

The *weird* thing is this only happens on Win98??? Win2k, WinME and
NT4 don't have a problem (or don't point to memory that is
offlimits). The only clue I have is one all of the above if I
assertions on every once in a while I get the assertion on line 17664

"Pending and direct clearance are not mutual exclusive"

Anyone have any ideas before I spend some hours looking into it.

Jim

 | Replies | Author | Date
4095 | Re: Selection AV | Jim Kueneman | Thu 10/18/2001
4096 | Re: Selection AV | [subscribedlists@b...] | Thu 10/18/2001
4097 | Re: Selection AV | Jim Kueneman | Thu 10/18/2001
4098 | Re: Selection AV | Jim Kueneman | Thu 10/18/2001
4099 | In place editor question | Franc van de Westelaken | Thu 10/18/2001
4100 | Re: In place editor question | [subscribedlists@b...] | Thu 10/18/2001
4101 | Re: Selection AV | [subscribedlists@b...] | Fri 10/19/2001
4103 | Re: Selection AV | Jim Kueneman | Fri 10/19/2001
4120 | Re: Selection AV | Mike Lischke | Sat 10/20/2001


re: Installing 2.5.4 in BCB5

From: [rhymebusta@h...]
Date: Thu Oct 18, 2001 3:19 pm
Subject: Re: Installing 2.5.4 in BCB5

--- In [VirtualTreeview@y...], [rhymebusta@h...] wrote:
> --- In [VirtualTreeview@y...], Vandrovec Milan [milan_va@s...] wrote:
> >
> > Hi.
> >
> > > Open your VirtualTreesC5.bpk:
> > > Find line:
> > > <PFLAGS value=" ... ">
> > > Add in this line
> > > <PFLAGS value=" ... -LUdclstd50">
> > >
> > > Columns editor:
> > > If you add in your VirtualTreesC5D.bpk a module
> > > dsnide50.bpi, that can
> > > delete from VirtualTreesReg.pas all {$ifndef CPPB}
{$endif} -
> > > you get Columns editor registered with VT-doubleclick.
> > >
> >
> > Could someone with BCB5 Standard or Trial test the new BCB
package,
> which is
> > at
> >
>
http://groups.yahoo.com/group/VirtualTreeview/files/Examples/BCB_Examp
> les/Co
> > mpatibility/,
> > file
> > VT2_5_40 for CPPB v2.zip.
> >
> > Thanks, Milan Vandrovec
>
> i tried it under BCB5 Trial and the initial instructions that come
> with it don't work---check the previous posts under the same
subject
> that i posted(they show the errors that resulted)

quick question......where should i put the "CBuilder" folder and the
files that come within the .zip file- i.e: compiler.inc, clearvt.bat,
etc...
specifically, can u tell me the file path?
i.e. C:\Program Files\Borland\CBuilder5\?????????


re: Installing 2.5.4 in BCB5

From: Vandrovec Milan [milan_va@s...]
Date: Thu Oct 18, 2001 3:48 pm
Subject: Re: Installing 2.5.4 in BCB5

Hi.

> > i tried it under BCB5 Trial and the initial instructions that come
> > with it don't work---check the previous posts under the same
> subject
> > that i posted(they show the errors that resulted)

I was confused by this, I was pretty sure it would work. At least
for me it does, and does not generate DsgnIntf.dcu anywhere, so I
thought it is taken from the dclstd50.bpi, which is even in Standard
and Trial edition. Or you don't have $(BCB)\Lib\dclstd50.bpi?

> quick question......where should i put the "CBuilder" folder and the
> files that come within the .zip file- i.e: compiler.inc, clearvt.bat,
> etc...

Put the full zip archive in a VirtualTreeView directory anywhere (I have
it in M:\CPPprojs\CBuilder\Project2\VirtualTreeView, but this path should
not be mentioned anywhere).
The only thing needed is to add this (VirtualTreeView, not the CBuilder)
directory to Tools-Environment Options-Library-LibraryPath. Also add
$(BCB)\Projects\Bpl to this list.

Compilers.inc is a part of VirtualTrees, so leave it where it is.
clearVT.bat should be moved to "c:\Program
Files\Borland\CBuilder5\Projects".

If you have installed BCB somewhere else than in
"c:\Program Files\Borland\CBuilder5"
then you must modify the "Final output" box in project options for both
VirtualTreeView and VirtualTreeViewD (for some reason, the $(BCB) macro gets
always expanded in this field).

> specifically, can u tell me the file path?
> i.e. C:\Program Files\Borland\CBuilder5\?????????

After all, what does not work for you?

Milan

 | Replies | Author | Date
4102 | Re: Installing 2.5.4 in BCB5 | [rhymebusta@h...] | Fri 10/19/2001


re: Selection AV

From: "Jim Kueneman" [jimdk@m...]
Date: Thu Oct 18, 2001 7:56 pm
Subject: Re: Selection AV

--- In [VirtualTreeview@y...], "Jim Kueneman" [jimdk@m...] wrote:
>
>
> Hi Mike welcome back. I was just about ready to release a new
> version of VET when I hit a snag. After a node deletion (of a
> selected node) I try to multiselect more nodes I get an AV on line
> 17976. It appears the FRangeAnchor is still assigned but the
address
> is invalid, ie the statement
>
> FRangeAnchor.Parent throws an error.

Ok, it appears that in DeleteNode if you are in a Begin/End Update
pair the method calls InternalRemoveNodeFromSelection. In this
method when the node is selected and it is the FRangeAnchor the
FRangeAnchor is not set to a different node, or clear it if no other
nodes are selected. This leaves FRangeAnchor pointing to a node that
is deleted just a clock cycles later.

If you call DeleteNode without calling Begin/End Update the method
calls RemoveNodeFromSelection, which does nil the FRangeAnchor after
it is removed.

Is this appears to be a bug or I am missing something?

The other thing that is a bit disconcerning is FRangeAnchor is not
updated as the nodes are deleted until they are all deleted. Then
and only then is FRangeAnchor set to nil (after SelectionCount = 0).
The implications are that FRangeAnchor points to invalid memory
during the entire deletion cycle if FRangeAnchor node is the first to
be deleted.

What if I have 5 nodes selected then programmaticlly delete only the
node which happens to be the FRangeAnchor? The FRangeAnchor is now
pointing into la-la land. This is exactly what is happening to me.
I am between a Begin/End Update block, although the same will happen
when not in this block, and deleting the nodes one by one, not using
the DeleteSelectedNodes method.

I am not sure if the deletion will be allowed so I don't want to just
delete them all at once. I wait to be notified that the deletion has
happened then delete the node.

Does this make sense?

Jim

 | Replies | Author | Date
4096 | Re: Selection AV | [subscribedlists@b...] | Thu 10/18/2001
4097 | Re: Selection AV | Jim Kueneman | Thu 10/18/2001
4098 | Re: Selection AV | Jim Kueneman | Thu 10/18/2001
4099 | In place editor question | Franc van de Westelaken | Thu 10/18/2001
4100 | Re: In place editor question | [subscribedlists@b...] | Thu 10/18/2001
4101 | Re: Selection AV | [subscribedlists@b...] | Fri 10/19/2001
4103 | Re: Selection AV | Jim Kueneman | Fri 10/19/2001


re: Selection AV

From: [subscribedlists@b...]
Date: Thu Oct 18, 2001 8:08 pm
Subject: Re: Selection AV

--- In [VirtualTreeview@y...], "Jim Kueneman" [jimdk@m...] wrote:
> The other thing that is a bit disconcerning is FRangeAnchor is not
> updated as the nodes are deleted until they are all deleted. Then
> and only then is FRangeAnchor set to nil
> (after SelectionCount = 0).

> The implications are that FRangeAnchor points to invalid memory
> during the entire deletion cycle if FRangeAnchor node is the
> first to be deleted.
>
> What if I have 5 nodes selected then programmaticlly delete only
> the node which happens to be the FRangeAnchor? The FRangeAnchor
> is now pointing into la-la land. This is exactly what is
> happening to me.

Doen't this only cause a problem if you are deleting parent nodes
before deleting their children first? Such as using an unresolved
selection? If so, it would seem that you could take steps to delete
the children first. Hope I'm understanding your question.

Doug

 | Replies | Author | Date
4097 | Re: Selection AV | Jim Kueneman | Thu 10/18/2001
4098 | Re: Selection AV | Jim Kueneman | Thu 10/18/2001
4099 | In place editor question | Franc van de Westelaken | Thu 10/18/2001
4100 | Re: In place editor question | [subscribedlists@b...] | Thu 10/18/2001
4101 | Re: Selection AV | [subscribedlists@b...] | Fri 10/19/2001
4103 | Re: Selection AV | Jim Kueneman | Fri 10/19/2001


re: Selection AV

From: "Jim Kueneman" [jimdk@m...]
Date: Thu Oct 18, 2001 8:26 pm
Subject: Re: Selection AV

> > The other thing that is a bit disconcerning is FRangeAnchor is
> >
> > What if I have 5 nodes selected then programmaticlly delete only
> > the node which happens to be the FRangeAnchor? The FRangeAnchor
> > is now pointing into la-la land. This is exactly what is
> > happening to me.
>
> Doen't this only cause a problem if you are deleting parent nodes
> before deleting their children first? Such as using an unresolved
> selection? If so, it would seem that you could take steps to delete
> the children first. Hope I'm understanding your question.

Hi Doug,

No children involved. Envision 5 root nodes. You select node 3
then node 4, using shift or mouse. Node 3 will be designated
FRangeAnchor. Now I ask the shell to delete these file (this is
VET). The shell goes off to delete the files. It signals me that it
deleted the Node 3 file. I respond by calling DeleteNode(3). At
this point FRangeAnchor is still pointing to Node 3, which has been
deleted, because it only gets reset to nil after SelectionCount goes
to 0. VET can now go off to do something else while it waits for the
shell to delete the other file. This is the point I think I am
having problems. VT is now in an invalid state. Eventually the
shell will signal VET that the other file has been deleted and I will
respond by calling DeleteNode(4) but in the mean time the tree may be
manipulated and FRangeAnchor is pointing to an invalid node. This is
all conjecture right now as I don't have access to Win98 at this
moment.

Jim

 | Replies | Author | Date
4098 | Re: Selection AV | Jim Kueneman | Thu 10/18/2001
4099 | In place editor question | Franc van de Westelaken | Thu 10/18/2001
4100 | Re: In place editor question | [subscribedlists@b...] | Thu 10/18/2001
4101 | Re: Selection AV | [subscribedlists@b...] | Fri 10/19/2001
4103 | Re: Selection AV | Jim Kueneman | Fri 10/19/2001


re: Selection AV

From: "Jim Kueneman" [jimdk@m...]
Date: Thu Oct 18, 2001 8:31 pm
Subject: Re: Selection AV

> deleted the Node 3 file. I respond by calling DeleteNode(3). At
> this point FRangeAnchor is still pointing to Node 3, which has been
> deleted, because it only gets reset to nil after SelectionCount
goes
> to 0. VET can now go off to do something else while it waits for

Oops, let me clarify that. It get set to 0 ONLY of I call DeleteNode
outside of a Begin/End Update pair. InternalRemoveFromSelection
NEVER sets FRangeAnchor to nil, which is really what I think the
problem in Win98 is. It must have a different enough memory
management system that it is reallocating that memory quickly enough
after deleting the node that it points to off limits memory, where as
the rest have not reallocated the memory yet so it is still *sort of*
valid.

At least that is my theory for now.

Jim

 | Replies | Author | Date
4099 | In place editor question | Franc van de Westelaken | Thu 10/18/2001
4100 | Re: In place editor question | [subscribedlists@b...] | Thu 10/18/2001
4101 | Re: Selection AV | [subscribedlists@b...] | Fri 10/19/2001
4103 | Re: Selection AV | Jim Kueneman | Fri 10/19/2001


In place editor question

From: "Franc van de Westelaken" [F.vdwestelaken@c...]
Date: Thu Oct 18, 2001 8:57 pm
Subject: In place editor question

Hi,

I've created a VT with inplace editors (SpinEdits). When I press a key I
want to start the editor. This works fine (in the keydown of the VT I
call EditNode). However, the editor starts with the currentvalue in the
cell (as specified in the PrepareEdit), but how can I modify it's
behaviour so that it also inserts the character in the editor that
initiated the Editor (Now I have to press the key twice in order to get
the text in the editor).

Franc.

[Non-text portions of this message have been removed]

 | Replies | Author | Date
4100 | Re: In place editor question | [subscribedlists@b...] | Thu 10/18/2001


re: In place editor question

From: [subscribedlists@b...]
Date: Thu Oct 18, 2001 10:20 pm
Subject: Re: In place editor question

--- In [VirtualTreeview@y...], "Franc van de Westelaken"
> how can I modify it's behaviour so that it also inserts the >
character in the editor that initiated the Editor (Now I have to
> press the key twice in order to get the text in the editor).

How's this:

Function SendKey(VirtualKey: Word): Boolean;
Begin
Try
PostVirtualKeyEvent(VirtualKey,False);
PostVirtualKeyEvent(VirtualKey,True);
Result := True;
Except
Result := False;
End;
End;

After initiating the editor use this function to send the editor a
virtual keystroke. Look up virtual keys in the Delphi help if you
are unsure of what they are.

Hope you find this helpful,

Doug


re: Selection AV

From: [subscribedlists@b...]
Date: Fri Oct 19, 2001 12:19 am
Subject: Re: Selection AV

> It must have a different enough memory management system that
> it is reallocating that memory quickly enough after deleting
> the node that it points to off limits memory, where as the rest
> have not reallocated the memory yet so it is still *sort of*
> valid.

Sort of valid? Doesn't sound very valid at all. The whole process
appears to be entirely dependent on everything happening in a
specific order and at a specific time that you do not control. You
are allowing your component's internal logic to be compromised by the
internal logic of another component. Given different operating
systems, future operating systems changes, and system load (which may
slow down the moving/copying/deleting of files, I would offload the
entire moving/copying/deleting process to a thread.

Why not store the nodes to be deleted within a list object and
process them one at a time from a separate thread. That way you still
have a very responsive tree and you can control what happens and
when. You can also invalidate the tree every so often instead of on
every file change.

I would go even one more step and place the thread within a command
object. I'm thinking of the command design pattern here. Then if you
have a large list of files to move or delete, the user can still
manipulate the tree. You can simply check for nil nodes before
performing any direct action from within each command object. Or you
could have each command object ask the others if there is an internal
lock on a specific file/folder by having a routine that polls the
other command objects.

You could then popup a message that a specific node is already
selected for deletion/movement by a previous command. The user could
even cancel the previous command by having the file/folder removed
from the other command object's list. That would allow you to
move/delete large numbers of files while allowing the user to
selectively change his/her mind about specific folders/files.

This could all happen in real time without interrupting the other
actions that another command object is performing. Other
files/folders may still be in the other command object's list and
they would not be affected. Because each command contains its own
independent thread, the VET could be very responsive.

I think off loading the process to a thread would be the way to go.
Encasing each thread within a command object would even be better.

Doug

 | Replies | Author | Date
4103 | Re: Selection AV | Jim Kueneman | Fri 10/19/2001


re: Installing 2.5.4 in BCB5

From: [rhymebusta@h...]
Date: Fri Oct 19, 2001 12:43 am
Subject: Re: Installing 2.5.4 in BCB5

--- In [VirtualTreeview@y...], Vandrovec Milan [milan_va@s...] wrote:
>
>
> Hi.
>
> > > i tried it under BCB5 Trial and the initial instructions that
come
> > > with it don't work---check the previous posts under the same
> > subject
> > > that i posted(they show the errors that resulted)
>
> I was confused by this, I was pretty sure it would work. At least
> for me it does, and does not generate DsgnIntf.dcu anywhere, so I
> thought it is taken from the dclstd50.bpi, which is even in Standard
> and Trial edition. Or you don't have $(BCB)\Lib\dclstd50.bpi?
>
> > quick question......where should i put the "CBuilder" folder and
the
> > files that come within the .zip file- i.e: compiler.inc,
clearvt.bat,
> > etc...
>
> Put the full zip archive in a VirtualTreeView directory anywhere
(I have
> it in M:\CPPprojs\CBuilder\Project2\VirtualTreeView, but this path
should
> not be mentioned anywhere).
> The only thing needed is to add this (VirtualTreeView, not the
CBuilder)
> directory to Tools-Environment Options-Library-LibraryPath. Also add
> $(BCB)\Projects\Bpl to this list.
>
> Compilers.inc is a part of VirtualTrees, so leave it where it is.
> clearVT.bat should be moved to "c:\Program
> Files\Borland\CBuilder5\Projects".
>
> If you have installed BCB somewhere else than in
> "c:\Program Files\Borland\CBuilder5"
> then you must modify the "Final output" box in project options for
both
> VirtualTreeView and VirtualTreeViewD (for some reason, the $(BCB)
macro gets
> always expanded in this field).
>
> > specifically, can u tell me the file path?
> > i.e. C:\Program Files\Borland\CBuilder5\?????????
>
> After all, what does not work for you?
>
> Milan

I'm pulling my hair out just installing this thing.
ok here's the steps that i did.
1. i made the $(BCB)\Intermed, $(BCB)\ToolsAPI(i forget who suggested
this directory), i didn't make the $(BCB)\Bpl directory because it
already existed.
2. i added the all the paths to the "Tools - Env. Options - Library -
Library Path" mentioned above(including the path of the directory of
where i unzipped all the *.pas *.dfm *.res *.inc files)
3. i edited the VirtualTrees.pas at line 4139 with the "if" statement
4. i added the -LUdclstd50 option in the PFLAGS tag of
VirtualTreeView.bpk
5. i made sure that the "dsnide50.bpi" file actually exists and that
it is included in the "PACKAGES" tag of VirtualTreeViewD.bpk under
the "values" property
6. i ran clearVT each time between compilations in the
$(BCB)\Projects dir

in the end.....i got the same f**king error!!!!!


re: Re: Selection AV

From: Jim Kueneman [jimdk@m...]
Date: Fri Oct 19, 2001 3:45 am
Subject: Re: [VirtualTreeview] Re: Selection AV

Just a quick aside.

Mike,
I would like you to take a look at this and let know if I am missing
something.

Ok,
Mike may not follow this if he does not see his name at the top of the
message <g>

>Sort of valid? Doesn't sound very valid at all. The whole process

I meant it may not cause an AV since it still contains the same info it had
before it was freed.

>appears to be entirely dependent on everything happening in a
>specific order and at a specific time that you do not control. You

Sorry my greatly simplified example may have clouded the issue.

> Why not store the nodes to be deleted within a list object and
>process them one at a time from a separate thread. That way you still
>have a very responsive tree and you can control what happens and
>when. You can also invalidate the tree every so often instead of on
>every file change.

Exactly how it is being done. There are alot of possibilities and
scenarios that can occur even with this scheme. Maybe the best way is to
really delete the nodes and then add them back if the notification only
catches some of the deletions. The problem is I never know when all the
files have been deleted, I have to break in and update sometime not knowing
if all notification are done or if the shell is finished.

Another scenaio is I have a bunch of node selected in VET and the file is
deleted in Explorer. The notification is sent to VET and the node is
deleted but again the FRangeAnchor is not updated if that node is the
FRangeAnchor.

The main point here is if a node is selected and is the FRangeAnchor if you
use DeleteNode on that node FRangeAnchor is not updated, expecially if you
are between a Begin/End Update pair since it then calls
InternalRemoveFromSelection and still points to freed memory.

It does appear to fix the problem in Win98 if I put a
Selected[NodeToDelete] right before a DeleteNode(NodeToDelete)

We should go off line if you want to discuss this more. Feel free to email
me directly. I do appreciate you taking the time to think about this and
discuss it.

Jim


re: Installing 2.5.4 in BCB5

From: Vandrovec Milan [milan_va@s...]
Date: Fri Oct 19, 2001 7:34 am
Subject: Re: Installing 2.5.4 in BCB5

Hello.

> I'm pulling my hair out just installing this thing.
> ok here's the steps that i did.
> 1. i made the $(BCB)\Intermed, $(BCB)\ToolsAPI(i forget who suggested
> this directory), i didn't make the $(BCB)\Bpl directory because it
> already existed.

That should be $(BCB)\Source\ToolsAPI, and should not be needed any more
anyway, since it only exists in Professional and Enterprise editions. That's
the trouble. I avoided using it as Oleg suggested.

Full list of my T-EO-L-LP:
$(BCB)\Lib
$(BCB)\Lib\Debug
$(BCB)\Bin
$(BCB)\Imports
$(BCB)\Projects\Bpl
m:\cppprojs\cbuilder\project2\virtualtreeview //this is where I copied it

> 4. i added the -LUdclstd50 option in the PFLAGS tag of
> VirtualTreeView.bpk

It should have been there! Did you download the "v2" version? And the most
important is to add the same to VirtualTreeViewD.bpk!

> 5. i made sure that the "dsnide50.bpi" file actually exists and that
> it is included in the "PACKAGES" tag of VirtualTreeViewD.bpk under
> the "values" property

VirtualTreeView.bpk:
<SPARELIBS value="VCL50.lib VCLX50.lib DSNIDE50.lib"/>
<PACKAGES value="vcl50.bpi dsnide50.bpi VCLX50.bpi"/>

VirtualTreeViewD.bpk:
<SPARELIBS value="VCL50.lib VCLX50.lib DSNIDE50.lib
VirtualTreeView.lib"/>
<PACKAGES value="vcl50.bpi dsnide50.bpi VCLX50.bpi
VirtualTreeView.bpi"/>

> 6. i ran clearVT each time between compilations in the
> $(BCB)\Projects dir
>
> in the end.....i got the same f**king error!!!!!

Could you check if VirtualTrees.dcu and .obj get created in
$(BCB)\Projects\Intermed?
VirtualTreeView.obj? VirtualTreesReg.dcu? VirtualTreeViewD.obj? This may be
a stupid question, but do you only Compile VirtualTreeView and
Compile&install VirtualTreeViewD?

If this does not help, I give up. Sorry.

Milan

 | Replies | Author | Date
4108 | Re: Installing 2.5.4 in BCB5 | [rhymebusta@h...] | Fri 10/19/2001
4112 | Re: Installing 2.5.4 in BCB5 | [rhymebusta@h...] | Fri 10/19/2001
4113 | Re: Installing 2.5.4 in BCB5 | [rhymebusta@h...] | Fri 10/19/2001


re: In place editor question

From: Franc v/d Westelaken [F.vdwestelaken@c...]
Date: Fri Oct 19, 2001 8:14 am
Subject: Re: In place editor question

Hi,

> PostVirtualKeyEvent(VirtualKey,False);
> PostVirtualKeyEvent(VirtualKey,True);

In which unit can I find this procedure ? I searched the VCL sources but this
function doesn't come up.

Franc.

[Non-text portions of this message have been removed]

 | Replies | Author | Date
4107 | Re: In place editor question | Werner Lehmann | Fri 10/19/2001
4109 | Re: In place editor question | [subscribedlists@b...] | Fri 10/19/2001


3 State Check Box Images - bug ?

From: [john.leavey@b...]
Date: Fri Oct 19, 2001 9:16 am
Subject: 3 State Check Box Images - bug ?

I have a Virtual String tree with, 3 state check boxes. However, for
those nodes with "greyed" state, the image used is a black square
rather than a tick with a grey background. Is this just an option I
have failed to set correctly or a bug ?

I'm using version 2.5.40

Thanks

John Leavey

 | Replies | Author | Date
4121 | Re: 3 State Check Box Images - bug ? | Mike Lischke | Sat 10/20/2001


re: In place editor question

From: Werner Lehmann [wl@b...]
Date: Fri Oct 19, 2001 9:31 am
Subject: Re: [VirtualTreeview] In place editor question

Hi Franc,

Franc van de Westelaken wrote:
>
> I've created a VT with inplace editors (SpinEdits). When I press a key I
> want to start the editor. This works fine (in the keydown of the VT I
> call EditNode). However, the editor starts with the currentvalue in the
> cell (as specified in the PrepareEdit), but how can I modify it's
> behaviour so that it also inserts the character in the editor that
> initiated the Editor (Now I have to press the key twice in order to get
> the text in the editor).

I suggest you create your own editor to get hold of the real edit control
and exactly know when the editing starts. You need to make PrepareEdit in VT
virtual, beg Mike nicely to include this, should not hurt performance ;)

TMyStringEditLink = class(TStringEditLink)
private
FNewChar: Char;
public
constructor CreateChar(NewChar: Char);
function PrepareEdit(Tree: TBaseVirtualTree; Node: PVirtualNode; Column:
Integer): Boolean; override;
end;

constructor TMyStringEditLink.CreateChar(NewChar: Char);
begin
inherited Create;
FNewChar := NewChar;
end;

function TMyStringEditLink.PrepareEdit(Tree: TBaseVirtualTree; Node:
PVirtualNode; Column: Integer): Boolean;
begin
inherited;
if Result and (FNewChar <> #0) then
Edit.Caption := Edit.Caption + FNewChar;
end;

In OnKeyDown:

EditChar := ...; // Char of pressed key in field variable.

In OnCreateEditor:

result := TMyStringEditLink.CreateChar(EditChar);
EditChar := #0;

Nothing of this is tested. Good luck.

Werner


re: Installing 2.5.4 in BCB5

From: [rhymebusta@h...]
Date: Fri Oct 19, 2001 2:42 pm
Subject: Re: Installing 2.5.4 in BCB5

--- In [VirtualTreeview@y...], Vandrovec Milan [milan_va@s...] wrote:
>
>
> Hello.
>
> > I'm pulling my hair out just installing this thing.
> > ok here's the steps that i did.
> > 1. i made the $(BCB)\Intermed, $(BCB)\ToolsAPI(i forget who
suggested
> > this directory), i didn't make the $(BCB)\Bpl directory because
it
> > already existed.
>
> That should be $(BCB)\Source\ToolsAPI, and should not be needed any
more
> anyway, since it only exists in Professional and Enterprise
editions. That's
> the trouble. I avoided using it as Oleg suggested.
>
> Full list of my T-EO-L-LP:
> $(BCB)\Lib
> $(BCB)\Lib\Debug
> $(BCB)\Bin
> $(BCB)\Imports
> $(BCB)\Projects\Bpl
> m:\cppprojs\cbuilder\project2\virtualtreeview //this is where I
copied it
>
>
> > 4. i added the -LUdclstd50 option in the PFLAGS tag of
> > VirtualTreeView.bpk
>
> It should have been there! Did you download the "v2" version? And
the most
> important is to add the same to VirtualTreeViewD.bpk!
>
>
> > 5. i made sure that the "dsnide50.bpi" file actually exists and
that
> > it is included in the "PACKAGES" tag of VirtualTreeViewD.bpk
under
> > the "values" property
>
> VirtualTreeView.bpk:
> <SPARELIBS value="VCL50.lib VCLX50.lib DSNIDE50.lib"/>
> <PACKAGES value="vcl50.bpi dsnide50.bpi VCLX50.bpi"/>
>
> VirtualTreeViewD.bpk:
> <SPARELIBS value="VCL50.lib VCLX50.lib DSNIDE50.lib
> VirtualTreeView.lib"/>
> <PACKAGES value="vcl50.bpi dsnide50.bpi VCLX50.bpi
> VirtualTreeView.bpi"/>
>
>
> > 6. i ran clearVT each time between compilations in the
> > $(BCB)\Projects dir
> >
> > in the end.....i got the same f**king error!!!!!
>
> Could you check if VirtualTrees.dcu and .obj get created in
> $(BCB)\Projects\Intermed?
> VirtualTreeView.obj? VirtualTreesReg.dcu? VirtualTreeViewD.obj?
This may be
> a stupid question, but do you only Compile VirtualTreeView and
> Compile&install VirtualTreeViewD?
>
> If this does not help, I give up. Sorry.
>
> Milan

maybe the files that replace the zeroed files are the problem...i'm
taking the *.dcr *.pas *.inc *.res files from the
VirtualTree_2.5.40.zip that is available for download in the Files
section of YG.
is this were i should be taking these files from? or is there
another .zip file somewhere that contains the replacements?

 | Replies | Author | Date
4112 | Re: Installing 2.5.4 in BCB5 | [rhymebusta@h...] | Fri 10/19/2001
4113 | Re: Installing 2.5.4 in BCB5 | [rhymebusta@h...] | Fri 10/19/2001


re: In place editor question

From: [subscribedlists@b...]
Date: Fri Oct 19, 2001 4:13 pm
Subject: Re: In place editor question

> > PostVirtualKeyEvent(VirtualKey,False);
> > PostVirtualKeyEvent(VirtualKey,True);
>
> In which unit can I find this procedure ? I searched the VCL
> sources but this function doesn't come up.

Sorry, browse to:

http://www.advdelphisys.com/codelib/sendkey_c.html

PostVirtualKeyEvent is in the unit listed there. Just click unit.
There is also a demo, just click demo.

There you will find a Delphi unit that will allow you to do just
about anything with the keyboard. Click the Unit link on the web
page. It includes routines to send characters, only accept numbers or
characters, or just about whatever else you would want to do with the
keyboard. You can also click on the Demo button for a demo.

Doug


Using OnStructureChange after MoveTo???

From: [subscribedlists@b...]
Date: Fri Oct 19, 2001 4:44 pm
Subject: Using OnStructureChange after MoveTo???

Re: Access to nodedata information from within the
OnStructureChange handler.

The sender and reason parameters are useful. But what about the node
parameter?

Any attempt to read any string from the nodedata will result in an AV
error coming deep from within the System.pas unit. Some assembly
instruction about accessing the AnsiString reference count. I'm
assuming that the nodedata object must be in some kind of limbo state
after performing a MoveTo instruction. I had to turn on the debug
DCUs to trace into the Run Time Library before I discovered what was
happening.

Something as simple as:

if Assigned(node) then
begin
nodedata := Sender.GetNodeData(Node); << Okay here.
SomeAnsiString := NodeData.Caption; << Will Crash here!
end;

Something like this also crashes:

Memo1.Lines.Add('Node Caption: ' + NodeData.Caption); << Will crash
<< here too!

Should we just stay clear of using the node within the handler? It's
nil most of the time anyway. If the node data cannot be accessed, I
would suggest removing it from the handler's parameter list. It
would be less confusing for new users. Anyone have any ideas? Has
anyone found a way to access nodedata within the OnStructureChange?

Thanks,

Doug

 | Replies | Author | Date
4199 | Re: Using OnStructureChange after MoveTo??? | Mike Lischke | Mon 10/22/2001


re: WB Mike and a question 4 u

From: [subscribedlists@b...]
Date: Fri Oct 19, 2001 5:31 pm
Subject: Re: WB Mike and a question 4 u

> I had a problem with the Drag'nDrop (node moving)...
> it seems that on node moving never calls the onsave and onload
> prior to node moving so user could get its own data to define
> whether the move is valid or not.

OnSaveNode and OnLoadNode are not to be used for the purpose of
checking whether a move should be valid or not. Use OnNodeMoving for
that. Since you already have to have PVirtualNodes for both the
source and target before calling MoveTo, you could always check your
data there before even making the call. I check my nodes within the
OnDragDrop handler before calling MoveTo/CopyTo and it works fine.

OnSaveNode and OnLoadNode are used to tell the VirtualTree how to
stream your nodes in and out. VirtualTree will stream your nodes
during the MoveTo transfer picking up all the children within the
internal stream. Using the two handlers is also necessary if you
want to save your tree to a stream or a file.

There is an OLE drag-and-drop demo in the files section, but VCL drag-
and-drop is easier to set up if all you want to do is drag nodes
within a Delphi App. I've been working on a VCL Drag-and-Drop demo
and will probably upload one to the files section next week.

Lastly, there should be no reason to change the MoveTo because it
works properly after you understand what do where, and with what
event handler. Granted this is the learning curve people keep talking
about here. Perhaps as more demos are posted it will get even easier.

EMail me if you need any detailed information.

Doug


re: Installing 2.5.4 in BCB5

From: [rhymebusta@h...]
Date: Fri Oct 19, 2001 5:54 pm
Subject: Re: Installing 2.5.4 in BCB5

> maybe the files that replace the zeroed files are the problem...i'm
> taking the *.dcr *.pas *.inc *.res files from the
> VirtualTree_2.5.40.zip that is available for download in the Files
> section of YG.
> is this were i should be taking these files from? or is there
> another .zip file somewhere that contains the replacements?

ok......forget that.....i got it installed but only after i did some
work arounds......which i'm not sure might be right....but it finally
installed.

here's what i did for anyone else having the same problems as me.
1. Replace zero-sized files with original versions,
2. create directory $(BCB)\Projects\Bpl and
$(BCB)\Projects\Intermed
3. Add to VirtualTrees.pas the followin line:
if (Images.Width<>0) and (Images.Height<>0) then //line 4139
to line 4139 (just before the for-loop)
4. move "clearVT.bat" to $(BCB)\Projects and run it (before every
compilation)
5. in VirtualTrees.bpk edit the "SPARELIB" tag so that u REMOVE
the "DSNIDE50.lib" and edit the "PACKAGE" tag so that u
REMOVE "dsnide50.bpi"....and save
6. now double click the VirtualTrees.bpk file so that it brings up
that little window where it has "Compile - Add - Remove - Install -
Options" buttons on the top.
7. REMOVE the "dsnide50.bpi" file from the "Requires" folder.
8. compile but DON'T install.......and DO save
9. double click the VirtualTreesD.bpk, and compile and install...this
does not need any modifications

now i don't know how important the dsnide50.bpi or dsnide50.lib files
are....probably pretty important, i don't know, but it installed like
that.
but since they ARE included in the VirtualTreesD.bpk i think it might
be ok......can anyone tell me if i'm wrong....or if excluding those
files might cause some unforseen problems

 | Replies | Author | Date
4113 | Re: Installing 2.5.4 in BCB5 | [rhymebusta@h...] | Fri 10/19/2001


re: Installing 2.5.4 in BCB5

From: [rhymebusta@h...]
Date: Fri Oct 19, 2001 6:04 pm
Subject: Re: Installing 2.5.4 in BCB5

> ok......forget that.....i got it installed but only after i did
some
> work arounds......which i'm not sure might be right....but it
finally
> installed.
>
> here's what i did for anyone else having the same problems as me.
> 1. Replace zero-sized files with original versions,
> 2. create directory $(BCB)\Projects\Bpl and
> $(BCB)\Projects\Intermed
> 3. Add to VirtualTrees.pas the followin line:
> if (Images.Width<>0) and (Images.Height<>0) then //line 4139
> to line 4139 (just before the for-loop)
> 4. move "clearVT.bat" to $(BCB)\Projects and run it (before every
> compilation)
> 5. in VirtualTrees.bpk edit the "SPARELIB" tag so that u REMOVE
> the "DSNIDE50.lib" and edit the "PACKAGE" tag so that u
> REMOVE "dsnide50.bpi"....and save
> 6. now double click the VirtualTrees.bpk file so that it brings up
> that little window where it has "Compile - Add - Remove - Install -
> Options" buttons on the top.
> 7. REMOVE the "dsnide50.bpi" file from the "Requires" folder.
> 8. compile but DON'T install.......and DO save
> 9. double click the VirtualTreesD.bpk, and compile and
install...this
> does not need any modifications
>
> now i don't know how important the dsnide50.bpi or dsnide50.lib
files
> are....probably pretty important, i don't know, but it installed
like
> that.
> but since they ARE included in the VirtualTreesD.bpk i think it
might
> be ok......can anyone tell me if i'm wrong....or if excluding those
> files might cause some unforseen problems

by the way....i was using the VT2_5_40 for CPPB v2.zip file that
Milan provides.


using vt2.5.4

From: [rhymebusta@h...]
Date: Fri Oct 19, 2001 6:19 pm
Subject: using vt2.5.4

hi i was wondering if anyone has made revisions to Mike's help file
that he posted in the YG( on 05/21/2001 ) that reflects the changes
that where made for v2.5.4.
'cause i'm getting errors like new method declarations for methods
that i use regularly like AddChild (i.e. it use to be
AddChild(PVirtualNode) but is now AddChild(PVirtualNode, void *). )
so it will really suck if i have to go through the VT source code
everytime i get a error for wrong method declarations/usage....or for
using types/structs/etc. that are no longer supported or included in
the VT.

 | Replies | Author | Date
4200 | Re: using vt2.5.4 | Mike Lischke | Mon 10/22/2001


Freeing resources

From: "Anders Thomsen" [anders@t...]
Date: Sat Oct 20, 2001 1:17 am
Subject: Freeing resources

Hi,

I has some problems with memoryleaks in my program, and I think I just figured
out where the problem is. I just cant understand why : )

Some code:

Type
TplstRec = record
Filename:String;
Text:String;
end;
PplstRec = ^TplstRec;

OnFormCreate:
MyTree.NodeDataSize := SizeOf(TplstRec);

The problem happens when I fill the tree and put string values in the
"Filename" and "Text" properties.
When I then do a MyTree.clear, I get mem leaks.

Then I added this:

procedure TForm1.MyTreeFreeNode(Sender: TBaseVirtualTree; Node: PVirtualNode);
var pl :PplstRec;
begin
pl := sender.GetNodeData(node);
pl.Filename := '';
pl.Text := ''
end;

And then no leaks happens!

Is it really nescessary to do this?

Cheers,
Thomsen

[Non-text portions of this message have been removed]

 | Replies | Author | Date
4117 | Re: Freeing resources | Jim Kueneman | Sat 10/20/2001
4148 | Re: Freeing resources | Mike Lischke | Sat 10/20/2001
4150 | Re: Freeing resources | Jim Kueneman | Sat 10/20/2001
4184 | Re: Freeing resources | GIANNAKOPOULOS KOSTAS | Mon 10/22/2001


Design question

From: Sanjay Kanade [skanade@v...]
Date: Sat Oct 20, 2001 4:07 am
Subject: Design question

For a selected disk drive, I want to keep the complete tree of file names,
sizes and other attributes in a Virtual Treeview so that I can then
analyze the stuff for various disk utilities without rescanning. I am a
little unclear on how the virtual memory works. If I directly keep the
data in a record on the node, how will it affect the physical memory for a
large number of files? Once I know I will think of an alternative design
if necessary. I will appreciate any thoughts on this.

Thanks,
Sanjay

 | Replies | Author | Date
4201 | Re: Design question | Mike Lischke | Mon 10/22/2001
4238 | Re: Design question | Werner Lehmann | Tue 10/23/2001


re: Freeing resources

From: Jim Kueneman [jimdk@m...]
Date: Sat Oct 20, 2001 4:17 am
Subject: Re: [VirtualTreeview] Freeing resources

>rocedure TForm1.MyTreeFreeNode(Sender: TBaseVirtualTree; Node: PVirtualNode);
>var pl :PplstRec;
>begin
> pl := sender.GetNodeData(node);
> pl.Filename := '';
> pl.Text := ''
>end;
>
>And then no leaks happens!
>
>Is it really nescessary to do this?

Yes, the memory allocation scheme used in VT is not dynamic array or
string aware. That works or

Finalize(pl^);

works too. I wish Mike would use New and Dispose <G>. I know about it and
thanks to your question realized I forgot it in what I did today!

Jim

 | Replies | Author | Date
4148 | Re: Freeing resources | Mike Lischke | Sat 10/20/2001
4150 | Re: Freeing resources | Jim Kueneman | Sat 10/20/2001


Content to ?

From: [duke_n5@h...]
Date: Sat Oct 20, 2001 8:05 am
Subject: Content to ?

Hello.
I am using VDT as a grid in a database application ( I am not using
fancy DB engines though-I found just plain INI file more comfortable).

Now I want to be able to convert the contents of it to Excel&HTML
table , except that
1) I see that ContentToXXX is defined only for VST (Not that I could
have used it properly with VST without help :))
2) I never programmed for Excel so I don't know how its files are
built. I figure I should use components on the Servers tab(I am on
D5) but again I don't know how.

Please help me with this.

 | Replies | Author | Date
4134 | Re: Content to ? | Werner Lehmann | Sat 10/20/2001
4213 | Re: Content to ? | Frank van den Bergh | Tue 10/23/2001
4202 | Re: Content to ? | Mike Lischke | Mon 10/22/2001


re: Suggestion for a new event

From: "Mike Lischke" [lists@l...]
Date: Sat Oct 20, 2001 11:41 am
Subject: RE: [VirtualTreeview] Suggestion for a new event

[VirtualTreeview] Suggestion for a new eventSometimes, it would be nice, if
the cursor can change in dependence
on the position (e.g. crHandPoint above a CheckBox, crDefault else).
However, in order to introduce such an option, it is actually
neccessary to define a descendent and to overwrite the WM_SETCURSOR
message.
Good idea. Would you please add this to the suggestions table in the
database area?

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net

[Non-text portions of this message have been removed]


re: Re: Selection AV

From: "Mike Lischke" [lists@l...]
Date: Sat Oct 20, 2001 11:52 am
Subject: RE: [VirtualTreeview] Re: Selection AV

Re: [VirtualTreeview] Re: Selection AVHi Jim,
Mike,
I would like you to take a look at this and let know if I am missing
something.

Ok,
Mike may not follow this if he does not see his name at the top of the
message <g>

Well, you have my attention now :o] Nonetheless, if I wouldn't ignore some
of the messages I would be drowned in the flood of messages I get.

The main point here is if a node is selected and is the FRangeAnchor if
you
use DeleteNode on that node FRangeAnchor is not updated, expecially if you
are between a Begin/End Update pair since it then calls
InternalRemoveFromSelection and still points to freed memory.
You are entirely right, that this is a bug in VT. It is the same as with
FFocusedNode. Also this reference has to be cleared if the node is
disconnected from the tree. I have now included a fix.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net

[Non-text portions of this message have been removed]


re: 3 State Check Box Images - bug ?

From: "Mike Lischke" [lists@l...]
Date: Sat Oct 20, 2001 11:58 am
Subject: RE: [VirtualTreeview] 3 State Check Box Images - bug ?

[VirtualTreeview] 3 State Check Box Images - bug ?Hi John,
I have a Virtual String tree with, 3 state check boxes. However, for
those nodes with "greyed" state, the image used is a black square
rather than a tick with a grey background. Is this just an option I
have failed to set correctly or a bug ?

No this is not a bug. Before I went to Turkey I changed the check images and
related implementation. From the design guidelines for Windows XP (provided
by MS) I found how they represent a "partially checked" check box (with this
little square). I found this much better than the previous solution where I
simply used a checked and greyed check box. This image, however, is also
used to denote a disabled check box which is checked, which is ambiguous.

If you don't like that then simply provide an own check images list to be
used by the tree.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net

[Non-text portions of this message have been removed]


re: By design or display bug?

From: "Mike Lischke" [lists@l...]
Date: Sat Oct 20, 2001 12:09 pm
Subject: RE: [VirtualTreeview] By design or display bug?

> When a *centered* header column is set as the sort column and the
> showsortglyphs is enabled, the ellipses (...) are sometimes displayed
> IMO unnecessarily.
>
> Should the header use the extra space opposite of the sort glyph
> before resorting to ellipses?

Correct, I forgot to account for the additional space used by the sort glyph.
Fixed now.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: Hiding form (2.5.34)

From: "Mike Lischke" [lists@l...]
Date: Sat Oct 20, 2001 12:24 pm
Subject: RE: [VirtualTreeview] Hiding form (2.5.34)

> there is an error when I'm hiding a form while I'm editing a node
> text of a VTV on this form. This happens because I minimize my
> application to the system tray, so the form is hidden, and if I am
> currently editing a node, I get the message "a deactivate or
> insivible form cannot get the focus".

Well, a long time ago I included code to modify the focus when the tree was in
edit mode and the
edit lost the focus. Recently I found that this might cause all kind of trouble
(e.g. when
displaying a dialog from the edit control). So I removed that. Please try again
with the latest
source.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: Possible bug in TVTHeader.Invalidate

From: "Mike Lischke" [lists@l...]
Date: Sat Oct 20, 2001 12:56 pm
Subject: RE: [VirtualTreeview] Possible bug in TVTHeader.Invalidate

Hi Ralf,

> -->> next line sets Column to NIL, so parameter isn´t used!!!
>
> Column := nil;
> if Column = nil then
> R := Treeview.GetHeaderRect
> else
> R := Column.GetRect;

You are right. This was some left over from testing which was used to hunt a
bug. The bug appeared
again when I removed the explicit assignment, but I have fixed that now.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: Header class descendant...

From: "Mike Lischke" [lists@l...]
Date: Sat Oct 20, 2001 1:14 pm
Subject: RE: [VirtualTreeview] Header class descendant...

Hi Werner,

> I'd like to use my own TVTHeader descendant. Could you add / change these
please:

Done.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: Re: Sorting VirtualStringTree

From: "Mike Lischke" [lists@l...]
Date: Sat Oct 20, 2001 1:20 pm
Subject: RE: [VirtualTreeview] Re: Sorting VirtualStringTree

Hi Helge,

> P.S. A question regarding YahooGroups: If I answer to a message from
> this YG with Outlook, is it appended as a answer to the message or is
> it taken as a new post? My problem is that when I post or reply from
> the web, my e-mail address is taken as Sender adress - I want to see
> my name there.

This is how YG handles the web mail interface. I do not have any influence on
it, so better you
always answer with your mail client.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: Re: Header draw problem

From: "Mike Lischke" [lists@l...]
Date: Sat Oct 20, 2001 1:26 pm
Subject: RE: [VirtualTreeview] Re: Header draw problem

Hi Wim,

> So is it possible to turn the default dawing of a header into a
> public function so it's easier to do only ownerdrawn text on them?
> I've looked in the code and if i do it myself it involves copying a
> fair number of lines to get it correct (i mean including sortglyphs
> etc).

Please understand that I reject any larger change in VT until the next version
is out. What you want
is difficult because I can't do any layout caluclation anymore if an unknown
part of the header is
drawn by the application instead of the tree. But you can of course add your
wish into the wish list
located in the database area.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: Coloring the header

From: "Mike Lischke" [lists@l...]
Date: Sat Oct 20, 2001 1:31 pm
Subject: RE: [VirtualTreeview] Coloring the header

Hi Helge,

> I'm using VT 2.5.40 and I want to color the header because hxXPStyle doesn't
> seem to work properly on W2K any more (in run-time it exits with "unable to
> read property" or so).

Perhaps you should try to find out why hsXPStyle does not work. Sounds like
mixed versions.

>Maybe I'm only missing something but where can I find
> the property to set the color of the header??? Maybe a tiny code snippet?

What about Header.Background? But I guess you want to change the color of the
entire header. In this
case doing an owner draw is better otherwise additional elements like borders,
sort glyph etc. might
not fit to your color.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: Combobox in VirtualTree

From: "Mike Lischke" [lists@l...]
Date: Sat Oct 20, 2001 1:34 pm
Subject: RE: [VirtualTreeview] Combobox in VirtualTree

Hi Trevis,

> I need do insert calendars, comboboxes, etc in the VirtualTree. I
> know that I have to use a property editor or something like that.
> Does anybody have a simple demo where I can find out how to do that?

There was code already in the Advanced demo of version 1.31. Please download
the demo from my
homepage (look for the property page tree).

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: Problem: show/hide columns

From: "Mike Lischke" [lists@l...]
Date: Sat Oct 20, 2001 1:37 pm
Subject: RE: [VirtualTreeview] Problem: show/hide columns

Hi Oleg,

> Switch the columns 2 and 3(2 - hide, 3 - show).
>
> Result:
> | column 1 | column 3 | column 4 |
> | data of col1 | EMPTY! | data of col3 | data of col4 |
>
> Refresh, Repaint, InvalidateColumn - no effect!

I cannot reproduce this problem (used this in a product of my company and it
worked fine). Can you
please provide a simple demo?

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net

 | Replies | Author | Date
4153 | Re[2]: [VirtualTreeview] Problem: show/hide colum | Oleg Kraynov | Sat 10/20/2001
4204 | Re: Re[2]: [VirtualTreeview] Problem: show/hide c | Mike Lischke | Mon 10/22/2001
4220 | Re[4]: [VirtualTreeview] Problem: show/hide colum | Oleg Kraynov | Tue 10/23/2001
4287 | Re: Re[4]: [VirtualTreeview] Problem: show/hide c | Mike Lischke | Sat 10/27/2001


re: Re: Division by zero when installing VT 2.5.40 to BCB

From: "Mike Lischke" [lists@l...]
Date: Sat Oct 20, 2001 1:41 pm
Subject: RE: [VirtualTreeview] Re: Division by zero when installing VT 2.5.40 to BCB

Hi Roland,

> Question to Mike:
>
> Can you build in this if for example with
> {$ifdef CPPB}
> if (Images.Width<>0) and (Images.Height<>0) then
> {$endif}
> for I := 0 to (Images.Width div Images.H........
> before line 4139 for the Cpp-User.

Sure, I could include that, but it makes no sense. This is data which is
essential to the tree. And
it should work! If not then it must be fixed instead wrapping an exception
stopper around it.

The code in ConvertImageList uses FindClassHInstance to find the owner instance
and this should work
for exes as well as OCX and normal DLLs. The question is: why is there no
image? Does the tree use
an old version of the res file or does the loader code not work?

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: Re: Division by zero when installing VT 2.5.40 to BCB

From: "Mike Lischke" [lists@l...]
Date: Sat Oct 20, 2001 1:47 pm
Subject: RE: [VirtualTreeview] Re: Division by zero when installing VT 2.5.40 to BCB

> I think, it is a good idea to check at least Images.Height - independent
> on Delphi or CPPB or any Resource file.
>
> if Images.Height <> 0 then
> for I := 0 to (Images.Width div Images.Height) - 1 do...

So be it then. But since this is nothing which will change during runtime I
have included an
assertion.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net

 | Replies | Author | Date
4182 | Re: Division by zero when installing VT 2.5.40 to | Roland | Mon 10/22/2001


re: translate DPVT : C-> Delphi

From: "Mike Lischke" [lists@l...]
Date: Sat Oct 20, 2001 1:54 pm
Subject: RE: [VirtualTreeview] translate DPVT : C-> Delphi

Hi Benoit,

> I recovered file DPVT that explains how to connect a table to
> VirtualTreeview: Terrific.
> Unfortunately, sources are in C ;-(((.
> Someone would have it translates in Delphi (I am hopeless in C, a few
> better with Delphi) the source.

I'm sorry, but if you can't manage to translate the source (or at least to get
enough ideas to know
what's important) and nobody else here wants to do it then you are a bit alone.
I plan to go through
the demos once the other stuf is ready but I can't promise.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: Content to ?

From: Werner Lehmann [wl@b...]
Date: Sat Oct 20, 2001 1:38 pm
Subject: Re: [VirtualTreeview] Content to ?

[duke_n5@h...] wrote:
>
> 2) I never programmed for Excel so I don't know how its files are
> built. I figure I should use components on the Servers tab(I am on
> D5) but again I don't know how.

Sometime ago I have picked up (somewhere) example code for simple Excel export
without
the requirement of Excel being installed. I have pasted all I have below, I
never checked
it out though. A second possibility is JEDI VCL, they have a JCLExcel unit. You
find the
interface section below, too, and can get the VCL from delphi-jedi.org.

Regards,
Werner

----------------

unit JclExcel;

{$I JCL.INC}

{$WEAKPACKAGEUNIT ON}

interface

uses
Classes;

type
TJclExcelWriter = class (TObject)
private
FStream: TStream;
public
constructor Create(const Stream: TStream);
procedure WriteBOF;
procedure WriteEOF;
procedure WriteBLANK(const Col, Row: Word;
const XF: Word {$IFDEF SUPPORTS_DEFAULTPARAMS} = 0 {$ENDIF});
procedure WriteLABEL(const Data: AnsiString; const Col, Row: Word;
const XF: Word {$IFDEF SUPPORTS_DEFAULTPARAMS} = 0 {$ENDIF});
procedure WriteNUMBER(const Data: Double; const Col, Row: Word;
const XF: Word {$IFDEF SUPPORTS_DEFAULTPARAMS} = 0 {$ENDIF});
procedure WriteBOOL(const Data: Boolean; const Col, Row: Word;
const XF: Word {$IFDEF SUPPORTS_DEFAULTPARAMS} = 0 {$ENDIF});
procedure WriteERROR(const Data: Byte; const Col, Row: Word;
const XF: Word {$IFDEF SUPPORTS_DEFAULTPARAMS} = 0 {$ENDIF});
end;

implementation

----------------

Excel.txt:

const
CXlsBof: array[0..5] of Word = ($809, 8, 00, $10, 0, 0);
CXlsEof: array[0..1] of Word = ($0A, 00);
CXlsLabel: array[0..5] of Word = ($204, 0, 0, 0, 0, 0);
CXlsNumber: array[0..4] of Word = ($203, 14, 0, 0, 0);
CXlsRk: array[0..4] of Word = ($27E, 10, 0, 0, 0);

procedure XlsBeginStream(XlsStream: TStream; const BuildNumber: Word);
begin
CXlsBof[4] := BuildNumber;
XlsStream.WriteBuffer(CXlsBof, SizeOf(CXlsBof));
end;

procedure XlsEndStream(XlsStream: TStream);
begin
XlsStream.WriteBuffer(CXlsEof, SizeOf(CXlsEof));
end;

procedure XlsWriteCellRk(XlsStream: TStream; const ACol, ARow: Word; const
AValue: Integer);
var
V: Integer;
begin
CXlsRk[2] := ARow;
CXlsRk[3] := ACol;
XlsStream.WriteBuffer(CXlsRk, SizeOf(CXlsRk));
V := (AValue shl 2) or 2;
XlsStream.WriteBuffer(V, 4);
end;

procedure XlsWriteCellNumber(XlsStream: TStream; const ACol, ARow: Word; const
AValue: Double);
begin
CXlsNumber[2] := ARow;
CXlsNumber[3] := ACol;
XlsStream.WriteBuffer(CXlsNumber, SizeOf(CXlsNumber));
XlsStream.WriteBuffer(AValue, 8);
end;

procedure XlsWriteCellLabel(XlsStream: TStream; const ACol, ARow: Word; const
AValue: string);
var
L: Word;
begin
L := Length(AValue);
CXlsLabel[1] := 8 + L;
CXlsLabel[2] := ARow;
CXlsLabel[3] := ACol;
CXlsLabel[5] := L;
XlsStream.WriteBuffer(CXlsLabel, SizeOf(CXlsLabel));
XlsStream.WriteBuffer(Pointer(AValue)^, L);
end;

procedure TForm1.Button1Click(Sender: TObject);
var
FStream: TFileStream;
I, J: Integer;
begin
FStream := TFileStream.Create('J:\e.xls', fmCreate);
try
XlsBeginStream(FStream, 0);
for I := 0 to 99 do
for J := 0 to 99 do
begin
XlsWriteCellNumber(FStream, I, J, 34.34);
// XlsWriteCellRk(FStream, I, J, 3434);
// XlsWriteCellLabel(FStream, I, J, Format('Cell: %d,%d', [I, J]));
end;
XlsEndStream(FStream);
finally
FStream.Free;
end;
end;

 | Replies | Author | Date
4213 | Re: Content to ? | Frank van den Bergh | Tue 10/23/2001


re: Drag and Drop

From: "Mike Lischke" [lists@l...]
Date: Sat Oct 20, 2001 2:04 pm
Subject: RE: [VirtualTreeview] Drag and Drop

Helge,

> What shall I do in OnDragDrop? In OnDragOver I set Allowed to true. The node
> shall always be added as long as they come from MP3DB.

I'm not sure if you have solved your problem but try ProcessDrop in your
OnDragDrop handler. This
will also trigger OnLoadNode.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net

 | Replies | Author | Date
4146 | Re: Drag and Drop | Helge Jung (ECO-Logic) | Sat 10/20/2001
4203 | Re: Drag and Drop | Mike Lischke | Mon 10/22/2001


VTreeView with a database

From: [christophe37fr@y...]
Date: Sat Oct 20, 2001 2:13 pm
Subject: VTreeView with a database

Hello !!
I try to used the VTrreView with a database, but i have a lot of
problems with my datafields .IT's look like different than the TreeNT
and i can't obtain all datas from my database.could you help me
please.

 | Replies | Author | Date
4138 | Re: VTreeView with a database | Werner Lehmann | Sat 10/20/2001
4156 | Re: VTreeView with a database | [christophe37fr@y...] | Sun 10/21/2001
4172 | Re: VTreeView with a database | Werner Lehmann | Sun 10/21/2001
4227 | Re: VTreeView with a database | [christophe37fr@y...] | Tue 10/23/2001
4240 | Re: VTreeView with a database | Werner Lehmann | Tue 10/23/2001
4250 | Re: VTreeView with a database | [christophe37fr@y...] | Wed 10/24/2001


re: Re: Strange focus behaviour...

From: "Mike Lischke" [lists@l...]
Date: Sat Oct 20, 2001 2:50 pm
Subject: RE: [VirtualTreeview] Re: Strange focus behaviour...

> Even stranger, if you have three sibling nodes, try ctrl-clicking
> on them in the order of 1-3-2 instead or 1-2-3 and the order of the
> selected nodes you will obtain from GetFirstSelected and
> GetNextSelected will be entirely different, even though the selection
> list contains the same three nodes.

This can only happen with one of the older VT versions. Since I have changed
the selection retrival
methods this should be history. They now return the nodes in logical order.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: VTreeView with a database

From: Werner Lehmann [wl@b...]
Date: Sat Oct 20, 2001 3:21 pm
Subject: Re: [VirtualTreeview] VTreeView with a database

[christophe37fr@y...] wrote:
>
> Hello !!
> I try to used the VTrreView with a database, but i have a lot of
> problems with my datafields .IT's look like different than the TreeNT
> and i can't obtain all datas from my database.could you help me
> please.

I suppose you should give us more details where your problems with VT
exactly are.

Werner

 | Replies | Author | Date
4156 | Re: VTreeView with a database | [christophe37fr@y...] | Sun 10/21/2001


re: Notes on dropmarkMode

From: "Mike Lischke" [lists@l...]
Date: Sat Oct 20, 2001 3:32 pm
Subject: RE: [VirtualTreeview] Notes on dropmarkMode

> Thanks for adding the dropmarkMode to HeaderDraw.
> I've found a little problem with it though, when dragging a column, the DDM
should be
> none if the column is the dragged column.

Done.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: How to make drag image look like standard image?

From: "Mike Lischke" [lists@l...]
Date: Sat Oct 20, 2001 3:34 pm
Subject: RE: [VirtualTreeview] How to make drag image look like standard image?

Hi Doug,

> My guess is that there must be a way to turn off the drag images and
> then just change the cursor to the drag cursor. However, I have been
> unable to turn off the images.

Easy: set Tree.DragImageKind to diNoImage.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: Re: Can the tree's lines be replaced with images?

From: "Mike Lischke" [lists@l...]
Date: Sat Oct 20, 2001 3:40 pm
Subject: RE: [VirtualTreeview] Re: Can the tree's lines be replaced with images?

> Done. Look in Files > Screen shots > Competitive_Trees for a
> screenshot of a tree with *pipes* and special icons for + and -.
>
> Any ideas on how to replicate something like that with the Virtual
> Tree component?

As Werner already stated use the owner draw abilities of VT. It shouldn't very
difficult to
implement that directly in the tree (e.g. see Tree.PaintTreeLines) but
currently I have no time to
do that.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: CheckType question

From: "Mike Lischke" [lists@l...]
Date: Sat Oct 20, 2001 3:43 pm
Subject: RE: [VirtualTreeview] CheckType question

> Is it possible to have checkboxes in other columns, not column 0?

No, this is not possible. You could implement that but all the hit tests are
designed to work only
with check boxes in the main column. I also assume that you want to have
several check values per
node (e.g. one for each column) which requires some enhancement to the node
structure as well as the
public access.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net

 | Replies | Author | Date
4145 | Re: Node data question | Lucian | Sat 10/20/2001
4149 | Re: Node data question | [subscribedlists@b...] | Sat 10/20/2001


re: Working Drag and drop demo

From: "Mike Lischke" [lists@l...]
Date: Sat Oct 20, 2001 3:55 pm
Subject: RE: [VirtualTreeview] Working Drag and drop demo

Trevis,

> Does anyboby has a working (for version 2.5.34) drag and drop demo?

Download
http://groups.yahoo.com/group/VirtualTreeview/files/Examples/Delphi_Examples/Mis\
c_Examples/VirtualTr
ee%20Demos.zip and look closer at the OLE demo. Also keep in mind the
VT.ProcessDrop method which
can be used to simplify drag'n drop handling.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: User changing Node Text

From: "Mike Lischke" [lists@l...]
Date: Sat Oct 20, 2001 4:02 pm
Subject: RE: [VirtualTreeview] User changing Node Text

> > I would say only the OnNewText event is needed. Store the edited
> > text in your data record. That's all.
>
> Cool. I didn't know about that - okay, I haven't thought about OnNewText
> until now, anyway ;-))

Additionally, OnNewText is also the only way to get the caption of a node if a
string tree loads it
implicitly (see also TreeOptions.StringOptions.toSaveCaptions).

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: Node data question

From: "Lucian" [ljee@s...]
Date: Sat Oct 20, 2001 4:34 pm
Subject: RE: [VirtualTreeview] Node data question

Hi Mike,

Is it possible to store in "Data" an address to an object? So NodeDataSize
is 4, and when we need the data, we typecast the address stored? This way we
could uses objects to store, and not records :-)

Something like

var
MyObject : TMyObject; --> class not record
Node : PVirtualNode;
NodeData : PInteger;
begin
MyObject := TMyObject.Create;
Node := VT.AddChild( nil );
NodeData := VT.GetNodeData( Node );
NodeData^:= Integer( MyObject );
end;

than it would be nice to retrieve it back like in:

... GetNodeWidth, DrawNode etc methods
var
MyObject : TMyObject;
begin
MyObject := TMObject( VT.GetNodeData( Node ) );
end;

I am trying this, but unfortunately I can't get it to work. Has anyone
already tried something like this? (using some assembler tricks)

Lucian

 | Replies | Author | Date
4149 | Re: Node data question | [subscribedlists@b...] | Sat 10/20/2001


re: Drag and Drop

From: "Helge Jung \(ECO-Logic\)" [helge@e...]
Date: Sat Oct 20, 2001 4:35 pm
Subject: Re: [VirtualTreeview] Drag and Drop

> I'm not sure if you have solved your problem but try ProcessDrop
> in your OnDragDrop handler. This will also trigger OnLoadNode.

It works! It works! It works! I could kiss you for that hint (don't panic -
I won't do ;-)) ... my problem was so easy that nobody thought about that, I
guess *g*

Okay, there seems to be some error with the data but I think I can manage
that myself now (if not: I know which YG to use...).

Thanks again,

Helge.

 | Replies | Author | Date
4203 | Re: Drag and Drop | Mike Lischke | Mon 10/22/2001


re: for older history see help file

From: "Mike Lischke" [lists@l...]
Date: Sat Oct 20, 2001 4:41 pm
Subject: RE: [VirtualTreeview] for older history see help file

Hi Moritz,

> in virtualtrees.pas you say "for older history see help file"; could
> you put this history somewhere (or let it stay in the .pas file for
> longer) until the helpfile is available? or did i oversee something?

I have put the history online
(http://www.lischke-online.de/VirtualTreeview/VTHistory.html).

> currently, i wonder where to find a note about the csChecked ->
> csCheckedNormal renaming... or wasnt there any?

This happend with the new XP check images. What I had before wasn't enough
anymore so I extended the
check "system".

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: Freeing resources

From: "Mike Lischke" [lists@l...]
Date: Sat Oct 20, 2001 4:49 pm
Subject: RE: [VirtualTreeview] Freeing resources

> Yes, the memory allocation scheme used in VT is not dynamic array or
> string aware. That works or
>
> Finalize(pl^);
>
> works too. I wish Mike would use New and Dispose <G>. I know about it and
> thanks to your question realized I forgot it in what I did today!

It wouldn't change anything, Jim. I cannot do a Dispose on an untyped pointer.
The
application/descentant is responsible for freeing allocated data except for the
node record itself
for which I have documented that the tree takes care.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net

 | Replies | Author | Date
4150 | Re: Freeing resources | Jim Kueneman | Sat 10/20/2001


re: Node data question

From: [subscribedlists@b...]
Date: Sat Oct 20, 2001 5:35 pm
Subject: Re: Node data question

> Is it possible to store in "Data" an address to an object? So
> NodeDataSize is 4, and when we need the data, we typecast the
> address stored? This way we could uses objects to store, and
> not records :-)
>
> Something like
>
> var
> MyObject : TMyObject; --> class not record
> Node : PVirtualNode;
> NodeData : PInteger;
> begin
> MyObject := TMyObject.Create;
> Node := VT.AddChild( nil );
> NodeData := VT.GetNodeData( Node );
> NodeData^:= Integer( MyObject );
> end;
>
> than it would be nice to retrieve it back like in:
>
> ... GetNodeWidth, DrawNode etc methods
> var
> MyObject : TMyObject;
> begin
> MyObject := TMObject( VT.GetNodeData( Node ) );
> end;

You should be able to store object references, only you don't want to
replace the NodeData record, you want to add a field to the NodeData
instead. Without actually testing this, it should look something like:

Type
PNodeData = ^TNodeData;
TNodeData = record
Caption : string;
ObjectPtr : Pointer; // You could try integer here also.
end;

Then when you want to obtain the object, just type cast it like so:

var
MyObject: TMyObject;
NodeData: PNodeData
begin
NodeData := VT.GetNodeData( Node );
MyObject := TMyObject( NodeData.ObjectPtr );
...

Lastly, I always try to use indirection to reference the tree itself
so that I can use more than one tree on the same form. Then you can
share event handlers with all the trees. For example, try using:

NodeData := Sender.GetNodeData( Node );

Using "Sender" allows you to use whichever tree called the handler.
Now you can use more trees and only write one handler to share among
them. (fewer typing cramps!) <Big Grin>

Hope this helps you out.

Doug


re: Freeing resources

From: "Jim Kueneman" [jimdk@m...]
Date: Sat Oct 20, 2001 7:24 pm
Subject: Re: Freeing resources

>
> It wouldn't change anything, Jim. I cannot do a Dispose on an
untyped pointer. The

Your right. I had my brain in Park. The compiler has no idea what
the contents of the untyped pointer are so Dispose won't work.

Jim


New file uploaded to VirtualTreeview

From: [VirtualTreeview@yahoogroups.com>
Date: Sat Oct 20, 2001 7:59 pm
Subject: New file uploaded to VirtualTreeview

Hello,

This email message is a notification to let you know that
a file has been uploaded to the Files area of the VirtualTreeview
group.

File : /VirtualTree_2.5.43.zip
Uploaded by : [lists@l...]
Description : Release candidate 1

You can access this file at the URL

http://groups.yahoo.com/group/VirtualTreeview/files/VirtualTree_2.5.43.zip

To learn more about file sharing for your group, please visit

http://help.yahoo.com/help/us/groups/files

Regards,

lists@l...]

 | Replies | Author | Date
4152 | Re: New file uploaded to VirtualTreeview | Mike Lischke | Sat 10/20/2001
4154 | Re: New file uploaded to VirtualTreeview | Jim Kueneman | Sun 10/21/2001
4155 | Re: New file uploaded to VirtualTreeview | Jim Kueneman | Sun 10/21/2001
4205 | Re: New file uploaded to VirtualTreeview | Mike Lischke | Mon 10/22/2001
4211 | Re: New file uploaded to VirtualTreeview | Jim Kueneman | Tue 10/23/2001
4232 | Re: New file uploaded to VirtualTreeview | Mike Lischke | Tue 10/23/2001


re: New file uploaded to VirtualTreeview

From: "Mike Lischke" [lists@l...]
Date: Sat Oct 20, 2001 8:23 pm
Subject: RE: [VirtualTreeview] New file uploaded to VirtualTreeview

> This email message is a notification to let you know that
> a file has been uploaded to the Files area of the VirtualTreeview
> group.
>
> File : /VirtualTree_2.5.43.zip
> Uploaded by : [lists@l...]
> Description : Release candidate 1

Again, here is a new update of VT. The following things have been changed:

- VTHeaderPopup is now in the distribution (thanks to Ralf for the code and
Roland for the icon)
- improved ShortenString function (no more binary search, there is an API for
that)
- conditional compilation of flat scroll bars (see symbol UseFlatScrollbars)
- header drop mark is not shown if the column being dragged is also the current
drop target
- TBaseVirtualTree.GetHeaderClass (allows creating an own header class)
- correct space distribution for centered column headers showing also the sort
indicator
- reset of FRangeAnchor when node is deleted
- bug fixes

Some notes:

1) Scrollbars: Today I had the opportunity to test VT's scrollbars on my brand
new Windows XP Pro
installation. Unfortunately, there is still a major problem and I have no clue
how to solve it. The
problem is that the default window handler (when called with WM_PRINT and
flagged with the
non-client area flag) draws the old style scrollbars into the provided bitmap,
while the look on the
screen is ok. This produces the strange effect that, during drag'n drop with
alpha blended drag
image, half of the scroll bar is painted in new style and the other half in old
style.

2) Check images, header XP style on Windows XP: Although I copied and pasted
the images from the
visual styles description page, they do not exactly correspond to the
images/colors actually shown.
Aside this, colors and forms of buttons etc. might change on Windows XP when
changing the desktop
theme. Hence I decided to implement full theme support. Werner, nobody answered
your announcement in
the news groups about the (partial) translated uxTheme etc. files. Now I would
be very happy if you
could assist me in getting this running. I downloaded the ThemesExplorer from
the MSDN homepage and
found that everything VT needs is in the themes API (including plus/minus
buttons and header
buttons).

3) Alpha blending: I'm still not very satisfied with the speed of the alpha
blending code,
particularly the part for the selection rectangle. I had a discussion with
Danny Thorpe (from
Borland, he's the man behind things like the Graphics unit or MMX/SSE assembler
implementations) and
he gave me some hints but even when using the tips I could not get the code
(significantly) faster
than it is currently. Please, if there is anybody of you who is very familiar
with MMX (and/or SSE,
the Athlon 4 supports SSE1 AFAIK) then please contact me privately to help
improving the code.

4) Drag image: Jim, how is the stand of your drag image helper stuff? Is it
something I could take
into VT? I don't care if it only works on 2K/XP. The "old" stuff still works on
9x/ME and this is
enough, but your code could solve the problem I mentioned in 1. Hopefully, it
is not another 1000
lines of code :o]

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net

 | Replies | Author | Date
4154 | Re: New file uploaded to VirtualTreeview | Jim Kueneman | Sun 10/21/2001
4155 | Re: New file uploaded to VirtualTreeview | Jim Kueneman | Sun 10/21/2001
4205 | Re: New file uploaded to VirtualTreeview | Mike Lischke | Mon 10/22/2001
4211 | Re: New file uploaded to VirtualTreeview | Jim Kueneman | Tue 10/23/2001
4232 | Re: New file uploaded to VirtualTreeview | Mike Lischke | Tue 10/23/2001


Re[2]: Problem: show/hide columns

From: Oleg Kraynov [olegvkr@y...]
Date: Sat Oct 20, 2001 11:09 pm
Subject: Re[2]: [VirtualTreeview] Problem: show/hide columns

Hi, Mike.

ML> I cannot reproduce this problem (used this in a product of my company and
it worked fine). Can you
ML> please provide a simple demo?

Sorry... The inexact example. I has missed the first column (column 0).

In addition:
Header.Options contains hoAutoResize.
Header.AutoResizeIndex = 1.

Procedure of switching a columns is trivial:
TVTColumnOptions visible_option; visible_option << coVisible;

vst->BeginUpdate();
if (vst->Header->Columns->Items[2]->Options.Contains(coVisible)) {
vst->Header->Columns->Items[2]->Options -= visible_option;
vst->Header->Columns->Items[3]->Options += visible_option;
}
else {
vst->Header->Columns->Items[2]->Options += visible_option;
vst->Header->Columns->Items[3]->Options -= visible_option;
}
vst->EndUpdate();

Send the file of example on email? or upload to the Files area?

--
Best regars,
Oleg

_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com

 | Replies | Author | Date
4204 | Re: Re[2]: [VirtualTreeview] Problem: show/hide c | Mike Lischke | Mon 10/22/2001
4220 | Re[4]: [VirtualTreeview] Problem: show/hide colum | Oleg Kraynov | Tue 10/23/2001
4287 | Re: Re[4]: [VirtualTreeview] Problem: show/hide c | Mike Lischke | Sat 10/27/2001


re: New file uploaded to VirtualTreeview

From: Jim Kueneman [jimdk@m...]
Date: Sun Oct 21, 2001 2:08 am
Subject: RE: [VirtualTreeview] New file uploaded to VirtualTreeview

>
>4) Drag image: Jim, how is the stand of your drag image helper stuff? Is
>it something I could take
>into VT? I don't care if it only works on 2K/XP. The "old" stuff still
>works on 9x/ME and this is
>enough, but your code could solve the problem I mentioned in 1. Hopefully,
>it is not another 1000

Are you talking about the IXXXHelper interfaces? If so the declaration of
the interfaces is more than the code <g>. Let me kown what you need and I
can copy it out of VET, or you can dig for it your self.

Jim


re: New file uploaded to VirtualTreeview

From: Jim Kueneman [jimdk@m...]
Date: Sun Oct 21, 2001 2:35 am
Subject: RE: [VirtualTreeview] New file uploaded to VirtualTreeview

Hi Mike,

> > a file has been uploaded to the Files area of the VirtualTreeview
> > group.
> >
> > File : /VirtualTree_2.5.43.zip
> > Uploaded by : [lists@l...]
> > Description : Release candidate 1

Two things,

1) VT contain a Types in the uses clause that I had to comment out to compile.
2) It contains function ScrollBarProp that is not used or exported

Jim

 | Replies | Author | Date
4205 | Re: New file uploaded to VirtualTreeview | Mike Lischke | Mon 10/22/2001
4211 | Re: New file uploaded to VirtualTreeview | Jim Kueneman | Tue 10/23/2001
4232 | Re: New file uploaded to VirtualTreeview | Mike Lischke | Tue 10/23/2001


re: VTreeView with a database

From: [christophe37fr@y...]
Date: Sun Oct 21, 2001 8:30 am
Subject: Re: VTreeView with a database

--- In [VirtualTreeview@y...], Werner Lehmann [wl@b...] wrote:
> [christophe37fr@y...] wrote:
> >
> > Hello !!
> > I try to used the VTrreView with a database, but i have a lot of
> > problems with my datafields .IT's look like different than the
TreeNT
> > and i can't obtain all datas from my database.could you help me
> > please.
>
> I suppose you should give us more details where your problems with
VT
> exactly are.
>
> Werner

Ok With TreeNT I used it in order to create a hierarchy ex : Level
0 : a Company's name and for each record of my database, the
employee's name.

It's easier than VT in TreeNT.


re: Drag'nDrop, Please help...

From: "Mike Lischke" [lists@l...]
Date: Sun Oct 21, 2001 10:10 am
Subject: RE: [VirtualTreeview] Drag'nDrop, Please help...

Hi Robert,

> it seems that on node moving never calls the onsave and onload prior
> to node moving so user could get its own data to define whether the
> move is valid or not. I changed the MoveTo (I should have override
> but it is not virtual) from the base to reflect the way that was
> working for copyto and it works correctly.
> Please let me know if there are any better way to do it or if this is
> ok?

I'm not sure what you want with your implementation. What you have sent is
basically what's already
in the code less the branch when moving nodes within the same tree. And this
special case does not
need OnLoadNode and OnSaveNode because the app. would only save a node's data
just to load it
shortly afterwards into the same location as it was before. Addtionally,
leaving out this branch
effectively removes the optimal move operation, which requires the least memory
and time of all node
move/copy variants.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net

 | Replies | Author | Date
4188 | Re: Drag'nDrop, Please help... | [robertlau_z@y...] | Mon 10/22/2001
4228 | Re: Drag'nDrop, Please help... | Mike Lischke | Tue 10/23/2001
4309 | Copying part of a tree to another tree | Franc van de Westelaken | Sat 10/27/2001
4321 | Re: Copying part of a tree to another tree | Mike Lischke | Sun 10/28/2001
4323 | Re: Copying part of a tree to another tree | Franc van de Westelaken | Sun 10/28/2001
4331 | Re: Copying part of a tree to another tree | Paul D'Agosta | Mon 10/29/2001


Flat scrollbars....

From: "Christian Petersen" [thechicane@y...]
Date: Sun Oct 21, 2001 10:10 am
Subject: Flat scrollbars....

Help me I'm blind!
Where exactly (!) do I enable the "UseFlatScrollbars"
in "virtualtrees.pas"? I'm stuck...

Thanks alot!
Christian Petersen / Heidelberg
([chris@c...])

 | Replies | Author | Date
4160 | Re: Flat scrollbars.... | Oleg Kraynov | Sun 10/21/2001


re: Unicode and VirtualStringTree

From: "Mike Lischke" [lists@l...]
Date: Sun Oct 21, 2001 10:19 am
Subject: RE: [VirtualTreeview] Unicode and VirtualStringTree

> I want to use the IME in Windows 2000 Professional (English
> version) to edit a node and type in Chinese characters. At
> the moment it always displays the text as question marks
> (e.g. '???')
>
> Do I need to set the component to use some special font?
> Any special settings? Something to do in Windows?

Well, this is a bit difficult. The edit in the default caption editor is not
Unicode aware (it's
just a normal TEdit). So the only way to get it working as you want it is to
use a chinese Windows
version or set a user's locale to chinese. This way the characters passed in by
the IME will be
converted to MBCS with the correct locale. Under an english Windows version the
english locale will
be used which of course produces the wrong mappings for chinese text.

The only way to make this working on all Windows platforms is to use an editor
which is capable of
accepting and displaying Unicode. The only standard control in Delphi which can
this is TRichEdit.
But the rich edit control cannot pass back Unicode to the application which
makes it so useless for
this task. Hence you won't come around to write an edit yourself, buy one (e.g.
www.trichedit.com)
or use a far east Windows version.

> I realise that I still need to retrieve and store the
> Unicode in a database (going to be a bit of a problem
> because I use BDE - will switch to ADO), but thats for
> another day.

That's actually a bit easier than you might think. If you don't need to search
in the database for
the strings then convert them to UTF-8 (which is a byte based format and can be
stored in the Delphi
string type). For code to convert UTF-16 to UTF-8 and vice versa download my
Unicode unit at
www.delphi-unicode.net or the JEDI code library which also contains this unit
from
www.delphi-jedi.org.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: Flat scrollbars....

From: Oleg Kraynov [olegvkr@y...]
Date: Sun Oct 21, 2001 10:31 am
Subject: Re: [VirtualTreeview] Flat scrollbars....

Hi, Christian.

{.$define UseFlatScrollbars} <--> {$define UseFlatScrollbars}

--
Best regards,
Oleg

_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


re: BUG: copying to clipboard

From: "Mike Lischke" [lists@l...]
Date: Sun Oct 21, 2001 11:04 am
Subject: RE: [VirtualTreeview] BUG: copying to clipboard

> At copying to clipboard if there are invisible columns, header is copied
correct, but nodes wrong.
> The data of nodes are copied without checking the Column.Options coVisible.

Fixed now.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: BUG(BCB5): Text & wchar_t

From: "Mike Lischke" [lists@l...]
Date: Sun Oct 21, 2001 11:09 am
Subject: RE: [VirtualTreeview] BUG(BCB5): Text & wchar_t

Oleg,

> OnGetText (... WideString& Text)
> Text = "Data"; (const char*) - all OK!
> --
> Text = L"Data"; (const wchar_t*)
>
> AuoFit main column on double click:
> Show the raw data of nodes in this column!!!

I'm sorry, but I don't understand what you mean here. Can you please try again
and reformulate your
problem?

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net

 | Replies | Author | Date
4170 | Re[2]: [VirtualTreeview] BUG(BCB5): Text & wchar_ | Oleg Kraynov | Sun 10/21/2001


re: Licensing?

From: "Mike Lischke" [lists@l...]
Date: Sun Oct 21, 2001 11:10 am
Subject: RE: [VirtualTreeview] Licensing?

> Nothing else. Use it, maybe give credit to Mike, but do not redistribute
> a changed source. AFAIK.

Actually, the MPL states that you also may distribute changed sources but you
have to mark it
clearly as not being the original source, who made the changes, when were they
made and what has
been changed.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: GetDisplayRect for Header

From: "Mike Lischke" [lists@l...]
Date: Sun Oct 21, 2001 11:16 am
Subject: RE: [VirtualTreeview] GetDisplayRect for Header

Trevis,

> I need to get the text display rect for a column header.
>
> I know that for nodes I can use GetDisplayRect(Node, Column,
> TextOnly) and for the header?

There is no such method in VT. Until now there was never a need. If you like
you can add a
wish/suggestion into the wish list table in the database area of the mailing
list at YG. Providing
source code for this feature would be even better. Then it would even be likely
that it will be
taken into the official source before the new official version is published.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net

 | Replies | Author | Date
4186 | Re: GetDisplayRect for Header | [jogador3@y...] | Mon 10/22/2001


re: Bug with KillFocus Workaround

From: "Mike Lischke" [lists@l...]
Date: Sun Oct 21, 2001 11:20 am
Subject: RE: [VirtualTreeview] Bug with KillFocus Workaround

> if Assigned(Form) and (Form is TForm) then
>
> is this workaround for the workaround ok this way? *g*

Perfekt. :o]

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net

 | Replies | Author | Date
4176 | Re: Bug with KillFocus Workaround | Theodor Kleynhans | Sun 10/21/2001
4207 | Re: Bug with KillFocus Workaround | Mike Lischke | Mon 10/22/2001
4209 | Re: Bug with KillFocus Workaround | Theodor Kleynhans | Tue 10/23/2001


re: TVTHeader - Parent Font ?

From: "Mike Lischke" [lists@l...]
Date: Sun Oct 21, 2001 11:24 am
Subject: RE: [VirtualTreeview] TVTHeader - Parent Font ?

John,

> Is there a way of simulating a ParentFont property for a TVTHeader
> object ?
>
> If not, could this be added as a feature in a future version.

Please make an entry into the wish list table in the database area at YG.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: TVTHeader.Invalidate Type Bug

From: "Mike Lischke" [lists@l...]
Date: Sun Oct 21, 2001 11:25 am
Subject: RE: [VirtualTreeview] TVTHeader.Invalidate Type Bug

> there seems to be a typo bug in TVTHeader.Invalidate:
>
> Column := nil;
> if Column = nil then
> R := TreeView.GetHeaderRect
> else
> R := Column.GetRect;
>
> The if-statement is worthless if Column is set to nil anyway.

This is already fixed in the latest build.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: VST: Tab key in Edit mode switches focus

From: "Mike Lischke" [lists@l...]
Date: Sun Oct 21, 2001 11:43 am
Subject: RE: [VirtualTreeview] VST: Tab key in Edit mode switches focus

> pressing the TAB key while editing a node in TVirtualStringTree DOES change
the focus to
> the next control, i.e. the edit window and the tree loose focus.
>
> There is no chance of suppressing this with the tree's key press / down / up
events,
> because the TAB key is eaten up by the edit control and is not forwarded to
the tree.
>
> This situation is especially confusing to users who try to tab to the next
column like in Excel.
>
> A solution requires some changes to TVtEdit along the following lines:

Thank you Ralf. This is now implemented.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: VST: Pressing Escape key in edit mode

From: "Mike Lischke" [lists@l...]
Date: Sun Oct 21, 2001 11:47 am
Subject: RE: [VirtualTreeview] VST: Pressing Escape key in edit mode

> I was surprised to find the Escape key being forwareded to the tree if
pressed during a VST edit.
>
> My assumption was that the Escape key had done its purpose by ending the
edit. My
> intention was to close a form when a user presses escape. However, the form
closed as
> well when aborting the edit.
>
> I have fixed this by checking for IsEditing, but I am still curious to know
if this
> behaviour is intended?

What is wrong with that behavior? Yes, this is intended and a valid operation
if the user wants to
cancel something. In the VCL such interferences are quite common. Think only of
the actions and
standard edits. With actions in an application standard edits cannot use
Ctrl+C, Ctrl+V
automatically if you also have actions with these shortcuts, etc.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


Re[2]: BUG(BCB5): Text & wchar_t

From: Oleg Kraynov [olegvkr@y...]
Date: Sun Oct 21, 2001 3:20 pm
Subject: Re[2]: [VirtualTreeview] BUG(BCB5): Text & wchar_t

Hi, Mike.

In version .43 no this error. Now error in oleaut32.dll.
IMHO, This specific (or error) of realization of class WideString in
BCB (the typecasting is required).

This not error of VirtualTrees.

--
Best regards,
Oleg

_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


re: Node data question

From: Werner Lehmann [wl@b...]
Date: Sun Oct 21, 2001 4:38 pm
Subject: Re: [VirtualTreeview] Node data question

Hi Lucian,

> Is it possible to store in "Data" an address to an object? So NodeDataSize
> is 4, and when we need the data, we typecast the address stored? This way we
> could uses objects to store, and not records :-)

Here's what I use for that purpose:

procedure SetObject(Tree: TBaseVirtualTree; Node: PVirtualNode; Obj: TObject);
var
Data: pointer;
begin
assert(Node <> nil);
Data := Tree.GetNodeData(Node);
assert(Data <> nil);
TObject(Data^) := Obj;
end;

function GetObject(Tree: TBaseVirtualTree; Node: PVirtualNode): TObject;
var
Data: pointer;
begin
assert(Node <> nil);
Data := Tree.GetNodeData(Node);
if Data = nil then
Result := nil
else
Result := TObject(Data^);
end;

You can use them, or maybe you spot where your problem is :)

Regards,
Werner

 | Replies | Author | Date
4212 | Re: Node data question | Bender Heri | Tue 10/23/2001


re: Re: VTreeView with a database

From: Werner Lehmann [wl@b...]
Date: Sun Oct 21, 2001 4:44 pm
Subject: Re: [VirtualTreeview] Re: VTreeView with a database

Hi Christophe,

> Ok With TreeNT I used it in order to create a hierarchy ex : Level
> 0 : a Company's name and for each record of my database, the
> employee's name.
>
> It's easier than VT in TreeNT.

This may be because TreeNT is not virtual and allows you to store your user
data in the tree nodes. But I don't know this because I never used TreeNT. In
any
way, VT is just a view to your data. It forces you to store the data in your
own structures. Which is good IMO. You should not bind data to a visual control.

I have done the same for my company: a derived VT displays 13 different trees
which come all from an Oracle db. So its quite possible. But I am sorry, your
question is still not specific enough to answer (at least by me). If you want
a full source example on how to do this I cannot give it to you. It depends
on your data and database anyway.

Werner

 | Replies | Author | Date
4227 | Re: VTreeView with a database | [christophe37fr@y...] | Tue 10/23/2001


re: New file uploaded to VirtualTreeview

From: Werner Lehmann [wl@b...]
Date: Sun Oct 21, 2001 5:30 pm
Subject: Re: [VirtualTreeview] New file uploaded to VirtualTreeview

Hi Mike,

welcome back from Turkey.

> - conditional compilation of flat scroll bars (see symbol UseFlatScrollbars)

Thanks for not removing this altogether. I can confirm the problems XP has with
flat scrollbars.
Or at least I have trouble to switch between flat and normal scrollbars on XP.
I want to have XP
scrollbars in XP and give the user the choice with other OS's. The behaviour
(esp. roll over
effect) indicates that the XP scrollbar style is a close relative of the flat
scrollbar so
it fits well into my app.

> - reset of FRangeAnchor when node is deleted

And probably FocusedNode as well... (unless you forgot it, just a reminder
without prior checking).

> 2) Check images, header XP style on Windows XP: Although I copied and pasted
the images from the
> visual styles description page, they do not exactly correspond to the
images/colors actually shown.
> Aside this, colors and forms of buttons etc. might change on Windows XP when
changing the desktop
> theme. Hence I decided to implement full theme support. Werner, nobody
answered your announcement in
> the news groups about the (partial) translated uxTheme etc. files. Now I
would be very happy if you
> could assist me in getting this running. I downloaded the ThemesExplorer from
the MSDN homepage and
> found that everything VT needs is in the themes API (including plus/minus
buttons and header
> buttons).

I am opening another thread for this so Vadim does have to vent again over big
"New file uploaded to
VirtualTreeview" threads :)

3) Alpha blending: I'm still not very satisfied with the speed of the alpha
blending code,
particularly the part for the selection rectangle. I had a discussion with
Danny Thorpe (from
Borland, he's the man behind things like the Graphics unit or MMX/SSE assembler
implementations) and
he gave me some hints but even when using the tips I could not get the code
(significantly) faster
than it is currently. Please, if there is anybody of you who is very familiar
with MMX (and/or SSE,
the Athlon 4 supports SSE1 AFAIK) then please contact me privately to help
improving the code.

Mike, I don't believe that there is much to be emberassed about in your alpha
blending code. I
suggest you open a folder on XP, with many files. Make that folder window
large, or maximize it.
No select fast with mouse, and notice that even the XP alpha blending is far
from perfect. I don't
see that yours is any slower than this.

Regards,
Werner


Visual themes support

From: Werner Lehmann [wl@b...]
Date: Sun Oct 21, 2001 7:44 pm
Subject: Visual themes support

> 2) Check images, header XP style on Windows XP: Although I copied and pasted
the images from the
> visual styles description page, they do not exactly correspond to the
images/colors actually shown.
> Aside this, colors and forms of buttons etc. might change on Windows XP when
changing the desktop
> theme. Hence I decided to implement full theme support. Werner, nobody
answered your announcement in
> the news groups about the (partial) translated uxTheme etc. files. Now I
would be very happy if you
> could assist me in getting this running. I downloaded the ThemesExplorer from
the MSDN homepage and
> found that everything VT needs is in the themes API (including plus/minus
buttons and header
> buttons).

Well, there is a (small) number of people who wrote me back on this (including
Ray Konopka, who will
give a talk on this matter at the next BorCon) but they did not send a copy to
the group :)

I am also happy that you decided to natively support themes. I have created a
VST descendant which
is theme aware. It detects the presence of a theme and simply toggles the XP
relevant options. Quite
some overhead was necessary for that because I wanted to keep values which are
assigned to the check-
images, header style etc. while the VST itself had to use other values for
these properties (the XP
ones). This approach had the single advantage that I could still adjust these
properties and switch
forth and back to the XP style and my custom style with a single option change.
This all required that
I override some option properties.

It gets much easier if you support the visual styles from within the base
virtualtree. And it
supports both VDT and VST together, clearly the superior solution. Plus added
flexibility for different
themes. It is quite easy to draw the required UI elements. Much easier than
your simulation of the column
headers. It requires a few functions from uxtheme.dll and a few constants from
tmSchema.h. I don't know
how you want to provide these to the VT. Either you import only the required
functions directly in
VirtualTrees.pas or add uxTheme.pas and tmSchema.pas to the distribution,
although they are not completly
translated and do not match Borland's strict rules for header conversions
(AFAIK they don't even have
a dynamically loading import unit at all).

I am creating an example project which demonstrates header drawings. The
tree-button, checkbox and
radiobutton drawings are very similar. Ok, you'll find it here:

http://groups.yahoo.com/group/VirtualTreeview/files/Examples/Delphi_Examples/Vis\
ual%20Styles.zip

For the VT I suggest to add a new paint option "toThemeAware". When this option
is active the tree
detects if it runs on a themed XP (or generally on an OS with uxTheme.dll
available) and adjusts its
drawing automatically. To detect if a theme has to be employed the tree can use
the IsAppThemed()
function from uxTheme. To detect whenever the theme changes (classic <-> blue
<-> silver <-> ...)
the message WM_THEMECHANGED must be handled.

Werner

 | Replies | Author | Date
4175 | Re: Visual themes support | Jim Kueneman | Sun 10/21/2001
4177 | Re: Visual themes support | Theodor Kleynhans | Sun 10/21/2001
4178 | Re: Visual themes support | Christian Petersen | Sun 10/21/2001
4179 | Re: Visual themes support | Werner Lehmann | Sun 10/21/2001
4180 | Re: Visual themes support | Werner Lehmann | Sun 10/21/2001
4206 | Re: Visual themes support | Mike Lischke | Mon 10/22/2001
4239 | Re: Visual themes support | Werner Lehmann | Tue 10/23/2001
4253 | Re: Visual themes support | Mike Lischke | Wed 10/24/2001


re: Visual themes support

From: Jim Kueneman [jimdk@m...]
Date: Sun Oct 21, 2001 9:17 pm
Subject: Re: [VirtualTreeview] Visual themes support

> > 2) Check images, header XP style on Windows XP: Although I copied and
> pasted the images from the
> > visual styles description page, they do not exactly correspond to the
> images/colors actually shown.
> > Aside this, colors and forms of buttons etc. might change on Windows XP
> when changing the desktop

Hi Werner,

Does XP support the expandandable ZIP files through a namespace extension
like WinME? I have a copy but I am reluctant to install it yet <g>. If
you are still playing with the OLEDragManager the latest version is in the
VirtualShellTool package.

Jim

 | Replies | Author | Date
4177 | Re: Visual themes support | Theodor Kleynhans | Sun 10/21/2001
4178 | Re: Visual themes support | Christian Petersen | Sun 10/21/2001


re: Bug with KillFocus Workaround

From: "Theodor Kleynhans" [theodor.yahoogroups@s...]
Date: Sun Oct 21, 2001 9:58 pm
Subject: RE: [VirtualTreeview] Bug with KillFocus Workaround

Hi,

> if Assigned(Form) and (Form is TForm) then
---
Of course, the "Assigned(Form)" is not necessary since "is" returns
false if the Object being tested is nil (which makes sense, since "nil"
is not a TForm ;).

Cheers,
Theodor

 | Replies | Author | Date
4207 | Re: Bug with KillFocus Workaround | Mike Lischke | Mon 10/22/2001
4209 | Re: Bug with KillFocus Workaround | Theodor Kleynhans | Tue 10/23/2001


re: Visual themes support

From: "Theodor Kleynhans" [theodor.yahoogroups@s...]
Date: Sun Oct 21, 2001 10:08 pm
Subject: RE: [VirtualTreeview] Visual themes support

Hi Jim,

> Does XP support the expandandable ZIP files through a
> namespace extension like WinME?
---
Yes.

> I have a copy but I am reluctant to install it yet <g>.
---
I was also but finally decided to take the plunge. I'm glad I did. It
definitely feels faster than Win2K on my Compaq PIII-600 laptop and I
haven't had a crash in over a week (since I installed it).

Cheers,
Theodor

 | Replies | Author | Date
4178 | Re: Visual themes support | Christian Petersen | Sun 10/21/2001


re: Visual themes support

From: "Christian Petersen" [thechicane@y...]
Date: Sun Oct 21, 2001 11:03 pm
Subject: Re: Visual themes support

Hi Theodor!

> definitely feels faster than Win2K on my Compaq PIII-600 laptop and
> I haven't had a crash in over a week (since I installed it).

I must admit that it's as stable as Win2K on my PIII-1GHz laptop -
but in my eyes it's much slower than Win2k was... I don't know why.
In the end XP is nothing more than Win2K with a cute skin... Sorry,
to say that, but Win2K rulez > the windows and buttons in XP are too
big. ;)) *hehe*

Okay. Enough off-topic today.
Greetz
Chris


re: Visual themes support

From: Werner Lehmann [wl@b...]
Date: Sun Oct 21, 2001 11:46 pm
Subject: Re: [VirtualTreeview] Visual themes support

Jim Kueneman wrote:
>
> Does XP support the expandandable ZIP files through a namespace extension
> like WinME? I have a copy but I am reluctant to install it yet <g>. If
> you are still playing with the OLEDragManager the latest version is in the
> VirtualShellTool package.

Think so. At least the explorer can put a zip file as virtual folder in the
treeview and show its contents in the listview. Have not experimented much with
this, it does not always do this. In a folder with many zips it will not make
virtual folders of each one...

Werner


re: Visual themes support

From: Werner Lehmann [wl@b...]
Date: Sun Oct 21, 2001 11:47 pm
Subject: Re: [VirtualTreeview] Visual themes support

Theodor Kleynhans wrote:
>
> I was also but finally decided to take the plunge. I'm glad I did. It
> definitely feels faster than Win2K on my Compaq PIII-600 laptop and I
> haven't had a crash in over a week (since I installed it).

I see no speed up, it's at most on par with Win2k. But then I have only
a Celeron 533 here...

Werner


Invalid typecast

From: [basil@r...]
Date: Mon Oct 22, 2001 5:07 am
Subject: Invalid typecast

Hi Mike!

Please change the following line:

if Assigned(Form) then ...

(in WMKillFocus procedure) to

if Assigned(Form) and (Form is TForm) then

because TActiveForm is not a TForm.

Thank you.
Basil

 | Replies | Author | Date
4208 | Re: Invalid typecast | Mike Lischke | Mon 10/22/2001


re: Division by zero when installing VT 2.5.40 to BCB

From: "Roland" [Beduerftig@S...]
Date: Mon Oct 22, 2001 9:20 am
Subject: Re: Division by zero when installing VT 2.5.40 to BCB

Hi Mike,

> > if Images.Height <> 0 then
> > for I := 0 to (Images.Width div Images.Height) - 1 do...
>
> So be it then. But since this is nothing which will change during
runtime I have included an
> assertion.
>
> Ciao, Mike

you're right, an assertion is enough, because the main problem was the
wrong (old) *.res file and not the code in VT, and the assertion
remember the developer to check whether all files have the correct
version.

thanks
Roland


VST doesn't show all lines

From: Michael Valentiner=Branth [MichaelVB@g...]
Date: Mon Oct 22, 2001 9:39 am
Subject: VST doesn't show all lines

Hello,

I have a strange problem with one of my VSTs:
It always 'hides' the last 5 or 6 lines.

Hard to describe, I'll try with an example:
- there are 30 visible nodes resp. lines in my VST
- the window's height is approx. 20 lines
- there's a schrollbar, that gives only access to the first 24 lines
- if I change the window's height to 24 lines, the scrollbar
disappears, so again, the user cannot access the last 6 lines.

ChildCount gives the right number (30).
Whether there are 30 or 300 lines visible in the tree, always the last
5 or 6 cannot be accessed.

I had the problem with an older version, and still have it after an
update to 2.5.40.

Bug? Any wrong configuration?

Michael

 | Replies | Author | Date
4185 | Re: VST doesn't show all lines | Helge Jung (ECO-Logic) | Mon 10/22/2001
4187 | Re: VST doesn't show all lines | Ralf Melles | Mon 10/22/2001
4225 | Re: VST doesn't show all lines | Michael Valentiner=Branth | Tue 10/23/2001


re: Freeing resources

From: GIANNAKOPOULOS KOSTAS [kyan@s...]
Date: Mon Oct 22, 2001 9:30 am
Subject: RE: [VirtualTreeview] Freeing resources

I'm sorry, Jim but Dispose() would not work either. For it to work the
passed parameter MUST be typed so that the compiler can determine what type
information to pass to System._Finalize (Notice that it expects a TypeInfo
pointer in EDX). Without type information no finalization will be done.

I had suggested a solution to this (passing an optional TypeInfo pointer to
NodeDataSize event or defining a OnNodeTypeInfo event) but it was rejected
by Mike.

> -----Original Message-----
> From: Jim Kueneman [mailto:[jimdk@m...]]
> Sent: Saturday, October 20, 2001 7:17 AM
> To: VirtualTreeview@yahoogroups.com
> Subject: Re: [VirtualTreeview] Freeing resources
>
>
>
> >rocedure TForm1.MyTreeFreeNode(Sender: TBaseVirtualTree;
> Node: PVirtualNode);
> >var pl :PplstRec;
> >begin
> > pl := sender.GetNodeData(node);
> > pl.Filename := '';
> > pl.Text := ''
> >end;
> >
> >And then no leaks happens!
> >
> >Is it really nescessary to do this?
>
>
> Yes, the memory allocation scheme used in VT is not dynamic array or
> string aware. That works or
>
> Finalize(pl^);
>
> works too. I wish Mike would use New and Dispose <G>. I
> know about it and
> thanks to your question realized I forgot it in what I did today!
>
> Jim
>
>
> ------------------------ Yahoo! Groups Sponsor
> ---------------------~-->
> Pinpoint the right security solution for your company- Learn
> how to add 128- bit encryption and to authenticate your web
> site with VeriSign's FREE guide!
> http://us.click.yahoo.com/yQix2C/33_CAA/yigFAA/i7folB/TM
> --------------------------------------------------------------
> -------~->
>
> To unsubscribe from this group, send an email to:
> VirtualTreeview-unsubscribe@egroups.com
>
>
>
> Your use of Yahoo! Groups is subject to
> http://docs.yahoo.com/info/terms/
>
>


re: VST doesn't show all lines

From: "Helge Jung \(ECO-Logic\)" [helge@e...]
Date: Mon Oct 22, 2001 12:11 pm
Subject: Re: [VirtualTreeview] VST doesn't show all lines

> I had the problem with an older version, and still have it after an
> update to 2.5.40.

There's a 2.5.43 at the YG ... only as an information - I don't know a
solution to your problem.

Helge.


re: GetDisplayRect for Header

From: [jogador3@y...]
Date: Mon Oct 22, 2001 1:03 pm
Subject: Re: GetDisplayRect for Header

> Trevis,
>
> > I need to get the text display rect for a column header.
> >
> > I know that for nodes I can use GetDisplayRect(Node, Column,
> > TextOnly) and for the header?
>
> There is no such method in VT. Until now there was never a need. If
you like you can add a
> wish/suggestion into the wish list table in the database area of
the mailing list at YG. Providing
> source code for this feature would be even better. Then it would
even be likely that it will be
> taken into the official source before the new official version is
published.

Thanks Mike, but I already solved my problem. I wanted to use that to
auto fit columns considering the header text also. I am doing it by
adding the sizes of Canvas.TextWidth, margin, spacing, image.width
and sort glyph.

Bye

Trevis


re: VST doesn't show all lines

From: "Ralf Melles" [rmelles@g...]
Date: Mon Oct 22, 2001 2:01 pm
Subject: Re: VST doesn't show all lines

--- In [VirtualTreeview@y...], Michael Valentiner=Branth
[MichaelVB@g...] wrote:
> Hello,
>
> I have a strange problem with one of my VSTs:
> It always 'hides' the last 5 or 6 lines.

Hi Michael,

never heard about this problem! I heavily use VT and never got a
problem like this.

Can you post a small code-snipplet for testing?

Regards
Ralf

 | Replies | Author | Date
4225 | Re: VST doesn't show all lines | Michael Valentiner=Branth | Tue 10/23/2001


re: Drag'nDrop, Please help...

From: [robertlau_z@y...]
Date: Mon Oct 22, 2001 2:09 pm
Subject: Re: Drag'nDrop, Please help...

Hi Mike,

Thanks for the response.
Here is the situation: I'm drag'n droping nodes from different trees
in diferrent processes(non-VCL). OnNodeMoving and OnNodeCopying
contains the code to check the data that allows the node to move or
copy. OnLoadNode and OnsaveNode have the code to save/load the
necessary custom data for my app. In one of the past Post in this
forum, I read that in order to find out the custom data during a
drag'n drop one must attach code to onsavenode and onloadnode.
The app works ok when performing node copies for drag'n drop.
However, when I try moving problems occured. I trace the coding and
realize that I was trying to read custom data that did not exists for
the moving node. I compare the code for move versus copy and noted
that on the basetree implementation the streamming in and out in not
done prior calling OnNodeMoving therefore OnLoadNode and OnsaveNode
are never called. Nevertheless, when copying the streaming is done
prior OnNodeCopying therefore OnLoadNode and OnsaveNode are called
allowing then custom data to be loaded.
My intention on the modified code was to process streaming prior to
calling OnNodeMoving as it was implemented for OnNodeCopying.

Perphaps, it is due to my lack of understanding on implementing the
drg'n drop process. Can you please clarify, and suggest a better way
to handle this.

Thanks in advance,
RL

 | Replies | Author | Date
4228 | Re: Drag'nDrop, Please help... | Mike Lischke | Tue 10/23/2001
4309 | Copying part of a tree to another tree | Franc van de Westelaken | Sat 10/27/2001
4321 | Re: Copying part of a tree to another tree | Mike Lischke | Sun 10/28/2001
4323 | Re: Copying part of a tree to another tree | Franc van de Westelaken | Sun 10/28/2001
4331 | Re: Copying part of a tree to another tree | Paul D'Agosta | Mon 10/29/2001


New file uploaded to VirtualTreeview

From: [VirtualTreeview@yahoogroups.com>
Date: Mon Oct 22, 2001 2:16 pm
Subject: New file uploaded to VirtualTreeview

Hello,

This email message is a notification to let you know that
a file has been uploaded to the Files area of the VirtualTreeview
group.

File : /Descendants/DBVTD5.zip
Uploaded by : [wsntrl@o...]
Description : DBVT sources on pascal

You can access this file at the URL

http://groups.yahoo.com/group/VirtualTreeview/files/Descendants/DBVTD5.zip

To learn more about file sharing for your group, please visit

http://help.yahoo.com/help/us/groups/files

Regards,

wsntrl@o...]


re: New file uploaded to VirtualTreeview

From: "Vadim Sedulin" [wsntrl@o...]
Date: Mon Oct 22, 2001 2:22 pm
Subject: Re: [VirtualTreeview] New file uploaded to VirtualTreeview

Hello All!

----- Original Message -----
From: [VirtualTreeview@yahoogroups.com>
To: [VirtualTreeview@yahoogroups.com>
Sent: Monday, October 22, 2001 6:16 PM
Subject: [VirtualTreeview] New file uploaded to VirtualTreeview

> File : /Descendants/DBVTD5.zip
> Uploaded by : wsntrl@o...]
> Description : DBVT sources on pascal

- Translated as is, w/o code modification/optimization.
- Compiled, but not tested under D5/VT 2.5.43

Bye.

Vadim Sedulin
E-Mail: wsntrl@o...]


re: VST: Pressing Escape key in edit mode

From: Ralf Junker [ralfjunker@g...]
Date: Mon Oct 22, 2001 2:32 pm
Subject: RE: [VirtualTreeview] VST: Pressing Escape key in edit mode

Hi Mike,

>> I was surprised to find the Escape key being forwareded to the tree if
pressed during a VST edit.
>>
>> My assumption was that the Escape key had done its purpose by ending the
edit. My
>> intention was to close a form when a user presses escape. However, the form
closed as
>> well when aborting the edit.
>>
>> I have fixed this by checking for IsEditing, but I am still curious to know
if this
>> behaviour is intended?
>
>What is wrong with that behavior? Yes, this is intended and a valid operation
if the user wants to cancel something.

There is per se nothing "wrong" with it. I do in fact expext the Escape key in
the OnKeyPress / Down / Up events, _except_ when the tree is in edit state. But
when cancelling an edit, I would expect the OnEditCanceled _only_.

Nevertheless, knowing that the escape key will _always_ show in the OnKey...
events, I also know I need to handle it according to the tree's various states.

-- Ralf

PS: I was excited to find my VTHeaderPopupMenu included in the last version. I
am glad I could contribute a small part to this great component.


re: New file uploaded to VirtualTreeview

From: "Wim van der Vegt" [wvd_vegt@k...]
Date: Mon Oct 22, 2001 3:03 pm
Subject: Re: [VirtualTreeview] New file uploaded to VirtualTreeview

Hi,

I found the part on creating the alias a bit cryptic (odbc/bde alias?). And it
keeps asking me for a password. Any suggestions

----------------
Wim van der Vegt

----- Original Message -----
From: Vadim Sedulin
To: [VirtualTreeview@yahoogroups.com
Sent: Monday, October 22, 2001 4:22 PM
Subject: Re: [VirtualTreeview] New file uploaded to VirtualTreeview

Hello All!

----- Original Message -----
From: [VirtualTreeview@yahoogroups.com>
To: <VirtualTreeview@yahoogroups.com>
Sent: Monday, October 22, 2001 6:16 PM
Subject: [VirtualTreeview] New file uploaded to VirtualTreeview

> File : /Descendants/DBVTD5.zip
> Uploaded by : wsntrl@o...]
> Description : DBVT sources on pascal

- Translated as is, w/o code modification/optimization.
- Compiled, but not tested under D5/VT 2.5.43

Bye.

Vadim Sedulin
E-Mail: wsntrl@o...]

Yahoo! Groups Sponsor

To unsubscribe from this group, send an email to:
VirtualTreeview-unsubscribe@egroups.com

Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.

[Non-text portions of this message have been removed]


invalidatenode??

From: [rhymebusta@h...]
Date: Mon Oct 22, 2001 5:55 pm
Subject: invalidatenode??

hi i was wondering if anyone could tell me what the InvalidateNode()
method is used for???
can't find any documentation on it.

 | Replies | Author | Date
4194 | Re: invalidatenode?? | [rhymebusta@h...] | Mon 10/22/2001


re: invalidatenode??

From: [rhymebusta@h...]
Date: Mon Oct 22, 2001 5:59 pm
Subject: Re: invalidatenode??

--- In [VirtualTreeview@y...], [rhymebusta@h...] wrote:
> hi i was wondering if anyone could tell me what the InvalidateNode()
> method is used for???
> can't find any documentation on it.
forget it........i found some.


Simple Drag'n'Drop Example

From: "Tom Hahn" [thahn@h...]
Date: Mon Oct 22, 2001 7:40 pm
Subject: Simple Drag'n'Drop Example

I have tree data stored in an array from which the Virtual tree is created.
Nodes can be at four different levels. The program should allow dragging
(move only) from any node level to any other node level within the tree so
long as the destination node can accept the drop without exceeding 4 levels.
Dragging from other controls or applications is not required. The level of
the node can be identified from the node/array information, which point to
each other.

I am looking for a simple example of what is necessary to accomplish this.
Any sugegstions would be very welcome.

Tom

---------------------------------
Thomas Hahn
Hahn Technology, Inc.
mailto:[thahn@h...]
http://www.hahntech.com
---------------------------------
The home of:
Scan: Hardware/Software Inventory
WebBank: URL/Password Manager
---------------------------------

 | Replies | Author | Date
4229 | Re: Simple Drag'n'Drop Example | Mike Lischke | Tue 10/23/2001


re: VST: Size & Position of Edit window in right aligned column

From: "Mike Lischke" [lists@l...]
Date: Mon Oct 22, 2001 8:07 pm
Subject: RE: [VirtualTreeview] VST: Size & Position of Edit window in right aligned column

Hi Ralf,

> Observations:
>
> * Edit window is very narrow.
> * Entering more than 1 or 2 character hides all other current chars.
> * The edit window does not grow with the text typed.

I see what you mean and I'm not very happy with the current implementation. On
the other hand it is
explicitly marked as a generic and simple implementation which needs a lot
improvement (and be it
only Unicode capabilities).

I would appreciate very much any help from other people here to make the
generic editor much more
useful and working also for centered and right aligned columns. I can't do it
currently myself,
simply for lack of time.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: CheckState and Virtual Paradigm?

From: "Mike Lischke" [lists@l...]
Date: Mon Oct 22, 2001 8:14 pm
Subject: RE: [VirtualTreeview] CheckState and Virtual Paradigm?

> Wouldn't the tree benefit from including the checkstates (and maybe also the
checktype
> and align) element into the virtual paradigm?

Well, this is a very interesting question. You are totally right. I never
thought about this design
"problem". It was so clear to me to implement check support as it is now and
never had doubts about
it.

On the other hand if you want to ride the horse to death then you could say
that every property of a
node should be queried from the application (selection and check states,
visibility and node height
etc. etc.). VT's implementation is quite good but still far from ideal, I
think. Btw: how does an
ideal implementation look like?

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: Selection AV

From: "Mike Lischke" [lists@l...]
Date: Mon Oct 22, 2001 8:16 pm
Subject: RE: [VirtualTreeview] Selection AV

Hi Jim,

> After a node deletion (of a
> selected node) I try to multiselect more nodes I get an AV on line
> 17976. It appears the FRangeAnchor is still assigned but the address
> is invalid, ie the statement

I have already answered to this thread and have it also fixed. This problem is
hopefully gone.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: Using OnStructureChange after MoveTo???

From: "Mike Lischke" [lists@l...]
Date: Mon Oct 22, 2001 8:23 pm
Subject: RE: [VirtualTreeview] Using OnStructureChange after MoveTo???

Hi Doug,

> Should we just stay clear of using the node within the handler? It's
> nil most of the time anyway. If the node data cannot be accessed, I
> would suggest removing it from the handler's parameter list. It
> would be less confusing for new users. Anyone have any ideas? Has
> anyone found a way to access nodedata within the OnStructureChange?

Mmh, strange effect you describe here. Unfortunately, I cannot reproduce it. I
tried this code:

procedure TGeneralForm.VST2StructureChange(Sender: TBaseVirtualTree;
Node: PVirtualNode; Reason: TChangeReason);

var
Data: PNodeData2;
S: string;

begin
if Assigned(Node) then
begin
Data := Sender.GetNodeData(Node);
S := Data.Caption;
OutputDebugString(PChar(S));
end;
end;

and I had no problem, whatsoever. Can you make a small demo?

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: using vt2.5.4

From: "Mike Lischke" [lists@l...]
Date: Mon Oct 22, 2001 8:27 pm
Subject: RE: [VirtualTreeview] using vt2.5.4

Hi,

> hi i was wondering if anyone has made revisions to Mike's help file
> that he posted in the YG( on 05/21/2001 ) that reflects the changes
> that where made for v2.5.4.

No, not yet. I can do once in a while if preferred.

> 'cause i'm getting errors like new method declarations for methods
> that i use regularly like AddChild (i.e. it use to be
> AddChild(PVirtualNode) but is now AddChild(PVirtualNode, void *). )
> so it will really suck if i have to go through the VT source code
> everytime i get a error for wrong method declarations/usage....or for
> using types/structs/etc. that are no longer supported or included in
> the VT.

I'm sorry, but this is the result when using work in progress. We talked here
in the list about
those changes (you might not be subscribed at that time) and I also try to
minimize interface
changes whereever possible. But sometimes I cannot prevent signature changes.
But fortunatly, with
higher version numbers those changes become less and lesser :o]

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: Design question

From: "Mike Lischke" [lists@l...]
Date: Mon Oct 22, 2001 8:31 pm
Subject: RE: [VirtualTreeview] Design question

Hi Sanjay,

> For a selected disk drive, I want to keep the complete tree of file names,
> sizes and other attributes in a Virtual Treeview so that I can then
> analyze the stuff for various disk utilities without rescanning. I am a
> little unclear on how the virtual memory works. If I directly keep the
> data in a record on the node, how will it affect the physical memory for a
> large number of files? Once I know I will think of an alternative design
> if necessary. I will appreciate any thoughts on this.

Mmh, I'm not sure whether this is a good idea. You will lead the virtual
paradigm ad absurdum when
you load the full tree and keep in memory all the time. I think you should go
the more complex path
and load and unload tree parts on demand, even if this means to slow down the
entire process. And
don't forget: today's hard disks are really large. There can be tenthousands of
files...

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: Content to ?

From: "Mike Lischke" [lists@l...]
Date: Mon Oct 22, 2001 8:34 pm
Subject: RE: [VirtualTreeview] Content to ?

Hi Duke,

> 1) I see that ContentToXXX is defined only for VST (Not that I could
> have used it properly with VST without help :))

That's what the string tree is for. If you don't use it then you have to
implement parts of it
yourself (e.g. copy it out from VST).

> 2) I never programmed for Excel so I don't know how its files are
> built. I figure I should use components on the Servers tab(I am on
> D5) but again I don't know how.

Can't help either here. But you should be able to find some code on the major
Delphi server. Use
www.google.com for your search in the news groups.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: Drag and Drop

From: "Mike Lischke" [lists@l...]
Date: Mon Oct 22, 2001 8:35 pm
Subject: RE: [VirtualTreeview] Drag and Drop

> It works! It works! It works! I could kiss you for that hint (don't panic -
> I won't do ;-)) ... my problem was so easy that nobody thought about that, I
> guess *g*

:-))

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: Re[2]: Problem: show/hide columns

From: "Mike Lischke" [lists@l...]
Date: Mon Oct 22, 2001 8:36 pm
Subject: RE: Re[2]: [VirtualTreeview] Problem: show/hide columns

Hi Oleg,

> Send the file of example on email? or upload to the Files area?

Upload to file area is the best option, but another problem arises. I don't
have BCB to debug your
code. Perhaps somebody else can help?

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net

 | Replies | Author | Date
4220 | Re[4]: [VirtualTreeview] Problem: show/hide colum | Oleg Kraynov | Tue 10/23/2001
4287 | Re: Re[4]: [VirtualTreeview] Problem: show/hide c | Mike Lischke | Sat 10/27/2001


re: New file uploaded to VirtualTreeview

From: "Mike Lischke" [lists@l...]
Date: Mon Oct 22, 2001 8:38 pm
Subject: RE: [VirtualTreeview] New file uploaded to VirtualTreeview

> 1) VT contain a Types in the uses clause that I had to comment out to compile.

Oops..... fixed.

> 2) It contains function ScrollBarProp that is not used or exported

Huh?. ScrollBarProp is a constant (an array).

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net

 | Replies | Author | Date
4211 | Re: New file uploaded to VirtualTreeview | Jim Kueneman | Tue 10/23/2001
4232 | Re: New file uploaded to VirtualTreeview | Mike Lischke | Tue 10/23/2001


re: Visual themes support

From: "Mike Lischke" [lists@l...]
Date: Mon Oct 22, 2001 8:47 pm
Subject: RE: [VirtualTreeview] Visual themes support

Hi Werner,

> It is quite easy to draw the required UI elements. Much easier than your
> simulation of the column headers. It requires a few functions from
uxtheme.dll and a few constants
from
> tmSchema.h.

Yes, I saw this with the ThemeExplorer. All the important UI elements are
available through the
themes APIs.

>I don't know how you want to provide these to the VT. Either you import only
the required functions
directly in
> VirtualTrees.pas or add uxTheme.pas and tmSchema.pas to the distribution,
although they
> are not completly translated and do not match Borland's strict rules for
header conversions (AFAIK
they
> don't even have a dynamically loading import unit at all).

Well, this is not yet thought through. Marcel van Brakel made a translation of
130+ header files of
the Widnows core platform SDK, which includes also uxTheme.pas and
tmSchema.pas. So at least we have
the full translation. Since these units are part of the regular JEDI Win32API
distribution it would
be the best way to use them. But on the other hand I cannot expect that every
user of VT has
download the package from JEDI. So I tend to include both units with the VT
package and make a note
about the JEDI package in the help file.

> I am creating an example project which demonstrates header drawings. The
tree-button, checkbox and
> radiobutton drawings are very similar. Ok, you'll find it here:

Thank you. Something to start with...

> For the VT I suggest to add a new paint option "toThemeAware". When this
option is active the tree
> detects if it runs on a themed XP (or generally on an OS with uxTheme.dll
available) and
> adjusts its drawing automatically. To detect if a theme has to be employed
the tree can use the
IsAppThemed()
> function from uxTheme. To detect whenever the theme changes (classic <-> blue
<-> silver <-> ...)
> the message WM_THEMECHANGED must be handled.

Yep, that's how I planned it so far. Shouldn't be that difficult....

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: Bug with KillFocus Workaround

From: "Mike Lischke" [lists@l...]
Date: Mon Oct 22, 2001 8:49 pm
Subject: RE: [VirtualTreeview] Bug with KillFocus Workaround

Hi Theodor,

> Of course, the "Assigned(Form)" is not necessary since "is" returns
> false if the Object being tested is nil (which makes sense, since "nil"
> is not a TForm ;).

Good point. Thank you.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net

 | Replies | Author | Date
4209 | Re: Bug with KillFocus Workaround | Theodor Kleynhans | Tue 10/23/2001


re: Invalid typecast

From: "Mike Lischke" [lists@l...]
Date: Mon Oct 22, 2001 8:49 pm
Subject: RE: [VirtualTreeview] Invalid typecast

Hi Basil,

> Please change the following line:

Already done.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: Bug with KillFocus Workaround

From: "Theodor Kleynhans" [theodor.yahoogroups@s...]
Date: Tue Oct 23, 2001 2:05 am
Subject: RE: [VirtualTreeview] Bug with KillFocus Workaround

Hi Mike,

> > Of course, the "Assigned(Form)" is not necessary since "is"
> > returns false if the Object being tested is nil (which makes
> > sense, since "nil" is not a TForm ;).
>
> Good point. Thank you.
---
Pleasure.
In case somebody thought I sounded like a wannabe-know-it-all, that
wasn't my intention. I just find this tip useful in my programming and
have noticed that very few Delphi developers know about it; thus a
mailing list seems like a good place to share. :)

BTW: Mike, you and Jim are definitely on my list of people to receive
free copies of any commercial components I finish. Great work, both of
you!

Cheers,
Theodor

-----------------------------
Theodor Kleynhans
[theodor@s...]
http://www.sulako.com


DBVT pascal translation reorganized

From: [adembaba@e...]
Date: Tue Oct 23, 2001 2:11 am
Subject: DBVT pascal translation reorganized

Hi,

I have reorganized the DBVT translation (to pascal by Vadim).
I havent done much testing either but, it does compile. Here
is what I did:

- I haven't done much other than to reorganize the code so that
it is now one unit as oppsed to two units it originally was.
I believe this is justifiable since this code is about 2,000
lines, there is, IMHO, no need to split them.
Just look at VirtualTrees's line count --easily over 20,000
lines in a single unit.

- I have removed all comments from the code since they were
Cyrillic, and they would have lost a lot in translation
especially since I do not know Russian at all (I am only
assuming they were Russian) :-)

- I have renamed TSimpleVirtualDBTree to TVirtualDBTree. I
believe it reflects its purpose better.

- I have also merged the code in TCustomSimpleVirtualDBTree
into TBaseVirtualDBTree; since everything else is derived
from TBaseVirtualDBTree.

- I got rid of TCheckDataLink, in favor of TVirtualDBTreeDataLink
(which is renamed from TVTDataLink). There was no need for two
descendants of TDataLink.

- Finally, I have renamed the resultant file VirtualDBTree.

Things to do:
- Check to see if we really need these classes separately:
TCustomCheckVirtualDBTree and TCheckVirtualDBTree. It looks
as if they should be merged into a single class.

- DCRs must be designed for
- TVirtualDBTree,
- TDBCheckVirtualDBTree,
- TCheckVirtualDBTree

- A demo. A demo is badly needed. I hope someone does come along
and do it, as I am simply hopeless with those things.

Hope someone might take it up from there.

Cheers,
Adem

 | Replies | Author | Date
4231 | Re: DBVT pascal translation reorganized | Mike Lischke | Tue 10/23/2001
4255 | Re: DBVT pascal translation reorganized | [adembaba@e...] | Wed 10/24/2001
4258 | Re: DBVT pascal translation reorganized | Mike Lischke | Wed 10/24/2001
4262 | Re: DBVT pascal translation reorganized | [adembaba@e...] | Thu 10/25/2001
4265 | Re: DBVT pascal translation reorganized | Vandrovec Milan | Thu 10/25/2001
4268 | Re: DBVT pascal translation reorganized | [adembaba@e...] | Thu 10/25/2001
4298 | Re: DBVT pascal translation reorganized | Mike Lischke | Sat 10/27/2001


re: New file uploaded to VirtualTreeview

From: Jim Kueneman [jimdk@m...]
Date: Tue Oct 23, 2001 2:59 am
Subject: RE: [VirtualTreeview] New file uploaded to VirtualTreeview

> > 2) It contains function ScrollBarProp that is not used or exported
>
>Huh?. ScrollBarProp is a constant (an array).

Yep and it is not used if you don't define the flatscroll bars and it that
case D5 complains.

Jim

 | Replies | Author | Date
4232 | Re: New file uploaded to VirtualTreeview | Mike Lischke | Tue 10/23/2001


re: Node data question

From: Bender Heri [HBender@E...]
Date: Tue Oct 23, 2001 8:27 am
Subject: RE: [VirtualTreeview] Node data question

I do it this way:

type
TCWNode = class
private
FiId : integer; // ID (primary key in DB)
FBookmark : OleVariant; // bookmark to the location in the DB
FVirtualNode : PVirtualNode; // ref to the location in the tree

// property access:
protected
public
procedure DefaultValuesToNode; virtual;

// ID (Primary key) in der DB-Tabelle
property ID : integer
read FiId write FiId;
// Bookmark, um den Record schnell wieder zu finden (wird im Moment noch
nicht gebraucht)
property Bookmark : OleVariant
read FBookmark write FBookmark;
// Referenz auf den zugehörigen Knoten im Tree
property pNode : PVirtualNode
read FVirtualNode write FVirtualNode;
end;

procedure TCWTree.ClassRefToNodeData(o : TObject; Node : PVirtualNode);
begin
move(o,(GetNodeData(Node))^,SizeOf(o));

Include(Node.States, vsInitialized); // this ensures to get a OnFreeNode
event
end;

function TCWTree.GetCWNode(Node: PVirtualNode) : TCWNode;
var
pData : Pointer;
begin
Result := nil;
if Node = nil then
Exit;
pData := GetNodeData(Node);
if pData = nil then
Exit;
move(pData^,result,SizeOf(result));
end;

The last one is a property access method of the property:

property CWNode[pNode : PVirtualNode] : TCWNode
read GetCWNode;

This works for me perfectly.

Heri Bender

> -----Original Message-----
> From: Lucian [mailto:[ljee@s...]]
> Sent: Saturday, October 20, 2001 6:35 PM
> To: VirtualTreeview@yahoogroups.com
> Subject: RE: [VirtualTreeview] Node data question
>
>
> Hi Mike,
>
> Is it possible to store in "Data" an address to an object? So
> NodeDataSize
> is 4, and when we need the data, we typecast the address
> stored? This way we
> could uses objects to store, and not records :-)
>
> Something like
>
> var
> MyObject : TMyObject; --> class not record
> Node : PVirtualNode;
> NodeData : PInteger;
> begin
> MyObject := TMyObject.Create;
> Node := VT.AddChild( nil );
> NodeData := VT.GetNodeData( Node );
> NodeData^:= Integer( MyObject );
> end;
>
> than it would be nice to retrieve it back like in:
>
> ... GetNodeWidth, DrawNode etc methods
> var
> MyObject : TMyObject;
> begin
> MyObject := TMObject( VT.GetNodeData( Node ) );
> end;
>
>
> I am trying this, but unfortunately I can't get it to work. Has anyone
> already tried something like this? (using some assembler tricks)
>
> Lucian
>
>
> ------------------------ Yahoo! Groups Sponsor
> ---------------------~-->
> Pinpoint the right security solution for your company- Learn
> how to add 128- bit encryption and to authenticate your web
> site with VeriSign's FREE guide!
> http://us.click.yahoo.com/yQix2C/33_CAA/yigFAA/i7folB/TM
> --------------------------------------------------------------
> -------~->
>
> To unsubscribe from this group, send an email to:
> VirtualTreeview-unsubscribe@egroups.com
>
>
>
> Your use of Yahoo! Groups is subject to
> http://docs.yahoo.com/info/terms/
>
>


re: Content to ?

From: "Frank van den Bergh" [frankvdbergh@y...]
Date: Tue Oct 23, 2001 10:27 am
Subject: Re: Content to ?

If you are interested, I made an Excel v4 export based on James Waler
ideas.

There is no need for Excel to be installed, and some (not all)
formats are included. I included fonts, colors, heights, splits and
number conversion.

I can upload it (I promised it to send it to Mike when the VST is
final), it has the same style as all the other ContentToxxx have.

Best regards,

Frank van den Bergh.

--- In [VirtualTreeview@y...], Werner Lehmann [wl@b...] wrote:
> [duke_n5@h...] wrote:
> >
> > 2) I never programmed for Excel so I don't know how its files are
> > built. I figure I should use components on the Servers tab(I am on
> > D5) but again I don't know how.
>
> Sometime ago I have picked up (somewhere) example code for simple
Excel export without
> the requirement of Excel being installed. I have pasted all I have
below, I never checked
> it out though. A second possibility is JEDI VCL, they have a
JCLExcel unit. You find the
> interface section below, too, and can get the VCL from delphi-
jedi.org.
>
> Regards,
> Werner
>
> ----------------
>
> unit JclExcel;
>
> {$I JCL.INC}
>
> {$WEAKPACKAGEUNIT ON}
>
> interface
>
> uses
> Classes;
>
> type
> TJclExcelWriter = class (TObject)
> private
> FStream: TStream;
> public
> constructor Create(const Stream: TStream);
> procedure WriteBOF;
> procedure WriteEOF;
> procedure WriteBLANK(const Col, Row: Word;
> const XF: Word {$IFDEF SUPPORTS_DEFAULTPARAMS} = 0 {$ENDIF});
> procedure WriteLABEL(const Data: AnsiString; const Col, Row:
Word;
> const XF: Word {$IFDEF SUPPORTS_DEFAULTPARAMS} = 0 {$ENDIF});
> procedure WriteNUMBER(const Data: Double; const Col, Row: Word;
> const XF: Word {$IFDEF SUPPORTS_DEFAULTPARAMS} = 0 {$ENDIF});
> procedure WriteBOOL(const Data: Boolean; const Col, Row: Word;
> const XF: Word {$IFDEF SUPPORTS_DEFAULTPARAMS} = 0 {$ENDIF});
> procedure WriteERROR(const Data: Byte; const Col, Row: Word;
> const XF: Word {$IFDEF SUPPORTS_DEFAULTPARAMS} = 0 {$ENDIF});
> end;
>
> implementation
>
> ----------------
>
> Excel.txt:
>
> const
> CXlsBof: array[0..5] of Word = ($809, 8, 00, $10, 0, 0);
> CXlsEof: array[0..1] of Word = ($0A, 00);
> CXlsLabel: array[0..5] of Word = ($204, 0, 0, 0, 0, 0);
> CXlsNumber: array[0..4] of Word = ($203, 14, 0, 0, 0);
> CXlsRk: array[0..4] of Word = ($27E, 10, 0, 0, 0);
>
> procedure XlsBeginStream(XlsStream: TStream; const BuildNumber:
Word);
> begin
> CXlsBof[4] := BuildNumber;
> XlsStream.WriteBuffer(CXlsBof, SizeOf(CXlsBof));
> end;
>
> procedure XlsEndStream(XlsStream: TStream);
> begin
> XlsStream.WriteBuffer(CXlsEof, SizeOf(CXlsEof));
> end;
>
> procedure XlsWriteCellRk(XlsStream: TStream; const ACol, ARow:
Word; const AValue: Integer);
> var
> V: Integer;
> begin
> CXlsRk[2] := ARow;
> CXlsRk[3] := ACol;
> XlsStream.WriteBuffer(CXlsRk, SizeOf(CXlsRk));
> V := (AValue shl 2) or 2;
> XlsStream.WriteBuffer(V, 4);
> end;
>
> procedure XlsWriteCellNumber(XlsStream: TStream; const ACol, ARow:
Word; const AValue: Double);
> begin
> CXlsNumber[2] := ARow;
> CXlsNumber[3] := ACol;
> XlsStream.WriteBuffer(CXlsNumber, SizeOf(CXlsNumber));
> XlsStream.WriteBuffer(AValue, 8);
> end;
>
> procedure XlsWriteCellLabel(XlsStream: TStream; const ACol, ARow:
Word; const AValue: string);
> var
> L: Word;
> begin
> L := Length(AValue);
> CXlsLabel[1] := 8 + L;
> CXlsLabel[2] := ARow;
> CXlsLabel[3] := ACol;
> CXlsLabel[5] := L;
> XlsStream.WriteBuffer(CXlsLabel, SizeOf(CXlsLabel));
> XlsStream.WriteBuffer(Pointer(AValue)^, L);
> end;
>
> procedure TForm1.Button1Click(Sender: TObject);
> var
> FStream: TFileStream;
> I, J: Integer;
> begin
> FStream := TFileStream.Create('J:\e.xls', fmCreate);
> try
> XlsBeginStream(FStream, 0);
> for I := 0 to 99 do
> for J := 0 to 99 do
> begin
> XlsWriteCellNumber(FStream, I, J, 34.34);
> // XlsWriteCellRk(FStream, I, J, 3434);
> // XlsWriteCellLabel(FStream, I, J, Format('Cell: %d,%d',
[I, J]));
> end;
> XlsEndStream(FStream);
> finally
> FStream.Free;
> end;
> end;


How to scroll view, not selected/focused node?

From: [milan_va@s...]
Date: Tue Oct 23, 2001 11:09 am
Subject: How to scroll view, not selected/focused node?

Hello.

I need a crazy thing: when arrow keys (up/down) are pressed, scroll
the view as if scrollbar-arrows were pressed, but leave the
selected/focused nodes as they were (e.g. scroll them out of view).
Is there an option like "MoveFocus" or something? Quick look at the
code (WMKeyDown) gave no ideas.
If this is not possible, how do I block the arrow keys completely?

Milan

 | Replies | Author | Date
4216 | Re: How to scroll view, not selected/focused node | Werner Lehmann | Tue 10/23/2001


re: How to scroll view, not selected/focused no de?

From: GIANNAKOPOULOS KOSTAS [kyan@s...]
Date: Tue Oct 23, 2001 11:17 am
Subject: RE: [VirtualTreeview] How to scroll view, not selected/focused no de?

Maybe sending/posting a WM_VSCROLL message to the tree in your KeyDown event
handler would work?
See what Mike's WMVScroll handler does
Don't forget to set Key to 0 so that it will not be processed ay further.

procedure TForm1.VTKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
case Key of
VK_DOWN: SendMessage(VT.Handle, WM_VSCROLL, SB_LINEDOWN, 0);
VK_UP: SendMessage(VT.Handle, WM_VSCROLL, SB_LINEUP, 0)
else
Exit;
end;
Key := 0;
end;

> Hello.
>
> I need a crazy thing: when arrow keys (up/down) are pressed, scroll
> the view as if scrollbar-arrows were pressed, but leave the
> selected/focused nodes as they were (e.g. scroll them out of view).
> Is there an option like "MoveFocus" or something? Quick look at the
> code (WMKeyDown) gave no ideas.
> If this is not possible, how do I block the arrow keys completely?
>


re: How to scroll view, not selected/focused node?

From: Werner Lehmann [wl@b...]
Date: Tue Oct 23, 2001 11:23 am
Subject: Re: [VirtualTreeview] How to scroll view, not selected/focused node?

[milan_va@s...] wrote:
>
> I need a crazy thing: when arrow keys (up/down) are pressed, scroll
> the view as if scrollbar-arrows were pressed, but leave the
> selected/focused nodes as they were (e.g. scroll them out of view).
> Is there an option like "MoveFocus" or something? Quick look at the
> code (WMKeyDown) gave no ideas.
> If this is not possible, how do I block the arrow keys completely?

Try ctrl+up, ctrl+down.

Werner


How to use the DoXXX methods???????????

From: [rhymebusta@h...]
Date: Tue Oct 23, 2001 2:53 pm
Subject: How to use the DoXXX methods???????????

what are the DoXXX methods for? i know they're virtual methods but
when do u implement them? or are u not supposed to implement them?

 | Replies | Author | Date
4218 | Re: How to use the DoXXX methods??????????? | Bender Heri | Tue 10/23/2001
4223 | Re: How to use the DoXXX methods??????????? | [rhymebusta@h...] | Tue 10/23/2001


re: How to use the DoXXX methods???????????

From: Bender Heri [HBender@E...]
Date: Tue Oct 23, 2001 3:09 pm
Subject: RE: [VirtualTreeview] How to use the DoXXX methods???????????

This is Delphi basic stuff.

The DoXXX Methods are wrappers for a callback (Delphi-Event) of the class
(property OnXXX)

If you derive a component, you want let the user of this component assign
his own method to the OnXXX-Callback. But if your derived component must
take some actions in conjunction with this event, your derivation must not
assign a method to OnXXX (since only one "user" can occupy this callback and
this you want to leave to the end-user of the component), but rather
override the DoXXX method where you call inherited (to effectively trigger
the callback) and write your own stuff before or after the inherited call.

You got it?

Heri

> -----Original Message-----
> From: [rhymebusta@h...] [mailto:[rhymebusta@h...]]
> Sent: Tuesday, October 23, 2001 4:54 PM
> To: [VirtualTreeview@yahoogroups.com
> Subject: [VirtualTreeview] How to use the DoXXX methods???????????
>
>
> what are the DoXXX methods for? i know they're virtual methods but
> when do u implement them? or are u not supposed to implement them?
>
>
>
> ------------------------ Yahoo! Groups Sponsor
> ---------------------~-->
> Get your FREE VeriSign guide to security solutions for your
> web site: encrypting transactions, securing intranets, and more!
> http://us.click.yahoo.com/UnN2wB/m5_CAA/yigFAA/i7folB/TM
> --------------------------------------------------------------
> -------~->
>
> To unsubscribe from this group, send an email to:
> VirtualTreeview-unsubscribe@egroups.com
>
>
>
> Your use of Yahoo! Groups is subject to
> http://docs.yahoo.com/info/terms/
>
>

Replies Author Date


AddChild

From: [d.faessler@p...]
Date: Tue Oct 23, 2001 3:04 pm
Subject: AddChild

Hi

I've got a data-structure like that:

type
PTree = ^TTree;
TTree = record
Desc: String[50];
Paint: Integer;
Next: PTree;
end;

Everywhere in my program i fill the structure:

new(tmp);
tmp^.Desc := 'Test';
tmp^.paint := 1;
tmp^.Next := nil
...
new(tmp^.next);
tmp^.next^.Desc := 'Test sub';
tmp^.next^.paint := 0;
tmp^.next^.next := nil
...

when clicking on a button, the Virtualtree should be filled:

var node: PVirtualNode;
tmp: PTree;
begin
tmp := root; {first record}
while tmp^.next <> nil do
begin
if tmp^.paint = 1 then
node := MyTree.AddChild(nil,tmp);
tmp := tmp^.next;
end;
end;

but, when I'd like to get the description it would not work. The text
would contain any symbols:

procedure TForm1.MyTreeGetText(Sender: TBaseVirtualTree;
Node: PVirtualNode; Column: Integer; TextType: TVSTTextType;
var Text: WideString);
var nodeD: Ptree;
begin
nodeD := MyTree.GetNodeData(node);
text := NodeD^.Desc;
end;

Have you any idea, what I'm doing wrong?

Thanks

Dominik Fässler

 | Replies | Author | Date
4221 | Re: AddChild | Helge Jung (ECO-Logic) | Tue 10/23/2001
4222 | Re: AddChild | [d.faessler@p...] | Tue 10/23/2001
4224 | Re: AddChild | Helge Jung (ECO-Logic) | Tue 10/23/2001
4230 | Re: AddChild | Helge Jung (ECO-Logic) | Tue 10/23/2001
4234 | Re: AddChild | [d.faessler@p...] | Tue 10/23/2001
4754 | AddChild | Martijn Brinkers | Wed 11/21/2001
4756 | Re: AddChild | Jim Kueneman | Wed 11/21/2001
4800 | Re: AddChild | [martijnbrinkers@p...] | Mon 11/26/2001
4755 | Re: AddChild | GIANNAKOPOULOS KOSTAS | Wed 11/21/2001


Re[4]: Problem: show/hide columns

From: Oleg Kraynov [olegvkr@y...]
Date: Tue Oct 23, 2001 3:13 pm
Subject: Re[4]: [VirtualTreeview] Problem: show/hide columns

Hi, Mike.

Please check:

procedure TBaseVirtualTree.PaintTree
...
with FHeader.FColumns do
begin
while (PaintInfo.Position < Count) and (PaintInfo.CellRect.Left <
Window.Right) do
begin

...

// Move clip rectangle and continue.
if coVisible in Items[FPositionToIndex[PaintInfo.Position]].FOptions then
with PaintInfo do
begin
Items[FPositionToIndex[Position]].GetAbsoluteBounds(CellRect.Left,
CellRect.Right);

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

CellRect.Bottom := Node.NodeHeight;
ContentRect.Bottom := Node.NodeHeight;
end;
end;
end;

When visible columns 0, 1, 2!, 4 - CellRect.Left = 61, 95, 145
When visible columns 0, 1, 3!, 4 - CellRect.Left = 61, 145,145

After resize of any column (if column 3 is visible) GetAbsoluteBounds returns
correct values.

Initial settings (in design mode):
visible columns - 0, 1, 2, 4.
invisible - 3.
Header.Options contains hoAutoResize.
Header.AutoResizeIndex = 1.

--
Best regards,
Oleg

_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com

 | Replies | Author | Date
4287 | Re: Re[4]: [VirtualTreeview] Problem: show/hide c | Mike Lischke | Sat 10/27/2001


re: AddChild

From: "Helge Jung \(ECO-Logic\)" [helge@e...]
Date: Tue Oct 23, 2001 3:21 pm
Subject: Re: [VirtualTreeview] AddChild

> Have you any idea, what I'm doing wrong?
>

First of all I'd check if you've set the nodesize correctly (in
Form1.OnCreate do: "MyTree.NodeDataSize := SizeOf (TTree);").

If that doesn't help try this as your filling-proc (not tested):

var
NewNode : PVirtualNode;
ActData,
NewData : PTree;

begin
ActData := root; { first record }

while ActData^.Next <> nil do
begin
if ActData^.Paint then
begin
NewData := MyTree.GetNodeData(MyTree.AddChild(nil));
NewData^ := ActData^;
end;
ActData := ActData^.Next;
end;
{ Attention: the last record (with ActData^.Next = nil) is not
inserted!!! }
end;

Helge.

 | Replies | Author | Date
4222 | Re: AddChild | [d.faessler@p...] | Tue 10/23/2001
4224 | Re: AddChild | Helge Jung (ECO-Logic) | Tue 10/23/2001
4230 | Re: AddChild | Helge Jung (ECO-Logic) | Tue 10/23/2001
4234 | Re: AddChild | [d.faessler@p...] | Tue 10/23/2001


re: AddChild

From: [d.faessler@p...]
Date: Tue Oct 23, 2001 3:28 pm
Subject: Re: AddChild

Thank you for your help. The second thing would work. But my question
is:

AFAIK MyTree would now create a new record an copy the old data in
it. Is it not possible to only set a link to it?

Thanks.

Dominik fässler

--- In [VirtualTreeview@y...], "Helge Jung \(ECO-Logic\)" [helge@e...]
wrote:
> > Have you any idea, what I'm doing wrong?
> >
>
> First of all I'd check if you've set the nodesize correctly (in
> Form1.OnCreate do: "MyTree.NodeDataSize := SizeOf (TTree);").
>
> If that doesn't help try this as your filling-proc (not tested):
>
> var
> NewNode : PVirtualNode;
> ActData,
> NewData : PTree;
>
> begin
> ActData := root; { first record }
>
> while ActData^.Next <> nil do
> begin
> if ActData^.Paint then
> begin
> NewData := MyTree.GetNodeData(MyTree.AddChild(nil));
> NewData^ := ActData^;
> end;
> ActData := ActData^.Next;
> end;
> { Attention: the last record (with ActData^.Next = nil) is not
> inserted!!! }
> end;
>
> Helge.

 | Replies | Author | Date
4224 | Re: AddChild | Helge Jung (ECO-Logic) | Tue 10/23/2001
4230 | Re: AddChild | Helge Jung (ECO-Logic) | Tue 10/23/2001
4234 | Re: AddChild | [d.faessler@p...] | Tue 10/23/2001


re: How to use the DoXXX methods???????????

From: [rhymebusta@h...]
Date: Tue Oct 23, 2001 3:30 pm
Subject: Re: How to use the DoXXX methods???????????

--- In [VirtualTreeview@y...], Bender Heri [HBender@E...] wrote:
> This is Delphi basic stuff.
>
> The DoXXX Methods are wrappers for a callback (Delphi-Event) of the
class
> (property OnXXX)
>
> If you derive a component, you want let the user of this component
assign
> his own method to the OnXXX-Callback. But if your derived component
must
> take some actions in conjunction with this event, your derivation
must not
> assign a method to OnXXX (since only one "user" can occupy this
callback and
> this you want to leave to the end-user of the component), but rather
> override the DoXXX method where you call inherited (to effectively
trigger
> the callback) and write your own stuff before or after the
inherited call.
>
> You got it?
>
> Heri
>
> > -----Original Message-----
> > From: [rhymebusta@h...] [mailto:[rhymebusta@h...]]
> > Sent: Tuesday, October 23, 2001 4:54 PM
> > To: [VirtualTreeview@y...]
> > Subject: [VirtualTreeview] How to use the DoXXX methods???????????
> >
> >
> > what are the DoXXX methods for? i know they're virtual methods
but
> > when do u implement them? or are u not supposed to implement them?
> >
> >
> >
> > ------------------------ Yahoo! Groups Sponsor
> > ---------------------~-->
> > Get your FREE VeriSign guide to security solutions for your
> > web site: encrypting transactions, securing intranets, and more!
> > http://us.click.yahoo.com/UnN2wB/m5_CAA/yigFAA/i7folB/TM
> > --------------------------------------------------------------
> > -------~->
> >
> > To unsubscribe from this group, send an email to:
> > VirtualTreeview-unsubscribe@egroups.com
> >
> >
> >
> > Your use of Yahoo! Groups is subject to
> > http://docs.yahoo.com/info/terms/
> >
> >
i think i get it....see i'm a c++ programmer and am using BCB5. but
when i saw the "virtual" in there i figured that one should override
them...thanks for the help.


re: Re: AddChild

From: "Helge Jung \(ECO-Logic\)" [helge@e...]
Date: Tue Oct 23, 2001 3:38 pm
Subject: Re: [VirtualTreeview] Re: AddChild

> AFAIK MyTree would now create a new record an copy the old data in
> it. Is it not possible to only set a link to it?

Absolutely correct. It is possible - I'll check it out in a second.

Helge.

 | Replies | Author | Date
4230 | Re: AddChild | Helge Jung (ECO-Logic) | Tue 10/23/2001
4234 | Re: AddChild | [d.faessler@p...] | Tue 10/23/2001


re: VST doesn't show all lines

From: Michael Valentiner=Branth [MichaelVB@g...]
Date: Tue Oct 23, 2001 4:07 pm
Subject: Re: [VirtualTreeview] VST doesn't show all lines

Hi Ralf,

> never heard about this problem!
>
What a pitty!<g>

> Can you post a small code-snipplet for testing?
>
Small? Haha!
The code around my VST has become rather complex with the time. And the reason
for the error may be anywhere.

But by trying to extract some code for you I found out some "nice" conditions:

1. I set NodeHeight[Node]=DefaultNodeHeight+2 for the top-level-nodes.
This is done in a filter routine, that also hides some (or most) of the nodes.
If I don't do this, there's no such problem.

2. It only happens, after saving and loading the tree to/from file. I used the
example "VT_SaveLoad" in the files section as a basis for these functions.

It seems that, the more top-level-nodes there are in the tree (visible or not),
the more lines are unvisible. And sometimes the last *visible* line is only
partly visible.

But only after saving/loading the tree! Still very strange.

I could reproduce it in the VT_LoadSave-Demo!
I uploaded my version of it (some more modifications for test reason) to the
Files/BugDemos as SaveLoad-NodeHeight.zip

I hope, the Upload worked. I can't see it in the section. Does it take some
time? It is the first time I upload something to a Yahoo group.

Michael


Checking parent nodes of a tree programatically?

From: [tvav@h...]
Date: Tue Oct 23, 2001 4:35 pm
Subject: Checking parent nodes of a tree programatically?

Hello there,
I have been using the VirtualTree for about a couple of weeks now and
let me tell you it is the best tree control that I have seen so far
(I have tried many including commercial ones). Keep up the great
work!
I have implemented the tree in our application and it has given it a
great new look and feel!
However I had to modify some things:
In a dialog of my application, I have 4 trees with checkboxes
(TriStateCheckBox). Each tree can have an unknown number of root and
children nodes. They are loaded dynamically. Those nodes are loaded
from a list of objects that are created depending on what the user
selects.
When the dialog is closed, the checked nodes ONLY are saved in a list
which is then streamed to a db table.
When the dialog is opened again and the nodes are loaded I need to
set their checked state depending on wheather or not these nodes
exist in the list saved before. This is fine, everything works
fine. The problem that I have is that I needed to set the correct
checkstate (csCheckedNormal or csMixedNormal or csMixedPressed) of
the parent node depending on the checkstate of their children.
I know that this checkstate is set correctly when the tree responds
to the mouse and keyboard events, but I could not do that
programmaticaly. I played around with the OnChecking and OnChecked
events, but that did not work also.
What I finally realized is that I needed to call the protected
TBaseVirtualTree.CheckParentCheckState function.
So I added a public function to TCustomVirtualStringTree defined as
follows:
function TCustomVirtualStringTree.SetParentsCheckState(Node:
PVirtualNode;
NewCheckState: TCheckState): Boolean;
begin
result := CheckParentCheckState(Node, NewCheckState);
end;
I can now call this function from within my code and it will set the
appropriate check state of the parent node depending on how many
children are checked.
My question is this: Did I even need to do this? Is there a better
way to accomplish this without adding this function?
If not, would it be possible to add a similar public method so that
it is part of the VirtualTree?
Thanks
Tony V.

Here's a sample of my code:
....
TC_FieldData = class(TObject)
IsChecked : Boolean;
Field : String;
FieldDesc : String;
FacilityID : Integer;
FacilityName : String;
IsFacility : Boolean;
end;
...
type
PNodeData = ^TNodeData;
TNodeData = record
MyFieldData : TC_FieldData;
end;
....

//The list of objects that make up the tree are loaded here
procedure TCensusByForm.LoadPatientTypes;
var
FieldData : TC_FieldData;
i : Integer;
Sel : TEntitySelection;
FFacilityID : Integer;
FFacilityName : String;
begin

// load patient types
for i := 0 to EntitySelections.Count - 1 do
begin
Sel := EntitySelections.Selection[i];
FFacilityID := StrToInt(Sel.AsInteger);
FFacilityName := Sel.EntityName;
//root node object
FieldData := TC_FieldData.Create;
FieldData.Field := '';
FieldData.FacilityID := FFacilityID;
FieldData.FacilityName := FFacilityName;
FieldData.IsFacility := True; //this indicates that it is a root
node
FieldData.FieldDesc := FFacilityName;
FieldData.IsChecked := False;
PTList.AddObject(FieldData.FieldDesc,FieldData);

//add the children now
with DBCensus.CensusByPTypeQuery do
try
Close;
SQL.Clear;
SQL.Add('SELECT PDESC, PNUM');
SQL.Add('FROM PTYPE');
SQL.Add('WHERE HOSP = ' + IntToStr(FFacilityID));
SQL.Add('ORDER BY PDESC');
Open;
First;

while not EOF do
begin
FieldData := TC_FieldData.Create;
FieldData.Field := Fields[1].AsString;
FieldData.FacilityID := FFacilityID;
FieldData.FacilityName := FFacilityName;
FieldData.IsFacility := False; //this indicates that it is a
child node
FieldData.FieldDesc := Fields[0].AsString;
//this checks if this item has been checked previously - if
so flag it
FieldData.IsChecked := (PatSavList.IndexOf(IntToStr
(FFacilityID)+'|'+FieldData.Field) <> -1);
PTList.AddObject(FieldData.FieldDesc,FieldData);
Next;
end;
Close;
except
on e : Exception do
begin
DBCensus.LogQueryError(DBCensus.CensusByPTypeQuery, e);
end;
end;
end; //for
end;
.......
//finally load the tree
procedure TCensusByForm.FillPTTree;
var
i : Integer;
PNode,CNode : PVirtualNode;
Data: PNodeData;
begin
for i := 0 to PTList.Count - 1 do
begin
with VirtualStringTreePT do
begin
if TC_FieldData(PTList.Objects[i]).IsFacility then //this is a
root node
begin
PNode := AddChild(nil,nil);
PNode.CheckType := ctTriStateCheckBox;
Data := GetNodeData(PNode);
Data.MyFieldData := TC_FieldData(PTList.Objects[i]);
end
else //child node of the above root
begin
cNode := AddChild(PNode,nil);
cNode.CheckType := ctTriStateCheckBox;
Data := GetNodeData(cNode);
Data.MyFieldData := TC_FieldData(PTList.Objects[i]);
cNode.CheckState := csUnCheckedNormal; //initial check state
if Data.MyFieldData.IsChecked then //this item has been
selected before - change its check state
cNode.CheckState := csCheckedNormal;

//this is my own function that I added in
TCustomVirtualStringTree
//it will set the parent check state accordingly -
csCheckedNormal or csMixedNormal or csMixedPressed
//depending on the number of children checked
SetParentsCheckState(cNode,cNode.CheckState);

end;
end;
end;
end;

 | Replies | Author | Date
4233 | Re: Checking parent nodes of a tree programatical | Mike Lischke | Tue 10/23/2001
4236 | Re: Checking parent nodes of a tree programatical | [tvav@h...] | Tue 10/23/2001
4288 | Re: Checking parent nodes of a tree programatical | Mike Lischke | Sat 10/27/2001
4479 | Re: Checking parent nodes of a tree programatical | [tvav@h...] | Mon 11/5/2001
4480 | Re: Checking parent nodes of a tree programatical | Jim Kueneman | Mon 11/5/2001
4498 | Re: Checking parent nodes of a tree programatical | [tvav@h...] | Tue 11/6/2001


re: VTreeView with a database

From: [christophe37fr@y...]
Date: Tue Oct 23, 2001 6:05 pm
Subject: Re: VTreeView with a database

--- In [VirtualTreeview@y...], Werner Lehmann [wl@b...] wrote:
> Hi Christophe,
>
> > Ok With TreeNT I used it in order to create a hierarchy ex : Level
> > 0 : a Company's name and for each record of my database, the
> > employee's name.
> >
> > It's easier than VT in TreeNT.
>
> This may be because TreeNT is not virtual and allows you to store
your user
> data in the tree nodes. But I don't know this because I never used
TreeNT. In any
> way, VT is just a view to your data. It forces you to store the
data in your
> own structures. Which is good IMO. You should not bind data to a
visual control.
>
> I have done the same for my company: a derived VT displays 13
different trees
> which come all from an Oracle db. So its quite possible. But I am
sorry, your
> question is still not specific enough to answer (at least by me).
If you want
> a full source example on how to do this I cannot give it to you. It
depends
> on your data and database anyway.
>
> Werner

OK Thanks for your information. About your source example, even if
it's no good for DataBase could you please show me how you do it
please.(I work with SQL-SERVER or ACCESS)


re: Re: Drag'nDrop, Please help...

From: "Mike Lischke" [lists@l...]
Date: Tue Oct 23, 2001 6:33 pm
Subject: RE: [VirtualTreeview] Re: Drag'nDrop, Please help...

Hi Robert,

veNode
> are never called. Nevertheless, when copying the streaming is done
> prior OnNodeCopying therefore OnLoadNode and OnsaveNode are called
> allowing then custom data to be loaded.
> My intention on the modified code was to process streaming prior to
> calling OnNodeMoving as it was implemented for OnNodeCopying.

As I already tried to point out: moving nodes is differently implemented than
copying nodes, in
order to optimize the process. This works usually very well, because the
optimized moved is only
done if source and target are in the same tree view control. Then, and only
then, no streaming is
performed because the nodes are moved directly and take their data with the
move.

If you, for good reasons, really insist of having the streaming having then
just do a copy instead a
move and delete the old nodes afterwards.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net

 | Replies | Author | Date
4309 | Copying part of a tree to another tree | Franc van de Westelaken | Sat 10/27/2001
4321 | Re: Copying part of a tree to another tree | Mike Lischke | Sun 10/28/2001
4323 | Re: Copying part of a tree to another tree | Franc van de Westelaken | Sun 10/28/2001
4331 | Re: Copying part of a tree to another tree | Paul D'Agosta | Mon 10/29/2001


re: Simple Drag'n'Drop Example

From: "Mike Lischke" [lists@l...]
Date: Tue Oct 23, 2001 6:40 pm
Subject: RE: [VirtualTreeview] Simple Drag'n'Drop Example

Hi Tom,

> I am looking for a simple example of what is necessary to accomplish this.
> Any sugegstions would be very welcome.

This is not difficult to implement. Aside your own information you also can use
GetNodeLevel to
determine a node's level. Then I recommend that you insert a check for the drop
target node
(VT.DropTargetNode) into the handler for the OnDragOver event. If the target
node's level is less
than 3 you can allow the drop.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: Re: AddChild

From: "Helge Jung \(ECO-Logic\)" [helge@e...]
Date: Tue Oct 23, 2001 6:40 pm
Subject: Re: [VirtualTreeview] Re: AddChild

> It is possible - I'll check it out in a second.

Okay, "in a second" took a bit longer - damn homework... okay, I tried for
over an half of an hour know but I don't get it... maybe one of the VT-Gurus
can help (Mike, Jim ou Werner).

Helge.

 | Replies | Author | Date
4234 | Re: AddChild | [d.faessler@p...] | Tue 10/23/2001


re: DBVT pascal translation reorganized

From: "Mike Lischke" [lists@l...]
Date: Tue Oct 23, 2001 6:58 pm
Subject: RE: [VirtualTreeview] DBVT pascal translation reorganized

Adem, Vadim,

> I have reorganized the DBVT translation (to pascal by Vadim).
> I havent done much testing either but, it does compile. Here
> is what I did:

This is very good. Many people asked here and me directly about a DB VT
descentant. The main point
currently to do now is to test the implementation. I hope some friendly sould
jumps in here. It
should really not take very long to test the control, but I can't give any
comment, since I haven't
even had a look into the source.

> - Check to see if we really need these classes separately:
> TCustomCheckVirtualDBTree and TCheckVirtualDBTree. It looks
> as if they should be merged into a single class.

It's your decision. If you think this is better then merge them. But always try
to imagine what
people could do with a xxxCustomxxx descentant.

> - DCRs must be designed for
> - TVirtualDBTree,
> - TDBCheckVirtualDBTree,
> - TCheckVirtualDBTree

I can do that, no problem. This is only a matter of a couple of minutes. But
what's the check
treeview (and its DB variant)?

> - A demo. A demo is badly needed. I hope someone does come along
> and do it, as I am simply hopeless with those things.

If nobody else does it I can create one once I come to the due review of all
demos. But I'd prefer
that somebody else write a demo for the trees. I can even be only a rough
design. It is much easier
for me to polish one application up than to create it from scratch.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net

 | Replies | Author | Date
4255 | Re: DBVT pascal translation reorganized | [adembaba@e...] | Wed 10/24/2001
4258 | Re: DBVT pascal translation reorganized | Mike Lischke | Wed 10/24/2001
4262 | Re: DBVT pascal translation reorganized | [adembaba@e...] | Thu 10/25/2001


re: New file uploaded to VirtualTreeview

From: "Mike Lischke" [lists@l...]
Date: Tue Oct 23, 2001 6:59 pm
Subject: RE: [VirtualTreeview] New file uploaded to VirtualTreeview

> Yep and it is not used if you don't define the flatscroll bars and it that
> case D5 complains.

I wonder why the D6 compiler did not complain. I always have all checks on.
Anyway, its now wrapped
too.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: Checking parent nodes of a tree programatically?

From: "Mike Lischke" [lists@l...]
Date: Tue Oct 23, 2001 7:15 pm
Subject: RE: [VirtualTreeview] Checking parent nodes of a tree programatically?

Hi Tony,

> My question is this: Did I even need to do this? Is there a better
> way to accomplish this without adding this function?
> If not, would it be possible to add a similar public method so that
> it is part of the VirtualTree?

You should not need to call the parent check method explicitely (it's done
automatically if
enabled). You wrote that it works all fine when you switch the check states
using the mouse
(including propagation), but not when you assign the value in code. If this is
so then you have
already enabled the auto propagation and something else is wrong.

Can you confirm this?

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net

 | Replies | Author | Date
4236 | Re: Checking parent nodes of a tree programatical | [tvav@h...] | Tue 10/23/2001
4288 | Re: Checking parent nodes of a tree programatical | Mike Lischke | Sat 10/27/2001
4479 | Re: Checking parent nodes of a tree programatical | [tvav@h...] | Mon 11/5/2001
4480 | Re: Checking parent nodes of a tree programatical | Jim Kueneman | Mon 11/5/2001
4498 | Re: Checking parent nodes of a tree programatical | [tvav@h...] | Tue 11/6/2001


re: AddChild

From: [d.faessler@p...]
Date: Tue Oct 23, 2001 7:17 pm
Subject: Re: AddChild

Nevertheless thank you for your work. I hope someone can help me as
soon as possible, because I have to deliver my program tomorrow.

Dominik Fässler

--- In [VirtualTreeview@y...], "Helge Jung \(ECO-Logic\)" [helge@e...]
wrote:
> > It is possible - I'll check it out in a second.
>
> Okay, "in a second" took a bit longer - damn homework... okay, I
tried for
> over an half of an hour know but I don't get it... maybe one of the
VT-Gurus
> can help (Mike, Jim ou Werner).
>
> Helge.


How to hide droptarget

From: [cas@c...]
Date: Tue Oct 23, 2001 7:50 pm
Subject: How to hide droptarget

Hello there

Is there any way to hide the selection box around the dropTargetnode
in a drag'n'drop operation?

I tried to set virtualstringtree.droptargetnode to 'nil' in the
onDragOver event, but it's a readonly property so that's not
possible. Is there any other way?

Later!
-Simon Horup

 | Replies | Author | Date
4252 | Re: How to hide droptarget | Mike Lischke | Wed 10/24/2001
4276 | Re: How to hide droptarget | [cas@c...] | Fri 10/26/2001
4277 | Re: How to hide droptarget | Jim Kueneman | Fri 10/26/2001
4278 | Re: How to hide droptarget | [cas@c...] | Fri 10/26/2001


re: Checking parent nodes of a tree programatically?

From: [tvav@h...]
Date: Tue Oct 23, 2001 9:06 pm
Subject: Re: Checking parent nodes of a tree programatically?

--- In [VirtualTreeview@y...], "Mike Lischke" [lists@l...] wrote:
> Hi Tony,
>
> > My question is this: Did I even need to do this? Is there a
better
> > way to accomplish this without adding this function?
> > If not, would it be possible to add a similar public method so
that
> > it is part of the VirtualTree?
>
> You should not need to call the parent check method explicitely
(it's done automatically if
> enabled). You wrote that it works all fine when you switch the
check states using the mouse
> (including propagation), but not when you assign the value in code.
If this is so then you have
> already enabled the auto propagation and something else is wrong.
>
> Can you confirm this?
>

Hi Mike,
Yes propagation works fine when I clik on the nodes. It works as
expected: when I click on a checkbox of a root node all its children
are checked. When I click on a child node, the parent node checkbox
is checked appropriately: if all the children are selected then the
parent becomes CheckedNormal; when some children are checked then the
parent checkbox becomes MixedNormal.
It also works fine when I press the spacebar while a node is selected.

However, automatic propagation,does not work when I toggle the
CheckState of a node programatically like I am doing in my exaple.
I am using VT version 2.5.40 with the following TreeOptions:
AutoOptions =
[toAutoDropExpand,toAutoScroll,toAutoScrollOnExpand,toAutoSpanColumns,
toAutoTristateTracking]
MiscOptions =
[toAcceptOLEDrop,toCheckSupport,toInitOnSave,toToggleOnDblClick]
PaintOptions =
[toShowButtons,toShowRoot,toShowTreeLines,toShowVertGridLines]
SelectionOptions = [toMultiSelect]
Thanks
Tony V.

 | Replies | Author | Date
4288 | Re: Checking parent nodes of a tree programatical | Mike Lischke | Sat 10/27/2001
4479 | Re: Checking parent nodes of a tree programatical | [tvav@h...] | Mon 11/5/2001
4480 | Re: Checking parent nodes of a tree programatical | Jim Kueneman | Mon 11/5/2001
4498 | Re: Checking parent nodes of a tree programatical | [tvav@h...] | Tue 11/6/2001


How to use DBVT ?

From: [x_gate@h...]
Date: Tue Oct 23, 2001 10:23 pm
Subject: How to use DBVT ?

Hi,
Does anyone know how to make it work ?
Also can it work as Grid ?

Thanks!


re: Design question

From: Werner Lehmann [wl@b...]
Date: Tue Oct 23, 2001 9:57 pm
Subject: Re: [VirtualTreeview] Design question

Hi Sanjay,

> For a selected disk drive, I want to keep the complete tree of file names,
> sizes and other attributes in a Virtual Treeview so that I can then
> analyze the stuff for various disk utilities without rescanning. I am a
> little unclear on how the virtual memory works. If I directly keep the
> data in a record on the node, how will it affect the physical memory for a
> large number of files? Once I know I will think of an alternative design
> if necessary. I will appreciate any thoughts on this.

I am not at all sure what you mean. The 'virtual' in TVirtualNode is not related
to virtual memory if this is your point. Other than that the usual procedures
apply, i.e. allocated, but unused memory may be paged to disk which may be the
case even with TVirtualNode's for your files, folder etc...

Regards,
Werner


re: Visual themes support

From: Werner Lehmann [wl@b...]
Date: Tue Oct 23, 2001 10:21 pm
Subject: Re: [VirtualTreeview] Visual themes support

Hi Mike,

> Yes, I saw this with the ThemeExplorer. All the important UI elements are
available through the
> themes APIs.

I did not know ThemeExplorer. Otherwise I wouldn't have written my own... (sort
of) ;)

> >I don't know how you want to provide these to the VT. Either you import only
the required functions
> directly in
> > VirtualTrees.pas or add uxTheme.pas and tmSchema.pas to the distribution,
although they
> > are not completly translated and do not match Borland's strict rules for
header conversions (AFAIK
> they
> > don't even have a dynamically loading import unit at all).
>
> Well, this is not yet thought through. Marcel van Brakel made a translation
of 130+ header files of
> the Widnows core platform SDK, which includes also uxTheme.pas and
tmSchema.pas. So at least we have
> the full translation. Since these units are part of the regular JEDI Win32API
distribution it would
> be the best way to use them. But on the other hand I cannot expect that every
user of VT has
> download the package from JEDI. So I tend to include both units with the VT
package and make a note
> about the JEDI package in the help file.

Doh. Before I downloaded the Win32 SDK with the XP header files I have looked
at the
latest version of Marcel's conversion and did not see conversions for uxTheme
and tmSchema.
Now that you mention it I see them, on my harddisk for quite some time. XXL-doh.

Including these files in the distribution would make sense to me. But there is
a little
problem: Marcel's conversions are static import units. An app compiled with
these would
only run on XP. I guess you would have to change everything you need from
uxTheme into
the dynamic way.

> > For the VT I suggest to add a new paint option "toThemeAware". When this
option is active the tree
> > detects if it runs on a themed XP (or generally on an OS with uxTheme.dll
available) and
> > adjusts its drawing automatically. To detect if a theme has to be employed
the tree can use the
> IsAppThemed()
> > function from uxTheme. To detect whenever the theme changes (classic <->
blue <-> silver <-> ...)
> > the message WM_THEMECHANGED must be handled.
>
> Yep, that's how I planned it so far. Shouldn't be that difficult....

Looking forward to seeing it. Checkboxes, radiobuttons and tree buttons should
be usable
very easily. Emulating ctButton is not so straightforward, we can use any
button style for
this (toolbutton or pushbutton) or simply take one from the imagelist which is
selected
into the property.

And I could not draw the sort arrow in the header, although there is a part
constant in
tmSchema for this. As you can see in ThemeExplorer, if the header is drawn with
this part
it looks like normal except that the vertical separator to the next column is
missing. I
couldn't figure out what the other header parts (*left, *right) are for. It may
be possible
that they are not defined any different than the normal header part, but only
for the currently
available theme. Future themes may change that.

There is one more problem. To get a theme handle for each of the classes
("BUTTON", "HEADER")
you have to use OpenThemeData() with a window handle. I have not tested what
happens if you
open several theme datas with the same handle. If that does not work we might
have to try
some workaround here. OTOH, you will probably cache the state images once at
startup and at
WM_THEMECHANGED probably, at least the current implementation suggests this
approach for
minimal efforts. In this case the problem is no problem, because the handle can
easily be
reused after CloseThemeData() for the previous theme. It may also well be that
using the
null handle (Desktop?) suffices for multiple use in parallel... (Hope this was
not too con-
fusing)

Just for the record, it is not always wise to workaround DrawThemeBackground(),
because this
function does some blending into the existing background. As far as I could see
this is
relevant mostly for the pushbutton, but I give no guarantees on this ;)

Another problem, probably obvious, but I see it only now. You can't put the
header images
into a few state bitmaps because the header can be resized. Thus I suggest to
get bitmaps
for all relevant states of checkboxes, radiobutton, treebuttons. Then
OpenThemeData with
"Header" and use that all the time to draw the header.

Regards,
Werner

 | Replies | Author | Date
4253 | Re: Visual themes support | Mike Lischke | Wed 10/24/2001


re: Re: VTreeView with a database

From: Werner Lehmann [wl@b...]
Date: Tue Oct 23, 2001 10:54 pm
Subject: Re: [VirtualTreeview] Re: VTreeView with a database

[christophe37fr@y...] wrote:
>
> OK Thanks for your information. About your source example, even if
> it's no good for DataBase could you please show me how you do it
> please.(I work with SQL-SERVER or ACCESS)

What exactly should I show you? How to work with a VT in general? There
are enough examples floating around probably, you can even look at the
reincarnation of the DBVT from Adem and Vadim (although I can't say
anything about it, have not used or tried it).

And I cannot give you my code. For one, its copyrighted by my company,
and then it is not likely to help you. I am putting a tree cache layer
in between VT and the DB and decouple everything via interfaces. Should
be more than confusing for a VT newcomer.

I suggest you read the introduction in the helpfile, look at the mentioned
source file or other examples available via YG and come back with specific
questions.

Regards,
Werner

 | Replies | Author | Date
4250 | Re: VTreeView with a database | [christophe37fr@y...] | Wed 10/24/2001


re: Re: AddChild (Mike, please read)

From: Werner Lehmann [wl@b...]
Date: Tue Oct 23, 2001 11:31 pm
Subject: Re: [VirtualTreeview] Re: AddChild (Mike, please read)

[d.faessler@p...] wrote:
>
> Nevertheless thank you for your work. I hope someone can help me as
> soon as possible, because I have to deliver my program tomorrow.

You get along with a few changes. Demo app pasted below.

Mike: if AddChild is used with user data pointer and the tree's UpdateCount
is 0, we have a problem: before the UserData is set (in AddChild), it is
already used:

AddChild->SetChildCount->UpdateScrollBars->UpdateHorizontalScrollbar
->GetMaxRightExtend->DoGetNodeWidth->GetText

If there is such an AddChild variant we should be sure that the optional
parameter is used (assigned) before it is queried. You can test that if
you comment the BeginUpdate below and click the button.

Regards,
Werner

unit Unit1;

interface

uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, VirtualTrees;

type
TString50 = string[50];

PTree = ^TTree;
TTree = record
Desc: TString50;
Paint: Integer;
Next: PTree;
end;

TForm1 = class(TForm)
MyTree: TVirtualStringTree;
Button1: TButton;
procedure FormCreate(Sender: TObject);
procedure Button1Click(Sender: TObject);
procedure MyTreeGetText(Sender: TBaseVirtualTree; Node: PVirtualNode;
Column: Integer; TextType: TVSTTextType; var Text: WideString);
private
Root: PTree;
public
{ Public declarations }
end;

var
Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.FormCreate(Sender: TObject);
var
tmp: PTree;
i: Integer;

function AddSibling(Node: PTree; Desc: TString50; Paint: Integer): PTree;
begin
New(result);
result.Desc := Desc;
result.Paint := Paint;
result.Next := nil;
if Node <> nil then
Node.Next := result;
end;

begin
// Create test data. Data is not freed on termination for this demo app!
Root := AddSibling(nil, 'Root', 1);
tmp := Root;
for i := 1 to 10 do
tmp := AddSibling(tmp, 'Node ' + IntToStr(i), Ord(Odd(i)));

// NodeDataSize: not SizeOf(TTree) in this case, we want to store only a
// reference to our own data record!
MyTree.NodeDataSize := SizeOf(PTree);
end;

procedure TForm1.Button1Click(Sender: TObject);
var
tmp: PTree;
begin
with MyTree do
try
// BeginUpdate / EndUpdate is necessary here because otherwise VT tries
// to get text before user data is set.
BeginUpdate;
Clear;
tmp := Root; // First record.
while tmp <> nil do
begin
if tmp.Paint = 1 then
MyTree.AddChild(nil, tmp);
tmp := tmp.Next;
end;
finally
EndUpdate;
end;
end;

procedure TForm1.MyTreeGetText(Sender: TBaseVirtualTree;
Node: PVirtualNode; Column: Integer; TextType: TVSTTextType;
var Text: WideString);
var
nodeD: PTree;
begin
// User data is a pointer to a pointer to the data...
nodeD := PTree(MyTree.GetNodeData(node)^);
Text := NodeD.Desc;
end;

end.

 | Replies | Author | Date
4289 | Re: AddChild (Mike, please read) | Mike Lischke | Sat 10/27/2001
4302 | Re: AddChild (Mike, please read) | Werner Lehmann | Sat 10/27/2001
4316 | Re: AddChild (Mike, please read) | Mike Lischke | Sun 10/28/2001


VCL and OLE drag and drop!

From: [jogador3@y...]
Date: Wed Oct 24, 2001 7:39 am
Subject: VCL and OLE drag and drop!

Hi!

In some applications I use VCL and in others I use OLE drag and drop.
Sometimes I need to change the dragcursor image, but it didn`t work!
I tried to set the VST.DragCursor, but it doesn't change! If I add
"inherited" to the main "else" statement of TBaseVirtualTree.BeginDrag
it work, but then I have a Access Violation. How should I do to be
able to change the drag cursor in both OLE and VCL drag and drop?

Thanks,
Trevis

 | Replies | Author | Date
4290 | Re: VCL and OLE drag and drop! | Mike Lischke | Sat 10/27/2001


Error in DBVTD5

From: "Ralf Melles" [rmelles@g...]
Date: Wed Oct 24, 2001 11:52 am
Subject: Error in DBVTD5

Hi,

I found a bug in "SimpleVirtualDBTree".

I can not access the TreeOptions in designtime.

 | Replies | Author | Date
4257 | WINDEFINES.INC | Malcolm Smith | Wed 10/24/2001
4259 | Re: WINDEFINES.INC | Mike Lischke | Wed 10/24/2001
4260 | Re: WINDEFINES.INC | Malcolm Smith | Wed 10/24/2001
4291 | Re: Error in DBVTD5 | Mike Lischke | Sat 10/27/2001


Does anyone know if this is possible?

From: [martijn@b...]
Date: Wed Oct 24, 2001 12:19 pm
Subject: Does anyone know if this is possible?

Hi all,

I want to create some view like this (
http://groups.yahoo.com/group/VirtualTreeview/files/Misc/request.gif )
- does anyone know if this is possible at all, and if so, can you
give me some directions - I cannot seem to get it done...

Thanks!

Martijn Tonies

 | Replies | Author | Date
4275 | Starting a drag problem | Jim Kueneman | Fri 10/26/2001
4305 | Re: Starting a drag problem | Mike Lischke | Sat 10/27/2001
4311 | Re: Starting a drag problem | Jim Kueneman | Sat 10/27/2001
4322 | Re: Starting a drag problem | Mike Lischke | Sun 10/28/2001
4336 | Re: Starting a drag problem | Jim Kueneman | Mon 10/29/2001
4339 | Re: Starting a drag problem | Mike Lischke | Mon 10/29/2001
4340 | Re: Starting a drag problem | Jim Kueneman | Mon 10/29/2001
4342 | Re: Starting a drag problem | Jim Kueneman | Tue 10/30/2001
4364 | Re: Starting a drag problem | Mike Lischke | Thu 11/1/2001


bug in 2.5.4

From: Simon Giles [simon.giles@q...]
Date: Wed Oct 24, 2001 1:54 pm
Subject: bug in 2.5.4

I've come across a case in TBaseVirtualTree.GetNextVisible where it's call
to GetFirstChild will return nil. As a result I get an access violation.
Here's the changes which I feel need to be made:

Old Code:

if ForceSearch or not (vsVisible in Result.States) then
begin
repeat
// Is there a next sibling?
if Assigned(Result.NextSibling) then
begin
Result := Result.NextSibling;
if vsVisible in Result.States then
Break;
end
else
begin
// No sibling anymore, so use the parent's next sibling.
if Result.Parent <> FRoot then
Result := Result.Parent
else
begin
// There are no further nodes to examine, hence there is no
further visible node.
Result := nil;
Break;
end;
end;
until False;
end;

New Code:

if assigned(result) and (ForceSearch or not (vsVisible in
Result.States)) then
begin
repeat
// Is there a next sibling?
if Assigned(Result.NextSibling) then
begin
Result := Result.NextSibling;
if vsVisible in Result.States then
Break;
end
else
begin
// No sibling anymore, so use the parent's next sibling.
if Result.Parent <> FRoot then
Result := Result.Parent
else
begin
// There are no further nodes to examine, hence there is no
further visible node.
Result := nil;
end;
end;
until (result=nil);
end;

Regards,
Simon

[Non-text portions of this message have been removed]

 | Replies | Author | Date
4293 | Re: bug in 2.5.4 | Mike Lischke | Sat 10/27/2001


Problems selecting first node in branch of tree.

From: Simon Giles [simon.giles@q...]
Date: Wed Oct 24, 2001 2:31 pm
Subject: Problems selecting first node in branch of tree.

Has anyone else encountered this problem?

After populating a tree, and opening a branch, I'm unable to select the
first node in the branch by clicking on the caption/text of the node. I can
select the node by clicking on the icon, and I can select other nodes in the
branch by clicking on their caption/text. It's as though the rectangle
which is clickable for selecting the first node in a branch does not include
the caption/text.

This problem occurs for all first nodes in every branch of the tree. (By
first I mean the top most node in the branch).

Regards,
Simon

[Non-text portions of this message have been removed]

 | Replies | Author | Date
4248 | Re: Problems selecting first node in branch of tr | Werner Lehmann | Wed 10/24/2001
4251 | Re: Problems selecting first node in branch of tr | Jacco | Wed 10/24/2001
4284 | Re: Problems selecting first node in branch of tr | Simon Giles | Fri 10/26/2001


Customizing plus minus bitmaps

From: [skanade@v...]
Date: Wed Oct 24, 2001 3:30 pm
Subject: Customizing plus minus bitmaps

I don't see a way to change the '+' '-' buttons to my own Folder
open and close bitmaps. I think it would be a common enough
requirement. Any ideas how to do that?

 | Replies | Author | Date
4249 | Re: Customizing plus minus bitmaps | Werner Lehmann | Wed 10/24/2001
4294 | Re: Customizing plus minus bitmaps | Mike Lischke | Sat 10/27/2001


re: Problems selecting first node in branch of tree.

From: Werner Lehmann [wl@b...]
Date: Wed Oct 24, 2001 4:07 pm
Subject: Re: [VirtualTreeview] Problems selecting first node in branch of tree.

Hi Simon,

> Has anyone else encountered this problem?

Yes.

> After populating a tree, and opening a branch, I'm unable to select the
> first node in the branch by clicking on the caption/text of the node. I can
> select the node by clicking on the icon, and I can select other nodes in the
> branch by clicking on their caption/text. It's as though the rectangle
> which is clickable for selecting the first node in a branch does not include
> the caption/text.
>
> This problem occurs for all first nodes in every branch of the tree. (By
> first I mean the top most node in the branch).

The reason is that VST holds an internal node width cache, which is initialized
(for example) in AddChild. If you don't use OnNodeInit but init a node manually
it will think that there is no text in that node and init the node width to
some-
thing small or 0. And it will not be aware when you later on set the node data
because the node width is already init'ed.

To fix it do one of these:
- Put BeginUpdate / EndUpdate around the code which adds the children or
modifies
the childcount, if you init nodes manually.
- Use OnInitNode event.
- Call RevalidateNode after AddChild.

Werner


re: Customizing plus minus bitmaps

From: Werner Lehmann [wl@b...]
Date: Wed Oct 24, 2001 4:10 pm
Subject: Re: [VirtualTreeview] Customizing plus minus bitmaps

[skanade@v...] wrote:
>
> I don't see a way to change the '+' '-' buttons to my own Folder
> open and close bitmaps. I think it would be a common enough
> requirement. Any ideas how to do that?

As far as I know there is currently no support for custom drawing of tree
buttons or tree lines (you can provide a pattern of the lines though). You
could hide the tree lines and use your folder images as state images. Or do
custom painting.

Werner


re: VTreeView with a database

From: [christophe37fr@y...]
Date: Wed Oct 24, 2001 5:39 pm
Subject: Re: VTreeView with a database

--- In [VirtualTreeview@y...], Werner Lehmann [wl@b...] wrote:
> [christophe37fr@y...] wrote:
> >
> > OK Thanks for your information. About your source example, even if
> > it's no good for DataBase could you please show me how you do it
> > please.(I work with SQL-SERVER or ACCESS)
>
> What exactly should I show you? How to work with a VT in general?
There
> are enough examples floating around probably, you can even look at
the
> reincarnation of the DBVT from Adem and Vadim (although I can't say
> anything about it, have not used or tried it).
>
> And I cannot give you my code. For one, its copyrighted by my
company,
> and then it is not likely to help you. I am putting a tree cache
layer
> in between VT and the DB and decouple everything via interfaces.
Should
> be more than confusing for a VT newcomer.
>
> I suggest you read the introduction in the helpfile, look at the
mentioned
> source file or other examples available via YG and come back with
specific
> questions.
>
> Regards,
> Werner

Thanks a lot for your informations,I think that I found the way to
get Data in my VT.Thanks again.
Regards,
Christophe


re: Problems selecting first node in branch of tree.

From: "Jacco" [Jacco@j...]
Date: Wed Oct 24, 2001 6:06 pm
Subject: Re: [VirtualTreeview] Problems selecting first node in branch of tree.

Simon,

I've had this problem a long time ago. This whas due to the fact that I
didn't initialize my record structure in the OnInitNode event. I moved my
code to the OnInitNode and since then I can select the caption text of the
Topnode.

Regards,
Jacco

----- Original Message -----
From: "Simon Giles" [simon.giles@q...]
To: <VirtualTreeview@yahoogroups.com>
Sent: Wednesday, October 24, 2001 4:31 PM
Subject: [VirtualTreeview] Problems selecting first node in branch of tree.

> Has anyone else encountered this problem?
>
> After populating a tree, and opening a branch, I'm unable to select the
> first node in the branch by clicking on the caption/text of the node. I
can
> select the node by clicking on the icon, and I can select other nodes in
the
> branch by clicking on their caption/text. It's as though the rectangle
> which is clickable for selecting the first node in a branch does not
include
> the caption/text.
>
> This problem occurs for all first nodes in every branch of the tree. (By
> first I mean the top most node in the branch).
>
> Regards,
> Simon
>
>
> [Non-text portions of this message have been removed]
>
>
>
> To unsubscribe from this group, send an email to:
> VirtualTreeview-unsubscribe@egroups.com
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>


re: How to hide droptarget

From: "Mike Lischke" [lists@l...]
Date: Wed Oct 24, 2001 8:17 pm
Subject: RE: [VirtualTreeview] How to hide droptarget

Hi Simon,

> Is there any way to hide the selection box around the dropTargetnode
> in a drag'n'drop operation?

Mmh, this was not intended, because usually you want to see where you will drop
to, but you could
try to set the drop target colors to the window background color.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net

 | Replies | Author | Date
4276 | Re: How to hide droptarget | [cas@c...] | Fri 10/26/2001
4277 | Re: How to hide droptarget | Jim Kueneman | Fri 10/26/2001
4278 | Re: How to hide droptarget | [cas@c...] | Fri 10/26/2001


re: Visual themes support

From: "Mike Lischke" [lists@l...]
Date: Wed Oct 24, 2001 8:29 pm
Subject: RE: [VirtualTreeview] Visual themes support

Hi Werner,

> I did not know ThemeExplorer. Otherwise I wouldn't have written my own...
(sort of) ;)

Always look for examples in MSDN. You can't get better code (at least most of
the time), unless you
(in general) don't understand C/C++.

> Now that you mention it I see them, on my harddisk for quite some time.
XXL-doh.

:o]

> Including these files in the distribution would make sense to me. But there
is a little
> problem: Marcel's conversions are static import units. An app compiled with
these would
> only run on XP. I guess you would have to change everything you need from
uxTheme into
> the dynamic way.

No problem. This is already done. I also have sent the changed units back to
Marcel today.

> I couldn't figure out what the other header parts (*left, *right) are for.

I found it today. They are for the fixed areas. E.g. in the listview this is
the area right to the
last column.

> There is one more problem. To get a theme handle for each of the classes
("BUTTON", "HEADER")
> you have to use OpenThemeData() with a window handle. I have not tested what
happens if you
> open several theme datas with the same handle.

Works like a charme. By default VT opens 3 theme handles (one for 'header', one
for 'treeview' and
one for 'button').

> null handle (Desktop?) suffices for multiple use in parallel

The null handle means to retrieve the default theme data. You can set theme
stuff for each window
individually.

> Another problem, probably obvious, but I see it only now. You can't put the
header images
> into a few state bitmaps because the header can be resized. Thus I suggest to
get bitmaps
> for all relevant states of checkboxes, radiobutton, treebuttons. Then
OpenThemeData with
> "Header" and use that all the time to draw the header.

What do you mean here? I use a previously opened theme and draw the header.
Then I paint the image
on this. No problem so far. Do I miss something?

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


New file uploaded to VirtualTreeview

From: [VirtualTreeview@yahoogroups.com>
Date: Wed Oct 24, 2001 8:38 pm
Subject: New file uploaded to VirtualTreeview

Hello,

This email message is a notification to let you know that
a file has been uploaded to the Files area of the VirtualTreeview
group.

File : /VirtualTree_2.6.0.zip
Uploaded by : [lists@l...]
Description : Release candidate 2

You can access this file at the URL

http://groups.yahoo.com/group/VirtualTreeview/files/VirtualTree_2.6.0.zip

To learn more about file sharing for your group, please visit

http://help.yahoo.com/help/us/groups/files

Regards,

lists@l...]

 | Replies | Author | Date
4256 | Re: New file uploaded to VirtualTreeview | Mike Lischke | Wed 10/24/2001
4267 | Re[2]: [VirtualTreeview] New file uploaded to Vir | Oleg Kraynov | Thu 10/25/2001
4299 | Re: Re[2]: [VirtualTreeview] New file uploaded to | Mike Lischke | Sat 10/27/2001
4312 | Re[4]: [VirtualTreeview] New file uploaded to Vir | Oleg Kraynov | Sat 10/27/2001
4332 | Re: Re[4]: [VirtualTreeview] New file uploaded to | Mike Lischke | Mon 10/29/2001


re: DBVT pascal translation reorganized

From: [adembaba@e...]
Date: Wed Oct 24, 2001 8:42 pm
Subject: Re: DBVT pascal translation reorganized

Mike,

> > - DCRs must be designed for
> > - TVirtualDBTree,
> > - TDBCheckVirtualDBTree,
> > - TCheckVirtualDBTree
>
> I can do that, no problem. This is only a matter of a
> couple of minutes.

I am just curious: How do you do that, what do you use?

> But what's the check treeview (and its DB variant)?

TDBCheckVirtualDBTree is TVirtualDBTree with a non-dataaware
checkbox. TCheckVirtualDBTree is TVirtualDBTree with a
dataaware checkboxfield that receives its checkmark value
from a completely separate datasource.

I find this distinction confusing too. I am of the opinion
that there must be a unified (data-aware) thingy, and if
its CheckDataSource property is unassigned, then it (checkbox)
should behave like how it does in VT.

Plus, for further disambiguity:
-- unified class should be named something TVirtualDBCheckBoxTree
(OK, I am flexible about this name thing :-)

-- CheckDataSource should be renamed to CheckBoxDataSource
-- ResultFieldName should be renamed to CheckBoxField

If you agree, I will try to do these in a couple days.

Then again, I am beginning to question the existence of
TVirtualDBCheckBoxTree in a generalized component all together;
is this not too much of a specialty to provide a new datasource
and datafield (only a checkbox at that). Would we not have to
provide another variant which addresses a case with blobs,
and another one with array fields, etc...

What do you say?

Cheers,
Adem

 | Replies | Author | Date
4258 | Re: DBVT pascal translation reorganized | Mike Lischke | Wed 10/24/2001
4262 | Re: DBVT pascal translation reorganized | [adembaba@e...] | Thu 10/25/2001


re: New file uploaded to VirtualTreeview

From: "Mike Lischke" [lists@l...]
Date: Wed Oct 24, 2001 8:53 pm
Subject: RE: [VirtualTreeview] New file uploaded to VirtualTreeview

> This email message is a notification to let you know that
> a file has been uploaded to the Files area of the VirtualTreeview
> group.

So, this time there is not much to say. New things are:

- full Windows XP theme support
- ILC_COLOR32 is now used for image list creation (instead ILC_COLOR16) to
allow for XP alpha
blending
- ContentToXXX routines consider now hidden columns

Plese check that the image lists still work correctly, particularly under
Win9x/ME systems (because
of the new flag).

A request to all of you: please, I need help with the help. I don't know how to
finish the help file
in my limited time. I still have bugs to fix and the demos must be brought in a
usable and tested
state. I urgently need volunteers for writing help or I simply have to skip
many parts. With the
current speed of writing the help it will take until next spring or so until it
is finished...

Things needed to be written:
- TCustomVirtualDrawTree & TVirtualDrawTree (base tree is nearly finished)
- TCustomVirtualStringTree & TVirtualStringTree
- TEnumFormatEtc
- TFormatEtcList
- TScrollBarOptions
- TStringEditLink
- TVTColors
- TVTDragImage
- TVTEdit
- TVTHeader
- TVirtualTreeColumn
- TVirtualTreeColumns
- TVirtualTreeHintWindow
- TVirtualTreeOptions (custom variant is already finished)
- many of the constants
- IVTDragManager
- IVTEditLink
- all types (e.g. TAfterItemEraseEvent, TCache, TVTButtonStyle etc.)
- the header popup menu

There is always a summary and a description for each item. The classes get an
entry for each
property and method. The non-custom variants of classes usually need only
references to the
custom-variants.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net

 | Replies | Author | Date
4267 | Re[2]: [VirtualTreeview] New file uploaded to Vir | Oleg Kraynov | Thu 10/25/2001
4299 | Re: Re[2]: [VirtualTreeview] New file uploaded to | Mike Lischke | Sat 10/27/2001
4312 | Re[4]: [VirtualTreeview] New file uploaded to Vir | Oleg Kraynov | Sat 10/27/2001
4332 | Re: Re[4]: [VirtualTreeview] New file uploaded to | Mike Lischke | Mon 10/29/2001


WINDEFINES.INC

From: "Malcolm Smith" [mjfreelancing@o...]
Date: Wed Oct 24, 2001 9:13 pm
Subject: WINDEFINES.INC

The above file is not on my system and I cannot compile the VT under BCB5.

Where can I get it from ?

Malcolm Smith
MJ Freelancing
ABN: 30 671 763 146
http://www.mjfreelancing.com

CORintel
ABN: 30 336 110 329

 | Replies | Author | Date
4259 | Re: WINDEFINES.INC | Mike Lischke | Wed 10/24/2001
4260 | Re: WINDEFINES.INC | Malcolm Smith | Wed 10/24/2001


re: Re: DBVT pascal translation reorganized

From: "Mike Lischke" [lists@l...]
Date: Wed Oct 24, 2001 9:26 pm
Subject: RE: [VirtualTreeview] Re: DBVT pascal translation reorganized

Adem,

> > > - DCRs must be designed for
> > > - TVirtualDBTree,
> > > - TDBCheckVirtualDBTree,
> > > - TCheckVirtualDBTree
> >
> > I can do that, no problem. This is only a matter of a
> > couple of minutes.
>
> I am just curious: How do you do that, what do you use?

Very simple: Photoshop for design and the Image editor form Delphi to create
the dcr. I uploaded a
simple dcr, so you can have a look (descentants folder).

> If you agree, I will try to do these in a couple days.

Sure, go ahead. My problem with that is that I have difficulties to understand
the meaning of a
general DB tree. I have written one for my company (also using parent/child
columns), but this is
for a special task.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net

 | Replies | Author | Date
4262 | Re: DBVT pascal translation reorganized | [adembaba@e...] | Thu 10/25/2001


re: WINDEFINES.INC

From: "Mike Lischke" [lists@l...]
Date: Wed Oct 24, 2001 9:29 pm
Subject: RE: [VirtualTreeview] WINDEFINES.INC

Malcolm,

> The above file is not on my system and I cannot compile the VT under BCB5.

Simply remove the references. They are not needed with the two files. I will
upload a corrected
version soon.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net

 | Replies | Author | Date
4260 | Re: WINDEFINES.INC | Malcolm Smith | Wed 10/24/2001


re: WINDEFINES.INC

From: "Malcolm Smith" [mjfreelancing@o...]
Date: Wed Oct 24, 2001 11:15 pm
Subject: RE: [VirtualTreeview] WINDEFINES.INC

Mike,

Thanks.

Malcolm Smith
MJ Freelancing
ABN: 30 671 763 146
http://www.mjfreelancing.com

CORintel
ABN: 30 336 110 329

-----Original Message-----
From: Mike Lischke [mailto:[lists@l...]]
Sent: Thursday, 25 October 2001 07:30
To: VirtualTreeview@yahoogroups.com
Subject: RE: [VirtualTreeview] WINDEFINES.INC

Malcolm,

> The above file is not on my system and I cannot compile the VT under BCB5.

Simply remove the references. They are not needed with the two files. I will
upload a corrected
version soon.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net

To unsubscribe from this group, send an email to:
VirtualTreeview-unsubscribe@egroups.com

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/


2.6.0

From: Werner Lehmann [wl@b...]
Date: Thu Oct 25, 2001 12:01 am
Subject: 2.6.0

Hi Mike,

I am just testing the new version, and the visual style drawing works good -
except
for a few minor problems.

- toThemeAware does not change the used DrawSelectionMode
- What is HotCursor for? I find that it is set automagically to crHandPoint in
one
of my VSTs. This leads to an always-on crHandPoint cursor if the mouse cursor
is
above the VT (not only nodes or checkboxes). I believe that this is what the
usual
Cursor property is for...
- Header resize problem: create enough columns to get a horz scrollbar, scroll
some-
what to the right, try to resize one of the last, partially visible columns.
Effect is hard to describe but was easily reproducible, hot track header is
painted
in a wrong way, resizing column is partially 'hidden' behind other columns
until
resize is finished, or resizing column is doubled. Horz offset is not
respected
probably.

BTW, after recompiling the packages I had some of the 'usual' trouble:
properties
of the trees have been changed randomly. Tree options are set when they weren't
be-
fore or vice versa and one Imagelist property was nil'ed without obvious
reason, and
of course the HotCursor property which changed to crHandPoint in only of several
trees... strange. Probably one of the several D6 bugs (I cannot even use the
desktop
layouts without getting - sometimes - an AV when D6 wants to switch back from
Debug
desktop to standard desktop, fails, and still thinks that the app is running;
this
always ended in a forced restart of the IDE because I could not run the app
again
(the IDE insisted that it would be running already)...

Regards,
Werner

 | Replies | Author | Date
4295 | Re: 2.6.0 | Mike Lischke | Sat 10/27/2001
4304 | Re: 2.6.0 | Werner Lehmann | Sat 10/27/2001
4318 | Re: 2.6.0 | Mike Lischke | Sun 10/28/2001
4319 | Re: 2.6.0 | Werner Lehmann | Sun 10/28/2001
4333 | Re: 2.6.0 | Mike Lischke | Mon 10/29/2001
4347 | Re: 2.6.0 | Simon Giles | Tue 10/30/2001
4365 | Re: 2.6.0 | Mike Lischke | Thu 11/1/2001


re: DBVT pascal translation reorganized

From: [adembaba@e...]
Date: Thu Oct 25, 2001 5:51 am
Subject: Re: DBVT pascal translation reorganized

> > > I can do that, no problem. This is only a matter of a
> > > couple of minutes.
> > I am just curious: How do you do that, what do you use?
>
> Very simple: Photoshop for design and the Image editor form
> Delphi to create the dcr.

Again, you're too humble... When I try to do that, what I end
up is blurb: I dont have the eye to see what my admirable
work of art of 1200x1200 will look like when it is reduced
to 24x24. And, I can never design anything meaningful at
24x24 resolution. Thank goodness there are others that can.

> I uploaded a simple dcr, so you can have a look (descentants
> folder).

They both look fine to me.

> My problem with that is that I have difficulties to understand
> the meaning of a general DB tree. I have written one for my
> company (also using parent/child columns), but this is for
> a special task.

Frankly, I agree. And, IMHO, a *general* tree should use
_queries_ for each of its nodes, and hence, instead of
a pair of extra numeric parent-child fields, the field kinds
should be a lot more flexible. But, IIRC, we discussed
this a little and some people disagreed. So, we'll go with
minimum denominator.

Cheers,
Adem


Collapse when deleting nodes

From: Martijn Tonies [martijn@b...]
Date: Thu Oct 25, 2001 6:38 am
Subject: Collapse when deleting nodes

Hi all,

Recently, I've downloaded a new version of the VirtualTreeview component. Am
I correct that the behaviour for deleting nodes has changed a bit?

I think that when you delete the currently focused/selected node, the
parentnode collapses. Before (talking way old versions) I think the focus
went to the previous sibling or the parent of the deleted node.

Any comments on this?

Martijn Tonies

[Non-text portions of this message have been removed]

 | Replies | Author | Date
4296 | Re: Collapse when deleting nodes | Mike Lischke | Sat 10/27/2001


Using same node-structure by 2 VTs?

From: "Ralf Melles" [rmelles@g...]
Date: Thu Oct 25, 2001 7:27 am
Subject: Using same node-structure by 2 VTs?

Hi Mike,

is it possible to use the same node-structure by 2 vtrees?
I have created a huge application for modeling hierarchys for a
datawarehouse. Now i have to show several attributes for every node.
I've added columns to show them but it would be more easier for the
enduser to horizontal scroll only the attributes.

I tried this by using your old synchronize demo, but it would blow up
the application-code if I do all node
creating/modifying/deleting/drag'n'drop... in both trees!

I simply use the same pointers in both trees to my memory-structure.
It would be perfect, if there is a possibility to *link* the second
treestructure to the first so that the second tree reflects every
changes in nodestruct of the first.

Thank you for doing a great job on this component!

Best regards
Ralf

 | Replies | Author | Date
4297 | Re: Using same node-structure by 2 VTs? | Mike Lischke | Sat 10/27/2001


re: Re: DBVT pascal translation reorganized

From: Vandrovec Milan [milan_va@s...]
Date: Thu Oct 25, 2001 8:07 am
Subject: RE: [VirtualTreeview] Re: DBVT pascal translation reorganized

Hi.

> > I uploaded a simple dcr, so you can have a look (descentants
> > folder).
>
> They both look fine to me.

I don't know about you, but for me, Delphi takes transparent color
from LOWER left corner, so Mike's nice images have purple background
after installation, and look a bit weird (there is white and black in
that corner). The solution is to move them right by 1 pixel, there is
luckily enough space.
Other than that, the look quite fine - except I don't know what they
mean :-)

Milan

P.S.: After writing this, I tried to improve them ... a bit... and uploaded
it as
http://groups.yahoo.com/group/VirtualTreeview/files/Descendants/
DBVT_milan_va.dcr

 | Replies | Author | Date
4268 | Re: DBVT pascal translation reorganized | [adembaba@e...] | Thu 10/25/2001
4298 | Re: DBVT pascal translation reorganized | Mike Lischke | Sat 10/27/2001


Newest VTV

From: Yur Ovchinnikov [Yur@s...]
Date: Thu Oct 25, 2001 9:41 am
Subject: Newest VTV

Hello folks,

Where can i get newest beta VTV without login to Yachoo?

--
Best regards,
Yur Ovchinnikov E-mail: [yur@s...]
JSC Summit WWW: http://alone.come.to
ICQ: 1400397

 | Replies | Author | Date
4269 | Re: Newest VTV | Helge Jung (ECO-Logic) | Thu 10/25/2001


Re[2]: New file uploaded to VirtualTreeview

From: Oleg Kraynov [olegvkr@y...]
Date: Thu Oct 25, 2001 9:29 am
Subject: Re[2]: [VirtualTreeview] New file uploaded to VirtualTreeview

Hi, Mike.

1. Very bad idea to deprive the not_XP users new XP styles.
Please, return back.

2. Where search for the files tmschema.h and uxtheme.h?

3. 2.5.43 - Please, subj "Re[4]: [VirtualTreeview] Problem: show/hide
columns".

--
Best regards,
Oleg

_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com

 | Replies | Author | Date
4299 | Re: Re[2]: [VirtualTreeview] New file uploaded to | Mike Lischke | Sat 10/27/2001
4312 | Re[4]: [VirtualTreeview] New file uploaded to Vir | Oleg Kraynov | Sat 10/27/2001
4332 | Re: Re[4]: [VirtualTreeview] New file uploaded to | Mike Lischke | Mon 10/29/2001


re: DBVT pascal translation reorganized

From: [adembaba@e...]
Date: Thu Oct 25, 2001 10:26 am
Subject: Re: DBVT pascal translation reorganized

Hi,

> > > I uploaded a simple dcr, so you can have a look (descentants
> > > folder).
> >
> > They both look fine to me.

> I don't know about you, but for me, Delphi takes transparent color
> from LOWER left corner, so Mike's nice images have purple background
> after installation, and look a bit weird (there is white and black
> in that corner). The solution is to move them right by 1 pixel,
> there is luckily enough space.

I did see the purple background, but, at this stage that didnt
look too important --after all, since DBVT is sort of alpha/beta
so could the .DCRs be ;-)

> Other than that, the look quite fine - except I don't know what
> they mean :-)

I dont care :-) Since when an image is meant to mean anything;
lust look at the Penguin, or the Monkey or any other open
source/GPL stuff...

> P.S.: After writing this, I tried to improve them ... a bit...
> and uploaded it as
> http://groups.yahoo.com/group/VirtualTreeview/files/Descendants/
> DBVT_milan_va.dcr

I will.


re: Newest VTV

From: "Helge Jung \(ECO-Logic\)" [helge@e...]
Date: Thu Oct 25, 2001 11:20 am
Subject: Re: [VirtualTreeview] Newest VTV

> Where can i get newest beta VTV without login to Yachoo?

You can't except someone provides it (but I think this person would have to
have permission by Mike). Why don't you want to login into YahooGroups?
Where's the problem? IIRC you can't post if you aren't signed in - so you
are already logged in, aren't you???

Helge.


Paintbug?

From: "Anders Thomsen" [anders@t...]
Date: Thu Oct 25, 2001 3:21 pm
Subject: Paintbug?

Hi everybody,

I send this to Mike some time ago, but I haven't head from him yet, but maybe
another one can help me.

I've been dealing with this strange painting error when hiding certain nodes.
Now I just found out, that the problem seems to happen when hiding the first
node.
It can easily be reproduced:

tree.rootnodecount := 8000;
..
..
tree.beginupdate;
aNode := tree.getfirstnode;
tree.isVisible[aNode] := false;
tree.endupdate;

Now try selecting some nodes, and you'll see the problem.
Mike found out that it the problem is the total node height is somehow wrong,
and thought it
was related to the way I filled the tree.

Can anyone else reproduce this problem?

Cheers,
Anders Thomsen

[Non-text portions of this message have been removed]

 | Replies | Author | Date
4271 | Re: Paintbug? | Jim Kueneman | Thu 10/25/2001
4273 | Re: Paintbug? | Anders Thomsen | Thu 10/25/2001
4279 | Re: Paintbug? | Michael Valentiner=Branth | Fri 10/26/2001
4313 | Re: Paintbug? | Mike Lischke | Sun 10/28/2001
4328 | Re: Paintbug? | Michael Valentiner=Branth | Mon 10/29/2001
4300 | Re: Paintbug? | Mike Lischke | Sat 10/27/2001
4324 | Re: Paintbug? | Anders Thomsen | Sun 10/28/2001


re: Paintbug?

From: "Jim Kueneman" [jimdk@m...]
Date: Thu Oct 25, 2001 3:26 pm
Subject: Re: Paintbug?

> Can anyone else reproduce this problem?

Confirmed, something is not right.

Jim


2.6.0: TAB Key deletes selected text

From: Ralf Junker [ralfjunker@g...]
Date: Thu Oct 25, 2001 10:23 am
Subject: 2.6.0: TAB Key deletes selected text

Hi Mike,

your recent changes (thank you!), allow to insert (invisible) tab character
when editing nodes (which also deletes all selected text).

Windows explorer does not react to TABs during node editing at all.

I suggest the following additions::

procedure TVTEdit.WMChar(var Message: TWMChar);
begin
case Message.CharCode of
VK_ESCAPE, // avoid beep
VK_TAB: ;
else
inherited;
end;
end;

Alternatively, you may set

Message.CharCode := 0;

Both work, but I don't dare say which to prefer.

Regards,

-- Ralf

 | Replies | Author | Date
4301 | Re: 2.6.0: TAB Key deletes selected text | Mike Lischke | Sat 10/27/2001


re: Re: Paintbug?

From: "Anders Thomsen" [anders@t...]
Date: Thu Oct 25, 2001 4:07 pm
Subject: Re: [VirtualTreeview] Re: Paintbug?

So glad to hear that!
I've been tearing almost all of my hair off the past few month trying to find
out what was wrong : )

-Thomsen
----- Original Message -----
From: Jim Kueneman
To: VirtualTreeview@yahoogroups.com
Sent: Thursday, October 25, 2001 5:26 PM
Subject: [VirtualTreeview] Re: Paintbug?

> Can anyone else reproduce this problem?

Confirmed, something is not right.

Jim

Yahoo! Groups Sponsor

To unsubscribe from this group, send an email to:
VirtualTreeview-unsubscribe@egroups.com

Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.

[Non-text portions of this message have been removed]


Change Node height ?

From: [x_gate@h...]
Date: Thu Oct 25, 2001 11:39 pm
Subject: Change Node height ?

Hi,
How can i change the height all my nodes ?
DefaultNodeHeight does nothing!

Thanks

 | Replies | Author | Date
4280 | Re: Change Node height ? | Michael Valentiner=Branth | Fri 10/26/2001
4283 | Re: Change Node height ? | Paul D'Agosta | Fri 10/26/2001
4285 | Re: Change Node height ? | [x_gate@h...] | Sat 10/27/2001


Starting a drag problem

From: Jim Kueneman [jimdk@m...]
Date: Fri Oct 26, 2001 12:37 am
Subject: Starting a drag problem

Hi Mike,

I have run into a problem with VT that I am not sure if it has been
there all the time. It has to do with how you detect a drag start. If I
am using a popup menu to start an edit on a node that node gets the focus
as long as the mouse is outside of the VT window. As soon as the mouse is
moved into the window the edit cancels. The problem is the way you handle
the drag detect. Anytime the mouse is pressed it calls the BeginDrag
method so VT gets prepared to drag by setting tsOLEDragPending. The
context menu freezes the application during its execution then when the
edit node is selected and the mouse goes back into the window the mouse is
in a much different spot and VT interperts this as a drag start and calls
DoDragging which tries to start a drag and cancels the edit.

I am not sure what the most elegant way of dealing with this is? Maybe in
WM_ContextMenu clear tsOLEDragPending?

Jim

 | Replies | Author | Date
4305 | Re: Starting a drag problem | Mike Lischke | Sat 10/27/2001
4311 | Re: Starting a drag problem | Jim Kueneman | Sat 10/27/2001
4322 | Re: Starting a drag problem | Mike Lischke | Sun 10/28/2001
4336 | Re: Starting a drag problem | Jim Kueneman | Mon 10/29/2001
4339 | Re: Starting a drag problem | Mike Lischke | Mon 10/29/2001
4340 | Re: Starting a drag problem | Jim Kueneman | Mon 10/29/2001
4342 | Re: Starting a drag problem | Jim Kueneman | Tue 10/30/2001
4364 | Re: Starting a drag problem | Mike Lischke | Thu 11/1/2001
4363 | Re: Starting a drag problem | Mike Lischke | Thu 11/1/2001


re: How to hide droptarget

From: [cas@c...]
Date: Fri Oct 26, 2001 4:43 am
Subject: Re: How to hide droptarget

Hello Mike
thanks for your reply and you wonderful component! - best component
ever made for delphi (along with ICS by francois maybe :)!

I'm not 100% sure your suggestion will work ...

The reason I want to hide the droptarget, is because I want to be
able to drop files to the treeview but not to a specific node in the
treeview. So if the droptarget is highlighted, it will be confusing
for the user, because the specific droptarget doesn't have anything
to do with the drag'n'drop operation.

The problem with setting the drop target colors to the window
background color is that the droptarget text color remains white. And
as my window color also is white, the node becomes invisible. I'm not
sure if I overlooked a droptargettext color property somewhere or if
there maybe another solution to hide the droptarget?

Cheers
- Simon Horup

--- In [VirtualTreeview@y...], "Mike Lischke" [lists@l...] wrote:
> Hi Simon,
>
> > Is there any way to hide the selection box around the
dropTargetnode
> > in a drag'n'drop operation?
>
> Mmh, this was not intended, because usually you want to see where
you will drop to, but you could
> try to set the drop target colors to the window background color.
>
> Ciao, Mike
> --
> www.lischke-online.de
> www.delphi-unicode.net

 | Replies | Author | Date
4277 | Re: How to hide droptarget | Jim Kueneman | Fri 10/26/2001
4278 | Re: How to hide droptarget | [cas@c...] | Fri 10/26/2001


re: Re: How to hide droptarget

From: Jim Kueneman [jimdk@m...]
Date: Fri Oct 26, 2001 4:58 am
Subject: Re: [VirtualTreeview] Re: How to hide droptarget

>The problem with setting the drop target colors to the window
>background color is that the droptarget text color remains white. And
>as my window color also is white, the node becomes invisible. I'm not
>sure if I overlooked a droptargettext color property somewhere or if
>there maybe another solution to hide the droptarget?

You can try to override the OnPaintText event and if the node and the drop
target node are one and the same change the color font to the VT font color.

Jim

 | Replies | Author | Date
4278 | Re: How to hide droptarget | [cas@c...] | Fri 10/26/2001


re: How to hide droptarget

From: [cas@c...]
Date: Fri Oct 26, 2001 5:23 am
Subject: Re: How to hide droptarget

What a wonderful solution ... Just implemented it, and it works
perfectly. thanks jim:)

- Simon Horup

--- In [VirtualTreeview@y...], Jim Kueneman [jimdk@m...] wrote:
>
> >The problem with setting the drop target colors to the window
> >background color is that the droptarget text color remains white.
And
> >as my window color also is white, the node becomes invisible. I'm
not
> >sure if I overlooked a droptargettext color property somewhere or
if
> >there maybe another solution to hide the droptarget?
>
>
> You can try to override the OnPaintText event and if the node and
the drop
> target node are one and the same change the color font to the VT
font color.
>
> Jim


re: Paintbug?

From: Michael Valentiner=Branth [MichaelVB@g...]
Date: Fri Oct 26, 2001 8:10 am
Subject: Re: [VirtualTreeview] Paintbug?

Hi,

> Mike found out that it the problem is the total node height is somehow
> wrong
>
Maybe there's a connection to the problem I described a few days ago in
"VST doesn't show all lines".

As I already wrote, I found two conditions for my problem
- a different NodeHeight in some nodes (-> total node height?!)
- saving and loading the VT

I uploaded a demo for it to Files/BugDemos.

Michael

 | Replies | Author | Date
4313 | Re: Paintbug? | Mike Lischke | Sun 10/28/2001
4328 | Re: Paintbug? | Michael Valentiner=Branth | Mon 10/29/2001


re: Change Node height ?

From: Michael Valentiner=Branth [MichaelVB@g...]
Date: Fri Oct 26, 2001 8:10 am
Subject: Re: [VirtualTreeview] Change Node height ?

Hi,

> How can i change the height all my nodes ?
> DefaultNodeHeight does nothing!
>
Don't know, why DefaultNodeHeight doesn't work.

I changed it for some nodes with tree.NodeHeight[Node].

But I got some trouble with it. See "VST doesn't show all lines".

Michael


VT 2.6.0 and BCB new Errors

From: "Roland" [Beduerftig@S...]
Date: Fri Oct 26, 2001 12:10 pm
Subject: VT 2.6.0 and BCB new Errors

Hi All,

I try to compile VT 2.6.0 with CPPB5 and following error happened:

in JwaTmSchema.hpp:

Line 18: E2209 include file "tmschema.h" not found

in JwaUxTheme.hpp:

Line 19: E2209 include file "uxtheme.h" not found
Line 27: E2257 , required
typedef THEMESIZE TThemeSize;
Line 29: E2257 , required
typedef _MARGINS TMargins;
Line 31: E2257 , required
typedef _INTLIST TIntList;
Line 33: E2257 , required
typedef PROPERTYORIGIN TPropertyOrigin;

The step was I copied the tmschema.pas and uxtheme.pas from and other
ZIP-file and compile all, but the main problem is:
I can not find the declaration see error E2257 (not "," is required,
declaration isn't found)

best regards
Roland

 | Replies | Author | Date
4282 | Re: VT 2.6.0 and BCB new Errors | Vandrovec Milan | Fri 10/26/2001
4314 | Re: VT 2.6.0 and BCB new Errors | Mike Lischke | Sun 10/28/2001
4329 | Re: VT 2.6.0 and BCB new Errors | Vandrovec Milan | Mon 10/29/2001
4337 | Re: VT 2.6.0 and BCB new Errors | Mike Lischke | Mon 10/29/2001
4348 | Re: VT 2.6.0 and BCB new Errors | [rhymebusta@h...] | Tue 10/30/2001
4366 | Re: VT 2.6.0 and BCB new Errors | Mike Lischke | Thu 11/1/2001
4385 | Re: VT 2.6.0 and BCB new Errors | [rhymebusta@h...] | Thu 11/1/2001
4387 | Re: VT 2.6.0 and BCB new Errors | Mike Lischke | Thu 11/1/2001
4349 | Re: VT 2.6.0 and BCB new Errors | Vandrovec Milan | Tue 10/30/2001


re: VT 2.6.0 and BCB new Errors

From: Vandrovec Milan [milan_va@s...]
Date: Fri Oct 26, 2001 12:41 pm
Subject: RE: [VirtualTreeview] VT 2.6.0 and BCB new Errors

Hi.

> Line 18: E2209 include file "tmschema.h" not found
>
>
> Line 19: E2209 include file "uxtheme.h" not found
>

I have added these files (plus schemadef.h required by one of them) to the
VT2_6_0 for CPPB.zip, they should be there. Check include path of
VirtualTreeView and VirtualTreeViewD projects. I still have problems that
some symbols are declared twice when compiling a project, but it works and
the package should give no errors.
I am sorry I have very little time right now to polish it up (I am working
on another project that does not use VT). If you can, stay with 2.5.43 or
upload your own 2.6.0 after you make it work.

Milan Vandrovec

 | Replies | Author | Date
4314 | Re: VT 2.6.0 and BCB new Errors | Mike Lischke | Sun 10/28/2001


re: Change Node height ?

From: "Paul D'Agosta" [pdagosta@c...]
Date: Fri Oct 26, 2001 1:47 pm
Subject: Re: Change Node height ?

--- In [VirtualTreeview@y...], [x_gate@h...] wrote:
> Hi,
> How can i change the height all my nodes ?
> DefaultNodeHeight does nothing!
>

AFAIK, DefaultNodeHeight only sets the height of *new* nodes created
after the assignment. To change all of the nodes, you must
programatically set each node, which is not hard to do using the
Get***Node methods and NodeHeight[] property.

 | Replies | Author | Date
4285 | Re: Change Node height ? | [x_gate@h...] | Sat 10/27/2001


re: Problems selecting first node in branch of tree.

From: Simon Giles [simon.giles@q...]
Date: Fri Oct 26, 2001 1:56 pm
Subject: RE: [VirtualTreeview] Problems selecting first node in branch of tree.

Thanks Jacco & Werner,

I added a call to InvalidateNode right after I updated the ChildCount and
this fixed the problem. It's odd I had thought that InvalidateToBottom
would do this for me, but it doesn't seem to. Ah well, problem fixed,
thanks again.

Regards,
Simon

[Non-text portions of this message have been removed]


re: Change Node height ?

From: [x_gate@h...]
Date: Sat Oct 27, 2001 12:41 am
Subject: Re: Change Node height ?

> AFAIK, DefaultNodeHeight only sets the height of *new* nodes
created
> after the assignment. To change all of the nodes, you must
> programatically set each node, which is not hard to do using the
> Get***Node methods and NodeHeight[] property.

Thanks this worked!

VirtualTree.RootNodeCount := 0;
VirtualTree.DefaultNodeHeight := 20;
VirtualTree.RootNodeCount := 30;


2 multiselect bugs

From: [spdev00@y...]
Date: Sat Oct 27, 2001 2:25 am
Subject: 2 multiselect bugs

Hi group,

I just founded 2 bugs related to multiple selection:

1) 'Nodes must never be nil' exception raised when selecting more
than one node and Shift+Up or Shift+Down is pressed.
Actually is an assertion raised in
TBaseVirtualTree.CompareNodePositions:
[...]
Assert(Assigned(Node1) and Assigned(Node2), 'Nodes must never be
nil.');
[...]

To duplicate the problem:
a) Since this problem is not only present in the latest version you
could just open the Advanced demo and go to the 'General abilities'
tab.
b) Now select multiple nodes, but don't click on any node we don't
wan't to focus any node. Just use the mouse and select the nodes with
the selection rectangle.
c) Press Shift+Up or Shift+Down and you'll get the AV.

The problem disappears if you have a focused node in the tree.
I guess the problem is in TBaseVirtualTree.WMKeyDown, when handling
for VK_UP and VK_DOWN:
[...]
if HandleMultiSelect and (CompareNodePositions(LastFocused,
FRangeAnchor) > 0) then
[...]

LastFocused is nil :(

Suggested fix: make VT to allways have a focused node, for example at
creation focus the first node.
After all if a VT control has focus, then it must have a focused node.
Note that focused <> selected.

2) The problem gets worse if toReportMode is true, because in
TBaseVirtualTree.HandleMouseDown at line 17712 the FocusedNode is
allways cleared:
[...]
if not IsAnyHit and (toReportMode in FOptions.FMiscOptions) then
FocusedNode := nil;
[...]

This is unnecessary because to mimic the report mode of the Listview
control you must clear only the selection, not the focus.
And the selection is perfectly cleared in that method.

Suggested fix: wipe that

That's it, thanks for this magnificent component.

Regards,
Robert.

 | Replies | Author | Date
4303 | Re: 2 multiselect bugs | Werner Lehmann | Sat 10/27/2001
4308 | Re: 2 multiselect bugs | [spdev00@y...] | Sat 10/27/2001
4310 | Re: 2 multiselect bugs | [spdev00@y...] | Sat 10/27/2001
4317 | Re: 2 multiselect bugs | Mike Lischke | Sun 10/28/2001
4315 | Re: 2 multiselect bugs | Mike Lischke | Sun 10/28/2001


re: Re[4]: Problem: show/hide columns

From: "Mike Lischke" [lists@l...]
Date: Sat Oct 27, 2001 9:02 am
Subject: RE: Re[4]: [VirtualTreeview] Problem: show/hide columns

Hi Oleg,

> After resize of any column (if column 3 is visible) GetAbsoluteBounds
returns correct values.
>
> Initial settings (in design mode):
> visible columns - 0, 1, 2, 4.
> invisible - 3.
> Header.Options contains hoAutoResize.
> Header.AutoResizeIndex = 1.

I set up a test project with the values above, but unfortunately I can't
remember what your problem
was and did also not find a hint in my sent mails. Can you please describe the
steps you made to
reproduce your problem (a demo project would be even better).

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: Re: Checking parent nodes of a tree programatically?

From: "Mike Lischke" [lists@l...]
Date: Sat Oct 27, 2001 9:08 am
Subject: RE: [VirtualTreeview] Re: Checking parent nodes of a tree programatically?

Hi Tony,

> However, automatic propagation,does not work when I toggle the
> CheckState of a node programatically like I am doing in my exaple.
> I am using VT version 2.5.40 with the following TreeOptions:

It seems that this problem is already fixed with the current version. I cannot
reproduce any problem
regarding check propagation. Please try version 2.6.0. If this does not work
then please create a
demo which shows the bug.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net

 | Replies | Author | Date
4479 | Re: Checking parent nodes of a tree programatical | [tvav@h...] | Mon 11/5/2001
4480 | Re: Checking parent nodes of a tree programatical | Jim Kueneman | Mon 11/5/2001
4498 | Re: Checking parent nodes of a tree programatical | [tvav@h...] | Tue 11/6/2001


re: Re: AddChild (Mike, please read)

From: "Mike Lischke" [lists@l...]
Date: Sat Oct 27, 2001 9:35 am
Subject: RE: [VirtualTreeview] Re: AddChild (Mike, please read)

Hi Werner,

> If there is such an AddChild variant we should be sure that the optional
> parameter is used (assigned) before it is queried. You can test that if
> you comment the BeginUpdate below and click the button.

Correct. This was a nicely hidden gotcha. Interestingly enough, the solution
for it was not to move
code around, because the node data must be set for the new node which is first
add in SetChildCount
but SetChildCount already needs the data in your case (chicken-egg problem).
What I did was to
temporarily stop updates in the tree. This works fine because also AddChild
contains code for
FUpdateCount = 0.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: VCL and OLE drag and drop!

From: "Mike Lischke" [lists@l...]
Date: Sat Oct 27, 2001 9:44 am
Subject: RE: [VirtualTreeview] VCL and OLE drag and drop!

Hi Trevis,

> I tried to set the VST.DragCursor, but it doesn't change! If I add
> "inherited" to the main "else" statement of TBaseVirtualTree.BeginDrag
> it work, but then I have a Access Violation. How should I do to be
> able to change the drag cursor in both OLE and VCL drag and drop?

Which version of VT do you use? I have tried with the advanced demo and it
worked for me. I have set
the drag cursor in the object inspector.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: Error in DBVTD5

From: "Mike Lischke" [lists@l...]
Date: Sat Oct 27, 2001 9:46 am
Subject: RE: [VirtualTreeview] Error in DBVTD5

Hi Ralf,

> I found a bug in "SimpleVirtualDBTree".
> I can not access the TreeOptions in designtime.

This has to do with the custom tree options inherited by this descentant. It
must get the same
GetOptionsClass etc. methods to use a non-custom variant of the tree options.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: Does anyone know if this is possible?

From: "Mike Lischke" [lists@l...]
Date: Sat Oct 27, 2001 9:50 am
Subject: RE: [VirtualTreeview] Does anyone know if this is possible?

Hi Martijn,

> I want to create some view like this (
> http://groups.yahoo.com/group/VirtualTreeview/files/Misc/request.gif )
> - does anyone know if this is possible at all, and if so, can you
> give me some directions - I cannot seem to get it done...

Mmh, with some tricks it should be possible. E.g. you could use the auto span
feature of VT and do
some owner draw. The main problem with your layout is that the child node does
not display tree
lines while the other nodes do.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: bug in 2.5.4

From: "Mike Lischke" [lists@l...]
Date: Sat Oct 27, 2001 10:00 am
Subject: RE: [VirtualTreeview] bug in 2.5.4

Hi Simon,

> I've come across a case in TBaseVirtualTree.GetNextVisible where it's call
> to GetFirstChild will return nil. As a result I get an access violation.
> Here's the changes which I feel need to be made:

Thank you for pointing this out. This is fixed now.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: Customizing plus minus bitmaps

From: "Mike Lischke" [lists@l...]
Date: Sat Oct 27, 2001 10:02 am
Subject: RE: [VirtualTreeview] Customizing plus minus bitmaps

> I don't see a way to change the '+' '-' buttons to my own Folder
> open and close bitmaps. I think it would be a common enough
> requirement. Any ideas how to do that?

Not with the current VT version. One could add code to customize these bitmaps
(also also the lines
to allow for pipes or whatever people like for them). But this is something
which must be
implemented later or by somebody else. Please add this to the wish list
(database area of the
mailing list).

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: 2.6.0

From: "Mike Lischke" [lists@l...]
Date: Sat Oct 27, 2001 11:29 am
Subject: RE: [VirtualTreeview] 2.6.0

Hi Werner,

> - toThemeAware does not change the used DrawSelectionMode

Ok, changed.

> - What is HotCursor for? I find that it is set automagically to crHandPoint
in one
> of my VSTs. This leads to an always-on crHandPoint cursor if the mouse
cursor is
> above the VT (not only nodes or checkboxes). I believe that this is what
the usual
> Cursor property is for...

Oops, this shouldn't happen. A test was missing in WMSetCursor (for hot
tracking). This new test is
now necessary because the hot node now always assigned (if the mouse is over a
node). This is
necessary for Windows XP hot check styles, but could be useful for other tasks
too (e.g. to
determine the node under the mouse in OnMouseDown etc.).

> - Header resize problem:

I encountered this problem already. It had to do with the recently removed
Column := nil command in
TVTHeader.Invalidate. The calculation of the invalidation rectangle was not
complete. This now fixed
too.

> BTW, after recompiling the packages I had some of the 'usual' trouble:

Yes indeed, Delphi has problems to load projects with values assigned to
properties which do not
exist anymore. If I could I would avoid that, but I can't unfortunatly.

Btw: You still have an open bug (#56) which I cannot reproduce and for which I
asked you to provide
a demo project. It seems you overlooked my request or lost it from your eyes,
so here it is again
:o]

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: Collapse when deleting nodes

From: "Mike Lischke" [lists@l...]
Date: Sat Oct 27, 2001 11:45 am
Subject: RE: [VirtualTreeview] Collapse when deleting nodes

Hi Martijn,

> I think that when you delete the currently focused/selected node, the
> parentnode collapses. Before (talking way old versions) I think the focus
> went to the previous sibling or the parent of the deleted node.

Mmh, I cannot see such behavior in VT. When a node is deleted than no other
node is selected or
focused. If the deleted node was the focused node then there will be no focused
node anymore after
the deletion.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: Using same node-structure by 2 VTs?

From: "Mike Lischke" [lists@l...]
Date: Sat Oct 27, 2001 11:51 am
Subject: RE: [VirtualTreeview] Using same node-structure by 2 VTs?

Hi Ralf,

> is it possible to use the same node-structure by 2 vtrees?

Not really, From the pure internal node layout it would be possible. However
most methods assume
that the nodes they work on belong to the tree in whose context the method is
called. Checking the
owner tree before every operation (and deligate it then) would be possible, I
think, but also much
slower.

> I simply use the same pointers in both trees to my memory-structure.
> It would be perfect, if there is a possibility to *link* the second
> treestructure to the first so that the second tree reflects every
> changes in nodestruct of the first.

Linking both trees to the same structure is what I'd do too. To save even more
you could use the
node references of one tree in the node data of the other one. I'm not sure
about the advantages,
however.

> Thank you for doing a great job on this component!

You are welcome :o]

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: Re: DBVT pascal translation reorganized

From: "Mike Lischke" [lists@l...]
Date: Sat Oct 27, 2001 11:54 am
Subject: RE: [VirtualTreeview] Re: DBVT pascal translation reorganized

Hi Milan,

> I don't know about you, but for me, Delphi takes transparent color
> from LOWER left corner

Oops, forgot about this one. My design was only a quick shot.

> Other than that, the look quite fine - except I don't know what they
> mean :-)

Well, for people used to a particular semantic (e.g. of the component palette
icons) it should be
quite obvious, but I agree, it is extremly difficult to make a 24x24 pixels
icon meaningfull.

> P.S.: After writing this, I tried to improve them ... a bit... and uploaded
> it as http://groups.yahoo.com/group/VirtualTreeview/files/Descendants/
> DBVT_milan_va.dcr

So finally I got what I tried to get: somebody caring about that :o]

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: Re[2]: New file uploaded to VirtualTreeview

From: "Mike Lischke" [lists@l...]
Date: Sat Oct 27, 2001 12:22 pm
Subject: RE: Re[2]: [VirtualTreeview] New file uploaded to VirtualTreeview

Hi Oleg,

> 1. Very bad idea to deprive the not_XP users new XP styles.
> Please, return back.

I'm not sure what you mean. If you don't use Windows XP then you will not see
any difference to
older versions. I admit however that the additional header files might produce
a bit trouble to
compile (particularly if you, as BCB user, do not have the necessary header
files). Sorry about
that.

> 2. Where search for the files tmschema.h and uxtheme.h?

As already mentioned, Milan uploaded them to the BCB examples area
(http://groups.yahoo.com/group/VirtualTreeview/files/Examples/BCB_Examples/Compa\
tibility/) and I
will add them too into the next distribution.

> 3. 2.5.43 - Please, subj "Re[4]: [VirtualTreeview] Problem: show/hide
> columns"

Aha, somehow I assumed you referred to private mail correspondence. No wonder
why I did not find
more related mails. No I remembered again what your problem was (going through
a couple of messages
from this month). Unfortunately, whatever I try I cannot reproduce the problem.
Still I need a
simple demo showing the problem.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net

 | Replies | Author | Date
4312 | Re[4]: [VirtualTreeview] New file uploaded to Vir | Oleg Kraynov | Sat 10/27/2001
4332 | Re: Re[4]: [VirtualTreeview] New file uploaded to | Mike Lischke | Mon 10/29/2001


re: Paintbug?

From: "Mike Lischke" [lists@l...]
Date: Sat Oct 27, 2001 12:40 pm
Subject: RE: [VirtualTreeview] Paintbug?

Hi again Anders,

> tree.rootnodecount := 8000;
> tree.beginupdate;
> aNode := tree.getfirstnode;
> tree.isVisible[aNode] := false;
> tree.endupdate;
>
> Now try selecting some nodes, and you'll see the problem.
> Mike found out that it the problem is the total node height is somehow wrong,
and thought it
> was related to the way I filled the tree.

Now that you provided such a simple example I was able to fix the bug within 10
minutes. Once you
know it, it is very simple. The cache validation algorithm always started with
the very first node
regardless whether it was visible or not. This produced all the trouble. Now
that I set it to
GetFirstVisibleNoInit everything seems to be fine. You should of course check
that with your
implementation. I would also like to hear whether you still need the
FixNodeHeights fix or I was
wrong there.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: 2.6.0: TAB Key deletes selected text

From: "Mike Lischke" [lists@l...]
Date: Sat Oct 27, 2001 12:50 pm
Subject: RE: [VirtualTreeview] 2.6.0: TAB Key deletes selected text

> your recent changes (thank you!), allow to insert (invisible) tab character
when editing
> nodes (which also deletes all selected text).
>
> Windows explorer does not react to TABs during node editing at all.

Ok, convinced :o]

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: Re: AddChild (Mike, please read)

From: Werner Lehmann [wl@b...]
Date: Sat Oct 27, 2001 12:40 pm
Subject: Re: [VirtualTreeview] Re: AddChild (Mike, please read)

Hi Mike,

> Correct. This was a nicely hidden gotcha. Interestingly enough, the solution
for it was not to move
> code around, because the node data must be set for the new node which is
first add in SetChildCount
> but SetChildCount already needs the data in your case (chicken-egg problem).
What I did was to
> temporarily stop updates in the tree. This works fine because also AddChild
contains code for
> FUpdateCount = 0.

If I understand you right we get at least one full client area update for
an AddChild now... oh well, maybe not too bad. Most people will use a blocking
loop for several AddChilds anyway. Or is it exactly one complete invalidate
for each and every AddChild, with additional overhead each time? In that case
I would suggest to make this behaviour dependent on the existence of this
addtional AddChild parameter (no need for updatecount changes if it is nil any-
way).

Werner

 | Replies | Author | Date
4316 | Re: AddChild (Mike, please read) | Mike Lischke | Sun 10/28/2001


re: 2 multiselect bugs

From: Werner Lehmann [wl@b...]
Date: Sat Oct 27, 2001 12:47 pm
Subject: Re: [VirtualTreeview] 2 multiselect bugs

Hi Robert,

[spdev00@y...] wrote:
>
> I just founded 2 bugs related to multiple selection:

Please stop founding bugs - we need no more than there are already ;)

> Suggested fix: make VT to allways have a focused node, for example at
> creation focus the first node.

Would be fine to me. But Mike did not accept that suggestion previously.
(As well as the suggestion to change the focus if the parent of the
focused node is collapsed, but that's another story).

Werner

 | Replies | Author | Date
4308 | Re: 2 multiselect bugs | [spdev00@y...] | Sat 10/27/2001
4310 | Re: 2 multiselect bugs | [spdev00@y...] | Sat 10/27/2001
4317 | Re: 2 multiselect bugs | Mike Lischke | Sun 10/28/2001


re: 2.6.0

From: Werner Lehmann [wl@b...]
Date: Sat Oct 27, 2001 12:51 pm
Subject: Re: [VirtualTreeview] 2.6.0

Hi Mike,

> Btw: You still have an open bug (#56) which I cannot reproduce and for which
I asked you to provide
> a demo project. It seems you overlooked my request or lost it from your eyes,
so here it is again
> :o]

No, I had not forgot about it. I tried to reproduce it at that time in an easy
(small)
test project and failed. And cutting down the project where it shows is lots of
work.
Thus I delayed the prove for the bug... will try again ;)

Werner

 | Replies | Author | Date
4318 | Re: 2.6.0 | Mike Lischke | Sun 10/28/2001


re: Starting a drag problem

From: "Mike Lischke" [lists@l...]
Date: Sat Oct 27, 2001 4:49 pm
Subject: RE: [VirtualTreeview] Starting a drag problem

Hi Jim,

> The problem is the way you handle
> the drag detect. Anytime the mouse is pressed it calls the BeginDrag
> method so VT gets prepared to drag by setting tsOLEDragPending. The
> context menu freezes the application during its execution then when the
> edit node is selected and the mouse goes back into the window the mouse is
> in a much different spot and VT interperts this as a drag start and calls
> DoDragging which tries to start a drag and cancels the edit.

You've hit again a difficult problem. It required quite some rework (and
rethink) to get it working
as intended. There was also the case that (on VCL drag) the popup menu (if
assigned) came up already
on mouse down (because internally there was WM_RBUTTONUP message sent by
BeginDrag). I moved this
implicit message for right and middle button drag to the end of the drag
operation. For the left
mouse button I cannot prevent the VCL to send it but found another stable
workaround.

The only thing I wonder about is: this all is a matter for VCL drag'n drop, not
OLE drag'n drop. I
encountered the problem you described only for VCL dd, so I wonder whether I
overlooked something.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net

 | Replies | Author | Date
4311 | Re: Starting a drag problem | Jim Kueneman | Sat 10/27/2001
4322 | Re: Starting a drag problem | Mike Lischke | Sun 10/28/2001
4336 | Re: Starting a drag problem | Jim Kueneman | Mon 10/29/2001
4339 | Re: Starting a drag problem | Mike Lischke | Mon 10/29/2001
4340 | Re: Starting a drag problem | Jim Kueneman | Mon 10/29/2001
4342 | Re: Starting a drag problem | Jim Kueneman | Tue 10/30/2001
4364 | Re: Starting a drag problem | Mike Lischke | Thu 11/1/2001
4363 | Re: Starting a drag problem | Mike Lischke | Thu 11/1/2001
4325 | Re: Starting a drag problem | Jim Kueneman | Mon 10/29/2001


re: New file uploaded to VirtualTreeview

From: Werner Lehmann [wl@b...]
Date: Sat Oct 27, 2001 1:08 pm
Subject: Re: [VirtualTreeview] New file uploaded to VirtualTreeview

Mike Lischke wrote:
>
> > 1. Very bad idea to deprive the not_XP users new XP styles.
> > Please, return back.
>
> I'm not sure what you mean. If you don't use Windows XP then you will not see
any difference to
> older versions. I admit however that the additional header files might
produce a bit trouble to
> compile (particularly if you, as BCB user, do not have the necessary header
files). Sorry about
> that.

I believe Oleg wants to have XP headers etc. in his app even when it does not
run on XP.
Well, I am against adding that back in, it is sort of redundant on XP (bloats
the exe),
may not fit into the selected user theme and personally I have decided that the
XP enhance-
ments do not look too well on 2k and prior OS's. The last decision is obviously
something
where Oleg has a different opinion... Maybe the XP header drawing code can be
put in some
procedure (which is not in VirtualTrees? or the linker removes it if not
used...) which can
be used for header owner drawing. Check buttons are easily supportable via
custom imagelist,
only tree buttons can not be changed as of now.

Werner


Sort this ?

From: [pcxsoftware@y...]
Date: Sat Oct 27, 2001 6:32 pm
Subject: Sort this ?

hi,

I have to get a file which looks like

1 bla bla
2 bla bla
2 blalbalba
3 blablabla
1 bla bla bla
2 bla bla
1 bla bla
2 blabla
3 blabla
4 bla bla
4 bla bla
...

In this VirtualTree-Form:

1 bla bla
- 2 bla bla
- 2 bla bla
- 3 bla bla
1 bla bla
- 2 bla bla
1 bla bla
- 2 bla bla
- 3 bla bla
- 4 bla bla
- 4 bla bla

So as you can see from the number in the first line of each char, I
get the level, but I can't get it working, here's my try for a
function that should do this thing (As parameter he gets the lines
with the numbers above):

procedure TForm1.CreateItemsFromString(Str: TStringList);
var
i : Integer;
x : Integer;
k : Integer;
s : String;
c : String;
t : PVirtualNode;
aNode : PVirtualNode;
P : PVirtualNode;
PData : PHelpItem;
s1, s2 : TStringList;
begin
// Doppelte aussortieren
s1 := TStringList.Create; s2 := TStringList.Create;

for i:=0 to Str.Count-1 do
begin
if s1.IndexOf(Str[i]) = -1 then
begin
s2.Add(Str[i]);
s1.Add(Str[i]);
end;
end;

for i:=0 to s2.Count-1 do
begin
s := s2[i];
c := Copy(s, 1, 1);
try
x := StrToInt(c);
except
x := -1;
end;
c := Copy(s, 2, length(s));
if x = 1 then
begin
t := TreeView.AddChild(nil);
//
PData := TreeView.GetNodeData(T);
PData.Caption := c; PData.IIndex := 0; PData.Ordner := True;
//
aNode := t;
end
else
begin
if x > 2 then
begin
P := aNode.FirstChild;
while P<>nil do
begin
if TreeView.GetNodeLevel(P) = x-2 then
begin
t := TreeView.AddChild(P);
exit;
end;
P := aNode.NextSibling;
end;
end
else
t := TreeView.AddChild(aNode);
//
PData := TreeView.GetNodeData(T);
PData.Caption := c; PData.IIndex := 10; PData.Ordner := False;
end;
//
end;
s1.Free; s2.Free;
end;

---
Hope anyone can help as this problem drives me crazy,
yours
A. Adam

 | Replies | Author | Date
4320 | Re: Sort this ? | Mike Lischke | Sun 10/28/2001


re: 2 multiselect bugs

From: [spdev00@y...]
Date: Sat Oct 27, 2001 7:16 pm
Subject: Re: 2 multiselect bugs

Hi Werner,

--- In [VirtualTreeview@y...], Werner Lehmann [wl@b...] wrote:
> > I just founded 2 bugs related to multiple selection:
>
> Please stop founding bugs - we need no more than there are
already ;)

I'll do my best ;)

> > Suggested fix: make VT to allways have a focused node, for
example at
> > creation focus the first node.
>
> Would be fine to me. But Mike did not accept that suggestion
previously.
> (As well as the suggestion to change the focus if the parent of the
> focused node is collapsed, but that's another story).

Why he didn't? can you hand me the yahoo groups post reference?
I guess VT clears the focus just 2 times, one in HandleMouseDown as
described in my post and then in the Clear method.
So VT doesn't have the need to not have a focused node, unless it is
cleared.
Well it could be solved anyway at the app level, focusing a node when
VT receives focus.

Regards,
Robert.

 | Replies | Author | Date
4310 | Re: 2 multiselect bugs | [spdev00@y...] | Sat 10/27/2001


Copying part of a tree to another tree

From: "Franc van de Westelaken" [F.vdwestelaken@c...]
Date: Sat Oct 27, 2001 7:23 pm
Subject: Copying part of a tree to another tree

Hi,

what's the best way to copy a node and all of it's parent to another
tree ? Do I have to traverse the tree back to the root node and add all
parents manually in the destination tree or is there a better way ?

Franc.

[Non-text portions of this message have been removed]

 | Replies | Author | Date
4321 | Re: Copying part of a tree to another tree | Mike Lischke | Sun 10/28/2001
4323 | Re: Copying part of a tree to another tree | Franc van de Westelaken | Sun 10/28/2001
4331 | Re: Copying part of a tree to another tree | Paul D'Agosta | Mon 10/29/2001


re: 2 multiselect bugs

From: [spdev00@y...]
Date: Sat Oct 27, 2001 7:40 pm
Subject: Re: 2 multiselect bugs

> Why he didn't? can you hand me the yahoo groups post reference?
> I guess VT clears the focus just 2 times, one in HandleMouseDown as
> described in my post and then in the Clear method.
> So VT doesn't have the need to not have a focused node, unless it
is
> cleared.
> Well it could be solved anyway at the app level, focusing a node
when
> VT receives focus.

Oops, VT clears the focused node in InternalDisconnectNode, and that
method is used by DeleteNode and MoveTo.
So if Mike accepts the suggestion of allways having a focused node
then VT must focus another node on deletion/moving, maybe the parent
node? and if the node does not have a parent focus the previous
sibling.

Robert.


re: Starting a drag problem

From: Jim Kueneman [jimdk@m...]
Date: Sat Oct 27, 2001 8:11 pm
Subject: RE: [VirtualTreeview] Starting a drag problem

Hi Mike,

>The only thing I wonder about is: this all is a matter for VCL drag'n
>drop, not OLE drag'n drop. I
>encountered the problem you described only for VCL dd, so I wonder whether
>I overlooked something.

No it was with VET so it was OLE dragging. The flag that caused it was the
tsOLDDragPending because it was set in MouseDown and still set in MouseMove
after the popupmenu was shown.

Jim

 | Replies | Author | Date
4322 | Re: Starting a drag problem | Mike Lischke | Sun 10/28/2001
4336 | Re: Starting a drag problem | Jim Kueneman | Mon 10/29/2001
4339 | Re: Starting a drag problem | Mike Lischke | Mon 10/29/2001
4340 | Re: Starting a drag problem | Jim Kueneman | Mon 10/29/2001
4342 | Re: Starting a drag problem | Jim Kueneman | Tue 10/30/2001
4364 | Re: Starting a drag problem | Mike Lischke | Thu 11/1/2001
4363 | Re: Starting a drag problem | Mike Lischke | Thu 11/1/2001


Re[4]: New file uploaded to VirtualTreeview

From: Oleg Kraynov [olegvkr@y...]
Date: Sat Oct 27, 2001 9:50 pm
Subject: Re[4]: [VirtualTreeview] New file uploaded to VirtualTreeview

Hi, Mike.

Âû ïèñàëè 27 îêòÿáðÿ 2001 ã., 16:22:50:

ML> Hi Oleg,

>> 1. Very bad idea to deprive the not_XP users new XP styles.
>> Please, return back.

ML> I'm not sure what you mean. If you don't use Windows XP then you will not
see any difference to
ML> older versions. I admit however that the additional header files might
produce a bit trouble to
ML> compile (particularly if you, as BCB user, do not have the necessary header
files). Sorry about
ML> that.

Sorry... I bad has explained.

In version 2.6.0 are absent:
TCheckImageKind - ckXP
TVTHeaderStyle - hsXPStyle
TVTButtonFillMode - fmShaded

But majority of users else will long use Windows NT.
Request:
if program run in Windows XP, that use the XP themes,
otherwise use the paint functions as in version 2.4.43.

>> 3. 2.5.43 - Please, subj "Re[4]: [VirtualTreeview] Problem: show/hide
>> columns"

ML> Aha, somehow I assumed you referred to private mail correspondence. No
wonder why I did not find
ML> more related mails. No I remembered again what your problem was (going
through a couple of messages
ML> from this month). Unfortunately, whatever I try I cannot reproduce the
problem. Still I need a
ML> simple demo showing the problem.

I has added file of example (BCB project and exe-file)

http://groups.yahoo.com/group/VirtualTreeview/files/BugDemos/problem_show_hide.z\
ip

PS. In version 2.6.0 - the same problem.

--
Best regards,
Oleg

_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com

 | Replies | Author | Date
4332 | Re: Re[4]: [VirtualTreeview] New file uploaded to | Mike Lischke | Mon 10/29/2001


re: Paintbug?

From: "Mike Lischke" [lists@l...]
Date: Sun Oct 28, 2001 10:05 am
Subject: RE: [VirtualTreeview] Paintbug?

> As I already wrote, I found two conditions for my problem
> - a different NodeHeight in some nodes (-> total node height?!)
> - saving and loading the VT

I think I found the problem now. This has been bothering me for quite some
time. In essence I forgot
to adjust the total tree height for top level nodes whe loading from stream.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net

 | Replies | Author | Date
4328 | Re: Paintbug? | Michael Valentiner=Branth | Mon 10/29/2001


re: VT 2.6.0 and BCB new Errors

From: "Mike Lischke" [lists@l...]
Date: Sun Oct 28, 2001 10:35 am
Subject: RE: [VirtualTreeview] VT 2.6.0 and BCB new Errors

> I have added these files (plus schemadef.h required by one of them) to the
> VT2_6_0 for CPPB.zip, they should be there.

Thank you Milan. I will add the necessary header files also to the next
distribution.

>I still have problems that
> some symbols are declared twice when compiling a project, but it works and
> the package should give no errors.

This is due to the yet unfinished header translations. There are still some
EXTERNALSYM declarations
missing.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: 2 multiselect bugs

From: "Mike Lischke" [lists@l...]
Date: Sun Oct 28, 2001 10:57 am
Subject: RE: [VirtualTreeview] 2 multiselect bugs

Hi Robert,

> I just founded 2 bugs related to multiple selection:

Thanks for letting me know about these. Although I do not want to remove the
ability of VT to have
also a not assigned focused node I have included a fall back to handle the
mentioned cases.

Btw: please add future bug reports to the bug table in the databse area of VT.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: Re: AddChild (Mike, please read)

From: "Mike Lischke" [lists@l...]
Date: Sun Oct 28, 2001 11:04 am
Subject: RE: [VirtualTreeview] Re: AddChild (Mike, please read)

Hi Werner,

> If I understand you right we get at least one full client area update for
> an AddChild now...

No, no, don't worry. There is no implicit EndUpdate call. I just manipulate the
FUpdateCount
variable temporarily.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: 2 multiselect bugs

From: "Mike Lischke" [lists@l...]
Date: Sun Oct 28, 2001 11:09 am
Subject: RE: [VirtualTreeview] 2 multiselect bugs

> Would be fine to me. But Mike did not accept that suggestion previously.
> (As well as the suggestion to change the focus if the parent of the
> focused node is collapsed, but that's another story).

The point here is that it is not clear which node to focus when the other is
deleted. Sometimes the
next or previous sibling is preferred then again the parent node or no node at
all. I'm not at all a
friend of too many automatisms. It is very simple for the application to set
the focused node
whenever it needs it.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: 2.6.0

From: "Mike Lischke" [lists@l...]
Date: Sun Oct 28, 2001 11:10 am
Subject: RE: [VirtualTreeview] 2.6.0

> No, I had not forgot about it. I tried to reproduce it at that time in an
easy (small)
> test project and failed. And cutting down the project where it shows is lots
of work.
> Thus I delayed the prove for the bug... will try again ;)

No problem. I'll mark it as being not reproducible and you can reopen it when
you get the error
again.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: 2.6.0

From: Werner Lehmann [wl@b...]
Date: Sun Oct 28, 2001 12:10 pm
Subject: Re: [VirtualTreeview] 2.6.0

Mike,

Werner Lehmann wrote:
>
> > Btw: You still have an open bug (#56) which I cannot reproduce and for
which I asked you to provide
> > a demo project. It seems you overlooked my request or lost it from your
eyes, so here it is again
> > :o]
>
> No, I had not forgot about it. I tried to reproduce it at that time in an
easy (small)
> test project and failed. And cutting down the project where it shows is lots
of work.
> Thus I delayed the prove for the bug... will try again ;)

this time I could surface the bug. The key was to change some nodes to bold
face after
they had been displayed already (and thus the node width had already been
determined I
guess).

You find the project on YG, named dropmark.zip. Click on the button at the top,
then drag
something from your desktop over the nodes. The bold drawn nodes will show a
dropmark which
is node wide enough.

BTW, I have another problem with the dropmark with the VT descendant at the
company. If a
new node is added to the tree, but not selected afterwards, it will not show
any dropmark
at all if another node is dragged over it. So far I could not demo this but
maybe you have
an idea why or where to look?

Regards,
Werner

 | Replies | Author | Date
4333 | Re: 2.6.0 | Mike Lischke | Mon 10/29/2001


re: Sort this ?

From: "Mike Lischke" [lists@l...]
Date: Sun Oct 28, 2001 1:01 pm
Subject: RE: [VirtualTreeview] Sort this ?

Hi Alexander,

> Hope anyone can help as this problem drives me crazy,
> yours
> A. Adam

You could try my LoadFromStream method in TreeNT (still available on my
homepage). There lines and
levels are interpreted depending on the number of tabulators they have in
front. You could easily
change the tabulator count by your number.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: Copying part of a tree to another tree

From: "Mike Lischke" [lists@l...]
Date: Sun Oct 28, 2001 1:02 pm
Subject: RE: [VirtualTreeview] Copying part of a tree to another tree

Hi Franc,

> what's the best way to copy a node and all of it's parent to another
> tree ? Do I have to traverse the tree back to the root node and add all
> parents manually in the destination tree or is there a better way ?

I'm afraid you have to go level by level up the parent list and recreate it in
the other tree step
by step. I see no other way since the parents of the node in question might
have other child nodes
which should not be copied.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net

 | Replies | Author | Date
4323 | Re: Copying part of a tree to another tree | Franc van de Westelaken | Sun 10/28/2001
4331 | Re: Copying part of a tree to another tree | Paul D'Agosta | Mon 10/29/2001


re: Starting a drag problem

From: "Mike Lischke" [lists@l...]
Date: Sun Oct 28, 2001 1:07 pm
Subject: RE: [VirtualTreeview] Starting a drag problem

> No it was with VET so it was OLE dragging. The flag that caused it was the
> tsOLDDragPending because it was set in MouseDown and still set in MouseMove
> after the popupmenu was shown.

Mmmh, it could be we have here a behavior change between XP and earlier Windows
versions. Under XP a
WM_RBUTTONUP message is sent to the tree window after the popup closed enabling
so the tree to
remove the drag flags properly.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: Copying part of a tree to another tree

From: "Franc van de Westelaken" [F.vdwestelaken@c...]
Date: Sun Oct 28, 2001 5:14 pm
Subject: RE: [VirtualTreeview] Copying part of a tree to another tree

Hi Mike,

> I'm afraid you have to go level by level up the parent list and
recreate it in the other tree step
> by step. I see no other way since the parents of the node in question
might have other child nodes
> which should not be copied.

Ok, but I think I'm missing something. I've tried to insert nodes as
parents of the current node but doesn't seem to get it to work. This is
the code I use (I've left the data assignment part out for saving space
in this e-mail).

MyNode := DestTree.AddChild(nil); // add new node to root
MyParentNode := Node.Parent; // get parent of current node in source
tree
Repeat
// insert parent node just before newly added node
MyNode := DestTree.InsertNode(MyNode, amInsertBefore);

// go to parent of current node in source tree
MyParentNode := MyParentNode.Parent;
until MyParentNode = SourceTree.RootNode;

This results in nodes being added as root nodes instead of building a
tree structure.

What am I doing wrong here ?

Franc.

 | Replies | Author | Date
4331 | Re: Copying part of a tree to another tree | Paul D'Agosta | Mon 10/29/2001


re: Paintbug?

From: "Anders Thomsen" [anders@t...]
Date: Sun Oct 28, 2001 10:48 pm
Subject: Re: [VirtualTreeview] Paintbug?

Hi Mike,

>Now that you provided such a simple example I was able to fix the bug within
10 minutes. Once you know it, it is very simple.

I'm sorry for all the troubles I've caused you, but I just recently found out,
that the problem was related to only the first
node being hidden. I thinks it's a little strange that no one but me has
experienced this bug before me?

>You should of course check that with your
>implementation. I would also like to hear whether you still need the
FixNodeHeights fix or I was
>wrong there.

I changed a line in DoValidateCache, and now everything works as it should!
Thank you very very much!
This has really been borthering a long, long time : )

Cheers,
Anders Thomsen

----- Original Message -----
From: Mike Lischke
To: VirtualTreeview@yahoogroups.com
Sent: Saturday, October 27, 2001 1:40 PM
Subject: RE: [VirtualTreeview] Paintbug?

Hi again Anders,

>> tree.rootnodecount := 8000;
>> tree.beginupdate;
>> aNode := tree.getfirstnode;
>> tree.isVisible[aNode] := false;
>> tree.endupdate;
>>
>> Now try selecting some nodes, and you'll see the problem.
>> Mike found out that it the problem is the total node height is somehow
wrong, and thought it
>> was related to the way I filled the tree.
>
>Now that you provided such a simple example I was able to fix the bug within
10 minutes. Once you
>know it, it is very simple. The cache validation algorithm always started with
the very first node
>regardless whether it was visible or not. This produced all the trouble. Now
that I set it to
>GetFirstVisibleNoInit everything seems to be fine. You should of course check
that with your
>implementation. I would also like to hear whether you still need the
FixNodeHeights fix or I was
>wrong there.
>
>Ciao, Mike
>--
>www.lischke-online.de
>www.delphi-unicode.net
>

>To unsubscribe from this group, send an email to:
>VirtualTreeview-unsubscribe@egroups.com

>Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


re: Starting a drag problem

From: Jim Kueneman [jimdk@m...]
Date: Mon Oct 29, 2001 1:07 am
Subject: RE: [VirtualTreeview] Starting a drag problem

Hi All,

Does anyone know of a freeware Unicode TEdit that is *simple* <g>. As
always Mike has to do things in a big way and I don't really want to have
to link in his whole Unicode library for an edit box to type in a path!

Jim

 | Replies | Author | Date
4334 | Re: Starting a drag problem | Mike Lischke | Mon 10/29/2001


"[C++ Error] VirtualTrees.hpp(523): E2076 Overloadable operator expected"

From: Albert Goodwill [albertgoodwill@y...]
Date: Mon Oct 29, 2001 3:51 am
Subject: "[C++ Error] VirtualTrees.hpp(523): E2076 Overloadable operator expected"

Hi Everybody,

I'm trying to use "FANTASTIC !!! VirtualTreeview"
component in my BCB 5.0.

I've installed the component but when I build my
program it gives me "[C++ Error]
VirtualTrees.hpp(523): E2076 Overloadable operator
expected" message in auto generated VirtualTrees.hpp
file(See code segment below). If I comment out the
"operator" declerations in TBaseDragDropManager class
it works okay until I re build the program which re
creates the VirtualTrees.hpp file.

Any suggestion to solve this problem?

Thanks

[albertgoodwill@y...]

class PASCALIMPLEMENTATION TBaseDragDropManager :
public System::TInterfacedObject
{
typedef System::TInterfacedObject inherited;
...

public:
operator IDropTarget*(void) { return
(IDropTarget*)&__IDropTarget; }
operator IDropSource*(void) { return
(IDropSource*)&__IDropSource; }
operator IDataObject*(void) { return
(IDataObject*)&__IDataObject; }

};

[C++ Error] VirtualTrees.http(523): E2076 Overloadable
operator expected

__________________________________________________
Do You Yahoo!?
Make a great connection at Yahoo! Personals.
http://personals.yahoo.com

 | Replies | Author | Date
4335 | Re: "[C++ Error] VirtualTrees.hpp(523): E2076 Ove | Mike Lischke | Mon 10/29/2001


re: Does anyone know if this is possible?

From: Martijn Tonies [martijn@b...]
Date: Mon Oct 29, 2001 8:08 am
Subject: RE: [VirtualTreeview] Does anyone know if this is possible?

Hi,

> > I want to create some view like this (
> >
> http://groups.yahoo.com/group/VirtualTreeview/files/Misc/request.gif )
> > - does anyone know if this is possible at all, and if so, can you
> > give me some directions - I cannot seem to get it done...
>
> Mmh, with some tricks it should be possible. E.g. you could
> use the auto span feature of VT and do
> some owner draw. The main problem with your layout is that
> the child node does not display tree
> lines while the other nodes do.
>
> Ciao, Mike

I did some owner drawing with the draw tree. No resizing for a couple of
columns, but it looks good enough :)

Thanks anyway!

Martijn
BISIT Engineering BV.

[Non-text portions of this message have been removed]


re: Paintbug?

From: Michael Valentiner=Branth [MichaelVB@g...]
Date: Mon Oct 29, 2001 8:55 am
Subject: Re: [VirtualTreeview] Paintbug?

Hi Mike,

> I think I found the problem now. This has been bothering me for quite
> some time. In essence I forgot to adjust the total tree height for top
> level nodes whe loading from stream.
>
That's fine, thanks.

And until the bug is fixed, I have found a simple workaround:
I can set the NodeHeight to DefaultNodeHeight before saving, and set my
values again after reloading.

Michael


re: VT 2.6.0 and BCB new Errors

From: Vandrovec Milan [milan_va@s...]
Date: Mon Oct 29, 2001 9:12 am
Subject: RE: [VirtualTreeview] VT 2.6.0 and BCB new Errors

Hi.

> >I still have problems that
> > some symbols are declared twice when compiling a project,
> but it works and
> > the package should give no errors.
>
> This is due to the yet unfinished header translations. There
> are still some EXTERNALSYM declarations
> missing.

I believe the problem is different: from BCB help:

"Weak packages cannot contain global variables."

I believe when you changed JwaUxTheme.pas from statically to dynamically
bound, there is no need for it to be {$WEAKPACKAGEUNIT}, nor possible, since
the function addresses are global variables. For BCB users, removing the
{$WEAKPACKAGEUNIT} from JwaUxTheme.pas works fine. I will upload it later, I
am REALLY busy.

Milan

 | Replies | Author | Date
4337 | Re: VT 2.6.0 and BCB new Errors | Mike Lischke | Mon 10/29/2001
4348 | Re: VT 2.6.0 and BCB new Errors | [rhymebusta@h...] | Tue 10/30/2001
4366 | Re: VT 2.6.0 and BCB new Errors | Mike Lischke | Thu 11/1/2001
4385 | Re: VT 2.6.0 and BCB new Errors | [rhymebusta@h...] | Thu 11/1/2001
4387 | Re: VT 2.6.0 and BCB new Errors | Mike Lischke | Thu 11/1/2001


Incremental search

From: Martijn Tonies [martijn@b...]
Date: Mon Oct 29, 2001 3:16 pm
Subject: Incremental search

Hi all,

perhaps I'm doing something wrong, but when using the incremental search
event on a draw-tree, with about 12000 root nodes, my CPU goes to 100%,
stays that way for about 15 seconds and then advances to the node...

What is happening here? Are all the nodes getting initialized and this takes
a lot of time or what?

Settings:
IncrementalSearch: isAll
IncrementalSearchDirection: sdForward
IncrementalSearchStart: ssAlwaysStartOver
IncrementalSearchTimeout: 1000

Event:

procedure TframAanbodSamenstellen.treeLABAanbodIncrementalSearch(
Sender: TBaseVirtualTree; Node: PVirtualNode; const Text: WideString;
var Result: Integer);
var data: PTreeData;
item: TLABAanbodsRegel;
begin
inherited;
data := Sender.GetNodeData(Node);
item := data^.Data as TLABAanbodsRegel;
if Pos(UpperCase(Text), item.ProductOmschrijving) = 1
then Result := 0
else Result := -1;
end;

greetings,

Martijn Tonies

[Non-text portions of this message have been removed]

 | Replies | Author | Date
4338 | Re: Incremental search | Mike Lischke | Mon 10/29/2001
4341 | Re: Incremental search | Werner Lehmann | Tue 10/30/2001
4343 | Re: Incremental search | Martijn Tonies | Tue 10/30/2001
4344 | Re: Incremental search | Werner Lehmann | Tue 10/30/2001
4345 | Re: Incremental search | Martijn Tonies | Tue 10/30/2001
4346 | Re: Incremental search | Martijn Tonies | Tue 10/30/2001
4358 | Re: Incremental search | Werner Lehmann | Wed 10/31/2001


re: Copying part of a tree to another tree

From: "Paul D'Agosta" [pdagosta@c...]
Date: Mon Oct 29, 2001 3:16 pm
Subject: Re: Copying part of a tree to another tree

> Ok, but I think I'm missing something. I've tried to insert nodes as
> parents of the current node but doesn't seem to get it to work. This
is
> the code I use (I've left the data assignment part out for saving
space
> in this e-mail).
>
> // insert parent node just before newly added node
> MyNode := DestTree.InsertNode(MyNode, amInsertBefore);
> What am I doing wrong here ?

amInsertBefore creates a sibling node above MyNode. What you need is
a supplemental MoveTo(NewNode,MyNode,amAddChild[First/Last],False)
call to move MyNode underneath the newly created Node.

You could do the same thing more simply (maybe slower?) recursively

function FindCreateNode(DestTree:TBaseVirtualTree;
Child:PVirtualNode):PVirtualNode;
var
SourceParentNode,
DestParentNode:PVirtualNode;
found:boolean;
begin
SourceParentNode := Child.Parent;
DestParentNode := nil;
found := false;
//do search for parent in dest tree here

if not found then
begin
if SourceParentNode <> nil then
DestParentNode := FindCreateNode(SourceParentNode);
end;
result := Dest.AddChild(DestParentNode);
end;

Hope this helps,
Paul

PS:
As usual, all code is untested :)


re: Re[4]: New file uploaded to VirtualTreeview

From: "Mike Lischke" [lists@l...]
Date: Mon Oct 29, 2001 7:55 pm
Subject: RE: Re[4]: [VirtualTreeview] New file uploaded to VirtualTreeview

Hi Oleg,

> Sorry... I bad has explained.
>
> In version 2.6.0 are absent:
> TCheckImageKind - ckXP
> TVTHeaderStyle - hsXPStyle
> TVTButtonFillMode - fmShaded
>
> But majority of users else will long use Windows NT.

OK, you convinced me. I have included legacy code to support also non-XP
systems.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: 2.6.0

From: "Mike Lischke" [lists@l...]
Date: Mon Oct 29, 2001 8:06 pm
Subject: RE: [VirtualTreeview] 2.6.0

Hi Werner,

> this time I could surface the bug. The key was to change some nodes to bold
face after
> they had been displayed already (and thus the node width had already been
determined I
> guess).

Well, here you've hit one of the weak points of VT. You should call
InvalidateNode when you change
its caption size. You know this is caused by the cached node width in the
string tree, but I cannot
retrieve this also from an event (or determine it on demand), because this
would be way to slow.

I'm all open ears for suggestions for improving this...

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: Starting a drag problem

From: "Mike Lischke" [lists@l...]
Date: Mon Oct 29, 2001 8:23 pm
Subject: RE: [VirtualTreeview] Starting a drag problem

Hi Jim,

> Does anyone know of a freeware Unicode TEdit that is *simple* <g>. As
> always Mike has to do things in a big way and I don't really want to have
> to link in his whole Unicode library for an edit box to type in a path!

Ahem, well, Unicode and "simple" is mutual exclusive :o] Possibly the simples
thing you could do is
to use TRichEdit and modify it so that it accepts and returns WideString. This
should be enough for
your path edit and works on any Windows platform and any IME.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: "[C++ Error] VirtualTrees.hpp(523): E2076 Overloadable operator expected"

From: "Mike Lischke" [lists@l...]
Date: Mon Oct 29, 2001 8:28 pm
Subject: RE: [VirtualTreeview] "[C++ Error] VirtualTrees.hpp(523): E2076 Overloadable operator expected"

Hi Albert,

> I'm trying to use "FANTASTIC !!! VirtualTreeview"
> component in my BCB 5.0.

Thank you and welcome in the club :-)

> I've installed the component but when I build my
> program it gives me "[C++ Error]
> VirtualTrees.hpp(523): E2076 Overloadable operator
> expected" message in auto generated VirtualTrees.hpp
> file(See code segment below). If I comment out the
> "operator" declerations in TBaseDragDropManager class
> it works okay until I re build the program which re
> creates the VirtualTrees.hpp file.

This problem has been solved quite a while ago. Try using the latest source
(available from the file
area of the mailing list at http://groups.yahoo.com/group/VirtualTreeview/files/

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: Starting a drag problem

From: "Jim Kueneman" [jimdk@m...]
Date: Mon Oct 29, 2001 8:32 pm
Subject: Re: Starting a drag problem

Hi Mike,

> No it was with VET so it was OLE dragging. The flag that caused it
was the
> tsOLDDragPending because it was set in MouseDown and still set in
MouseMove
> after the popupmenu was shown.

Ok, it is something I was doing to circumvent another issue I had
with VT. I am playing with toRightClickSelect in RButtonUp because I
want to allow a right click menu if multiple nodes are selected. If
toRightClickSelect is enabled then VT unselects all the nodes after
the contextmenu is shown execpt the one where the mouse was clicked.
I want VT to leave my selections alone on the RButtonUp. Is there
something you can do about that?

Jim

 | Replies | Author | Date
4339 | Re: Starting a drag problem | Mike Lischke | Mon 10/29/2001
4340 | Re: Starting a drag problem | Jim Kueneman | Mon 10/29/2001
4342 | Re: Starting a drag problem | Jim Kueneman | Tue 10/30/2001
4364 | Re: Starting a drag problem | Mike Lischke | Thu 11/1/2001
4363 | Re: Starting a drag problem | Mike Lischke | Thu 11/1/2001


re: VT 2.6.0 and BCB new Errors

From: "Mike Lischke" [lists@l...]
Date: Mon Oct 29, 2001 8:33 pm
Subject: RE: [VirtualTreeview] VT 2.6.0 and BCB new Errors

Hi Milan,

> I believe the problem is different: from BCB help:
>
> "Weak packages cannot contain global variables."
>
> I believe when you changed JwaUxTheme.pas from statically to dynamically
> bound, there is no need for it to be {$WEAKPACKAGEUNIT}, nor possible, since
> the function addresses are global variables. For BCB users, removing the
> {$WEAKPACKAGEUNIT} from JwaUxTheme.pas works fine. I will upload it later, I
> am REALLY busy.

You don't need to upload any fixes. It is already enough that you told me about
the problem. I will
take care about that.

For the problem: the {$WEAKPACKAGEUNIT} mark is mainly to avoid having to take
the unit into a
package (to allow to use it from different packages without having another
dependency). I guess you
have included the files anyway, so try leaving them out (just as with *.h files
which I guess are
also not in packages).

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net

 | Replies | Author | Date
4348 | Re: VT 2.6.0 and BCB new Errors | [rhymebusta@h...] | Tue 10/30/2001
4366 | Re: VT 2.6.0 and BCB new Errors | Mike Lischke | Thu 11/1/2001
4385 | Re: VT 2.6.0 and BCB new Errors | [rhymebusta@h...] | Thu 11/1/2001
4387 | Re: VT 2.6.0 and BCB new Errors | Mike Lischke | Thu 11/1/2001


re: Incremental search

From: "Mike Lischke" [lists@l...]
Date: Mon Oct 29, 2001 8:41 pm
Subject: RE: [VirtualTreeview] Incremental search

Hi Marijn,

> perhaps I'm doing something wrong, but when using the incremental search
> event on a draw-tree, with about 12000 root nodes, my CPU goes to 100%,
> stays that way for about 15 seconds and then advances to the node...

Well, you should make yourself more familiar with incremental search in VT.
Indeed is it so that a
linear search is performed in the tree which surely takes some time.
Additionally, by using isAll
every node is initialized until a match is found. The next disadvantage is that
you always want to
start over when searching (normally, incremental search is performed from the
currently focused
node).

And finally, you are doing quite costly string operations:

> if Pos(UpperCase(Text), item.ProductOmschrijving) = 1

You are converting Unicode to ANSI text for every match (UpperCase takes ANSI
strings) which is
quite expensive, converting every text to upper case all the time and then you
are using one of the
most time consuming string search functions (Pos).

All this together will put heavy load on your system.

HTH

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: Re: Starting a drag problem

From: "Mike Lischke" [lists@l...]
Date: Mon Oct 29, 2001 8:44 pm
Subject: RE: [VirtualTreeview] Re: Starting a drag problem

Jim,

> Ok, it is something I was doing to circumvent another issue I had
> with VT. I am playing with toRightClickSelect in RButtonUp because I
> want to allow a right click menu if multiple nodes are selected. If
> toRightClickSelect is enabled then VT unselects all the nodes after
> the contextmenu is shown execpt the one where the mouse was clicked.
> I want VT to leave my selections alone on the RButtonUp. Is there
> something you can do about that?

If you click on one of the selected nodes then the selection stays as it is,
even on mouse up with
context menu. Only if you click on an unselected node then the selection is
cleared (this is exactly
like Explorer behaves). Do you need other special handling?

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net

 | Replies | Author | Date
4340 | Re: Starting a drag problem | Jim Kueneman | Mon 10/29/2001
4342 | Re: Starting a drag problem | Jim Kueneman | Tue 10/30/2001
4364 | Re: Starting a drag problem | Mike Lischke | Thu 11/1/2001
4363 | Re: Starting a drag problem | Mike Lischke | Thu 11/1/2001


re: Starting a drag problem

From: "Jim Kueneman" [jimdk@m...]
Date: Mon Oct 29, 2001 9:10 pm
Subject: Re: Starting a drag problem

> If you click on one of the selected nodes then the selection stays
as it is, even on mouse up with
> context menu. Only if you click on an unselected node then the
selection is cleared (this is exactly
> like Explorer behaves). Do you need other special handling?

I think I found it. It also explains another problem I see now and
then.

Look in the HandleMouseDown method. I have not tried to completely
understand all the logic but in the block commented

// pending clearance

it sets tsClearPending.

now the next block check a *lot* of other stuff and one of them is
the PopupMenu. Two things.

1) VET has a popupmenu but the shell supplies it so this will be nil
unless there is a custom menu assigned.

2) A number of people experience this assertion (including me now and
then)

Assert(not (tsClearPending in FStates), 'Pending and direct clearance
are mutual exclusive!');

To add some background

AutoDrag is true because it may be the start of a rightclick drag too.

So I think the bottom line here is that I have a popupmenu but it is
not assigned to the PopupMenu property and it is causing VET some
problems becuase the tsClearPending is still set in the MouseUp
method.

Jim

 | Replies | Author | Date
4342 | Re: Starting a drag problem | Jim Kueneman | Tue 10/30/2001
4364 | Re: Starting a drag problem | Mike Lischke | Thu 11/1/2001
4363 | Re: Starting a drag problem | Mike Lischke | Thu 11/1/2001


re: Incremental search

From: Werner Lehmann [wl@b...]
Date: Mon Oct 29, 2001 9:58 pm
Subject: Re: [VirtualTreeview] Incremental search

Martijn,

> And finally, you are doing quite costly string operations:
>
> > if Pos(UpperCase(Text), item.ProductOmschrijving) = 1
>
> You are converting Unicode to ANSI text for every match (UpperCase takes ANSI
strings) which is
> quite expensive, converting every text to upper case all the time and then
you are using one of the
> most time consuming string search functions (Pos).

Do the compare with PChars or PCharWideChars manually in a loop. The PChars
avoid the indexing, the manual loop allows you to break the loop as soon as
something is not equal, it also avoids UpperCase on the whole length of the
string as well as the widechar / char conversion (at least for the whole
string).

Werner


re: Re: Starting a drag problem

From: Jim Kueneman [jimdk@m...]
Date: Tue Oct 30, 2001 1:56 am
Subject: Re: [VirtualTreeview] Re: Starting a drag problem

Hi Mike,

> Look in the HandleMouseDown method. I have not tried to completely
>understand all the logic but in the block commented

I jumped the gun on my analysis. The menu has no bearing on the result
because any of those checks are not even called do the the short cut
boolean evaluation.

The problem really appears to be HandleMouseDown and the

// pending clearance

block

All of the parameters are true:

MulitSelect = True
ShiftEmpty = True
not a hit on the ItemCheckbox
(IsHit ShiftEmpty AutoDrag (this may be the start of a drag not sure yet)
and NodeSelected)
are all true as to be expected.

Then tsClearPending is set. There does not seem to be any change for this
flag to be unset until the HandleMouseUp where if it is set it immediatly
clears the selected nodes and reselects the focused node if it was one of
those selected.

I always questioned the DragStart call in the MouseDown method. It seems
more logical to do this only after a mouse down and a delta mouse move is
detected? Unless I am missing something obvious.

Jim

 | Replies | Author | Date
4364 | Re: Starting a drag problem | Mike Lischke | Thu 11/1/2001


re: Incremental search

From: Martijn Tonies [martijn@b...]
Date: Tue Oct 30, 2001 8:19 am
Subject: RE: [VirtualTreeview] Incremental search

Hi,

> > perhaps I'm doing something wrong, but when using the
> incremental search
> > event on a draw-tree, with about 12000 root nodes, my CPU
> goes to 100%,
> > stays that way for about 15 seconds and then advances to the node...
>
> Well, you should make yourself more familiar with incremental
> search in VT. Indeed is it so that a
> linear search is performed in the tree which surely takes
> some time. Additionally, by using isAll
> every node is initialized until a match is found. The next
> disadvantage is that you always want to
> start over when searching (normally, incremental search is
> performed from the currently focused
> node).

Alright - I've changed the settings to isAll (non-initialized nodes have to
get initialized), and ssLastHit.

> And finally, you are doing quite costly string operations:
>
> > if Pos(UpperCase(Text), item.ProductOmschrijving) = 1
>
> You are converting Unicode to ANSI text for every match
> (UpperCase takes ANSI strings) which is
> quite expensive, converting every text to upper case all the
> time and then you are using one of the
> most time consuming string search functions (Pos).

I modified the stuff to this:

function WideBeginsWith(SubStr, Str: WideString): Boolean;
var substrP, strP: PWideChar;
l, n: Integer;
begin
l := Length(SubStr);
if l > Length(Str)
then Result := False
else begin
substrP := PWideChar(WideUpperCase(SubStr));
strP := PWideChar(Str);
n := 0;
repeat
Result := strP[n] = substrP[n];
Inc(n);
until (n = l) or not Result
end;
end;

procedure TframAanbodSamenstellen.treeLABAanbodIncrementalSearch(
Sender: TBaseVirtualTree; Node: PVirtualNode; const Text: WideString;
var Result: Integer);
var data: PTreeData;
item: TLABAanbodsRegel;
begin
inherited;
data := Sender.GetNodeData(Node);
item := TLABAanbodsRegel(data^.Data);
if WideBeginsWith(Text, item.ProductOmschrijvingUpper)
then Result := 0
else Result := -1;
end;

In here, the item.ProductOmschrijvingUpper keeps a wide string uppercase
version of the ansi string 'ProductOmschrijving' - this should avoid the
case converting.

Using the 'Pos' function wasn't a good idea - both of you are right :) ... I
also tried the Delphi 6 AnsiStartsText function.

What do you think, which is faster (and is the above function for matching
with the PWideChars alright - I haven't got that much experience with PChars
at all...

Martijn Tonies

[Non-text portions of this message have been removed]


re: Incremental search

From: Werner Lehmann [wl@b...]
Date: Tue Oct 30, 2001 11:40 am
Subject: Re: [VirtualTreeview] Incremental search

Hi Martijn,

> I modified the stuff to this:
>
> function WideBeginsWith(SubStr, Str: WideString): Boolean;
> var substrP, strP: PWideChar;
> l, n: Integer;
> begin
> l := Length(SubStr);
> if l > Length(Str)
> then Result := False
> else begin
> substrP := PWideChar(WideUpperCase(SubStr));
> strP := PWideChar(Str);
> n := 0;
> repeat
> Result := strP[n] = substrP[n];
> Inc(n);
> until (n = l) or not Result
> end;
> end;
>
> procedure TframAanbodSamenstellen.treeLABAanbodIncrementalSearch(
> Sender: TBaseVirtualTree; Node: PVirtualNode; const Text: WideString;
> var Result: Integer);
> var data: PTreeData;
> item: TLABAanbodsRegel;
> begin
> inherited;
> data := Sender.GetNodeData(Node);
> item := TLABAanbodsRegel(data^.Data);
> if WideBeginsWith(Text, item.ProductOmschrijvingUpper)
> then Result := 0
> else Result := -1;
> end;
>
> In here, the item.ProductOmschrijvingUpper keeps a wide string uppercase
> version of the ansi string 'ProductOmschrijving' - this should avoid the
> case converting.

Hm, there is no point in using PWideChar if you access the single chars still
by index. And you uppercase the whole string when you might only need the
first char to see that they are different. And I don't know what happens if
you cast the result of WideUpperCase (which is a temporary in C slang) into
a PWideChar and use that afterwards without variable reference. But you have
tested it probably...

> Using the 'Pos' function wasn't a good idea - both of you are right :) ... I
> also tried the Delphi 6 AnsiStartsText function.

Which, by the sounds of it, would also convert AnsiString -> WideString.

> What do you think, which is faster (and is the above function for matching
> with the PWideChars alright - I haven't got that much experience with PChars
> at all...

I suppose that you could use WideCompareText() just as well. It relies on a
WinAPI call and respects the current locale. May sound slow, especially if
locale does not matter too much, but I could not come up with something faster
than this function. My best bet was 7 times slower, without locale and correct
WideChar support. I am showing it here for your enjoyment ;)

function WideCompareTextNoLocaleNoWide(S1, S2: WideString): Integer;
var
P1, P2: PWideChar;
begin
P1 := PWideChar(S1);
P2 := PWideChar(S2);
result := CharUpper(PChar(Char(P1^))) - CharUpper(PChar(Char(P2^)));
if (result = 0) and (P1^ <> #0) then
repeat
Inc(P1);
Inc(P2);
result := CharUpper(PChar(Char(P1^))) - CharUpper(PChar(Char(P2^)));
until (result <> 0) or (P1^ = #0) or (P2^ = #0);
end;

Werner


re: Incremental search

From: Martijn Tonies [martijn@b...]
Date: Tue Oct 30, 2001 12:10 pm
Subject: RE: [VirtualTreeview] Incremental search

Hi Werner,

> > I modified the stuff to this:
> >
> > function WideBeginsWith(SubStr, Str: WideString): Boolean;
> > var substrP, strP: PWideChar;
> > l, n: Integer;
> > begin
> > l := Length(SubStr);
> > if l > Length(Str)
> > then Result := False
> > else begin
> > substrP := PWideChar(WideUpperCase(SubStr));
> > strP := PWideChar(Str);
> > n := 0;
> > repeat
> > Result := strP[n] = substrP[n];
> > Inc(n);
> > until (n = l) or not Result
> > end;
> > end;
> >
> > procedure TframAanbodSamenstellen.treeLABAanbodIncrementalSearch(
> > Sender: TBaseVirtualTree; Node: PVirtualNode; const Text:
> WideString;
> > var Result: Integer);
> > var data: PTreeData;
> > item: TLABAanbodsRegel;
> > begin
> > inherited;
> > data := Sender.GetNodeData(Node);
> > item := TLABAanbodsRegel(data^.Data);
> > if WideBeginsWith(Text, item.ProductOmschrijvingUpper)
> > then Result := 0
> > else Result := -1;
> > end;
> >
> > In here, the item.ProductOmschrijvingUpper keeps a wide
> string uppercase
> > version of the ansi string 'ProductOmschrijving' - this
> should avoid the
> > case converting.
>
> Hm, there is no point in using PWideChar if you access the
> single chars still
> by index.

Cause Delphi translates the index to the right in memory position?

>And you uppercase the whole string when you might
> only need the
> first char to see that they are different.

Well, that is true - but then again, calling the UpCase function over and
over again might generate more overhead. On the other hand, an incremental
search usually happens with a few characters only.

>And I don't know what happens if
> you cast the result of WideUpperCase (which is a temporary in
> C slang) into
> a PWideChar and use that afterwards without variable
> reference. But you have
> tested it probably...

Hmmm... good point. It returns a WideString - do I have to keep that so that
it is ref-counted by the memory manager or does the PWideChar cast keep it
alive? (it does work though)

> > What do you think, which is faster (and is the above
> function for matching
> > with the PWideChars alright - I haven't got that much
> experience with PChars
> > at all...
>
> I suppose that you could use WideCompareText() just as well.
> It relies on a
> WinAPI call and respects the current locale. May sound slow,
> especially if
> locale does not matter too much, but I could not come up with
> something faster
> than this function.

Probably highly optimized asm or so... Anyway, I returns -1, 0 or 1 - and
it's meaning isn't usuable for this case I think. I need to know whether the
substr starts with str.

>My best bet was 7 times slower, without
> locale and correct
> WideChar support. I am showing it here for your enjoyment ;)

Let me see if I get it right here.

> function WideCompareTextNoLocaleNoWide(S1, S2: WideString): Integer;
> var
> P1, P2: PWideChar;
> begin
> P1 := PWideChar(S1);
> P2 := PWideChar(S2);
> result := CharUpper(PChar(Char(P1^))) - CharUpper(PChar(Char(P2^)));

You're point to the memory at P1 with P1^ and this is a char (casted) - You
then use a char pointer for the CharUpper function. CharUpper is a direct
Windows call?

> if (result = 0) and (P1^ <> #0) then
> repeat
> Inc(P1);
> Inc(P2);

You're increasing the pointer positions to the next char - and to the same.

> result := CharUpper(PChar(Char(P1^))) -
> CharUpper(PChar(Char(P2^)));
> until (result <> 0) or (P1^ = #0) or (P2^ = #0);
> end;

btw, I don't really like modifying pointers like this :)

Martijn Tonies

[Non-text portions of this message have been removed]


re: Incremental search

From: Martijn Tonies [martijn@b...]
Date: Tue Oct 30, 2001 12:15 pm
Subject: RE: [VirtualTreeview] Incremental search

Hi,

o - and by the way, it seems that the initializing of the nodes is the
bottleneck now :)

MT

>
> > procedure TframAanbodSamenstellen.treeLABAanbodIncrementalSearch(
> > Sender: TBaseVirtualTree; Node: PVirtualNode; const Text:
> WideString;
> > var Result: Integer);
> > var data: PTreeData;
> > item: TLABAanbodsRegel;
> > begin
> > inherited;
> > data := Sender.GetNodeData(Node);
> > item := TLABAanbodsRegel(data^.Data);
> > if WideBeginsWith(Text, item.ProductOmschrijvingUpper)
> > then Result := 0
> > else Result := -1;
> > end;

[Non-text portions of this message have been removed]


re: 2.6.0

From: Simon Giles [simon.giles@q...]
Date: Tue Oct 30, 2001 2:00 pm
Subject: RE: [VirtualTreeview] 2.6.0

> Well, here you've hit one of the weak points of VT. You
> should call InvalidateNode when you change
> its caption size. You know this is caused by the cached node
> width in the string tree, but I cannot
> retrieve this also from an event (or determine it on demand),
> because this would be way to slow.
>
> I'm all open ears for suggestions for improving this...

When the state of the font or the caption changes, call InvalidateNode
automatically (inside the appropriate property set method). If a call to
InvalidateNode is too expensive at that point, split out InvalidateNode's
"recalculate caption rect" functionality into a less expensive function.

- Simon

[Non-text portions of this message have been removed]

 | Replies | Author | Date
4365 | Re: 2.6.0 | Mike Lischke | Thu 11/1/2001


re: VT 2.6.0 and BCB new Errors

From: [rhymebusta@h...]
Date: Tue Oct 30, 2001 2:43 pm
Subject: Re: VT 2.6.0 and BCB new Errors

> You don't need to upload any fixes. It is already enough that you
told me about the problem. I will
> take care about that.
>
> For the problem: the {$WEAKPACKAGEUNIT} mark is mainly to avoid
having to take the unit into a
> package (to allow to use it from different packages without having
another dependency). I guess you
> have included the files anyway, so try leaving them out (just as
with *.h files which I guess are
> also not in packages).
>
> Ciao, Mike
> --
> www.lischke-online.de
> www.delphi-unicode.net

ok so i was wondering if the .zip file that is posted for VT2.6.0 in
the "Files -> Examples -> BCB_Examples -> Compatibility" section is
the one that is needed in order to be able to install VT in BCB?
because i have had time consuming issues trying to install previous
versions...and even when they do install....errors occcur when i use
ONLY the VT component(in a TForm) and try to compile the *.cpp files.

there's one consistent error that the compiler spits out:

[C++ Error] VirtualTrees.hpp(523): E2076 Overloadable operator
expected
/************************************/
//this is where it says the error is//
/************************************/
public:
operator IDropTarget*(void) { return (IDropTarget*)
&__IDropTarget; }
operator IDropSource*(void) { return (IDropSource*)
&__IDropSource; }
operator IDataObject*(void) { return (IDataObject*)
&__IDataObject; }

};

 | Replies | Author | Date
4366 | Re: VT 2.6.0 and BCB new Errors | Mike Lischke | Thu 11/1/2001
4385 | Re: VT 2.6.0 and BCB new Errors | [rhymebusta@h...] | Thu 11/1/2001
4387 | Re: VT 2.6.0 and BCB new Errors | Mike Lischke | Thu 11/1/2001


re: Re: VT 2.6.0 and BCB new Errors

From: Vandrovec Milan [milan_va@s...]
Date: Tue Oct 30, 2001 3:40 pm
Subject: RE: [VirtualTreeview] Re: VT 2.6.0 and BCB new Errors

> ok so i was wondering if the .zip file that is posted for VT2.6.0 in
> the "Files -> Examples -> BCB_Examples -> Compatibility" section is
> the one that is needed in order to be able to install VT in BCB?

Yes, now there is "VT2_6_0 for CPPB v2.zip", ...

> because i have had time consuming issues trying to install previous
> versions...and even when they do install....errors occcur when i use
> ONLY the VT component(in a TForm) and try to compile the *.cpp files.
>
> there's one consistent error that the compiler spits out:
>
> [C++ Error] VirtualTrees.hpp(523): E2076 Overloadable operator
> expected
> /************************************/
> //this is where it says the error is//
> /************************************/
> public:
> operator IDropTarget*(void) { return (IDropTarget*)
> &__IDropTarget; }
> operator IDropSource*(void) { return (IDropSource*)
> &__IDropSource; }
> operator IDataObject*(void) { return (IDataObject*)
> &__IDataObject; }
>
> };

... but I think I can't help you with this. It works fine for me, although I
have these lines you mention around line 1934 to 1936. Pretty interesting,
isn't it?
Anyway, it looks like not being the problem, since I can compile those
lines. Could you send me the .hpp file to [milan_va@s...]? I will compare
it with my own.

BTW, from when it does not work? Do you have an older version that was OK?

Milan Vandrovec


advanced demo application

From: [molzahn@m...]
Date: Tue Oct 30, 2001 4:04 pm
Subject: advanced demo application

Hi

Just FYI:

Downloaded the demo program yesterday and found, that using
the "Painting like XP" and "Alignment, Directionality and
Internationalization" demos produce a Range Check Error followed by a
blue screen of death. I'm using Win98SE and ME.

Also, the application seems to be designed only for lower screen
resolutions and/ or small fonts. Under 1280x1024 and large font, you
cannot see the far right and bottom parts of the window.

HTH
Uwe

 | Replies | Author | Date
4367 | Re: advanced demo application | Mike Lischke | Thu 11/1/2001
4380 | Re: advanced demo application | [molzahn@m...] | Thu 11/1/2001
4383 | Re: advanced demo application | Mike Lischke | Thu 11/1/2001
4449 | Re: advanced demo application | [molzahn@m...] | Sat 11/3/2001
4379 | Re: advanced demo application | Werner Lehmann | Thu 11/1/2001
4381 | Re: advanced demo application | Mike Lischke | Thu 11/1/2001
4384 | Re: advanced demo application Large Fonts | [sales@d...] | Thu 11/1/2001
4389 | Re: advanced demo application | Werner Lehmann | Thu 11/1/2001
4414 | Re: advanced demo application | Mike Lischke | Fri 11/2/2001


Save exactly treeview positions

From: "Body Closed" [bodyclosed@y...]
Date: Tue Oct 30, 2001 5:29 pm
Subject: Save exactly treeview positions

What is the best way to save the treeview position? Like user
open form with treeview, open some nodes inside nodes, and close
form, when user open form again i want that treeview show and
position in the last item on the virtual treeview, what is the
best method do to this, VT has some feature to automatic
do this? Maybe save pos on register, if dont has, here is my
suggestion?

How to expand all nodes? And unexpand nodes? I try
find some procedure to make this, but no success!

Thanx all

 | Replies | Author | Date
4357 | Re: Save exactly treeview positions | Werner Lehmann | Wed 10/31/2001


OnDragAllowed Triggered prior to Selection Change

From: "Simon Moscrop" [SimonMoscrop@H...]
Date: Tue Oct 30, 2001 4:48 pm
Subject: OnDragAllowed Triggered prior to Selection Change

Mike,

This is causing us a problem or two. We wish to not allow drag if
multiple nodes are selected (through ctrl, shift etc) but we have no
way of knowing at this point what will be selected when drag starts.

I.e. the selection of what is about to be dragged is updated AFTER
the OnDragAllowed event - so finding out whether we want to allow
drag or not becomes pretty complex.

Is this on purpose?

Thanks for your help & your wonderful component.

- Simon

 | Replies | Author | Date
4353 | OnDragAllowed Triggered prior to Selection Change | Simon Moscrop | Tue 10/30/2001
4356 | Re: OnDragAllowed Triggered prior to Selection Ch | Ralf Melles | Wed 10/31/2001
4368 | Re: OnDragAllowed Triggered prior to Selection Ch | Mike Lischke | Thu 11/1/2001


OnDragAllowed Triggered prior to Selection Change

From: "Simon Moscrop" [SimonMoscrop@H...]
Date: Tue Oct 30, 2001 4:48 pm
Subject: OnDragAllowed Triggered prior to Selection Change

Mike,

This is causing us a problem or two. We wish to not allow drag if
multiple nodes are selected (through ctrl, shift etc) but we have no
way of knowing at this point what will be selected when drag starts.

I.e. the selection of what is about to be dragged is updated AFTER
the OnDragAllowed event - so finding out whether we want to allow
drag or not becomes pretty complex.

Is this on purpose?

Thanks for your help & your wonderful component.

- Simon

 | Replies | Author | Date
4356 | Re: OnDragAllowed Triggered prior to Selection Ch | Ralf Melles | Wed 10/31/2001


VT2.6.0 missing image in VirtualTrees.RES and assert fail in IDE?

From: [sales@d...]
Date: Tue Oct 30, 2001 7:08 pm
Subject: VT2.6.0 missing image in VirtualTrees.RES and assert fail in IDE?

Download and rebuild packages. Installation fails with assertion
fail on line 4151. Images don't load when in IDE?? Remove assertion
and rebuild and get a zero divide error.

Look at VertualTrees.RES. Seems XP support image is missing. Insert
a dummy image and all is OK.

John

 | Replies | Author | Date
4369 | Re: VT2.6.0 missing image in VirtualTrees.RES and | Mike Lischke | Thu 11/1/2001


Undeclared identifier : TClipboardFormats Error in BCB

From: Albert Goodwill [albertgoodwill@y...]
Date: Wed Oct 31, 2001 3:19 am
Subject: Undeclared identifier : TClipboardFormats Error in BCB

I've downloaded the following files;
(i) VirtualTree_2_6_0.zip

(ii) VT2_6_0 for CPPB v2.zip

to try VirtualTrees in my BCB 5.0 (Build 12.34). I've followed the
instructions in Readme.txt file of VT2_6_0 for CPPB v2.zip.

Errors :

When I compile VirtualTreeView.bpk I get the folowing error message;

[Linker Fatal Error] Fatal : Unable to open file 'VIRTUALTOOLSC5D.LIB'

I've modified the VirtualTreeView.bpk source and removed two references to
'VIRTUALTOOLSC5D.LIB' and VirtualTreeView.bpk compiled again and received the
similar messages for VT_Addons.lib and VirtualTreeViewD.lib files. I've also
removed the references to these files and then it compiled and installed okay.

I've tried to compile VirtualTreeViewD.bpk and received the following error
message;

[Pascal Error] VirtualTreesReg.pas(107): Undeclared identifier
'TClipboardFormats'

Any help to solve this problem?

Thanks..

[albertgoodwill@y...]

---------------------------------
Do You Yahoo!?
Make a great connection at Yahoo! Personals.

[Non-text portions of this message have been removed]


re: OnDragAllowed Triggered prior to Selection Change

From: "Ralf Melles" [rmelles@g...]
Date: Wed Oct 31, 2001 8:10 am
Subject: Re: OnDragAllowed Triggered prior to Selection Change

--- In [VirtualTreeview@y...], "Simon Moscrop" [SimonMoscrop@H...]
wrote:
> Mike,
>
> This is causing us a problem or two. We wish to not allow drag if
> multiple nodes are selected (through ctrl, shift etc) but we have
no
> way of knowing at this point what will be selected when drag starts.
>
> I.e. the selection of what is about to be dragged is updated AFTER
> the OnDragAllowed event - so finding out whether we want to allow
> drag or not becomes pretty complex.
>
> Is this on purpose?

Hi Simon, this is only an idea but I´m shure it will work:

Check the number of selected nodes in the OnChange method of the
treeview and change the properties to enable/disable draging.

Regard
Ralf


re: Save exactly treeview positions

From: Werner Lehmann [wl@b...]
Date: Wed Oct 31, 2001 12:13 pm
Subject: Re: [VirtualTreeview] Save exactly treeview positions

Hi Body Closed,

> What is the best way to save the treeview position? Like user
> open form with treeview, open some nodes inside nodes, and close
> form, when user open form again i want that treeview show and
> position in the last item on the virtual treeview, what is the
> best method do to this, VT has some feature to automatic
> do this? Maybe save pos on register, if dont has, here is my
> suggestion?
>
> How to expand all nodes? And unexpand nodes? I try
> find some procedure to make this, but no success!

I have created two methods in my VST descendant which store / restore the
FocusedNode, the TopNode, the IDs of all expanded nodes and some other
company specific information into a state string. Works quite good, only
the strings can get long; for a fully expanded tree the state string would
be 18+ KB as ascii string, still 3+ KB in binary representation with no
upper limit of course.

Cannot give you source (copyrighted code, also with some specifics related
to our framework). But this should give you an idea ;)

Werner


re: Incremental search

From: Werner Lehmann [wl@b...]
Date: Wed Oct 31, 2001 12:28 pm
Subject: Re: [VirtualTreeview] Incremental search

Hi Martijn,

> > Hm, there is no point in using PWideChar if you access the
> > single chars still
> > by index.
>
> Cause Delphi translates the index to the right in memory position?

I have found that those string routines can be much faster if you use PChars
instead of indexed AnsiStrings. Did not check with the ASM code but even if
it used some addressing mode like 'indirect with offset' it is still slower.

With PChars there's no need for this, it always points to the current char
and you can inc() it to get the next. If you find a #0 the string's end has
been reached - thus avoiding the Length() call (don't know if the length is
stored somewhere or has to be counted, any insight anyone on this?). The
approach makes only sense if you go more or less unidirectional thru the
string, of course.

> >And you uppercase the whole string when you might
> > only need the
> > first char to see that they are different.
>
> Well, that is true - but then again, calling the UpCase function over and
> over again might generate more overhead. On the other hand, an incremental
> search usually happens with a few characters only.

Both true. I hoped the second aspect would be more important. If only we
had plain ASCII and AnsiStrings; we could just reset a bit and have the fastest
possible UpCase().

> >And I don't know what happens if
> > you cast the result of WideUpperCase (which is a temporary in
> > C slang) into
> > a PWideChar and use that afterwards without variable
> > reference. But you have
> > tested it probably...
>
> Hmmm... good point. It returns a WideString - do I have to keep that so that
> it is ref-counted by the memory manager or does the PWideChar cast keep it
> alive? (it does work though)

This is what I wondered too. I'd figure if it works delphi keeps the reference.

> Probably highly optimized asm or so... Anyway, I returns -1, 0 or 1 - and
> it's meaning isn't usuable for this case I think. I need to know whether the
> substr starts with str.

Oops. We need a function version with compare length limit. Like AnsiStrLIComp()
which I am using (and am aware of the WideChar - AnsiChar conversion). Such a
parameter could be easily added to my function...

> Let me see if I get it right here.
>
> > function WideCompareTextNoLocaleNoWide(S1, S2: WideString): Integer;
> > var
> > P1, P2: PWideChar;
> > begin
> > P1 := PWideChar(S1);
> > P2 := PWideChar(S2);
> > result := CharUpper(PChar(Char(P1^))) - CharUpper(PChar(Char(P2^)));
>
> You're point to the memory at P1 with P1^ and this is a char (casted) - You
> then use a char pointer for the CharUpper function. CharUpper is a direct
> Windows call?

Yes. I need it to get the correct UpCase for special characters like ä / Ä.
May be the bottleneck here. The PChar cast does nothing (only needed for type
compatibility), don't know how efficient the WideChar - Char cast is though.

> > if (result = 0) and (P1^ <> #0) then
> > repeat
> > Inc(P1);
> > Inc(P2);
>
> You're increasing the pointer positions to the next char - and to the same.

Yes.

> > result := CharUpper(PChar(Char(P1^))) -
> > CharUpper(PChar(Char(P2^)));
> > until (result <> 0) or (P1^ = #0) or (P2^ = #0);
> > end;
>
> btw, I don't really like modifying pointers like this :)

Hehe. There's no magic in it and so far it's quite harmless.

Werner


AutoDragExpand not working in VCL Drag and Drop (same tree)

From: [gerard.beneteau@w...]
Date: Wed Oct 31, 2001 4:33 pm
Subject: AutoDragExpand not working in VCL Drag and Drop (same tree)

I my doing VCL Drag and Drop in the same tree.

I have set the AutoDragExpand option, but is not working: in
procedure DoDragExpand, FDragManager is nil. Commenting out
the "Assign(FDragManager)" test fixes the problem, but I am not sure
it is the right thing to do.
Just to let you know...

Gérard

-------------------------------
procedure TBaseVirtualTree.DoDragExpand;

begin
StopTimer(ExpandTimer);
if
====> {Assigned(FDragManager) and } <=== commented out by me for
test purpose
Assigned(FDropTargetNode) and (vsHasChildren in
FDropTargetNode.States) and
not (vsExpanded in FDropTargetNode.States) then
with DragManager do
begin
if Assigned(DragSource) then
DragSource.FDragImage.HideDragImage;
ToggleNode(FDropTargetNode);
UpdateWindow(Handle);
if Assigned(DragSource) then
DragSource.FDragImage.ShowDragImage;
end;
end;

 | Replies | Author | Date
4372 | Re: AutoDragExpand not working in VCL Drag and Dr | Mike Lischke | Thu 11/1/2001


SyncUpdates

From: Werner Lehmann [wl@b...]
Date: Wed Oct 31, 2001 11:32 pm
Subject: SyncUpdates

Hi Mike,

I am just looking into an OnChange problem. Apparently every second time
when this event fires its Node parameter is nil. Not too pretty IMO but
this has been known before. Well, I used to set ChangeDelay to 100 or 200
and am getting *almost* no Change events with nil nodes anymore. I say
almost because it still happens sometimes with no apparent reason and
causes some odd behaviour; it seems as if it would not fire again then
with the real FocusedNode (which is <> nil), is that possible?

Now to subject of this mail. I must admit that I am unsure when to use
BeginSync, EndSync (they look better without the h at the end ;). Could
you tell me a case where they provide any benefit over the usual Begin-
Update, EndUpdate?

Does BeginSync extend BeginUpdate, i.e. the update is still suspended?
Your code looks a little bit strange in BeginSync and EndSync. You seem
to confuse FUpdateCount for FSynchUpdateCount in both methods, maybe a
copy and paste error.

Regards,
Werner

 | Replies | Author | Date
4375 | Re: SyncUpdates | Mike Lischke | Thu 11/1/2001
4454 | Re: SyncUpdates | Werner Lehmann | Sun 11/4/2001


HELP FILE !

From: Werner Lehmann [wl@b...]
Date: Wed Oct 31, 2001 11:54 pm
Subject: HELP FILE !

Hi Mike,

I am putting this in an extra thread. It *may* be that more people are
seeing it now as under "RE: [VirtualTreeview] New file uploaded to
VirtualTreeview" :)

Mike Lischke wrote:
>
> A request to all of you: please, I need help with the help. I don't know how
to finish the help file
> in my limited time. I still have bugs to fix and the demos must be brought in
a usable and tested
> state. I urgently need volunteers for writing help or I simply have to skip
many parts. With the
> current speed of writing the help it will take until next spring or so until
it is finished...
>
> Things needed to be written:
> - TCustomVirtualDrawTree & TVirtualDrawTree (base tree is nearly finished)
> - TCustomVirtualStringTree & TVirtualStringTree
> - TEnumFormatEtc
> - TFormatEtcList
> - TScrollBarOptions
> - TStringEditLink
> - TVTColors
> - TVTDragImage
> - TVTEdit
> - TVTHeader
> - TVirtualTreeColumn
> - TVirtualTreeColumns
> - TVirtualTreeHintWindow
> - TVirtualTreeOptions (custom variant is already finished)
> - many of the constants
> - IVTDragManager
> - IVTEditLink
> - all types (e.g. TAfterItemEraseEvent, TCache, TVTButtonStyle etc.)
> - the header popup menu
>
> There is always a summary and a description for each item. The classes get an
entry for each
> property and method. The non-custom variants of classes usually need only
references to the
> custom-variants.

Valid request. I think we have some regulars here who are able to contribute
some (even small)
part of the help. Many small parts add up to a big part (if someone didn't know
that yet :).

I'd like to help you (us all!) out a bit, cannot promise to hold any deadlines
though. How
did you imagine the contributions? Do I take the interface part of a class and
write summary
and description right below it and you copy and paste that? Or should I use any
help file tool?
What about small screenshots which demonstrate, for example, TVTColors or the
different header
styles?

Regards,
Werner

 | Replies | Author | Date
4377 | Re: HELP FILE ! | Mike Lischke | Thu 11/1/2001
4483 | Re: HELP FILE ! | Werner Lehmann | Mon 11/5/2001
4484 | Re: HELP FILE ! | Jim Kueneman | Mon 11/5/2001
4485 | Re: HELP FILE ! | Werner Lehmann | Tue 11/6/2001
4487 | Re: HELP FILE ! | Jim Kueneman | Tue 11/6/2001
4491 | Re: HELP FILE ! | Werner Lehmann | Tue 11/6/2001
4508 | Re: HELP FILE ! | Werner Lehmann | Tue 11/6/2001
4523 | Re: HELP FILE ! | Mike Lischke | Wed 11/7/2001
4524 | Re: HELP FILE ! | Werner Lehmann | Wed 11/7/2001


Blended node icon

From: Werner Lehmann [wl@b...]
Date: Thu Nov 1, 2001 1:06 am
Subject: Blended node icon

Hi Mike,

do you remember my posting about the fact that the blended icon does
look too 'weak' when the tree does not have the focus and the icon
is blended with clBtnFace or something similar?

I just wanted to bug you once more with this :) I have just now dis-
covered that Explorer does not draw the icon blended if the listview
is unfocused. The icon is only blended if the tree has focus... What
about this? Should be a very minor change :)

Regards,
Werner

 | Replies | Author | Date
4378 | Re: Blended node icon | Mike Lischke | Thu 11/1/2001
4388 | Re: Blended node icon | Werner Lehmann | Thu 11/1/2001
4413 | Re: Blended node icon | Mike Lischke | Fri 11/2/2001
4421 | Re: Blended node icon | Werner Lehmann | Fri 11/2/2001
4424 | Re: Blended node icon | Mike Lischke | Sat 11/3/2001


re: Re: Starting a drag problem

From: "Mike Lischke" [lists@l...]
Date: Thu Nov 1, 2001 11:52 am
Subject: RE: [VirtualTreeview] Re: Starting a drag problem

> 1) VET has a popupmenu but the shell supplies it so this will be nil
> unless there is a custom menu assigned.

Ok, I added a virtual method called HasPopupMenu which VET can override to
return whether it got a
menu or not. In the base tree this method checks for the PopupMenu property and
the OnGetPopuMenu
event. Should be now flexible enough to handle all cases.

Ciao, Mike


re: Re: Starting a drag problem

From: "Mike Lischke" [lists@l...]
Date: Thu Nov 1, 2001 11:58 am
Subject: RE: [VirtualTreeview] Re: Starting a drag problem

> are all true as to be expected.

Yes, indeed, and it works well in all combinations I can reproduce here.

> I always questioned the DragStart call in the MouseDown method. It seems
> more logical to do this only after a mouse down and a delta mouse move is
> detected? Unless I am missing something obvious.

The BeginDrag call does not really start dragging. It's rather a registration
to start one if the
mouse moves now more then a specific amount of pixels.

Ciao, Mike


re: 2.6.0

From: "Mike Lischke" [lists@l...]
Date: Thu Nov 1, 2001 12:05 pm
Subject: RE: [VirtualTreeview] 2.6.0

Hi Simon,

> When the state of the font or the caption changes, call InvalidateNode
> automatically (inside the appropriate property set method). If a call to
> InvalidateNode is too expensive at that point, split out InvalidateNode's
> "recalculate caption rect" functionality into a less expensive function.

Unfortunatly, the font change happens during painting (in an event) so the only
place where you can
recalculate the size is in this event. The font properties are not persistent
things in a node but
properties assigned on the fly. This is extremely flexible but bears also some
problems, as we see.
The only solution I can imagine currently is to explicitly invalidate the nodes
after they are
switched to bold in code. This will not work, of course, when the font
attributes are dynamically
determined in the event and not known in advance. But since this might become
quite time consuming
in an event which is called very often it is better to determine this only if
needed and then
invalidate the node.

Ciao, Mike


re: Re: VT 2.6.0 and BCB new Errors

From: "Mike Lischke" [lists@l...]
Date: Thu Nov 1, 2001 12:08 pm
Subject: RE: [VirtualTreeview] Re: VT 2.6.0 and BCB new Errors

> ok so i was wondering if the .zip file that is posted for VT2.6.0 in
> the "Files -> Examples -> BCB_Examples -> Compatibility" section is
> the one that is needed in order to be able to install VT in BCB?

I have not idea. Also the Delphi version should compile and install fine (after
conversion by BCB).
Unfortunately, I cannot test it on my machines.

> there's one consistent error that the compiler spits out:

Search the messages in the archive. We had this problem about a year ago and I
thought it is already
fixed for a long time by taking in

{$HPPEMIT '#include <objidl.h>'}

into VirtualTrees.pas and moving around some stuff.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net

 | Replies | Author | Date
4385 | Re: VT 2.6.0 and BCB new Errors | [rhymebusta@h...] | Thu 11/1/2001
4387 | Re: VT 2.6.0 and BCB new Errors | Mike Lischke | Thu 11/1/2001


re: advanced demo application

From: "Mike Lischke" [lists@l...]
Date: Thu Nov 1, 2001 12:13 pm
Subject: RE: [VirtualTreeview] advanced demo application

Hi Uwe,

> Downloaded the demo program yesterday and found, that using
> the "Painting like XP" and "Alignment, Directionality and
> Internationalization" demos produce a Range Check Error followed by a
> blue screen of death. I'm using Win98SE and ME.

Thank you for letting me know. I will go through al the demos once I decided
that VT is ready to
publish.

> Also, the application seems to be designed only for lower screen
> resolutions and/ or small fonts. Under 1280x1024 and large font, you
> cannot see the far right and bottom parts of the window.

It is not the screen resolution but the font size which produces the problem.
Have you ever been
able to design a Delphi application successfully which runs properly on any
font size? Me not, and I
doubt it is possible. The effort is tremendous because every element in the
application has to
resize automatically, which makes designing a form in the IDE a joke (because
the layout is not
preserved). The other option would be to leave enough space in the first place
to allow proper
expansion, but then the app. looks terrible at small font sizes.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net

 | Replies | Author | Date
4380 | Re: advanced demo application | [molzahn@m...] | Thu 11/1/2001
4383 | Re: advanced demo application | Mike Lischke | Thu 11/1/2001
4449 | Re: advanced demo application | [molzahn@m...] | Sat 11/3/2001


re: OnDragAllowed Triggered prior to Selection Change

From: "Mike Lischke" [lists@l...]
Date: Thu Nov 1, 2001 12:16 pm
Subject: RE: [VirtualTreeview] OnDragAllowed Triggered prior to Selection Change

> I.e. the selection of what is about to be dragged is updated AFTER
> the OnDragAllowed event - so finding out whether we want to allow
> drag or not becomes pretty complex.
>
> Is this on purpose?

Yes, this is by design. This is a typical chicken-egg problem. The tree needs
to know whether
dragging is allowed or not before it can act further, while you need to know
what happens afterwards
before permitting drag. What you could do of course is to check the selection
count and if it is one
and the hit node is the first selected node then you can permit the drag
operation. Check for
modifier keys because ctrl-clicking on a selected node will unselect it.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: VT2.6.0 missing image in VirtualTrees.RES and assert fail in IDE?

From: "Mike Lischke" [lists@l...]
Date: Thu Nov 1, 2001 12:17 pm
Subject: RE: [VirtualTreeview] VT2.6.0 missing image in VirtualTrees.RES and assert fail in IDE?

Hi John,

> Look at VertualTrees.RES. Seems XP support image is missing. Insert
> a dummy image and all is OK.

Thank you for letting me know. The next build will contain the correct res file
again. Sorry for the
trouble.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


Master Detail

From: "Dion" [dion@n...]
Date: Thu Nov 1, 2001 1:10 pm
Subject: Master Detail

Hi,

Forgive me for posing a so many questions at once.

How do I fill a VT in a Forms OnCreate event with a master detail relationship,
getting the data from a database.

Is it possible to hide the column headings, but still have the column visible?

How do display the checkboxes.

Sorry for being so demanding, but I would really like to get up and running
with vt as soon as possible.

Many thanks,
Dion.

[Non-text portions of this message have been removed]

 | Replies | Author | Date
4374 | Re: Master Detail | Jim Kueneman | Thu 11/1/2001
4376 | Re: Master Detail (many questions at once) | Helge Jung (ECO-Logic) | Thu 11/1/2001


problem installing VT

From: "Ronan Van Riet" [rvanriet@s...]
Date: Thu Nov 1, 2001 1:04 pm
Subject: problem installing VT

Hi,

I just downloaded VirtualTreeview.zip, but cannot find the
VirtualTreesD5.dpk.

Please can someone help me so I can start experimenting with VT.

I am using Delphi 5.

Kind regards,
Ronan van Riet
Symantec

 | Replies | Author | Date
4373 | Re: problem installing VT | Jim Kueneman | Thu 11/1/2001
4396 | Re[2]: [VirtualTreeview] problem installing VT | Yur Ovchinnikov | Fri 11/2/2001
4457 | problem installing VT | Ronan Van Riet | Mon 11/5/2001
4459 | Re: Problem installing VT | Helge Jung (ECO-Logic) | Mon 11/5/2001


re: AutoDragExpand not working in VCL Drag and Drop (same tree)

From: "Mike Lischke" [lists@l...]
Date: Thu Nov 1, 2001 1:19 pm
Subject: RE: [VirtualTreeview] AutoDragExpand not working in VCL Drag and Drop (same tree)

Hi Gérard,

> I have set the AutoDragExpand option, but is not working: in
> procedure DoDragExpand, FDragManager is nil. Commenting out
> the "Assign(FDragManager)" test fixes the problem, but I am not sure
> it is the right thing to do.

Thank you for letting me know. Indeed there was an incorrect summation of
checks which prevented VCL
drag expand. This is fixed now.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: problem installing VT

From: Jim Kueneman [jimdk@m...]
Date: Thu Nov 1, 2001 1:51 pm
Subject: Re: [VirtualTreeview] problem installing VT

At 02:04 PM 11/1/2001 +0100, you wrote:
>Hi,
>
>I just downloaded VirtualTreeview.zip, but cannot find the
>VirtualTreesD5.dpk.

Is this the version from the Yahoo Group's files area? The latest version
is 2.6.0.

http://groups.yahoo.com/group/VirtualTreeview

>Kind regards,
>Ronan van Riet
>Symantec

Cool, can we see VT in the next version of Norton Utilities? <G>

Jim

 | Replies | Author | Date
4396 | Re[2]: [VirtualTreeview] problem installing VT | Yur Ovchinnikov | Fri 11/2/2001


re: Master Detail

From: Jim Kueneman [jimdk@m...]
Date: Thu Nov 1, 2001 1:54 pm
Subject: Re: [VirtualTreeview] Master Detail

Take a look at this example first

http://groups.yahoo.com/group/VirtualTreeview/files/Examples/Delphi_Examples/Mis\
c_Examples/VT_Basics.zip

It should help with most of your questions or at least help make them more
specific.

Jim


re: SyncUpdates

From: "Mike Lischke" [lists@l...]
Date: Thu Nov 1, 2001 1:52 pm
Subject: RE: [VirtualTreeview] SyncUpdates

Hi Werner,

> I am just looking into an OnChange problem. Apparently every second time
> when this event fires its Node parameter is nil. Not too pretty IMO but
> this has been known before.

I don't know what your problem is here. Once you tested for assigned nodes in
OnChange it should not
be an issue anymore for you. The passed node can be nil in several cases, e.g.
when clearing the
selection or when several nodes are affected by an operation (e.g. in
InvertSelection).

>Well, I used to set ChangeDelay to 100 or 200
> and am getting *almost* no Change events with nil nodes anymore.

Sure, this is one of the reasons to have delayed change events. This way
several quickly occuring
events are accumulated and only one event is fired.

>I say
> almost because it still happens sometimes with no apparent reason and
> causes some odd behaviour; it seems as if it would not fire again then
> with the real FocusedNode (which is <> nil), is that possible?

Oops, here I lost you. Why did suddenly mention the focused node? Note: focus
and selection are two
different things.

> Now to subject of this mail. I must admit that I am unsure when to use
> BeginSync, EndSync (they look better without the h at the end ;). Could
> you tell me a case where they provide any benefit over the usual Begin-
> Update, EndUpdate?

Sure. Synchronized updates were necessary in some of our products. Imagine a
case where you have two
forms. One contains a VT and the other form contains several other controls
which can be navigated
and are created and destroyed depending on the node in the tree. Clicking on a
node will create a
framework on the other form, which also contains a menu, from which you can
also navigate. This menu
navigation also changes the selected node in the treeview. So we have a
recursion here. This alone
produces all kind of trouble if you have other things which are not
synchronized with the whole
navigation process (e.g. a playing media player or threaded speech
recognition). Things get worst
however when clicking a node might open another dialog (e.g. for loading or
saving). Depending on
the form state of the other forms (e.g. fsStayOnTop) it happens then that the
dialog appears behind
all other VCL windows (!) and cannot be brought to front. Furthermore, since
this dialog is modal
you cannot activate any other window in the application. This is very annoying
and could elegantly
be avoided by synchronizing updates for a short period of time (e.g. when you
select a node in code
you know the OnChange event will be called before the selection code returns),
without affecting
normal delayed events in usual navigation.

Btw, in case you ask: the reason for the strange behavior of the dialog was
that it was created
modally and (due to delayed change events) another form with fsStayOn top was
created after it.
Modal forms have an own message loop and rely on things like DisableTaskWindows
which does not work
in this case.

> Does BeginSync extend BeginUpdate, i.e. the update is still suspended?

No, both can coexist. So you can activate synchronized updates and they appear
directly on screen or
are blocked. Just as you like.

> Your code looks a little bit strange in BeginSync and EndSync. You seem
> to confuse FUpdateCount for FSynchUpdateCount in both methods, maybe a
> copy and paste error.

Oops, yes there were two wrong references. This is fixed now.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: Master Detail (many questions at once)

From: "Helge Jung \(ECO-Logic\)" [helge@e...]
Date: Thu Nov 1, 2001 1:53 pm
Subject: Re: [VirtualTreeview] Master Detail (many questions at once)

> Forgive me for posing a so many questions at once.

I don't think that really matters ;-)

> How do I fill a VT in a Forms OnCreate event with a master detail
> relationship, getting the data from a database.

It is called VirtualTreeview - that means that data should be assigned when
it needs, but anyway:

type { before the form declaration }
PDBEntry = ^TDBEntry;
TDBEntry = record
Data1, Data2 : widestring;
end;

procedure TForm1.Form1Create(Sender: TObject);
begin
VST.NodeDataSize := SizeOf (TDBEntry); // assuming your tree is called VST

{iterate through your data and for each info do the following}
with PDBEntry(VST.GetNodeData(VST.AddChild(nil)))^ do
begin
Data1 := Table.FieldByName('YourField').AsString;
Data2 := '...';
end;
end;

The procedure described above only adds root-nodes (IAW at level 0). If you
want to add nodes under another (as child-nodes), you'll have to change it a
bit:

procedure TForm1.Form1Create (Sender: TObject);
var
ParentNode,
NewNode : PVirtualNode;

begin
VST.NodeDataSize := SizeOf (TDBEntry);
ParentNode := nil;

{ for each record }
// if this node should be a root node, set ParentNode := nil;
NewNode := VST.AddChild(ParentNode);
with PDBEntry(VST.GetNodeData(NewNode))^ do
begin
Data1 := '...';
Data2 := '...';
end;
// if this node should have childs, set ParentNode := NewNode;
end;

> Is it possible to hide the column headings, but still have the
> column visible?

What do you mean? VST.Header.Options.hoVisible?

> How do display the checkboxes.

In OnInitNode say "Node^.CheckType := ctCheckBox;".

> Sorry for being so demanding, but I would really like to get up
> and running with vt as soon as possible.

There is a place giving help... you seem to found it ;-)

Hope, my out-of-brain stuff helps you,
Helge.


re: HELP FILE !

From: "Mike Lischke" [lists@l...]
Date: Thu Nov 1, 2001 3:02 pm
Subject: RE: [VirtualTreeview] HELP FILE !

> I am putting this in an extra thread. It *may* be that more people are
> seeing it now as under "RE: [VirtualTreeview] New file uploaded to
VirtualTreeview" :)

Good idea. I would have reposted the request today if you would not have been
faster, Werner.

> Valid request. I think we have some regulars here who are able to contribute
some (even small)
> part of the help. Many small parts add up to a big part (if someone didn't
know that yet :).

Indeed, if everybody would only take one class or a handfull of constants or
types the documentation
would be ready within a few days.

> I'd like to help you (us all!) out a bit, cannot promise to hold any
deadlines though.

Great. Just pick one part you like to document.

>How
> did you imagine the contributions? Do I take the interface part of a class
and write summary
> and description right below it and you copy and paste that? Or should I use
any help file tool?

I see three ways:

1. Simply create plain text file, copy out the class (or other part) and write
one short line
summary as well as some description.
2. Use the document structure as produced by my authoring tool which looks like:

<Class Name="TScrollBarOptions">
<Methods>
<Method Name="Create">
<Summary></Summary>
<Desc></Desc>
</Method>
<Method Name="GetOwner">
<Summary></Summary>
<Desc></Desc>
</Method>
<Method Name="SetAlwaysVisible">
<Summary></Summary>
<Desc></Desc>
</Method>
etc. which looks very much like XML (actually it is SGML).
3. You download the trial version of the authoring tool I use (Time2Help at
www.time2help) which is
liimited to 30 days but gives you previews but requires some work to get used
to it. For text
formatting you can use usual HTML tags like <b></b>, <i></i>, <li>, <ul>,
<table> etc.

> What about small screenshots which demonstrate, for example, TVTColors or the
different header
> styles?

Also images are possible and I prefer using them to describe complex things.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: Blended node icon

From: "Mike Lischke" [lists@l...]
Date: Thu Nov 1, 2001 3:14 pm
Subject: RE: [VirtualTreeview] Blended node icon

> I just wanted to bug you once more with this :) I have just now dis-
> covered that Explorer does not draw the icon blended if the listview
> is unfocused. The icon is only blended if the tree has focus... What
> about this? Should be a very minor change :)

It is indeed and I have done it, but the next step will be an option like
toDontBlendIfTreeIsUnfocusedRegardlessOftoUseBlendedImages. Btw: in WinXP I
found that TListview has
an update "bug". Sometimes (when switching focus) the icons are not invalidated.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: advanced demo application

From: Werner Lehmann [wl@b...]
Date: Thu Nov 1, 2001 3:53 pm
Subject: Re: [VirtualTreeview] advanced demo application

Hi Mike,

> It is not the screen resolution but the font size which produces the problem.
Have you ever been
> able to design a Delphi application successfully which runs properly on any
font size? Me not, and I
> doubt it is possible. The effort is tremendous because every element in the
application has to
> resize automatically, which makes designing a form in the IDE a joke (because
the layout is not
> preserved). The other option would be to leave enough space in the first
place to allow proper
> expansion, but then the app. looks terrible at small font sizes.

A severe problem, nevertheless. According to Peter Below the problem does
not occur when you design all your stuff in large fonts. But seriously,
who wants to do that? For my personal stuff I include a font size check in
the start up code. But this is not acceptable for commercial applications.
How do you handle this at your company?

Werner

 | Replies | Author | Date
4381 | Re: advanced demo application | Mike Lischke | Thu 11/1/2001
4384 | Re: advanced demo application Large Fonts | [sales@d...] | Thu 11/1/2001


re: advanced demo application

From: [molzahn@m...]
Date: Thu Nov 1, 2001 4:31 pm
Subject: Re: advanced demo application

Hi Mike

<< It is not the screen resolution but the font size which produces
the problem. Have you ever been able to design a Delphi application
successfully which runs properly on any font size? >>

Although it might not be 100% possible for each and every system
setting in the world, there are still several ways to tackle the
small font/large font issue. If you like, have a look at my web
site "The Delphi Pool" at

http://www.lmc-mediaagentur.de/dpool.htm

Under Delphi -> Tips & Tricks -> User Interface -> Screen Design
there are a couple of possible approaches listed.

<<Me not, and I doubt it is possible. The effort is tremendous ... >>

Well, there are at least two commercial programs, I'm working with,
that display correctly under both small and large fonts and also
under all screen resolutions: Adobe Photoshop 6.01 and MS Word2000.

Have a good day
Uwe

 | Replies | Author | Date
4383 | Re: advanced demo application | Mike Lischke | Thu 11/1/2001
4449 | Re: advanced demo application | [molzahn@m...] | Sat 11/3/2001


re: advanced demo application

From: "Mike Lischke" [lists@l...]
Date: Thu Nov 1, 2001 4:49 pm
Subject: RE: [VirtualTreeview] advanced demo application

> But this is not acceptable for commercial applications.
> How do you handle this at your company?

We force people to use the same font size at which we designed the application
by simply disabling
the automatic scaling mechanism in the VCL. All our layouts would brake
terribly with changing font
sizes. They depend on pixels in their alignment.

Before anybody complains: I don't like this but I have no idea of a better
solution. Layout
customization (and UI in general) is the most expensive part in most
application development today.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


Dragging Columns? (Version 2.6.0)

From: "Tom Hahn" [thahn@h...]
Date: Thu Nov 1, 2001 5:04 pm
Subject: Dragging Columns? (Version 2.6.0)

I have two questions about dragging (re-arranging) columns:

1. I wish to make Column 0 unmovable and always in the 0 position. I have
tried the following:

a. Checking for Column 0 in the OnHeaderDragging event and setting Allowed
= false

b. Removing "coMovable" from the Options for Column 0

Neither approach seesm to work. What am I missing?

2. I wish to know when a column is moved and dropped (its old number and its
new number). I can't seem to find the correct event to recognize this.

TIA for any help you can provide.

Tom

---------------------------------
Thomas Hahn
Hahn Technology, Inc.
mailto:[thahn@h...]
http://www.hahntech.com
---------------------------------
The home of:
Scan: Hardware/Software Inventory
WebBank: URL/Password Manager
---------------------------------

 | Replies | Author | Date
4390 | Re: Dragging Columns? (Version 2.6.0) | Werner Lehmann | Thu 11/1/2001
4392 | Re: Dragging Columns? (Version 2.6.0) | Tom Hahn | Fri 11/2/2001
4415 | Re: Dragging Columns? (Version 2.6.0) | Mike Lischke | Fri 11/2/2001
4427 | Re: Dragging Columns? (Version 2.6.0) | Mike Lischke | Sat 11/3/2001
4412 | Re: Dragging Columns? (Version 2.6.0) | Mike Lischke | Fri 11/2/2001
4432 | Re: Dragging Columns? (Version 2.6.0) | Werner Lehmann | Sat 11/3/2001


re: Re: advanced demo application

From: "Mike Lischke" [lists@l...]
Date: Thu Nov 1, 2001 5:54 pm
Subject: RE: [VirtualTreeview] Re: advanced demo application

Hi Uwe,

> site "The Delphi Pool" at
> http://www.lmc-mediaagentur.de/dpool.htm
> Under Delphi -> Tips & Tricks -> User Interface -> Screen Design
> there are a couple of possible approaches listed.

Thank you, I will have a look.

> Well, there are at least two commercial programs, I'm working with,
> that display correctly under both small and large fonts and also
> under all screen resolutions: Adobe Photoshop 6.01 and MS Word2000.

At which price? Photoshop uses extremly much space in the options dialog and
many filters. And even
so some labels are cut off (e.g. "Voreinstellungen | Allgemeine
Einstellungen"). But the palette
windows and the layer settings completely ignore the font/dpi settings. This is
not an accusation
but an expression of how difficult this entire stuff is.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net

 | Replies | Author | Date
4449 | Re: advanced demo application | [molzahn@m...] | Sat 11/3/2001


re: advanced demo application Large Fonts

From: [sales@d...]
Date: Thu Nov 1, 2001 6:53 pm
Subject: Re: advanced demo application Large Fonts

--- In [VirtualTreeview@y...], Werner Lehmann [wl@b...] wrote:
> Hi Mike,
>
> > It is not the screen resolution but the font size which produces
the problem. Have you ever been
> > able to design a Delphi application successfully which runs
properly on any font size? Me not, and I
> > doubt it is possible. The effort is tremendous because every
element in the application has to
> > resize automatically, which makes designing a form in the IDE a
joke (because the layout is not
> > preserved). The other option would be to leave enough space in
the first place to allow proper
> > expansion, but then the app. looks terrible at small font sizes.
>
> A severe problem, nevertheless. According to Peter Below the
problem does
> not occur when you design all your stuff in large fonts. But
seriously,
> who wants to do that? For my personal stuff I include a font size
check in
> the start up code. But this is not acceptable for commercial
applications.
> How do you handle this at your company?
>
> Werner

We have solved this by
1. Making sure the scaled property on each Form/Dialog is true
2. Using a TrueType Font as the Font (Arial).
Forms/ Dialogs/ Buttons etc will then be automatically scaled.
This is a big problem for HiRes notebooks which need to run large
fonts.
I have used VT in one of these projects and VT scales OK.
You need to set both Main font and Header font to TrueType.
John


re: VT 2.6.0 and BCB new Errors

From: [rhymebusta@h...]
Date: Thu Nov 1, 2001 7:34 pm
Subject: Re: VT 2.6.0 and BCB new Errors

--- In [VirtualTreeview@y...], "Mike Lischke" [lists@l...] wrote:
> > there's one consistent error that the compiler spits out:
>
> Search the messages in the archive. We had this problem about a
year ago and I thought it is already
> fixed for a long time by taking in
>
> {$HPPEMIT '#include <objidl.h>'}
>
> into VirtualTrees.pas and moving around some stuff.
>
> Ciao, Mike
> --
what do u mean "by taking in
>
> {$HPPEMIT '#include <objidl.h>'}
>
> into VirtualTrees.pas and moving around some stuff."

where would i put that?

 | Replies | Author | Date
4387 | Re: VT 2.6.0 and BCB new Errors | Mike Lischke | Thu 11/1/2001


VT installation in BCB

From: [rhymebusta@h...]
Date: Thu Nov 1, 2001 8:45 pm
Subject: VT installation in BCB

Hi
i was wondering if anyone can point me to the correct instructions of
installing the VT v2.0-2.6 in BCB. i keep getting the error:
"[C++ Error] VirtualTrees.hpp(523): E2076 Overloadable operator
expected"
but can't find the methods to fix it.....i know that it was solved
some time ago by moving some code around in the VirtualTrees.pas file.
All i want to know is if anyone knows what code needs to be moved
around or if they can point me to the messages where it was discussed.
I already tried looking through the archive but no luck.

 | Replies | Author | Date
4391 | Re: VT installation in BCB | Mike Lischke | Thu 11/1/2001


re: Re: VT 2.6.0 and BCB new Errors

From: "Mike Lischke" [lists@l...]
Date: Thu Nov 1, 2001 9:01 pm
Subject: RE: [VirtualTreeview] Re: VT 2.6.0 and BCB new Errors

--
> what do u mean "by taking in
> >
> > {$HPPEMIT '#include <objidl.h>'}
> >
> > into VirtualTrees.pas and moving around some stuff."
>
> where would i put that?

This line is placed into the Delphi source file to emit a

#include <objidl.h>

line into the resulting C file. It was said that this solves the error you
mentioned. Another way
was to delete the three lines. This will not have any impact on the work of VT.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: Blended node icon

From: Werner Lehmann [wl@b...]
Date: Thu Nov 1, 2001 8:23 pm
Subject: Re: [VirtualTreeview] Blended node icon

Mike Lischke wrote:
>
> > I just wanted to bug you once more with this :) I have just now dis-
> > covered that Explorer does not draw the icon blended if the listview
> > is unfocused. The icon is only blended if the tree has focus... What
> > about this? Should be a very minor change :)
>
> It is indeed and I have done it, but the next step will be an option like
> toDontBlendIfTreeIsUnfocusedRegardlessOftoUseBlendedImages. Btw: in WinXP I
found that TListview has
> an update "bug". Sometimes (when switching focus) the icons are not
invalidated.

Sorry for being so pestering. I simply felt that this detail wasn't quite right.

Werner

 | Replies | Author | Date
4413 | Re: Blended node icon | Mike Lischke | Fri 11/2/2001


re: advanced demo application

From: Werner Lehmann [wl@b...]
Date: Thu Nov 1, 2001 8:26 pm
Subject: Re: [VirtualTreeview] advanced demo application

Mike Lischke wrote:
>
> > But this is not acceptable for commercial applications.
> > How do you handle this at your company?
>
> We force people to use the same font size at which we designed the
application by simply disabling
> the automatic scaling mechanism in the VCL. All our layouts would brake
terribly with changing font
> sizes. They depend on pixels in their alignment.

That is you set all Scaled properties on forms and frames to false? I believe
we tried that
without too much success.

> Before anybody complains: I don't like this but I have no idea of a better
solution. Layout
> customization (and UI in general) is the most expensive part in most
application development today.

And Delphi makes it a lot easier. I had to work with GTK+ for my thesis and the
simplest
Delphi tasks took much much more time... when they were possible at all.

Werner

 | Replies | Author | Date
4414 | Re: advanced demo application | Mike Lischke | Fri 11/2/2001


re: Dragging Columns? (Version 2.6.0)

From: Werner Lehmann [wl@b...]
Date: Thu Nov 1, 2001 9:02 pm
Subject: Re: [VirtualTreeview] Dragging Columns? (Version 2.6.0)

Hi Tom,

> I have two questions about dragging (re-arranging) columns:
>
> 1. I wish to make Column 0 unmovable and always in the 0 position. I have
> tried the following:
>
> a. Checking for Column 0 in the OnHeaderDragging event and setting Allowed
> = false
>
> b. Removing "coMovable" from the Options for Column 0
>
> Neither approach seesm to work. What am I missing?

a. works for me. b. does not. The latter looks like a bug to me, it seems
as if coMovable would not be used when it should, namely before tsDragPending
is set. Or at least where OnHeaderDragging is fired.

But even with a working a.-solution one problem remains. You cannot drag that
column but you can drag other columns to the left of it. Don't know if this
can be prevented... this is one for Mike, I suppose.

> 2. I wish to know when a column is moved and dropped (its old number and its
> new number). I can't seem to find the correct event to recognize this.

I can understand that trouble. OnHeaderDragged provides the column ID where
the dragged column was dropped on. To know which column has been dragged you
would have to store that ID in OnHeaderDragging in a private field. BTW, you
may find the Position property of a VTColumn useful.

Mike, if a column is dragged there are no dropmarks drawn on itself (which is
correct). But shouldn't there also be no dropmarks on the right side of the
left neighbour column and to left side of the right neighbour column? A drop
makes no sense here. If you still drop that column here there is no visual
difference but OnHeaderDragged is fired with the column ID of the target column.

Also, coMovable does not seem to work, or at least if coMovable is removed that
column can still be dragged. And finally, the principle to work with column IDs
instead of column positions is still good. But an event parameter 'Column:
Integer'
does not communicate this fact good enough. It may be too late but what about
an extra type like this:

type
TVTColumnID = type Cardinal; // maybe only = Integer or = type Integer

TVTHeaderNotifyEvent = procedure(Sender: TVTHeader; Column: TVTColumnID) of
object;
TVTHeaderDraggingEvent = procedure(Sender: TVTHeader; Column: TVTColumnID;
var Allowed: Boolean) of object;

This would avoid confusion about position / index and column ID.

Regards,
Werner

 | Replies | Author | Date
4392 | Re: Dragging Columns? (Version 2.6.0) | Tom Hahn | Fri 11/2/2001
4415 | Re: Dragging Columns? (Version 2.6.0) | Mike Lischke | Fri 11/2/2001
4427 | Re: Dragging Columns? (Version 2.6.0) | Mike Lischke | Sat 11/3/2001


re: VT installation in BCB

From: "Mike Lischke" [lists@l...]
Date: Thu Nov 1, 2001 9:10 pm
Subject: RE: [VirtualTreeview] VT installation in BCB

> All i want to know is if anyone knows what code needs to be moved
> around or if they can point me to the messages where it was discussed.
> I already tried looking through the archive but no luck.

Search the archive, there is a full text search ability. See, for instance,
following messages (it
wasn't a whole year ago, but only 6 months):

#1324 (and following thread)
#1718 (and thread) etc.

Search for "IDropTarget" and you will find several messages.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: Dragging Columns? (Version 2.6.0)

From: "Tom Hahn" [thahn@h...]
Date: Fri Nov 2, 2001 4:49 am
Subject: RE: [VirtualTreeview] Dragging Columns? (Version 2.6.0)

Hi Werner

> > 1. I wish to make Column 0 unmovable and always in the 0
> position. I have
> > tried the following:
> >
> > a. Checking for Column 0 in the OnHeaderDragging event and
> setting Allowed
> > = false
> >
> > b. Removing "coMovable" from the Options for Column 0
> >
> > Neither approach seesm to work. What am I missing?
>
> a. works for me. b. does not. The latter looks like a bug to
> me, it seems
> as if coMovable would not be used when it should, namely before
> tsDragPending
> is set. Or at least where OnHeaderDragging is fired.
>
> But even with a working a.-solution one problem remains. You
> cannot drag that
> column but you can drag other columns to the left of it. Don't
> know if this
> can be prevented... this is one for Mike, I suppose.

I discovered that you could drag a column to the left (using method a.) over
the 'immovable" column and thereby move the column that was not supposed to
move. I also discovered that if you click on the column, drag down and to
the right (instead of horizontally) you can also move the column. I'm not
sure that I understand what is happening in this case.

As you noted, coMovable seems to have no effect (at least in this case.)

Tom


Traversing a Vritual String Tree

From: [ranganathdindu@h...]
Date: Fri Nov 2, 2001 9:05 am
Subject: Traversing a Vritual String Tree

Dear All,
I am a new user of Virtual String Tree. I have Virtual String tree
displayed. Now I want to traverse through all the nodes of the
tree.So Can anyone please help me.
Thanks in advance.

Regards,
Ranganath.D

 | Replies | Author | Date
4394 | Re: Traversing a Vritual String Tree | Bender Heri | Fri 11/2/2001
4395 | Re: Traversing a Vritual String Tree | GIANNAKOPOULOS KOSTAS | Fri 11/2/2001


re: Traversing a Vritual String Tree

From: Bender Heri [HBender@E...]
Date: Fri Nov 2, 2001 9:20 am
Subject: RE: [VirtualTreeview] Traversing a Vritual String Tree

If you do not modify the structur of the tree during the traversation you
can use the method IterateSubTree which will call a callback function for
each found node. In this callback you can decide if the iteration should go
on or stop.

If you want delete nodes during the iteration you must implement this by
yourself.

Heri

> -----Original Message-----
> From: [ranganathdindu@h...] [mailto:[ranganathdindu@h...]]
> Sent: Friday, November 02, 2001 10:05 AM
> To: VirtualTreeview@yahoogroups.com
> Subject: [VirtualTreeview] Traversing a Vritual String Tree
>
>
> Dear All,
> I am a new user of Virtual String Tree. I have Virtual String tree
> displayed. Now I want to traverse through all the nodes of the
> tree.So Can anyone please help me.
> Thanks in advance.
>
> Regards,
> Ranganath.D
>
>
> ------------------------ Yahoo! Groups Sponsor
> ---------------------~-->
> Clever Cam is a pen sized digital camera, webcam, and
> mini-camcorder. Just $79.95 at Youcansave.com.
> http://us.click.yahoo.com/F11sED/NkNDAA/ySSFAA/i7folB/TM
> --------------------------------------------------------------
> -------~->
>
> To unsubscribe from this group, send an email to:
> VirtualTreeview-unsubscribe@egroups.com
>
>
>
> Your use of Yahoo! Groups is subject to
> http://docs.yahoo.com/info/terms/
>
>


re: Traversing a Vritual String Tree

From: GIANNAKOPOULOS KOSTAS [kyan@s...]
Date: Fri Nov 2, 2001 9:11 am
Subject: RE: [VirtualTreeview] Traversing a Vritual String Tree

Look at method IterateSubTree.

> -----Original Message-----
> From: [ranganathdindu@h...] [mailto:[ranganathdindu@h...]]
> Sent: Friday, November 02, 2001 11:05 AM
> To: VirtualTreeview@yahoogroups.com
> Subject: [VirtualTreeview] Traversing a Vritual String Tree
>
>
> Dear All,
> I am a new user of Virtual String Tree. I have Virtual String tree
> displayed. Now I want to traverse through all the nodes of the
> tree.So Can anyone please help me.
> Thanks in advance.
>
> Regards,
> Ranganath.D
>
>
> ------------------------ Yahoo! Groups Sponsor
> ---------------------~-->
> Clever Cam is a pen sized digital camera, webcam, and
> mini-camcorder. Just $79.95 at Youcansave.com.
> http://us.click.yahoo.com/F11sED/NkNDAA/ySSFAA/i7folB/TM
> --------------------------------------------------------------
> -------~->
>
> To unsubscribe from this group, send an email to:
> VirtualTreeview-unsubscribe@egroups.com
>
>
>
> Your use of Yahoo! Groups is subject to
> http://docs.yahoo.com/info/terms/
>
>


Re[2]: problem installing VT

From: Yur Ovchinnikov [Yur@s...]
Date: Fri Nov 2, 2001 9:13 am
Subject: Re[2]: [VirtualTreeview] problem installing VT

Hello Jim,

Thursday, November 01, 2001, 3:51:02 PM, you wrote:

JK> At 02:04 PM 11/1/2001 +0100, you wrote:
>>Hi,
>>
>>I just downloaded VirtualTreeview.zip, but cannot find the
>>VirtualTreesD5.dpk.

If you used pkunzip utility without supporting long file names.. then try
using any archiver with long file names support.

--
Best regards,
Yur Ovchinnikov E-mail: [yur@s...]
JSC Summit WWW: http://alone.come.to
ICQ: 1400397


Unicode display in vtree?

From: [skanade@v...]
Date: Fri Nov 2, 2001 11:19 am
Subject: Unicode display in vtree?

Mike,

I hope with all your unicode knowledge you help me with this:)

I have never used unicode before. When I learnt that Virtual Treeview
can display unicode, I was thrilled. I installed cyrillic font on a
win2k machine and created a folder in some russian characters. It
displays fine in Windows Explorer.

Now, I wrote a program that calls FindFirstFileW/NextW in win32 to
get the folders and display them in Virtual Tree View. I used
widestrings everywhere. However, VT is not able to display that
folder name. It shows all characters as rectangle black boxes. What
can be wrong? Is there some property I need to set?

Thanks,
Sanjay

 | Replies | Author | Date
4398 | Re: Unicode display in vtree? | Helge Jung (ECO-Logic) | Fri 11/2/2001
4400 | Re: Unicode display in vtree? | [skanade@v...] | Fri 11/2/2001
4402 | Re: Unicode display in vtree? | Franz-Leo Chomse | Fri 11/2/2001
4410 | Re: Unicode display in vtree? | [skanade@v...] | Fri 11/2/2001
4411 | Re: Unicode display in vtree? | Franz-Leo Chomse | Fri 11/2/2001
4417 | Re: Unicode display in vtree? | Franz-Leo Chomse | Fri 11/2/2001
4419 | Re: Unicode display in vtree? | Mike Lischke | Fri 11/2/2001
4399 | Re: Unicode display in vtree? | Jim Kueneman | Fri 11/2/2001
4408 | Re: Unicode display in vtree? | [skanade@v...] | Fri 11/2/2001


re: Unicode display in vtree?

From: "Helge Jung \(ECO-Logic\)" [helge@e...]
Date: Fri Nov 2, 2001 11:50 am
Subject: Re: [VirtualTreeview] Unicode display in vtree?

> Now, I wrote a program that calls FindFirstFileW/NextW in win32 to
> get the folders and display them in Virtual Tree View. I used
> widestrings everywhere. However, VT is not able to display that
> folder name. It shows all characters as rectangle black boxes. What
> can be wrong? Is there some property I need to set?
>

Just a thought (I don't know using Unicode): Maybe you've to take an
Unicode-aware font?

Helge.

 | Replies | Author | Date
4400 | Re: Unicode display in vtree? | [skanade@v...] | Fri 11/2/2001
4402 | Re: Unicode display in vtree? | Franz-Leo Chomse | Fri 11/2/2001
4410 | Re: Unicode display in vtree? | [skanade@v...] | Fri 11/2/2001
4411 | Re: Unicode display in vtree? | Franz-Leo Chomse | Fri 11/2/2001
4417 | Re: Unicode display in vtree? | Franz-Leo Chomse | Fri 11/2/2001
4419 | Re: Unicode display in vtree? | Mike Lischke | Fri 11/2/2001


re: Unicode display in vtree?

From: Jim Kueneman [jimdk@m...]
Date: Fri Nov 2, 2001 1:48 pm
Subject: Re: [VirtualTreeview] Unicode display in vtree?

>I have never used unicode before. When I learnt that Virtual Treeview
>can display unicode, I was thrilled. I installed cyrillic font on a
>win2k machine and created a folder in some russian characters. It
>displays fine in Windows Explorer.

I bet Helge's suggestion is what is wrong use Lucida Sans Unicode
font. Also don't forget about VirtualExplorerTree, all this work is done
for you <g>:

http://groups.yahoo.com/group/VirtualExplorerTree

Jim

 | Replies | Author | Date
4408 | Re: Unicode display in vtree? | [skanade@v...] | Fri 11/2/2001
4416 | Re: Unicode display in vtree? | Jim Kueneman | Fri 11/2/2001


re: Unicode display in vtree?

From: [skanade@v...]
Date: Fri Nov 2, 2001 2:01 pm
Subject: Re: Unicode display in vtree?

--- In [VirtualTreeview@y...], "Helge Jung \(ECO-Logic\)" [helge@e...]
wrote:
> > Now, I wrote a program that calls FindFirstFileW/NextW in win32 to
> > get the folders and display them in Virtual Tree View. I used
> > widestrings everywhere. However, VT is not able to display that
> > folder name. It shows all characters as rectangle black boxes.
What
> > can be wrong? Is there some property I need to set?
> >
>
> Just a thought (I don't know using Unicode): Maybe you've to take an
> Unicode-aware font?
>
> Helge.

I never thought of that. Thanks. I will try that tomorrow when I get
to that machine.

But, how do I know if that font exists on the user's system? Perhaps,
someone can give me a generic unicode font name to use that comes
with Windows, and is sure to exist on Windows 2000 (and NT) systems.

Sanjay

 | Replies | Author | Date
4402 | Re: Unicode display in vtree? | Franz-Leo Chomse | Fri 11/2/2001
4410 | Re: Unicode display in vtree? | [skanade@v...] | Fri 11/2/2001
4411 | Re: Unicode display in vtree? | Franz-Leo Chomse | Fri 11/2/2001
4417 | Re: Unicode display in vtree? | Franz-Leo Chomse | Fri 11/2/2001
4419 | Re: Unicode display in vtree? | Mike Lischke | Fri 11/2/2001


Kylix

From: "[M@r...]" [marms@m...]
Date: Fri Nov 2, 2001 2:08 pm
Subject: Kylix

Hi,

Has someone using or trying to use VT under kylix, do you think it's
easy to port or not at all ?

Regards,
Sébastien Hordeaux
--
PHPEdit Project
http://www.phpedit.com/

 | Replies | Author | Date
4405 | Re: Kylix | Helge Jung (ECO-Logic) | Fri 11/2/2001


re: Re: Unicode display in vtree?

From: Franz-Leo Chomse [chomse@c...]
Date: Fri Nov 2, 2001 2:21 pm
Subject: Re: [VirtualTreeview] Re: Unicode display in vtree?

>But, how do I know if that font exists on the user's system? Perhaps,
>someone can give me a generic unicode font name to use that comes
>with Windows, and is sure to exist on Windows 2000 (and NT) systems.

The only font usable is Arial Unicode MS, since it contains glyphs
for all used UNICODE points, but it is part of the Office package
and has a size of more than 20 Megabyte. Compare this size with the
200 Kilobyte of a normal font, you see that they lack a lot of characters.

Regards from Germany

Franz-Leo

 | Replies | Author | Date
4410 | Re: Unicode display in vtree? | [skanade@v...] | Fri 11/2/2001
4411 | Re: Unicode display in vtree? | Franz-Leo Chomse | Fri 11/2/2001
4417 | Re: Unicode display in vtree? | Franz-Leo Chomse | Fri 11/2/2001


re: Re: Unicode display in vtree?

From: Vandrovec Milan [milan_va@s...]
Date: Fri Nov 2, 2001 2:33 pm
Subject: RE: [VirtualTreeview] Re: Unicode display in vtree?

Hi.

> But, how do I know if that font exists on the user's system? Perhaps,
> someone can give me a generic unicode font name to use that comes
> with Windows, and is sure to exist on Windows 2000 (and NT) systems.

I use Tahoma, it looks quite good and is always there. Other choices are
Arial, Lucida Sans and Lucida Sans Unicode, but these fonts are quite
different from standard MS Sans Serif. Haven't tested them on WinNT though
(only 98 and 2000).
It Tahoma supports Russian and Greek characters on my Czech (East Europe)
Windows 98, and even Chinese on Czech Win 2000. Arabian not found anywhere.
Arial the same.

Milan Vandrovec


re: Kylix

From: Werner Lehmann [wl@b...]
Date: Fri Nov 2, 2001 2:46 pm
Subject: Re: [VirtualTreeview] Kylix

"[M@r...]" wrote:
>
> Has someone using or trying to use VT under kylix, do you think it's
> easy to port or not at all ?

Currently no Kylix version available. And don't hold your breath...
VT relies on many Windows specific things.

Werner


re: Kylix

From: "Helge Jung \(ECO-Logic\)" [helge@e...]
Date: Fri Nov 2, 2001 2:46 pm
Subject: Re: [VirtualTreeview] Kylix

> Has someone using or trying to use VT under kylix, do you think it's
> easy to port or not at all ?

I doubt it's possible (without hard work). You would lose the OLE
drag'n'drop, for example. In VT there are many routines tuned for Win32 -
and all these routines would have to be rewritten from scratch ... if you
want to do that: Mike would be happy ;-)

But anyway: it's a good idea (I'd love to have VT under Linux, too)!

Helge.


re: Kylix

From: Vandrovec Milan [milan_va@s...]
Date: Fri Nov 2, 2001 3:04 pm
Subject: RE: [VirtualTreeview] Kylix

Hello.

> But anyway: it's a good idea (I'd love to have VT under Linux, too)!

There was a discussion about it when somebody wanted to remove the Drag&Drop
completely to decrease the output-exe size, and Mike said it would be too
hard to split it into two classes or add conditional compilation. I believe
rewriting it would be even harder.

Milan Vandrovec


[no subject]

From: ìÏÇ×ÉÎÅÎËÏ àÒÉÊ [logvinenko@i...]
Date: Fri Nov 2, 2001 2:16 pm
Subject:

äÏÂÒÙÊ ÄÅÎØ

ìÏÇ×ÉÎÅÎËÏ àÒÉÊ

 | Replies | Author | Date
4409 | Re: | Mike Lischke | Fri 11/2/2001


re: Unicode display in vtree?

From: [skanade@v...]
Date: Fri Nov 2, 2001 5:07 pm
Subject: Re: Unicode display in vtree?

--- In [VirtualTreeview@y...], Jim Kueneman [jimdk@m...] wrote:
>
> >I have never used unicode before. When I learnt that Virtual
Treeview
> >can display unicode, I was thrilled. I installed cyrillic font on a
> >win2k machine and created a folder in some russian characters. It
> >displays fine in Windows Explorer.
>
> I bet Helge's suggestion is what is wrong use Lucida Sans Unicode
> font. Also don't forget about VirtualExplorerTree, all this work
is done
> for you <g>:
>
> http://groups.yahoo.com/group/VirtualExplorerTree
>
> Jim

Last time I checked that group, I couldn't easily locate the download
file that contains the component. I will check again.

Thanks,
Sanjay

 | Replies | Author | Date
4416 | Re: Unicode display in vtree? | Jim Kueneman | Fri 11/2/2001


re: [VirtualTreeview]

From: "Mike Lischke" [lists@l...]
Date: Fri Nov 2, 2001 5:16 pm
Subject: RE: [VirtualTreeview]

> äÏÂÒÙÊ ÄÅÎØ
> ìÏÇ×ÉÎÅÎËÏ àÒÉÊ

Guten Tag Juri, was ist dein Begehr? ;-)

Ciao, Mike


re: Unicode display in vtree?

From: [skanade@v...]
Date: Fri Nov 2, 2001 5:25 pm
Subject: Re: Unicode display in vtree?

--- In [VirtualTreeview@y...], Franz-Leo Chomse [chomse@c...] wrote:
>
> >But, how do I know if that font exists on the user's system?
Perhaps,
> >someone can give me a generic unicode font name to use that comes
> >with Windows, and is sure to exist on Windows 2000 (and NT)
systems.
>
> The only font usable is Arial Unicode MS, since it contains glyphs
> for all used UNICODE points, but it is part of the Office package
> and has a size of more than 20 Megabyte. Compare this size with the
> 200 Kilobyte of a normal font, you see that they lack a lot of
characters.
>

In Delphi code, how do I know if the font exists? I guess I set it
as the font for tree view and then check back the font name
to see if it has been set? Or, is there a better way.

Thanks,
Sanjay

 | Replies | Author | Date
4411 | Re: Unicode display in vtree? | Franz-Leo Chomse | Fri 11/2/2001
4417 | Re: Unicode display in vtree? | Franz-Leo Chomse | Fri 11/2/2001


re: Re: Unicode display in vtree?

From: Franz-Leo Chomse [chomse@c...]
Date: Fri Nov 2, 2001 6:02 pm
Subject: Re: [VirtualTreeview] Re: Unicode display in vtree?

>In Delphi code, how do I know if the font exists? I guess I set it
>as the font for tree view and then check back the font name
>to see if it has been set? Or, is there a better way.

The file name is ARIALUNI.TTF and it must reside in the font directory.

The normal Arial font for NT, W2K and XP also does support UNICODE but
contains only the codepoints of the single byte codepages.

Regards from Germany

Franz-Leo.


re: Dragging Columns? (Version 2.6.0)

From: "Mike Lischke" [lists@l...]
Date: Fri Nov 2, 2001 6:58 pm
Subject: RE: [VirtualTreeview] Dragging Columns? (Version 2.6.0)

Hi Tom,

> 1. I wish to make Column 0 unmovable and always in the 0 position. I have
> tried the following:
> Neither approach seesm to work. What am I missing?

You have also to remove the coAllowClick flag. There is already a suggestion to
make this and the
coMovable flag more independent but at the time being it is necessary to switch
both off.

> 2. I wish to know when a column is moved and dropped (its old number and its
> new number). I can't seem to find the correct event to recognize this.

You can use OnHeaderDragged to get notified when a header drag operation is
finished. However, the
event does currently not carry the old and new positions. Since this is a true
limitation which
makes this event almost useless I have changed it so that the column index and
its old position are
now passed. The new position can be determined using the column index and the
columns Position
property.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: Blended node icon

From: "Mike Lischke" [lists@l...]
Date: Fri Nov 2, 2001 7:04 pm
Subject: RE: [VirtualTreeview] Blended node icon

Hi Werner,

> TListview has
> > an update "bug". Sometimes (when switching focus) the icons are not
invalidated.
>
> Sorry for being so pestering. I simply felt that this detail wasn't quite
right.

I can send you a screen shot if you don't believe me. Try this:

- open an Explore window and select something in the right pane (listview), the
icon will get
blended too
- open another window (not necessarily an Explorer window) and place it so
above the first one that
the selected icon is partially hidden, in this process the icon should be
display unblended because
the Explorer window lost the focus
- now switch back to the first window (alt-tab or caption click)
- you will see now the formerly hidden part of the icon blended and the other
half unblended

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: advanced demo application

From: "Mike Lischke" [lists@l...]
Date: Fri Nov 2, 2001 7:08 pm
Subject: RE: [VirtualTreeview] advanced demo application

> That is you set all Scaled properties on forms and frames to false? I believe
we tried that
> without too much success.

No, no, this would be much to much work (and you will likely forget a form).
Since there are still
fixes and correction needed in the VCL (even for Delphi 6) we have modified
Graphics.pas
(InitScreenLogPixels) and used a fixed ScreenLogPixel value of 96. This way any
scaling is
effectively disabled.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: Dragging Columns? (Version 2.6.0)

From: "Mike Lischke" [lists@l...]
Date: Fri Nov 2, 2001 7:17 pm
Subject: RE: [VirtualTreeview] Dragging Columns? (Version 2.6.0)

> But even with a working a.-solution one problem remains. You cannot drag that
> column but you can drag other columns to the left of it. Don't know if this
> can be prevented... this is one for Mike, I suppose.

Well, depends on the semantic. coMovable is meant for the direct movement of
the column. If another
column is dropped on it then not the target moves but the source column. Except
for the just moved
column the target keeps its position relative to all other columns.

> I can understand that trouble. OnHeaderDragged provides the column ID where
> the dragged column was dropped on. To know which column has been dragged you
> would have to store that ID in OnHeaderDragging in a private field. BTW, you
> may find the Position property of a VTColumn useful.

This is hopefully no issue anymore.

> Mike, if a column is dragged there are no dropmarks drawn on itself (which is
> correct). But shouldn't there also be no dropmarks on the right side of the
> left neighbour column and to left side of the right neighbour column?

Yes, sure, you are right, but the result doesn't really justify the effort. We
can keep that in the
wish list for a while...

> Also, coMovable does not seem to work, or at least if coMovable is removed
that
> column can still be dragged.

Again, this is the result of too much dependency on coAllowClick. Have to
resolve this matter...

>And finally, the principle to work with column IDs
> instead of column positions is still good. But an event parameter 'Column:
Integer'
> does not communicate this fact good enough. It may be too late but what about
> an extra type like this:

I think this is not necessary. If not explicitely marked then only column
indices are used, never
positions.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net

 | Replies | Author | Date
4427 | Re: Dragging Columns? (Version 2.6.0) | Mike Lischke | Sat 11/3/2001


re: Re: Unicode display in vtree?

From: Jim Kueneman [jimdk@m...]
Date: Fri Nov 2, 2001 7:25 pm
Subject: Re: [VirtualTreeview] Re: Unicode display in vtree?

>Last time I checked that group, I couldn't easily locate the download
>file that contains the component. I will check again.

Really?

http://groups.yahoo.com/group/VirtualExplorerTree/files/VET_1.6.5.zip

Is just the VET component

http://groups.yahoo.com/group/VirtualExplorerTree/files/VirtualShellTools_0.5a.z\
ip

Is the component and a bunch of other Shell tools

Jim


re: Re: Unicode display in vtree?

From: Franz-Leo Chomse [chomse@c...]
Date: Fri Nov 2, 2001 7:23 pm
Subject: Re: [VirtualTreeview] Re: Unicode display in vtree?

>In Delphi code, how do I know if the font exists? I guess I set it
>as the font for tree view and then check back the font name
>to see if it has been set? Or, is there a better way.

Get the UNICODE viewer from Mike's homepage. With its aid you can
check the UNICODE points supported by the fonts on your system. So
you can build a list of desired fonts and check wether they are
available in the font directory of the current system.

Regards from Germany

Franz-Leo


re: Unicode display in vtree?

From: "Mike Lischke" [lists@l...]
Date: Fri Nov 2, 2001 7:43 pm
Subject: RE: [VirtualTreeview] Unicode display in vtree?

Hi Sanjay,

> I hope with all your unicode knowledge you help me with this:)

Ok, let's do it a little excurse into Unicode :o]

> Now, I wrote a program that calls FindFirstFileW/NextW in win32 to
> get the folders and display them in Virtual Tree View. I used
> widestrings everywhere. However, VT is not able to display that
> folder name. It shows all characters as rectangle black boxes. What
> can be wrong? Is there some property I need to set?

The GDI (actually the font mapper) does already a good job in finding font
replacements if a
particular familiy is not installed. But this still has limits, of course
(certain controls like
TRichEdit do automatic font linking, however, and will replace fonts if they do
not contain the
required glyph). Every true type font (and open type font in W2K+) is Unicode
enabled, even if it
only contains glyphs for the base ANSI characters (called the basic latin
block, which corresponds
to the old 128 characters ASCII code page, see also
http://czyborra.com/charsets/iso646.html).

This means you can (theoretically) use every TT/OT font to display Unicode
characters. But for
various reasons no font in Windows covers every possible glyph defined in
Unicode. The most complete
font I have ever seen (Franz Leo already mentioned it) is Arial Unicode MS,
which contains all
glyphs defined by Unicode standard 2.0 (version 3.1.1 is the latest one). This
font, however, is not
free and if you had already a look at my Unicode page (www.delphi-unicode.net)
then you will see
that I had to add a certain statement to my link to that font.

Anyway, for your russian characters to display correctly you have to assign a
font to VT which
contains cyrillic glyphs. This should however not be very difficult. Many fonts
which are quite
common on Windows contain cyrillic glyphs (Arial, Andale Mono, Batang, Book
Antiqua, Comic Sans MS,
Courier New, Garamond, Impact, to name only a few). For some help picking a
certain font try out my
Unicode Font Viewer which lists all installed fonts on your system and allows
to browse all code
pages (0..64K only, currently) and visit also Alan Wood's Unicode resource page
(Unicode fonts for
Windows computers) at http://www.hclrss.demon.co.uk/unicode/fonts.html.

HTH

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net

 | Replies | Author | Date
4420 | Re: Unicode display in vtree? | Mike Lischke | Fri 11/2/2001


re: Re: Unicode display in vtree?

From: "Mike Lischke" [lists@l...]
Date: Fri Nov 2, 2001 7:51 pm
Subject: RE: [VirtualTreeview] Re: Unicode display in vtree?

> But, how do I know if that font exists on the user's system? Perhaps,
> someone can give me a generic unicode font name to use that comes
> with Windows, and is sure to exist on Windows 2000 (and NT) systems.

Since Windows 95 you can rely on some fonts which are always installed. These
include:

- Arial
- Courier New
- Lucidia Sans Unicode
- Verdana
- Times New Roman u.a.

With the Explorer language update packs you'll get:

- David (contains good arabic glyphs)
- Ming LiU
- MS Gothic (chinese)
- MS Mincho (chinese) u.a.

but you cannot rely on their existance.

Starting with Win2K also Tahoma and Trebuchet MS are part of the installation.
Tahoma is my prefered
font because of its excellent layout and appearance (Trebuchet is the default
font in Windows XP
themes).

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: Unicode display in vtree?

From: "Mike Lischke" [lists@l...]
Date: Fri Nov 2, 2001 7:59 pm
Subject: RE: [VirtualTreeview] Unicode display in vtree?

Oops, corrections:

> to the old 128 characters ASCII code page,

ASCII is not a code page but a character set.

> Unicode Font Viewer which lists all installed fonts on your system and allows
to browse all code
> pages (0..64K only, currently)

not code pages, but code points.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: Blended node icon

From: Werner Lehmann [wl@b...]
Date: Fri Nov 2, 2001 10:50 pm
Subject: Re: [VirtualTreeview] Blended node icon

Hi Mike,

> I can send you a screen shot if you don't believe me. Try this:
>
> - open an Explore window and select something in the right pane (listview),
the icon will get
> blended too
> - open another window (not necessarily an Explorer window) and place it so
above the first one that
> the selected icon is partially hidden, in this process the icon should be
display unblended because
> the Explorer window lost the focus
> - now switch back to the first window (alt-tab or caption click)
> - you will see now the formerly hidden part of the icon blended and the other
half unblended

How nitpicky must one be to find this? :) Having said that I cannot reproduce
it on XP. Either there are more unknown factors or it is a graphic driver
problem
(wouldn't be the first).

Werner

 | Replies | Author | Date
4424 | Re: Blended node icon | Mike Lischke | Sat 11/3/2001


re: advanced demo application

From: Werner Lehmann [wl@b...]
Date: Fri Nov 2, 2001 10:52 pm
Subject: Re: [VirtualTreeview] advanced demo application

Mike Lischke wrote:
>
> > That is you set all Scaled properties on forms and frames to false? I
believe we tried that
> > without too much success.
>
> No, no, this would be much to much work (and you will likely forget a form).
Since there are still
> fixes and correction needed in the VCL (even for Delphi 6) we have modified
Graphics.pas
> (InitScreenLogPixels) and used a fixed ScreenLogPixel value of 96. This way
any scaling is
> effectively disabled.

Hm. Will try that. I suppose that you can take screenshots of your apps on both
large and small fonts with that fix and they are 100% identical? That would be
*almost* perfect. At least no cut-off labels and misplaced scrollbars anymore.

Werner


Master detail Example

From: "Dion" [dion@n...]
Date: Sat Nov 3, 2001 7:34 am
Subject: Master detail Example

Hi All,

Where can I find a Master detail example?
Can I traverse the tree by index as in the VCL version?

Many Thanks,
Dion.

[Non-text portions of this message have been removed]

 | Replies | Author | Date
4425 | Re: Master detail Example | Mike Lischke | Sat 11/3/2001


re: Blended node icon

From: "Mike Lischke" [lists@l...]
Date: Sat Nov 3, 2001 8:47 am
Subject: RE: [VirtualTreeview] Blended node icon

> How nitpicky must one be to find this? :)

I would not have looked for it if you wouldn't have mentioned how they are
blended. I just compared
VT's blending with "official" controls and quickly found the mentioned problem.

>Having said that I cannot reproduce
> it on XP. Either there are more unknown factors or it is a graphic driver
problem

Strange. Well, I can't change it so I ignore it.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: Master detail Example

From: "Mike Lischke" [lists@l...]
Date: Sat Nov 3, 2001 8:56 am
Subject: RE: [VirtualTreeview] Master detail Example

Hi Dion,

> Where can I find a Master detail example?

I'm afraid you won't find any. There are a few examples in the file area of
this mailing list but
they don't use master-detail relations.

> Can I traverse the tree by index as in the VCL version?

No. You can use IterateSubtree or go through the tree by GetFirst and GetNext.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


Rebuilding tree saved to database

From: "Helge Jung \(ECO-Logic\)" [helge@e...]
Date: Sat Nov 3, 2001 10:04 am
Subject: Rebuilding tree saved to database

I have a tree and save it to a database (or another kind of a list). I save
the position data within the database/list (e.g. "0.0.2.1").

Now I want to rebuild the tree from the data in the database/list. I tried
and tried and can only get it working for the first nodes - all other nodes
aren't inserted properly. It must be the fault of my algorithm but maybe
someone uninvolved sees the mistake or has another solution.

I uploaded my test-program to the group - there you'll see what I want to do
(without database but in a array for testing):
http://groups.yahoo.com/group/VirtualTreeview/files/Misc/NodeLevel-Test.zip

Thanks in advance,

Helge.

 | Replies | Author | Date
4435 | Re: Rebuilding tree saved to database | Werner Lehmann | Sat 11/3/2001
4438 | Re: Rebuilding tree saved to database | Helge Jung (ECO-Logic) | Sat 11/3/2001
4446 | Re: Rebuilding tree saved to database | Werner Lehmann | Sat 11/3/2001
4482 | Re: Rebuilding tree saved to database | Helge Jung (ECO-Logic) | Mon 11/5/2001


re: Dragging Columns? (Version 2.6.0)

From: "Mike Lischke" [lists@l...]
Date: Sat Nov 3, 2001 10:55 am
Subject: RE: [VirtualTreeview] Dragging Columns? (Version 2.6.0)

Hi Werner,

> >And finally, the principle to work with column IDs
> > instead of column positions is still good. But an event parameter 'Column:
Integer'
> > does not communicate this fact good enough. It may be too late but what
about
> > an extra type like this:
>
> I think this is not necessary. If not explicitely marked then only column
indices are
> used, never positions.

I finally decided differently. Your idea of creating own types for column
indices and positions
appeared to me as a good idea (after the second look :-)). I have just resolved
a strange paint bug
when columns are reordered and found out that mixing up positions and indices
was the reason. I did
not need more reasons ...

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


New file uploaded to VirtualTreeview

From: [VirtualTreeview@yahoogroups.com>
Date: Sat Nov 3, 2001 11:15 am
Subject: New file uploaded to VirtualTreeview

Hello,

This email message is a notification to let you know that
a file has been uploaded to the Files area of the VirtualTreeview
group.

File : /VirtualTree_2.6.5.zip
Uploaded by : [lists@l...]
Description : Release candidate 2

You can access this file at the URL

http://groups.yahoo.com/group/VirtualTreeview/files/VirtualTree_2.6.5.zip

To learn more about file sharing for your group, please visit

http://help.yahoo.com/help/us/groups/files

Regards,

lists@l...]

 | Replies | Author | Date
4429 | Re: New file uploaded to VirtualTreeview | Mike Lischke | Sat 11/3/2001
4433 | Re[2]: [VirtualTreeview] New file uploaded to Vir | Oleg Kraynov | Sat 11/3/2001
4439 | Re: Re[2]: [VirtualTreeview] New file uploaded to | Mike Lischke | Sat 11/3/2001


re: New file uploaded to VirtualTreeview

From: "Mike Lischke" [lists@l...]
Date: Sat Nov 3, 2001 11:29 am
Subject: RE: [VirtualTreeview] New file uploaded to VirtualTreeview

> This email message is a notification to let you know that
> a file has been uploaded to the Files area of the VirtualTreeview
> group.

New this time is:

- small tree painting rework
- TColumnIndex, TColumnPosition (to utilize better type checking)
- overloaded ColumnFromPosition variant to get a column index from a position
index
- TVTHeaderDraggedEvent, new parameter in OnHeaderDraggedEvent
- scrollbar reset when hiding it
- Ctrl-A now considers selection constraints
- no image blending if the tree is unfocused
- improved VCL drag handling
- method HasPopupMenu
- legacy code for XP painting non-XP system
- bug fixes

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net

 | Replies | Author | Date
4433 | Re[2]: [VirtualTreeview] New file uploaded to Vir | Oleg Kraynov | Sat 11/3/2001
4439 | Re: Re[2]: [VirtualTreeview] New file uploaded to | Mike Lischke | Sat 11/3/2001


Bugs

From: "Mike Lischke" [lists@l...]
Date: Sat Nov 3, 2001 11:31 am
Subject: Bugs

I need a bit more help with open bugs. Actually only one still remains. It's
#74, about header streaming. Jim, can you please give a bit more information
about how the tree was before you loaded the stream and what happend
afterwards? Or make a demo project if you like.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net

 | Replies | Author | Date
4434 | Re: Bugs | Jim Kueneman | Sat 11/3/2001
4655 | Re: Bugs | Mike Lischke | Fri 11/16/2001
4659 | Re: Bugs | Jim Kueneman | Fri 11/16/2001
4684 | Re: Bugs | Mike Lischke | Sun 11/18/2001
4700 | Re: Header Streaming WAS - Bugs | Jim Kueneman | Sun 11/18/2001


Swap nodes

From: [ilan@s...]
Date: Sat Nov 3, 2001 11:37 am
Subject: Swap nodes

I have been going over the help file for over 10 minutes now, but
can't seem to find a function to swap two items in a
VirtualStringTree. I can do it by using the following pseudo code:

tempnode = node1;
node1 = node2
node2 = tempnode;

But this will swap the data and not positions. I need the nodes to
swap position not data, so all pointers will still point towards the
same node after the swap.

Any help would be appreciated.

Ilan

 | Replies | Author | Date
4448 | Re: Swap nodes | Mike Lischke | Sat 11/3/2001
4450 | Re: Swap nodes | [ilan@s...] | Sat 11/3/2001
4451 | Re: Swap nodes | Werner Lehmann | Sun 11/4/2001
4481 | Re: Swap nodes | [ilan@s...] | Mon 11/5/2001


re: Dragging Columns? (Version 2.6.0)

From: Werner Lehmann [wl@b...]
Date: Sat Nov 3, 2001 12:09 pm
Subject: Re: [VirtualTreeview] Dragging Columns? (Version 2.6.0)

Mike Lischke wrote:
>
> I finally decided differently. Your idea of creating own types for column
indices and positions
> appeared to me as a good idea (after the second look :-)). I have just
resolved a strange paint bug
> when columns are reordered and found out that mixing up positions and indices
was the reason. I did
> not need more reasons ...

:)

Werner


Re[2]: New file uploaded to VirtualTreeview

From: Oleg Kraynov [olegvkr@y...]
Date: Sat Nov 3, 2001 1:12 pm
Subject: Re[2]: [VirtualTreeview] New file uploaded to VirtualTreeview

Hi, Mike.

Are absent the functions InitThemeLibrary and FreeThemeLibrary.

--
Best regards,
Oleg

_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com

 | Replies | Author | Date
4439 | Re: Re[2]: [VirtualTreeview] New file uploaded to | Mike Lischke | Sat 11/3/2001


re: Bugs

From: Jim Kueneman [jimdk@m...]
Date: Sat Nov 3, 2001 1:30 pm
Subject: Re: [VirtualTreeview] Bugs

At 12:31 PM 11/3/2001 +0100, you wrote:
>I need a bit more help with open bugs. Actually only one still remains.
>It's #74, about header streaming. Jim, can you please give a bit more
>information about how the tree was before you loaded the stream and what
>happend afterwards? Or make a demo project if you like.

Use VT and the ShellDetails for column headers. Where I see the problem is
on Line 6373 of the VirtualExplorerTree.pas. When you right click the
header to allow the different columns to the shown I save the header to a
stream so if the user changes the columns then hits cancel the old header
is loaded back from the stream. You can see my note in the file.

You can comment out the hoVisible lines and try it or look at the code to
see what I am doing.

Jim

 | Replies | Author | Date
4655 | Re: Bugs | Mike Lischke | Fri 11/16/2001
4659 | Re: Bugs | Jim Kueneman | Fri 11/16/2001
4684 | Re: Bugs | Mike Lischke | Sun 11/18/2001
4700 | Re: Header Streaming WAS - Bugs | Jim Kueneman | Sun 11/18/2001


re: Rebuilding tree saved to database

From: Werner Lehmann [wl@b...]
Date: Sat Nov 3, 2001 1:24 pm
Subject: Re: [VirtualTreeview] Rebuilding tree saved to database

Hi Helge,

> I have a tree and save it to a database (or another kind of a list). I save
> the position data within the database/list (e.g. "0.0.2.1").

I have not looked at your test project (yet, maybe later, I have my own bugs to
fix :). But let me just say that your approach of saving the sibling indices in
a string (this is what it looks like) is not optimal. Accessing it requires
scanning and parsing to say the least. The real problem is that VT's are not
good
at indexed access. And this indexes access can only be avoided with your
approach
if you get all nodes sorted (this includes the requirement that sibling indices
are padded with enough 0's to fit all future needs in order to get a proper sort
order).

IMO it is far better to save the tree recursively. Traverse the tree in a
recursive
manner and store a unique (possibly artificial) key, parent key and child index
with
each node. This allows you to easily read it back in with the same recursive
order.
Unfortunately it requires a hierarchical query functionality on your db server
side
which I have seen only at Oracle, so far. If a hierarchical query is not
available
you would have to use several subqueries (bad) or have to re-build the tree
(read
back from db) in a breadth-first approach because you can only order by parent
key,
child index then. This is the best and most flexible way.

Werner

PS: I have looked shortly at your test project (load routine is pasted below in
case anyone sees something relevant). I can only say it is very inefficient with
all this string handling, pos copy trim strtoint etc. I didn't spot the error
quickly because I would have to analyze first how your method works at all...

procedure TForm1.BitBtn3Click(Sender: TObject);
var
i : integer;
RemainingSNL,
SearchNodeLevel: string;
SearchNode,
NewNode : PVirtualNode;
NodeData : PData;

function FindNodeAtLevel (NodeLevel: string) : PVirtualNode;
begin
//NodeLevel := Copy (Nod
FindNodeLevel := NodeLevel;
Result := VST.IterateSubtree (nil, FindNode, nil, [], true, true);
end;

function FindChildNode (Node: PVirtualNode; NodeLevel: string) : PVirtualNode;
begin
FindNodeLevel := NodeLevel;
Result := VST.IterateSubtree (Node, FindNode, nil, [], true, true);
end;

function RPos (SearchChar: char; SearchStr: string): integer;
var
i : integer;

begin
Result := Length(SearchStr)+1;
for i := Length(SearchStr) downto 1 do
if SearchStr[i] = SearchChar then
begin
Result := i;
Break;
end;
end;

begin
SearchNode := nil;
SearchNodeLevel := '';

for i := 0 to (Length(DataList)-1) do
begin
while Copy (DataList[i].NodeLevel, 1, Length(SearchNodeLevel)) <>
SearchNodeLevel do
begin
SearchNode := SearchNode^.Parent;
SearchNodeLevel := CaptureNodeLevel (VST, SearchNode);
end;
RemainingSNL := Copy (DataList[i].NodeLevel, Length(SearchNodeLevel)+2,
MaxInt);
if Trim(RemainingSNL) <> '' then RemainingSNL := RemainingSNL + '.';
while (Pos('.',RemainingSNL) > 0) and
(VST.ChildCount[SearchNode] >= StrToInt (Copy (RemainingSNL, 1, Pos
('.', RemainingSNL) -1))) do
begin
// Child suchen
SearchNode := FindChildNode (SearchNode, Copy(DataList[i].NodeLevel, 1,
RPos('.', DataList[i].NodeLevel)-1));
RemainingSNL := Copy (RemainingSNL, Pos('.',RemainingSNL)+1, MaxInt);
end;

SearchNodeLevel := CaptureNodeLevel (VST, SearchNode);

NewNode := VST.AddChild (SearchNode);
NodeData := VST.GetNodeData(NewNode);
NodeData^ := DataList[i];
end;
end;

 | Replies | Author | Date
4438 | Re: Rebuilding tree saved to database | Helge Jung (ECO-Logic) | Sat 11/3/2001


re: New file uploaded to VirtualTreeview

From: Werner Lehmann [wl@b...]
Date: Sat Nov 3, 2001 1:57 pm
Subject: Re: [VirtualTreeview] New file uploaded to VirtualTreeview

Hi Mike,

> > This email message is a notification to let you know that
> > a file has been uploaded to the Files area of the VirtualTreeview
> > group.
>
> New this time is:
>
> - small tree painting rework
> - TColumnIndex, TColumnPosition (to utilize better type checking)
> - overloaded ColumnFromPosition variant to get a column index from a position
index
> - TVTHeaderDraggedEvent, new parameter in OnHeaderDraggedEvent
> - scrollbar reset when hiding it
> - Ctrl-A now considers selection constraints
> - no image blending if the tree is unfocused
> - improved VCL drag handling
> - method HasPopupMenu
> - legacy code for XP painting non-XP system
> - bug fixes

You have added InitThemeLibrary and FreeThemeLibrary to JWAuxTheme but did not
include the changed file in the zip.

I noticed that with WinXP in classic mode (not themed!) we get a blended
selection
rectangle if toThemeAware is set. Shouldn't it be the dotted rectangle *if* this
is set in the DrawSelectionMode property? Your code also looks a little bit
ambiguous:

if (FDrawSelectionMode = smDottedRectangle) and not (toThemeAware in
FOptions.PaintOptions) or not MMXAvailable then

At least I had to look up that AND has higher precedence than OR :)

And while I looked for smBlendedRectangle to see why I don't get the dotted
rectangle
in classic mode I noticed this initialization in PaintTree:

if FDrawSelectionMode = smBlendedRectangle then
NodeBitmap.PixelFormat := pf32Bit;

With this conditional the case "Dotted Rectangle in Property, toThemeAware
true, WinXP
themed" will not init the PixelFormat. This may be a problem.

The removed unfocused-not-blending-icon really makes a difference IMO. Although
99%
of all end users will not notice this (along with at least 25% of all the other
GUI work
we do :)

BTW, bug #71: I cannot reproduce this myself with this and the previous version
of VT.
The bug occurred at the company where I have a quite old version (months old!).
I may
reopen that bug if this still happens when I switched versions there and can
create a
test project. SetTopNode has been slightly modified since then but even by
undoing that
change in 2.6.0 I could not reproduce the problem so far.

Werner

 | Replies | Author | Date
4440 | Re: New file uploaded to VirtualTreeview | Mike Lischke | Sat 11/3/2001


Can not compile VirtualTreeView 2.6.5

From: "J. Peter Mugaas" [oma00215@m...]
Date: Sat Nov 3, 2001 2:35 pm
Subject: Can not compile VirtualTreeView 2.6.5

I can not compile VirtualTreeView 2.6.5. I get the following errors:

[Error] VirtualTrees.pas(4322): Undeclared identifier: 'InitThemeLibrary'
[Error] VirtualTrees.pas(4347): Undeclared identifier: 'FreeThemeLibrary'
[Fatal Error] VirtualTreesD6.dpk(36): Could not compile used unit
'VirtualTrees.pas'

-- Support the anti-Spam amendment - Join at http://www.cauce.org/
J. Peter Mugaas E-Mail: [oma00215@m...]
http://wvnvm.wvnet.edu/~oma00215/ ICQ Number: 14297043
Finger for PGP Key


re: Rebuilding tree saved to database

From: "Helge Jung \(ECO-Logic\)" [helge@e...]
Date: Sat Nov 3, 2001 3:08 pm
Subject: Re: [VirtualTreeview] Rebuilding tree saved to database

> IMO it is far better to save the tree recursively. Traverse the
> tree in a recursive manner and store a unique (possibly
> artificial) key, parent key and child index with each node.

I save the tree in the callback of IterateSubtree - I have this "nodelevel"
as an unique id (there can't be two nodes with the same id - in the database
I have also a second field with guarantees that there won't be two
duplicated entrys).

> This allows you to easily read it back in with the same
> recursive order.

I don't understand exactly what you mean - maybe you can give a short
example or try to explain it once again in German?

> PS: I have looked shortly at your test project. I can only say
> it is very inefficient with all this string handling, pos copy
> trim strtoint etc.

I know, I know *g* But it's only a test project and I'm still trying. But
because I couldn't get it to work I thought there will be some VT guru who
knows the solution without even looking at my test-program. But it seems I
always find the cases which are a bit trickier *grr*

But thanks anyway for your time!

Helge.


re: Re[2]: New file uploaded to VirtualTreeview

From: "Mike Lischke" [lists@l...]
Date: Sat Nov 3, 2001 3:54 pm
Subject: RE: Re[2]: [VirtualTreeview] New file uploaded to VirtualTreeview

> Are absent the functions InitThemeLibrary and FreeThemeLibrary.

Oops, sorry. Forgot to update the two theme units too. I will upload a new zip
file in a couple of
minutes.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: New file uploaded to VirtualTreeview

From: "Mike Lischke" [lists@l...]
Date: Sat Nov 3, 2001 4:03 pm
Subject: RE: [VirtualTreeview] New file uploaded to VirtualTreeview

> I noticed that with WinXP in classic mode (not themed!) we get a blended
selection
> rectangle if toThemeAware is set. Shouldn't it be the dotted rectangle *if*
this
> is set in the DrawSelectionMode property? Your code also looks a little bit
> ambiguous:

OK, this is fixed now. I forgot to check if themes are enabled at all.

> And while I looked for smBlendedRectangle to see why I don't get the dotted
rectangle
> in classic mode I noticed this initialization in PaintTree:
>
> if FDrawSelectionMode = smBlendedRectangle then
> NodeBitmap.PixelFormat := pf32Bit;

This is strange, I already have made the pixelformat setting unconditional. Did
you perhaps mix up
sources ? :-)

> BTW, bug #71: I cannot reproduce this myself with this and the previous
version of VT.

OK, so let it closed and reopen only if necessary.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


New file uploaded to VirtualTreeview

From: [VirtualTreeview@yahoogroups.com>
Date: Sat Nov 3, 2001 4:08 pm
Subject: New file uploaded to VirtualTreeview

Hello,

This email message is a notification to let you know that
a file has been uploaded to the Files area of the VirtualTreeview
group.

File : /VirtualTree_2.6.5.zip
Uploaded by : [lists@l...]
Description : Release candidate 2

You can access this file at the URL

http://groups.yahoo.com/group/VirtualTreeview/files/VirtualTree_2.6.5.zip

To learn more about file sharing for your group, please visit

http://help.yahoo.com/help/us/groups/files

Regards,

lists@l...]

 | Replies | Author | Date
4442 | Re: New (second) file uploaded to VirtualTreeview | Mike Lischke | Sat 11/3/2001


re: New (second) file uploaded to VirtualTreeview

From: "Mike Lischke" [lists@l...]
Date: Sat Nov 3, 2001 4:10 pm
Subject: RE: [VirtualTreeview] New (second) file uploaded to VirtualTreeview

> This email message is a notification to let you know that
> a file has been uploaded to the Files area of the VirtualTreeview
> group.

OK, hopefully this time all is complete. I have also uploaded this version to
the beta folder on my
homepage.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


Error about missing file

From: "J. Peter Mugaas" [oma00215@m...]
Date: Sat Nov 3, 2001 4:20 pm
Subject: Error about missing file

I got an error about a missing file.
[Warning] VirtualTreesD6.dpk(3): File not found: 'VirtualTreesD6.res'
[Warning] VirtualTreesD6.dpk(3): File not found: 'VirtualTreesD6.res'
[Error] VirtualTreesD6D.dpk(32): File not found: 'VirtualTreesD6.res'

If I copy the file VirtualTrees.Res to VirtualTreesD6.res, I get a
duplicate resource error.
-- Support the anti-Spam amendment - Join at http://www.cauce.org/
J. Peter Mugaas E-Mail: [oma00215@m...]
http://wvnvm.wvnet.edu/~oma00215/ ICQ Number: 14297043
Finger for PGP Key

 | Replies | Author | Date
4444 | Re: Error about missing file | Mike Lischke | Sat 11/3/2001


re: Error about missing file

From: "Mike Lischke" [lists@l...]
Date: Sat Nov 3, 2001 4:39 pm
Subject: RE: [VirtualTreeview] Error about missing file

>I got an error about a missing file.
> [Warning] VirtualTreesD6.dpk(3): File not found: 'VirtualTreesD6.res'
> [Warning] VirtualTreesD6.dpk(3): File not found: 'VirtualTreesD6.res'
> [Error] VirtualTreesD6D.dpk(32): File not found: 'VirtualTreesD6.res'

These res files are created on the fly if not yet there and contain only an
icon and version
information if enabled. Simply ignore the messages and let the IDE recreate the
res file.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: New file uploaded to VirtualTreeview

From: Werner Lehmann [wl@b...]
Date: Sat Nov 3, 2001 4:35 pm
Subject: Re: [VirtualTreeview] New file uploaded to VirtualTreeview

> > And while I looked for smBlendedRectangle to see why I don't get the dotted
rectangle
> > in classic mode I noticed this initialization in PaintTree:
> >
> > if FDrawSelectionMode = smBlendedRectangle then
> > NodeBitmap.PixelFormat := pf32Bit;
>
> This is strange, I already have made the pixelformat setting unconditional.
Did you perhaps mix up
> sources ? :-)

I remember your entry in the version log but this is copied from the 2.6.5
version
virtualtrees.pas. Unlikeley that *I* mixed up the sources :))

> > BTW, bug #71: I cannot reproduce this myself with this and the previous
version of VT.
>
> OK, so let it closed and reopen only if necessary.

Of course.

Werner

 | Replies | Author | Date
4447 | Re: New file uploaded to VirtualTreeview | Mike Lischke | Sat 11/3/2001


re: Rebuilding tree saved to database

From: Werner Lehmann [wl@b...]
Date: Sat Nov 3, 2001 4:48 pm
Subject: Re: [VirtualTreeview] Rebuilding tree saved to database

"Helge Jung (ECO-Logic)" wrote:
>
> I save the tree in the callback of IterateSubtree - I have this "nodelevel"
> as an unique id (there can't be two nodes with the same id - in the database
> I have also a second field with guarantees that there won't be two
> duplicated entrys).

I understand that the field is unique - at least until you insert some nodes
without changing the strings of the other siblings... but the point was that
this is not the perfect data structure for the purpose.

> > This allows you to easily read it back in with the same
> > recursive order.
>
> I don't understand exactly what you mean - maybe you can give a short
> example or try to explain it once again in German?

For simplicity lets assume a fully initialized tree. You can traverse and save
the whole tree with a routine like this:

procedure StoreNodes(VT: TBaseVirtualTree; Parent: PVirtualNode = nil);
var
Node: PVirtualNode;
begin
Node := VT.GetFirstChild(Parent);
while Node <> nil do
begin
StoreNodeData(Node);
StoreNodes(VT, Node);
Node := Node.NextSibling;
end;
end;

To read it back a routine with the same structure can be used. The main task is
here to get hold of the structure to know where child nodes are to be added. If
you would write this to a stream you could add the childcount into the stream
before you stream the child nodes and also insert markers which indicate if the
next node is a child, a sibling or if the recursion must go up one level.

OTOH, if you store this in a db you might want to have access to single nodes
as single db rows. Replace the marker system with three db fields then: primary
key (pk), parent key, child index. Parent key would point to the pk of the
parent
node or would be NULL if it is a top level node. child index would indicate the
order of siblings among a node's children. The routine can be easily extended so
that these 3 infos are stored instead of the markers above.

Werner

 | Replies | Author | Date
4482 | Re: Rebuilding tree saved to database | Helge Jung (ECO-Logic) | Mon 11/5/2001


re: New file uploaded to VirtualTreeview

From: "Mike Lischke" [lists@l...]
Date: Sat Nov 3, 2001 4:53 pm
Subject: RE: [VirtualTreeview] New file uploaded to VirtualTreeview

> I remember your entry in the version log but this is copied from the 2.6.5
version
> virtualtrees.pas. Unlikeley that *I* mixed up the sources :))

Outsch, there are two lines with this content and I only changed one, sorry...

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: Swap nodes

From: "Mike Lischke" [lists@l...]
Date: Sat Nov 3, 2001 4:56 pm
Subject: RE: [VirtualTreeview] Swap nodes

Hi Ilan,

> But this will swap the data and not positions. I need the nodes to
> swap position not data, so all pointers will still point towards the
> same node after the swap.

Can you be a bit more precise? What exactly do you want to swap?

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net

 | Replies | Author | Date
4450 | Re: Swap nodes | [ilan@s...] | Sat 11/3/2001


re: advanced demo application

From: [molzahn@m...]
Date: Sat Nov 3, 2001 5:01 pm
Subject: Re: advanced demo application

Hi Mike

<< And even so some labels are cut off (e.g. "Voreinstellungen |
Allgemeine Einstellungen").>>

Most of the time I try to avoid an internationalized version of a
major commercial package. As with Photoshop, I always use the
original. In the English version I haven't seen cut-off labels and
such yet.

<<But the palette windows and the layer settings completely ignore
the font/dpi settings.>>

That's true and can be rather annoying when you work under 1600x1200
for example. But it's not an example for the small font/ large font
issue, I believe. It looks as if they simply hard-coded the font size
(for whatever reason).

Regards
Uwe


re: Swap nodes

From: [ilan@s...]
Date: Sat Nov 3, 2001 11:39 pm
Subject: Re: Swap nodes

> Can you be a bit more precise? What exactly do you want to swap?

I want to create a button 'Move to top of list' that will move all
selected nodes in the VirtualTreeView towards the top of the list. I
do however want to keep all the pointers pointing towards the moved
nodes to stay intact.

Ilan


re: Re: Swap nodes

From: Werner Lehmann [wl@b...]
Date: Sun Nov 4, 2001 12:23 am
Subject: Re: [VirtualTreeview] Re: Swap nodes

[ilan@s...] wrote:
>
> I want to create a button 'Move to top of list' that will move all
> selected nodes in the VirtualTreeView towards the top of the list. I
> do however want to keep all the pointers pointing towards the moved
> nodes to stay intact.

You can use .MoveTo() for this.

Werner

 | Replies | Author | Date
4481 | Re: Swap nodes | [ilan@s...] | Mon 11/5/2001


Cut-off text in VST

From: [duke_n5@h...]
Date: Sun Nov 4, 2001 10:41 am
Subject: Cut-off text in VST

In the new versions of VST (since 2.5.4 I think) if a text of a node
doesn't fit into a column, '...' is shown.

When the node is selected, the text is shown properly like in the
older versions.

I dug in all the new options and couldn't find where to turn this
cutting-off off.

Please Help.

 | Replies | Author | Date
4453 | Re: Cut-off text in VST | Mike Lischke | Sun 11/4/2001


re: Cut-off text in VST

From: "Mike Lischke" [lists@l...]
Date: Sun Nov 4, 2001 12:57 pm
Subject: RE: [VirtualTreeview] Cut-off text in VST

> In the new versions of VST (since 2.5.4 I think) if a text of a node
> doesn't fit into a column, '...' is shown.

Please check this with the latest version of VT. I had replaced the binary
search for finding a
matching string in ShortenString by a single API call which I encountered too
late as not being
supported. I have repaired this but perhaps you just have this wrong version?

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: SyncUpdates

From: Werner Lehmann [wl@b...]
Date: Sun Nov 4, 2001 2:12 pm
Subject: Re: [VirtualTreeview] SyncUpdates

Hi Mike,

> > I am just looking into an OnChange problem. Apparently every second time
> > when this event fires its Node parameter is nil. Not too pretty IMO but
> > this has been known before.
>
> I don't know what your problem is here. Once you tested for assigned nodes in
OnChange it should not
> be an issue anymore for you. The passed node can be nil in several cases,
e.g. when clearing the
> selection or when several nodes are affected by an operation (e.g. in
InvertSelection).

Must investigate this issue further. Thought BeginSynch/EndSynch could help
here but
obviously this is not the case. I must admit that I am using a workaround here.
In
OnChange I am storing the then focused node in a field FLastFocused. I know
that focus
and selection are different things. But I have a single selection tree here
where exactly
one node should be focused at all times. And this tree has a right hand side
like in
Explorer which is dependent on the focused node; it is a little bit to slow to
update
this right hand side with each focus change.

To summarize, I am misusing the OnChange event as OnFocusChanged event because
OnChange
provides a ChangeDelay while OnFocusChanged does not. Which - in my single
selection tree -
should be fine, or so I thought.

Ok, I am have now this in OnChange:

FLastFocused := Node;
if FLastFocused = nil then // OnChange can fire with a nil node but
FLastFocused should be valid.
FLastFocused := VTree.FocusedNode;
assert(FLastFocused <> nil);

This fixes my problems *apparently*. A FocusDelay property or something would
be even better
of course ;)

> >Well, I used to set ChangeDelay to 100 or 200
> > and am getting *almost* no Change events with nil nodes anymore.
>
> Sure, this is one of the reasons to have delayed change events. This way
several quickly occuring
> events are accumulated and only one event is fired.
>
> >I say
> > almost because it still happens sometimes with no apparent reason and
> > causes some odd behaviour; it seems as if it would not fire again then
> > with the real FocusedNode (which is <> nil), is that possible?
>
> Oops, here I lost you. Why did suddenly mention the focused node? Note: focus
and selection are two
> different things.

Correct, this should be explained above.

> > Now to subject of this mail. I must admit that I am unsure when to use
> > BeginSync, EndSync (they look better without the h at the end ;). Could
> > you tell me a case where they provide any benefit over the usual Begin-
> > Update, EndUpdate?
>
> Sure. Synchronized updates were necessary in some of our products. Imagine a
case where you have two
> forms. One contains a VT and the other form contains several other controls
which can be navigated
> and are created and destroyed depending on the node in the tree. Clicking on
a node will create a
> framework on the other form, which also contains a menu, from which you can
also navigate. This menu
> navigation also changes the selected node in the treeview. So we have a
recursion here. This alone
> produces all kind of trouble if you have other things which are not
synchronized with the whole
> navigation process (e.g. a playing media player or threaded speech
recognition). Things get worst
> however when clicking a node might open another dialog (e.g. for loading or
saving). Depending on
> the form state of the other forms (e.g. fsStayOnTop) it happens then that the
dialog appears behind
> all other VCL windows (!) and cannot be brought to front. Furthermore, since
this dialog is modal
> you cannot activate any other window in the application. This is very
annoying and could elegantly
> be avoided by synchronizing updates for a short period of time (e.g. when you
select a node in code
> you know the OnChange event will be called before the selection code
returns), without affecting
> normal delayed events in usual navigation.

Thanks for this detailed explanation. I 'memorize' that BeginSync and EndSync
temporarily
suspend the delay of the OnChange and OnStructureChange events :)

Werner


Error about missing file when compiling VT2_6_0 for CPPB v2

From: "Jeffrey" [zws@h...]
Date: Mon Nov 5, 2001 3:12 am
Subject: Error about missing file when compiling VT2_6_0 for CPPB v2

Hi All,

While linking VirtualTreeView.bpk, I get an error message.
The error message is: Unable to open file 'VIRTUALSHELLTOOLSC5D.LIB'

Could you help me?

Regards,
Jeffrey

[Non-text portions of this message have been removed]

 | Replies | Author | Date
4456 | Re: Error about missing file when compiling VT2_6 | Jim Kueneman | Mon 11/5/2001


re: Error about missing file when compiling VT2_6_0 for CPPB v2

From: Jim Kueneman [jimdk@m...]
Date: Mon Nov 5, 2001 1:50 pm
Subject: Re: [VirtualTreeview] Error about missing file when compiling VT2_6_0 for CPPB v2

Hi,

>While linking VirtualTreeView.bpk, I get an error message.
>The error message is: Unable to open file 'VIRTUALSHELLTOOLSC5D.LIB'

That appears to be a VirtualExplorerTree (VET) Shell Tools
file? http://groups.yahoo.com/group/VirtualExplorerTree I am not sure why
it would be in the VT package except by mistake.

Jim


problem installing VT

From: "Ronan Van Riet" [rvanriet@s...]
Date: Mon Nov 5, 2001 1:56 pm
Subject: problem installing VT

Hi,

I just downloaded VirtualTreeview.zip, but cannot find the
VirtualTreesD5.dpk.

Please can someone help me so I can start experimenting with VT.

I am using Delphi 5.

Kind regards,
Ronan van Riet
Symantec

 | Replies | Author | Date
4459 | Re: Problem installing VT | Helge Jung (ECO-Logic) | Mon 11/5/2001


re: Error about missing file when compiling VT2 _6_0 for CPPB v2

From: Vandrovec Milan [milan_va@s...]
Date: Mon Nov 5, 2001 2:13 pm
Subject: RE: [VirtualTreeview] Error about missing file when compiling VT2 _6_0 for CPPB v2

Hello.

>
> While linking VirtualTreeView.bpk, I get an error message.
> The error message is: Unable to open file 'VIRTUALSHELLTOOLSC5D.LIB'
>
> I am not sure why
> it would be in the VT package except by mistake.

Yes, sorry. This has already been reported to me, I have fixed it, but
didn't upload the fix. Did it right now.
If you don't want to download again, use a text editor to remove the
references in <LIBRARIES=...> and <SPARELIBS=...>. BCB keeps adding them
automatically, and sometimes I forget to remove them.

Milan Vandrovec


re: Problem installing VT

From: "Helge Jung \(ECO-Logic\)" [helge@e...]
Date: Mon Nov 5, 2001 2:24 pm
Subject: Re: [VirtualTreeview] Problem installing VT

> I just downloaded VirtualTreeview.zip, but cannot find the
> VirtualTreesD5.dpk.

If you downloaded
http://groups.yahoo.com/group/VirtualTreeview/files/VirtualTree_2.6.5.zip it
shouldn't be a problem to find the file. It is definitivly in there (just
checked again).

> Please can someone help me so I can start experimenting with VT.

In the help file (available at the YG, too) there is a chapter on how to
begin. Basically you define a record and tell the Tree the size
(.NodeDataSize in OnCreate). When you've set RootNodeCount to the number you
want, fill the data in OnInitNode:

var
Data : PMyData; { definition: PMyData = ^TMyData; TMyData = record Data1:
widestring; ... end; }

begin
Data := Sender.GetNodeData(Node);
with Data^ do
begin
Data1 := 'This is node '+IntToStr (Node^.Index);
end;
end;

Then, you tell in OnGetText what to display (that's in VirtualStringTree - I
don't know about VirtualDrawTree):

var
Data : PMyData;

begin
Data := Sender.GetNodeData(Node);
case Column of
0 : Text := Data^.Data1;
else Text := 'I don''t know what to display :-(';
end;
end;

Hope that helps you on the way - further information are in the help file
(the help isn't finished or complete yet but you'll get the information you
want, I think ;-).

> I am using Delphi 5.

Me too *g*

> Ronan van Riet
> Symantec

I think I know what kind of listviews the next version of Norton AntiVirus
has *ggg*

Helge.


ValidateCache erro

From: Yur Ovchinnikov [Yur@s...]
Date: Mon Nov 5, 2001 3:42 pm
Subject: ValidateCache erro

Hello folks,

How can i awoid such error: "DoValidateCache: Internal error.
CurrentNode is nil." (ver 2.0.6.0)?

This happened when i resized two neighboring TV's and one TV's has
focus and focused node.

--
Best regards,
Yur Ovchinnikov E-mail: [yur@s...]
JSC Summit WWW: http://alone.come.to
ICQ: 1400397

 | Replies | Author | Date
4461 | Re: ValidateCache erro | Yur Ovchinnikov | Mon 11/5/2001
4565 | Re: ValidateCache erro | Mike Lischke | Sat 11/10/2001
4567 | Re: ValidateCache erro | Mike Lischke | Sat 11/10/2001
4590 | Re[2]: [VirtualTreeview] ValidateCache erro | Yur Ovchinnikov | Mon 11/12/2001
4477 | Re: ValidateCache erro | Werner Lehmann | Mon 11/5/2001
4490 | Re[2]: [VirtualTreeview] ValidateCache erro | Yur Ovchinnikov | Tue 11/6/2001
4493 | Re: ValidateCache erro | Werner Lehmann | Tue 11/6/2001
4494 | Re[2]: [VirtualTreeview] ValidateCache erro | Yur Ovchinnikov | Tue 11/6/2001


re: ValidateCache erro

From: Yur Ovchinnikov [Yur@s...]
Date: Mon Nov 5, 2001 4:01 pm
Subject: Re: [VirtualTreeview] ValidateCache erro

Hello Yur,

Monday, November 05, 2001, 5:42:07 PM, you wrote:

YO> Hello folks,

YO> How can i awoid such error: "DoValidateCache: Internal error.
YO> CurrentNode is nil." (ver 2.0.6.0)?

YO> This happened when i resized two neighboring TV's and one TV's has
YO> focus and focused node.

Just downloaded new 2.6.5 version and have in this situation "Integer
Overflow" erro with next "Access Violation" with any tree operation

Simptoms:
FVisibleCount is Cardinal and
20511: Dec(fVisibleCount) with fVisibleCount=0 generated exception.
Exception is not catched and some next operations are not executed

Ovidiously not exact operations with this counter.

I replaced
20510: if NodeVisible and (vsVisible in Run.States) then
with this one:
20510: if NodeVisible and (vsVisible in Run.States) and (fVisibleCount > 0) then

This worked for me (but i don't know how correctly)

--
Best regards,
Yur Ovchinnikov E-mail: [yur@s...]
JSC Summit WWW: http://alone.come.to
ICQ: 1400397

 | Replies | Author | Date
4565 | Re: ValidateCache erro | Mike Lischke | Sat 11/10/2001
4567 | Re: ValidateCache erro | Mike Lischke | Sat 11/10/2001
4590 | Re[2]: [VirtualTreeview] ValidateCache erro | Yur Ovchinnikov | Mon 11/12/2001


re: Problem installing VT

From: "Ronan Van Riet" [rvanriet@s...]
Date: Mon Nov 5, 2001 4:06 pm
Subject: Re: [VirtualTreeview] Problem installing VT

Helge,

Thanks I now have the required files.

Kind regards,
Ronan van Riet

"Helge Jung

\(ECO-Logic\)" To:
[VirtualTreeview@yahoogroups.com>

<helge@e...] cc:

ftware.de> Subject: Re:
[VirtualTreeview] Problem installing VT

11/05/01 03:24 PM

Please respond to

VirtualTreeview

> I just downloaded VirtualTreeview.zip, but cannot find the
> VirtualTreesD5.dpk.

If you downloaded
http://groups.yahoo.com/group/VirtualTreeview/files/VirtualTree_2.6.5.zip
it
shouldn't be a problem to find the file. It is definitivly in there (just
checked again).


How to set up a hierarchy??

From: "Ray Jensen" [bigsigh@o...]
Date: Mon Nov 5, 2001 4:11 pm
Subject: How to set up a hierarchy??

Hello friends,

I have been following this list for quite a while now, and
working with VST for a few weeks.
I am blown away by the quality and versatility of VT!
I can easily use it as a grid or as a straight list, but as a
treeview replacement... help!
Please, I am REALLY desperate trying to get this to
work... I am way behind in my client's deadline :(

My node data looks like this:

PTAgentData = ^TAgentData;
TAgentData = record
OID : Integer; // unique key in db
Agent_ID : Integer;
Parent_ID : Integer;
pAgent : TAgent; //pointer to the Agent in my framework
end;

I start in FormCreate ny adding only one node - the company.
It has Parent_ID of -1 and Agent_ID of 0.
So next, I want to create the first level of child nodes, beneath the
Company,
using OnInitNode event. (?)
I have also tried using OnInitChildren, but the problem is a chicken-and-egg
problem - I can't get the Agent info from my framework because I don't have
a
valid data pointer in InitChildren.
I must be missing something. I searched the help file, but part of the
problem is that I am not sure which events fire first...

I want it to look like this:

---------------------------------------------------------------------
-- The Company (first node added at formCreate)
|-- Agent 001
|-- Agent 002
|-- Agent 003
|-- Agent 002 <== now this Agent has sub-agents - when do I add
them?
|-- Agent 004
|-- Agent 005

Thank you very much for a fantastic component!

Ray Jensen
Big Sigh Studios
[bigsigh@o...]

 | Replies | Author | Date
4465 | Re: How to set up a hierarchy?? | Helge Jung (ECO-Logic) | Mon 11/5/2001
4468 | Re: How to set up a hierarchy?? | Jim Kueneman | Mon 11/5/2001
4478 | Re: How to set up a hierarchy?? | Werner Lehmann | Mon 11/5/2001
4486 | Re: How to set up a hierarchy?? | Ray Jensen | Tue 11/6/2001


Resizing columns

From: Yur Ovchinnikov [Yur@s...]
Date: Mon Nov 5, 2001 4:09 pm
Subject: Resizing columns

Hello folks,

How can i easy resize last tree column with such options:

1) ColumnCount = 2
2) Header.Autosize = true
3) AutosizeColumnIndex = 0

Problem with method of resizing - only way is to resize column 2 with
pulling right margin to the right. Very unusable method.

--
Best regards,
Yur Ovchinnikov E-mail: [yur@s...]
JSC Summit WWW: http://alone.come.to
ICQ: 1400397

 | Replies | Author | Date
4476 | Re: Resizing columns | Werner Lehmann | Mon 11/5/2001


re: How to set up a hierarchy??

From: "Helge Jung \(ECO-Logic\)" [helge@e...]
Date: Mon Nov 5, 2001 4:23 pm
Subject: Re: [VirtualTreeview] How to set up a hierarchy??

> I want it to look like this:
>
> ---------------------------------------------------------------------
> -- The Company (first node added at formCreate)
> |-- Agent 001
> |-- Agent 002
> |-- Agent 003
> |-- Agent 002 <== now this Agent has sub-agents - when do I add
> them?
> |-- Agent 004
> |-- Agent 005
>

AFAIK in OnInitChildren you set the number of children a node has (in your
case when Agent 003 is selected you say "1"). Then for each node OnInitNode
is fired in which you can assign the data:

var
Data : PTAgentData;

begin
Data := Sender.GetNodeData(Node);

// determine which AgentData to be used
with Data^ do
begin
OID := ...;
Agent_ID := ...;
// I assume Parent_ID is the ID of the Agent at the parent node:
Parent_ID := PTAgentData(Sender.GetNodeData (Node^.Parent))^.Agent_ID;
pAgent := ...;
end;
end;

You can also build the complete tree in OnCreate with AddChild - just for
your information (don't know if you knew that already).

Helge.


Can`t install Virtual Tree view / Design time package error ?

From: [fastpartner@y...]
Date: Mon Nov 5, 2001 4:28 pm
Subject: Can`t install Virtual Tree view / Design time package error ?

I have downloaded the new release Virtual Tree view 2.6.5

Now I tried to open the file "VirtualTreesD5.dpk" and then clicked
the button -Install-.

Then I get a error message like.......
"Package C:\....\VirtualTreesD5.bpl can not be installed because it
is not a design time package.

What can be the error here ?

By the way, there is also another file called "VirtualTreesD5D.dpk" -
What kind of file is that?

Thanks for help,
Matthias Jensen
[m.jensen@w...]

 | Replies | Author | Date
4467 | Re: Can`t install Virtual Tree view / Design time | Helge Jung (ECO-Logic) | Mon 11/5/2001
4469 | Re: Can`t install Virtual Tree view / Design time | [fastpartner@y...] | Mon 11/5/2001
4470 | Re: Basic questions on VT (was "Can't install VT. | Helge Jung (ECO-Logic) | Mon 11/5/2001
4471 | Re: Basic questions on VT (was "Can't install VT. | [fastpartner@y...] | Mon 11/5/2001


re: Can`t install Virtual Tree view / Design time package error ?

From: "Helge Jung \(ECO-Logic\)" [helge@e...]
Date: Mon Nov 5, 2001 4:37 pm
Subject: Re: [VirtualTreeview] Can`t install Virtual Tree view / Design time package error ?

> Now I tried to open the file "VirtualTreesD5.dpk" and then clicked
> the button -Install-.
>
> Then I get a error message like.......
> "Package C:\....\VirtualTreesD5.bpl can not be installed because it
> is not a design time package.
>
> What can be the error here ?
>

There's nothing wrong - first open VirtualTreesD5.dpk and say Project-Build
(or say Compile - not Install!)...

> By the way, there is also another file called "VirtualTreesD5D.dpk" - What
kind of file is that?

... then open VirtualTreesD5D.dpk, say again Project-Build (prevents rests
of prior versions of VT) and then click Install - et voila!

VirtualTreesD5.dpk is the runtime-package(?) which is needed by the second
one:
VirtualTreesD5D.dpk is the designtime-package which also supplies the icons
in the component palette.

Helge.

 | Replies | Author | Date
4469 | Re: Can`t install Virtual Tree view / Design time | [fastpartner@y...] | Mon 11/5/2001
4470 | Re: Basic questions on VT (was "Can't install VT. | Helge Jung (ECO-Logic) | Mon 11/5/2001
4471 | Re: Basic questions on VT (was "Can't install VT. | [fastpartner@y...] | Mon 11/5/2001


re: How to set up a hierarchy??

From: "Jim Kueneman" [jimdk@m...]
Date: Mon Nov 5, 2001 4:37 pm
Subject: Re: How to set up a hierarchy??

--- In [VirtualTreeview@y...], "Ray Jensen" [bigsigh@o...] wrote:
> Hello friends,
>
> I have been following this list for quite a while now, and
> working with VST for a few weeks.
> I am blown away by the quality and versatility of VT!
> I can easily use it as a grid or as a straight list, but as a
> treeview replacement... help!

The events go like this:

You add the number of root nodes in the OI.

As VT needs to display them you get a OnInitNode where you can set up
the node and any user data required for that node, including the
HasChildren flag to tell it to display the "+".

When the user tries to expand the node VT calls OnInitChildren so it
can know how many children the parent has.

If any of these children are visible VT calls OnInitNode for each of
them.

This is in a perfect virtual world. In many cases it is easier (or
necessary) to use AddChild within the OnInitChildren method instead
just returning the number of nodes for various reasons. Make sure to
bracket the AddChild(s) with BeginUpdate and EndUpdate.

Jim


re: Can`t install Virtual Tree view / Design time package error ?

From: [fastpartner@y...]
Date: Mon Nov 5, 2001 5:52 pm
Subject: Re: Can`t install Virtual Tree view / Design time package error ?

Hello Helge,

Thanks a lot for your help.

If you have the time for it then please could you explain to me
in a easy way what I can use the 3 components of the tree view for.

I just want to add a (data aware) tree view component to a form, so I
can navigate between different database records and the tree view
also has to be able to create new records usinfg a right click.

Now I can see there are 3 components (called Virtual´DrawTree,
Virtual StringTree and VTHeaderPopMenu.

Do I need all 3 components in order to create such a navigation tree
and what can I use them for.
I was looking through the Tree view help file but there is no
description what to use this 3 components for.

If possible try to explain it to me in a easy because I just started
using this tree view component.
I hope there will also be a more extended help file available with
some small examples for data-aware use.

I know it is a very professional component, so even if there is no
extended help file available I have to figure out how work with it.

Thanks for your help or if anybody else will reply,
Matthias

--- In [VirtualTreeview@y...], "Helge Jung \(ECO-Logic\)" [helge@e...]
wrote:
> > Now I tried to open the file "VirtualTreesD5.dpk" and then clicked
> > the button -Install-.
> >
> > Then I get a error message like.......
> > "Package C:\....\VirtualTreesD5.bpl can not be installed because
it
> > is not a design time package.
> >
> > What can be the error here ?
> >
>
> There's nothing wrong - first open VirtualTreesD5.dpk and say
Project-Build
> (or say Compile - not Install!)...
>
> > By the way, there is also another file
called "VirtualTreesD5D.dpk" - What
> kind of file is that?
>
> ... then open VirtualTreesD5D.dpk, say again Project-Build
(prevents rests
> of prior versions of VT) and then click Install - et voila!
>
> VirtualTreesD5.dpk is the runtime-package(?) which is needed by the
second
> one:
> VirtualTreesD5D.dpk is the designtime-package which also supplies
the icons
> in the component palette.
>
> Helge.

 | Replies | Author | Date
4470 | Re: Basic questions on VT (was "Can't install VT. | Helge Jung (ECO-Logic) | Mon 11/5/2001
4471 | Re: Basic questions on VT (was "Can't install VT. | [fastpartner@y...] | Mon 11/5/2001


re: Re: Basic questions on VT (was "Can't install VT...")

From: "Helge Jung \(ECO-Logic\)" [helge@e...]
Date: Mon Nov 5, 2001 6:02 pm
Subject: Re: [VirtualTreeview] Re: Basic questions on VT (was "Can't install VT...")

> If you have the time for it then please could you explain to me
> in a easy way what I can use the 3 components of the tree view for.

TVirtualStringTree is the one you probably need most
TVirtualDrawTree is a VirtualTree in which you draw everything yourself
TVTHeaderPopupMenu: I don't exactly what it's for (I only use VST) - but you
can assign it to VT.Header.PopupMenu - I think you can select columns there
(Visible yes or no, I guess)

> I just want to add a (data aware) tree view component to a form, so I
> can navigate between different database records and the tree view
> also has to be able to create new records usinfg a right click.

That might become a bit complicated - but there's something about that in
the help IIRC. Maybe you first want to try a tree in which you can edit
things and afterwards (when you know how to do that) you try to link the
whole thing with a database.

Is the database local or client-server?

> If possible try to explain it to me in a easy because I just started
> using this tree view component.

Oh, I just started with it, too (about 1-2 month ago) - you'll learn it very
quickly.

> I hope there will also be a more extended help file available with
> some small examples for data-aware use.

In the helpfile available at the YG there's something mentioned about
database trees (I think I saw something about that) - if not, there are some
database-descendants in the Files-Area of the YG and there were already some
discussions about these kind of trees here in the YG. But if you need help
with it, I'm using VT in connection with InterBase and it works perfectly -
but I don't use the tree to edit the database - I edit the VT locally and
afterwards store everything to the database (depends on the program-logic
you need).

> I know it is a very professional component, so even if there is no
> extended help file available I have to figure out how work with it.

Start with the help file at the YG (I'm repeating myself *g*) - it's not
complete yet but it should help you on the way.

Helge.

 | Replies | Author | Date
4471 | Re: Basic questions on VT (was "Can't install VT. | [fastpartner@y...] | Mon 11/5/2001


re: Basic questions on VT (was "Can't install VT...")

From: [fastpartner@y...]
Date: Mon Nov 5, 2001 6:18 pm
Subject: Re: Basic questions on VT (was "Can't install VT...")

Helge, Thanks a lot for your good help.

I also want to work with Interbase and use the tree view to navigate
between the records and to create new database records but I will now
work with the VT help file and I will also take a look at database
demos. Maybe I can use some of the information.

Thanks again for your help,
Matthias Jensen

--- In [VirtualTreeview@y...], "Helge Jung \(ECO-Logic\)" [helge@e...]
wrote:
> > If you have the time for it then please could you explain to me
> > in a easy way what I can use the 3 components of the tree view
for.
>
> TVirtualStringTree is the one you probably need most
> TVirtualDrawTree is a VirtualTree in which you draw everything
yourself
> TVTHeaderPopupMenu: I don't exactly what it's for (I only use VST) -
but you
> can assign it to VT.Header.PopupMenu - I think you can select
columns there
> (Visible yes or no, I guess)
>
> > I just want to add a (data aware) tree view component to a form,
so I
> > can navigate between different database records and the tree view
> > also has to be able to create new records usinfg a right click.
>
> That might become a bit complicated - but there's something about
that in
> the help IIRC. Maybe you first want to try a tree in which you can
edit
> things and afterwards (when you know how to do that) you try to
link the
> whole thing with a database.
>
> Is the database local or client-server?
>
> > If possible try to explain it to me in a easy because I just
started
> > using this tree view component.
>
> Oh, I just started with it, too (about 1-2 month ago) - you'll
learn it very
> quickly.
>
> > I hope there will also be a more extended help file available with
> > some small examples for data-aware use.
>
> In the helpfile available at the YG there's something mentioned
about
> database trees (I think I saw something about that) - if not, there
are some
> database-descendants in the Files-Area of the YG and there were
already some
> discussions about these kind of trees here in the YG. But if you
need help
> with it, I'm using VT in connection with InterBase and it works
perfectly -
> but I don't use the tree to edit the database - I edit the VT
locally and
> afterwards store everything to the database (depends on the program-
logic
> you need).
>
> > I know it is a very professional component, so even if there is no
> > extended help file available I have to figure out how work with
it.
>
> Start with the help file at the YG (I'm repeating myself *g*) -
it's not
> complete yet but it should help you on the way.
>
> Helge.


Infinite Loop in the OnGetText

From: [DStrickland@c...]
Date: Mon Nov 5, 2001 6:23 pm
Subject: Infinite Loop in the OnGetText

I have created a simple stringtree that continually calls the
OnGetText. While this is happening the cpu runs @ 100% utilization
and the application hangs until I close the form using the
Stringtree. I have several in the application that works without
continually calling the OnGetText. The only thing that's different
is that this tree has children. It loops whether the children have
been initialized or not. I have matched properties with the other
stringtree's but it didn't help.

I log messages in all the stringtree events and here's a short-
listing of what happens.

11/5/2001 1:06:09 PM >>>>> Stringtree >>>>>InitNode
11/5/2001 1:06:09 PM >>>>> Stringtree >>>>>GetText
11/5/2001 1:06:09 PM >>>>> Stringtree >>>>>GetText
11/5/2001 1:06:09 PM >>>>> Stringtree >>>>>GetText
11/5/2001 1:06:09 PM >>>>> Stringtree >>>>>InitNode
11/5/2001 1:06:09 PM >>>>> Stringtree >>>>>GetText
11/5/2001 1:06:09 PM >>>>> Stringtree >>>>>GetText
11/5/2001 1:06:09 PM >>>>> Stringtree >>>>>GetText
11/5/2001 1:06:09 PM >>>>> Stringtree >>>>>InitNode
11/5/2001 1:06:09 PM >>>>> Stringtree >>>>>GetText
11/5/2001 1:06:09 PM >>>>> Stringtree >>>>>GetText
11/5/2001 1:06:09 PM >>>>> Stringtree >>>>>GetText
11/5/2001 1:06:09 PM >>>>> Stringtree >>>>>InitNode
11/5/2001 1:06:09 PM >>>>> Stringtree >>>>>GetText
11/5/2001 1:06:09 PM >>>>> Stringtree >>>>>GetText
11/5/2001 1:06:09 PM >>>>> Stringtree >>>>>GetText
11/5/2001 1:06:09 PM >>>>> Stringtree >>>>>InitNode
11/5/2001 1:06:09 PM >>>>> Stringtree >>>>>GetText
11/5/2001 1:06:09 PM >>>>> Stringtree >>>>>GetText
11/5/2001 1:06:09 PM >>>>> Stringtree >>>>>GetText
11/5/2001 1:06:09 PM >>>>> Stringtree >>>>>InitNode
11/5/2001 1:06:09 PM >>>>> Stringtree >>>>>GetText
11/5/2001 1:06:09 PM >>>>> Stringtree >>>>>GetText
11/5/2001 1:06:09 PM >>>>> Stringtree >>>>>GetText
11/5/2001 1:06:09 PM >>>>> Stringtree >>>>>GetText
11/5/2001 1:06:09 PM >>>>> Stringtree >>>>>GetText
11/5/2001 1:06:09 PM >>>>> Stringtree >>>>>GetText
11/5/2001 1:06:09 PM >>>>> Stringtree >>>>>GetText
11/5/2001 1:06:09 PM >>>>> Stringtree >>>>>GetText
11/5/2001 1:06:09 PM >>>>> Stringtree >>>>>GetText
11/5/2001 1:06:09 PM >>>>> Stringtree >>>>>GetText
11/5/2001 1:06:09 PM >>>>> Stringtree >>>>>GetText
11/5/2001 1:06:09 PM >>>>> Stringtree >>>>>GetText

Continues looping from here on.

Thanks
DS

 | Replies | Author | Date
4473 | Re: Infinite Loop in the OnGetText | Jim Kueneman | Mon 11/5/2001
4475 | Re: Infinite Loop in the OnGetText | [DStrickland@c...] | Mon 11/5/2001


re: Infinite Loop in the OnGetText

From: "Jim Kueneman" [jimdk@m...]
Date: Mon Nov 5, 2001 7:48 pm
Subject: Re: Infinite Loop in the OnGetText

> continually calling the OnGetText. The only thing that's different
> is that this tree has children. It loops whether the children have
> been initialized or not. I have matched properties with the other
> stringtree's but it didn't help.

Make sure you wrap any node additions (and most anything else) with
BeginUpdate/EndUpdates

Jim

 | Replies | Author | Date
4475 | Re: Infinite Loop in the OnGetText | [DStrickland@c...] | Mon 11/5/2001


[no subject]

From: "Paul D'Agosta" [pdagosta@c...]
Date: Mon Nov 5, 2001 8:47 pm
Subject:

Hi Mike,

One of the display rules that I am trying to inforce is that the
selected row (which is also the focused row in this tree) never
scrolls due to background structure changes. This is easy to
implement by getting the offset value at the beginning of an update
and comparing it to the end of the update. Using this delta I can
scroll my VST to the correct location new position.

Here is my OnUpdating procedure for reference:

procedure TForm1.VirtualStringTree1Updating(Sender: TBaseVirtualTree;
State: TVTUpdateState);
var
NewRect:TRect;
begin
if not (csDestroying in ComponentState) and
Assigned(Sender.FocusedNode) then
begin
case State of
usBegin:
begin
FCurNode := Sender.FocusedNode;
FCurRect :=
Sender.GetDisplayRect(Sender.FocusedNode,-1,false);

end;
usEnd:
begin
if FCurNode = Sender.FocusedNode then
begin
NewRect :=
Sender.GetDisplayRect(Sender.FocusedNode,-1,false);
Sender.offsety := Sender.offsety - NewRect.top +
FCurRect.top;
end;
end;
end;
end;
end;

This works fine for Adding nodes, but when I Delete nodes I see a jump
(ie it scrolls up and then back down to where it should be). It seems
that the screen is updated twice, once for the delete, and once for
setting the offsety.

I have just found that it only seems to happen when the last node is
in view. This leads me to believe that deleting nodes that update the
scrollbar scrolled to the bottom cause a repaint prematurely.

I am uploading a demo app to demonstrate the problem.
While running the app, scroll to the very bottom and select a node
five or so rows up from the last node.
delete a lot of nodes quickly
watch the selected rectangle bounce
compare this to when the last node is not in view or when adding nodes

Thanks,

Paul

 | Replies | Author | Date
4566 | Re: (please add a subject line!) | Mike Lischke | Sat 11/10/2001
4593 | Re: (please add a subject line!) | Paul D'Agosta | Mon 11/12/2001
4594 | Deleting Nodes while Last Node is Visible | Paul D'Agosta | Mon 11/12/2001
4618 | Re: Deleting Nodes while Last Node is Visible | Paul D'Agosta | Wed 11/14/2001
4673 | Re: (please add a subject line!) | Mike Lischke | Sun 11/18/2001


re: Infinite Loop in the OnGetText

From: [DStrickland@c...]
Date: Mon Nov 5, 2001 9:15 pm
Subject: Re: Infinite Loop in the OnGetText

First, thanks for the fast reply! Secondly, I already had the
BeginUpdate and EndUpdates in the events. But I rechecked again.
So, the problem still exist. I have the treegrid looking and
performing exactly as needed exact for the looping problem. Also, if
I toogle the tree to visible := False then no problem. Visible :=
true then 100% utilization.

Thanks
Darryl

--- In [VirtualTreeview@y...], "Jim Kueneman" [jimdk@m...] wrote:
>
>
> > continually calling the OnGetText. The only thing that's
different
> > is that this tree has children. It loops whether the children
have
> > been initialized or not. I have matched properties with the
other
> > stringtree's but it didn't help.
>
>
> Make sure you wrap any node additions (and most anything else) with
> BeginUpdate/EndUpdates
>
> Jim


re: Resizing columns

From: Werner Lehmann [wl@b...]
Date: Mon Nov 5, 2001 8:57 pm
Subject: Re: [VirtualTreeview] Resizing columns

Yur Ovchinnikov wrote:
>
> How can i easy resize last tree column with such options:
>
> 1) ColumnCount = 2
> 2) Header.Autosize = true
> 3) AutosizeColumnIndex = 0
>
> Problem with method of resizing - only way is to resize column 2 with
> pulling right margin to the right. Very unusable method.

Well - the autosizing algorithm is not 100% perfect, especially with many
columns. While the autosize column autosizes correctly other columns have
their 'issues' with sizing. Personally I use it only if the header is hidden
and the user has no chance to size the columns anyway. There have been
attempts to modify its behaviour but the matter gets complex very soon. I
guess nobody has tried since then.

What is needed here is probably a detailed spec which describes all possible
circumstances and then somebody to implement it.

Werner


re: ValidateCache erro

From: Werner Lehmann [wl@b...]
Date: Mon Nov 5, 2001 8:49 pm
Subject: Re: [VirtualTreeview] ValidateCache erro

Yur,

> YO> How can i awoid such error: "DoValidateCache: Internal error.
> YO> CurrentNode is nil." (ver 2.0.6.0)?
>
> YO> This happened when i resized two neighboring TV's and one TV's has
> YO> focus and focused node.
>
> Just downloaded new 2.6.5 version and have in this situation "Integer
> Overflow" erro with next "Access Violation" with any tree operation

Can you make a small demo which exhibts the problem?

Werner

 | Replies | Author | Date
4490 | Re[2]: [VirtualTreeview] ValidateCache erro | Yur Ovchinnikov | Tue 11/6/2001


re: How to set up a hierarchy??

From: Werner Lehmann [wl@b...]
Date: Mon Nov 5, 2001 9:04 pm
Subject: Re: [VirtualTreeview] How to set up a hierarchy??

Hi Ray,

> My node data looks like this:
>
> PTAgentData = ^TAgentData;
> TAgentData = record
> OID : Integer; // unique key in db
> Agent_ID : Integer;
> Parent_ID : Integer;
> pAgent : TAgent; //pointer to the Agent in my framework
> end;

the problem with this structure is that it is organized bottom-up only , i.e.
from children to parent. But you always build a tree top-down, parents first.
If you have a parent you do not know its children with your structure. This
makes it hard to create the tree and basically requires to iterate over them.

Ideally you would have a list of children in a TList or array, or a chained
siblings list similar to the way in which TVirtualNode works (I recommend the
list though, or the array if your data is very static).

If I assume such a list you could simply handle OnInitChildren by returning the
count of this list. And in OnInitNode you get the data of the parent of the
node which you have to init (the parent is init'ed already), and then use
Node.Index
with the parent node's child list to init the node. This is how it's meant to
work.

Werner


re: Checking parent nodes of a tree programatically?

From: [tvav@h...]
Date: Mon Nov 5, 2001 9:59 pm
Subject: Re: Checking parent nodes of a tree programatically?

> It seems that this problem is already fixed with the current
version. I cannot reproduce any problem
> regarding check propagation. Please try version 2.6.0. If this does
not work then please create a
> demo which shows the bug.

Hi Mike,
Unfortunately, it is still happening with version 2.6.0!
I have created a zip with a demo of this problem
called "PropagateProblem.zip". I uploaded this file in the BugDemos
directory.
Thanks
Tony

 | Replies | Author | Date
4480 | Re: Checking parent nodes of a tree programatical | Jim Kueneman | Mon 11/5/2001
4498 | Re: Checking parent nodes of a tree programatical | [tvav@h...] | Tue 11/6/2001


re: Checking parent nodes of a tree programatically?

From: "Jim Kueneman" [jimdk@m...]
Date: Mon Nov 5, 2001 10:19 pm
Subject: Re: Checking parent nodes of a tree programatically?

> Unfortunately, it is still happening with version 2.6.0!
> I have created a zip with a demo of this problem
> called "PropagateProblem.zip". I uploaded this file in the

Change this:

if assigned(SelNode) then
begin
SelNode.CheckState := csCheckedNormal;
Invalidate;
end;

to:

if assigned(SelNode) then
begin
VirtualStringTree1.CheckState[SelNode] :=
csCheckedNormal;
Invalidate;
end;

VT is not aware of the change when setting the node directly.

Jim

Jim

 | Replies | Author | Date
4498 | Re: Checking parent nodes of a tree programatical | [tvav@h...] | Tue 11/6/2001


re: Swap nodes

From: [ilan@s...]
Date: Mon Nov 5, 2001 10:27 pm
Subject: Re: Swap nodes

> You can use .MoveTo() for this.
>
> Werner

Thank you!

Ilan


re: Rebuilding tree saved to database

From: "Helge Jung \(ECO-Logic\)" [helge@e...]
Date: Mon Nov 5, 2001 10:35 pm
Subject: Re: [VirtualTreeview] Rebuilding tree saved to database

> For simplicity lets assume a fully initialized tree. You can
> traverse and save
> the whole tree with a routine like this:
>
> procedure StoreNodes(VT: TBaseVirtualTree; Parent: PVirtualNode = nil);
> var
> Node: PVirtualNode;
> begin
> Node := VT.GetFirstChild(Parent);
> while Node <> nil do
> begin
> StoreNodeData(Node);
> StoreNodes(VT, Node);
> Node := Node.NextSibling;
> end;
> end;
>
> [...]
>
> OTOH, if you store this in a db you might want to have access to
> single nodes as single db rows. Replace the marker system with
> three db fields then: primary key (pk), parent key, child index.
> Parent key would point to the pk of the parent node or would be
> NULL if it is a top level node. child index would indicate the
> order of siblings among a node's children. The routine can be
> easily extended so that these 3 infos are stored instead of
> the markers above.

Many thanks for your hint - I changed it a bit and integrated it into my
program and it works properly. Many thanks for that hint with the parent
id - I could have thought about that myself but as usual you don't see the
forest because of the trees (was that translated correctly from German? *g*)

Helge.


re: HELP FILE !

From: Werner Lehmann [wl@b...]
Date: Mon Nov 5, 2001 10:55 pm
Subject: Re: [VirtualTreeview] HELP FILE !

Mike Lischke wrote:
>
> 3. You download the trial version of the authoring tool I use (Time2Help at
www.time2help) which is
> liimited to 30 days but gives you previews but requires some work to get used
to it. For text
> formatting you can use usual HTML tags like <b></b>, <i></i>, <li>, <ul>,
<table> etc.

I have begun to work with Time2Help trial. Workflow is sometimes a little bit
'obfuscating'
but it is ok. I could not get hyperlinks to work. Tried it with JUMP and SEE
tag but the
link is only visible in the preview. If I click on it in the preview I come to
an (almost)
empty page. In CHM there is no link at all, only the TEXT parameter of both
tags is displayed
in capital letters.

So far I have documented TStringEditLink and IVTEditLink.

Werner

 | Replies | Author | Date
4484 | Re: HELP FILE ! | Jim Kueneman | Mon 11/5/2001


re: HELP FILE !

From: Jim Kueneman [jimdk@m...]
Date: Mon Nov 5, 2001 11:40 pm
Subject: Re: [VirtualTreeview] HELP FILE !

>I have begun to work with Time2Help trial. Workflow is sometimes a little
>bit 'obfuscating'
>but it is ok. I could not get hyperlinks to work. Tried it with JUMP and
>SEE tag but the
>link is only visible in the preview. If I click on it in the preview I
>come to an (almost)
>empty page. In CHM there is no link at all, only the TEXT parameter of
>both tags is displayed
>in capital letters.

Hi Werner,

If you have not found this obscure help page search on this:

Topic ID's generated by Time2HELP

To see this:

Unit: IDH_Unit_[%Unit.Name%]
Interface: IDH_interface_[%interface.Name%]
Class: IDH_Class_[%Class.Name%]
Routine: IDH_[%Unit.Name%]_[%Routine.Name%]
Property: IDH_[%Class.Name%]_[%Property.Name%]
Method: IDH_[%Class.Name%]_[%Method.Name%]
Event: IDH_[%Class.Name%]_[%Event.Name%]

So make a hyperlink to a particular method in a particular class do this:

<A HRef="IDH_TColumnManager_ToggleWidthAutoFit">ToggleWidthAutoFit</A>

Also if you have not found it Ctl+Spacebar is a big help.

Jim


re: HELP FILE !

From: Werner Lehmann [wl@b...]
Date: Tue Nov 6, 2001 12:16 am
Subject: Re: [VirtualTreeview] HELP FILE !

Hi Jim,

> If you have not found this obscure help page search on this:
>
> Topic ID's generated by Time2HELP

Thanks, that might prove helpful.

> Unit: IDH_Unit_[%Unit.Name%]
> Interface: IDH_interface_[%interface.Name%]
> Class: IDH_Class_[%Class.Name%]
> Routine: IDH_[%Unit.Name%]_[%Routine.Name%]
> Property: IDH_[%Class.Name%]_[%Property.Name%]
> Method: IDH_[%Class.Name%]_[%Method.Name%]
> Event: IDH_[%Class.Name%]_[%Event.Name%]
>
> So make a hyperlink to a particular method in a particular class do this:
>
> <A HRef="IDH_TColumnManager_ToggleWidthAutoFit">ToggleWidthAutoFit</A>

I hoped to get away with the <See> or <SeeAlso> tags. The help provides
an example for it which looks much easier (and especially shorter). Alas,
it does not seem to work.

Ex.

TStringEditLink implements the interface <See Class=IVTEditLink>.

> Also if you have not found it Ctl+Spacebar is a big help.

Yes, I found that *by chance*. The biggest problem with Time2Help so far is
that I have finally to learn what ctrl+x,c,v do. I always confuse them and
at times when I don't think about it I use ctrl+ins,del and shift+ins. But
_these_ do evil stuff. The least is that selected text is gone, mostly re-
placed by sth else and there is no undo with ctrl+z,backspace. Really annoying
little detail.

Werner

 | Replies | Author | Date
4487 | Re: HELP FILE ! | Jim Kueneman | Tue 11/6/2001


re: How to set up a hierarchy??

From: "Ray Jensen" [bigsigh@o...]
Date: Tue Nov 6, 2001 12:31 am
Subject: Re: [VirtualTreeview] How to set up a hierarchy??

Thanks Helge and Werner.
I have decided to add some helper functions in my framework
which maintain an array of id's for siblings which have already
been added to a parent node.
This should do the trick.
And yes, I am determined to remain purely virtual! :)

----- Original Message -----
From: "Werner Lehmann" [wl@b...]
To: <VirtualTreeview@yahoogroups.com>
Sent: Tuesday, November 06, 2001 8:04 AM
Subject: Re: [VirtualTreeview] How to set up a hierarchy??

: Hi Ray,
:
: > My node data looks like this:
: >
: > PTAgentData = ^TAgentData;
: > TAgentData = record
: > OID : Integer; // unique key in db
: > Agent_ID : Integer;
: > Parent_ID : Integer;
: > pAgent : TAgent; //pointer to the Agent in my framework
: > end;
:
: the problem with this structure is that it is organized bottom-up only ,
i.e.
: from children to parent. But you always build a tree top-down, parents
first.
: If you have a parent you do not know its children with your structure.
This
: makes it hard to create the tree and basically requires to iterate over
them.
:
: Ideally you would have a list of children in a TList or array, or a
chained
: siblings list similar to the way in which TVirtualNode works (I recommend
the
: list though, or the array if your data is very static).
:
: If I assume such a list you could simply handle OnInitChildren by
returning the
: count of this list. And in OnInitNode you get the data of the parent of
the
: node which you have to init (the parent is init'ed already), and then use
Node.Index
: with the parent node's child list to init the node. This is how it's meant
to
: work.
:
: Werner
:
:
:
: To unsubscribe from this group, send an email to:
: VirtualTreeview-unsubscribe@egroups.com
:
:
:
: Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
:
:
:


re: HELP FILE !

From: Jim Kueneman [jimdk@m...]
Date: Tue Nov 6, 2001 12:51 am
Subject: Re: [VirtualTreeview] HELP FILE !

Hi Werner,

>Yes, I found that *by chance*. The biggest problem with Time2Help so far is
>that I have finally to learn what ctrl+x,c,v do. I always confuse them and
>at times when I don't think about it I use ctrl+ins,del and shift+ins. But
>_these_ do evil stuff. The least is that selected text is gone, mostly re-

:^) I thought I was the only one who still used ctrl+ins and
shift+ins! You are not left handed are you? I find the x,c,v to be very
awkward when using the mouse with my left hand, and yes it does *nasty* things.

Jim


How to show plus mark?

From: "Ray Jensen" [bigsigh@o...]
Date: Tue Nov 6, 2001 8:35 am
Subject: How to show plus mark?

Hi,
I am making progress! Yahoo! :)
Please, can anyone tell me how to make the plus symbol appear
after adding a first node to the VST?
Of course, I have set ChildCount for the first node to a value > 0,
but the plus symbol does not show.

many thanks,

Ray Jensen
Big Sigh Studios
[bigsigh@o...]

 | Replies | Author | Date
4492 | Re: How to show plus mark? | Werner Lehmann | Tue 11/6/2001


New file uploaded to VirtualTreeview

From: [VirtualTreeview@yahoogroups.com>
Date: Tue Nov 6, 2001 9:26 am
Subject: New file uploaded to VirtualTreeview

Hello,

This email message is a notification to let you know that
a file has been uploaded to the Files area of the VirtualTreeview
group.

File : /BugDemos/Project1_20011106.zip
Uploaded by : [Yur@s...]
Description : Problem with TBaseVirtualTree.FVisibleCount

You can access this file at the URL

http://groups.yahoo.com/group/VirtualTreeview/files/BugDemos/Project1_20011106.z\
ip

To learn more about file sharing for your group, please visit

http://help.yahoo.com/help/us/groups/files

Regards,

Yur@s...]


Re[2]: ValidateCache erro

From: Yur Ovchinnikov [Yur@s...]
Date: Tue Nov 6, 2001 9:25 am
Subject: Re[2]: [VirtualTreeview] ValidateCache erro

Hello Werner,

Monday, November 05, 2001, 10:49:13 PM, you wrote:

WL> Yur,

>> YO> How can i awoid such error: "DoValidateCache: Internal error.
>> YO> CurrentNode is nil." (ver 2.0.6.0)?
>>
>> YO> This happened when i resized two neighboring TV's and one TV's has
>> YO> focus and focused node.
>>
>> Just downloaded new 2.6.5 version and have in this situation "Integer
>> Overflow" erro with next "Access Violation" with any tree operation

WL> Can you make a small demo which exhibts the problem?

J just uploaded source project with description of how to generate a bug.
http://groups.yahoo.com/group/VirtualTreeview/files/BugDemos/Project1_20011106.z\
ip
Sorry for lazy code :)

In most cases error is "Integer Overflow", in any "DoValidateCache: Internal
error.
CurrentNode is nil." (but i can identify conditions)

WL> Werner

--
Best regards,
Yur Ovchinnikov E-mail: [yur@s...]
JSC Summit WWW: http://alone.come.to
ICQ: 1400397


re: HELP FILE !

From: Werner Lehmann [wl@b...]
Date: Tue Nov 6, 2001 1:48 am
Subject: Re: [VirtualTreeview] HELP FILE !

Jim Kueneman wrote:
>
> :^) I thought I was the only one who still used ctrl+ins and
> shift+ins! You are not left handed are you? I find the x,c,v to be very
> awkward when using the mouse with my left hand, and yes it does *nasty*
things.

I *am* left handed but ctrl x,c,v should be reachable quite good with one hand
- after
all that's probably the reason for these shortcuts. But I simply cannot recall
what
the mean :) I have always to count x,c,v,cut,copy (both with c),paste
(vaste?). The
other shortcuts are so much easier to learn.

Oh, and btw, I use the mouse with the right hand ;)

Werner


re: How to show plus mark?

From: Werner Lehmann [wl@b...]
Date: Tue Nov 6, 2001 10:52 am
Subject: Re: [VirtualTreeview] How to show plus mark?

Ray Jensen wrote:
>
> I am making progress! Yahoo! :)
> Please, can anyone tell me how to make the plus symbol appear
> after adding a first node to the VST?
> Of course, I have set ChildCount for the first node to a value > 0,
> but the plus symbol does not show.

VTree.HasChildren[Node] := true;

This sets a flag in the TVirtualNode record and the node will be painted
with the plus. Do not set the flag directly, the tree will not know that
you modified one of the records. If you use OnInitNode do it there. And
defer the ChildCount setting until OnInitChildren (this is not a must but
will avoid to add children (although uninit'ed) before they are needed).

Werner


re: ValidateCache erro

From: Werner Lehmann [wl@b...]
Date: Tue Nov 6, 2001 11:43 am
Subject: Re: [VirtualTreeview] ValidateCache erro

Yur Ovchinnikov wrote:
>
> J just uploaded source project with description of how to generate a bug.
>
http://groups.yahoo.com/group/VirtualTreeview/files/BugDemos/Project1_20011106.z\
ip
> Sorry for lazy code :)
>
> In most cases error is "Integer Overflow", in any "DoValidateCache: Internal
error.
> CurrentNode is nil." (but i can identify conditions)

I could work around the problem which occurs when your instructions are
followed.
Simply replace RootNodeCount := 0 with Clear:

procedure TfrmEdit.vstControlsFocusChanged(Sender: TBaseVirtualTree;
Node: PVirtualNode; Column: Integer);
var
v_fdata: pControlInfo;
v_data: pPropertyInfo;
v_node, v_topNode: pVirtualNode;
v_i, v_j: Integer;
v_temp: String;
begin
v_fdata := Sender.GetNodeData(Node);
if assigned(v_fdata) then
begin
vstproperties.Clear; <------------------
//vstProperties.RootNodeCount := 0;

v_topNode := vstProperties.AddChild(nil);
v_data := vstProperties.GetNodeData(v_topnode);

I admit that RootNodeCount should work as well. OTOH, .Clear does a lot more
than
SetRootNodeCount. Have no time to look further into this now, a simpler demo
which
tries to provoke RootNodeCount did not show the error.

Maybe (hopefully :) Mike is already suspecting a problem here....

Werner

 | Replies | Author | Date
4494 | Re[2]: [VirtualTreeview] ValidateCache erro | Yur Ovchinnikov | Tue 11/6/2001


Re[2]: ValidateCache erro

From: Yur Ovchinnikov [Yur@s...]
Date: Tue Nov 6, 2001 12:22 pm
Subject: Re[2]: [VirtualTreeview] ValidateCache erro

Hello Werner,

Tuesday, November 06, 2001, 1:43:28 PM, you wrote:

WL> Yur Ovchinnikov wrote:
>>
>> J just uploaded source project with description of how to generate a bug.
>>
http://groups.yahoo.com/group/VirtualTreeview/files/BugDemos/Project1_20011106.z\
ip
>> Sorry for lazy code :)
>>
>> In most cases error is "Integer Overflow", in any "DoValidateCache: Internal
error.
>> CurrentNode is nil." (but i can identify conditions)

WL> I could work around the problem which occurs when your instructions are
followed.
WL> Simply replace RootNodeCount := 0 with Clear:

WL> procedure TfrmEdit.vstControlsFocusChanged(Sender: TBaseVirtualTree;
WL> Node: PVirtualNode; Column: Integer);
WL> var
WL> v_fdata: pControlInfo;
WL> v_data: pPropertyInfo;
WL> v_node, v_topNode: pVirtualNode;
WL> v_i, v_j: Integer;
WL> v_temp: String;
WL> begin
WL> v_fdata := Sender.GetNodeData(Node);
WL> if assigned(v_fdata) then
WL> begin
WL> vstproperties.Clear; <------------------
WL> //vstProperties.RootNodeCount := 0;

WL> v_topNode := vstProperties.AddChild(nil);
WL> v_data := vstProperties.GetNodeData(v_topnode);

WL> I admit that RootNodeCount should work as well. OTOH, .Clear does a lot
more than
WL> SetRootNodeCount. Have no time to look further into this now, a simpler
demo which
WL> tries to provoke RootNodeCount did not show the error.

Thnks, this work too. One of the troubles with VTV is lacking of
documentation...

WL> Maybe (hopefully :) Mike is already suspecting a problem here....

WL> Werner

--
Best regards,
Yur Ovchinnikov E-mail: [yur@s...]
JSC Summit WWW: http://alone.come.to
ICQ: 1400397


VT 2.6.5 double declare using BCB

From: "Roland" [Beduerftig@S...]
Date: Tue Nov 6, 2001 12:56 pm
Subject: VT 2.6.5 double declare using BCB

Hallo,

I try to use VT 2.6.5 with BCB5.

Step 1
I delete all "not important" files (see description from Milan)

Step 2
I expand all from zip

Step 3
compile with 0 error 0 warning - Ok

Step 4
Load my aktual project and build new

following error will be shown:

JwaTmSchema.hpp(326): E2238 TXT_DISPLAYNAME more the once declared
JwaTmSchema.hpp(318): E2344 TXT_DISPLAYNAME already declared
and so on until the compiler break => too many errors or messages

Step 5

I look at JwaTmSchema.hpp
in line 18 is: #include "tmschema.h"

I look at tmschema.h
in line 136 is: #define TMT_FIRST_RCSTRING_NAME TMT_DISPLAYNAME

now back to JwaTmSchema.hpp
in line 318 is: static const Word TMT_DISPLAYNAME = 0x259;
in line 326 is: static const Word TMT_FIRST_RCSTRING_NAME = 0x259;

and this is the same with the other errors !

best regards
Roland

 | Replies | Author | Date
4496 | Re: VT 2.6.5 double declare using BCB | Vandrovec Milan | Tue 11/6/2001
4499 | Re: VT 2.6.5 double declare using BCB | Roland | Tue 11/6/2001
4569 | Re: VT 2.6.5 double declare using BCB | Mike Lischke | Sat 11/10/2001
4587 | Re: VT 2.6.5 double declare using BCB | Roland | Mon 11/12/2001
4671 | Re: VT 2.6.5 double declare using BCB | Mike Lischke | Sun 11/18/2001
4501 | Re: VT 2.6.5 double declare using BCB | Vandrovec Milan | Tue 11/6/2001
4589 | Re: VT 2.6.5 double declare using BCB | Vandrovec Milan | Mon 11/12/2001
4672 | Re: VT 2.6.5 double declare using BCB | Mike Lischke | Sun 11/18/2001


re: VT 2.6.5 double declare using BCB

From: Vandrovec Milan [milan_va@s...]
Date: Tue Nov 6, 2001 1:05 pm
Subject: RE: [VirtualTreeview] VT 2.6.5 double declare using BCB

Hello.

> Step 4
> Load my aktual project and build new
>
> following error will be shown:
>
> JwaTmSchema.hpp(326): E2238 TXT_DISPLAYNAME more the once declared
> JwaTmSchema.hpp(318): E2344 TXT_DISPLAYNAME already declared
> and so on until the compiler break => too many errors or messages

You have to use the modified JwaTmSchema.pas supplied in my package, not hte
original one. Modifications look similar to this:

{$IFNDEF BCB}
TMT_FIRST_RCSTRING_NAME = TMT_DISPLAYNAME;
TMT_LAST_RCSTRING_NAME = TMT_DESCRIPTION;
{$ENDIF}
And so on.

Also, you will have to remove the {$WEAKPACKAGEUNIT} directive from
JwaUxTheme.pas.

Using the files from "VT2_6_5 for CPPB.zip" should help.

Milan Vandrovec

 | Replies | Author | Date
4499 | Re: VT 2.6.5 double declare using BCB | Roland | Tue 11/6/2001
4569 | Re: VT 2.6.5 double declare using BCB | Mike Lischke | Sat 11/10/2001
4587 | Re: VT 2.6.5 double declare using BCB | Roland | Mon 11/12/2001
4671 | Re: VT 2.6.5 double declare using BCB | Mike Lischke | Sun 11/18/2001


Locking the first column?

From: [inakshin@y...]
Date: Tue Nov 6, 2001 3:09 pm
Subject: Locking the first column?

How difficult would it be to implement column locking
functionality, similar to excel? I.e. preventing the
first column (main column) from scrolling out of the
view?

Igor
[inakshin@s...]

 | Replies | Author | Date
4500 | Re: Locking the first column? | Werner Lehmann | Tue 11/6/2001
4570 | Re: Locking the first column? | Mike Lischke | Sat 11/10/2001


re: Checking parent nodes of a tree programatically?

From: [tvav@h...]
Date: Tue Nov 6, 2001 4:02 pm
Subject: Re: Checking parent nodes of a tree programatically?

> Change this:
>
> if assigned(SelNode) then
> begin
> SelNode.CheckState := csCheckedNormal;
> Invalidate;
> end;
>
> to:
>
> if assigned(SelNode) then
> begin
> VirtualStringTree1.CheckState[SelNode] :=
> csCheckedNormal;
> Invalidate;
> end;
>
> VT is not aware of the change when setting the node directly.
>

Jim,
That makes sense! (and works fine of course).
Thanks
Tony


re: VT 2.6.5 double declare using BCB

From: "Roland" [Beduerftig@S...]
Date: Tue Nov 6, 2001 4:19 pm
Subject: Re: VT 2.6.5 double declare using BCB

Hello Milan, hello Mike,

I found your package with the modification. It is Ok, but ......

The basic question is:

Isn't it the better way to have only one source for delphi and BCB ?

My opinion is:

- the idea with the workaround from Milan to delete all
"unimportant files" before the compilation of the
project VT is Ok.
- 2 different source codes for VT is not a good way

My problem is:

I work the WinNT4Sp5 and with this OS I can't test the new feature
you (Mike) build in, for example the theme for Win2k or WinXP, then I
can only copy your source compile and use VT without this feature.

Mike write VT xxxx release candidate y, and this was the reason why I
try to update from a older version to the actual version, that the
difference between the used version and the actual version will not
so great.

best regards
Roland

> You have to use the modified JwaTmSchema.pas supplied in my
package, not hte
> original one. Modifications look similar to this:
>
> {$IFNDEF BCB}
> TMT_FIRST_RCSTRING_NAME = TMT_DISPLAYNAME;
> TMT_LAST_RCSTRING_NAME = TMT_DESCRIPTION;
> {$ENDIF}
> And so on.
>
> Also, you will have to remove the {$WEAKPACKAGEUNIT} directive from
> JwaUxTheme.pas.
>
> Using the files from "VT2_6_5 for CPPB.zip" should help.
>
> Milan Vandrovec


re: Locking the first column?

From: Werner Lehmann [wl@b...]
Date: Tue Nov 6, 2001 4:17 pm
Subject: Re: [VirtualTreeview] Locking the first column?

> How difficult would it be to implement column locking
> functionality, similar to excel? I.e. preventing the
> first column (main column) from scrolling out of the
> view?

This is on the wishlist (see YG database) but not so easy to
implement. Will most likely not come before the next 'final'
non beta release.

Werner


re: Re: VT 2.6.5 double declare using BCB

From: Vandrovec Milan [milan_va@s...]
Date: Tue Nov 6, 2001 4:46 pm
Subject: RE: [VirtualTreeview] Re: VT 2.6.5 double declare using BCB

Hello.

> Isn't it the better way to have only one source for delphi and BCB ?

Yes, there is: Mike will obey :-)
I use Delphi version of my package daily, and it is OK under Delphi5. So I
believe this can replace the original package. The only trouble would be
adding new files to the package, if I was offline for some time - then
somebody else would have to add it from BCB and upload. However, right now
the filenames are pretty stable, the only change I can think of was adding
VTHeaderPopupMenu - and you could live without it.

> - the idea with the workaround from Milan to delete all
> "unimportant files" before the compilation of the
> project VT is Ok.

It has to do with the BCB problem that a click on "Compile" does not always
Compile, but only say it is compiling, but leave the original files.
(compilation is ok, but the linking is very fast). Now I solve it using a
Project Group for all 5 packages (VT, VTD, VT_Addons, VST, VSTD), and use
Build All. But still, sometimes the full-clear is needed. Anyway, this has
nothing to do with the sources.

> My problem is:
>
> I work the WinNT4Sp5 and with this OS I can't test the new feature
> you (Mike) build in, for example the theme for Win2k or WinXP, then I
> can only copy your source compile and use VT without this feature.

And where is the problem? Me too don't have WinXP, so there is some
functionality I cannot test. I only make sure I can compile it.

Milan Vandrovec


sorting/comparing

From: [rhymebusta@h...]
Date: Tue Nov 6, 2001 5:23 pm
Subject: sorting/comparing

hi just have a question on sorting the nodes of a string tree.
do i have to assing the Sort() methode to one that i created or do i
override it(since it's virtual)? and then do i have to do something
with the OnCompareNode() method????
i just wanna know how to start off.
thanks

 | Replies | Author | Date
4503 | Re: sorting/comparing | Paul D'Agosta | Tue 11/6/2001
4504 | Re: sorting/comparing | Paul D'Agosta | Tue 11/6/2001
4505 | Re: sorting/comparing | [rhymebusta@h...] | Tue 11/6/2001
4507 | Re: sorting/comparing | Paul D'Agosta | Tue 11/6/2001
4561 | RootNode Parent | Jim Kueneman | Sat 11/10/2001
4563 | Re: RootNode Parent | Mike Lischke | Sat 11/10/2001
4564 | Re: RootNode Parent | Ralf Melles | Sat 11/10/2001
4576 | Re: RootNode Parent | Mike Lischke | Sat 11/10/2001


re: sorting/comparing

From: "Paul D'Agosta" [pdagosta@c...]
Date: Tue Nov 6, 2001 6:13 pm
Subject: Re: sorting/comparing

--- In [VirtualTreeview@y...], [rhymebusta@h...] wrote:
> hi just have a question on sorting the nodes of a string tree.
> do i have to assing the Sort() methode to one that i created or do i
> override it(since it's virtual)? and then do i have to do something
> with the OnCompareNode() method????
> i just wanna know how to start off.
> thanks

All you need is an OnCompareNode event handler. You will receive two
Nodes pointers and a column (which is set in Header.SortColumn).
Simply assign a value to Result to tell the tree which Node is larger.

Result < 0 means Node1 is larger
Result > 0 means Node2 is larger
Result = 0 means Node1 and Node2 are equal

Sample Code:

procedure TForm1.VirtualStringTree1CompareNodes(Sender:
TBaseVirtualTree; Node1,Node2: PVirtualNode; Column: Integer; var
Result: Integer);
var
dataptr1,
dataptr2:PDataRec;
begin
dataptr1 := sender.getnodedata(node1);
dataptr2 := sender.getnodedata(node2);

//ANSI strings case sensitive
result := ANSICompareStr(dataptr1^.Field,dataptr2^.Field);
//or ANSI strings case insensitive
result := ANSICompareText(dataptr1^.Field,dataptr2^.Field);
//or Numeric data
result := dataptr2^.IntField - dataptr1^.IntField;

end;

Paul

 | Replies | Author | Date
4504 | Re: sorting/comparing | Paul D'Agosta | Tue 11/6/2001
4505 | Re: sorting/comparing | [rhymebusta@h...] | Tue 11/6/2001
4507 | Re: sorting/comparing | Paul D'Agosta | Tue 11/6/2001
4561 | RootNode Parent | Jim Kueneman | Sat 11/10/2001
4563 | Re: RootNode Parent | Mike Lischke | Sat 11/10/2001
4564 | Re: RootNode Parent | Ralf Melles | Sat 11/10/2001
4576 | Re: RootNode Parent | Mike Lischke | Sat 11/10/2001


re: sorting/comparing

From: "Paul D'Agosta" [pdagosta@c...]
Date: Tue Nov 6, 2001 6:18 pm
Subject: Re: sorting/comparing

CORRECTION:
> Result < 0 means Node1 is larger
> Result > 0 means Node2 is larger
Should be:
Result > 0 means Node1 is larger
Result < 0 means Node2 is larger

> //or Numeric data
> result := dataptr2^.IntField - dataptr1^.IntField;
>
Should be:
result := dataptr1^.IntField - dataptr2^.IntField;

Sorry about that :)

Paul

 | Replies | Author | Date
4505 | Re: sorting/comparing | [rhymebusta@h...] | Tue 11/6/2001
4507 | Re: sorting/comparing | Paul D'Agosta | Tue 11/6/2001
4561 | RootNode Parent | Jim Kueneman | Sat 11/10/2001
4563 | Re: RootNode Parent | Mike Lischke | Sat 11/10/2001
4564 | Re: RootNode Parent | Ralf Melles | Sat 11/10/2001
4576 | Re: RootNode Parent | Mike Lischke | Sat 11/10/2001


re: sorting/comparing

From: [rhymebusta@h...]
Date: Tue Nov 6, 2001 7:16 pm
Subject: Re: sorting/comparing

--- In [VirtualTreeview@y...], "Paul D'Agosta" [pdagosta@c...] wrote:
>
> CORRECTION:
> > Result < 0 means Node1 is larger
> > Result > 0 means Node2 is larger
> Should be:
> Result > 0 means Node1 is larger
> Result < 0 means Node2 is larger
>
> > //or Numeric data
> > result := dataptr2^.IntField - dataptr1^.IntField;
> >
> Should be:
> result := dataptr1^.IntField - dataptr2^.IntField;
>
> Sorry about that :)
>
> Paul
sorry......i should have been more specific.....what if i have an
application that uses my TVirtualStringTree object that i created and
i have a sort method in my calling application and i've implemented a
generic function pointer(in my TVirtualStringTree object) that points
to the calling app's sorting function....so that i can re-use this
TVirtualStringTree object with several different applications.

 | Replies | Author | Date
4507 | Re: sorting/comparing | Paul D'Agosta | Tue 11/6/2001
4561 | RootNode Parent | Jim Kueneman | Sat 11/10/2001
4563 | Re: RootNode Parent | Mike Lischke | Sat 11/10/2001
4564 | Re: RootNode Parent | Ralf Melles | Sat 11/10/2001
4576 | Re: RootNode Parent | Mike Lischke | Sat 11/10/2001


DB Check TreeView $$$

From: "Wayne Fulcher" [wayne@d...]
Date: Tue Nov 6, 2001 8:44 pm
Subject: DB Check TreeView $$$

I have a small project I would like to get some help on using the VT
component.
I want to use the VT as a DBCheckTreeView.
To explain, I have a database with the following columns:
Genre, Artist, Album, Track Number, Title.
I want to display the contents of my database, sorted in the same order, in
the TreeView.
The purpose of the check boxes would allow the user to check certain nodes
then maybe on a split screen indicate a change like
"change the Genre to 'Country' for every node that is checked"
At that point I would want to update the database and update the treeview,
understanding that now some nodes may have a different parent.
(ie if the artist "Pink Floyd" was under Metal but has now been moved to
Rock then the change should be reflected in the TreeView.)

Anyway that will give you an idea as to what I need.
Is this really simple to do or is there more to it than I realize.
I just found this component the other day and I would like to get this done
somewhat quickly.
If someone would be interested in helping me I would really appreciate it.
If you are interested then send me an email and we can work out the details.

Thanks,
Wayne Fulcher
[wayne@d...]


re: sorting/comparing

From: "Paul D'Agosta" [pdagosta@c...]
Date: Tue Nov 6, 2001 11:15 pm
Subject: Re: sorting/comparing

> sorry......i should have been more specific.....what if i have an
> application that uses my TVirtualStringTree object that i created
and
> i have a sort method in my calling application and i've implemented
a
> generic function pointer(in my TVirtualStringTree object) that
points
> to the calling app's sorting function....so that i can re-use this
> TVirtualStringTree object with several different applications.

It would be difficult to use a sort algorithm outside of the tree to
sort the tree nodes, because of the internal linked list structure.
All you should need is a comparison function for OnCompareNodes and
call VST.Sort(...) or set AutoSort in the options.
The comparison function could use a library procedure to determine
which comes first.

To move the comparison inside the tree would destroy the virtualness
of the tree.

I'm not sure I'm fully understanding you.
Maybe another person in the group can help as well.

Paul

 | Replies | Author | Date
4561 | RootNode Parent | Jim Kueneman | Sat 11/10/2001
4563 | Re: RootNode Parent | Mike Lischke | Sat 11/10/2001
4564 | Re: RootNode Parent | Ralf Melles | Sat 11/10/2001
4576 | Re: RootNode Parent | Mike Lischke | Sat 11/10/2001


re: HELP FILE !

From: Werner Lehmann [wl@b...]
Date: Tue Nov 6, 2001 11:58 pm
Subject: Re: [VirtualTreeview] HELP FILE !

Hi,

I have just documented the events from TCustomVirtualStringTree. But - I don't
see *any* events in the CHM. How can I get them? There is also the third page
missing which lets you do a full text search...

Werner

 | Replies | Author | Date
4523 | Re: HELP FILE ! | Mike Lischke | Wed 11/7/2001


Stride50 package!~!~

From: Harry Yau [harry@r...]
Date: Wed Nov 7, 2001 1:26 am
Subject: Stride50 package!~!~

Hi Hi All:
I am new to this list and also new to "VirtualTreeView"
I am wondering where I can download the package
that required to run VirtualTreeView -- "stride50."
I wanna try out the VirtualTreeView, However, delphi 5
keeps complian me about miss a required package "stride50."
Please, would many one mind to help me out!

Harry Yau (^o^)

[Non-text portions of this message have been removed]

 | Replies | Author | Date
4510 | Re: Stride50 package!~!~ | Jim Kueneman | Wed 11/7/2001
4511 | Re: Stride50 package!~!~ | Harry Yau | Wed 11/7/2001
4512 | Re: Stride50 package!~!~ | Wim van der Vegt | Wed 11/7/2001
4513 | Re: Stride50 package!~!~ | Harry Yau | Wed 11/7/2001


re: Stride50 package!~!~

From: "Jim Kueneman" [jimdk@m...]
Date: Wed Nov 7, 2001 3:00 am
Subject: Re: Stride50 package!~!~

--- In [VirtualTreeview@y...], Harry Yau [harry@r...] wrote:
> I wanna try out the VirtualTreeView, However, delphi 5
> keeps complian me about miss a required package "stride50."
> Please, would many one mind to help me out!

?? Is this D5 Standard?

Jim


re: Re: Stride50 package!~!~

From: Harry Yau [harry@r...]
Date: Wed Nov 7, 2001 3:21 am
Subject: Re: [VirtualTreeview] Re: Stride50 package!~!~

No, I am using Delphi 5 Enterprise.
Thank for your reply

Harry Yau

Jim Kueneman wrote:

> --- In [VirtualTreeview@y...], Harry Yau [harry@r...] wrote:
> > I wanna try out the VirtualTreeView, However, delphi 5
> > keeps complian me about miss a required package "stride50."
> > Please, would many one mind to help me out!
>
> ?? Is this D5 Standard?
>
> Jim
>
> To unsubscribe from this group, send an email to:
> VirtualTreeview-unsubscribe@egroups.com
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/


re: Re: Stride50 package!~!~

From: "Wim van der Vegt" [wvd_vegt@k...]
Date: Wed Nov 7, 2001 8:43 am
Subject: Re: [VirtualTreeview] Re: Stride50 package!~!~

Hi,

It's standard D5EE allright (got a bpl with that name in the Delphi5\Bin
Directory). I'm using D5EE With UpdatePack 1 (Build 6.18) and it's present
there. It's version info says 'String Resource Editor IDE Package' so my guess
is you did an incomplete install of D5. Have a look on the D5 CD, it should be
there somewhere.

----------------
Wim van der Vegt

----- Original Message -----
From: Harry Yau
To: [VirtualTreeview@yahoogroups.com
Sent: Wednesday, November 07, 2001 4:21 AM
Subject: Re: [VirtualTreeview] Re: Stride50 package!~!~

No, I am using Delphi 5 Enterprise.
Thank for your reply

Harry Yau

Jim Kueneman wrote:

> --- In [VirtualTreeview@y...], Harry Yau <harry@r...] wrote:
> > I wanna try out the VirtualTreeView, However, delphi 5
> > keeps complian me about miss a required package "stride50."
> > Please, would many one mind to help me out!
>
> ?? Is this D5 Standard?
>
> Jim
>
> To unsubscribe from this group, send an email to:
> VirtualTreeview-unsubscribe@egroups.com
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/

To unsubscribe from this group, send an email to:
VirtualTreeview-unsubscribe@egroups.com

Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.

[Non-text portions of this message have been removed]


re: Re: Stride50 package!~!~

From: Harry Yau [harry@r...]
Date: Wed Nov 7, 2001 10:13 am
Subject: Re: [VirtualTreeview] Re: Stride50 package!~!~

Ooops, I got it work now, coz I checked "Build RunTime Package" option before.
Thank You Very Much.

Harry Yau (o^_^o)

Wim van der Vegt wrote:

> Hi,
>
> It's standard D5EE allright (got a bpl with that name in the Delphi5\Bin
Directory). I'm using D5EE With UpdatePack 1 (Build 6.18) and it's present
there. It's version info says 'String Resource Editor IDE Package' so my guess
is you did an incomplete install of D5. Have a look on the D5 CD, it should be
there somewhere.
>
> ----------------
> Wim van der Vegt
>
> ----- Original Message -----
> From: Harry Yau
> To: [VirtualTreeview@yahoogroups.com
> Sent: Wednesday, November 07, 2001 4:21 AM
> Subject: Re: [VirtualTreeview] Re: Stride50 package!~!~
>
> No, I am using Delphi 5 Enterprise.
> Thank for your reply
>
> Harry Yau
>
> Jim Kueneman wrote:
>
> > --- In [VirtualTreeview@y...], Harry Yau <harry@r...] wrote:
> > > I wanna try out the VirtualTreeView, However, delphi 5
> > > keeps complian me about miss a required package "stride50."
> > > Please, would many one mind to help me out!
> >
> > ?? Is this D5 Standard?
> >
> > Jim
> >
> > To unsubscribe from this group, send an email to:
> > VirtualTreeview-unsubscribe@egroups.com
> >
> >
> >
> > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
> To unsubscribe from this group, send an email to:
> VirtualTreeview-unsubscribe@egroups.com
>
> Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
>
> [Non-text portions of this message have been removed]
>
> To unsubscribe from this group, send an email to:
> VirtualTreeview-unsubscribe@egroups.com
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/


Drag and drop problem again!

From: [jogador3@y...]
Date: Wed Nov 7, 2001 10:48 am
Subject: Drag and drop problem again!

Hi!

I had implemented the drag and drop with
MoveTo and CopyTo, but I know that this is not
the best way. I would like to use the ProcessDrop,
but I just can't get it to work. Somebody help me!

The VT version I am using is 2.5.34. Do I need to
register a clipboardformat, create a DataObject or a
DragManager, or something else? Which are the options
and properties I have to set? Do I need to do something
"special" in DragOver and DragAllow besides allow and accept?

My simplified DragDrop method is:
//--------------------------------------------------------------------
---------------------------
procedure Tform1.VSTDragDrop(Sender: TBaseVirtualTree; Source:
TObject; DataObject: IDataObject;
Formats: TFormatArray; Shift: TShiftState; Pt: TPoint; var Effect:
Integer; Mode: TDropMode);
begin
AttachMode := amInsertAfter; //just for example
FVST.ProcessDrop(DataObject, FVST.DropTargetNode, Effect,
AttachMode);
end;
//--------------------------------------------------------------------
---------------------------

Thanks a lot,

Trevis

 | Replies | Author | Date
4515 | Re: Drag and drop problem again! | [jogador3@y...] | Wed 11/7/2001


re: Drag and drop problem again!

From: [jogador3@y...]
Date: Wed Nov 7, 2001 12:09 pm
Subject: Re: Drag and drop problem again!

I found out the problem!

The missing "magical" line was
VST.ClipboardFormats.Add('Virtual Tree Data');

Thanks

Trevis

--- In [VirtualTreeview@y...], [jogador3@y...] wrote:
> Hi!
>
> I had implemented the drag and drop with
> MoveTo and CopyTo, but I know that this is not
> the best way. I would like to use the ProcessDrop,
> but I just can't get it to work. Somebody help me!
>
> The VT version I am using is 2.5.34. Do I need to
> register a clipboardformat, create a DataObject or a
> DragManager, or something else? Which are the options
> and properties I have to set? Do I need to do something
> "special" in DragOver and DragAllow besides allow and accept?
>
> My simplified DragDrop method is:
> //------------------------------------------------------------------
--
> ---------------------------
> procedure Tform1.VSTDragDrop(Sender: TBaseVirtualTree; Source:
> TObject; DataObject: IDataObject;
> Formats: TFormatArray; Shift: TShiftState; Pt: TPoint; var
Effect:
> Integer; Mode: TDropMode);
> begin
> AttachMode := amInsertAfter; //just for example
> FVST.ProcessDrop(DataObject, FVST.DropTargetNode, Effect,
> AttachMode);
> end;
> //------------------------------------------------------------------
--
> ---------------------------
>
> Thanks a lot,
>
> Trevis


vsInitialUserData may cause memory leaks

From: GIANNAKOPOULOS KOSTAS [kyan@s...]
Date: Wed Nov 7, 2001 2:16 pm
Subject: vsInitialUserData may cause memory leaks

Hello, everybody.

I came across a strange "quirk". I managed to create a memory leak in a
TVirtualStringTree that i cannot solve, not "decently" at least.
I decided to use AddChild(Node) to add my nodes and then i used GetNodeData
to set the values to my user data record, that has some ref-counted members.
The problem is that the node's state does not include vsInitialUserData,
since i didn't pass a pointer to AddChild, so, if the node is never Init'ed
(if for instance it is never scrolled into view) then OnFreeNode will not be
called for it, leaving the refcounted data in memory.
The reason for this is the check in method DoFreeNode:
if Assigned(FOnFreeNode) and ([vsInitialized, vsInitialUserData] *
Node.States <> []) then
FOnFreeNode(Self, Node);

Maybe it should call OnFreeNode regardless of whether it has been
initialized or if it has "Initial user data"? I don't know, it is very
difficult for VT to detect if a node actually *HAS* user data that need
deallocating, so the flag vsInitialUserData doesn't make much sense to me
(sorry Mike).

Or if not, how can i solve this without "indecent" ways, like doing

Include(Node.States, vsInitialUserData);

after i setup my data, or passing a dummy pointer to AddChild() with the
risk of breaking the automatic refcounting Delphi does?

Thank you in advance for any help.

 | Replies | Author | Date
4521 | Re: vsInitialUserData may cause memory leaks | Werner Lehmann | Wed 11/7/2001
4528 | Re: vsInitialUserData may cause memory leaks | GIANNAKOPOULOS KOSTAS | Thu 11/8/2001
4572 | Re: vsInitialUserData may cause memory leaks | Mike Lischke | Sat 11/10/2001
4591 | Re: vsInitialUserData may cause memory leaks | GIANNAKOPOULOS KOSTAS | Mon 11/12/2001


caption editing of node

From: [rhymebusta@h...]
Date: Wed Nov 7, 2001 7:46 pm
Subject: caption editing of node

hi i was wondering if there was any methods or something that i can
call to allow the user to be able to edit the caption of the node
i.e. Let's say i have a popup menu that popups up when a user right
clicks on the node and one of the options in the menu is "Rename".
now...i want to able to allow the user to rename the node in the same
manner as though they had single clicked in the text field of the node
(you know, it takes a split second but it eventually allows u to edit
the text)
so my question is:
is there anything that i can call(method or doXXX) that would allow
me to do that?

 | Replies | Author | Date
4519 | Re: caption editing of node | Helge Jung (ECO-Logic) | Wed 11/7/2001
4520 | Re: caption editing of node | Werner Lehmann | Wed 11/7/2001
4522 | Re: caption editing of node | [rhymebusta@h...] | Wed 11/7/2001
4525 | Re: caption editing of node | Werner Lehmann | Wed 11/7/2001


Test

From: "Alexandr Golubev" [a.golubev@p...]
Date: Wed Nov 7, 2001 7:49 pm
Subject: Test

Test
-------------------------------------------------
E-Mail: [a.golubev@p...]

[Non-text portions of this message have been removed]


re: caption editing of node

From: "Helge Jung \(ECO-Logic\)" [helge@e...]
Date: Wed Nov 7, 2001 7:51 pm
Subject: Re: [VirtualTreeview] caption editing of node

> hi i was wondering if there was any methods or something that i can
> call to allow the user to be able to edit the caption of the node
> i.e. Let's say i have a popup menu that popups up when a user right
> clicks on the node and one of the options in the menu is "Rename".
> now...i want to able to allow the user to rename the node in the same
> manner as though they had single clicked in the text field of the node
> (you know, it takes a split second but it eventually allows u to edit
> the text)
> so my question is:
> is there anything that i can call(method or doXXX) that would allow
> me to do that?
>

Set the Editable-flag in the Options and check OnNewNode and the OnEditXXX
events. AFAIK there's also a EditNode method.

Helge.


re: caption editing of node

From: Werner Lehmann [wl@b...]
Date: Wed Nov 7, 2001 7:53 pm
Subject: Re: [VirtualTreeview] caption editing of node

[rhymebusta@h...] wrote:
>
> (you know, it takes a split second but it eventually allows u to edit

EditNode().

Werner

 | Replies | Author | Date
4522 | Re: caption editing of node | [rhymebusta@h...] | Wed 11/7/2001


re: vsInitialUserData may cause memory leaks

From: Werner Lehmann [wl@b...]
Date: Wed Nov 7, 2001 7:57 pm
Subject: Re: [VirtualTreeview] vsInitialUserData may cause memory leaks

GIANNAKOPOULOS KOSTAS wrote:
>
> Or if not, how can i solve this without "indecent" ways, like doing
>
> Include(Node.States, vsInitialUserData);

I don't see what's wrong with this.

After all you init'ed the node manually. Not much different from what
AddChild with second parameter does: both avoid OnInitNode. Do you
want a property

property Initialized[Node: PVirtualNode]: Boolean read GetInitialized write
SetInitialized;

?

That would also look quite odd if one hasn't your special case in mind.

Werner


re: caption editing of node

From: [rhymebusta@h...]
Date: Wed Nov 7, 2001 8:03 pm
Subject: Re: caption editing of node

--- In [VirtualTreeview@y...], Werner Lehmann [wl@b...] wrote:
> [rhymebusta@h...] wrote:
> >
> > (you know, it takes a split second but it eventually allows u to
edit
>
> EditNode().
>
> Werner

thanks! that's perfect......it worked....just that since i forgot
that i didn't have any columns it crashed the first time(i had put 0
for the columns parameter, then i put -1 just to test it out and it
worked).


re: HELP FILE !

From: "Mike Lischke" [lists@l...]
Date: Wed Nov 7, 2001 8:15 pm
Subject: RE: [VirtualTreeview] HELP FILE !

Hi Werner,

> I have just documented the events from TCustomVirtualStringTree. But - I don't
> see *any* events in the CHM. How can I get them? There is also the third page
> missing which lets you do a full text search...

Thank you for taking the time and doing some documentation! I'm happy that you
take T2H with all its
quirks to do the job, that makes things for me much easier. Unfortunately,
threre are some really
disadvantages which almost got me to switch to another tool. Only two points
kept me so far from
doing so: I already paid my copy and the others are either not doing a god job
either or are
extremly expensive (e.g. doc-o-matic, my tool of choice, costs nearly 10x more
than T2H, do document
open source it is much to much).

One of the drawbacks in T2H is that it will not display the stuff from
TCustomXXX variants of class
in the overview or in the index. With the full text search you would find it
however. IIRC then you
can modify the help project (hpj) to get the full text search page, but I am
not sure. I can upload
the entire help project once my internet connection is open again (DSL line is
broken currently).

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: HELP FILE !

From: Werner Lehmann [wl@b...]
Date: Wed Nov 7, 2001 10:29 pm
Subject: Re: [VirtualTreeview] HELP FILE !

Hi Mike,

> > I have just documented the events from TCustomVirtualStringTree. But - I
don't
> > see *any* events in the CHM. How can I get them? There is also the third
page
> > missing which lets you do a full text search...
>
> Thank you for taking the time and doing some documentation! I'm happy that
you take T2H with all its
> quirks to do the job, that makes things for me much easier. Unfortunately,
threre are some really
> disadvantages which almost got me to switch to another tool. Only two points
kept me so far from
> doing so: I already paid my copy and the others are either not doing a god
job either or are
> extremly expensive (e.g. doc-o-matic, my tool of choice, costs nearly 10x
more than T2H, do document
> open source it is much to much).

maybe 'open source' is a magic door opener here... did you mail them about it?
;) OTOH,
it is questionable if these tool will be able to import the T2H source.

> One of the drawbacks in T2H is that it will not display the stuff from
TCustomXXX variants of class
> in the overview or in the index. With the full text search you would find it
however. IIRC then you
> can modify the help project (hpj) to get the full text search page, but I am
not sure. I can upload
> the entire help project once my internet connection is open again (DSL line
is broken currently).

I see the TCustom* stuff both in index and on the start page where all classes
etc are
listed. What I do *not* see is *any* event, protected or not. T2H knows about
them because
it let me document them but in the CHM they're gone somehow. I wanted to test
if a link
like this <See Event=TCustomVirtualStringTree.OnNewText Text=OnNewText> works
finally. It
does not in the T2H preview. If possible I would like to have something shorter
than the
<A> tag, also with (a little) respect to other output in WinHelp format.
Little, because
I do use <ul> and <li>.

Werner


re: Re: caption editing of node

From: Werner Lehmann [wl@b...]
Date: Wed Nov 7, 2001 10:31 pm
Subject: Re: [VirtualTreeview] Re: caption editing of node

[rhymebusta@h...] wrote:
>
> thanks! that's perfect......it worked....just that since i forgot
> that i didn't have any columns it crashed the first time(i had put 0
> for the columns parameter, then i put -1 just to test it out and it
> worked).

:)

You may simply use Header.MainColumn instead. At least as long as you want
to edit the main column...

Werner


hottrack

From: "Body Closed" [bodyclosed@y...]
Date: Thu Nov 8, 2001 2:27 am
Subject: hottrack

How to make a hottrack with underline bar in blue color? Like Delphi
treeview?

I activate hottrack and the underline is black, i try found some
propertie to change but fail, are possible???

Thanx all

 | Replies | Author | Date
4527 | Re: hottrack | Jim Kueneman | Thu 11/8/2001


re: hottrack

From: Jim Kueneman [jimdk@m...]
Date: Thu Nov 8, 2001 2:26 am
Subject: Re: [VirtualTreeview] hottrack

At 11:27 PM 11/7/2001 -0300, you wrote:

> How to make a hottrack with underline bar in blue color? Like Delphi
>treeview?
>
> I activate hottrack and the underline is black, i try found some
>propertie to change but fail, are possible???

In the Object Inspector:

Colors > HotColor -> clBlue works for me.

Jim


re: vsInitialUserData may cause memory leaks

From: GIANNAKOPOULOS KOSTAS [kyan@s...]
Date: Thu Nov 8, 2001 8:30 am
Subject: RE: [VirtualTreeview] vsInitialUserData may cause memory leaks

> property Initialized[Node: PVirtualNode]: Boolean read
> GetInitialized write SetInitialized;

No, no, that's OK.

If you say that Include(Node.States, vsInitialUserData) is decent (and Mike
concurs) then it's fine with me.

I agree about the property being odd. i just try to keep in mind that if i
misuse a "quirk" it may turn aroung and bite me in the future (for instance
the quirk may be corrected) and i will have to rewrite lots of code.

Thanks.


[no subject]

From: "Centre of SLC" [centrslc@m...]
Date: Thu Nov 8, 2001 8:34 am
Subject:

[Non-text portions of this message have been removed]


Problem with CheckState

From: [d.faessler@p...]
Date: Thu Nov 8, 2001 1:32 pm
Subject: Problem with CheckState

Hi

First, I would say that I find VirtualTreeview is an excellent
component. I had, like some others, problems with
AutoTristateTracking. If you set the CheckState, it sometimes would
not refresh all parent nodes. I've found the bug (or future?). If you
add a node, the checkstate of this node has default value. If this
value is the same as you set programmicly there is no event which
would refresh the parents. So I first set the CheckState to a value
not used in my program and then set the normal state:

MyTree.CheckState[node1] := csMixedNormal;
if Locked then
MyTree.CheckState[node1] := csUncheckedNormal
else
MyTree.CheckState[node1] := csCheckedNormal;

If someone has a better idea, please post it.

Dominik Fässler

 | Replies | Author | Date
4573 | Re: Problem with CheckState | Mike Lischke | Sat 11/10/2001


canvas does not allow drawing

From: "Rony Cesana" [cesana@c...]
Date: Thu Nov 8, 2001 3:44 pm
Subject: canvas does not allow drawing

Hello everybody!
I'm new to this mailing list (actually, I had used a VirtualTreeView some
time ago, and now I'm using it once more, so I re-joined it!).
I have a problem under win98 with the VirtualTreeView... while under win2000
this doesn't show.
The message I get from the run-time system is the one in the subject.
Has any of you ever experienced this same problem?

Thanx in advance,
Rony

 | Replies | Author | Date
4532 | Re: canvas does not allow drawing | Vandrovec Milan | Thu 11/8/2001
4533 | VirtualTreeview-unsubscribe@egroups.com | Biju Dennis | Thu 11/8/2001
4534 | Re: canvas does not allow drawing | GIANNAKOPOULOS KOSTAS | Thu 11/8/2001


re: canvas does not allow drawing

From: Vandrovec Milan [milan_va@s...]
Date: Thu Nov 8, 2001 4:09 pm
Subject: RE: [VirtualTreeview] canvas does not allow drawing

Hello.

> I have a problem under win98 with the VirtualTreeView...
> while under win2000
> this doesn't show.
> The message I get from the run-time system is the one in the subject.
> Has any of you ever experienced this same problem?

"Canvas does not allow drawing" happens to me when there are no Windows
handles available. I got this sometimes... In fact, I avoided this using VT
:-). Run the System monitor in Win98. I do not know it's exact name, but
it's the one with 3 bars, showing Available system resources (System, GDI
and something). It should be all around 40-60%. If you see that the
resources go down slowly to 0 then the message appears, then your
application (or some other) does not free some handles. At least I had
exactly this problem a few times.
On W2K, the handles are limited only by memory, so it would take much longer
than in Win98. You can check in Task mamager, that the memory gets eaten.
Not sure if the Handles column shows it.

Milan Vandrovec


[VirtualTreeview-unsubscribe@egroups.com

From: Biju Dennis [Dennisbiju@y...]
Date: Thu Nov 8, 2001 4:12 pm
Subject: [VirtualTreeview-unsubscribe@egroups.com

--- Rony Cesana <cesana@c...] wrote:
> Hello everybody!
> I'm new to this mailing list (actually, I had used a
> VirtualTreeView some
> time ago, and now I'm using it once more, so I
> re-joined it!).
> I have a problem under win98 with the
> VirtualTreeView... while under win2000
> this doesn't show.
> The message I get from the run-time system is the
> one in the subject.
> Has any of you ever experienced this same problem?
>
> Thanx in advance,
> Rony
>
>

__________________________________________________
Do You Yahoo!?
Find a job, post your resume.
http://careers.yahoo.com


re: canvas does not allow drawing

From: GIANNAKOPOULOS KOSTAS [kyan@s...]
Date: Thu Nov 8, 2001 4:25 pm
Subject: RE: [VirtualTreeview] canvas does not allow drawing

I have discovered that it is very easy to bring the Win9X GDI resource pool
to its knees when you use TSpeedButtons. The reason is that each speedbutton
contains its glyph and creates an HBITMAP resource when it is shown. This
means that you get at least as many HBITMAPS as the number of speedbuttons
you have in your application.
Oh, and TDBNavigator components can eat up resources, since they contain 10
speedbuttons whose Glyphs are not common (as they ought to be).

When you have visual form inheritance things get worse because if you have,
say, 5 forms active that inherit from an abstract form with 10 speedbuttons
you get 10*5 = 50 HBITMAPS active at the same time.

My suggestion is: Don't use TSpeedButtons, use TToolButtons instead, because
they use a common HBITMAP resource contained in an imagelist. Infact i've
written a TSpeedButton descendant that can use an imagelist instead of its
embedded glyph.

Also the IDE is notorious for its appetite for resources.

> "Canvas does not allow drawing" happens to me when there are
> no Windows
> handles available. I got this sometimes... In fact, I avoided
> this using VT
> :-). Run the System monitor in Win98. I do not know it's
> exact name, but
> it's the one with 3 bars, showing Available system resources
> (System, GDI
> and something). It should be all around 40-60%. If you see that the
> resources go down slowly to 0 then the message appears, then your
> application (or some other) does not free some handles. At least I had
> exactly this problem a few times.
> On W2K, the handles are limited only by memory, so it would
> take much longer
> than in Win98. You can check in Task mamager, that the memory
> gets eaten.
> Not sure if the Handles column shows it.


OnCompareNodes question

From: [rhymebusta@h...]
Date: Thu Nov 8, 2001 7:40 pm
Subject: OnCompareNodes question

hi i was wondering when your supposed to know that some nodes are
being compared?
ie - if i have a function called
void __fastcall TMyVT::treeCompareNodes(TBaseVirtualTree *Sender,
PVirtualNode Node1, PVirtualNode Node2, int Column, int &Result);
that is called when the nodes are being compared.
....now, how do i invoke the comparison......do i use Sort() or
something else?

 | Replies | Author | Date
4536 | Re: OnCompareNodes question | Helge Jung (ECO-Logic) | Thu 11/8/2001
4537 | Re: OnCompareNodes question | Paul D'Agosta | Thu 11/8/2001
4549 | Re: OnCompareNodes question | [rhymebusta@h...] | Fri 11/9/2001
4551 | Re: OnCompareNodes question | [rhymebusta@h...] | Fri 11/9/2001
4553 | Re: OnCompareNodes question | Paul D'Agosta | Fri 11/9/2001


re: OnCompareNodes question

From: "Helge Jung \(ECO-Logic\)" [helge@e...]
Date: Thu Nov 8, 2001 7:42 pm
Subject: Re: [VirtualTreeview] OnCompareNodes question

> ....now, how do i invoke the comparison......do i use Sort() or
> something else?

I use the Sort() method in my programs but AFAIK there's also a AutoSort
option which can do that somehow also - so I would answer "yes" to your
question ;-)

Helge.

 | Replies | Author | Date
4537 | Re: OnCompareNodes question | Paul D'Agosta | Thu 11/8/2001
4549 | Re: OnCompareNodes question | [rhymebusta@h...] | Fri 11/9/2001
4551 | Re: OnCompareNodes question | [rhymebusta@h...] | Fri 11/9/2001
4553 | Re: OnCompareNodes question | Paul D'Agosta | Fri 11/9/2001


re: OnCompareNodes question

From: "Paul D'Agosta" [pdagosta@c...]
Date: Thu Nov 8, 2001 10:03 pm
Subject: Re: OnCompareNodes question

--- In [VirtualTreeview@y...], "Helge Jung \(ECO-Logic\)" [helge@e...]
wrote:
> > ....now, how do i invoke the comparison......do i use Sort() or
> > something else?
>
> I use the Sort() method in my programs but AFAIK there's also a
AutoSort
> option which can do that somehow also - so I would answer "yes" to
your
> question ;-)
>
> Helge.

I personally include the toAutoSort in TreeOptions.AutoOptions.
Be careful with toAutoSort as lots of invalidates/inserts on lots of
nodes can be expensive if you don't use BeginUpdate/EndUpdate to
ensure only one call to Sort.

Paul

 | Replies | Author | Date
4549 | Re: OnCompareNodes question | [rhymebusta@h...] | Fri 11/9/2001
4551 | Re: OnCompareNodes question | [rhymebusta@h...] | Fri 11/9/2001
4553 | Re: OnCompareNodes question | Paul D'Agosta | Fri 11/9/2001


Read INI file into TreeView?

From: "DGJ" [dgj@b...]
Date: Thu Nov 8, 2001 9:04 pm
Subject: Read INI file into TreeView?

Hi all

I am using a normal Delphi Treeview at the moment to read the win.ini file with
the following code but need checkboxes to select or unselect sections or keys
in the file. It seems much more difficult to do the same thing with the virtual
treeview. It would be ideal also to have bitmaps to reflect closed or open
nodes similar to the windows explorer.

is there an easy way?

Thanks

DGJ

Glist:=TstringList.Create;
Glist2:=TstringList.Create;
try
NewIni := TIniFile.Create(IniName); // win.ini
NewIni.ReadSections(Glist);
for i := 0 to (Glist.Count -1) do
begin
Tsec:=TreeView1.Items.AddChild (nil,Glist.Strings[i]);
Glist2.Clear;
NewIni.ReadSectionValues(Glist.Strings[i],Glist2);
for x := 0 to (Glist2.Count -1) do
begin
TreeView1.Items.AddChild(Tsec,Glist2.Strings[x]);
end;
end;
finally
Glist.Clear;
Glist.Free;
Glist2.Clear;
Glist2.Free;
end;

[Non-text portions of this message have been removed]

 | Replies | Author | Date
4540 | Re: Read INI file into TreeView? | Bender Heri | Fri 11/9/2001
4559 | Re: Read INI file into TreeView? | Werner Lehmann | Fri 11/9/2001


FocusedNode

From: [RDU@c...]
Date: Fri Nov 9, 2001 7:51 am
Subject: FocusedNode

Hello,

at first I want to tell you that my english isn´t good. I´m from
Germany. Also Sorry.

I fill my VST with Data from on Interbase Database with InitNode and
InitChild.

It is very fast, so i don´t want to use the Treeview from Borland
Delphi.

The User can locate Words in the Database. If the word is found i
want to focused the Node witch have this Data.

 | Replies | Author | Date
4541 | Re: FocusedNode | Bender Heri | Fri 11/9/2001
4542 | Re: FocusedNode | Ilia Chachkhunashvili | Fri 11/9/2001
4546 | Re: FocusedNode | Helge Jung (ECO-Logic) | Fri 11/9/2001
4548 | Re: FocusedNode | Paul Istrate | Fri 11/9/2001


re: Read INI file into TreeView?

From: Bender Heri [HBender@E...]
Date: Fri Nov 9, 2001 8:14 am
Subject: RE: [VirtualTreeview] Read INI file into TreeView?

To show the bitmaps: Prepare them in a TImageList which you assign to
VT.ImageList. In the callback (delphi event) OnGetImage you can assign one
of the bitmaps contained in the image list. You only have to check if the
node which is coming as parameter in this callback, is expanded or not.

Heri

> -----Original Message-----
> From: DGJ [mailto:[dgj@b...]]
> Sent: Thursday, November 08, 2001 10:04 PM
> To: VirtualTreeview@yahoogroups.com
> Subject: [VirtualTreeview] Read INI file into TreeView?
>
>
> Hi all
>
> I am using a normal Delphi Treeview at the moment to read the
> win.ini file with the following code but need checkboxes to
> select or unselect sections or keys in the file. It seems
> much more difficult to do the same thing with the virtual
> treeview. It would be ideal also to have bitmaps to reflect
> closed or open nodes similar to the windows explorer.
>
> is there an easy way?
>
> Thanks
>
> DGJ
>
>
> Glist:=TstringList.Create;
> Glist2:=TstringList.Create;
> try
> NewIni := TIniFile.Create(IniName); // win.ini
> NewIni.ReadSections(Glist);
> for i := 0 to (Glist.Count -1) do
> begin
> Tsec:=TreeView1.Items.AddChild (nil,Glist.Strings[i]);
> Glist2.Clear;
> NewIni.ReadSectionValues(Glist.Strings[i],Glist2);
> for x := 0 to (Glist2.Count -1) do
> begin
> TreeView1.Items.AddChild(Tsec,Glist2.Strings[x]);
> end;
> end;
> finally
> Glist.Clear;
> Glist.Free;
> Glist2.Clear;
> Glist2.Free;
> end;
>
>
>
> [Non-text portions of this message have been removed]
>
>
> ------------------------ Yahoo! Groups Sponsor
> ---------------------~-->
> Universal Inkjet Refill Kit $29.95
> Refill any ink cartridge for less!
> Includes black and color ink.
> http://us.click.yahoo.com/XwUZwC/MkNDAA/ySSFAA/i7folB/TM
> --------------------------------------------------------------
> -------~->
>
> To unsubscribe from this group, send an email to:
> VirtualTreeview-unsubscribe@egroups.com
>
>
>
> Your use of Yahoo! Groups is subject to
> http://docs.yahoo.com/info/terms/
>
>


re: FocusedNode

From: Bender Heri [HBender@E...]
Date: Fri Nov 9, 2001 8:23 am
Subject: RE: [VirtualTreeview] FocusedNode

I don't understand exactly what you want to do.

There is also a german newsgroup about VT:

[VirtualTreeview_de@y...]

Heri

> -----Original Message-----
> From: [RDU@c...] [mailto:[RDU@c...]]
> Sent: Friday, November 09, 2001 8:51 AM
> To: VirtualTreeview@yahoogroups.com
> Subject: [VirtualTreeview] FocusedNode
>
>
> Hello,
>
> at first I want to tell you that my english isn´t good. I´m from
> Germany. Also Sorry.
>
> I fill my VST with Data from on Interbase Database with InitNode and
> InitChild.
>
> It is very fast, so i don´t want to use the Treeview from Borland
> Delphi.
>
> The User can locate Words in the Database. If the word is found i
> want to focused the Node witch have this Data.
>
>
>
>
>
>
>
>
>
>
> To unsubscribe from this group, send an email to:
> VirtualTreeview-unsubscribe@egroups.com
>
>
>
> Your use of Yahoo! Groups is subject to
> http://docs.yahoo.com/info/terms/
>
>


re: FocusedNode

From: "Ilia Chachkhunashvili" [iliauta@h...]
Date: Fri Nov 9, 2001 9:59 am
Subject: Re: [VirtualTreeview] FocusedNode

I didn't found the way to select Node from My programmly and add next public
procedure to the
VST

procedure TBaseVirtualTree.SetSelectedNode(Node: PVirtualNode;
Value: Boolean);
begin
FocusedNode := Node;
FocusedColumn := -1;
SetSelected(node, value);
end;

(I Use Old version of VST so I'm NOt sure that there is nothing about this in
new versions)
If someone has better solution please send me letter.

----- Original Message -----
From: Bender Heri
Sent: 9 ноября 2001 г. 12:15
To: '[VirtualTreeview@yahoogroups.com'
Subject: RE: [VirtualTreeview] FocusedNode

I don't understand exactly what you want to do.

There is also a german newsgroup about VT:

[VirtualTreeview_de@y...]

Heri

> -----Original Message-----
> From: [RDU@c...] [mailto:RDU@c...]]
> Sent: Friday, November 09, 2001 8:51 AM
> To: VirtualTreeview@yahoogroups.com
> Subject: [VirtualTreeview] FocusedNode
>
>
> Hello,
>
> at first I want to tell you that my english isn´t good. I´m from
> Germany. Also Sorry.
>
> I fill my VST with Data from on Interbase Database with InitNode and
> InitChild.
>
> It is very fast, so i don´t want to use the Treeview from Borland
> Delphi.
>
> The User can locate Words in the Database. If the word is found i
> want to focused the Node witch have this Data.
>
>
>
>
>
>
>
>
>
>
> To unsubscribe from this group, send an email to:
> VirtualTreeview-unsubscribe@egroups.com
>
>
>
> Your use of Yahoo! Groups is subject to
> http://docs.yahoo.com/info/terms/
>
>

To unsubscribe from this group, send an email to:
VirtualTreeview-unsubscribe@egroups.com

Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. Get more
from the Web. FREE MSN Explorer download : http://explorer.msn.com

[Non-text portions of this message have been removed]

 | Replies | Author | Date
4546 | Re: FocusedNode | Helge Jung (ECO-Logic) | Fri 11/9/2001


Images from different imagelists

From: GIANNAKOPOULOS KOSTAS [kyan@s...]
Date: Fri Nov 9, 2001 10:48 am
Subject: Images from different imagelists

Hello.

Does anyone know if it is possible for a VT to be able to display images
from different imagelists for two or more of its nodes, meaning the value of
"Images" "changing" depending on which node is drawn?

If it is not possible i'll add it in the wish list.

Thank you.


Access Violation

From: [ranganathdindu@h...]
Date: Fri Nov 9, 2001 11:43 am
Subject: Access Violation

Dear All,
I have a situation like this..
I have two tabs and one Virtual String Stree in each one..In each tab
i have some functionality like adding nodes.. deleting.. changing the
font etc., Some times even when i donot do any operations, while
changing the tabs I get AccessViolation

and when i looked at Stack Trace is shows like this

TCustomVirtualStringTree.DoGetText
TCustomVirtualStringTree.DoPaintNode
TBaseVirtualTree.Pain

it does not even show me the parent component or the tab name etc.,

It is very urgent.. Please help me what could be reason..

Regards
Ranganath.D

 | Replies | Author | Date
4547 | Re: Access Violation | Werner Lehmann | Fri 11/9/2001
4588 | Re: Access Violation | [ranganathdindu@h...] | Mon 11/12/2001
4592 | Re: Access Violation | Jim Kueneman | Mon 11/12/2001
4595 | Re: Access Violation | Werner Lehmann | Mon 11/12/2001
4703 | Re: Access Violation | [ranganathdindu@h...] | Mon 11/19/2001


Antwort: Read INI file into TreeView?

From: [zan.trajkov@s...]
Date: Fri Nov 9, 2001 11:46 am
Subject: Antwort: [VirtualTreeview] Read INI file into TreeView?

Hi

i create a small testproject for your problem ... It's not testet !!!!
Only for get a hint....

To enable check support, don't forget to activate the appropriate option in
TreeOptions.MiscOptions ....

Hope this helps ....

v
Zan

Code:

implementation

{$R *.DFM}

type
TININode = record
Caption : string[255]; // if the strings are larger, change
declaration
end;
PININode = ^TININode;

const
OPEN_FOLDER = 0;
CLOSED_FOLDER = 1;

procedure TForm1.FormCreate(Sender: TObject);
begin
vst_IniFile.NodeDataSize := sizeof(TININode);
end;

procedure TForm1.bt_LoadClick(Sender: TObject);
var
i,x : Integer;
Glist, Glist2 : TStringList;
IniName : string;
NewNodeSection : PVirtualNode;
NewNodeValue : PVirtualNode;

ANodeDataSection : PININode;
ANodeDataValue : PININode;
NewIni : TIniFile;
begin
IniName := ''; // Only to compile .....

NewIni := nil;

Glist:=TstringList.Create;
Glist2:=TstringList.Create;
try
NewIni := TIniFile.Create(IniName); // win.ini
NewIni.ReadSections(Glist);
for i := 0 to (Glist.Count -1) do
begin
//Tsec:=TreeView1.Items.AddChild (nil,Glist.Strings[i]);
NewNodeSection := vst_IniFile.AddChild(nil); // vst_IniFile = Name of
Treeview .... ;-)
ANodeDataSection := vst_IniFile.GetNodeData(NewNodeSection);

NewNodeSection.CheckType := ctCheckBox;

if Assigned(ANodeDataSection) then
begin
ANodeDataSection.Caption := Glist.Strings[i];
end;

Glist2.Clear;
NewIni.ReadSectionValues(Glist.Strings[i],Glist2);
for x := 0 to (Glist2.Count -1) do
begin
//TreeView1.Items.AddChild(Tsec,Glist2.Strings[x]);
NewNodeValue := vst_IniFile.AddChild(NewNodeSection);
ANodeDataValue := vst_IniFile.GetNodeData(NewNodeValue);

NewNodeValue.CheckType := ctCheckBox;

if Assigned(ANodeDataValue) then
begin
ANodeDataValue.Caption := Glist2.Strings[x];
end;
end;
end;
finally
Glist.Clear;
Glist.Free;
Glist2.Clear;
Glist2.Free;

if Assigned(NewIni) then
NewIni.Free; // Do not forget!!!!
end;

end;

procedure TForm1.vst_IniFileGetImageIndex(Sender: TBaseVirtualTree;
Node: PVirtualNode; Kind: TVTImageKind; Column: Integer;
var Ghosted: Boolean; var Index: Integer);
begin
if (Kind in [ikNormal, ikSelected]) then
begin
if (vsExpanded in Node.States) then
begin
Index := OPEN_FOLDER; // const for index of icon in imagelist
end else
begin
Index := CLOSED_FOLDER; // const for index of icon in imagelist
end;
end;
end;

procedure TForm1.vst_IniFileGetText(Sender: TBaseVirtualTree;
Node: PVirtualNode; Column: Integer; TextType: TVSTTextType;
var Text: WideString);
var
NodeData : PININode;
begin
NodeData := vst_IniFile.GetNodeData(Node);

if Assigned(NodeData) then
Text := NodeData.Caption;
end;

end.


re: FocusedNode

From: "Helge Jung \(ECO-Logic\)" [helge@e...]
Date: Fri Nov 9, 2001 11:54 am
Subject: Re: [VirtualTreeview] FocusedNode

> I didn't found the way to select Node from My programmly [...]

VST.FocusedNode := YourNode;
VST.Selected[YourNode] := true;

It works in the 2.5.x versions - in other versions I don't know but I suggest
you use the new versions because they've many improvements.

Helge.


re: Access Violation

From: Werner Lehmann [wl@b...]
Date: Fri Nov 9, 2001 1:02 pm
Subject: Re: [VirtualTreeview] Access Violation

[ranganathdindu@h...] wrote:
>
> Dear All,
> I have a situation like this..
> I have two tabs and one Virtual String Stree in each one..In each tab
> i have some functionality like adding nodes.. deleting.. changing the
> font etc., Some times even when i donot do any operations, while
> changing the tabs I get AccessViolation
>
> and when i looked at Stack Trace is shows like this
>
> TCustomVirtualStringTree.DoGetText
> TCustomVirtualStringTree.DoPaintNode
> TBaseVirtualTree.Pain
>
> it does not even show me the parent component or the tab name etc.,
>
> It is very urgent.. Please help me what could be reason..

I suggest you show us
- how you add and init your nodes
- what your NodeDataSize is set to
- what is in your GetText event

The AV might be anything, cannot say much more with this information.

Werner

 | Replies | Author | Date
4588 | Re: Access Violation | [ranganathdindu@h...] | Mon 11/12/2001
4592 | Re: Access Violation | Jim Kueneman | Mon 11/12/2001


re: FocusedNode

From: "Paul Istrate" [istech@c...]
Date: Fri Nov 9, 2001 1:31 pm
Subject: Re: [VirtualTreeview] FocusedNode

> I didn't found the way to select Node from My programmly and add next
public procedure to the
> VST

Hi,

You don't need to add a new public function/proc.

VT have methods/properties for almost all you need.

Node record have members for selected, checked ...etc. states.

But... don't use directly (though Include/Exclude)

Use instead the property:

VST.Selected[Node]:=True/False;
VST.Visible[Node]:=True/False;
.....

Check all properties which expect a Node as parameter. You will find
extremely usefull things.

PS: Take care of BeginUpdate/EndUpdate pair.

Regards,
Paul Istrate


re: OnCompareNodes question

From: [rhymebusta@h...]
Date: Fri Nov 9, 2001 4:39 pm
Subject: Re: OnCompareNodes question

> I personally include the toAutoSort in TreeOptions.AutoOptions.
> Be careful with toAutoSort as lots of invalidates/inserts on lots
of
> nodes can be expensive if you don't use BeginUpdate/EndUpdate to
> ensure only one call to Sort.
>
> Paul

um......this is kinda related:
If I call Sort() does that make a call to the even handler of
OnCompareNodes()?????? is that how it works?

 | Replies | Author | Date
4551 | Re: OnCompareNodes question | [rhymebusta@h...] | Fri 11/9/2001
4553 | Re: OnCompareNodes question | Paul D'Agosta | Fri 11/9/2001


Range check Error

From: [gene-mccrory@j...]
Date: Fri Nov 9, 2001 4:42 pm
Subject: Range check Error

Developed app using TVirtualStringTree version 2.6.5 on Win2000.
Works fine on development machine. Moved application to test Citrix
MetaFrame Server, now receiving 'Range Check Error' exception on
click of node buttons when attempting to expand or collapse a node.

If you expand the last node of the last branch all the way through,
it expands this path. It will not collapse this path or
expand/collapse other nodes without raising 'Range Check Error'.

Prior to release 2.5.40 this worked okay.

Test server
Windows NT 4.00.1381 Terminal Server Edition service pack 6
MetaFrame 1.8 build 663 service pack 1

Thanks in advance for any help with this issue.

Best regards,

Gene McCrory

 | Replies | Author | Date
4554 | Re: Range check Error | [gene-mccrory@j...] | Fri 11/9/2001
4575 | Re: Range check Error | Mike Lischke | Sat 11/10/2001


re: OnCompareNodes question

From: [rhymebusta@h...]
Date: Fri Nov 9, 2001 4:42 pm
Subject: Re: OnCompareNodes question

> um......this is kinda related:
> If I call Sort() does that make a call to the even handler of
> OnCompareNodes()?????? is that how it works?
or is the OnCompareNodes() method called if the voAutosort is set to
true??
or is it both of the above situations??

 | Replies | Author | Date
4553 | Re: OnCompareNodes question | Paul D'Agosta | Fri 11/9/2001


Application.ProcessMessages

From: "Rony Cesana" [cesana@c...]
Date: Fri Nov 9, 2001 5:06 pm
Subject: Application.ProcessMessages

I've noticed that such method is called during Hint processing
(VirtualTrees.pas, v. 2.0, line 3713), though the painting process does not
call lock on the canvas: could this be a source of problem? in my opinion
this could lead to unaligned access to canvas.

I used to have a problem with hints (Access violation), and commenting out
that line seems to resolve them.

This, anyway, does not solve my problem about "Canvas does not allow
drawing", because hints were not enabled when I experienced it.

Any clue or comment?

Thanx,
Rony

 | Replies | Author | Date
4574 | Re: Application.ProcessMessages | Mike Lischke | Sat 11/10/2001


re: OnCompareNodes question

From: "Paul D'Agosta" [pdagosta@c...]
Date: Fri Nov 9, 2001 5:14 pm
Subject: Re: OnCompareNodes question

--- In [VirtualTreeview@y...], [rhymebusta@h...] wrote:
> > um......this is kinda related:
> > If I call Sort() does that make a call to the even handler of
> > OnCompareNodes()?????? is that how it works?
> or is the OnCompareNodes() method called if the voAutosort is set to
> true??
> or is it both of the above situations??

Yes. Both situations.

There are 3 ways I know of to Sort:
1) Set toAutoSort in TreeOptions.AutoOptions
2) Call Sort()
3) Call SortTree()

toAutoSort causes the Tree internally to call the Sort() procedure at
various times (AddNode, InsertNode, EndUpdate, etc.)

The Sort() procedure uses an internal sort algorithm (MergeSort) to
sort the children of a node. (AFAIK, it does not sort GrandChildren
Nodes. Use SortTree for this)

SortTree() is a procedure that will call Sort() for every Parent Node
in the tree

To compare two nodes Sort() calls the OnCompareNodes event to know
which order the nodes belong.

Paul


re: Range check Error

From: [gene-mccrory@j...]
Date: Fri Nov 9, 2001 6:03 pm
Subject: Re: Range check Error

> Moved application to test Citrix
> MetaFrame Server, now receiving 'Range Check Error' exception on
> click of node buttons when attempting to expand or collapse a node.

I found what causes this issue on a Citrix MetaFrame Server v1.8 -
TreeOptions.AnimationOptions := [toAnimatedToggle];

Best regards,

Gene McCrory

--- In [VirtualTreeview@y...], [gene-mccrory@j...] wrote:
> Developed app using TVirtualStringTree version 2.6.5 on Win2000.
> Works fine on development machine. Moved application to test
Citrix
> MetaFrame Server, now receiving 'Range Check Error' exception on
> click of node buttons when attempting to expand or collapse a node.
>
> If you expand the last node of the last branch all the way through,
> it expands this path. It will not collapse this path or
> expand/collapse other nodes without raising 'Range Check Error'.
>
> Prior to release 2.5.40 this worked okay.
>
> Test server
> Windows NT 4.00.1381 Terminal Server Edition service pack 6
> MetaFrame 1.8 build 663 service pack 1
>
> Thanks in advance for any help with this issue.
>
> Best regards,
>
> Gene McCrory

 | Replies | Author | Date
4575 | Re: Range check Error | Mike Lischke | Sat 11/10/2001


DB demo

From: "Wayne Fulcher" [wayne@d...]
Date: Fri Nov 9, 2001 7:33 pm
Subject: DB demo

Does anybody know where I can find a demo application that would show how to
use the Virtual Tree with a database?

Thanks,
Wayne Fulcher
[wayne@d...]

 | Replies | Author | Date
4556 | Re: DB demo | Helge Jung (ECO-Logic) | Fri 11/9/2001


re: DB demo

From: "Helge Jung \(ECO-Logic\)" [helge@e...]
Date: Fri Nov 9, 2001 7:56 pm
Subject: Re: [VirtualTreeview] DB demo

> Does anybody know where I can find a demo application that would
> show how to use the Virtual Tree with a database?

Yes *g*

Oh, you also want to know where exactly? ;-)
Look at the YG:
http://groups.yahoo.com/group/VirtualTreeview/files/Examples/Delphi_Examples
/Database/

Helge.


Deleting Nodes

From: [rhymebusta@h...]
Date: Fri Nov 9, 2001 9:29 pm
Subject: Deleting Nodes

hi i was wondering what event handler(OnXXX) is called(if there is
any called) when you use the DeleteNode() method(i.e. myTVT-
>DeleteNode(node) ). See, i want the application that uses my virtual
tree to be able to free whatever data it allocated from the
application, i don't want the VT to free the application data(
whatever GetNodeData(PVirtualNode) points to). I thought there would
be an OnDeleteNode or something...but i couldn't find one.

 | Replies | Author | Date
4558 | Re: Deleting Nodes | Paul D'Agosta | Fri 11/9/2001


re: Deleting Nodes

From: "Paul D'Agosta" [pdagosta@c...]
Date: Fri Nov 9, 2001 9:52 pm
Subject: Re: Deleting Nodes

--- In [VirtualTreeview@y...], [rhymebusta@h...] wrote:
> hi i was wondering what event handler(OnXXX) is called(if there is
> any called) when you use the DeleteNode() method(i.e. myTVT-
> >DeleteNode(node) ). See, i want the application that uses my
virtual
> tree to be able to free whatever data it allocated from the
> application, i don't want the VT to free the application data(
> whatever GetNodeData(PVirtualNode) points to). I thought there would
> be an OnDeleteNode or something...but i couldn't find one.

Look at OnFreeNode

Paul


re: Read INI file into TreeView?

From: Werner Lehmann [wl@b...]
Date: Fri Nov 9, 2001 11:26 pm
Subject: Re: [VirtualTreeview] Read INI file into TreeView?

DGJ wrote:
>
> I am using a normal Delphi Treeview at the moment to read the win.ini file
with the following code but need checkboxes to select or unselect sections or
keys in the file. It seems much more difficult to do the same thing with the
virtual treeview. It would be ideal also to have bitmaps to reflect closed or
open nodes similar to the windows explorer.

http://groups.yahoo.com/group/VirtualTreeview/files/Descendants/VirtualStuff2.zi\
p

You find an ini-file VT descendant here. Maybe this gets you started.

Werner


re: Problem with CheckState (Mike)

From: Werner Lehmann [wl@b...]
Date: Sat Nov 10, 2001 1:40 am
Subject: Re: [VirtualTreeview] Problem with CheckState (Mike)

[d.faessler@p...] wrote:
>
> First, I would say that I find VirtualTreeview is an excellent
> component. I had, like some others, problems with
> AutoTristateTracking. If you set the CheckState, it sometimes would
> not refresh all parent nodes. I've found the bug (or future?). If you
> add a node, the checkstate of this node has default value. If this
> value is the same as you set programmicly there is no event which
> would refresh the parents. So I first set the CheckState to a value
> not used in my program and then set the normal state:

Have not seen this yet but there is another problem with tristate checks:
Check a node which has no children but vsHasChildren is set. Expand this
node. No child node will be checked although they should all be checked.

Apparently there is a check (in code :) missing. When a node gets a checkbox
and the tree is using tristate checking then the node must be checked if its
immediate parent is also checked.

Mike, is this a glitch or are we missing something or is there a reason for
doing it like this?

Regards,
Werner

 | Replies | Author | Date
4562 | Re: Problem with CheckState (Mike) | Mike Lischke | Sat 11/10/2001
4578 | Re: Problem with CheckState (Mike) | Werner Lehmann | Sat 11/10/2001


RootNode Parent

From: Jim Kueneman [jimdk@m...]
Date: Sat Nov 10, 2001 2:33 am
Subject: RootNode Parent

Hi Mike,

I have found something that could be concidered a bug. The
RootNode.Parent contains some address, it is not nil as I would expect (and
would like to count on that fact) Is this for a specific purpose?

Jim

 | Replies | Author | Date
4563 | Re: RootNode Parent | Mike Lischke | Sat 11/10/2001
4564 | Re: RootNode Parent | Ralf Melles | Sat 11/10/2001
4576 | Re: RootNode Parent | Mike Lischke | Sat 11/10/2001


re: Problem with CheckState (Mike)

From: "Mike Lischke" [lists@l...]
Date: Sat Nov 10, 2001 8:37 am
Subject: RE: [VirtualTreeview] Problem with CheckState (Mike)

> Mike, is this a glitch or are we missing something or is there a reason for
> doing it like this?

Would you rather prefer to initialize the child nodes when a tristate node gets
checked?

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: RootNode Parent

From: "Mike Lischke" [lists@l...]
Date: Sat Nov 10, 2001 8:38 am
Subject: RE: [VirtualTreeview] RootNode Parent

> I have found something that could be concidered a bug. The
> RootNode.Parent contains some address, it is not nil as I would expect (and
> would like to count on that fact) Is this for a specific purpose?

It's not a bug, it's a feature :-) The parent value of FRoot is the treeview it
belongs to.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: RootNode Parent

From: "Ralf Melles" [rmelles@g...]
Date: Sat Nov 10, 2001 8:47 am
Subject: Re: RootNode Parent

--- In [VirtualTreeview@y...], Jim Kueneman [jimdk@m...] wrote:
>
>
> Hi Mike,
>
> I have found something that could be concidered a bug. The
> RootNode.Parent contains some address, it is not nil as I would
expect (and
> would like to count on that fact) Is this for a specific purpose?
>
> Jim

Hi Mike,

I found the same problem. If I try to find the related VT of a node
by traversing back to RootNode, sometimes the Prog crashes because it
finds a pointer to an invalid address (eg. $340). I don´t know why
this happens!

-I'm loading data -> Ok
-Clear tree by VST.Clear and loading same data again ->OK
-Clear tree by VST.Clear and loading same data again ->OK
-Clear tree by VST.Clear and loading same data again ->OK
-Clear tree by VST.Clear and loading same data again -> ERROR

This might teasing me! I cannot tell you when this happens because
sometimes it crashes after 2.load, sometimes after the 4., 3.

Regards
Ralf

 | Replies | Author | Date
4576 | Re: RootNode Parent | Mike Lischke | Sat 11/10/2001


re: ValidateCache erro

From: "Mike Lischke" [lists@l...]
Date: Sat Nov 10, 2001 9:30 am
Subject: RE: [VirtualTreeview] ValidateCache erro

> Just downloaded new 2.6.5 version and have in this situation "Integer
> Overflow" erro with next "Access Violation" with any tree operation
> I replaced
> 20510: if NodeVisible and (vsVisible in Run.States) then
> with this one:
> 20510: if NodeVisible and (vsVisible in Run.States) and (fVisibleCount > 0)
then

I thought this problem were already fixed and never raises its head again.
Well, obviously I am
wrong. The fix you included is a neat workaround but does not repair the actual
error. Could you
create a simple demo which reproduces the exception?

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net

 | Replies | Author | Date
4567 | Re: ValidateCache erro | Mike Lischke | Sat 11/10/2001
4590 | Re[2]: [VirtualTreeview] ValidateCache erro | Yur Ovchinnikov | Mon 11/12/2001


re: (please add a subject line!)

From: "Mike Lischke" [lists@l...]
Date: Sat Nov 10, 2001 9:40 am
Subject: RE: [VirtualTreeview] (please add a subject line!)

Hi Paul,

> This works fine for Adding nodes, but when I Delete nodes I see a jump
> (ie it scrolls up and then back down to where it should be). It seems
> that the screen is updated twice, once for the delete, and once for
> setting the offsety.

This can well be, since the tree has to scroll up when it is at the bottom
bound and a node is
deleted. I'm not sure however what you want. Your display rules are not very
consequently enforced
anyway (e.g. select a node near the top then scroll down with the scrollbars
without changing the
selected node and then press the delete button in your demo -> the selected
node is not scrolled
into view).

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net

 | Replies | Author | Date
4593 | Re: (please add a subject line!) | Paul D'Agosta | Mon 11/12/2001
4594 | Deleting Nodes while Last Node is Visible | Paul D'Agosta | Mon 11/12/2001
4618 | Re: Deleting Nodes while Last Node is Visible | Paul D'Agosta | Wed 11/14/2001
4673 | Re: (please add a subject line!) | Mike Lischke | Sun 11/18/2001


re: ValidateCache erro

From: "Mike Lischke" [lists@l...]
Date: Sat Nov 10, 2001 9:46 am
Subject: RE: [VirtualTreeview] ValidateCache erro

> wrong. The fix you included is a neat workaround but does not repair the
actual error. Could you
> create a simple demo which reproduces the exception?

I just found your demo for this problem and will now go and fix it once and for
all :o]

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net

 | Replies | Author | Date
4590 | Re[2]: [VirtualTreeview] ValidateCache erro | Yur Ovchinnikov | Mon 11/12/2001


Scroll area wrong size when nodes made invisible

From: [zh66w6@h...]
Date: Sat Nov 10, 2001 11:26 am
Subject: Scroll area wrong size when nodes made invisible

When I iterate through all the nodes in a tree removing the vsVisible
state, the vertical scrollbar remains the same, leaving a large blank
space at the bottom of the tree. What am I doing wrong?

Cheers, Paul

 | Replies | Author | Date
4571 | Re: Scroll area wrong size when nodes made invisi Mi | Mike Lischke | Sat 11/10/2001


re: VT 2.6.5 double declare using BCB

From: "Mike Lischke" [lists@l...]
Date: Sat Nov 10, 2001 11:33 am
Subject: RE: [VirtualTreeview] VT 2.6.5 double declare using BCB

Hi Milan,

> You have to use the modified JwaTmSchema.pas supplied in my package, not hte
> original one. Modifications look similar to this:
>
> {$IFNDEF BCB}
> TMT_FIRST_RCSTRING_NAME = TMT_DISPLAYNAME;
> TMT_LAST_RCSTRING_NAME = TMT_DESCRIPTION;
> {$ENDIF}
> And so on.

Why this? Where are the other identifiers declared? I can't find them.

> Also, you will have to remove the {$WEAKPACKAGEUNIT} directive from
> JwaUxTheme.pas.

Weak packaging is usually allowed if you don't have initialization code nor
initialized variables.
So why does it not work with BCB?

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net

 | Replies | Author | Date
4587 | Re: VT 2.6.5 double declare using BCB | Roland | Mon 11/12/2001
4671 | Re: VT 2.6.5 double declare using BCB | Mike Lischke | Sun 11/18/2001


re: Locking the first column?

From: "Mike Lischke" [lists@l...]
Date: Sat Nov 10, 2001 11:37 am
Subject: RE: [VirtualTreeview] Locking the first column?

Hi Igor,

> How difficult would it be to implement column locking
> functionality, similar to excel? I.e. preventing the
> first column (main column) from scrolling out of the
> view?

Quite difficult indeed. This question has already been asked so I recommend
that you use the search
feature of YG to find it in the message archive.

There is a lot to consider for a fixed column (scrolling, hit testing, painting
etc.) so the only
way I can imagine to make this somwhat less difficult is to use a bit
non-client area on the left
hand side of the tree window to implement one fixed column (it's rather a
gutter since no normal
column would be used for this), but I don't know how well this behaves with
left side scroll bars.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: Scroll area wrong size when nodes made invisible

From: "Mike Lischke" [lists@l...]
Date: Sat Nov 10, 2001 11:38 am
Subject: RE: [VirtualTreeview] Scroll area wrong size when nodes made invisible

> When I iterate through all the nodes in a tree removing the vsVisible
> state, the vertical scrollbar remains the same, leaving a large blank
> space at the bottom of the tree. What am I doing wrong?

Use VT.IsVisble[Node] := False instead.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: vsInitialUserData may cause memory leaks

From: "Mike Lischke" [lists@l...]
Date: Sat Nov 10, 2001 12:20 pm
Subject: RE: [VirtualTreeview] vsInitialUserData may cause memory leaks

Hi Kostas,

> I decided to use AddChild(Node) to add my nodes and then i used GetNodeData
> to set the values to my user data record, that has some ref-counted members.
> The problem is that the node's state does not include vsInitialUserData,
> since i didn't pass a pointer to AddChild, so, if the node is never Init'ed
>
> Maybe it should call OnFreeNode regardless of whether it has been
> initialized or if it has "Initial user data"? I don't know, it is very
> difficult for VT to detect if a node actually *HAS* user data that need
> deallocating, so the flag vsInitialUserData doesn't make much sense to me
> (sorry Mike).

I'm not sure why you are not able to use the mechanisms VT provides. I have
included the optional
user data pointer to AddChild and InsertNode for that one and simple reason,
namely that you have
data attached to a node which must be released regardless of whether the node
has been initialized
or not. If you don't have the data ready for the AddChild call (which is very
similar to the normal
TTreeView behavior in this regard) then why don't you use OnInitNode? How do
you actually intialize
the nodes then?

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: Problem with CheckState

From: "Mike Lischke" [lists@l...]
Date: Sat Nov 10, 2001 12:55 pm
Subject: RE: [VirtualTreeview] Problem with CheckState

Hi Dominik,

> If you add a node, the checkstate of this node has default value. If this
> value is the same as you set programmicly there is no event which
> would refresh the parents.

Yes, this is the intended way. If you don't change anything why should the
parent be updated?

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: Application.ProcessMessages

From: "Mike Lischke" [lists@l...]
Date: Sat Nov 10, 2001 1:01 pm
Subject: RE: [VirtualTreeview] Application.ProcessMessages

Hi Rony,

> I've noticed that such method is called during Hint processing
> (VirtualTrees.pas, v. 2.0, line 3713), though the painting process does not
> call lock on the canvas: could this be a source of problem? in my opinion
> this could lead to unaligned access to canvas.

This is only dangerous if VT would use more than one thread to access the
canvas. But this is not
the case. The ProcessMessages call is something I would rather have removed but
it must be there
because otherwise during an animation most of the processing in an application
would be delayed
(including mouse moves which is a serious limitation).

> I used to have a problem with hints (Access violation), and commenting out
> that line seems to resolve them.

This is a bit vague. Could you write a little demo which shows this effect?

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: Re: Range check Error

From: "Mike Lischke" [lists@l...]
Date: Sat Nov 10, 2001 1:02 pm
Subject: RE: [VirtualTreeview] Re: Range check Error

Hi Gene,

> I found what causes this issue on a Citrix MetaFrame Server v1.8 -
> TreeOptions.AnimationOptions := [toAnimatedToggle];

Mmh, perhaps the ScrollDC call? I have no idea what else could be the problem.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: Re: RootNode Parent

From: "Mike Lischke" [lists@l...]
Date: Sat Nov 10, 2001 1:04 pm
Subject: RE: [VirtualTreeview] Re: RootNode Parent

Hi Ralf,

> I found the same problem. If I try to find the related VT of a node
> by traversing back to RootNode, sometimes the Prog crashes because it
> finds a pointer to an invalid address (eg. $340). I don´t know why
> this happens!

Mmh, I cannot reproduce this problem. If you could write a little demo which
shows the problem then
I would fix.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: Re: RootNode Parent

From: Werner Lehmann [wl@b...]
Date: Sat Nov 10, 2001 12:24 pm
Subject: Re: [VirtualTreeview] Re: RootNode Parent

Hi Ralf,

> > I have found something that could be concidered a bug. The
> > RootNode.Parent contains some address, it is not nil as I would
> expect (and
> > would like to count on that fact) Is this for a specific purpose?
> >
> > Jim
>
> I found the same problem. If I try to find the related VT of a node
> by traversing back to RootNode, sometimes the Prog crashes because it
> finds a pointer to an invalid address (eg. $340). I don´t know why
> this happens!
>
> -I'm loading data -> Ok
> -Clear tree by VST.Clear and loading same data again ->OK
> -Clear tree by VST.Clear and loading same data again ->OK
> -Clear tree by VST.Clear and loading same data again ->OK
> -Clear tree by VST.Clear and loading same data again -> ERROR
>
> This might teasing me! I cannot tell you when this happens because
> sometimes it crashes after 2.load, sometimes after the 4., 3.

If you suspect that this is related to the parent of the rootnode then
stop your traversing if you reach VT.RootNode, not when the parent is
nil.

Werner


re: Problem with CheckState (Mike)

From: Werner Lehmann [wl@b...]
Date: Sat Nov 10, 2001 12:53 pm
Subject: Re: [VirtualTreeview] Problem with CheckState (Mike)

Hi Mike,

> > Mike, is this a glitch or are we missing something or is there a reason for
> > doing it like this?
>
> Would you rather prefer to initialize the child nodes when a tristate node
gets checked?

No, of course not. These nodes can have children of their own, the full subtree
would
have to be expanded / init'ed. This is probably what you want to point out
anyway :)

I suggest that tristate checking works like this. The term "(grand) child"
refers
to the full subtree.

- When a node is checked:
* all init'ed (grand) child nodes with checkboxes are being checked too
* init all parent nodes
* find the next most parent with checkbox. if it is unchecked or mixed it
must be
CHECKED if *none* of its (grand) children is unchecked or mixed (subtree
iteration,
search for unchecked or mixed child, can be aborted when found) or it must
be MIXED
otherwise

- When a node is unchecked:
* all init'ed (grand) child nodes with checkboxes are being unchecked too
* init all parent nodes
* find the next most parent with checkbox. if it is checked or mixed it must
be
UNCHECKED if *none* of its (grand) children is checked or mixed (subtree
iteration,
search for checked or mixed child, can be aborted when found) or it must be
MIXED
otherwise

- When a node is init'ed with checkbox state
OR
When a (init'ed) node gets a checkbox for the first time via CheckType[]
property
* find the next most parent with checkbox (may require to init parent nodes
as needed),
if parent is checked / unchecked simply copy checkstate to init'ed node, if
parent
is mixed, leave checkbox unchecked

I hope this 'spec' makes sense, I have put some effort in it to cover all cases.

Werner


Persistence in CheckStates

From: "Jim Kueneman" [jimdk@m...]
Date: Sat Nov 10, 2001 1:36 pm
Subject: Persistence in CheckStates

Hi Mike,

I am trying to store the checkstates of VT (in VET) and have hit a
snag. Lets say you have the tree expaned 4 levels and a node is
checked in level 4. That makes levels 1 - 3 have a the "shaded" box
indicating there are checked children. Now I run through the tree
and save each nodes CheckState and CheckType. I close the program.

On reopening the program on the InitNode I look for a
corresponding saved node to restore the checkstate. Here is the
problem, I know that level 1 checkbox should be "shaded" but it won't
do that until I have a real child 4 levels down created and checked.

Basicly I am loosing the "virtualness" of VT by having to create 4
levels to get the upper levels to show the right checkstate. Now
that I think about this it may be related Werner message on
checkboxes.

Any Hints?

Jim

 | Replies | Author | Date
4585 | Re: Persistence in CheckStates MIKE; READ FIRST | Jim Kueneman | Sun 11/11/2001


TBaseVirtualTree.ValidateChildren

From: Werner Lehmann [wl@b...]
Date: Sat Nov 10, 2001 4:53 pm
Subject: TBaseVirtualTree.ValidateChildren

Hi Mike,

the recursive parameter of this method does nothing at all:

procedure TBaseVirtualTree.ValidateChildren(Node: PVirtualNode; Recursive:
Boolean);

Regards,
Werner

 | Replies | Author | Date
4610 | Re: TBaseVirtualTree.ValidateChildren | Mike Lischke | Tue 11/13/2001
4614 | Re: TBaseVirtualTree.ValidateChildren | Werner Lehmann | Tue 11/13/2001


Make node visible or not

From: [colir2000@y...]
Date: Sat Nov 10, 2001 10:45 pm
Subject: Make node visible or not

Firstly I want congratulate Mike and the others participants for
this very good component.
I would like to know if it is possible to do a node visible or not.
Some property to change this?

 | Replies | Author | Date
4582 | Re: Make node visible or not | Helge Jung (ECO-Logic) | Sat 11/10/2001


re: Make node visible or not

From: "Helge Jung \(ECO-Logic\)" [helge@e...]
Date: Sat Nov 10, 2001 10:51 pm
Subject: Re: [VirtualTreeview] Make node visible or not

> I would like to know if it is possible to do a node visible or not.
> Some property to change this?

VST.IsVisible[TheNode] := false;

Helge.


tool tip notice time (english and german question)

From: "[UEF]Gangsta" [uefgangsta@g...]
Date: Sun Nov 11, 2001 2:54 pm
Subject: tool tip notice time (english and german question)

hi all

i have a question regarding the tool tip function. It works fine, but
the tool tip comes too fast/early. I want to change the time, but i
cannot find a value for this. The tooltip should come after the mouse
points at least 2 seconds on an entry.

Can you tell me?

Thx
Gangsta

========================================
Hallo !

Ich habe eine Frage bezüglich der Tool-Tip Funktion. Es
funktioniert ganz gut, nur erscheint der Tool-Tip zu früh. Ich
würde gern diese Zeit ändern, aber weiß nich wo. Der
Tool-Tip sollte
erscheinen, nachdem die Maus 2 Sekunden auf einem Eintrag zeigt.

Wer kann mir helfen?

Danke
Gangsta


UseThemes

From: Werner Lehmann [wl@b...]
Date: Sun Nov 11, 2001 8:02 pm
Subject: UseThemes

Hi Mike,

I have been bugging Jim for half a day because a VET on a modal dialog
was building up so slowly that I could see the mainform below it for
some 2 or 3 seconds.

It turned out that the real troublemaker is the function UseThemes. This
is called before every single checkbox is painted. If I replace that call
in PaintCheckImage() with "true" the performance problem is gone.

Would be a good idea to replace that function by a local boolean field which
is only updated on

- start up / CreateWnd / OpenThemeHandle
- WM_THEMECHANGED
- toThemeAware change

Ok? :)

Regards,
Werner

 | Replies | Author | Date
4611 | Re: UseThemes | Mike Lischke | Tue 11/13/2001
4613 | Re: UseThemes | Werner Lehmann | Tue 11/13/2001
4675 | Re: UseThemes | Mike Lischke | Sun 11/18/2001


re: Persistence in CheckStates MIKE; READ FIRST

From: "Jim Kueneman" [jimdk@m...]
Date: Sun Nov 11, 2001 10:07 pm
Subject: Re: Persistence in CheckStates MIKE; READ FIRST

Hi Mike,

> levels to get the upper levels to show the right checkstate. Now
> that I think about this it may be related Werner message on
> checkboxes.

Again I quickly cast blame the "perfect one" for my ignorance. It
was my fault, VT is flawless <g>

Jim


Disallow selection change?

From: Werner Lehmann [wl@b...]
Date: Mon Nov 12, 2001 1:09 am
Subject: Disallow selection change?

Hi,

how can I prevent that a left click on any node changes the selection?
I want to force a particular node to be selected and focused and do
not allow a change.

Tried it with OnFocusChanging but if I disallow the focus change on all
nodes but the one where I want to keep the focus and then click on any
other node the selection is removed.

Werner

 | Replies | Author | Date
4670 | Re: Disallow selection change? | Mike Lischke | Sun 11/18/2001
4690 | Re: Disallow selection change? | Werner Lehmann | Sun 11/18/2001
4691 | Re: Disallow selection change? | Mike Lischke | Sun 11/18/2001
4699 | Re: Disallow selection change? | Werner Lehmann | Sun 11/18/2001


re: VT 2.6.5 double declare using BCB

From: "Roland" [Beduerftig@S...]
Date: Mon Nov 12, 2001 8:27 am
Subject: Re: VT 2.6.5 double declare using BCB

Hi Mike,

> > {$IFNDEF BCB}
> > TMT_FIRST_RCSTRING_NAME = TMT_DISPLAYNAME;
> > TMT_LAST_RCSTRING_NAME = TMT_DESCRIPTION;
> > {$ENDIF}
> > And so on.
>
> Why this? Where are the other identifiers declared?
> I can't find them.

I have explain it in message 4495, and then I discus this with Milan
(message 4496, 4499 and 4501), in short form:
It's a problem only using BCB.

here the basic info form message 4495:

JwaTmSchema.hpp(326): E2238 TXT_DISPLAYNAME more the once declared
JwaTmSchema.hpp(318): E2344 TXT_DISPLAYNAME already declared
and so on until the compiler break => too many errors or messages

I look at JwaTmSchema.hpp
in line 18 is: #include "tmschema.h"

I look at tmschema.h
in line 136 is: #define TMT_FIRST_RCSTRING_NAME TMT_DISPLAYNAME

now back to JwaTmSchema.hpp
in line 318 is: static const Word TMT_DISPLAYNAME = 0x259;
in line 326 is: static const Word TMT_FIRST_RCSTRING_NAME = 0x259;

=> Now you can see the problem "tmschema.h" is include only using
BCB and then you have the double declaration

best regards
Roland

 | Replies | Author | Date
4671 | Re: VT 2.6.5 double declare using BCB | Mike Lischke | Sun 11/18/2001


re: Access Violation

From: [ranganathdindu@h...]
Date: Mon Nov 12, 2001 10:14 am
Subject: Re: Access Violation

Dear Sir,

My DataStructure is

PTestTreeNode = ^TTestTreeNode;
TTestTreeNode = record
Id : Integer;
Data : TTestPlanTestTreeData;
end;

My InitNode code is like this

var
Data : PTestTreeNode;
begin
with Sender do
begin
Data := GetNodeData( Node );
Data.Id := nodeTestTree.Id;
Data.Data := nodeTestTree.Data;
end;

NodeDataSize is

vstTestTree.NodeDataSize := SizeOf( TTestTreeNode );

My GetText is

var
Data: PTestTreeNode;
begin
Data := Sender.GetNodeData( Node );
if Assigned(Data) then
if Assigned( Data.Data ) then
Text := Data.Data.Code
else
Text := '!!WrongData!!';

If you can conclude anything from this please let me know..

Thank you

Regards,
Ranganath.D

 | Replies | Author | Date
4592 | Re: Access Violation | Jim Kueneman | Mon 11/12/2001


re: VT 2.6.5 double declare using BCB

From: Vandrovec Milan [milan_va@s...]
Date: Mon Nov 12, 2001 11:12 am
Subject: RE: [VirtualTreeview] VT 2.6.5 double declare using BCB

Hi.

> > Also, you will have to remove the {$WEAKPACKAGEUNIT} directive from
> > JwaUxTheme.pas.
>
> Weak packaging is usually allowed if you don't have
> initialization code nor initialized variables.
> So why does it not work with BCB?

So, if you want to know: It works OK if I am only using VT. However, if
using another package that uses VT, namely VT_Addons (TVirtualStringTreeEx),
then I get the following:

[Linker Warning] Public symbol '__tpdsc__ THEMESIZE' defined in both module
C:\PROGRAM
FILES\BORLAND\CBUILDER5\PROJECTS\LIB\VT_ADDONS.LIB|M:\CPPprojs\CBuilder\Proj
ect2\VirtualTreeView\JwaUxTheme.pas and C:\PROGRAM
FILES\BORLAND\CBUILDER5\PROJECTS\LIB\VIRTUALTREEVIEW.LIB|M:\CPPprojs\CBuilde
r\Project2\VirtualTreeView\JwaUxTheme.pas

and same for PROPERTYORIGIN instead of THEMESIZE;

[Linker Warning] Public symbol 'Jwauxtheme::OpenThemeData' defined in both
module C:\PROGRAM
FILES\BORLAND\CBUILDER5\PROJECTS\LIB\VT_ADDONS.LIB|M:\CPPprojs\CBuilder\Proj
ect2\VirtualTreeView\JwaUxTheme.pas and C:\PROGRAM
FILES\BORLAND\CBUILDER5\PROJECTS\LIB\VIRTUALTREEVIEW.LIB|M:\CPPprojs\CBuilde
r\Project2\VirtualTreeView\JwaUxTheme.pas

and much more of this. I believe it is related to the following from BCB
help, under Search/Weak Packaging:

Note: Unit files containing the #pragma package(smart_init, weak)
directive must not have global variables.

-----

It requires some conditions to appear, like turn off Build with Runtime
packages, and call some functions of the tree, not just placing it on the
form. But still, the unit it quite small, so "strongpackaging" shouldn't
hurt too much.
I tried all 4 ways of VT_Addons (adding or not VirtualTrees package to
Requires, adding or not the two jwa*.pas).
If somebody with BCB can find a way to avoid the warnings, and still have
{$WEAKPACKAGEUNIT} defined, then please tell me (I am only Advanced, not a
Guru :-)).

Milan Vandrovec

 | Replies | Author | Date
4672 | Re: VT 2.6.5 double declare using BCB | Mike Lischke | Sun 11/18/2001


Re[2]: ValidateCache erro

From: Yur Ovchinnikov [Yur@s...]
Date: Mon Nov 12, 2001 12:02 pm
Subject: Re[2]: [VirtualTreeview] ValidateCache erro

Hello Mike,

Saturday, November 10, 2001, 11:46:38 AM, you wrote:

>> wrong. The fix you included is a neat workaround but does not repair the
actual error. Could you
>> create a simple demo which reproduces the exception?

ML> I just found your demo for this problem and will now go and fix it once and
for all :o]

Thanks for attention :)

ML> Ciao, Mike
ML> --
ML> www.lischke-online.de
ML> www.delphi-unicode.net

--
Best regards,
Yur Ovchinnikov E-mail: [yur@s...]
JSC Summit WWW: http://alone.come.to
ICQ: 1400397


re: vsInitialUserData may cause memory leaks

From: GIANNAKOPOULOS KOSTAS [kyan@s...]
Date: Mon Nov 12, 2001 12:15 pm
Subject: RE: [VirtualTreeview] vsInitialUserData may cause memory leaks

> I'm not sure why you are not able to use the mechanisms VT
> provides. I have included the optional
> user data pointer to AddChild and InsertNode for that one and
> simple reason, namely that you have
> data attached to a node which must be released regardless of
> whether the node has been initialized
> or not. If you don't have the data ready for the AddChild
> call (which is very similar to the normal
> TTreeView behavior in this regard) then why don't you use
> OnInitNode? How do you actually intialize
> the nodes then?

Actually i *do* use OnInitNode/OnInitChildren.
I'll try to explain my case.

I have a hierarchical object model that is stored in a database. I have come
up with a set of interfaces for my object model and some interfaced objects
that implements them (something like the shell IShellFolder object, only
mine can be "items" too, not only "folders").
I load the object model from the database incrementally (this is where
OnInitChildren comes) and during AddChild i *do* have all the information
about the object being added, but i don't want to call it at that time
because it will initialize itself, accessing the database. Instead i do it
in OnInitNode.

To be honest, the best way to do this seems to be using AddChild(Node, Data)
version passing the interface pointer of the object to Data after an
explicit _AddRef (neutralized by a matching _Release in OnFreeNode). I did
it in 2 steps thinking that it would be equivalent, but it is not. I hadn't
realized up till now that the concept of "node initialization" was bound to
the "user data" memory management, meaning that you had assumed that if a
node is not initialized then it has no user data to free.

Well, what can i say... maybe that i should spend more time Reading That FM,
but i really don't have much (as most of us i suspect). And that the
tradeoff for performance and low memory consumption is *always* added
complexity...


re: Re: Access Violation

From: Jim Kueneman [jimdk@m...]
Date: Mon Nov 12, 2001 12:36 pm
Subject: Re: [VirtualTreeview] Re: Access Violation

At 10:14 AM 11/12/2001 +0000, you wrote:
>Dear Sir,
>
>My DataStructure is
>
> PTestTreeNode = ^TTestTreeNode;
> TTestTreeNode = record
> Id : Integer;
> Data : TTestPlanTestTreeData;
> end;
>
>
>My InitNode code is like this
>
>var
> Data : PTestTreeNode;
>begin
> with Sender do
> begin
> Data := GetNodeData( Node );
> Data.Id := nodeTestTree.Id;
> Data.Data := nodeTestTree.Data;
> end;
>
>
>NodeDataSize is
>
> vstTestTree.NodeDataSize := SizeOf( TTestTreeNode );
>
>My GetText is
>
>var
> Data: PTestTreeNode;
>begin
> Data := Sender.GetNodeData( Node );
> if Assigned(Data) then
> if Assigned( Data.Data ) then
> Text := Data.Data.Code
> else
> Text := '!!WrongData!!';
>
>If you can conclude anything from this please let me know..

It looks ok to me depending on what TTestPlanTestTreeData is and if it is
allocated correctly. Where does the AV occur?

Jim


re: (please add a subject line!)

From: "Paul D'Agosta" [pdagosta@c...]
Date: Mon Nov 12, 2001 2:40 pm
Subject: Re: (please add a subject line!)

-
> This can well be, since the tree has to scroll up when it is at the
bottom bound and a node is
> deleted. I'm not sure however what you want. Your display rules are
not very consequently enforced
> anyway (e.g. select a node near the top then scroll down with the
scrollbars without changing the
> selected node and then press the delete button in your demo -> the
selected node is not scrolled
> into view).

Actually, that is exactly what I want. When nodes are being updated,
I want the highlighted Node to remain as close to its original offset
as possible (even if it is off the screen). The application I have is
very dynamic (Nodes being inserted, updated, and deleted many times a
second all day long), and I don't want the screen jumping around all
over the place. In times of heavy deleting (ie hundreds of
deletes/second) when the last node is in view, the screen is
unreadable, because of the intermediate redraw(s).

My request is that even when the tree needs to be scrolled up that the
repaint request be defered until the EndUpdate. Or in general, while
in a BeginUpdate/EndUpdate transaction, that no intermediate screen
updates be done.

 | Replies | Author | Date
4594 | Deleting Nodes while Last Node is Visible | Paul D'Agosta | Mon 11/12/2001
4618 | Re: Deleting Nodes while Last Node is Visible | Paul D'Agosta | Wed 11/14/2001
4673 | Re: (please add a subject line!) | Mike Lischke | Sun 11/18/2001


Deleting Nodes while Last Node is Visible

From: "Paul D'Agosta" [pdagosta@c...]
Date: Mon Nov 12, 2001 2:48 pm
Subject: Deleting Nodes while Last Node is Visible

--- In [VirtualTreeview@y...], "Paul D'Agosta" [pdagosta@c...] wrote:
> -
> > This can well be, since the tree has to scroll up when it is at
the
> bottom bound and a node is
> > deleted. I'm not sure however what you want. Your display rules
are
> not very consequently enforced
> > anyway (e.g. select a node near the top then scroll down with the
> scrollbars without changing the
> > selected node and then press the delete button in your demo -> the
> selected node is not scrolled
> > into view).
>
> Actually, that is exactly what I want. When nodes are being
updated,
> I want the highlighted Node to remain as close to its original
offset
> as possible (even if it is off the screen). The application I have
is
> very dynamic (Nodes being inserted, updated, and deleted many times
a
> second all day long), and I don't want the screen jumping around all
> over the place. In times of heavy deleting (ie hundreds of
> deletes/second) when the last node is in view, the screen is
> unreadable, because of the intermediate redraw(s).
>
> My request is that even when the tree needs to be scrolled up that
the
> repaint request be defered until the EndUpdate. Or in general,
while
> in a BeginUpdate/EndUpdate transaction, that no intermediate screen
> updates be done.

Sorry about the subject line :)

Paul

 | Replies | Author | Date
4618 | Re: Deleting Nodes while Last Node is Visible | Paul D'Agosta | Wed 11/14/2001


re: Re: Access Violation

From: Werner Lehmann [wl@b...]
Date: Mon Nov 12, 2001 6:44 pm
Subject: Re: [VirtualTreeview] Re: Access Violation

Jim Kueneman wrote:
>
> >If you can conclude anything from this please let me know..
>
> It looks ok to me depending on what TTestPlanTestTreeData is and if it is
> allocated correctly. Where does the AV occur?

Exactly what I would have replied.

Jim, the AV is in DoGetText. Here's the original posting from Friday:

> I have a situation like this..
> I have two tabs and one Virtual String Stree in each one..In each tab
> i have some functionality like adding nodes.. deleting.. changing the
> font etc., Some times even when i donot do any operations, while
> changing the tabs I get AccessViolation
>
> and when i looked at Stack Trace is shows like this
>
> TCustomVirtualStringTree.DoGetText
> TCustomVirtualStringTree.DoPaintNode
> TBaseVirtualTree.Pain
>
>
> it does not even show me the parent component or the tab name etc.,
>
> It is very urgent.. Please help me what could be reason..

I am sorry, Ranganath, this looks ok. The error is probably somewhere
else. A small demo would be helpful. Or are you suspecting any particular
cause already?

Werner

 | Replies | Author | Date
4703 | Re: Access Violation | [ranganathdindu@h...] | Mon 11/19/2001


InvalidateNode usage

From: [rhymebusta@h...]
Date: Mon Nov 12, 2001 9:41 pm
Subject: InvalidateNode usage

hi i was wondering what the use of the ValidateNode/InvalidateNode
methods are....i haven't used them anywhere but i've seen them used
in some examples. I've handled the OnNewText event but didn't use
the InvalidateNode() method(even though i was told to) and i haven't
had any problems.
also, what's the use of the BeginUpdate/EndUpdate methods?

 | Replies | Author | Date
4597 | Re: InvalidateNode usage | Werner Lehmann | Mon 11/12/2001


re: InvalidateNode usage

From: Werner Lehmann [wl@b...]
Date: Mon Nov 12, 2001 11:18 pm
Subject: Re: [VirtualTreeview] InvalidateNode usage

[rhymebusta@h...] wrote:
>
> hi i was wondering what the use of the ValidateNode/InvalidateNode
> methods are....i haven't used them anywhere but i've seen them used
> in some examples. I've handled the OnNewText event but didn't use
> the InvalidateNode() method(even though i was told to) and i haven't
> had any problems.

Just look in the source, there's a comment at the beginning of those
methods.

function TBaseVirtualTree.InvalidateNode(Node: PVirtualNode): TRect;

// Initiates repaint of the given node and returns the just invalidated
rectangle.

procedure TBaseVirtualTree.ValidateNode(Node: PVirtualNode; Recursive: Boolean);

// Ensures that the given node (and all its children, if Recursive is True) are
initialized.

> also, what's the use of the BeginUpdate/EndUpdate methods?

Call BeginUpdate if you are going to do a lot of tree modifications. The
tree will not repaint itself for every change until you call EndUpdate.
Good idea to use try..finally for those. Because if your EndUpdate is not
executed after a BeginUpdate the tree will never paint itself again and
you can 'draw' with other windows on it...

The reason for this is that the tree modifications are much faster and
that the user sees all modifications at once when they are done.

Werner


Draw the route path

From: [sephokimo@y...]
Date: Tue Nov 13, 2001 12:20 am
Subject: Draw the route path

Hi all,

I want to draw the route of VT, add RouteTree property in
TBaseVirtualTree:
property RouteTree: Boolean read FRouteTree write FRouteTree;

On TBaseVirtualTree.Paint modify as following codes:

// 2) paint tree lines if requested
if voShowTreeLines in FOptions then
begin
for X := 0 to IndentSize - 1 do
begin
// Sephiroth
if FRouteTree and GetSelected(Node) then
FOffScreenBitmap.Canvas.Pen.Color := clBlue
else
FOffScreenBitmap.Canvas.Pen.Color := FColors.TreeLineColor;

DrawLineImage(FOffScreenBitmap.Canvas, NodeClipRect.Left + X *
Integer(FIndent), R.Top,
Node.NodeHeight, VAlign, LineType[X]);
end;
end;

But seems that it's difficult to draw tree lines within selected
nodes, has any suggestion?

regards,
Sephiroth

 | Replies | Author | Date
4599 | Re: Draw the route path | Werner Lehmann | Tue 11/13/2001
4600 | Re: Draw the route path | Helge Jung (ECO-Logic) | Tue 11/13/2001
4602 | Re: Draw the route path | Franz-Leo Chomse | Tue 11/13/2001
4603 | Re: Draw the route path | Helge Jung (ECO-Logic) | Tue 11/13/2001
4604 | Re: Draw the route path | Franz-Leo Chomse | Tue 11/13/2001
4605 | Re: Draw the route path | Helge Jung (ECO-Logic) | Tue 11/13/2001
4606 | Re: Draw the route path | Franz-Leo Chomse | Tue 11/13/2001
4601 | Re: Draw the route path | Ralf Melles | Tue 11/13/2001
4607 | Re: Draw the route path | Werner Lehmann | Tue 11/13/2001


re: Draw the route path

From: Werner Lehmann [wl@b...]
Date: Tue Nov 13, 2001 1:23 pm
Subject: Re: [VirtualTreeview] Draw the route path

[sephokimo@y...] wrote:
>
> I want to draw the route of VT, add RouteTree property in
> TBaseVirtualTree:

Am I the only one who does not know what a route path is?

> property RouteTree: Boolean read FRouteTree write FRouteTree;

Sounds more like an option but a boolean property.

Werner

 | Replies | Author | Date
4600 | Re: Draw the route path | Helge Jung (ECO-Logic) | Tue 11/13/2001
4602 | Re: Draw the route path | Franz-Leo Chomse | Tue 11/13/2001
4603 | Re: Draw the route path | Helge Jung (ECO-Logic) | Tue 11/13/2001
4604 | Re: Draw the route path | Franz-Leo Chomse | Tue 11/13/2001
4605 | Re: Draw the route path | Helge Jung (ECO-Logic) | Tue 11/13/2001
4606 | Re: Draw the route path | Franz-Leo Chomse | Tue 11/13/2001


re: Draw the route path

From: "Helge Jung \(ECO-Logic\)" [helge@e...]
Date: Tue Nov 13, 2001 1:39 pm
Subject: Re: [VirtualTreeview] Draw the route path

> Am I the only one who does not know what a route path is?

Definitivly not. Maybe he can tell us two what a route path is? By "route" I
think of packet routing - but that's perhaps not what he meant ;-)

Helge.


re: Draw the route path

From: "Ralf Melles" [rmelles@g...]
Date: Tue Nov 13, 2001 2:21 pm
Subject: Re: Draw the route path

Maybe he want´s to show the path from the selected node up to the
root by drawing bold treelines between the "routenodes"?

Ralf


re: Draw the route path

From: Franz-Leo Chomse [chomse@c...]
Date: Tue Nov 13, 2001 2:42 pm
Subject: Re: [VirtualTreeview] Draw the route path

On Tue, 13 Nov 2001 14:23:41 +0100, Werner Lehmann [wl@b...] wrote:

>
>[sephokimo@y...] wrote:
>>
>> I want to draw the route of VT, add RouteTree property in
>> TBaseVirtualTree:
>
>Am I the only one who does not know what a route path is?

The complete node chain from root to current node.

root.child.grandchild ...

Regards from Germay

Franz-Leo

 | Replies | Author | Date
4603 | Re: Draw the route path | Helge Jung (ECO-Logic) | Tue 11/13/2001
4604 | Re: Draw the route path | Franz-Leo Chomse | Tue 11/13/2001
4605 | Re: Draw the route path | Helge Jung (ECO-Logic) | Tue 11/13/2001
4606 | Re: Draw the route path | Franz-Leo Chomse | Tue 11/13/2001


re: Draw the route path

From: "Helge Jung \(ECO-Logic\)" [helge@e...]
Date: Tue Nov 13, 2001 2:53 pm
Subject: Re: [VirtualTreeview] Draw the route path

> > >Am I the only one who does not know what a route path is?

> > The complete node chain from root to current node.

> root.child.grandchild ...

And what would be the purpose for that? I can't see one in the moment -
maybe someone can explain that to me.

Helge.

 | Replies | Author | Date
4604 | Re: Draw the route path | Franz-Leo Chomse | Tue 11/13/2001
4605 | Re: Draw the route path | Helge Jung (ECO-Logic) | Tue 11/13/2001
4606 | Re: Draw the route path | Franz-Leo Chomse | Tue 11/13/2001


re: Draw the route path

From: Franz-Leo Chomse [chomse@c...]
Date: Tue Nov 13, 2001 3:16 pm
Subject: Re: [VirtualTreeview] Draw the route path

On Tue, 13 Nov 2001 15:53:24 +0100, "Helge Jung \(ECO-Logic\)"
[helge@e...] wrote:

>
>> > >Am I the only one who does not know what a route path is?
>
>> > The complete node chain from root to current node.
>
>> root.child.grandchild ...
>
>And what would be the purpose for that? I can't see one in the moment -
>maybe someone can explain that to me.

Building the access path in a hierarchical database. (or the complete
path name of a file in an explorer view)

Building a unique identifier for the node, assuming that the
childs names are unique for one parent.

Regards from Germany

Franz-Leo

 | Replies | Author | Date
4605 | Re: Draw the route path | Helge Jung (ECO-Logic) | Tue 11/13/2001
4606 | Re: Draw the route path | Franz-Leo Chomse | Tue 11/13/2001


re: Draw the route path

From: "Helge Jung \(ECO-Logic\)" [helge@e...]
Date: Tue Nov 13, 2001 3:39 pm
Subject: Re: [VirtualTreeview] Draw the route path

>And what would be the purpose for that? I can't see one in the moment -
>maybe someone can explain that to me.

Building the access path in a hierarchical database. (or the complete
path name of a file in an explorer view)

Building a unique identifier for the node, assuming that the
childs names are unique for one parent.

I always use this function for storing references to nodes in databases:

function CaptureNodeLevel (Tree: TBaseVirtualTree; Node: PVirtualNode) :
string;
var
ParentNode : PVirtualNode;

begin
if (Node <> nil) and (Node <> Tree.RootNode) then
begin
Result := IntToStr (Node^.Index);

ParentNode := Node^.Parent;
while (ParentNode <> Tree.RootNode) and (ParentNode <> nil) do
begin
Node := ParentNode;
Result := IntToStr (Node^.Index) + '.' + Result;

ParentNode := Node^.Parent;
end;
end
else
Result := '';
end;

But this routine goes the other way down (from the child node up to the root
node) ... maybe I don't see the forest because of all the trees...

Helge.

 | Replies | Author | Date
4606 | Re: Draw the route path | Franz-Leo Chomse | Tue 11/13/2001


re: Draw the route path

From: Franz-Leo Chomse [chomse@c...]
Date: Tue Nov 13, 2001 4:23 pm
Subject: Re: [VirtualTreeview] Draw the route path

>But this routine goes the other way down (from the child node up to the root
>node) ... maybe I don't see the forest because of all the trees...

The route path is the result of your function.

Regards from Germany

Franz-Leo


re: Draw the route path

From: Werner Lehmann [wl@b...]
Date: Tue Nov 13, 2001 5:26 pm
Subject: Re: [VirtualTreeview] Draw the route path

Franz-Leo Chomse wrote:
>
> >But this routine goes the other way down (from the child node up to the root
> >node) ... maybe I don't see the forest because of all the trees...
>
> The route path is the result of your function.

Anyway we are talking about a visual enhancement here ('draw' the route path!).

A change like this would require an update of a large part of the tree whenever
the selection changes (what about multi selection). For practical purposes I
expect a full Invalidate() for each selection change.

The whole problem is a subset of another request: the ability to custom draw
only
the tree lines and buttons. This would allow one to simply change the color if
the currently painted node is a parent of any selected node. This can also be
quite costly to determine for large trees or multi select trees.

Werner


Header.Background (TColor)

From: "Ariel" [asel98@y...]
Date: Tue Nov 13, 2001 5:42 pm
Subject: Header.Background (TColor)

is working that property?
im using Header.Style=hsPlates

but it always use clBtnFace color.

tia

 | Replies | Author | Date
4609 | Re: Header.Background (TColor) | Werner Lehmann | Tue 11/13/2001


re: Header.Background (TColor)

From: Werner Lehmann [wl@b...]
Date: Tue Nov 13, 2001 7:22 pm
Subject: Re: [VirtualTreeview] Header.Background (TColor)

Ariel wrote:
>
> is working that property?
> im using Header.Style=hsPlates
>
> but it always use clBtnFace color.

Header background is per def. the area to the right of the columns
and is only visible when all columns to not fill up the clientwidth.
This works for me.

Werner


re: TBaseVirtualTree.ValidateChildren

From: "Mike Lischke" [lists@l...]
Date: Tue Nov 13, 2001 7:37 pm
Subject: RE: [VirtualTreeview] TBaseVirtualTree.ValidateChildren

Hi Werner,

> the recursive parameter of this method does nothing at all:
>
> procedure TBaseVirtualTree.ValidateChildren(Node: PVirtualNode; Recursive:
Boolean);

It does something. Look deeper ;-) (hint: ValidateNode).

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: UseThemes

From: "Mike Lischke" [lists@l...]
Date: Tue Nov 13, 2001 7:50 pm
Subject: RE: [VirtualTreeview] UseThemes

> It turned out that the real troublemaker is the function UseThemes. This
> is called before every single checkbox is painted. If I replace that call
> in PaintCheckImage() with "true" the performance problem is gone.
>
> Would be a good idea to replace that function by a local boolean field which
> is only updated on

I have no problem caching the UseThemes result but I would how this can have
such an impact. Usually
there are only a couple of paint cycles with about as much UseThemes calls as
need to draw all
checkboxes in the window once. The only scenario I can imagine is that you
frequently repaint the
checkboxes at a high rate.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


Invisible Node Text

From: "Tom Hahn" [thahn@h...]
Date: Tue Nov 13, 2001 8:29 pm
Subject: Invisible Node Text

I have an application which includes user-configurable text and background
colors in the primary column at the lowest level node. I accomplish this by
using the following event handlers (simplified):

(in the following example, BackColor is clWhite and FontColor is clBlack)

procedure TMainForm.VstBeforeCellPaint(Sender: TBaseVirtualTree;
Canvas: TCanvas; Node: PVirtualNode; Column: Integer; CellRect: TRect);
begin
if Column = 0 then
begin
Canvas.Brush.Color := BackColor;
Canvas.FillRect(CellRect);
end;
end;

procedure TMainForm.VSTPaintText(Sender: TBaseVirtualTree;
const Canvas: TCanvas; Node: PVirtualNode; Column: Integer;
TextType: TVSTTextType);
var
Data : PTree;
begin
if Node = Vst.FocusedNode then
Canvas.Pen.Mode := pmMaskPenNot
else
Canvas.Font.Color := FontColor;
end;

This works fine so long as the form containing the tree is in focus. The
node text remains visible whether or node the node is selected (black
background). Part of the application however, involves the user clicking on
a node when starts another program using ShellExecute.
In this case, the cell becomes totally black and the text is invisible until
focus returns to the form containing the tree.

I have tried testing in the PaintText event whether or not the form with the
tree is active. My assumption was if it was not active, the Canvas.Pen.Mode
should be set to "pmMaskPenNot" to force the text color to something
visible. This seems to have no effect.

What can I do to keep the text visible at all times (selected, unselected,
with or without the form being active)?

TIA,
Tom

---------------------------------
Thomas Hahn
Hahn Technology, Inc.
mailto:[thahn@h...]
http://www.hahntech.com
---------------------------------
The home of:
Scan: Hardware/Software Inventory
WebBank: URL/Password Manager
---------------------------------

 | Replies | Author | Date
4674 | Re: Invisible Node Text | Mike Lischke | Sun 11/18/2001
4692 | Re: Invisible Node Text | Tom Hahn | Sun 11/18/2001


re: UseThemes

From: Werner Lehmann [wl@b...]
Date: Tue Nov 13, 2001 9:35 pm
Subject: Re: [VirtualTreeview] UseThemes

Hi Mike,

> > It turned out that the real troublemaker is the function UseThemes. This
> > is called before every single checkbox is painted. If I replace that call
> > in PaintCheckImage() with "true" the performance problem is gone.
> >
> > Would be a good idea to replace that function by a local boolean field which
> > is only updated on
>
> I have no problem caching the UseThemes result but I would how this can have
such an impact. Usually
> there are only a couple of paint cycles with about as much UseThemes calls as
need to draw all
> checkboxes in the window once. The only scenario I can imagine is that you
frequently repaint the
> checkboxes at a high rate.

Don't think so, that is just up to VET.

Just one minute ago I could reproduce the effect another time - the tree build
was so
fast that I wondered why I would complain about it (less 1 sec). But I fooled
myself
because I had commented out the UseThemes call in PaintCheckImage. After I have
put
that back in the first tree build took 2-3 seconds again. It is tolerable but
it is
not necessary and not very pretty to see through VET during this time.

Werner

procedure TBaseVirtualTree.PaintCheckImage(const PaintInfo: TVTPaintInfo);

if (toThemeAware in FOptions.PaintOptions) {and UseThemes} then

 | Replies | Author | Date
4675 | Re: UseThemes | Mike Lischke | Sun 11/18/2001


re: TBaseVirtualTree.ValidateChildren

From: Werner Lehmann [wl@b...]
Date: Tue Nov 13, 2001 9:36 pm
Subject: Re: [VirtualTreeview] TBaseVirtualTree.ValidateChildren

Hi Mike,

> It does something. Look deeper ;-) (hint: ValidateNode).

I should really stop smoking, uhm, whatever I smoke. Sorry ;)

Werner


Can not compile D4 package

From: "Peter Evans" [pgevans@m...]
Date: Wed Nov 14, 2001 4:53 am
Subject: Can not compile D4 package

Yesterday I downloaded from Yahoo file site "VirtualTree_2.6.5.zip".

I double clicked on package "VirtualTreesD4.dpk". When the package came on
screen, I clicked on
button "Compile".

I was able to compile the units (listed in the package) once. But do not get
"...dcp". Then when
clicked "Install" I get the error "Access violation at address 0086A927 in
module 'DCC40.DLL'. Read of
address 02BF1000"

Now when I click "Compile" I get same error.

The file "DCC40.DLL" is in "...\Borland\Delphi4\Bin".

What do I need to do to compile the package correctly?

Regards, Peter Evan

 | Replies | Author | Date
4616 | Re: Can not compile D4 package | Helge Jung (ECO-Logic) | Wed 11/14/2001
4617 | Out of topic | [ls@t...] | Wed 11/14/2001
4676 | Re: Out of topic | Mike Lischke | Sun 11/18/2001
4630 | Re: Can not compile D4 package | Peter Evans | Thu 11/15/2001
4678 | Re: Can not compile D4 package | Mike Lischke | Sun 11/18/2001


re: Can not compile D4 package

From: "Helge Jung \(ECO-Logic\)" [helge@e...]
Date: Wed Nov 14, 2001 6:11 am
Subject: Re: [VirtualTreeview] Can not compile D4 package

> Yesterday I downloaded from Yahoo file site "VirtualTree_2.6.5.zip".
> I double clicked on package "VirtualTreesD4.dpk". When the package came on
> screen, I clicked on button "Compile".

All ok up to here.

> I was able to compile the units (listed in the package) once. But
> do not get "...dcp". Then when clicked "Install" I get [...]

Don't install it. After you've build/compiled it close the
VirtualTreesD4.dpk and open VirtualTreesD4D.dpk. This one you install. Then
everything should be fine.

Helge.

 | Replies | Author | Date
4617 | Out of topic | [ls@t...] | Wed 11/14/2001
4676 | Re: Out of topic | Mike Lischke | Sun 11/18/2001


Out of topic

From: [ls@t...]
Date: Wed Nov 14, 2001 9:31 am
Subject: Out of topic

Hello,

I know it is al little bit out of topic. But can anybody tell me what
is the translation of "Dipl.-Ing." into english?

After some searches in the Internet, I found something like "grad.
eng." or "eng. grad.". But I don't exactly know, if this is right.

Sorry again for disturbing the list with this out of topic question.

Regards

Lars

--------------------------------------------------
Dipl.-Ing. Lars Söding
eMail: [ls@t...]
Internet: www.tpm-online.de
--------------------------------------------------

 | Replies | Author | Date
4676 | Re: Out of topic | Mike Lischke | Sun 11/18/2001


re: Deleting Nodes while Last Node is Visible

From: "Paul D'Agosta" [pdagosta@c...]
Date: Wed Nov 14, 2001 3:39 pm
Subject: Re: Deleting Nodes while Last Node is Visible

> My request is that even when the tree needs to be scrolled up that
the
> repaint request be defered until the EndUpdate. Or in general,
while
> in a BeginUpdate/EndUpdate transaction, that no intermediate
screen
> updates be done.

After researching the problem a little, I think I can clarify this
request.
Here is my call stack:
1) EndUpdate
2) UpdateScrollBars(true)
3) UpdateVerticalScrollBar(true)
4) SetOffsetY(...)
5) DoSetOffsetXY(...)

During a structure change, especially a node deletion, the offset from
the top of the client area can change. This is not a scrolling
operation.
In DoSetOffsetXY() ScrollWindow is called which causes an immediate
repaint. This repaint does not necessarily reflect the true state of
FOffsetY. When EndUpdate finally calls Invalidate, the control will
be repainted correctly.

The reason ScrollWindow paints the wrong state is that it assumes the
delta in Offsety is due to a scrolling operation, which in a structure
change is not the case.

Even without my "display rule" this is still a problem.

1) Create a VST with lots of nodes.
2) Create a button with the following Click event:
with VST1 do
begin
BeginUpdate;
DeleteNode(GetFirst);
EndUpdate;
end;
3) Set a breakpoint in EndUpdate at UpdateScrollBars;
4) Run the App
5) Scroll to the very bottom.
6) Click the button.
7) Step over the UpdateScrollBars. The last Node is off the screen
now.
8) Continue the program. The invalidate causes the screen to be
repainted correctly.

I hope this clearly shows what my problem is.
I appreciate your time and effort.

Thank you,
Paul


IterateSubtree beginner

From: [slackmeister@y...]
Date: Wed Nov 14, 2001 5:48 pm
Subject: IterateSubtree beginner

hi,

I'm not doing so well with the IterateSubtree, I receive a compiler
method of 'Incompatible types : method pointer and regular procedure'.

here are my declarations

procedure RefreshTree(thisTree : TVirtualStringTree);
procedure RefreshNode(Sender: TBaseVirtualTree; Node: PVirtualNode;
Data: Pointer; var Abort: Boolean);

and here is the code:

procedure RefreshTree(thisTree : TVirtualStringTree);
begin
thisTree.IterateSubtree(nil, RefreshNode ,nil,[],false,false);
end; //refresh tree

{
refreshes the node
}
procedure RefreshNode(Sender: TBaseVirtualTree; Node: PVirtualNode;
Data: Pointer; var Abort: Boolean);
var
nI : integer;
begin
//node refreshing code
end;

could you please let me know what I have to do in order to get this
to work? ( or an easier way to refresh all initialized nodes)

thanks
taryn

 | Replies | Author | Date
4620 | Re: IterateSubtree beginner | Bender Heri | Wed 11/14/2001
4621 | Re: IterateSubtree beginner | GIANNAKOPOULOS KOSTAS | Wed 11/14/2001
4622 | Re: IterateSubtree beginner | [slackmeister@y...] | Wed 11/14/2001
4623 | Re: IterateSubtree beginner | GIANNAKOPOULOS KOSTAS | Thu 11/15/2001


re: IterateSubtree beginner

From: Bender Heri [HBender@E...]
Date: Wed Nov 14, 2001 6:00 pm
Subject: RE: [VirtualTreeview] IterateSubtree beginner

The method RefreshNode must be part of a class and not a standalone one.

Heri

> -----Original Message-----
> From: [slackmeister@y...] [mailto:[slackmeister@y...]]
> Sent: Wednesday, November 14, 2001 6:49 PM
> To: VirtualTreeview@yahoogroups.com
> Subject: [VirtualTreeview] IterateSubtree beginner
>
>
> hi,
>
> I'm not doing so well with the IterateSubtree, I receive a compiler
> method of 'Incompatible types : method pointer and regular procedure'.
>
> here are my declarations
>
> procedure RefreshTree(thisTree : TVirtualStringTree);
> procedure RefreshNode(Sender: TBaseVirtualTree; Node: PVirtualNode;
> Data: Pointer; var Abort: Boolean);
>
> and here is the code:
>
> procedure RefreshTree(thisTree : TVirtualStringTree);
> begin
> thisTree.IterateSubtree(nil, RefreshNode ,nil,[],false,false);
> end; //refresh tree
>
> {
> refreshes the node
> }
> procedure RefreshNode(Sender: TBaseVirtualTree; Node: PVirtualNode;
> Data: Pointer; var Abort: Boolean);
> var
> nI : integer;
> begin
> //node refreshing code
> end;
>
> could you please let me know what I have to do in order to get this
> to work? ( or an easier way to refresh all initialized nodes)
>
> thanks
> taryn
>
>
> To unsubscribe from this group, send an email to:
> VirtualTreeview-unsubscribe@egroups.com
>
>
>
> Your use of Yahoo! Groups is subject to
> http://docs.yahoo.com/info/terms/
>
>


re: IterateSubtree beginner

From: GIANNAKOPOULOS KOSTAS [kyan@s...]
Date: Wed Nov 14, 2001 5:53 pm
Subject: RE: [VirtualTreeview] IterateSubtree beginner

Your iterator callback must be a method of an object (any object will do)
and not a regular procedure. This is what the "of object" notation in the
declaration of TVTGetNodeProc states.

instead of

procedure RefreshNode(Sender: TBaseVirtualTree; Node: PVirtualNode; Data:
Pointer; var Abort: Boolean);

it should be

procedure TYourForm.RefreshNode(Sender: TBaseVirtualTree; Node:
PVirtualNode; Data: Pointer; var Abort: Boolean);

> I'm not doing so well with the IterateSubtree, I receive a compiler
> method of 'Incompatible types : method pointer and regular procedure'.

 | Replies | Author | Date
4622 | Re: IterateSubtree beginner | [slackmeister@y...] | Wed 11/14/2001


re: IterateSubtree beginner

From: [slackmeister@y...]
Date: Wed Nov 14, 2001 8:23 pm
Subject: Re: IterateSubtree beginner

this will now compile, but I cannot get it to work as I had hoped.
I am trying to refresh all visible nodes -- both the data and
visually in the tree. Any ideas?

procedure RefreshTree(thisTree : TVirtualStringTree);
var
RefreshNode : TRefreshNode;
begin
RefreshNode := TRefreshNode.Create;
thisTree.IterateSubtree(thisTree.TopNode,
RefreshNode.RefreshNode ,nil,[vsVisible, vsInitialized],false,false);
thisTree.Invalidate;
end; //refresh tree

procedure TRefreshNode.RefreshNode(Sender: TBaseVirtualTree; Node:
PVirtualNode; Data: Pointer; var Abort: Boolean);
begin
Sender.ReinitNode(Node,true);
Sender.InvalidateNode(Node);
end;

--- In [VirtualTreeview@y...], GIANNAKOPOULOS KOSTAS [kyan@s...] wrote:
> Your iterator callback must be a method of an object (any object
will do)
> and not a regular procedure. This is what the "of object" notation
in the
> declaration of TVTGetNodeProc states.
>
> instead of
>
> procedure RefreshNode(Sender: TBaseVirtualTree; Node: PVirtualNode;
Data:
> Pointer; var Abort: Boolean);
>
> it should be
>
> procedure TYourForm.RefreshNode(Sender: TBaseVirtualTree; Node:
> PVirtualNode; Data: Pointer; var Abort: Boolean);
>
>
> > I'm not doing so well with the IterateSubtree, I receive a
compiler
> > method of 'Incompatible types : method pointer and regular
procedure'.


re: Re: IterateSubtree beginner

From: GIANNAKOPOULOS KOSTAS [kyan@s...]
Date: Thu Nov 15, 2001 8:16 am
Subject: RE: [VirtualTreeview] Re: IterateSubtree beginner

From what i see you want to reinitialize all nodes and have the tree repaint
them. You don't need a manual iteration to do that. Try this:

ThisTree.ReInitNode(nil, True); // This will reinitialize all nodes.
ThisTree.Invalidate; // This will repaint the control.

> this will now compile, but I cannot get it to work as I had hoped.
> I am trying to refresh all visible nodes -- both the data and
> visually in the tree. Any ideas?
>
> procedure RefreshTree(thisTree : TVirtualStringTree);
> var
> RefreshNode : TRefreshNode;
> begin
> RefreshNode := TRefreshNode.Create;
> thisTree.IterateSubtree(thisTree.TopNode,
> RefreshNode.RefreshNode ,nil,[vsVisible, vsInitialized],false,false);
> thisTree.Invalidate;
> end; //refresh tree
>
> procedure TRefreshNode.RefreshNode(Sender: TBaseVirtualTree; Node:
> PVirtualNode; Data: Pointer; var Abort: Boolean);
> begin
> Sender.ReinitNode(Node,true);
> Sender.InvalidateNode(Node);
> end;


Transparent Buttons on colored backgrounds!?

From: Ralf Junker [ralfjunker@g...]
Date: Wed Nov 14, 2001 11:17 pm
Subject: Transparent Buttons on colored backgrounds!?

Hi Mike, Hi Group,

transparent buttons make the tree look *much* nicer when an items' background
has a different color than clWindow or the tree's default background color.

The required changes are five lines of code only (larger context quoted below):

// TButtonFillMode is only used when the button style is bsRectangle and
determines how to fill the interior.
TVTButtonFillMode = (
fmTreeColor, // solid color, uses the trees background color
fmWindowColor, // solid color, uses clWindow
fmShaded, // color gradient, Windows XP style (legacy code, use toThemeAware
on Windows XP instead)
fmTransparent // transparent color, use the item's background color
);

Also, in TBaseVirtualTree.PrepareBitmaps (twice, for FPlusBM and FMinusBM):

// Button style is rectangular. Now ButtonFillMode determines how to fill the
interior.
if FButtonFillMode in [fmTreeColor, fmWindowColor, fmTransparent] then
begin
if FButtonFillMode = fmTreeColor then
Brush.Color := Self.Color
else if FButtonFillMode = fmWindowColor then
Brush.Color := clWindow;

Cheers,

-- Ralf

Mike: Thanks for preventing those TAB keystrokes from stealing focus!

 | Replies | Author | Date
4677 | Re: Transparent Buttons on colored backgrounds!? | Mike Lischke | Sun 11/18/2001
4704 | Re: Transparent Buttons on colored backgrounds!? | Ralf Junker | Mon 11/19/2001


Focus Rectangle too small when font changes to fsBold

From: Ralf Junker [ralfjunker@g...]
Date: Wed Nov 14, 2001 11:56 pm
Subject: Focus Rectangle too small when font changes to fsBold

Hi Mike, Hi Group,

I am using the following event to paint root nodes in bold font if (and only
if) the node in question is expanded.

procedure TfrmMain.TreeViewPaintText(Sender: TBaseVirtualTree;
const Canvas: TCanvas; Node: PVirtualNode; Column: Integer;
TextType: TVSTTextType);
begin
if (Sender.GetNodeLevel(Node) = 0) and (vsExpanded in Node^.States) then
Canvas.Font.Style := [fsBold];
end;

However, when a focused (and selected) node is expanded (by clicking the +
button or using the keyboard), the focus (and selection) rectangle does not
grow with the font. It only grows after clicking the text with the mouse.

As it seems, the font change information is not passed on to the the focus /
selection rectangle, which is then not resized.

Or should I use another event to change the font to bold?

Thanks for any answer,

-- Ralf

 | Replies | Author | Date
4628 | Re: Focus Rectangle too small when font changes tWerner | Werner Lehmann | Thu 11/15/2001
4633 | Re: Focus Rectangle too small when font changes tGIANNAK | GIANNAKOPOULOS KOSTAS | Thu 11/15/2001
4679 | Re: Focus Rectangle too small when font changes t Mike Li | Mike Lischke | Sun 11/18/2001
4730 | Re: Focus Rectangle too small when font changes t | Ralf Junker | Tue 11/20/2001
4788 | Re: Focus Rectangle too small when font changes | Mike Lischke | Sat 11/24/2001


Is it possible to use VirtualDBTree as a DBGrid???

From: [zh66w6@h...]
Date: Thu Nov 15, 2001 9:51 am
Subject: Is it possible to use VirtualDBTree as a DBGrid???

Is it possible to use VirtualDBTree as a DBGrid??? If so, how?
Anybody got any examples on how to use the DBTrees?

Cheers,
Paul


Which version?

From: Lucas Franzen [luc@r...]
Date: Thu Nov 15, 2001 10:02 am
Subject: Which version?

Hi,

I realized that I'm still using V1.31 - the last Version 1 build - of
TVirtualTreeview.

So I just thought about getting a version 2.

But which one?

If I go to Mike's homepage there's a download, but no version number
supplied (in the .pas file there's just a version 2.0,
VTStreamMajorVersion = 1, VTStreamMinorVersion = 16).

If I go to the YahooGroups there are just Beta Versionas and
ReleaseCandidates available.

So I'm a little confused which version to use.

Will there be major problems when moving from V1 to V2 ???

Any help is welcome.

Thanks
Luc.

 | Replies | Author | Date
4629 | Re: Which version? | Werner Lehmann | Thu 11/15/2001


re: Focus Rectangle too small when font changes to fsBold

From: Werner Lehmann [wl@b...]
Date: Thu Nov 15, 2001 10:14 am
Subject: Re: [VirtualTreeview] Focus Rectangle too small when font changes to fsBold

Ralf Junker wrote:
>
> However, when a focused (and selected) node is expanded (by clicking the +
button or using the keyboard), the focus (and selection) rectangle does not
grow with the font. It only grows after clicking the text with the mouse.
>
> As it seems, the font change information is not passed on to the the focus /
selection rectangle, which is then not resized.
>
> Or should I use another event to change the font to bold?

I had a similar problem. Here's Mikes answer:

> Hi Werner,
>
> > this time I could surface the bug. The key was to change some nodes to bold
face after
> > they had been displayed already (and thus the node width had already been
determined I
> > guess).
>
> Well, here you've hit one of the weak points of VT. You should call
InvalidateNode when you change
> its caption size. You know this is caused by the cached node width in the
string tree, but I cannot
> retrieve this also from an event (or determine it on demand), because this
would be way to slow.
>
> I'm all open ears for suggestions for improving this...

Werner


re: Which version?

From: Werner Lehmann [wl@b...]
Date: Thu Nov 15, 2001 10:17 am
Subject: Re: [VirtualTreeview] Which version?

Lucas Franzen wrote:
>
> But which one?

Take the latest Release Candidate in the root-dir of YG files area.

> Will there be major problems when moving from V1 to V2 ???

Hard to say, never tried it. Expect some event signature changes. No idea how
compatible the rest is, it has changed a lot.

Werner


re: Can not compile D4 package

From: "Peter Evans" [pgevans@m...]
Date: Thu Nov 15, 2001 10:02 am
Subject: Re: [VirtualTreeview] Can not compile D4 package

Thank you Helge for your very quick reply. I took your tips and found a
solution!

Message to Mike Lischke ::-
I downloaded from your website 'VTHtml.zip' 887kb. I tried to follow the
"Virtual Treeview Instalation" but failed.
These are the steps I followed to install in Delphi 4. If you want, please
use the following in a revised "Installation".

1) remove any similar packages from Delphi IDE
2) rename any directories that contain old versions of Virtual Treeview.
3) copy 'VirtualTreeD4D.res' and rename it 'VirtualTreeD4.res'. Place in
same directory.
4) double click on file '~D4D.dpk'. This will run Delphi and the package
will
appear on screen.
5) Compile package by clicking the 'Compile' button.
6) Install package by clicking the 'Install' button. You should get the
message that 3 components have been registered.
7) Exit Delphi.
8) Run Delphi. If you get the message "Can't load package ...One of the
library files needed to run this application cannot be found..." Click Yes.
The message reappears. Click Yes.
You probably need to copy '~D4.dcp' and '~D4D.dcp' to 'c:\windows\system' or
whatever.
You may need to add browsing path to ::- dialog 'Environment Options', tab
'Library'.
9) The 3 components should be visible in Component Toolbar.
10) Exit Delphi. Run Delphi.
11) Are the 3 components still visible? If they are then Success.
If they are not then create a new project and place the 3 components on the
new form.Compile.
This should make the components "stick" to the Component Toolbar. Success.

The above worked for me.

Regards, Peter Evans

 | Replies | Author | Date
4678 | Re: Can not compile D4 package | Mike Lischke | Sun 11/18/2001


Problem with forms on demo files

From: "Peter Evans" [pgevans@m...]
Date: Thu Nov 15, 2001 10:00 am
Subject: Problem with forms on demo files

Now that I have VirtualTreeview working under Delphi 4 I wanted to test a
few demo programs.

I downloaded 'Saving_and_Loading_VT' and 'VT_Basics.zip'. Unfortunately the
forms in each of those demos have been saved under Delphi 5? So with Delphi
4 one gets an "invalid stream error".

How can I obtain a Delphi 4 compatible version of the two demos? Can anyone
send me a copy please?

Regards, Peter Evans


Set RootNode to FocusedNode

From: [rnoc@s...]
Date: Thu Nov 15, 2001 11:56 am
Subject: Set RootNode to FocusedNode

Why RootNode can not be set as FocusedNode programmatically ???
When I set FocusedNode = RootNode nothing happens, because
in procedure DoFocusNode you have put this code:
if Node = FRoot then
Node := nil;

Kind regards, Riko.

 | Replies | Author | Date
4634 | Re: Set RootNode to FocusedNode | [rnoc@s...] | Thu 11/15/2001
4635 | Re: Set RootNode to FocusedNode | Jim Kueneman | Thu 11/15/2001


re: Focus Rectangle too small when font changes to fsBold

From: GIANNAKOPOULOS KOSTAS [kyan@s...]
Date: Thu Nov 15, 2001 11:57 am
Subject: RE: [VirtualTreeview] Focus Rectangle too small when font changes to fsBold

Well, actually i have a suggestion for Mike on this one. It is just a quick
thought and probably needs more thinking but here it is:

Temporarily hook the Canvas.OnChange event handler to a provate method that
just sets a FCanvasChanged data-member in the VT and then invalidate the
node if FCanvasChanged is True:

procedure TCustomVirtualStringTree.CanvasChanged(Sender: TObject);
begin
FCanvasChanged := True;
end;

procedure TCustomVirtualStringTree.DoPaintText(Node: PVirtualNode; const
Canvas: TCanvas; Column: Integer;
TextType: TVSTTextType);

begin
if Assigned(FOnPaintText) then
begin
FCanvasChanged := False;
Canvas.OnChange := CanvasChanged;
try
FOnPaintText(Self, Canvas, Node, Column, TextType);
if FCanvasChanged then InvalidateNode(Node);
finally
Canvas.OnChange := nil;
end;
end;
end;

> Ralf Junker wrote:
> >
> > However, when a focused (and selected) node is expanded (by
> clicking the + button or using the keyboard), the focus (and
> selection) rectangle does not grow with the font. It only
> grows after clicking the text with the mouse.
> >
> > As it seems, the font change information is not passed on
> to the the focus / selection rectangle, which is then not resized.
> >
> > Or should I use another event to change the font to bold?
>
> I had a similar problem. Here's Mikes answer:
>
> > Hi Werner,
> >
> > > this time I could surface the bug. The key was to change
> some nodes to bold face after
> > > they had been displayed already (and thus the node width
> had already been determined I
> > > guess).
> >
> > Well, here you've hit one of the weak points of VT. You
> should call InvalidateNode when you change
> > its caption size. You know this is caused by the cached
> node width in the string tree, but I cannot
> > retrieve this also from an event (or determine it on
> demand), because this would be way to slow.
> >
> > I'm all open ears for suggestions for improving this...

 | Replies | Author | Date
4679 | Re: Focus Rectangle too small when font changes t Mike Li | Mike Lischke | Sun 11/18/2001
4730 | Re: Focus Rectangle too small when font changes t | Ralf Junker | Tue 11/20/2001
4788 | Re: Focus Rectangle too small when font changes | Mike Lischke | Sat 11/24/2001


re: Set RootNode to FocusedNode

From: [rnoc@s...]
Date: Thu Nov 15, 2001 12:05 pm
Subject: Re: Set RootNode to FocusedNode

Sorry, I didn't read help carefully.
To get my first node I have to do:
GetNext(RootNode).

Kind regards, Riko.

 | Replies | Author | Date
4635 | Re: Set RootNode to FocusedNode | Jim Kueneman | Thu 11/15/2001


re: Re: Set RootNode to FocusedNode

From: Jim Kueneman [jimdk@m...]
Date: Thu Nov 15, 2001 12:19 pm
Subject: Re: [VirtualTreeview] Re: Set RootNode to FocusedNode

>Sorry, I didn't read help carefully.
>To get my first node I have to do:
>GetNext(RootNode).

RootNode is the hidden node. GetFirst will also get the first "real" node
in the tree.

Jim


re: Someone has experiences with printing? ROLAND

From: "Frank van den Bergh" [frankvdbergh@y...]
Date: Thu Nov 15, 2001 12:34 pm
Subject: Re: Someone has experiences with printing? ROLAND

Hi Roland,

Is was interesting whether you had translated the printing procedure
from Mathias?

Best regards,

Frank van den Bergh.
--- In [VirtualTreeview@y...], "Roland" [Beduerftig@S...] wrote:
> > (an acceptable solution) in BCB...
> > (I'm currently using VT v 2.4.23)
> .....
> > That's about it, if someone is interested, I can post the source
> > code to this group (it's about 290 lines of code...)
> >
> > /Mathias
>
> Hi Mathias,
>
> it sounds interest, I released also my project, but in the next
step
> I can try to implement such a feature.
>
> When you copy the code in files area, I can translate it from BCB
to
> delphi.
>
> with best regards
> Roland

 | Replies | Author | Date
4782 | Re: Someone has experiences with printing? ROLAND | Roland | Thu 11/22/2001


Extra node at bottom of list when pointer is nearby

From: [axc97c@y...]
Date: Thu Nov 15, 2001 1:13 pm
Subject: Extra node at bottom of list when pointer is nearby

Hi

I have a tree using the latest version of the VirtualTreeview
control, having several root nodes (about 10), each of which having
about 500-1500 childnodes. However, when i move the mouse past the
last node in the list, when there is space in the window after it,
then i get a duplicate image of the node and its text appearing.
This 'fake' node doesnt do anything when clicked on, and when the
mouse is moves off of where it is, it dissapears.

Please help.

If there is anymore information needed about this problem, i am glad
to give it as its driving me nuts

Thanks

Adam

 | Replies | Author | Date
4638 | Re: Extra node at bottom of list when pointer is Jim K | Jim Kueneman | Thu 11/15/2001
4639 | Re: Extra node at bottom of list when pointer is axc97 | [axc97c@y...] | Thu 11/15/2001
4681 | Re: Extra node at bottom of list when pointer is Mike | Mike Lischke | Sun 11/18/2001


re: Extra node at bottom of list when pointer is nearby

From: "Jim Kueneman" [jimdk@m...]
Date: Thu Nov 15, 2001 1:17 pm
Subject: Re: Extra node at bottom of list when pointer is nearby

>
> If there is anymore information needed about this problem, i am
glad

If you can make a demo that exibits the problem and upload it to the
files area

http://groups.yahoo.com/group/VirtualTreeview/files/BugDemos/

Then add a bug report in the Database are of yahoo groups it would
help Mike out tremondously.

Jim

 | Replies | Author | Date
4639 | Re: Extra node at bottom of list when pointer is axc97 | [axc97c@y...] | Thu 11/15/2001


re: Extra node at bottom of list when pointer is nearby

From: [axc97c@y...]
Date: Thu Nov 15, 2001 2:27 pm
Subject: Re: Extra node at bottom of list when pointer is nearby

--- In [VirtualTreeview@y...], "Jim Kueneman" [jimdk@m...] wrote:
> >
> > If there is anymore information needed about this problem, i am
> glad
>
> If you can make a demo that exibits the problem and upload it to
the
> files area
>
> http://groups.yahoo.com/group/VirtualTreeview/files/BugDemos/
>
> Then add a bug report in the Database are of yahoo groups it would
> help Mike out tremondously.
>
> Jim

After a fair bit of trying to make a demo, it appears then the
process causing the problem, the bit of code causing the problem is

procedure TForm1.Button1Click(Sender: TObject);
var
TempNode : PVirtualNode;
Node : PVirtualNode;
i : Integer;
begin
// create temp node to put em into then to move em later
TempNode := DLList.InsertNode(nil,amAddChildLast);

// create destination node
DestNode := DLList.InsertNode(nil,amAddChildLast);

// if adding 3000 node, then get the error 'nodes must never be
nil' - why?
// if adding 300 nodes, then no problem occurs.
// if adding 1200 then a fake ghost node appears when moving
mouse over certain spots of screen
for i := 0 to 1200 do
begin
Node := DLList.InsertNode(TempNode,amAddChildLast);
DLList.MoveTo(Node, DestNode, amAddChildLast, false);
end;
end;

I have uploaded a demo of this happening.

I am running Delphi 6, on Windows 2000. However, ive tested the
compiled exe file on a win98se machine and the same problem does
occur.

The file uploaded is BugDemos/FakeNodeBug.zip

Thanks

Adam

Also, thanks to the creator of VirtualTreeView, as its the best tree
list thing ive ever seen. Excelent work.


FW: Invisible Node Text

From: "Tom Hahn" [thahn@h...]
Date: Fri Nov 16, 2001 4:58 am
Subject: FW: [VirtualTreeview] Invisible Node Text

I'm resending this in the hope that someone who knows the answer missed the
first message.

Tom

-----Original Message-----
From: Tom Hahn [mailto:[thahn@h...]]
Sent: Tuesday, November 13, 2001 3:29 PM
To: VirtualTreeview
Subject: [VirtualTreeview] Invisible Node Text

I have an application which includes user-configurable text and background
colors in the primary column at the lowest level node. I accomplish this by
using the following event handlers (simplified):

(in the following example, BackColor is clWhite and FontColor is clBlack)

procedure TMainForm.VstBeforeCellPaint(Sender: TBaseVirtualTree;
Canvas: TCanvas; Node: PVirtualNode; Column: Integer; CellRect: TRect);
begin
if Column = 0 then
begin
Canvas.Brush.Color := BackColor;
Canvas.FillRect(CellRect);
end;
end;

procedure TMainForm.VSTPaintText(Sender: TBaseVirtualTree;
const Canvas: TCanvas; Node: PVirtualNode; Column: Integer;
TextType: TVSTTextType);
var
Data : PTree;
begin
if Node = Vst.FocusedNode then
Canvas.Pen.Mode := pmMaskPenNot
else
Canvas.Font.Color := FontColor;
end;

This works fine so long as the form containing the tree is in focus. The
node text remains visible whether or node the node is selected (black
background). Part of the application however, involves the user clicking on
a node when starts another program using ShellExecute.
In this case, the cell becomes totally black and the text is invisible until
focus returns to the form containing the tree.

I have tried testing in the PaintText event whether or not the form with the
tree is active. My assumption was if it was not active, the Canvas.Pen.Mode
should be set to "pmMaskPenNot" to force the text color to something
visible. This seems to have no effect.

What can I do to keep the text visible at all times (selected, unselected,
with or without the form being active)?

TIA,
Tom

---------------------------------
Thomas Hahn
Hahn Technology, Inc.
mailto:[thahn@h...]
http://www.hahntech.com
---------------------------------
The home of:
Scan: Hardware/Software Inventory
WebBank: URL/Password Manager
---------------------------------

To unsubscribe from this group, send an email to:
VirtualTreeview-unsubscribe@egroups.com

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/

 | Replies | Author | Date
4643 | Re: FW: [VirtualTreeview] Invisible Node Text | Jim Kueneman | Fri 11/16/2001
4646 | Re: FW: [VirtualTreeview] Invisible Node Text | Tom Hahn | Fri 11/16/2001
4649 | Re: FW: [VirtualTreeview] Invisible Node Text | Mike Lischke | Fri 11/16/2001


'VT_Basics' demo does not compile

From: "Peter Evans" [pgevans@m...]
Date: Fri Nov 16, 2001 5:45 am
Subject: 'VT_Basics' demo does not compile

I downloaded the most basic demonstration of VirtualTreeview off Yahoo
Groups.
This is the demonstration must first time users would try.
It is 'VT_Basics.ZIP' found in 'Files > Examples > Delphi_Examples >
Misc_Examples'.

The program does not compile. I tried this with a fresh newly installed
Delphi product with no previous installations.
The compiler can not find VirtualExplorerTree and ShellUtilities.
These units are not a part of the VT download.

To work around this problem delete those two units from the USES statement.

Recommended Action - Update the unit Unit1 in the ZIP file with the above
changes.

Regards, Peter Evans

 | Replies | Author | Date
4644 | Re: 'VT_Basics' demo does not compile | Jim Kueneman | Fri 11/16/2001
4742 | Re: 'VT_Basics' demo does not compile | Peter Evans | Wed 11/21/2001


Inverted order on paste

From: [jogador3@y...]
Date: Fri Nov 16, 2001 12:24 pm
Subject: Inverted order on paste

Hello!

First I would like to say that VST is a great component (who does'nt
know yet?)! Second, I am using the functios PasteFromClipboard,
CutToClipboard and CopyToClipboard. It looks like that when I copy
and paste, the order is inverted but when I cut and paste seems to be
Ok. I'm handling this by re-inverting the selection, but I think that
must be an easier way. Any ideas?

The Version I'm using is 2.5.34 and these are my procedures
(simplified):

//------------------------------------------------
procedure TfrmMain.btnCopyClick(Sender: TObject);
begin
VST.CopyToClipBoard;
end;
//------------------------------------------------
procedure TfrmMain.btnCutClick(Sender: TObject);
begin
VST.CutToClipBoard;
end;
//------------------------------------------------
procedure TfrmMain.btnPasteClick(Sender: TObject);
begin
VST.PasteFromClipBoard;
end;
//------------------------------------------------

Thanks and regards!

Trevis

 | Replies | Author | Date
4682 | Re: Inverted order on paste | Mike Lischke | Sun 11/18/2001


re: FW: Invisible Node Text

From: "Jim Kueneman" [jimdk@m...]
Date: Fri Nov 16, 2001 1:11 pm
Subject: Re: FW: [VirtualTreeview] Invisible Node Text

Hi Tom,

> I'm resending this in the hope that someone who knows the answer
missed the

I see your problems but I am not enough of a graphic guru to give you
an answer. This looks like one for Mike.

He should be answering emails later today if his trends continue <g>.

Jim

 | Replies | Author | Date
4646 | Re: FW: [VirtualTreeview] Invisible Node Text | Tom Hahn | Fri 11/16/2001
4649 | Re: FW: [VirtualTreeview] Invisible Node Text | Mike Lischke | Fri 11/16/2001


re: 'VT_Basics' demo does not compile

From: "Jim Kueneman" [jimdk@m...]
Date: Fri Nov 16, 2001 1:14 pm
Subject: Re: 'VT_Basics' demo does not compile

Hi Peter,

> The program does not compile. I tried this with a fresh newly
installed
> Delphi product with no previous installations.
> The compiler can not find VirtualExplorerTree and ShellUtilities.
> These units are not a part of the VT download.

Sorry I made the demo. Those files belong to the VirtualExplorerTree
derivative of VT that I have available at

http://groups.yahoo.com/group/VirtualExplorerTree

I will fix it.

Jim


Hiding nodes

From: [axc97c@y...]
Date: Fri Nov 16, 2001 2:08 pm
Subject: Hiding nodes

If i have one top level node, with lots of children, is it possible
to hide the top level node so it isnt drawn while still having the
children visible?

ie

Node
|-CNode
|-CNode
|-CNode
|-CNode

to

CNode
CNode
CNode
CNode

Is this possible without moving nodes about?

Adam

 | Replies | Author | Date
4647 | Re: Hiding nodes | Werner Lehmann | Fri 11/16/2001
4648 | Re: Hiding nodes | [axc97c@y...] | Fri 11/16/2001
4680 | Re: Hiding nodes | Michael Valentiner=Branth | Sun 11/18/2001
4685 | Re: Hiding nodes | Mike Lischke | Sun 11/18/2001
4732 | Re: Hiding nodes | Michael Valentiner=Branth | Tue 11/20/2001


re: FW: Invisible Node Text

From: "Tom Hahn" [thahn@h...]
Date: Fri Nov 16, 2001 2:18 pm
Subject: RE: FW: [VirtualTreeview] Invisible Node Text

Thanks, Jim

> -----Original Message-----
> From: Jim Kueneman [mailto:[jimdk@m...]]
> Sent: Friday, November 16, 2001 8:12 AM
> To: VirtualTreeview@yahoogroups.com
> Subject: Re: FW: [VirtualTreeview] Invisible Node Text
>
>
> I see your problems but I am not enough of a graphic guru to give you
> an answer. This looks like one for Mike.
>
> He should be answering emails later today if his trends continue <g>.


re: Hiding nodes

From: Werner Lehmann [wl@b...]
Date: Fri Nov 16, 2001 3:37 pm
Subject: Re: [VirtualTreeview] Hiding nodes

[axc97c@y...] wrote:
>
> If i have one top level node, with lots of children, is it possible
> to hide the top level node so it isnt drawn while still having the
> children visible?
>
> ie
>
> Node
> |-CNode
> |-CNode
> |-CNode
> |-CNode
>
> to
>
> CNode
> CNode
> CNode
> CNode
>
> Is this possible without moving nodes about?

Only with tricks. If you don't have any other child nodes (only these
two levels) you can set indent to 0 and change the NodeHeight of the
first node to 0. If there are more levels you can only change the
NodeHeight to 0, switch ShowRoot off and live with what you get... :)

Werner

 | Replies | Author | Date
4648 | Re: Hiding nodes | [axc97c@y...] | Fri 11/16/2001
4680 | Re: Hiding nodes | Michael Valentiner=Branth | Sun 11/18/2001
4685 | Re: Hiding nodes | Mike Lischke | Sun 11/18/2001
4732 | Re: Hiding nodes | Michael Valentiner=Branth | Tue 11/20/2001


re: Hiding nodes

From: [axc97c@y...]
Date: Fri Nov 16, 2001 4:35 pm
Subject: Re: Hiding nodes

Thanks

Worked absolutely perfectly.

Only thing to note : after setting the parent node height to 0, i had
to re set all the child nod heights

Thanks

Adam

--- In [VirtualTreeview@y...], Werner Lehmann [wl@b...] wrote:
> [axc97c@y...] wrote:
> >
> > If i have one top level node, with lots of children, is it
possible
> > to hide the top level node so it isnt drawn while still having the
> > children visible?
> >
> > ie
> >
> > Node
> > |-CNode
> > |-CNode
> > |-CNode
> > |-CNode
> >
> > to
> >
> > CNode
> > CNode
> > CNode
> > CNode
> >
> > Is this possible without moving nodes about?
>
> Only with tricks. If you don't have any other child nodes (only
these
> two levels) you can set indent to 0 and change the NodeHeight of the
> first node to 0. If there are more levels you can only change the
> NodeHeight to 0, switch ShowRoot off and live with what you
get... :)
>
> Werner

 | Replies | Author | Date
4680 | Re: Hiding nodes | Michael Valentiner=Branth | Sun 11/18/2001
4685 | Re: Hiding nodes | Mike Lischke | Sun 11/18/2001
4732 | Re: Hiding nodes | Michael Valentiner=Branth | Tue 11/20/2001


re: FW: Invisible Node Text

From: "Mike Lischke" [lists@l...]
Date: Fri Nov 16, 2001 5:30 pm
Subject: RE: FW: [VirtualTreeview] Invisible Node Text

> He should be answering emails later today if his trends continue <g>.

LOL :o]


Many errors: here's the documentation.

From: "Rony Cesana" [cesana@c...]
Date: Fri Nov 16, 2001 6:07 pm
Subject: Many errors: here's the documentation.

Hello everybody.
I wrote a message about "Canvas does not allow drawing" error some days
ago... but the documentation I supplied was not enough to find out what was
wrong.

The problem is the following: the same application working in win2000 does
not work, sometimes, on win98.

- The error I get more frequently is the "Canvas does not allow drawing"
one.
- Anyway, the assertion "Assert(Y >= FOffsetY, 'GetNodeAt: invalid vertical
position.');" at line 13108 of VirtualTrees.pas (v. 2.0) sometimes fails: I
never invoke such function directly, but I guess its the painting process
that does it (see line 8630 ibidem).
- Sometimes, generically, I get a simple Access Violation exception.

Hope the attachment will be enough to discover what's wrong with my code.

Thanx everybody for your attention,
Rony Cesana

[Non-text portions of this message have been removed]

 | Replies | Author | Date
4651 | Re: Many errors: here's the documentation. | Helge Jung (ECO-Logic) | Fri 11/16/2001
4683 | Re: Many errors: here's the documentation. | Mike Lischke | Sun 11/18/2001
4686 | Re: Many errors: here's the documentation. | Rony Cesana | Sun 11/18/2001
4687 | Re: Many errors: here's the documentation. | Helge Jung (ECO-Logic) | Sun 11/18/2001
4688 | Re: Many errors: here's the documentation. | Mike Lischke | Sun 11/18/2001


re: Many errors: here's the documentation.

From: "Helge Jung \(ECO-Logic\)" [helge@e...]
Date: Fri Nov 16, 2001 6:18 pm
Subject: Re: [VirtualTreeview] Many errors: here's the documentation.

> Hope the attachment will be enough to discover what's wrong with my code.

You can't send attachments. Post your code/example to the Files/BugDemos
area.

Helge.


attached to previous...

From: "Rony Cesana" [cesana@c...]
Date: Fri Nov 16, 2001 6:18 pm
Subject: attached to previous...

here's the attachment of the previous message:
-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_

unit DebugVirtualTree;

interface

(*
object tvTree: TVirtualStringTree
Left = 0
Top = 0
Width = 129
Height = 486
Align = alTop
Anchors = [akLeft, akTop, akRight, akBottom]
BorderStyle = bsSingle
Header.AutoSizeIndex = 0
Header.Columns = <
item
ImageIndex = -1
Layout = blGlyphLeft
Position = 0
Width = 50
end>
Header.Font.Charset = DEFAULT_CHARSET
Header.Font.Color = clWindowText
Header.Font.Height = -11
Header.Font.Name = 'MS Sans Serif'
Header.Font.Style = []
Header.MainColumn = -1
Header.Style = hsThickButtons
HintAnimation = hatSlide
HintMode = hmHint
Images = ilEnabled
Options = [voAcceptOLEDrop, voAnimatedToggle, voAutoDropExpand,
voAutoTristateTracking, voFullRowSelect, voInitOnSave, voRightClickSelect,
voShowButtons, voShowDropmark, voShowRoot, voShowTreeLines,
voToggleOnDblClick]
ParentShowHint = False
ScrollBarOptions.ScrollBarStyle = sbmFlat
ShowHint = True
TabOrder = 0
OnChange = tvTreeChange
OnCompareNodes = tvTreeCompareNodes
OnGetText = tvTreeGetText
OnGetImageIndex = tvTreeGetImageIndex
OnGetHint = tvTreeGetHint
WideDefaultText = 'Node'
end
*)

type
PTreeNodeData = ^TTreeNodeData;
TTreeNodeData = record
SectionName: string;
Hint: string;
Panel, ID: Integer;
LevelOrder: Integer;
end;

implementation

procedure TMainForm.tvTreeCompareNodes(Sender: TBaseVirtualTree; Node1,
Node2: PVirtualNode; Column: Integer; var Result: Integer);
var
rec: PTreeNodeData;
i1, i2: Integer;
begin
Result := 0;

rec := Sender.GetNodeData(Node1);
if rec = nil
then Exit;
i1 := rec.LevelOrder;

rec := Sender.GetNodeData(Node2);
if rec = nil
then Exit;
i2 := rec.LevelOrder;

if i1 < i2
then Result := -1
else if i1 = i2
then Result := 0
else Result := 1;
end;

procedure TMainForm.tvTreeGetImageIndex(Sender: TBaseVirtualTree;
Node: PVirtualNode; Kind: TVTImageKind; Column: Integer;
var Index: Integer);
begin
Index := Sender.GetNodeLevel(Node);
end;

procedure TMainForm.tvTreeGetText(Sender: TBaseVirtualTree;
Node: PVirtualNode; Column: Integer; TextType: TVSTTextType;
var Text: WideString);
var
rec: PTreeNodeData;
begin
rec := Sender.GetNodeData(Node);
if rec = nil
then Text := ''
else Text := rec.SectionName;
end;

procedure TMainForm.tvTreeGetHint(Sender: TBaseVirtualTree;
Node: PVirtualNode; Column: Integer; TextType: TVSTTextType;
var Text: WideString);
var
rec: PTreeNodeData;
begin
rec := Sender.GetNodeData(Node);
if rec = nil
then Text := ''
else Text := rec.Hint;
end;

// here's how, elsewhere, the tree is filled...
inp.node := Tree.AddChild(parent);
Proc(Self.qryTree, Tree.GetNodeData(inp.node));
// where Proc is Assigned the following method:

procedure TMainForm.FillData(DataSet: TDataSet; Data: Pointer);
begin
with PTreeNodeData(Data)^ do
with DataSet do
begin
SectionName := FieldByName(SectionNameFld).AsString;
Panel := FieldByName(PanelFld).AsInteger;
ID := FieldByName(IDFld).AsInteger;
LevelOrder := FieldByName(LOFld).AsInteger;
Hint := FieldByName(HintFld).AsString;
end;
end;

end.

 | Replies | Author | Date
4653 | Re: attached to previous... | Werner Lehmann | Fri 11/16/2001
4654 | Re: attached to previous... | Werner Lehmann | Fri 11/16/2001


re: attached to previous...

From: Werner Lehmann [wl@b...]
Date: Fri Nov 16, 2001 6:42 pm
Subject: Re: [VirtualTreeview] attached to previous...

Rony Cesana wrote:
>
> here's the attachment of the previous message:
> -_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
>
> type
> PTreeNodeData = ^TTreeNodeData;
> TTreeNodeData = record
> SectionName: string;
> Hint: string;
> Panel, ID: Integer;
> LevelOrder: Integer;
> end;

Need to call finalize() for that in OnFreeNode.

> if i1 < i2
> then Result := -1
> else if i1 = i2
> then Result := 0
> else Result := 1;

result := i1 - i2; // Shorter, faster.

> procedure TMainForm.tvTreeGetImageIndex(Sender: TBaseVirtualTree;
> Node: PVirtualNode; Kind: TVTImageKind; Column: Integer;
> var Index: Integer);
> begin
> Index := Sender.GetNodeLevel(Node);
> end;

Sure that you want this also when Kind = ikOverlay(, ikState)?

if Kind in [ikNormal, ikSelected] then
Index := ...

> procedure TMainForm.tvTreeGetText(Sender: TBaseVirtualTree;
> Node: PVirtualNode; Column: Integer; TextType: TVSTTextType;
> var Text: WideString);
> var
> rec: PTreeNodeData;
> begin
> rec := Sender.GetNodeData(Node);
> if rec = nil
> then Text := ''
> else Text := rec.SectionName;
> end;

Set DefaultText to '' and you avoid one redundant assignment:

if rec <> nil then
Text := ...

> // here's how, elsewhere, the tree is filled...
> inp.node := Tree.AddChild(parent);
> Proc(Self.qryTree, Tree.GetNodeData(inp.node));
> // where Proc is Assigned the following method:
>
> procedure TMainForm.FillData(DataSet: TDataSet; Data: Pointer);
> begin
> with PTreeNodeData(Data)^ do
> with DataSet do
> begin
> SectionName := FieldByName(SectionNameFld).AsString;
> Panel := FieldByName(PanelFld).AsInteger;
> ID := FieldByName(IDFld).AsInteger;
> LevelOrder := FieldByName(LOFld).AsInteger;
> Hint := FieldByName(HintFld).AsString;
> end;
> end;

Don't see anything which would cause the error. How about a small stand alone
demo unless someone else finds something significant?

Werner


re: attached to previous...

From: Werner Lehmann [wl@b...]
Date: Fri Nov 16, 2001 6:46 pm
Subject: Re: [VirtualTreeview] attached to previous...

Werner Lehmann wrote:
>
> Need to call finalize() for that in OnFreeNode.
>

> > inp.node := Tree.AddChild(parent);
> > Proc(Self.qryTree, Tree.GetNodeData(inp.node));

In order to have OnFreeNode called you must convince VT that the
node is init'ed (afaik):

Include(inp.node.State, vsUserInitialized); // not sure about the sp. of the
enum value.

Werner


re: Bugs

From: "Mike Lischke" [lists@l...]
Date: Fri Nov 16, 2001 7:28 pm
Subject: RE: [VirtualTreeview] Bugs

Hi Jim,

> Use VT and the ShellDetails for column headers. Where I see the problem is
> on Line 6373 of the VirtualExplorerTree.pas. When you right click the
> header to allow the different columns to the shown I save the header to a
> stream so if the user changes the columns then hits cancel the old header
> is loaded back from the stream. You can see my note in the file.

Finally, I wanted to go hunting your header stream bug but I cannot get the
code to execute with the
VET source I have. In TColumnMenuItem.Click; there is a check for ColumnIndex <
-1 which is never
True so I guess I must use a different demo (the one simulating a full
explorer?). I did not find
the source for it, though.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net

 | Replies | Author | Date
4659 | Re: Bugs | Jim Kueneman | Fri 11/16/2001
4684 | Re: Bugs | Mike Lischke | Sun 11/18/2001
4700 | Re: Header Streaming WAS - Bugs | Jim Kueneman | Sun 11/18/2001


Newsgroup

From: "Mike Lischke" [lists@l...]
Date: Fri Nov 16, 2001 8:07 pm
Subject: Newsgroup

Hi all,

from now on there is an official newsgroup for Virtual Treeview. You will find
it at:

news://forums.talkto.net/delphi-gems.support.virtualtreeview

Read you there ...

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


OnFreeNode question

From: [rhymebusta@h...]
Date: Fri Nov 16, 2001 8:34 pm
Subject: OnFreeNode question

hi i was wondering:
if i call the DeleteNode() method, do i have to implement the
OnFreeNode even handler to delete the PVirtualNode myself or can i
leave it alone and VT will take care of deleting that node? i mean
since i don't know how the PVirtualNode is allocated i don't know if
i should call free/delete or what....any suggestions would be helpful.

 | Replies | Author | Date
4658 | Re: OnFreeNode question | Werner Lehmann | Fri 11/16/2001
4660 | Re: OnFreeNode question | [rhymebusta@h...] | Fri 11/16/2001
4661 | Re: OnFreeNode question | Jim Kueneman | Fri 11/16/2001
4666 | Re: OnFreeNode question | [rhymebusta@h...] | Sat 11/17/2001
4667 | Re: OnFreeNode question | Jim Kueneman | Sat 11/17/2001


re: OnFreeNode question

From: Werner Lehmann [wl@b...]
Date: Fri Nov 16, 2001 9:17 pm
Subject: Re: [VirtualTreeview] OnFreeNode question

[rhymebusta@h...] wrote:
>
> hi i was wondering:
> if i call the DeleteNode() method, do i have to implement the
> OnFreeNode even handler to delete the PVirtualNode myself or can i
> leave it alone and VT will take care of deleting that node? i mean
> since i don't know how the PVirtualNode is allocated i don't know if
> i should call free/delete or what....any suggestions would be helpful.

You must never free a TVirtualNode yourself - the treeview always allocates
and deallocates the required memory. OnFreeNode is the event which notifies
you that the node will be freed very soon. Your task is to free any additional
data which is bound to the node data only, if you have any. A common case
is a node record with ref'counted members like AnsiStrings ("string"). You
must call Finalize() on this record in OnFreeNode or you will get mem leaks.
VT cannot do it for you because it does not know what the data contains.

VT will fire OnFreeNode only if the node state includes vsInitialized or
vsUserInitialized (if memory serves). That means if you do *not* use OnInitNode
but AddChild or InsertNode and must rely on OnFreeNode to get rid of your
allocated or ref'counted stuff you must manually include one of these enum
values into the node state. AFAIK.

Werner

 | Replies | Author | Date
4660 | Re: OnFreeNode question | [rhymebusta@h...] | Fri 11/16/2001
4661 | Re: OnFreeNode question | Jim Kueneman | Fri 11/16/2001
4666 | Re: OnFreeNode question | [rhymebusta@h...] | Sat 11/17/2001
4667 | Re: OnFreeNode question | Jim Kueneman | Sat 11/17/2001


re: Bugs

From: Jim Kueneman [jimdk@m...]
Date: Fri Nov 16, 2001 9:32 pm
Subject: RE: [VirtualTreeview] Bugs

Hi Mike,

>Finally, I wanted to go hunting your header stream bug but I cannot get
>the code to execute with the
>VET source I have. In TColumnMenuItem.Click; there is a check for
>ColumnIndex < -1 which is never
>True so I guess I must use a different demo (the one simulating a full
>explorer?). I did not find
>the source for it, though.

Drop a VET on a form. Set TreeOptions.VETShellOptions.toShellColumnMenu to
true. Set ColumnDetails to cdVETShellColums. Run the program and right
click on the header buttons. Select More... and the code will execute.
This is assuming the root node has more than 5 column possibilittes, like a
disk folder in Win2k, ME and I am sure XP.

Jim

 | Replies | Author | Date
4684 | Re: Bugs | Mike Lischke | Sun 11/18/2001
4700 | Re: Header Streaming WAS - Bugs | Jim Kueneman | Sun 11/18/2001


re: OnFreeNode question

From: [rhymebusta@h...]
Date: Fri Nov 16, 2001 9:26 pm
Subject: Re: OnFreeNode question

> You must never free a TVirtualNode yourself - the treeview always
allocates
> and deallocates the required memory. OnFreeNode is the event which
notifies
> you that the node will be freed very soon. Your task is to free any
additional
> data which is bound to the node data only, if you have any. A
common case
> is a node record with ref'counted members like AnsiStrings
("string"). You
> must call Finalize() on this record in OnFreeNode or you will get
mem leaks.
> VT cannot do it for you because it does not know what the data
contains.
>
> VT will fire OnFreeNode only if the node state includes
vsInitialized or
> vsUserInitialized (if memory serves). That means if you do *not*
use OnInitNode
> but AddChild or InsertNode and must rely on OnFreeNode to get rid
of your
> allocated or ref'counted stuff you must manually include one of
these enum
> values into the node state. AFAIK.
>
> Werner
i understood everything except the Finalize() method part....i can't
seem to find it......is it a new method....i'm using 2.4 since i
can't get later versions to install correctly just yet(in BCB).

 | Replies | Author | Date
4661 | Re: OnFreeNode question | Jim Kueneman | Fri 11/16/2001
4666 | Re: OnFreeNode question | [rhymebusta@h...] | Sat 11/17/2001
4667 | Re: OnFreeNode question | Jim Kueneman | Sat 11/17/2001


re: Re: OnFreeNode question

From: Jim Kueneman [jimdk@m...]
Date: Fri Nov 16, 2001 9:38 pm
Subject: Re: [VirtualTreeview] Re: OnFreeNode question

>
> > Werner
>i understood everything except the Finalize() method part....i can't
>seem to find it......is it a new method....i'm using 2.4 since i
>can't get later versions to install correctly just yet(in BCB).

Finalize and Intiailize are Delphi functions that detect dynamiclly
allocated structures in a memory allocation and either initialize them or
free them (Finalize)

An example

type
MyRec = record
AStr: string
end;

var
P: PMyRec;
begin
GetMem(P, SizeOf(MyRec));
P.AStr := 'Hello World';
FreeMem(P);
end;

In this case the Hello World allocation is not freed because FreeMem
does not know about it

Fix

var
P: PMyRec;
begin
GetMem(P, SizeOf(MyRec));
P.AStr := 'Hello World';
Finalize(P); // May need P^ here Delphi compiler usually tells me <g>
FreeMem(P);
end;

Jim

Jim

 | Replies | Author | Date
4666 | Re: OnFreeNode question | [rhymebusta@h...] | Sat 11/17/2001
4667 | Re: OnFreeNode question | Jim Kueneman | Sat 11/17/2001


Get new Node Text

From: [dsanchoortega@y...]
Date: Sat Nov 17, 2001 3:14 pm
Subject: Get new Node Text

Hello!

If I change the text of a node editing it directly on the treeview,
how can I get the new text in OnEdited event?

Thanks

 | Replies | Author | Date
4663 | Re: Get new Node Text | Werner Lehmann | Sat 11/17/2001
4664 | Re: Get new Node Text | Helge Jung (ECO-Logic) | Sat 11/17/2001
4665 | Re: Get new Node Text | Jim Kueneman | Sat 11/17/2001


re: Get new Node Text

From: Werner Lehmann [wl@b...]
Date: Sat Nov 17, 2001 3:30 pm
Subject: Re: [VirtualTreeview] Get new Node Text

[dsanchoortega@y...] wrote:
>
> If I change the text of a node editing it directly on the treeview,
> how can I get the new text in OnEdited event?

^^ OnNewText :)

OnEdited is a generic event which can also be used for the draw tree
and if other node editors but the built-in editor are used.

Werner


re: Get new Node Text

From: "Helge Jung \(ECO-Logic\)" [helge@e...]
Date: Sat Nov 17, 2001 3:31 pm
Subject: Re: [VirtualTreeview] Get new Node Text

> If I change the text of a node editing it directly on the treeview,
> how can I get the new text in OnEdited event?

The new text is submitted in OnNewText - store it in a local variable you
read in OnEdited. But this only works if OnEdited is called *after*
OnNewText - I don't know exactly.

Helge.


re: Get new Node Text

From: Jim Kueneman [jimdk@m...]
Date: Sat Nov 17, 2001 3:39 pm
Subject: Re: [VirtualTreeview] Get new Node Text

Hi,

>If I change the text of a node editing it directly on the treeview,
>how can I get the new text in OnEdited event?

Use OnNewText; from there you store the new string into your structure.

Jim


re: OnFreeNode question

From: [rhymebusta@h...]
Date: Sat Nov 17, 2001 5:26 pm
Subject: Re: OnFreeNode question

> Finalize and Intiailize are Delphi functions that detect dynamiclly
> allocated structures in a memory allocation and either initialize
them or
> free them (Finalize)
>
> An example
>
> type
> MyRec = record
> AStr: string
> end;
>
> var
> P: PMyRec;
> begin
> GetMem(P, SizeOf(MyRec));
> P.AStr := 'Hello World';
> FreeMem(P);
> end;
>
> In this case the Hello World allocation is not freed because
FreeMem
> does not know about it
>
> Fix
>
> var
> P: PMyRec;
> begin
> GetMem(P, SizeOf(MyRec));
> P.AStr := 'Hello World';
> Finalize(P); // May need P^ here Delphi compiler usually tells
me <g>
> FreeMem(P);
> end;
>
>
> Jim
ok i see............i'm using VT for BCB hence writing in C++.

 | Replies | Author | Date
4667 | Re: OnFreeNode question | Jim Kueneman | Sat 11/17/2001


re: Re: OnFreeNode question

From: Jim Kueneman [jimdk@m...]
Date: Sat Nov 17, 2001 6:54 pm
Subject: Re: [VirtualTreeview] Re: OnFreeNode question

> > Jim
>ok i see............i'm using VT for BCB hence writing in C++.

I was assuming BCB worked the same way.

Jim


[no subject]

From: [r-scholz@t...]
Date: Sun Nov 18, 2001 8:52 am
Subject:

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

I already posted this news to
borland.public.delphi.ide but there was no
response. Because this is the mailing-list
for the best Delphi control on this planet -
maybe you can help me!!!

here we go...

I have two projects which rely on two
different versions of the same component. Now, I
tried to make two project-groups and make Delphi
load the corresponding Design-Time Package
in the Component Bar every time I open a project
group. But I was not successful.

I think this must be a very common problem.
How do you archive your project and all the
components it relies on, so you can reopen it
any time in the future an rebuild the version you
once delivered to the customer? Ok - I know
this has to do with version control - but this is
not my problem here. How to package it,
so you have everything ready in the Delphi-IDE?

By the way, I'm using Delphi 5.

Please comment. Many thanks for your help.
greetings
Richard

-----BEGIN PGP SIGNATURE-----
Version: PGPfreeware 6.5.3 for non-commercial use <http://www.pgp.com>
Comment: Go and get my key from http://pgpkeys.mit.edu:11371

iQA/AwUBO/dozqpbmIk/kkxMEQK5hACgu0cOto3MbpzsZzHAKvb+1o8yZvgAoOQ1
m5WwoKutw+IIgHVO16ScCVi7
=79+U
-----END PGP SIGNATURE-----


re: [VirtualTreeview]

From: "Wim van der Vegt" [wvd_vegt@k...]
Date: Sun Nov 18, 2001 9:26 am
Subject: Re: [VirtualTreeview]

Hi,

If you got the sources, just rename one of the components (and it's units etc).
That way you can add them both (i have netmanage 4/5 online together in d5).

Wim van der Vegt
----- Original Message -----
From: [r-scholz@t...]
To: VirtualTreeview@yahoogroups.com
Sent: Sunday, November 18, 2001 09:52 AM
Subject: [VirtualTreeview]

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

I already posted this news to
borland.public.delphi.ide but there was no
response. Because this is the mailing-list
for the best Delphi control on this planet -
maybe you can help me!!!

here we go...

I have two projects which rely on two
different versions of the same component. Now, I
tried to make two project-groups and make Delphi
load the corresponding Design-Time Package
in the Component Bar every time I open a project
group. But I was not successful.

I think this must be a very common problem.
How do you archive your project and all the
components it relies on, so you can reopen it
any time in the future an rebuild the version you
once delivered to the customer? Ok - I know
this has to do with version control - but this is
not my problem here. How to package it,
so you have everything ready in the Delphi-IDE?

By the way, I'm using Delphi 5.

Please comment. Many thanks for your help.
greetings
Richard

-----BEGIN PGP SIGNATURE-----
Version: PGPfreeware 6.5.3 for non-commercial use <http://www.pgp.com>
Comment: Go and get my key from http://pgpkeys.mit.edu:11371

iQA/AwUBO/dozqpbmIk/kkxMEQK5hACgu0cOto3MbpzsZzHAKvb+1o8yZvgAoOQ1
m5WwoKutw+IIgHVO16ScCVi7
=79+U
-----END PGP SIGNATURE-----

Yahoo! Groups Sponsor

To unsubscribe from this group, send an email to:
VirtualTreeview-unsubscribe@egroups.com

Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.

[Non-text portions of this message have been removed]


re: Disallow selection change?

From: "Mike Lischke" [lists@l...]
Date: Sun Nov 18, 2001 9:45 am
Subject: RE: [VirtualTreeview] Disallow selection change?

Hi Werner,

> how can I prevent that a left click on any node changes the selection?
> I want to force a particular node to be selected and focused and do
> not allow a change.

I thought about this, but the only idea I had was to optionally stop VT from
processing the mouse
event. But this is a bit esoteric. For your special problem you could reselect
the node:

if not Allowed then
Sender.Selected[OldNode] := True;

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: Re: VT 2.6.5 double declare using BCB

From: "Mike Lischke" [lists@l...]
Date: Sun Nov 18, 2001 9:49 am
Subject: RE: [VirtualTreeview] Re: VT 2.6.5 double declare using BCB

Hi Roland,

> I have explain it in message 4495, and then I discus this with Milan
> (message 4496, 4499 and 4501), in short form:
> It's a problem only using BCB.

Actually, it is a problem which results from the still missing $EXTERNALSYM
directives. Marcel van
Brakel (the original author of those units) has this still on his todo list
(you can also find a
short message about this in JwaTmSchema.pas).

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: VT 2.6.5 double declare using BCB

From: "Mike Lischke" [lists@l...]
Date: Sun Nov 18, 2001 9:51 am
Subject: RE: [VirtualTreeview] VT 2.6.5 double declare using BCB

Milan,

> If somebody with BCB can find a way to avoid the warnings, and still have
> {$WEAKPACKAGEUNIT} defined, then please tell me (I am only Advanced, not a
> Guru :-)).

I will likely remove the weak packaging from those units. I'm already
discussing this with Marcel.
Weak packaging is only to allow including a unit which uses DLLs which might
not be available on a
particular system into a package. But since the themes units use dynamic
loading there is no need to
package them weakly. Hence we can remove this.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: Re: (please add a subject line!)

From: "Mike Lischke" [lists@l...]
Date: Sun Nov 18, 2001 10:22 am
Subject: RE: [VirtualTreeview] Re: (please add a subject line!)

Hi Paul,

> My request is that even when the tree needs to be scrolled up that the
> repaint request be defered until the EndUpdate. Or in general, while
> in a BeginUpdate/EndUpdate transaction, that no intermediate screen
> updates be done.

I realized that I did not account for FUpdateCount > 0 in DoSetOffsetXY. I have
now included a check
for this case. Please try again to see if this now works as expected.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: Invisible Node Text

From: "Mike Lischke" [lists@l...]
Date: Sun Nov 18, 2001 10:47 am
Subject: RE: [VirtualTreeview] Invisible Node Text

Hi Tom,

> I have tried testing in the PaintText event whether or not the form with the
> tree is active. My assumption was if it was not active, the Canvas.Pen.Mode
> should be set to "pmMaskPenNot" to force the text color to something
> visible. This seems to have no effect.

I'm a bit confused when I try to reproduce your layout. It is not clear to me
why you don't simply
use the proper selection colors (see Colors property). To make sure the text is
always visible
simply invert the color of the background (Color := not Color and $FFFFFF) in
OnPaintText.

Does this help?

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net

 | Replies | Author | Date
4692 | Re: Invisible Node Text | Tom Hahn | Sun 11/18/2001


re: UseThemes

From: "Mike Lischke" [lists@l...]
Date: Sun Nov 18, 2001 10:48 am
Subject: RE: [VirtualTreeview] UseThemes

> Just one minute ago I could reproduce the effect another time - the tree
build was so
> fast that I wondered why I would complain about it (less 1 sec). But I fooled
myself
> because I had commented out the UseThemes call in PaintCheckImage.

The themes flag is now cached :-)

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: Out of topic

From: "Mike Lischke" [lists@l...]
Date: Sun Nov 18, 2001 11:01 am
Subject: RE: [VirtualTreeview] Out of topic

A request to all: Please avoid posting off-topic messages to this mailing
list. In the new
newsgroups (news://forums.talkto.net/delphi-gems.support.virtualtreeview) this
is not so critical as
one can simply ignore such messages (if marked correctly).

Lars, you could have contacted one of the german readers (me, Werner, Moritz,
Roland etc.) and ask
them. The official term for Dipl.-Ing. is "graduate engineer" (use either
http://dict.tu-chemnitz.de/, or http://dict.leo.org/ for translations english
<-> german). A
Dipl.-Ing. is (depending on the studies) similar to "bachelor of science" or
"master of science",
but sometimes also described as "graduate diploma" (e.g. in Ireland, University
of Limerick).

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net

> I know it is al little bit out of topic. But can anybody tell me what
> is the translation of "Dipl.-Ing." into english?
>
> After some searches in the Internet, I found something like "grad.
> eng." or "eng. grad.". But I don't exactly know, if this is right.


re: Transparent Buttons on colored backgrounds!?

From: "Mike Lischke" [lists@l...]
Date: Sun Nov 18, 2001 11:22 am
Subject: RE: [VirtualTreeview] Transparent Buttons on colored backgrounds!?

Hi Ralf,

> The required changes are five lines of code only (larger context quoted
below):

... not counted the tests necessary to go through every combination ;-)

OK, I have included the new style. It was indeed a short work, but be aware
that the dotted lines
now also shine through under the buttons.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net

 | Replies | Author | Date
4704 | Re: Transparent Buttons on colored backgrounds!? | Ralf Junker | Mon 11/19/2001


re: Can not compile D4 package

From: "Mike Lischke" [lists@l...]
Date: Sun Nov 18, 2001 12:02 pm
Subject: RE: [VirtualTreeview] Can not compile D4 package

Hi Peter,

> I downloaded from your website 'VTHtml.zip' 887kb. I tried to follow the
> "Virtual Treeview Instalation" but failed.
> These are the steps I followed to install in Delphi 4. If you want, please
> use the following in a revised "Installation".

Thank you for this check list. I have to rework the installation description
anyway, so it is a good
help to do the job.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: Focus Rectangle too small when font changes to fsBold

From: "Mike Lischke" [lists@l...]
Date: Sun Nov 18, 2001 12:07 pm
Subject: RE: [VirtualTreeview] Focus Rectangle too small when font changes to fsBold

Kostas,

> Temporarily hook the Canvas.OnChange event handler to a provate method that
> just sets a FCanvasChanged data-member in the VT and then invalidate the
> node if FCanvasChanged is True:

The canvas hook is done several times in VT, however invalidating the node is
not a good option as
it also requires to initialize it again, which might in turn cause trouble.

Unfortunately, I cannot think of a better way. Options include to remove the
OnPaintText event and
provide other means for customization (but which?) or to recalculate a node's
with every time its
text and/or font formatting changes. Other scenarios could be involved but it
always is related to
customizing a nodes appearance. Since other things depend also from this
customization (tooltips,
editing) it is a difficult matter, which still waits for a pratical solution.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net

 | Replies | Author | Date
4730 | Re: Focus Rectangle too small when font changes t | Ralf Junker | Tue 11/20/2001
4788 | Re: Focus Rectangle too small when font changes | Mike Lischke | Sat 11/24/2001


re: Hiding nodes

From: Michael Valentiner=Branth [MichaelVB@g...]
Date: Sun Nov 18, 2001 12:15 pm
Subject: Re: [VirtualTreeview] Hiding nodes

Hi Adam,

[setting node-height to zero it hide it]
> Worked absolutely perfectly.
>
Be careful. There's a problem with different node-heights when using SaveNode
and LoadNode on such a tree.

My workaround: Set the node-height to default before storing, and resetting to
zero (or whatever you like) after loading.

It seems, there's also a problem when adding such top-level-nodes at runtime.
But I haven't verified that yet.

Michael

 | Replies | Author | Date
4685 | Re: Hiding nodes | Mike Lischke | Sun 11/18/2001
4732 | Re: Hiding nodes | Michael Valentiner=Branth | Tue 11/20/2001


re: Extra node at bottom of list when pointer is nearby

From: "Mike Lischke" [lists@l...]
Date: Sun Nov 18, 2001 12:31 pm
Subject: RE: [VirtualTreeview] Extra node at bottom of list when pointer is nearby

Hi Adam,

> If there is anymore information needed about this problem, i am glad
> to give it as its driving me nuts

Thank you for making me aware of this. The problem had to do with a slight,
mmmh, typo and is fixed
now. Btw: your code is very inefficient and keeps even VT quite busy for a
couple of seconds. Try
using:

procedure TForm1.Button1Click(Sender: TObject);
var
TempNode : PVirtualNode;
Node : PVirtualNode;
i : Integer;
begin
DLList.BeginUpdate;
try
// create temp node to put em into then to move em later
TempNode := DLList.InsertNode(nil,amAddChildLast);

// create destination node
DestNode := DLList.InsertNode(nil,amAddChildLast);

// if adding 3000 node, then get the error 'nodes must never be nil' - why?
// if adding 300 nodes, then no problem occurs.
// if adding 1200 then a fake ghost node appears when moving mouse over
certain spots of screen
for i := 0 to 3000 do
begin
Node := DLList.InsertNode(TempNode,amAddChildLast);
DLList.MoveTo(Node, DestNode, amAddChildLast, false);
end;
finally
DLList.EndUpdate;
end;
end;

This way speed will increase by factor 100 (or even more, I only guessed it
since the result is on
the screen in the same moment when you release Button1).

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: Inverted order on paste

From: "Mike Lischke" [lists@l...]
Date: Sun Nov 18, 2001 12:45 pm
Subject: RE: [VirtualTreeview] Inverted order on paste

Hi Trevis,

> Ok. I'm handling this by re-inverting the selection, but I think that
> must be an easier way. Any ideas?
>
> The Version I'm using is 2.5.34 and these are my procedures
> (simplified):

I have reworked this stuff lately for another reason. It could well be that
your problem is gone
with this too. Please try the latest version of VT (after the next upload which
is announced here).

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: Many errors: here's the documentation.

From: "Mike Lischke" [lists@l...]
Date: Sun Nov 18, 2001 12:47 pm
Subject: RE: [VirtualTreeview] Many errors: here's the documentation.

Hi Rony,

> - Anyway, the assertion "Assert(Y >= FOffsetY, 'GetNodeAt: invalid vertical
> position.');" at line 13108 of VirtualTrees.pas (v. 2.0) sometimes fails: I
> never invoke such function directly, but I guess its the painting process
> that does it (see line 8630 ibidem).

Please try the latest version of VT. I fixed today a bug which might be related
to this problem.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: Bugs

From: "Mike Lischke" [lists@l...]
Date: Sun Nov 18, 2001 1:16 pm
Subject: RE: [VirtualTreeview] Bugs

Hi Jim,

> Drop a VET on a form. Set TreeOptions.VETShellOptions.toShellColumnMenu to
> true. Set ColumnDetails to cdVETShellColums. Run the program and right
> click on the header buttons. Select More... and the code will execute.
> This is assuming the root node has more than 5 column possibilittes, like a
> disk folder in Win2k, ME and I am sure XP.

OK, this is fixed now too but needs a bit more testing.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net

 | Replies | Author | Date
4700 | Re: Header Streaming WAS - Bugs | Jim Kueneman | Sun 11/18/2001


re: Hiding nodes

From: "Mike Lischke" [lists@l...]
Date: Sun Nov 18, 2001 1:20 pm
Subject: RE: [VirtualTreeview] Hiding nodes

> Be careful. There's a problem with different node-heights when using SaveNode
and
> LoadNode on such a tree.

This is all history now. I have already fixed the node height bug two weeks ago.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net

 | Replies | Author | Date
4732 | Re: Hiding nodes | Michael Valentiner=Branth | Tue 11/20/2001


re: Many errors: here's the documentation.

From: "Rony Cesana" [cesana@c...]
Date: Sun Nov 18, 2001 1:22 pm
Subject: Re: [VirtualTreeview] Many errors: here's the documentation.

> Hi Rony,
> Please try the latest version of VT. I fixed today a bug which might be
related to this problem.

thanx a lot, I'll try it at once... but where do I find it, exactly?

> Ciao, Mike
Ciao, Rony

 | Replies | Author | Date
4687 | Re: Many errors: here's the documentation. | Helge Jung (ECO-Logic) | Sun 11/18/2001
4688 | Re: Many errors: here's the documentation. | Mike Lischke | Sun 11/18/2001


re: Many errors: here's the documentation.

From: "Helge Jung \(ECO-Logic\)" [helge@e...]
Date: Sun Nov 18, 2001 1:30 pm
Subject: Re: [VirtualTreeview] Many errors: here's the documentation.

> thanx a lot, I'll try it at once... but where do I find it, exactly?
>

I think you'll find it at the YG:
http://groups.yahoo.com/group/VirtualTreeview/files

But first when Mike has uploaded the new version... there'll be a mail from
the YG when he does.

Helge.


re: Many errors: here's the documentation.

From: "Mike Lischke" [lists@l...]
Date: Sun Nov 18, 2001 1:34 pm
Subject: RE: [VirtualTreeview] Many errors: here's the documentation.

> thanx a lot, I'll try it at once... but where do I find it, exactly?

Please wait until I send a message. From now on I will upload into the beta
folder of my homepage
and give the link via the newsgroups (and here too, for the time being). I want
to fix outstanding
bugs first, however.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


first public release candidate

From: "Mike Lischke" [lists@l...]
Date: Sun Nov 18, 2001 2:28 pm
Subject: first public release candidate

Hi all,

I just uploaded the latest build of VT to my homepage at:
http://www.lischke-online.de/VirtualTreeview/beta/VirtualTree_2.6.11.zip.

I also made an announcement in the VT newsgroup at
news://forums.talkto.net/delphi-gems.support.virtualtreeview.

Soon I will update the version history page at:
http://www.lischke-online.de/VirtualTreeview/VTHistory.html.

I have closed/fixed all reported bugs, so that nothing is open anymore. The
todo table does not exist anymore and I have moved the remaining entries to the
wish list, which is still open for suggestions etc.

The only addition to VT planned currently is an improved drag image and OLE
drag handling provided by Jim Kueneman. If somebody wants to add something to
the online help then please send it to me as soon as possible (Werner, how far
did you came?). I have finished the general help topics and the description for
the base tree (plus a few other stuff). I will now revise this but will not add
anything significant to the help myself (except what I get sent). So the help
again ends up incomplete. Unfortunately, also the promised online FAQ from John
Knipper will not become reality.

The last task which remains after what I have mention above is to create some
nice packages which include also most of the contributions. If somebody wants
to add something then please contact me privately.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net

 | Replies | Author | Date
4693 | Re: first public release candidate | Jim Kueneman | Sun 11/18/2001
4694 | Re: first public release candidate | Mike Lischke | Sun 11/18/2001
4696 | Re: first public release candidate | Jim Kueneman | Sun 11/18/2001
4697 | Re: first public release candidate | Mike Lischke | Sun 11/18/2001
4698 | Re: first public release candidate | Jim Kueneman | Sun 11/18/2001
4709 | Re: first public release candidate | Jim Kueneman | Mon 11/19/2001
4728 | Re: Child Checking on Init..... Fix | Jim Kueneman | Mon 11/19/2001
4767 | Re: first public release candidate | Mike Lischke | Wed 11/21/2001
4707 | Re: first public release candidate | Werner Lehmann | Mon 11/19/2001


re: Disallow selection change?

From: Werner Lehmann [wl@b...]
Date: Sun Nov 18, 2001 1:53 pm
Subject: Re: [VirtualTreeview] Disallow selection change?

Hi Mike,

> > how can I prevent that a left click on any node changes the selection?
> > I want to force a particular node to be selected and focused and do
> > not allow a change.
>
> I thought about this, but the only idea I had was to optionally stop VT from
processing the mouse
> event. But this is a bit esoteric. For your special problem you could
reselect the node:
>
> if not Allowed then
> Sender.Selected[OldNode] := True;

I am afraid that this could cause flicker - but I have not tried. For the
moment I can get along without scrolling (not enough nodes) and have put
the VT on a disabled panel.

In case you wonder: I am misusing the VST as kind of progress view. Each
node represents a step, the selection color has been changed to a bright
text marker yellow and the ParentColor is true, along with some other
supporting settings. It is not obvious that the control is a VT or even
only a single control at all. Looks like some labels, only better and with
flexible number of items. Think I have found another use of VT :)

Werner

 | Replies | Author | Date
4691 | Re: Disallow selection change? | Mike Lischke | Sun 11/18/2001


re: Disallow selection change?

From: "Mike Lischke" [lists@l...]
Date: Sun Nov 18, 2001 3:06 pm
Subject: RE: [VirtualTreeview] Disallow selection change?

> I am afraid that this could cause flicker - but I have not tried.

But I have before I suggested it and I did not notice any flickering. It looks
like the tree is
disabled or had not gotten the mouse event.

> only a single control at all. Looks like some labels, only better and with
> flexible number of items. Think I have found another use of VT :)

Send me a screen shot of the coolest view and I publish it in the gallery :-)

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: Invisible Node Text

From: "Tom Hahn" [thahn@h...]
Date: Sun Nov 18, 2001 3:13 pm
Subject: RE: [VirtualTreeview] Invisible Node Text

Hello Mike,
>
> > I have tried testing in the PaintText event whether or not the
> form with the
> > tree is active. My assumption was if it was not active, the
> Canvas.Pen.Mode
> > should be set to "pmMaskPenNot" to force the text color to something
> > visible. This seems to have no effect.
>
> I'm a bit confused when I try to reproduce your layout. It is not
> clear to me why you don't simply
> use the proper selection colors (see Colors property). To make
> sure the text is always visible
> simply invert the color of the background (Color := not Color and
> $FFFFFF) in OnPaintText.
>
Your suggestion about inverting the background color in OnPaintText solved
the problem. What I did was:

Canvas.Font.Color := not Canvas.Brush.Color and $FFFFFF

I guess I had made this more complicated than it had to be.

Thank You!
Tom


re: first public release candidate

From: Jim Kueneman [jimdk@m...]
Date: Sun Nov 18, 2001 3:37 pm
Subject: Re: [VirtualTreeview] first public release candidate

Hi Mike,

The new version design package give me an error on installing into the IDE:

"Internal Image "VT_XP" is missing or corrupt. (path/VirtualTree.pas,
line 4219)"

>The only addition to VT planned currently is an improved drag image and
>OLE drag handling provided by Jim Kueneman. If somebody wants to add
>something to the online help then please send it to me as soon as possible

Doh, now I am on the spot!

Jim

 | Replies | Author | Date
4694 | Re: first public release candidate | Mike Lischke | Sun 11/18/2001
4696 | Re: first public release candidate | Jim Kueneman | Sun 11/18/2001
4697 | Re: first public release candidate | Mike Lischke | Sun 11/18/2001
4698 | Re: first public release candidate | Jim Kueneman | Sun 11/18/2001
4709 | Re: first public release candidate | Jim Kueneman | Mon 11/19/2001
4728 | Re: Child Checking on Init..... Fix | Jim Kueneman | Mon 11/19/2001
4767 | Re: first public release candidate | Mike Lischke | Wed 11/21/2001


re: first public release candidate

From: "Mike Lischke" [lists@l...]
Date: Sun Nov 18, 2001 3:47 pm
Subject: RE: [VirtualTreeview] first public release candidate

> The new version design package give me an error on installing into the IDE:
>
> "Internal Image "VT_XP" is missing or corrupt. (path/VirtualTree.pas,
> line 4219)"

Thanks a lot Jim for checking this so quickly. I have included another idea
from Werner (regarding
check states) and also updated the res file. Now everything should be ok.

> Doh, now I am on the spot!

I thought you were already working on it :-) Your observations and ideas were
so precise that I
assumed you are nearly done with it. But don't hurry too much. If you can't get
it implemented this
year then we keep that for the time after the publication of the current code.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net

 | Replies | Author | Date
4696 | Re: first public release candidate | Jim Kueneman | Sun 11/18/2001
4697 | Re: first public release candidate | Mike Lischke | Sun 11/18/2001
4698 | Re: first public release candidate | Jim Kueneman | Sun 11/18/2001
4709 | Re: first public release candidate | Jim Kueneman | Mon 11/19/2001
4728 | Re: Child Checking on Init..... Fix | Jim Kueneman | Mon 11/19/2001
4767 | Re: first public release candidate | Mike Lischke | Wed 11/21/2001


Fw: first public release candidate

From: "Robert Fitzjohn" [robfitsy@y...]
Date: Sun Nov 18, 2001 3:52 pm
Subject: Fw: [VirtualTreeview] first public release candidate

>
> > Hi all,
> >
> > I just uploaded the latest build of VT to my homepage at:
> http://www.lischke-online.de/VirtualTreeview/beta/VirtualTree_2.6.11.zip.
> >
>
>
> Problem:
>
> ConvertImageList(XPImages, 'VT_XP', False);
> ...
> Assert(Images.Height > 0, 'Internal image "' + ImageName + '" is missing
> or corrupt.');
>
>
> Solution:
>
> Rename VP_XP in virtualtrees.res to VT_XP.
> ^^

_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


re: first public release candidate

From: Jim Kueneman [jimdk@m...]
Date: Sun Nov 18, 2001 4:09 pm
Subject: RE: [VirtualTreeview] first public release candidate

Hi Mike,

>Thanks a lot Jim for checking this so quickly. I have included another
>idea from Werner (regarding
>check states) and also updated the res file. Now everything should be ok.

What did you do? I added some stuff to VET to support checks maybe I can
remove it. Is it to make new children of a ckecked node have the right
checkstate regardless of when they are initialized?

>I thought you were already working on it :-) Your observations and ideas
>were so precise that I
>assumed you are nearly done with it. But don't hurry too much. If you
>can't get it implemented this
>year then we keep that for the time after the publication of the current code.

I am close but I just don't like it. It adds another level of confusion to
the already overwhelming selection of events. I am still thinking how to
do it.

Jim

 | Replies | Author | Date
4697 | Re: first public release candidate | Mike Lischke | Sun 11/18/2001
4698 | Re: first public release candidate | Jim Kueneman | Sun 11/18/2001
4709 | Re: first public release candidate | Jim Kueneman | Mon 11/19/2001
4728 | Re: Child Checking on Init..... Fix | Jim Kueneman | Mon 11/19/2001
4767 | Re: first public release candidate | Mike Lischke | Wed 11/21/2001


re: first public release candidate

From: "Mike Lischke" [lists@l...]
Date: Sun Nov 18, 2001 4:20 pm
Subject: RE: [VirtualTreeview] first public release candidate

> What did you do? I added some stuff to VET to support checks maybe I can
> remove it. Is it to make new children of a ckecked node have the right
> checkstate regardless of when they are initialized?

Exactly. Somehow I overlooked Werners email and implemented it therefore first
today (Werner
reminded me in the newsgroup).

> I am close but I just don't like it. It adds another level of confusion to
> the already overwhelming selection of events. I am still thinking how to
> do it.

I understand what you mean. And only taking the drag image helper is not
possible, no? I know, this
requires some changes in the IDataObject implementation, but this might still
be much less than the
entire OLE rework...

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net

 | Replies | Author | Date
4698 | Re: first public release candidate | Jim Kueneman | Sun 11/18/2001
4709 | Re: first public release candidate | Jim Kueneman | Mon 11/19/2001
4728 | Re: Child Checking on Init..... Fix | Jim Kueneman | Mon 11/19/2001
4767 | Re: first public release candidate | Mike Lischke | Wed 11/21/2001


re: first public release candidate

From: Jim Kueneman [jimdk@m...]
Date: Sun Nov 18, 2001 4:40 pm
Subject: RE: [VirtualTreeview] first public release candidate

Hi Mike,

>I understand what you mean. And only taking the drag image helper is not
>possible, no? I know, this
>requires some changes in the IDataObject implementation, but this might
>still be much less than the
>entire OLE rework...

I was going to pose this question to you <g>. I think this is what I will
do, only get the IxxxxHelpers working. With the new option to stop VT from
deleting moved nodes automaticlly I think Werner and I will be happy :^)

Jim


re: Disallow selection change?

From: Werner Lehmann [wl@b...]
Date: Sun Nov 18, 2001 6:32 pm
Subject: Re: [VirtualTreeview] Disallow selection change?

Hi Mike,

> > I am afraid that this could cause flicker - but I have not tried.
>
> But I have before I suggested it and I did not notice any flickering. It
looks like the tree is
> disabled or had not gotten the mouse event.

Have tried it in FocusChanging and did not help - I could select that node in
addition to the previously selected node which should be the only one. Which
event are you talking about?

> > only a single control at all. Looks like some labels, only better and with
> > flexible number of items. Think I have found another use of VT :)
>
> Send me a screen shot of the coolest view and I publish it in the gallery :-)

OMG, I have raised expectations it seems ;)

Instead of a screenshot (I am not ready for this, may take some time) I have
created a small demo project and am posting it to the (news)group. The demo
can be used as a building block for own efforts but contains not every single
aspect - took me too long already in this form :)

If anyone adds useful stuff I am interested in it...

Werner


re: Header Streaming WAS - Bugs

From: "Jim Kueneman" [jimdk@m...]
Date: Sun Nov 18, 2001 8:36 pm
Subject: Re: Header Streaming WAS - Bugs

Hi Mike,

> > disk folder in Win2k, ME and I am sure XP.
>
> OK, this is fixed now too but needs a bit more testing.

This appears to be fixed, I have removed my workaround in VET.

Thanks,
Jim


compile

From: "Rony Cesana" [cesana@c...]
Date: Sun Nov 18, 2001 9:01 pm
Subject: compile

do I need ToolWnds.dcu to compile the package?
where could I find it?

thanx for your patience... rony

 | Replies | Author | Date
4702 | Re: compile | Jim Kueneman | Sun 11/18/2001
4710 | GDI fault | Justin Turberville | Mon 11/19/2001


re: compile

From: Jim Kueneman [jimdk@m...]
Date: Sun Nov 18, 2001 11:19 pm
Subject: Re: [VirtualTreeview] compile

>do I need ToolWnds.dcu to compile the package?
>where could I find it?

Why do you think you need this? Where does the error surface?

Jim


re: Access Violation

From: [ranganathdindu@h...]
Date: Mon Nov 19, 2001 8:01 am
Subject: Re: Access Violation

Dear Sir,
I saw your reply now. I will try to simulate the error and send the
application. But I donot what is going wrong.

Regards,
Ranganath.D


re: Transparent Buttons on colored backgrounds!?

From: Ralf Junker [ralfjunker@g...]
Date: Mon Nov 19, 2001 9:52 am
Subject: RE: [VirtualTreeview] Transparent Buttons on colored backgrounds!?

Hi Mike,

>but be aware that the dotted lines now also shine through under the buttons.

I was missing this. Do you think there is an easy way to avoid this?

However, I still think the new style is very usefull if you don't use the
(dotted) lines mode, like in the XML tree.

Thanks,

-- Ralf


Tree Editors

From: GIANNAKOPOULOS KOSTAS [kyan@s...]
Date: Mon Nov 19, 2001 10:14 am
Subject: Tree Editors

Good morning Mike.

Based on your demos i had written a set of IVTEditLink implementors that can
use other edit controls such as a TComboBox or a TDateTimePicker. One of the
differences with TStringEditLink is that the editor control must occupy the
whole cell of the tree instead of just the text rect.

Since this morning when i downloaded the latest version their behaviour has
changed, they occupy the text rect like TStringEditLink.

My SetBounds() implementation was

procedure TCustomEditLink.SetBounds(R: TRect);
begin
FEdit.BoundsRect := R; // FEdit is the editor control
end;

To achieve the behaviour i wanted i changed it to

procedure TCustomEditLink.SetBounds(R: TRect);
begin
FEdit.BoundsRect := FTree.GetDisplayRect(FNode, FColumn, False);
end;

after i found that it is called in several places in VirtualTrees.pas.

Is this OK with you? If not, please tell me what to do to get what i want.

Thank you in advance.

<KY>

 | Replies | Author | Date
4765 | Re: Tree Editors | Mike Lischke | Wed 11/21/2001
4777 | Re: Tree Editors | GIANNAKOPOULOS KOSTAS | Thu 11/22/2001
4791 | Re: Tree Editors | Mike Lischke | Sat 11/24/2001


Any trouble installing VT2.5+ in BCB?

From: Vandrovec Milan [milan_va@s...]
Date: Mon Nov 19, 2001 11:48 am
Subject: [VirtualTreeview] Any trouble installing VT2.5+ in BCB?

> -----Original Message-----
> From: [rhymebusta@h...] [mailto:[rhymebusta@h...]]

> ....i'm using 2.4 since i
> can't get later versions to install correctly just yet(in BCB).

Oh my god! Why you didn't tell me? What's the trouble installing the newer
versions? I changed some parts of VirtualTreesReg.pas, and as nobody
complained, I left it that way.

Milan Vandrovec

 | Replies | Author | Date
4711 | Re: Any trouble installing VT2.5+ in BCB? | [rhymebusta@h...] | Mon 11/19/2001


re: first public release candidate

From: Werner Lehmann [wl@b...]
Date: Mon Nov 19, 2001 1:13 pm
Subject: Re: [VirtualTreeview] first public release candidate

Hi Jim, Mike,

> >I understand what you mean. And only taking the drag image helper is not
> >possible, no? I know, this
> >requires some changes in the IDataObject implementation, but this might
> >still be much less than the
> >entire OLE rework...
>
> I was going to pose this question to you <g>. I think this is what I will
> do, only get the IxxxxHelpers working. With the new option to stop VT from
> deleting moved nodes automaticlly I think Werner and I will be happy :^)

Hm, I may not get any fans with this question but what about optimized move
detection...? ;) Remember, I am dragging nodes as HDROP form VT to the shell,
the shell steals the real files and I never know it...

Werner

 | Replies | Author | Date
4708 | Re: Optimized Move | Jim Kueneman | Mon 11/19/2001
4766 | Re: Optimized Move | Mike Lischke | Wed 11/21/2001


re: Optimized Move

From: Jim Kueneman [jimdk@m...]
Date: Mon Nov 19, 2001 1:51 pm
Subject: Re: [VirtualTreeview] Optimized Move

Hi Werner,

>Hm, I may not get any fans with this question but what about optimized move
>detection...? ;) Remember, I am dragging nodes as HDROP form VT to the shell,
>the shell steals the real files and I never know it...

The shell always uses optimized moves so can't you always assume that
happened? I am not sure what happens if the move fails (lock file, no
permission, etc.). If I add the drag image support the optimized move is
easy to put in and get out of the IDataObject, although I don't seem to
remember if the DragEnd event gives you the IDataObject. Nope it appears
not. I can add a default IDataObject parameter there maybe.

I will keep this in mind.

Jim

Also did you notice Mike added a new option to stop the automatic deletion
of moved nodes <g>

 | Replies | Author | Date
4766 | Re: Optimized Move | Mike Lischke | Wed 11/21/2001


re: first public release candidate

From: "Jim Kueneman" [jimdk@m...]
Date: Mon Nov 19, 2001 4:09 pm
Subject: Re: first public release candidate

Hi Mike,

> > What did you do? I added some stuff to VET to support checks
maybe I can
> > remove it. Is it to make new children of a ckecked node have the
right
> > checkstate regardless of when they are initialized?
>
> Exactly. Somehow I overlooked Werners email and implemented it
therefore first today (Werner

Problem in your implementation. It does not fire the Checked event
for the child nodes when the checked node is expanded.

Jim

 | Replies | Author | Date
4728 | Re: Child Checking on Init..... Fix | Jim Kueneman | Mon 11/19/2001
4767 | Re: first public release candidate | Mike Lischke | Wed 11/21/2001


GDI fault

From: "Justin Turberville" [justin@d...]
Date: Mon Nov 19, 2001 5:24 pm
Subject: GDI fault

Has anyone been getting invalid page fault or general protection fault
errors in GDI.exe in their apps on a Windows 95/98 PC on closing or moving a
form with a VirtualTreeView on a background form?

After we disabled the treeview drawing on form deactivation, the problem
went away, so it definitely seems to be a VT issue, almost as if the
graphics driver gets overwhelmed - the problem being more acute the lower
spec the machine is.


re: Any trouble installing VT2.5+ in BCB?

From: [rhymebusta@h...]
Date: Mon Nov 19, 2001 7:44 pm
Subject: Re: Any trouble installing VT2.5+ in BCB?

> Oh my god! Why you didn't tell me? What's the trouble installing
the newer
> versions? I changed some parts of VirtualTreesReg.pas, and as nobody
> complained, I left it that way.
>
> Milan Vandrovec
i'll make a list of what's wrong when i have time....sorry i can't do
better right now....if u check back in other posts that i had with u
about some troubles about installation u can see most of what was
wrong.


Setting MultiSelect option at runtime

From: [rhymebusta@h...]
Date: Mon Nov 19, 2001 8:02 pm
Subject: Setting MultiSelect option at runtime

hi i'm wondering how to set the voMultiSelect option (that's under
the Options property) at run time.
i tried doing: myTree->Options.voMultiSelect = false;
but since Options is an "enum" i can't do that.....so is there any
way to do this.

 | Replies | Author | Date
4714 | Re: Setting MultiSelect option at runtime | Helge Jung (ECO-Logic) | Mon 11/19/2001
4715 | Re: Setting MultiSelect option at runtime | Helge Jung (ECO-Logic) | Mon 11/19/2001
4717 | Re: Setting MultiSelect option at runtime | [rhymebusta@h...] | Mon 11/19/2001
4718 | Re: Setting MultiSelect option at runtime | Helge Jung (ECO-Logic) | Mon 11/19/2001
4719 | Re: Setting MultiSelect option at runtime | [rhymebusta@h...] | Mon 11/19/2001
4721 | Re: Setting MultiSelect option at runtime | Lucas Franzen | Mon 11/19/2001
4723 | Re: Setting MultiSelect option at runtime | Helge Jung (ECO-Logic) | Mon 11/19/2001
4722 | Re: Setting MultiSelect option at runtime | Werner Lehmann | Mon 11/19/2001
4729 | Re: Setting MultiSelect option at runtime | [rhymebusta@h...] | Mon 11/19/2001


Drag n Drop

From: "Tom Hahn" [thahn@h...]
Date: Mon Nov 19, 2001 8:09 pm
Subject: Drag n Drop

This was also posted earlier to the newsgroup. Since that seems to be
unavailable now, I will try here.

This may be an incredibly stupid question but I am at a loss as to how to
implement drag and drop processing within a single tree. The tree consists
of possible nodes at 4 levels (with fewer nodes allowed):

C1
C2
C3
Name

C1
Name

C1
C2
Name

The drag can start at any of the 4 levels and if not at the lowest level,
would include all nodes below it. The final tree cannot exceed 4 levels so
drops would be restricted when that would be the result. The node records
are pointers to an array where the information about each node is contained.
The array also includes information dictating where an entry appears in the
tree so it will need to be updated during the drag and drop process.

Since I can't seem to get the necessary events straight in my head, I would
appreciate an example which shows how this can be accomplished.

Tom

---------------------------------
Thomas Hahn
Hahn Technology, Inc.
mailto:[thahn@h...]
http://www.hahntech.com
---------------------------------
The home of:
Scan: Hardware/Software Inventory
WebBank: URL/Password Manager
---------------------------------


re: Setting MultiSelect option at runtime

From: "Helge Jung \(ECO-Logic\)" [helge@e...]
Date: Mon Nov 19, 2001 8:31 pm
Subject: Re: [VirtualTreeview] Setting MultiSelect option at runtime

> hi i'm wondering how to set the voMultiSelect option (that's under
> the Options property) at run time.
> i tried doing: myTree->Options.voMultiSelect = false;
> but since Options is an "enum" i can't do that.....so is there any
> way to do this.
>

myTree.Options := myTree.Options + [voMultiSelect];

Helge.

 | Replies | Author | Date
4715 | Re: Setting MultiSelect option at runtime | Helge Jung (ECO-Logic) | Mon 11/19/2001
4717 | Re: Setting MultiSelect option at runtime | [rhymebusta@h...] | Mon 11/19/2001
4718 | Re: Setting MultiSelect option at runtime | Helge Jung (ECO-Logic) | Mon 11/19/2001
4719 | Re: Setting MultiSelect option at runtime | [rhymebusta@h...] | Mon 11/19/2001


re: Setting MultiSelect option at runtime

From: "Helge Jung \(ECO-Logic\)" [helge@e...]
Date: Mon Nov 19, 2001 8:35 pm
Subject: Re: [VirtualTreeview] Setting MultiSelect option at runtime

> > i tried doing: myTree->Options.voMultiSelect = false;
>
> myTree.Options := myTree.Options + [voMultiSelect];
>

Uuups... In your case it would be "myTree.Options := myTree.Options -
[voMultiSelect];", of course.

Helge.

 | Replies | Author | Date
4717 | Re: Setting MultiSelect option at runtime | [rhymebusta@h...] | Mon 11/19/2001
4718 | Re: Setting MultiSelect option at runtime | Helge Jung (ECO-Logic) | Mon 11/19/2001
4719 | Re: Setting MultiSelect option at runtime | [rhymebusta@h...] | Mon 11/19/2001


re: GDI fault

From: Werner Lehmann [wl@b...]
Date: Mon Nov 19, 2001 9:12 pm
Subject: Re: [VirtualTreeview] GDI fault

Hi Justin,

> After we disabled the treeview drawing on form deactivation, the problem
> went away, so it definitely seems to be a VT issue, almost as if the
> graphics driver gets overwhelmed - the problem being more acute the lower
> spec the machine is.

By 'treeview drawing' do you refer to custom drawing? Or did you call
BeginUpdate
without EndUpdate? If custom drawing, what and how are you drawing, can their
be any resource leaks?

Werner

 | Replies | Author | Date
4731 | Re: GDI fault | Justin Turberville | Tue 11/20/2001
4736 | Re: GDI fault | Werner Lehmann | Tue 11/20/2001
4738 | Re: GDI fault | Mike Lischke | Tue 11/20/2001
4748 | Re: GDI fault | Justin Turberville | Wed 11/21/2001
4737 | Re: GDI fault | Rony Cesana | Tue 11/20/2001
4739 | Re: GDI fault | Jim Kueneman | Tue 11/20/2001
4744 | Re: GDI fault | Werner Lehmann | Wed 11/21/2001
4745 | Re: GDI fault | [subscribedlists@b...] | Wed 11/21/2001
4746 | Re: GDI fault | Jim Kueneman | Wed 11/21/2001


re: Setting MultiSelect option at runtime

From: [rhymebusta@h...]
Date: Mon Nov 19, 2001 9:19 pm
Subject: Re: Setting MultiSelect option at runtime

--- In [VirtualTreeview@y...], "Helge Jung \(ECO-Logic\)" [helge@e...]
wrote:
> > > i tried doing: myTree->Options.voMultiSelect = false;
> >
> > myTree.Options := myTree.Options + [voMultiSelect];
> >
>
> Uuups... In your case it would be "myTree.Options :=
myTree.Options -
> [voMultiSelect];", of course.
>
> Helge.
Does anyone know how to do that in C++ 'cause i keeping getting
errors like:
[C++ Error] object_manager.cpp(193): E2094 'operator-' not
implemented in type 'TVirtualTreeOptions' for arguments of
type 'TVirtualTreeOption'

this is what i have: tree->Options = tree->Options-(voMultiSelect);

 | Replies | Author | Date
4718 | Re: Setting MultiSelect option at runtime | Helge Jung (ECO-Logic) | Mon 11/19/2001
4719 | Re: Setting MultiSelect option at runtime | [rhymebusta@h...] | Mon 11/19/2001


re: Re: Setting MultiSelect option at runtime

From: "Helge Jung \(ECO-Logic\)" [helge@e...]
Date: Mon Nov 19, 2001 9:23 pm
Subject: Re: [VirtualTreeview] Re: Setting MultiSelect option at runtime

> this is what i have: tree->Options = tree->Options-(voMultiSelect);
^ ^

I don't know C but maybe you need square brackets (marked above) as in
Delphi?

Helge.

 | Replies | Author | Date
4719 | Re: Setting MultiSelect option at runtime | [rhymebusta@h...] | Mon 11/19/2001


re: Setting MultiSelect option at runtime

From: [rhymebusta@h...]
Date: Mon Nov 19, 2001 9:26 pm
Subject: Re: Setting MultiSelect option at runtime

--- In [VirtualTreeview@y...], "Helge Jung \(ECO-Logic\)" [helge@e...]
wrote:
> > this is what i have: tree->Options = tree->Options-
(voMultiSelect);
> ^ ^
>
> I don't know C but maybe you need square brackets (marked above) as
in
> Delphi?
>
> Helge.
no i tried that and i got a "Syntax Error" message from the compiler


re: Drag n Drop

From: Werner Lehmann [wl@b...]
Date: Mon Nov 19, 2001 9:27 pm
Subject: Re: [VirtualTreeview] Drag n Drop

I have answered this in the group.

Werner


re: Re: Setting MultiSelect option at runtime

From: Lucas Franzen [luc@r...]
Date: Mon Nov 19, 2001 9:44 pm
Subject: Re: [VirtualTreeview] Re: Setting MultiSelect option at runtime

[rhymebusta@h...] schrieb:
>
> --- In [VirtualTreeview@y...], "Helge Jung \(ECO-Logic\)" [helge@e...]
> wrote:
> > > this is what i have: tree->Options = tree->Options-
> (voMultiSelect);
> > ^ ^
> >
> > I don't know C but maybe you need square brackets (marked above) as
> in
> > Delphi?
> >
> > Helge.
> no i tried that and i got a "Syntax Error" message from the compiler

In Delphi there are also Include and Exclude available. Maybe there's
something similar in C?

Otherwise look at the help what you'll find for SETS.

Funny how we're all guessing around *g*

Luc.

 | Replies | Author | Date
4723 | Re: Setting MultiSelect option at runtime | Helge Jung (ECO-Logic) | Mon 11/19/2001


re: Re: Setting MultiSelect option at runtime

From: Werner Lehmann [wl@b...]
Date: Mon Nov 19, 2001 9:45 pm
Subject: Re: [VirtualTreeview] Re: Setting MultiSelect option at runtime

[rhymebusta@h...] wrote:
>
> this is what i have: tree->Options = tree->Options-(voMultiSelect);

According to my dusted C++ and practically not existing BCB knowledge this
would have to be

tree->Options.SelectionOptions = tree->Options.SelectionOptions >>
voMultiSelect;

and possibly even

tree->Options.SelectionOptions >>= voMultiSelect;

Probably not because we deal with a property setter here...

Werner

 | Replies | Author | Date
4729 | Re: Setting MultiSelect option at runtime | [rhymebusta@h...] | Mon 11/19/2001


re: Re: Setting MultiSelect option at runtime

From: "Helge Jung \(ECO-Logic\)" [helge@e...]
Date: Mon Nov 19, 2001 9:50 pm
Subject: Re: [VirtualTreeview] Re: Setting MultiSelect option at runtime

> In Delphi there are also Include and Exclude available. Maybe there's
> something similar in C?

A few days ago I had problems with using Include and Exclude with sets so I
didn't suggested them. But maybe I only made a mistake with the syntax - the
compiler always complained "the left argument can't be assigned with a
value" or something like that (translated out of my mind from German ;-).

> Funny how we're all guessing around *g*

In German I'd say: "Bringt ein bisschen Leben in die Bude!". I remember in
the borland newsgroups there were sometimes huge discussions about such tiny
things like we have here - it was amazing to follow them *g*

Helge.


re: Re: Setting MultiSelect option at runtime

From: Lucas Franzen [luc@r...]
Date: Mon Nov 19, 2001 10:00 pm
Subject: Re: [VirtualTreeview] Re: Setting MultiSelect option at runtime

"Helge Jung (ECO-Logic)" schrieb:
>
> > In Delphi there are also Include and Exclude available. Maybe there's
> > something similar in C?
>
> A few days ago I had problems with using Include and Exclude with sets so I
> didn't suggested them. But maybe I only made a mistake with the syntax - the
> compiler always complained "the left argument can't be assigned with a
> value" or something like that (translated out of my mind from German ;-).

I don't use it either, maybe I had the same problem.

But my Delphi help says that it is similar and leads to more efficient
code *g*

Whatever that means.
Maybe the compiler will give me a bonus for saving some work :-))

>
> > Funny how we're all guessing around *g*
>
> In German I'd say: "Bringt ein bisschen Leben in die Bude!". I remember in
> the borland newsgroups there were sometimes huge discussions about such tiny
> things like we have here - it was amazing to follow them *g*

Da geb ich Dir voll und ganz Recht!

Luc.

 | Replies | Author | Date
4725 | Re: Setting MultiSelect option at runtime | Jim Kueneman | Mon 11/19/2001


re: Setting MultiSelect option at runtime

From: "Jim Kueneman" [jimdk@m...]
Date: Mon Nov 19, 2001 10:13 pm
Subject: Re: Setting MultiSelect option at runtime

> > > In Delphi there are also Include and Exclude available. Maybe
there's
> > > something similar in C?
> >
> > A few days ago I had problems with using Include and Exclude with
sets so I
> > didn't suggested them. But maybe I only made a mistake with the
syntax - the
> > compiler always complained "the left argument can't be assigned
with a
> > value" or something like that (translated out of my mind from
German ;-).
>
> I don't use it either, maybe I had the same problem.
>

You can't use a property in Exlude/Include you must use the variable
that the property set. This makes Exclude/Include almost useless in
components that only expose the property and not the underlying
variable.

Jim


re: Re: Setting MultiSelect option at runtime

From: Werner Lehmann [wl@b...]
Date: Mon Nov 19, 2001 10:22 pm
Subject: Re: [VirtualTreeview] Re: Setting MultiSelect option at runtime

"Helge Jung (ECO-Logic)" wrote:
>
> > In Delphi there are also Include and Exclude available. Maybe there's
> > something similar in C?
>
> A few days ago I had problems with using Include and Exclude with sets so I
> didn't suggested them. But maybe I only made a mistake with the syntax - the
> compiler always complained "the left argument can't be assigned with a
> value" or something like that (translated out of my mind from German ;-).

This is because Include/Exclude modify the set 'in place' (I believe) or at
least they work with a var parameter. And a property cannot be used as var
parameter value because access to it is handled via getter and setter
properties. The property value can also be a simple field var but for practical
purposes no difference is made here (you could add a getter at a later time
and some other code would not work anymore).

Werner

 | Replies | Author | Date
4727 | Re: Setting MultiSelect option at runtime | Helge Jung (ECO-Logic) | Mon 11/19/2001


re: Re: Setting MultiSelect option at runtime

From: "Helge Jung \(ECO-Logic\)" [helge@e...]
Date: Mon Nov 19, 2001 10:27 pm
Subject: Re: [VirtualTreeview] Re: Setting MultiSelect option at runtime

> This is because Include/Exclude modify the set 'in place' (I
> believe) or at least they work with a var parameter. And a property
> cannot be used as var parameter value because access to it is handled
> via getter and setter properties. The property value can also be a
> simple field var but for practical purposes no difference is made
> here (you could add a getter at a later time and some other code
> would not work anymore).

Absolutely logical ... makes sense.

Helge.


re: Child Checking on Init..... Fix

From: "Jim Kueneman" [jimdk@m...]
Date: Mon Nov 19, 2001 10:41 pm
Subject: Re: Child Checking on Init..... Fix

Hi Again Mike,

> > > What did you do? I added some stuff to VET to support checks
> maybe I can
> > > remove it. Is it to make new children of a ckecked node have
the
> right
> > > checkstate regardless of when they are initialized?
> >
> > Exactly. Somehow I overlooked Werners email and implemented it
> therefore first today (Werner
>
>
> Problem in your implementation. It does not fire the Checked event
> for the child nodes when the checked node is expanded.

Suggested Fix:

Was:

procedure TBaseVirtualTree.SetCheckType(Node: PVirtualNode; Value:
TCheckType);
......
Node.CheckState := Node.Parent.CheckState;
...

New:

procedure TBaseVirtualTree.SetCheckType(Node: PVirtualNode; Value:
TCheckType);
......
CheckState[Node] := Node.Parent.CheckState
...

Jim


re: Setting MultiSelect option at runtime

From: [rhymebusta@h...]
Date: Mon Nov 19, 2001 11:09 pm
Subject: Re: Setting MultiSelect option at runtime

--- In [VirtualTreeview@y...], Werner Lehmann [wl@b...] wrote:
> [rhymebusta@h...] wrote:
> >
> > this is what i have: tree->Options = tree->Options-
(voMultiSelect);
>
> According to my dusted C++ and practically not existing BCB
knowledge this
> would have to be
>
> tree->Options.SelectionOptions = tree->Options.SelectionOptions
>> voMultiSelect;
>
> and possibly even
>
> tree->Options.SelectionOptions >>= voMultiSelect;
>
> Probably not because we deal with a property setter here...
>
> Werner
actually u almost had it, it was:
tree->Options = tree->Options >> voMultiSelect;


re: Focus Rectangle too small when font changes to fsBold

From: Ralf Junker [ralfjunker@g...]
Date: Mon Nov 19, 2001 10:10 pm
Subject: RE: [VirtualTreeview] Focus Rectangle too small when font changes to fsBold

Hi Mike,

>> Temporarily hook the Canvas.OnChange event handler to a provate method that
>> just sets a FCanvasChanged data-member in the VT and then invalidate the
>> node if FCanvasChanged is True:
>
>The canvas hook is done several times in VT, however invalidating the node is
not a good option as
>it also requires to initialize it again, which might in turn cause trouble.
>
>Unfortunately, I cannot think of a better way. Options include to remove the
OnPaintText event and
>provide other means for customization (but which?) or to recalculate a node's
with every time its
>text and/or font formatting changes. Other scenarios could be involved but it
always is related to
>customizing a nodes appearance. Since other things depend also from this
customization (tooltips,
>editing) it is a difficult matter, which still waits for a pratical solution.

The problem is about drawing the selection and focus rectangle before the
actual length of the text is been known. This happens PrepareCell, which is
called before DoPaintNode. However, the text's font can only be modified during
DoPaintNode, i.e. AFTER the focus rect has already been painted.

I wonder if it is possible to postpone drawing the focus and selection rects
until its dimensions are finally known to the tree. In other words, move the
relevant code from PrepareCell to DoPaintNode. (My intuition tells me this is
more part of painting the node than preparing it.)

Descendant classes (i.e. VirtualStringTree) would then call inherited
DoPaintNode after they have stored the NodeWidth to TVTPaintInfo. Afterwards
they continue to draw their nodes, i.e. Text in case of the VirtualStringTree.

This might not be the straightforward way of calling the inherited procedure,
but it is very effective. As a positive side-effect, it would also eliminate
one call to GetNodeText, because the node width could be calculated on the text
which will be actually painted.

I have done a simple check by adding one line to PaintNormalText. PrepareCell
will of course repaint the entire node, but the focus rect is properly adjusted
afterwards.

if FFontChanged then
begin
// If the font has been changed then the ellipsis width must be
recalculated.
TripleWidth := 0;
// Recalculate also the width of the normal text.
GetTextExtentPoint32W(Canvas.Handle, PWideChar(Text), Length(Text), Size);
NodeWidth := Size.cx + 2 * FTextMargin;
// Added Line for Checking
PrepareCell (PaintInfo);
end;

Regards,

-- Ralf

 | Replies | Author | Date
4788 | Re: Focus Rectangle too small when font changes | Mike Lischke | Sat 11/24/2001


re: GDI fault

From: "Justin Turberville" [justin@d...]
Date: Tue Nov 20, 2001 7:25 am
Subject: RE: [VirtualTreeview] GDI fault

Werner

Yes, it is all owner draw, but should there be a beginupdate/endupdate in
that?
As far as we can tell, there are no resource leaks or running out of GDI
handles.
There is no inkling of any problem in Win NT/2000 and no signs of
instability in interacting with the treeview, it's just on Win95/98 when it
is not on the active form and some dragging of the active form is
undertaken. Where it happened reliably is when another form with the
treeview is opened over the main one and then our find dialog is
opened over that - drag or close the find dialog and bam - reboot time - it
does'nt even have to cover any treeview part. A strange one. Continuous use
does not result in the problem which also weighs against it being a resource
leak.

For now, we do a BeginUpdate on form deactivation and EndUpdate on
activation so that it does not redraw in the background - not very
satisfactory when the top form is moved. We tried drawing the image to a
bitmap facsimile via BitBlt (to capture to the scroll bars aswell!) but that
causes too much flicker on Win 95/98 (a crap OS).

I must say that other than that, our VirtualTreeView implementation works
really well.
We use it in it's 'pure' form - nothing is stored in the nodes. We have
written a TVirtualBrowser base class that returns the node key and text from
the relevant query as per the node level and index, using moveby - much in
the same way as the DB grid works. Only the first level is initially
populated with a cache node added to each, with the branch being populated
in OnExpanding. With only node level and index to go by and caching,
locating a certain node is an interesting challenge! The queries are kept
simple this way, making it almost instant and no real limit to the amount of
data we can represent in the treeview.

We even tried saving out the text for the visible nodes in a string list for
it to draw from that in case it was our DB access was stressing things, but
no change.

regards
Justin

-----Original Message-----
From: Werner Lehmann [mailto:[wl@b...]]
Sent: 19 November 2001 11:13
To: VirtualTreeview@yahoogroups.com
Subject: Re: [VirtualTreeview] GDI fault

Hi Justin,

> After we disabled the treeview drawing on form deactivation, the problem
> went away, so it definitely seems to be a VT issue, almost as if the
> graphics driver gets overwhelmed - the problem being more acute the lower
> spec the machine is.

By 'treeview drawing' do you refer to custom drawing? Or did you call
BeginUpdate
without EndUpdate? If custom drawing, what and how are you drawing, can
their
be any resource leaks?

Werner

To unsubscribe from this group, send an email to:
VirtualTreeview-unsubscribe@egroups.com

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/


re: Hiding nodes

From: Michael Valentiner=Branth [MichaelVB@g...]
Date: Tue Nov 20, 2001 7:36 am
Subject: Re: [VirtualTreeview] Hiding nodes

Hi Mike,

> > Be careful. There's a problem with different node-heights when using
SaveNode and
> > LoadNode on such a tree.
>
> This is all history now. I have already fixed the node height bug two weeks
ago.
>
Sorry, didn't notice that.

I tried it now with 2.6.11 and it works fine. Thanks!

Michael


[no subject]

From: ian madany [madany70@y...]
Date: Tue Nov 20, 2001 9:00 am
Subject:

__________________________________________________
Do You Yahoo!?
Yahoo! GeoCities - quick and easy web site hosting, just $8.95/month.
http://geocities.yahoo.com/ps/info1


source incorrect in DragOver

From: [frans.bouwmans@z...]
Date: Tue Nov 20, 2001 9:05 am
Subject: source incorrect in DragOver

I used an old version of vritualtree and implemented some dragdrop
functionality between 2 virtualtreeviews.
When I recently upgraded to 2.6.5 drag and drop didn't function
correctly. the source in dragover function was not the source control.
I tracked this down by comparing the CMDrag procedure with the
original one in unit control. IT appears that one line is missing to
change the source from TDragControlObject to the control. by adding
one line this functions again

procedure TBaseVirtualTree.CMDrag(var Message: TCMDrag);
var
S: TObject;
ShiftState: Integer;
P: TPoint;
DropEffect: Integer;
Formats: TFormatArray;

begin
with Message, DragRec^ do
begin
S := Source;
Formats := nil;

// let the ancestor handle dock operations
if S is TDragDockObject then
inherited
else
// line to be added
S := (S as TDragControlObject).Control;
// end modification

P.S. I'm also building a virtualtree based descendant which display's
a tree of mp3's with attributes. When it is good enough for
publishing I will post it in the descendants group.

By the way, this treeview looks great, thank to Mike for all his work


re: Optimized Move

From: Werner Lehmann [wl@b...]
Date: Tue Nov 20, 2001 12:10 pm
Subject: Re: [VirtualTreeview] Optimized Move

Hi Jim,

> The shell always uses optimized moves so can't you always assume that
> happened? I am not sure what happens if the move fails (lock file, no
> permission, etc.). If I add the drag image support the optimized move is

You name the problems already. Moreover, I cannot distinguish between an aborted
move and an optimized move - both return DROPEFFECT_NONE if I am not mistaken.

> easy to put in and get out of the IDataObject, although I don't seem to
> remember if the DragEnd event gives you the IDataObject. Nope it appears
> not. I can add a default IDataObject parameter there maybe.

The data object can be accessed via VT.DragManager.DataObject already. Maybe
you can add a property to IVTDragManager interface or somewhere else to indicate
the optimized move?

> I will keep this in mind.

Thanks!

> Also did you notice Mike added a new option to stop the automatic deletion
> of moved nodes <g>

Yes - it sneaked in and I noticed it the other day when I browsed the release
history notes ;) This has been the only source location where I *had* to
modify
the source in the company. Glad that this is not necessary anymore.

Werner


re: GDI fault

From: Werner Lehmann [wl@b...]
Date: Tue Nov 20, 2001 6:24 pm
Subject: Re: [VirtualTreeview] GDI fault

Hi Justin,

> Yes, it is all owner draw, but should there be a beginupdate/endupdate in
> that?

No it should not.

> As far as we can tell, there are no resource leaks or running out of GDI
> handles.
> There is no inkling of any problem in Win NT/2000 and no signs of
> instability in interacting with the treeview, it's just on Win95/98 when it
> is not on the active form and some dragging of the active form is

That alone does not prove too much, resource are limited only by memory in NT/2k
while 9x has some small and fix sized memory reservered for it (IIRC 64k).

> undertaken. Where it happened reliably is when another form with the
> treeview is opened over the main one and then our find dialog is
> opened over that - drag or close the find dialog and bam - reboot time - it
> does'nt even have to cover any treeview part. A strange one. Continuous use
> does not result in the problem which also weighs against it being a resource
> leak.

Agreed.

> For now, we do a BeginUpdate on form deactivation and EndUpdate on
> activation so that it does not redraw in the background - not very
> satisfactory when the top form is moved. We tried drawing the image to a
> bitmap facsimile via BitBlt (to capture to the scroll bars aswell!) but that
> causes too much flicker on Win 95/98 (a crap OS).

I have included this functionality into a descendant of VST, according to an
option the client area is buffered during updates.

I can't you give you any precise directions to fix that problem. But you seem
to be able to reproduce it reliably, this provides a basis for debugging. First
step would be to turn off custom drawing (commenting out whatever possible). If
that does not help get rid of any event handlers you can live without for
testing
purposes. Usually on OnGetText remains. I am sorry that there does not seem to
be an easy and less reboot prone way. But since nobody else sees these symptoms
there is probably something that you do to be held responsible (I am not saying
that you do something wrong - only the circumstances in your environment are
special).

Many of us including Mike and Jim use Win2k or WinXP and do not face those
problems
even if they exist under 9x. Hence any such 9x only problems could very well be
undiscovered until now.

> I must say that other than that, our VirtualTreeView implementation works
> really well.
> We use it in it's 'pure' form - nothing is stored in the nodes. We have
> written a TVirtualBrowser base class that returns the node key and text from
> the relevant query as per the node level and index, using moveby - much in
> the same way as the DB grid works. Only the first level is initially
> populated with a cache node added to each, with the branch being populated
> in OnExpanding. With only node level and index to go by and caching,
> locating a certain node is an interesting challenge! The queries are kept
> simple this way, making it almost instant and no real limit to the amount of
> data we can represent in the treeview.
>
> We even tried saving out the text for the visible nodes in a string list for
> it to draw from that in case it was our DB access was stressing things, but
> no change.

That sounds as if you do not use any client side caching in node records or
node
classes and always retrieve that data from a dataset via .MoveBy. If this is
true
I am astonished that you don't run into performance bottle necks. Someone (I
believe Ralf Junker) did that too and complained about it... Or are you using
some sort of in memory table or TClientDataset? That would be another story
then.

Werner

 | Replies | Author | Date
4738 | Re: GDI fault | Mike Lischke | Tue 11/20/2001
4748 | Re: GDI fault | Justin Turberville | Wed 11/21/2001


re: GDI fault

From: "Rony Cesana" [cesana@c...]
Date: Tue Nov 20, 2001 6:49 pm
Subject: Re: [VirtualTreeview] GDI fault

> But since nobody else sees these symptoms
> there is probably something that you do to be held responsible (I am not
saying
> that you do something wrong - only the circumstances in your environment
are
> special).
>
> Many of us including Mike and Jim use Win2k or WinXP and do not face those
problems
> even if they exist under 9x. Hence any such 9x only problems could very
well be
> undiscovered until now.

I'm developing a program under win2k, with two trees, and it works quite
fine.
Anyway, since this program must be used under win9x too, I tested and
experienced those problems too.
Those "Canvas does not allow drawing", "Illegal parameter", "Internal error
in module GDI..." errors I quoted a couple of days ago all come from the
same place, I guess...

 | Replies | Author | Date
4739 | Re: GDI fault | Jim Kueneman | Tue 11/20/2001


re: GDI fault

From: "Mike Lischke" [lists@l...]
Date: Tue Nov 20, 2001 7:59 pm
Subject: RE: [VirtualTreeview] GDI fault

> Many of us including Mike and Jim use Win2k or WinXP and do not face those
problems
> even if they exist under 9x. Hence any such 9x only problems could very well
be
> undiscovered until now.

Nonetheless, VT is tested on several machines in my company (reaching from
plain, age old Win95 iron
up to WinXP on which it is currently developed) and used on many customer
machines with all
thinkable hardware combination. However, not the full functionality of VT is
used in those
applications...

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: GDI fault

From: "Jim Kueneman" [jimdk@m...]
Date: Tue Nov 20, 2001 9:26 pm
Subject: Re: GDI fault

> Those "Canvas does not allow drawing", "Illegal
parameter", "Internal error
> in module GDI..." errors I quoted a couple of days ago all come
from the

Remember Win9x only has FIVE Display Contexts per thread so if you
are using the ownerdraw VT make sure you are not doing something
recursivly or calling subfunctions that also call allocate a DC using
GetDC or GetDCEx. What you are experiencing sure sound like Windows
running out of DC's

Jim


node x, y coordinates

From: [slackmeister@y...]
Date: Wed Nov 21, 2001 12:02 am
Subject: node x, y coordinates

hi,

I'm attempting to map a hotkey on the vt to simulate a right click.
(So that I can popup the popup menu attached to the tree)
However, the popup function requires the x and y coordinates (which I
would like to be for the currently selected node).

Any ideas on how to get the coordinates, or a better way to do this
would be greatly appreciated.

t

 | Replies | Author | Date
4741 | Re: node x, y coordinates | Werner Lehmann | Wed 11/21/2001


re: node x, y coordinates

From: Werner Lehmann [wl@b...]
Date: Wed Nov 21, 2001 1:06 am
Subject: Re: [VirtualTreeview] node x, y coordinates

[slackmeister@y...] wrote:
>
> I'm attempting to map a hotkey on the vt to simulate a right click.
> (So that I can popup the popup menu attached to the tree)
> However, the popup function requires the x and y coordinates (which I
> would like to be for the currently selected node).
>
> Any ideas on how to get the coordinates, or a better way to do this
> would be greatly appreciated.

Here's a function that makes a TWinControl display a popup menu if its
property PopupMenu is set (not tested):

procedure ShowPopupMenu(Handle: HWND; x: SmallInt = -1; y: SmallInt = -1);
var
WMContextMenu: TWMContextMenu;
begin
with WMContextMenu do
begin
Msg := WM_CONTEXTMENU;
hWnd := Handle;
Pos := SmallPoint(x, y);
Result := 0;
end;

with TMessage(WMContextMenu) do
PostMessage(Handle, WM_CONTEXTMENU, WParam, LParam);
end;

Problem: does not work if you use the OnGetPopupMenu handler of VT because
currently GetPopupMenu is not overridden in VT (to return either what the
PopupMenu property is set to or what the event handler provides).

And even then the menu would appear at the top left corner.

The manual way might be better. You get coordinates with VT.GetDisplayRect(),
can show the menu with PopupMenu.Popup(), may have to translate coordinates
with ClientToScreen() and ScreenToClient().

Werner


re: Re: 'VT_Basics' demo does not compile

From: "Peter Evans" [pgevans@m...]
Date: Tue Nov 20, 2001 10:53 pm
Subject: Re: [VirtualTreeview] Re: 'VT_Basics' demo does not compile

Thank you. This will make an excellent demo even better.
Regards, Peter Evans


Advanced Demo? Source code?

From: [subscribedlists@b...]
Date: Wed Nov 21, 2001 4:48 am
Subject: Advanced Demo? Source code?

The advanced demo seems to have disappeared. Does anyone know where
to find it now? Is the source code for the advanced demo now
available? I was blown away with some of the animated tree
presentations.

Thanks for the great work,

Doug

 | Replies | Author | Date
4789 | Re: Advanced Demo? Source code? | Mike Lischke | Sat 11/24/2001
4797 | Re: Advanced Demo? Source code? | [subscribedlists@b...] | Sun 11/25/2001


re: GDI fault

From: Werner Lehmann [wl@b...]
Date: Wed Nov 21, 2001 5:05 am
Subject: Re: [VirtualTreeview] GDI fault

Mike Lischke wrote:
>
> > Many of us including Mike and Jim use Win2k or WinXP and do not face those
problems
> > even if they exist under 9x. Hence any such 9x only problems could very
well be
> > undiscovered until now.
>
> Nonetheless, VT is tested on several machines in my company (reaching from
plain, age old Win95 iron
> up to WinXP on which it is currently developed) and used on many customer
machines with all
> thinkable hardware combination. However, not the full functionality of VT is
used in those
> applications...

I have heard today that one tester got the same problem on Win98. It was on a
VET (with
checkboxes if that matters). After unchecking a whole drive he got many errors.
Most of
them were 'Error: Invalid parameter' (orig. 'Error: der Parameter stimmt
nicht'), about
each 10th was the 'Canvas does not allow drawing' problem. The message boxes
kept on
going for some time but he could get rid off them. I guess there were n x nodes
(x columns?)
errors.

This is a plain VET, no custom drawing. No idea so far where to start at all.

Werner

 | Replies | Author | Date
4745 | Re: GDI fault | [subscribedlists@b...] | Wed 11/21/2001
4746 | Re: GDI fault | Jim Kueneman | Wed 11/21/2001
4747 | Re: GDI fault | Justin Turberville | Wed 11/21/2001
4762 | Re: GDI fault | Mike Lischke | Wed 11/21/2001


re: GDI fault

From: [subscribedlists@b...]
Date: Wed Nov 21, 2001 6:33 am
Subject: Re: GDI fault

> This is a plain VET, no custom drawing. No idea so far where to
> start at all.

Because Windows 9x only allows five device contexts per thread,
perhaps there is a problem with releasing a context somewhere within
your code. Are you allocating a DC somewhere without using a try-
finally block?

Doug

 | Replies | Author | Date
4746 | Re: GDI fault | Jim Kueneman | Wed 11/21/2001
4747 | Re: GDI fault | Justin Turberville | Wed 11/21/2001
4762 | Re: GDI fault | Mike Lischke | Wed 11/21/2001


re: Re: GDI fault

From: Jim Kueneman [jimdk@m...]
Date: Wed Nov 21, 2001 7:41 am
Subject: Re: [VirtualTreeview] Re: GDI fault

At 06:33 AM 11/21/2001 +0000, you wrote:
> > This is a plain VET, no custom drawing. No idea so far where to
> > start at all.
>
>Because Windows 9x only allows five device contexts per thread,
>perhaps there is a problem with releasing a context somewhere within
>your code. Are you allocating a DC somewhere without using a try-
>finally block?

That was my thought too but after looking at the VCL the message shown is
different if it is a Window DC that can't be allocated. The message that
is described is only used in one place... if a BitmapCanvas can't be
allocated. Any TCanvas in the VCL that is not a TControlCanvas is a
TBitmapCanvas so there can be *many* of these allocated and Win98 must
store *ALL* GDI objects in a 64k block. Is sounds like as they open more
levels of windows the problems gets worse. Are the dialogs being created
on top of VT created dynamiclly so they could be dragging down resources.
Note the above statement inplies that the VCL allocates a MemoryDC for
*every* GDI object that has a TCanvas property. These can add up *fast*.

I know I am as guilty as the rest but any TBitmap that is hanging around
you should call Dormat right after you use it to release the memory DC and
the Bitmap Handle (it move the bitmap into a stream on the heap) or at
least Bitmap.Canvas.Handle := 0 to force it to be released after using it.

Jim


re: Re: GDI fault

From: "Justin Turberville" [justin@d...]
Date: Wed Nov 21, 2001 7:41 am
Subject: RE: [VirtualTreeview] Re: GDI fault

> Because Windows 9x only allows five device contexts per thread,
> perhaps there is a problem with releasing a context somewhere within
> your code. Are you allocating a DC somewhere without using a try-
>finally block?

Well, here is our drawing routine. I don't think we're doing anything
naughty, just long & fiddly...

procedure THWForm.tvBrowserBeforeItemPaint(Sender: TBaseVirtualTree; Canvas:
TCanvas; Node: PVirtualNode; ItemRect: TRect; var CustomDraw: Boolean);

var r : TRect;
t : widestring;
i,l : longint;

begin
if (csDestroying in componentstate) or (not (assigned(node))) then
exit;

customdraw:=true;

try

// Obtain the text to draw for the node

if (assigned(fbrowsers)) then
t:=fbrowsers.getcurrentbrowser.getitemtext(node)

else

exit;

//

with canvas do
begin
font.assign(sender.font);
font.size:=8;
font.color:=clCaptionText;

i:=8+4;
l:=sender.getnodelevel(node);

// Tiled Node

if (l=0) and ((not (assigned(fbrowsers))) or
(fbrowsers.getcurrentbrowser=NIL) or (fbrowsers.getcurrentbrowser.tile))
then
begin
with (font) do
begin
style:=style+[fsBold];

if (node=sender.hotnode) then
color:=clBtnHighLight

else

color:=clWindowText;
end;

//

if (node=sender.focusednode) then
begin
font.color:=clHighLightText;
brush.color:=clHighLight;
end

else

brush.color:=clBtnFace;

//

r:=itemrect;

fillrect(r);

inc(r.left,4);
inc(r.top,1);

drawtext(handle,PChar(string(t)),-1,r,DT_NOPREFIX+DT_END_ELLIPSIS);

drawedge(handle,itemrect,EDGE_RAISED,BF_RECT+BF_SOFT);
end

else

begin
with (font) do
begin
if (node=sender.focusednode) then
begin
style:=style+[fsBold];
color:=clHighLightText;
brush.color:=clHighLight;
end

else

begin
style:=style-[fsBold];
color:=clWindowText;
brush.color:=clWindow;
end;

//

if (node=sender.hotnode) or (sender.expanded[node]) then
style:=style+[fsUnderline]

else

style:=style-[fsUnderline];
end;

//

r:=itemrect;

fillrect(r);

//

if (l=0) then
inc(r.left,4)

else

if (assigned(fbrowsers)) and (fbrowsers.getcurrentbrowser<>nil) and
(fbrowsers.getcurrentbrowser.tile) then
begin
if (l=1) then
inc(r.left,4)

else

inc(r.left,i);
end

else

inc(r.left,l*i);

//

inc(r.top,1);

if (assigned(node.firstchild)) then
begin
if (sender.expanded[node]) then
t:='- '+t

else

t:='+ '+t;
end;

drawtext(handle,PChar(string(t)),-1,r,DT_NOPREFIX+DT_END_ELLIPSIS);

// Define border with next group

if (not (sender.expanded[node])) and (not
(assigned(node.nextsibling))) and (((l=1) and
(assigned(node.parent.nextsibling)) or ((l=2) and (not
(assigned(node.parent.nextsibling))) and
(assigned(node.parent.parent.nextsibling))))) then
drawedge(handle,itemrect,BDR_RAISEDOUTER,BF_BOTTOM+BF_FLAT)
end;
end;

except on exception do

end;
end;

Exceptions are suppressed to prevent an error message causing recursive
redrawing!

regards
Justin


re: GDI fault

From: "Justin Turberville" [justin@d...]
Date: Wed Nov 21, 2001 7:41 am
Subject: RE: [VirtualTreeview] GDI fault

Werner

> That sounds as if you do not use any client side caching in node records
or node
> classes and always retrieve that data from a dataset via .MoveBy. If this
is true
> I am astonished that you don't run into performance bottle necks. Someone
(I
> believe Ralf Junker) did that too and complained about it... Or are you
using
> some sort of in memory table or TClientDataset? That would be another
story then.

We use a query per level with the parent node's key being the filter
parameter. The row index in the query corresponds to the node index and is
stored in the querie's tag property. Thus getting a node's text is a matter
of accertaining the relevant query from the node level and doing a moveby on
the node index less the current row index.
The original intention was to store the text in the node the first time it
required drawing but works so well that we left it as is - even on a slow
PC, processor utilization is at about 3% and we are representing a lot of
data at times. Of course only one level can be expanded at a time for this
to work efficiently - where a SingleExpand option would help as using
AutoExpand does not suit us, having to resort to:

procedure THWForm.tvBrowserExpanding(Sender: TBaseVirtualTree; Node:
PVirtualNode; var Allowed: Boolean);

procedure Collapse(n,s : PVirtualNode);
begin
with tvBrowser do
begin
while (assigned(n)) do
begin
if (n<>s) then
begin
if (expanded[n]) and (not (hasasparent(s,n))) then
expanded[n]:=false;

collapse(getfirstchild(n),s);
end;

n:=getnextsibling(n);
end;
end;
end;

begin
// Ensure that only the selected branch is expanded

collapse(tvBrowser.getfirstnode,node);
end;

- which is hardly ideal...

regards
Justin

PS: Yor committed support of what is a freeware product is commendable &
puts a lot of commercial products to shame


How to make standard TListView support the Drag-Drop from VST

From: [nealzhao@y...]
Date: Wed Nov 21, 2001 9:56 am
Subject: How to make standard TListView support the Drag-Drop from VST

I want to make TListView to support Drag-drop from VST.How to do that?

Thanks.

Neal

 | Replies | Author | Date
4757 | Re: How to make standard TListView support the Dr | Jim Kueneman | Wed 11/21/2001
4768 | Re: How to make standard TListView support the Dr | [nealzhao@y...] | Thu 11/22/2001


re: Re: GDI fault

From: Werner Lehmann [wl@b...]
Date: Wed Nov 21, 2001 10:33 am
Subject: Re: [VirtualTreeview] Re: GDI fault

[subscribedlists@b...] wrote:
>
> > This is a plain VET, no custom drawing. No idea so far where to
> > start at all.
>
> Because Windows 9x only allows five device contexts per thread,
> perhaps there is a problem with releasing a context somewhere within
> your code. Are you allocating a DC somewhere without using a try-
> finally block?

Not that I knew. I am using some TBitmap intensive components that I wrote
myself and of course I am using their Canvas. But those components do not
work with many TBitmaps at the same time and there is always a try finally.
Explicit CreateDC's or similar are not done anywhere.

More important: the above mentioned components did not produce any such
errors in the past and are unchanged. The problem came up in a modal dialog
with three VST (2 VET, 1 VST) on it. And the VET which caused the problem
presumably has only one event handler, OnInitNode. Rest is done behind the
scenes and I guess Jim doesn't do any custom drawing.

Also, Justin does not use a VET making it unlikely that it is a VET issue.

Werner


re: Re: GDI fault

From: Werner Lehmann [wl@b...]
Date: Wed Nov 21, 2001 11:10 am
Subject: Re: [VirtualTreeview] Re: GDI fault

Jim Kueneman wrote:
>
> That was my thought too but after looking at the VCL the message shown is
> different if it is a Window DC that can't be allocated. The message that
> is described is only used in one place... if a BitmapCanvas can't be
> allocated. Any TCanvas in the VCL that is not a TControlCanvas is a
> TBitmapCanvas so there can be *many* of these allocated and Win98 must
> store *ALL* GDI objects in a 64k block. Is sounds like as they open more
> levels of windows the problems gets worse. Are the dialogs being created
> on top of VT created dynamiclly so they could be dragging down resources.
> Note the above statement inplies that the VCL allocates a MemoryDC for
> *every* GDI object that has a TCanvas property. These can add up *fast*.
>
> I know I am as guilty as the rest but any TBitmap that is hanging around
> you should call Dormat right after you use it to release the memory DC and
> the Bitmap Handle (it move the bitmap into a stream on the heap) or at
> least Bitmap.Canvas.Handle := 0 to force it to be released after using it.

Thanks Jim, I didn't know this. I am not doing TBitmap related work in that
modal dialog with the VET which produced the problem. At least not explicitly,
of course VT itself creates bitmaps on 14 occasions.

The message is brought up in the VCL as soon as a handle for a bitmap is
being allocated and this fails in TCanvas.RequiredState(). In fact it can be
a handle for any canvas, not necessarily a TBitmapCanvas but lets assume
that it is a bitmap's canvas.

Justin, are you getting a source location where the error pops up? I guess
not because you didn't mention it. I'd ask you to remove the BeginUpdate so
that the error happens again, then compile with debug DCUs (Compiler Options).
Of course you also need reference info checked and the debugger option "Stop on
delphi exceptions". When the exception is raised bring up the call stack window
and lets see which code part fails.

If that does not bring any source location do this. Add the following to the
beginning of VirtualTrees.pas:

var
BitmapCount: Integer = 0;

type
TBitmap = class (Graphics.TBitmap)
private
function GetCanvas: TCanvas;
public
constructor Create; override;
destructor Destroy; override;
property Canvas: TCanvas read GetCanvas;
end;

TPicture = class (Graphics.TPicture)
private
function GetBitmap: TBitmap;
procedure SetBitmap(const Value: TBitmap);
public
property Bitmap: TBitmap read GetBitmap write SetBitmap;
end;

Implementation can be anywhere in VirtualTrees.pas:

{ TBitmap }

constructor TBitmap.Create;
begin
inherited;
Inc(BitmapCount);
end;

destructor TBitmap.Destroy;
begin
Dec(BitmapCount);
inherited;
end;

function TBitmap.GetCanvas: TCanvas;
begin
try
result := inherited GetCanvas;
except
// I'd like to output a call stack here, unfortunately this is not Java.
raise;
end;
end;

{ TPicture }

function TPicture.GetBitmap: TBitmap;
begin
result := TBitmap(inherited Bitmap);
end;

procedure TPicture.SetBitmap(const Value: TBitmap);
begin
inherited Bitmap := Graphics.TBitmap(Value);
end;

All bitmaps that VT allocates are under our control now. Examine the
BitmapCount variable.
I have added a timer to my mainform:

Caption := IntToStr(VirtualTrees.BitmapCount);

Not every bitmap has a handle allocated but it might be interesting.

Regards,
Werner

 | Replies | Author | Date
4752 | Re: GDI fault | Justin Turberville | Wed 11/21/2001
4764 | Re: GDI fault | Mike Lischke | Wed 11/21/2001
4758 | Re: GDI fault | Jim Kueneman | Wed 11/21/2001
4759 | Re: GDI fault | Jim Kueneman | Wed 11/21/2001
4763 | Re: GDI fault | Mike Lischke | Wed 11/21/2001


re: Re: GDI fault

From: "Justin Turberville" [justin@d...]
Date: Wed Nov 21, 2001 12:26 pm
Subject: RE: [VirtualTreeview] Re: GDI fault

Werner

> Justin, are you getting a source location where the error pops up? I guess
> not because you didn't mention it. I'd ask you to remove the BeginUpdate
so
> that the error happens again, then compile with debug DCUs (Compiler
Options).
> Of course you also need reference info checked and the debugger option
"Stop on
> delphi exceptions". When the exception is raised bring up the call stack
window
> and lets see which code part fails.

I've tried tracing through with remote debugging, but there is no consistent
place in the code where an exception occurs - Windows pops up the dreaded
white DOS error screen and on pressing close, the Windows error dialog then
pops up and always gives hex addresses in GDI.exe, never in the program
itself. Even after killing the program, Windows is unstable thereafter until
restarted. So it seems to be a stack overflow/memory overwrite issue.
Sometimes instead of the error appearing immediately, some of the controls
on the top window do not get drawn, then you know that the error is
imminent!

I'll try your debug code sometime. I appreciate the effort!

regards
Justin

 | Replies | Author | Date
4764 | Re: GDI fault | Mike Lischke | Wed 11/21/2001


AddChild problems

From: "Martijn Brinkers" [martijnbrinkers@p...]
Date: Wed Nov 21, 2001 12:43 pm
Subject: AddChild problems

I know AddChild is disapproved :)

I use the following code to add childs to an empty tree.

categoryNode := vst.AddChild(nil);
data := vst.GetNodeData(categoryNode);

the problem is that addChild results in a call to updateScrollBars which
results in a call to getText. GetText therefore needs to work with an
uninitialized node. Is this normal?

Another question. I know AddChild is not the recommended way to add childs. I
want to display some hierachical data which is already in some data structure.
Could someone give me a hint how to fill the tree without using AddChild?

Thanks

Martijn Brinkers

[Non-text portions of this message have been removed]


AddChild

From: "Martijn Brinkers" [martijnbrinkers@p...]
Date: Wed Nov 21, 2001 12:53 pm
Subject: AddChild

oke I found it :) ... should have been looking a little longer. I used
BeginUpdate EndUpdate.

but I still want some advice on the AddChild vs not AddChild issue :)

Martijn Brinkers

[Non-text portions of this message have been removed]

 | Replies | Author | Date
4756 | Re: AddChild | Jim Kueneman | Wed 11/21/2001
4800 | Re: AddChild | [martijnbrinkers@p...] | Mon 11/26/2001


re: AddChild

From: GIANNAKOPOULOS KOSTAS [kyan@s...]
Date: Wed Nov 21, 2001 12:54 pm
Subject: RE: [VirtualTreeview] AddChild

You can also use the optional extra parameter of AddChild to stuff a pointer
in the customdata area of the node (NodeDataSize must be >= 4). This way no
access to the node's data is done before AddChild() returns and the node is
initialized inside AddChild(). No BeginUpdate/EndUpdate necessary.

Since you already have a data structure a reference pointer to it from the
node should be enough for your needs. If not you must use the
BeginUpdate/EndUpdate technique.

> oke I found it :) ... should have been looking a little
> longer. I used BeginUpdate EndUpdate.
>
> but I still want some advice on the AddChild vs not AddChild issue :)


re: AddChild

From: Jim Kueneman [jimdk@m...]
Date: Wed Nov 21, 2001 1:18 pm
Subject: Re: [VirtualTreeview] AddChild

>but I still want some advice on the AddChild vs not AddChild issue :)

The "pure" way is to only use OnInitNode and OnInitChildren. In OnInitNode
you set the HasChildren flag. The when the user tries to expand that node
VT calls OnInitChildren where you only return the number of children, which
in turn calls OnInitNode for those nodes, if they are visible. As you can
see this relies on you know how many children a node has in advance. In
some cases that is not possible or at least practical so AddChild is
perfectly acceptable it just violates Mikes's vision of a "pure
VirutalTreeview".

Jim

 | Replies | Author | Date
4800 | Re: AddChild | [martijnbrinkers@p...] | Mon 11/26/2001


re: How to make standard TListView support the Drag-Drop from VST

From: Jim Kueneman [jimdk@m...]
Date: Wed Nov 21, 2001 1:30 pm
Subject: Re: [VirtualTreeview] How to make standard TListView support the Drag-Drop from VST

Hi Neil,

>I want to make TListView to support Drag-drop from VST.How to do that?

I don't have time to crank out a demo but you need to set the DragType to
dtVCL and then use

OnDragAllowed,
OnDragDrop,
OnDragOver,
and
OnDragEnd

Set all the allows to trrue and for the most part it should work like any
other VCL control. (You need to add ActiveX to the uses clause for
IDataObject)

Jim

 | Replies | Author | Date
4768 | Re: How to make standard TListView support the Dr | [nealzhao@y...] | Thu 11/22/2001


re: Re: GDI fault

From: Jim Kueneman [jimdk@m...]
Date: Wed Nov 21, 2001 2:14 pm
Subject: Re: [VirtualTreeview] Re: GDI fault

>Thanks Jim, I didn't know this. I am not doing TBitmap related work in that
>modal dialog with the VET which produced the problem. At least not explicitly,
>of course VT itself creates bitmaps on 14 occasions.
>
>The message is brought up in the VCL as soon as a handle for a bitmap is
>being allocated and this fails in TCanvas.RequiredState(). In fact it can be
>a handle for any canvas, not necessarily a TBitmapCanvas but lets assume
>that it is a bitmap's canvas.

It sounds like you are playing with Win98. A few thoughts. Do a stress
test and allocate memory DCs and bitmaps while watching the resouces. See
if the memory DCs show up in the GDI resources. Then see how much of each
it takes to bring Win98 down.

I was also thinking that VT does a lot of double buffering, so it may have
to create a very large bitmap(s?) to copy the content to before blasting it
to the screen. I have not looked at the code but that could be a fair size
bitmap depending on the situation and 64k is not very big when it comes to
bitmaps. How about a GDI resource tracker imbedded in the VT paint code to
dynamiclly watch what is happening during a paint?

Maybe an easier way is to change VT to always check for a Bitmap handle = 0
or a DC = 0 it may be trying to use one of these even though it failed? (I
am not sure if Mike already does this or not)

Just some random thoughts I had while in the shower :^)

Jim


re: GDI fault

From: "Jim Kueneman" [jimdk@m...]
Date: Wed Nov 21, 2001 5:15 pm
Subject: Re: GDI fault

Hi Werner,

> > you should call Dormat right after you use it to release the
memory DC and
> > the Bitmap Handle (it move the bitmap into a stream on the heap)
or at
> > least Bitmap.Canvas.Handle := 0 to force it to be released after
using it.
>
> Thanks Jim, I didn't know this. I am not doing TBitmap related work
in that
> modal dialog with the VET which produced the problem. At least not
explicitly,
> of course VT itself creates bitmaps on 14 occasions.

I snooped more and I was wrong:

procedure TWinControl.MainWndProc(var Message: TMessage);
begin
try
try
WindowProc(Message);
finally
FreeDeviceContexts;
FreeMemoryContexts;
end;
except
Application.HandleException(Self);
end;
end;

The memory and real DCs are released (if they are not locked by
another thread) after every message to a window. The bitmap however
are not.

Jim


re: Re: GDI fault

From: Werner Lehmann [wl@b...]
Date: Wed Nov 21, 2001 5:41 pm
Subject: Re: [VirtualTreeview] Re: GDI fault

Jim Kueneman wrote:
>
> It sounds like you are playing with Win98. A few thoughts. Do a stress
> test and allocate memory DCs and bitmaps while watching the resouces. See
> if the memory DCs show up in the GDI resources. Then see how much of each
> it takes to bring Win98 down.

The problem occurs on Win98. However, I don't have access to a Win9x and it
was not on my machine.

> I was also thinking that VT does a lot of double buffering, so it may have
> to create a very large bitmap(s?) to copy the content to before blasting it
> to the screen. I have not looked at the code but that could be a fair size
> bitmap depending on the situation and 64k is not very big when it comes to
> bitmaps. How about a GDI resource tracker imbedded in the VT paint code to
> dynamiclly watch what is happening during a paint?

That's what my interposer class from one of the last postings was meant for.
Right now it allows you to track how many bitmaps are held by VT and I have
a try..except around the place where the exception should occur. Not sure what
we can do in the except..end. If the exception is raised it should have stopped
there already.

It would be best if we had a small test app (maybe Justin can provide it since
he seems to be able to reproduce the problem reliably) and someone can check
this out on a Win98 machine in the delphi debugger?

> Maybe an easier way is to change VT to always check for a Bitmap handle = 0
> or a DC = 0 it may be trying to use one of these even though it failed? (I
> am not sure if Mike already does this or not)

If the bitmap is 0 we are in trouble anyway. Not sure how this can be gracefully
handled - other than popping up a message 'resources low' and terminating the
app.

> Just some random thoughts I had while in the shower :^)

Random thoughts, hm? ;)

Werner

 | Replies | Author | Date
4769 | Re: GDI fault | Jim Kueneman | Thu 11/22/2001


Default font color bug? (VirtualDrawTree)

From: [ljee@s...]
Date: Wed Nov 21, 2001 7:02 pm
Subject: Default font color bug? (VirtualDrawTree)

Hi,

I have this problem: new project, drop a VirtualDrawTree, set
rootchildcount to 0, just initialize one node to say "hello", usual
stuff, nothing fancy, don't change default properties for the tree.

When the node is painted, font color is BtnFace.
Why is it not black?

procedure TForm1.FormCreate(Sender: TObject);
begin
VT.RootNodeCount := 1;
end;

procedure TForm1.VTGetNodeWidth(Sender: TBaseVirtualTree; Canvas:
TCanvas;
Node: PVirtualNode; Column: Integer; var NodeWidth: Integer);
begin
Inc( NodeWidth, Canvas.TextWidth( 'Hello!' ) );
end;

procedure TForm1.VTDrawNode(Sender: TBaseVirtualTree; const
PaintInfo: TVTPaintInfo);
begin
with PaintInfo do
Canvas.TextRect( CellRect, ContentRect.Left,
ContentRect.Top, 'Hello!' );
end;

TIA,

Lucian

 | Replies | Author | Date
4790 | Re: Default font color bug? (VirtualDrawTree) | Mike Lischke | Sat 11/24/2001


re: Re: GDI fault

From: "Mike Lischke" [lists@l...]
Date: Wed Nov 21, 2001 7:33 pm
Subject: RE: [VirtualTreeview] Re: GDI fault

> Because Windows 9x only allows five device contexts per thread,
> perhaps there is a problem with releasing a context somewhere within
> your code. Are you allocating a DC somewhere without using a try-
> finally block?

I really would like to know what causes the trouble but it is not the 5 DCs
barrier. I don't know
why this story is still told to people but it is wrong! Here is a quote from
MSDN just about this
matter:

In 16-bit MicrosoftR WindowsR, the cache contains five display device contexts,
but only five device
contexts from the cache can be active at a time. To ensure that other
applications have access to
these device contexts, an application must release a device context immediately
after using it.
Failure to do so eventually causes the application to fail.

There is no predetermined limit on the amount of device contexts that a cache
can hold; the system
creates a new display device context for the cache if none is available. Given
this, a Win32-based
application can have more than five active device contexts from the cache at a
time. However, the
application must continue to release these device contexts after use. Because
new display device
contexts for the cache are allocated in the application's heap space, failing
to release the device
contexts eventually consumes all available heap space. The system indicates
this failure by
returning an error when it cannot allocate space for the new device context.
Other functions
unrelated to the cache may also return errors.

--- end quote

Additionally, the VCL keeps an own cache of device contexts. I suppose this is
to speed up painting.
But since VT does not use TControlCanvas it does also not make use of this
special feature.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: Re: GDI fault

From: "Mike Lischke" [lists@l...]
Date: Wed Nov 21, 2001 7:38 pm
Subject: RE: [VirtualTreeview] Re: GDI fault

> The message is brought up in the VCL as soon as a handle for a bitmap is
> being allocated and this fails in TCanvas.RequiredState(). In fact it can be
> a handle for any canvas, not necessarily a TBitmapCanvas but lets assume
> that it is a bitmap's canvas.

While reading this I remember that I had cases where I accidently specified
negative values (wrongly
calculated) for the bitmap dimensions which caused big trouble when using the
bitmap. Just a
thought...

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: Re: GDI fault

From: "Mike Lischke" [lists@l...]
Date: Wed Nov 21, 2001 7:40 pm
Subject: RE: [VirtualTreeview] Re: GDI fault

> pops up and always gives hex addresses in GDI.exe, never in the program
> itself. Even after killing the program, Windows is unstable thereafter until

Have you had a look at the stack trace? If there is no stack history then you
are very likely in a
message. Enable also debug VCL.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: Tree Editors

From: "Mike Lischke" [lists@l...]
Date: Wed Nov 21, 2001 8:56 pm
Subject: RE: [VirtualTreeview] Tree Editors

Hi Kostas,

> Since this morning when i downloaded the latest version their behaviour has
> changed, they occupy the text rect like TStringEditLink.

Yes, I reworked this code lately since it still did not produce the correct
position. Now it does
but I forgot to include code which checks for the grid mode so that the editors
get the full cell
width. This is now done, but I have to upload the new code first.

The only thing I could not get working is when you have a long text in the
editor and start deleting
chars from the end. Instead of using the full edit room the cursor is placed
more and more to the
left leaving a blank area to its right. Do you know how I can automatically
scroll the content of
the edit so that it always uses all available space?

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: Optimized Move

From: "Mike Lischke" [lists@l...]
Date: Wed Nov 21, 2001 8:59 pm
Subject: RE: [VirtualTreeview] Optimized Move

> The shell always uses optimized moves so can't you always assume that
> happened? I am not sure what happens if the move fails (lock file, no
> permission, etc.).

AFAIK the target writes something in the given IDataObject if the move was
successfull. Using this
value the source can determine what happend. So VT's IDataObject implementation
needs write support
;-)

>If I add the drag image support the optimized move is
> easy to put in and get out of the IDataObject, although I don't seem to
> remember if the DragEnd event gives you the IDataObject. Nope it appears
> not. I can add a default IDataObject parameter there maybe.

The DoDragging method can determine this value and expose it. Anyway, once this
is available it
should be easy to pass it on to the application.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: Re: first public release candidate

From: "Mike Lischke" [lists@l...]
Date: Wed Nov 21, 2001 9:01 pm
Subject: RE: [VirtualTreeview] Re: first public release candidate

> Problem in your implementation. It does not fire the Checked event
> for the child nodes when the checked node is expanded.

Fixed.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: How to make standard TListView support the Drag-Drop from VST

From: [nealzhao@y...]
Date: Thu Nov 22, 2001 12:57 am
Subject: Re: How to make standard TListView support the Drag-Drop from VST

--- In [VirtualTreeview@y...], Jim Kueneman [jimdk@m...] wrote:
>
> Hi Neil,
>
> >I want to make TListView to support Drag-drop from VST.How to do
that?
>
>
> I don't have time to crank out a demo but you need to set the
DragType to
> dtVCL and then use
>
> OnDragAllowed,
> OnDragDrop,
> OnDragOver,
> and
> OnDragEnd
>
> Set all the allows to trrue and for the most part it should work
like any
> other VCL control. (You need to add ActiveX to the uses clause for
> IDataObject)
>
> Jim

Thanks

Neal


re: Re: GDI fault

From: Jim Kueneman [jimdk@m...]
Date: Thu Nov 22, 2001 1:20 am
Subject: Re: [VirtualTreeview] Re: GDI fault

Hi Werner,

> > test and allocate memory DCs and bitmaps while watching the resouces. See
> > if the memory DCs show up in the GDI resources. Then see how much of each
> > it takes to bring Win98 down.
>
>The problem occurs on Win98. However, I don't have access to a Win9x and it
>was not on my machine.

Ok I forced myself to boot into Win98. Wrote a little test program with 2
VET plus allocation of DC, Memory DCs, and Bitmaps.

Results: Fresh boot:

I could allocate almost 5000 DC's, 5000 MemDC's, 4000 - 100x100 compatible
bitmaps at once and got down to 13% resources. Now at first this seems
good but..... I pushed harder and crashed it. Rebooted. Hit allocate
Bitmaps... only would allocate 140 bitmap handles? Left all 140 handles
allocated Touched VET and bang..... Low resources, VET started kicking
messages and reboot time. I could not see what the message all said becaue
it was using a "big* font.

I have not been able to make it do it again. I have also noticed that
the Resource Meter will get "stuck" at about 30% if taken to low. After
releasing the resources it only will come up to ~30% but I can then
allocate the same number of resources and is ok. Seems to cache them
maybe??? I also once got it to hit a low resources warning with 35%
showing in the meter.

Bottom line. I don't trust Win98's resouce allocation at all <g>

Jim


Header column property Position

From: "Peter Evans" [pgevans@m...]
Date: Thu Nov 22, 2001 1:31 am
Subject: Header column property Position

Is it possible to save the state of the column positions?

I did a test to see if the Property Position changed when the columns were
moved. It did.

procedure TTimelineDlg.Button1Click(Sender: TObject);
begin
ShowMessage('The Position of Test column is ' +
IntToStr(VST1.Header.Columns[2].Position));
end;

Is it a valid technique to store the Position for user preferences?

Regards, Peter Evans

 | Replies | Author | Date
4771 | Re: Header column property Position | Jim Kueneman | Thu 11/22/2001
4773 | Re: Header column property Position | Peter Evans | Thu 11/22/2001


re: Header column property Position

From: Jim Kueneman [jimdk@m...]
Date: Thu Nov 22, 2001 2:03 am
Subject: Re: [VirtualTreeview] Header column property Position

>Is it a valid technique to store the Position for user preferences?

Sure. You can also just do a Header.SaveToStream/LoadFromStream. I am
doing both, manipulatiing Position and using SaveTo/LoadFrom Stream in VET.

Jim


re: Re: GDI fault

From: Werner Lehmann [wl@b...]
Date: Thu Nov 22, 2001 2:16 am
Subject: Re: [VirtualTreeview] Re: GDI fault

Jim Kueneman wrote:
>
> to the screen. I have not looked at the code but that could be a fair size
> bitmap depending on the situation and 64k is not very big when it comes to
> bitmaps. How about a GDI resource tracker imbedded in the VT paint code to

I forgot to mention that the 64k barrier refers only to the handles, not
to the actual bitmap pixel data. If I am not mistaken. In any case it is not
enough anyway ;)

Werner


re: Header column property Position

From: "Peter Evans" [pgevans@m...]
Date: Thu Nov 22, 2001 2:24 am
Subject: Re: [VirtualTreeview] Header column property Position

Thanks. I will look into doing that.
Regards, Peter Evans


re: Re: GDI fault

From: Werner Lehmann [wl@b...]
Date: Thu Nov 22, 2001 2:27 am
Subject: Re: [VirtualTreeview] Re: GDI fault

Hi Jim,

> I could allocate almost 5000 DC's, 5000 MemDC's, 4000 - 100x100 compatible
> bitmaps at once and got down to 13% resources. Now at first this seems
> good but..... I pushed harder and crashed it. Rebooted. Hit allocate
> Bitmaps... only would allocate 140 bitmap handles? Left all 140 handles
> allocated Touched VET and bang..... Low resources, VET started kicking
> messages and reboot time. I could not see what the message all said becaue
> it was using a "big* font.

Thanks for the effort. Unfortunately resoure-low-effects are quite non
deterministic.

> I have not been able to make it do it again. I have also noticed that
> the Resource Meter will get "stuck" at about 30% if taken to low. After
> releasing the resources it only will come up to ~30% but I can then
> allocate the same number of resources and is ok. Seems to cache them
> maybe??? I also once got it to hit a low resources warning with 35%
> showing in the meter.
>
> Bottom line. I don't trust Win98's resouce allocation at all <g>

And I back that. Unfortunately this bug should be fixed ASAP. Cannot expect
of users to reboot every now and then because of this bug.

Second bottom line. How to proceed now? I still think it's best to reproduce
this with a basic VST as Justin can. To get a location in the source to start
looking and debugging...

Werner

 | Replies | Author | Date
4776 | Re: GDI fault | Justin Turberville | Thu 11/22/2001


VSTEdit "Range check error."

From: "Peter Evans" [pgevans@m...]
Date: Thu Nov 22, 2001 4:14 am
Subject: VSTEdit "Range check error."

I am trialing VSTEdit which has 2 units of code - MFEdit.pas and
VSTEdit.pas.

Using the component TMFNumEdit I strike problems.

Firstly the demo program 'demoedit.exe'.
1) compiled under Delphi 4 get "Range check error"
2) compiled under Delphi 6 get ditto
3) my own text program under Delphi 4 get ditto.

Error is in unit MREdit proc TMFNumEditGauge line 2417 "Pos :=
Message.LParamLo + 1;".

Now Pos is defined as a SmallInt which in Delphi 4 has the
range -32,768..32,767.

The editor works when
1) key the number
2) use little up arrow
3) use little down arrow
4) use large down arrow

Does not work when move line with mouse to the left hand side.

I tried setting Property MaxValue to less than (32,767 - 1) but that did
not work either.

Any ideas on how to fix this?

Regards, Peter Evans

 | Replies | Author | Date
4799 | Re: VSTEdit "Range check error." | Peter Evans | Sun 11/25/2001
4802 | Re: VSTEdit "Range check error." | Martijn Brinkers | Mon 11/26/2001
4807 | Re: VSTEdit "Range check error." | Peter Evans | Tue 11/27/2001


re: Re: GDI fault

From: "Justin Turberville" [justin@d...]
Date: Thu Nov 22, 2001 7:57 am
Subject: RE: [VirtualTreeview] Re: GDI fault

VET started kicking
> messages and reboot time. I could not see what the message all said
becaue
> it was using a "big* font.

The big font often happened with me, but I never go error messages from VT,
just the white DOS fault message followed by the Windows GDI error if not
the blue screen first. That is unless I have assertions on, getting that
invalid vertical position assertion, but that did not presage a crash.

> Second bottom line. How to proceed now? I still think it's best to
reproduce
> this with a basic VST as Justin can. To get a location in the source to
start
> looking and debugging...

I was afraid it would come to that ;) I may not be able to reliably product
it as that only happened in a certain combination in a complex application,
where it did not happen reliably in an almost identical situation. Perhaps
several windows with expanded VTs on them & dragging the active form
around... We only got the problem when there is an expanded VT on an
inactive form, if that may give some clue.

My impression remains that the crash occurs because Windows is in an
unstable state because of something happening at a previous action as there
is no obvious problem in the VT on the crash - I'd be tracing on a perfectly
innocious line of VT code (usually in ScrollIntoView or one of its
subroutines) when the pc suddenly freezes. Often, it is not even happening
in VT unless perhaps in the helper thread.

We thought it could be a message queue overflow due to recursive background
drawing.
The problem seems more acute, the slower the processor is, so maybe it is
tied to how fast the PC manages to process its message backlog. Then again I
did try WinSight and there was no evidence of a large number of recursive
messages, but but only on Win2000, not that that should make any difference.


re: Tree Editors

From: GIANNAKOPOULOS KOSTAS [kyan@s...]
Date: Thu Nov 22, 2001 8:33 am
Subject: RE: [VirtualTreeview] Tree Editors

> The only thing I could not get working is when you have a
> long text in the editor and start deleting
> chars from the end. Instead of using the full edit room the
> cursor is placed more and more to the
> left leaving a blank area to its right. Do you know how I can
> automatically scroll the content of
> the edit so that it always uses all available space?

This seems to work (although it may be costly) at least for an edit control
with fixed size:

procedure TMyEdit.Change;
var
S, L: Integer;
begin
inherited;
S := SelStart;
L := SelLength;
SendMessage(Handle, WM_SETREDRAW, 0, 0);
try
SelStart := 0;
finally
SelStart := S;
SelLength := L;
SendMessage(Handle, WM_SETREDRAW, 1, 0);
Invalidate;
end;
end;

 | Replies | Author | Date
4791 | Re: Tree Editors | Mike Lischke | Sat 11/24/2001


re: Re: GDI fault

From: Bender Heri [HBender@E...]
Date: Thu Nov 22, 2001 8:51 am
Subject: RE: [VirtualTreeview] Re: GDI fault

Hi all

Some times ago I had to find a very nasty bug similar to this one. It has
nothing to do with VT, but maybe it can give a hint. The bug effect was as
following: When I changed the focus from app A to app B (i.e. with ALT-TAB)
my buggy application C (which made some background processing) was shot down
by the OS (NT 4 SP 6) immediatly without any error message. The bug was: I
created a window handle in one thread and released it in annother thread,
which is a _must not_.
Maybe your problem is similar since VT does some background processing in
different thread contexts?

Heri

> -----Original Message-----
> From: Justin Turberville [mailto:[justin@d...]]
> Sent: Thursday, November 22, 2001 8:57 AM
> To: VirtualTreeview@yahoogroups.com
> Subject: RE: [VirtualTreeview] Re: GDI fault
>
>
> VET started kicking
> > messages and reboot time. I could not see what the message all said
> becaue
> > it was using a "big* font.
>
> The big font often happened with me, but I never go error
> messages from VT,
> just the white DOS fault message followed by the Windows GDI
> error if not
> the blue screen first. That is unless I have assertions on,
> getting that
> invalid vertical position assertion, but that did not presage a crash.
>
> > Second bottom line. How to proceed now? I still think it's best to
> reproduce
> > this with a basic VST as Justin can. To get a location in
> the source to
> start
> > looking and debugging...
>
> I was afraid it would come to that ;) I may not be able to
> reliably product
> it as that only happened in a certain combination in a
> complex application,
> where it did not happen reliably in an almost identical
> situation. Perhaps
> several windows with expanded VTs on them & dragging the active form
> around... We only got the problem when there is an expanded VT on an
> inactive form, if that may give some clue.
>
> My impression remains that the crash occurs because Windows is in an
> unstable state because of something happening at a previous
> action as there
> is no obvious problem in the VT on the crash - I'd be tracing
> on a perfectly
> innocious line of VT code (usually in ScrollIntoView or one of its
> subroutines) when the pc suddenly freezes. Often, it is not
> even happening
> in VT unless perhaps in the helper thread.
>
> We thought it could be a message queue overflow due to
> recursive background
> drawing.
> The problem seems more acute, the slower the processor is, so
> maybe it is
> tied to how fast the PC manages to process its message
> backlog. Then again I
> did try WinSight and there was no evidence of a large number
> of recursive
> messages, but but only on Win2000, not that that should make
> any difference.
>
>
> To unsubscribe from this group, send an email to:
> VirtualTreeview-unsubscribe@egroups.com
>
>
>
> Your use of Yahoo! Groups is subject to
> http://docs.yahoo.com/info/terms/
>
>

 | Replies | Author | Date
4779 | Re: GDI fault | Justin Turberville | Thu 11/22/2001
4786 | Re: GDI fault | Justin Turberville | Fri 11/23/2001
4792 | Re: GDI fault | Mike Lischke | Sat 11/24/2001


re: Re: GDI fault

From: "Justin Turberville" [justin@d...]
Date: Thu Nov 22, 2001 9:12 am
Subject: RE: [VirtualTreeview] Re: GDI fault

My problem only occurs on Win9x - there is no indication of any problem on
NT/2000.
After disabling VT drawing while on an inactive form, the problem did not
occur.

> Some times ago I had to find a very nasty bug similar to this one. It has
> nothing to do with VT, but maybe it can give a hint. The bug effect was as
> following: When I changed the focus from app A to app B (i.e. with
ALT-TAB)
> my buggy application C (which made some background processing) was shot
down
> by the OS (NT 4 SP 6) immediatly without any error message. The bug was: I
> created a window handle in one thread and released it in annother thread,
> which is a _must not_.
> Maybe your problem is similar since VT does some background processing in
> different thread contexts?

> Heri

 | Replies | Author | Date
4786 | Re: GDI fault | Justin Turberville | Fri 11/23/2001


print virtual treeview

From: [mdissel@h...]
Date: Thu Nov 22, 2001 3:01 pm
Subject: print virtual treeview

Hello

Has somebody made the virtual treeview printable? I'm using the VT as
a "listview" and like to print(preview) the contents (with
automatically add more pages down (more records) and right (more
columns).

I really like the devExpress Printing System, but that is only
capable of printin the standard TTreeview.

Regards,

Marco Dissel

 | Replies | Author | Date
4781 | Re: print virtual treeview | Jim Kueneman | Thu 11/22/2001


re: print virtual treeview

From: Jim Kueneman [jimdk@m...]
Date: Thu Nov 22, 2001 3:44 pm
Subject: Re: [VirtualTreeview] print virtual treeview

At 03:01 PM 11/22/2001 +0000, you wrote:
>Hello
>
>Has somebody made the virtual treeview printable? I'm using the VT as
>a "listview" and like to print(preview) the contents (with
>automatically add more pages down (more records) and right (more
>columns).
>
>I really like the devExpress Printing System, but that is only
>capable of printin the standard TTreeview.

Mathis posted a BCB example of a quick and dirty implementation of this:

http://groups.yahoo.com/group/VirtualTreeview/files/Examples/BCB_Examples/Printi\
ng/

He also has a post of the theory behind it.

http://groups.yahoo.com/group/VirtualTreeview/message/3255

I don't know if anyone has converted it to Delphi.

Jim


re: Someone has experiences with printing? ROLAND

From: "Roland" [Beduerftig@S...]
Date: Thu Nov 22, 2001 4:41 pm
Subject: Re: Someone has experiences with printing? ROLAND

Hi Frank,

sorry I was the last days a little bit out of order.

No. I had on time to do this, but I saw that someone uploaded a
source for this point in the filearea.

Best regards
Roland


Adding a node

From: "Peter Evans" [pgevans@m...]
Date: Thu Nov 22, 2001 11:48 pm
Subject: Adding a node

I have a simple TVirtualStringTree. I can delete rows from that tree OK.
I have 2 problems with Adding nodes.

1) The Added nodes do not go where I want them.
This case works ::-

IF VST1.FocusedNode = Nil THEN BEGIN
ShowMessage('FocusedNode = Nil');
Node := VST1.AddChild(Nil); {Works - adds a node as the last child}
END;

However when I Add when a row is focused I want the new row to appear after
that row.
The following code ::-

Node := VST1.AddChild(Nil); {adds a node as the last child}

only Adds the row as the last row.

How can I make the row appear after the focused row and before the existing
rows?

2) The Added nodes do not have the correct data.
When I initialise my tree the event OnInitNode is called.
That procedure just gives the row simple data like "This is column 1", "This
is column 2".
So far so good.

However when I add a row - the event OnInitNode is called and that
"dummy" data is entered.
I want to have something like "Hello 1", "Hello 2". But I get "This is
column 1", "This is column 2".

Node := VST1.AddChild(Nil);
MyData := PMyData( VST1.GetNodeData(Node));
Initialize(MyData^);
MyData.Column1 := 'Hello 1"; {do not see this}
MyData.Column2 := 'Hello 2"; {do not see this}

What am I doing wrong?

Regards, Peter Evans

 | Replies | Author | Date
4784 | Re: Adding a node | Jim Kueneman | Fri 11/23/2001
4798 | Re: Adding a node | Peter Evans | Sun 11/25/2001
4821 | Re: Adding a node | Mike Lischke | Wed 11/28/2001


re: Adding a node

From: Jim Kueneman [jimdk@m...]
Date: Fri Nov 23, 2001 12:32 am
Subject: Re: [VirtualTreeview] Adding a node

Hi Peter,

>How can I make the row appear after the focused row and before the existing
>rows?

How about
InsertNode(VST1.SelectedNode, amInsertAfter);

> Node := VST1.AddChild(Nil);
> MyData := PMyData( VST1.GetNodeData(Node));
> Initialize(MyData^);
> MyData.Column1 := 'Hello 1"; {do not see this}
> MyData.Column2 := 'Hello 2"; {do not see this}
>
>What am I doing wrong?

Either use Begin/EndUpdate around the whole block to hold off VT from doing
the drawing until you have set the data or call InvalidateNode after you
set the new data.

Jim


Why the color of font is clBtnFace in VirtualDrawTree?

From: [ljee@s...]
Date: Fri Nov 23, 2001 2:42 am
Subject: Why the color of font is clBtnFace in VirtualDrawTree?

Hi,

I have this problem: new project, drop a VirtualDrawTree, set
rootchildcount to 1, just initialize one node to say "hello", usual
stuff, nothing fancy, don't change default properties for the tree.

When the node is painted, font color is clBtnFace.
WHY IS IT NOT CLBLACK?

procedure TForm1.FormCreate(Sender: TObject);
begin
VT.RootNodeCount := 1;
end;

procedure TForm1.VTGetNodeWidth(Sender: TBaseVirtualTree; Canvas:
TCanvas;
Node: PVirtualNode; Column: Integer; var NodeWidth: Integer);
begin
Inc( NodeWidth, Canvas.TextWidth( 'Hello!' ) );
end;

procedure TForm1.VTDrawNode(Sender: TBaseVirtualTree; const
PaintInfo: TVTPaintInfo);
begin
with PaintInfo do
Canvas.TextRect( CellRect,
ContentRect.Left, ContentRect.Top, 'Hello!' );
end;

TIA,

Lucian


re: Re: GDI fault

From: "Justin Turberville" [justin@d...]
Date: Fri Nov 23, 2001 8:03 am
Subject: RE: [VirtualTreeview] Re: GDI fault

I have noticed that at times, when the mouse cursor is moved onto the VT, it
start shuddering, that is it draws the nodes in thier correct place and the
redraws them all several pixels to the left, then back at the correct
position, and so on until the mouse cursor is moved. Maybe this is related
to the GDI fault issue. Has anyone else had this happen? I have not been
able to recreate it by reenacting the sequence of actions that led up to it.


BCB : Using in Packages

From: [Andree.Hayen@t...]
Date: Sat Nov 24, 2001 8:18 am
Subject: BCB : Using in Packages

I don't think I'm the only one who tried to use VT in Packages...
Running application results in an EAcessViolation in VCL50.BPL
in Form-Create. (Form is in package).

Notice: Installing is fine, VT without using in Packages is fine.

I have only CPP-Builder 5.0 Prof.- Delphi-trials won't load it, so I can't test
it with mother... ;-)

I'm trying VT from Mike Lischkes Website.

Any hint is welcome.

Andree

[Non-text portions of this message have been removed]


re: Focus Rectangle too small when font changes to fsBold

From: "Mike Lischke" [lists@l...]
Date: Sat Nov 24, 2001 9:31 am
Subject: RE: [VirtualTreeview] Focus Rectangle too small when font changes to fsBold

> I wonder if it is possible to postpone drawing the focus and selection rects
until its
> dimensions are finally known to the tree. In other words, move the relevant
code from
> PrepareCell to DoPaintNode. (My intuition tells me this is more part of
painting the node
> than preparing it.)

This is very difficult. The paint stuff is extremely complex and I have
reworked it already several
times. The problem is not the painting but the discrepancy between the stored
node width and changed
node text. The most reliable solution would be to store font settings in the
node too and do not
allow to change them in OnPaintText.

However, you will not frequently change the text format, simply because the
user can't work with the
tree otherwise. So the most elegant (and easy to implement) solution is to call
InvalidateNode
whenever text attributes change (determine them in OnExpanded not in
OnPaintText). If you still need
more frequent changes then use either full row selection, full owner draw for
the particular node or
a draw tree.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: Advanced Demo? Source code?

From: "Mike Lischke" [lists@l...]
Date: Sat Nov 24, 2001 9:32 am
Subject: RE: [VirtualTreeview] Advanced Demo? Source code?

> The advanced demo seems to have disappeared. Does anyone know where
> to find it now? Is the source code for the advanced demo now
> available? I was blown away with some of the animated tree
> presentations.

The advanced demo is currently being reworked. You can get a developer snapshot
if you like.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net

 | Replies | Author | Date
4797 | Re: Advanced Demo? Source code? | [subscribedlists@b...] | Sun 11/25/2001


re: Default font color bug? (VirtualDrawTree)

From: "Mike Lischke" [lists@l...]
Date: Sat Nov 24, 2001 9:33 am
Subject: RE: [VirtualTreeview] Default font color bug? (VirtualDrawTree)

> I have this problem: new project, drop a VirtualDrawTree, set
> rootchildcount to 0, just initialize one node to say "hello", usual
> stuff, nothing fancy, don't change default properties for the tree.
>
> When the node is painted, font color is BtnFace.
> Why is it not black?

The draw tree does not set a default value for this color. Since full painting
is done by the
application you have to adjust the canvas' settings. So one of the first lines
should be something
like:

ACanvas.Font := Tree.Font;

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: Tree Editors

From: "Mike Lischke" [lists@l...]
Date: Sat Nov 24, 2001 9:48 am
Subject: RE: [VirtualTreeview] Tree Editors

Hi Kostas,

> This seems to work (although it may be costly) at least for an edit control
> with fixed size:

Unfortunately, it does not work in VT. The point is that I have no trouble with
a fixed sized edit
but when deleting parts of the text which is too long to fit entirely into the
edit.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: Re: GDI fault

From: "Mike Lischke" [lists@l...]
Date: Sat Nov 24, 2001 9:49 am
Subject: RE: [VirtualTreeview] Re: GDI fault

> Maybe your problem is similar since VT does some background processing in
> different thread contexts?

The only background processing VT does is to validate a simple array (the node
cache). It cannot
cause trouble regarding GDI, unless it raises an exception while the tree is
painting.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


Clipboard/DragDrop - Own formats

From: [hulbi@l...]
Date: Sat Nov 24, 2001 11:05 am
Subject: Clipboard/DragDrop - Own formats

All,

I have a TVirtualStringTree component in my application and store a
record of application data along with each node.
Is there any examples out there of creating my own format so that
these nodes can be dragged (cut/copy etc) around my tree preserving
this information at each node ?

Many thanks from a newbie VST user ...

Chris.

 | Replies | Author | Date
4796 | Re: Clipboard/DragDrop - Own formats | Jim Kueneman | Sat 11/24/2001


re: Re: GDI fault

From: Peter Nürk [pnuerk@o...]
Date: Sat Nov 24, 2001 7:05 pm
Subject: RE: [VirtualTreeview] Re: GDI fault

Hallo Mike,

the GDI-Fault isn´t a GDI-Fault. It only acource if
VT.Header.ShowHint:=True

In Rev. 1.31 of VirtualTree the Exception show exactly the
position of the Bug in VT. -> Include(...

If VT is Empty and the MousePointer is
moved over the Header, the Exeption gomes.

Ciao, Peter

>> Maybe your problem is similar since VT does some background processing in
>> different thread contexts?

> The only background processing VT does is to validate a simple array (the
> node cache). It cannot
> cause trouble regarding GDI, unless it raises an exception while the tree
> is painting.

> Ciao, Mike
> --
> www.lischke-online.de
> www.delphi-unicode.net

> To unsubscribe from this group, send an email to:
> VirtualTreeview-unsubscribe@egroups.com

> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/

 | Replies | Author | Date
4795 | Re: GDI fault | Mike Lischke | Sat 11/24/2001


re: Re: GDI fault

From: "Mike Lischke" [lists@l...]
Date: Sat Nov 24, 2001 7:28 pm
Subject: RE: [VirtualTreeview] Re: GDI fault

Hi Peter,

> In Rev. 1.31 of VirtualTree the Exception show exactly the
> position of the Bug in VT. -> Include(...

This bug was indeed there but has been fixed quite a while ago. You can try the
latest build from
www.lischke-online.de/VirtualTreeview/beta/VirtualTree_2.6.11.zip.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: Clipboard/DragDrop - Own formats

From: "Jim Kueneman" [jimdk@m...]
Date: Sat Nov 24, 2001 9:43 pm
Subject: Re: Clipboard/DragDrop - Own formats

> I have a TVirtualStringTree component in my application and store a
> record of application data along with each node.
> Is there any examples out there of creating my own format so that
> these nodes can be dragged (cut/copy etc) around my tree preserving
> this information at each node ?

I can't help you much more than VT uses OLE drag and drop and to look
at OnRenderOLEData, OnDragDrop, and OnGetUserClipboardFormat.

The order they are fired is:

BeginDrag/CopyToClipboard - OnGetUserClipboardFormat

Register a custom format and return it in the event

Drop/Paste - OnRenederOLEData fires, this is the drag source being
asked to load the data into IDataObject. OnDragDrop fires in the
drop target after the source has loaded the IDataObject.

If you don't understand OLE Clipboards and IDataObject then this is
likely an uphill battle. As I write this we are reworking the OLE
DataObject so it will be much more flexable (now it is limited to
HGlobal) and there may be some other things to simplifiy OLE
transfers.

Jim


re: Advanced Demo? Source code?

From: [subscribedlists@b...]
Date: Sun Nov 25, 2001 9:50 am
Subject: Re: Advanced Demo? Source code?

> The advanced demo is currently being reworked. You can get a
> developer snapshot if you like.

Yes, I would like to have a copy of the in progress source code.
Where can I locate one or can you email me a copy to
[downloads@b...]?

Thanks,

Doug


re: Adding a node

From: "Peter Evans" [pgevans@m...]
Date: Sun Nov 25, 2001 11:00 pm
Subject: Re: [VirtualTreeview] Adding a node

> How about
> InsertNode(VST1.SelectedNode, amInsertAfter);

Works! Thanks Jim.

> Either use Begin/EndUpdate around the whole block to hold off VT from
doing
> the drawing until you have set the data or call InvalidateNode after you
> set the new data.

I got this working by adding the line ::-
VST1.OnInitNode := Nil;
in the procedure where I Add a Node to the tree. This means that OnInitNode
is no longer called.

It is odd there is not an event that signals when the tree (via the property
RootNodeCount) has finished initialising the tree. Is there such an event?

Regards, Peter Evans

 | Replies | Author | Date
4821 | Re: Adding a node | Mike Lischke | Wed 11/28/2001


re: VSTEdit "Range check error."

From: "Peter Evans" [pgevans@m...]
Date: Sun Nov 25, 2001 11:04 pm
Subject: Re: [VirtualTreeview] VSTEdit "Range check error."

I have done some further investigation into this problem.

1) If I change the property GaugeHeight = 0 then the Gauge will not be
visible. Unfortunately it is still possible to "grab" with the mouse the
gauge and make the number increase or decrease. And you can still get the
"Range check error".

2) When the mouse is being moved to the right hand side. The number in the
Gauge increases. When the mouse travels past the end of the gauge the number
still increases. The number can increase above the maximum.

Regards, Peter Evans


re: AddChild

From: [martijnbrinkers@p...]
Date: Mon Nov 26, 2001 2:46 am
Subject: Re: AddChild

Thanks :). For now I will stick to AddChild because it fits better
with the code I have now but I can see the advantage of the pure
approach for large data-sets (which I will be using soon :).

--- In [VirtualTreeview@y...], Jim Kueneman [jimdk@m...] wrote:
>
> The "pure" way is to only use OnInitNode and OnInitChildren. In
OnInitNode
> you set the HasChildren flag. The when the user tries to expand
that node
> VT calls OnInitChildren where you only return the number of
children, which
> in turn calls OnInitNode for those nodes, if they are visible. As
you can
> see this relies on you know how many children a node has in
advance. In
> some cases that is not possible or at least practical so AddChild
is
> perfectly acceptable it just violates Mikes's vision of a "pure
> VirutalTreeview".
>
> Jim


How Get a property : Node

From: Ven ven [vasut_v_y@y...]
Date: Mon Nov 26, 2001 5:17 am
Subject: How Get a property : Node

Hello, All.
I have a little question: How get property:Node when
clicking column >0 ?

Best regards, Ven

__________________________________________________
Do You Yahoo!?
Yahoo! GeoCities - quick and easy web site hosting, just $8.95/month.
http://geocities.yahoo.com/ps/info1

 | Replies | Author | Date
4805 | Re: How Get a property : Node | Jim Kueneman | Tue 11/27/2001


re: VSTEdit "Range check error."

From: "Martijn Brinkers" [martijnbrinkers@p...]
Date: Mon Nov 26, 2001 10:43 am
Subject: Re: [VirtualTreeview] VSTEdit "Range check error."

This fixes the lower "range check error" but I still do not know why LParamLo
gets values that high. I did not find the effect of getting higher values than
the maximum of the control.

Martijn Brinkers

procedure TMFNumEditGauge.WMMouseMove(var Message: TMessage);
var
Pos : SmallInt;
Diff,
V : Double;
LocalMinValue,
LocalMaxValue : Double;
begin
if ( not MouseCapture ) then
Exit;
{bug fix ?. Don't know why but sometimes LParamLo gets to high}
if Message.LParamLo > High(SmallInt) then
Pos := 0
else
Pos := Message.LParamLo + 1;

etc...

end;
----- Original Message -----
From: Peter Evans
To: VirtualTreeview@yahoogroups.com
Sent: Monday, November 26, 2001 8:04 AM
Subject: Re: [VirtualTreeview] VSTEdit "Range check error."

I have done some further investigation into this problem.

1) If I change the property GaugeHeight = 0 then the Gauge will not be
visible. Unfortunately it is still possible to "grab" with the mouse the
gauge and make the number increase or decrease. And you can still get the
"Range check error".

2) When the mouse is being moved to the right hand side. The number in the
Gauge increases. When the mouse travels past the end of the gauge the number
still increases. The number can increase above the maximum.

Regards, Peter Evans

Yahoo! Groups Sponsor

To unsubscribe from this group, send an email to:
VirtualTreeview-unsubscribe@egroups.com

Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.

[Non-text portions of this message have been removed]


GDI fault problem

From: Mike Lischke [lists@l...]
Date: Mon Nov 26, 2001 2:48 pm
Subject: GDI fault problem

Hi all,

in the process of hunting another problem I just had an "aha-effect"
regarding the recently mentioned GDI problems. Actually, it is so that the
VCL might release DC handles whenever it thinks it is appropriate. This can
even happen while VT is in a paint handler where the application paints its
own stuff using such methods like PaintTo or classes like TControlGrid etc.
which use PaintTo.

The resulting effect is that the device context on enter of the paint
handler is not the same as on exit of it. That this confuses the painting is
obvious and can simply be avoided by locking the canvas in the PaintInfo
structure. So what I'd like to suggest is that you always call

PaintInfo.Canvas.Lock;
try
// your painting here
finally
PaintInfo.Canvas.Unlock;
end;

and see if the GDI faults still occur. Regardless of the outcome, however, I
will place such a lock into the PaintTree method of VT to avoid other
troubles like changed brush and window orgs etc. Let me know what you
find...

Ciao, Mike

Dipl. Ing. Mike Lischke
Senior software engineer
_________________________
digital publishing AG
Tumblinger Strasse 32
80337 Munich, Germany
Fon +49 (89) 747 482 32
Fax +49 (89) 747 923 08
http://www.digitalpublishing.de


GDI FAULT

From: "Fabio Manfredini" [fabmanfredini@n...]
Date: Wed Jan 1, 1997 6:43 am
Subject: GDI FAULT

i´m getting a GDI Fault in design time, when i move the mouse over one
Virtual Tree View. It does not occurs every time a move the mouse over, but
this problem occurs a lot of times and i need to restart delphi every time
is occurs. I was not sure if it was a VT issue, but after reading some GDI
Fault related messages within the list, a think there is something related
to. There is some known way to fix this problem ?

Thank You.

 | Replies | Author | Date
4806 | Re: GDI FAULT | Jim Kueneman | Tue 11/27/2001
4808 | Re: GDI FAULT | Justin Turberville | Tue 11/27/2001
4810 | Re: GDI FAULT | Jim Kueneman | Tue 11/27/2001
4811 | Re: GDI FAULT | [frans.bouwmans@z...] | Tue 11/27/2001
4822 | Re: GDI FAULT | Mike Lischke | Wed 11/28/2001
4819 | Re: GDI FAULT | Justin Turberville | Wed 11/28/2001
4825 | Re: GDI FAULT | Mike Lischke | Wed 11/28/2001
4833 | Re: GDI FAULT - no more! | Justin Turberville | Thu 11/29/2001
4850 | Re: GDI FAULT - no more! | Mike Lischke | Sun 12/2/2001


re: How Get a property : Node

From: Jim Kueneman [jimdk@m...]
Date: Tue Nov 27, 2001 2:48 am
Subject: Re: [VirtualTreeview] How Get a property : Node

At 09:17 PM 11/25/2001 -0800, you wrote:
>Hello, All.
>I have a little question: How get property:Node when
>clicking column >0 ?
>
>Best regards, Ven

Hi Ven,

I am not sure what you mean here. Are you talking about using VT like a
grid? If so you must set TreeOptions.MiscOptions.toGridExtenstion and
TreeOptions.SelectionOptions.toExtendedFocus then use the
OnFocusChange/Changing events.

Jim


re: GDI FAULT

From: Jim Kueneman [jimdk@m...]
Date: Tue Nov 27, 2001 3:00 am
Subject: Re: [VirtualTreeview] GDI FAULT

At 04:43 AM 1/1/1997 -0200, you wrote:
>i´m getting a GDI Fault in design time, when i move the mouse over one
>Virtual Tree View. It does not occurs every time a move the mouse over, but
>this problem occurs a lot of times and i need to restart delphi every time
>is occurs. I was not sure if it was a VT issue, but after reading some GDI
>Fault related messages within the list, a think there is something related
>to. There is some known way to fix this problem ?

Perfect candidate to try Mike's idea.

Go into VirtualTrees.pas and search for the PaintTree method and add the
lock cavas calls Mike outlined a few message ago.

begin
.......
// For alpha blending we need the 32 bit pixel format.
NodeBitmap.PixelFormat := pf32Bit;
try
PaintInfo.Canvas.Lock; < ADD THIS
......... // *many* lines of paint code
finally
PaintInfo.Canvas.UnLock; < ADD THIS
NodeBitmap.Free;
end;

And please report what happens.

Jim

 | Replies | Author | Date
4808 | Re: GDI FAULT | Justin Turberville | Tue 11/27/2001
4810 | Re: GDI FAULT | Jim Kueneman | Tue 11/27/2001
4811 | Re: GDI FAULT | [frans.bouwmans@z...] | Tue 11/27/2001
4822 | Re: GDI FAULT | Mike Lischke | Wed 11/28/2001
4819 | Re: GDI FAULT | Justin Turberville | Wed 11/28/2001
4825 | Re: GDI FAULT | Mike Lischke | Wed 11/28/2001
4833 | Re: GDI FAULT - no more! | Justin Turberville | Thu 11/29/2001
4850 | Re: GDI FAULT - no more! | Mike Lischke | Sun 12/2/2001


re: VSTEdit "Range check error."

From: "Peter Evans" [pgevans@m...]
Date: Tue Nov 27, 2001 5:49 am
Subject: Re: [VirtualTreeview] VSTEdit "Range check error."

Martijn,
Thank you for replying. I too do not know why LParamLo gets that high....

> This fixes the lower "range check error" but I still do not know why
LParamLo gets values that high. I >did not find the effect of getting higher
values than the maximum of the control.

For Problem 1.
I wasn't sure where the problem has to be fixed. As it can be fixed in
procedure WMMouseMove I suggest ::-

{bug fix ?. Don't know why but sometimes LParamLo gets to high}
if Message.LParamLo > ( High(SmallInt) - 1 ) then

I should have said for Problem 2 ::-

2) When the mouse is being moved to the right hand side. The number in the
Gauge increases. When the mouse travels past the end of the gauge the number
still increases. The number can increase above the maximum set in the
Property GaugeMaxValue.

Regards, Peter Evans


re: GDI FAULT

From: "Justin Turberville" [justin@d...]
Date: Tue Nov 27, 2001 11:25 am
Subject: RE: [VirtualTreeview] GDI FAULT

I'm currently using VT v2.0 which has neither PaintTree, PaintInfo nor
NodeBitmap identifiers. I did download v2.6, but have not yet converted to
it - a bit of effort required due to some property and method parameter
changes. I suppose I should instead of trying to do the same in v2.0?

Justin

-----Original Message-----
From: Jim Kueneman [mailto:[jimdk@m...]]
Sent: 27 November 2001 05:00
To: [VirtualTreeview@yahoogroups.com
Subject: Re: [VirtualTreeview] GDI FAULT

At 04:43 AM 1/1/1997 -0200, you wrote:
>i´m getting a GDI Fault in design time, when i move the mouse over one
>Virtual Tree View. It does not occurs every time a move the mouse over, but
>this problem occurs a lot of times and i need to restart delphi every time
>is occurs. I was not sure if it was a VT issue, but after reading some GDI
>Fault related messages within the list, a think there is something related
>to. There is some known way to fix this problem ?

Perfect candidate to try Mike's idea.

Go into VirtualTrees.pas and search for the PaintTree method and add the
lock cavas calls Mike outlined a few message ago.

begin
.......
// For alpha blending we need the 32 bit pixel format.
NodeBitmap.PixelFormat := pf32Bit;
try
PaintInfo.Canvas.Lock; < ADD THIS
......... // *many* lines of paint code
finally
PaintInfo.Canvas.UnLock; < ADD THIS
NodeBitmap.Free;
end;

And please report what happens.

Jim

To unsubscribe from this group, send an email to:
VirtualTreeview-unsubscribe@egroups.com

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/

 | Replies | Author | Date
4810 | Re: GDI FAULT | Jim Kueneman | Tue 11/27/2001
4811 | Re: GDI FAULT | frans.bouwmans@z...] | Tue 11/27/2001
4822 | Re: GDI FAULT | Mike Lischke | Wed 11/28/2001


re: Welcome to VirtualTreeview

From: Martin Lowry [m.lowry@h...]
Date: Tue Nov 27, 2001 1:24 pm
Subject: RE: Welcome to VirtualTreeview

Cheers!
-------------------------------------------------------
Martin Lowry Voice: +44 (0)1482 674075
Fax: +44 (0)1482 320137
Email: mailto:[m.lowry@h...]
WWW: http://www.med-phys.hull.ac.uk/~Lobivia/
-------------------------------------------------------


re: GDI FAULT

From: Jim Kueneman [jimdk@m...]
Date: Tue Nov 27, 2001 1:28 pm
Subject: RE: [VirtualTreeview] GDI FAULT

Hi,

>NodeBitmap identifiers. I did download v2.6, but have not yet converted to
>it - a bit of effort required due to some property and method parameter
>changes. I suppose I should instead of trying to do the same in v2.0?

I see, actually you should use the absolute latest:

www.lischke-online.de/VirtualTreeview/beta/VirtualTree_2.6.11.zip

This is *almost* the next public release version.

Jim

 | Replies | Author | Date
4811 | Re: GDI FAULT | [frans.bouwmans@z...] | Tue 11/27/2001
4822 | Re: GDI FAULT | Mike Lischke | Wed 11/28/2001


re: GDI FAULT

From: [frans.bouwmans@z...]
Date: Tue Nov 27, 2001 4:58 pm
Subject: Re: GDI FAULT

>
> This is *almost* the next public release version.

I noticed that the problem I reported a few days ago is not fixed in
this almost next beta release.
The problem is the source object of the dragover event, it should be
the originating object, but it is actually the dragobject.
Note that adding this line also requires a begin end in the else part.

procedure TBaseVirtualTree.CMDrag(var Message: TCMDrag);
var
S: TObject;
ShiftState: Integer;
P: TPoint;
DropEffect: Integer;
Formats: TFormatArray;

begin
with Message, DragRec^ do
begin
S := Source;
Formats := nil;

// let the ancestor handle dock operations
if S is TDragDockObject then
inherited
else
// line to be added
S := (S as TDragControlObject).Control;
// end modification

 | Replies | Author | Date
4822 | Re: GDI FAULT | Mike Lischke | Wed 11/28/2001


HTML aware VirtualStringTree

From: "Martijn Brinkers" [martijnbrinkers@p...]
Date: Wed Nov 28, 2001 5:44 am
Subject: HTML aware VirtualStringTree

I would like to have a VirtualStringTree that can display text with HTML markup
(like different font, colors etc.). Is there someone who knows if there is some
label component which I can use for the HTML part?

Thanks,

Martijn Brinkers

[Non-text portions of this message have been removed]

 | Replies | Author | Date
4813 | Re: HTML aware VirtualStringTree | Helge Jung (ECO-Logic) | Wed 11/28/2001
4814 | Re: HTML aware VirtualStringTree | Martijn Brinkers | Wed 11/28/2001
4823 | Re: HTML aware VirtualStringTree | Mike Lischke | Wed 11/28/2001
4828 | Re: HTML aware VirtualStringTree | Helge Jung (ECO-Logic) | Wed 11/28/2001
4846 | Re: HTML aware VirtualStringTree | Mike Lischke | Sat 12/1/2001
4829 | Re: HTML aware VirtualStringTree | Martijn Brinkers | Thu 11/29/2001
4847 | Re: HTML aware VirtualStringTree | Mike Lischke | Sat 12/1/2001
4830 | Re: HTML aware VirtualStringTree | Martijn Brinkers | Thu 11/29/2001


re: HTML aware VirtualStringTree

From: "Helge Jung \(ECO-Logic\)" [helge@e...]
Date: Wed Nov 28, 2001 6:09 am
Subject: RE: [VirtualTreeview] HTML aware VirtualStringTree

> I would like to have a VirtualStringTree that can display text
> with HTML markup (like different font, colors etc.). Is there
> someone who knows if there is some label component which I can
> use for the HTML part?
>

Don't know if that helps you but Mike has written something like a syntax
highlighter which works halfway (I have some situation in which it produces
errors) but it may give you a clue on how to achieve what you want. BTW it's
Unicode-aware.

Helge.


re: HTML aware VirtualStringTree

From: "Martijn Brinkers" [martijnbrinkers@p...]
Date: Wed Nov 28, 2001 6:17 am
Subject: Re: [VirtualTreeview] HTML aware VirtualStringTree

thanks I will take a look at it :)

Martijn Brinkers
----- Original Message -----
From: Helge Jung (ECO-Logic)
To: VirtualTreeview@yahoogroups.com
Sent: Wednesday, November 28, 2001 3:09 PM
Subject: RE: [VirtualTreeview] HTML aware VirtualStringTree

> I would like to have a VirtualStringTree that can display text
> with HTML markup (like different font, colors etc.). Is there
> someone who knows if there is some label component which I can
> use for the HTML part?
>

Don't know if that helps you but Mike has written something like a syntax
highlighter which works halfway (I have some situation in which it produces
errors) but it may give you a clue on how to achieve what you want. BTW it's
Unicode-aware.

Helge.

Yahoo! Groups Sponsor
ADVERTISEMENT

To unsubscribe from this group, send an email to:
VirtualTreeview-unsubscribe@egroups.com

Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.

[Non-text portions of this message have been removed]


FW: Problem with saving and loading tree structure and user data in Virtual TreeView...

From: "Justin Turberville" [justin@d...]
Date: Wed Nov 28, 2001 7:11 am
Subject: FW: Problem with saving and loading tree structure and user data in Virtual TreeView...

-----Original Message-----
From: Tomasz Trejderowski [mailto:[trejderowski@q...]]
Sent: 27 November 2001 10:54
To: [justin@d...]
Subject: Problem with saving and loading tree structure and user data in
Virtual TreeView...

Hello!

Can you help me with Virtual TreeView OnLoadNode and OnSaveNode bug?

Here is an decription:
The bug is that when I create tree structure and write it to file (with user
data - see attached file) and then read it from this file all seams to be
OK - structure is recreated and user data is properly read and assigned to
each tree node. But when a exit program, run it again and click on the Read
button I get one of nodes' data read incorrectly (usually one of first).
When I read it again sometimes it gets corrected and sometimes not. It is
silly to me - because something may work or something may not work - working
form time to time is stupid and really pissed me off (sorry :) because I
can't find bug in code that sometimes works and sometimes not. I'm sending
you piece of my code - please see if you can produce this bug at your
computer and mayby to find a solution.
BTW: I compared file test.tree right after saving (without exiting program,
when load works fine) with that one after exiting program and starting new
one (when load gets buggy from time to time) - it is the same, so delphi
does not mess anything at anytime by itself - conlusion: there is a bug in
my code, but where ???

If you would need a record that I will be using (not used yet), when I fight
this silly bug - here it is:

type
PMyRec = ^TMyRec;
TMyRec = record
Caption: String; //Should be set as each node's caption when Load.
Image: Integer; //Should be taken as ImageList.Index and set as node's
image when Load.
Hint: String; //Should be set as each node's Hint when Load.
Target: String; //Used internally by app, when user selects node.
end;

So as you see - it is not too complicated, but I still had problems with
writing it. Mayby you can help...

Best regards

Tomasz Trejderowski
-------------------------------------
[trejderowski@q...]

[Non-text portions of this message have been removed]

 | Replies | Author | Date
4817 | Re: FW: Problem with saving and loading tree stru | Jim Kueneman | Wed 11/28/2001
4818 | Re: FW: Problem with saving and loading tree str | Justin Turberville | Wed 11/28/2001


Replacing the collapse expand image with another!

From: "Dion" [dion@n...]
Date: Tue Nov 27, 2001 1:54 pm
Subject: Replacing the collapse expand image with another!

Hi All,

How do I replace the 'collapse', 'expand' node image in the tree with
another?

Regards,
Dion.

----- Original Message -----
From: [ljee@s...]
To: <VirtualTreeview@yahoogroups.com>
Sent: Friday, November 23, 2001 4:42 AM
Subject: [VirtualTreeview] Why the color of font is clBtnFace in
VirtualDrawTree?

> Hi,
>
> I have this problem: new project, drop a VirtualDrawTree, set
> rootchildcount to 1, just initialize one node to say "hello", usual
> stuff, nothing fancy, don't change default properties for the tree.
>
> When the node is painted, font color is clBtnFace.
> WHY IS IT NOT CLBLACK?
>
>
> procedure TForm1.FormCreate(Sender: TObject);
> begin
> VT.RootNodeCount := 1;
> end;
>
> procedure TForm1.VTGetNodeWidth(Sender: TBaseVirtualTree; Canvas:
> TCanvas;
> Node: PVirtualNode; Column: Integer; var NodeWidth: Integer);
> begin
> Inc( NodeWidth, Canvas.TextWidth( 'Hello!' ) );
> end;
>
> procedure TForm1.VTDrawNode(Sender: TBaseVirtualTree; const
> PaintInfo: TVTPaintInfo);
> begin
> with PaintInfo do
> Canvas.TextRect( CellRect,
> ContentRect.Left, ContentRect.Top, 'Hello!' );
> end;
>
>
> TIA,
>
> Lucian
>
>
>
> To unsubscribe from this group, send an email to:
> VirtualTreeview-unsubscribe@egroups.com
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>
>

 | Replies | Author | Date
4824 | Re: Replacing the collapse expand image with anot | Mike Lischke | Wed 11/28/2001


re: FW: Problem with saving and loading tree structure and user data in Virtual TreeView...

From: Jim Kueneman [jimdk@m...]
Date: Wed Nov 28, 2001 12:49 pm
Subject: Re: [VirtualTreeview] FW: Problem with saving and loading tree structure and user data in Virtual TreeView...

Hi Justin,

>[Non-text portions of this message have been removed]

You have to upload to the files area, not attachments allowed.

Also I sent you an email privately last night did you not get it or did the
fix not work? The problem was the string in the record was a WideString
and the SaveTo/LoadFrom Stream routines were casting it to a PChar instead
of a PWideChar.

Jim

 | Replies | Author | Date
4818 | Re: FW: Problem with saving and loading tree str | Justin Turberville | Wed 11/28/2001


re: FW: Problem with saving and loading tree structure and user data in Virtual TreeView...

From: "Justin Turberville" [justin@d...]
Date: Wed Nov 28, 2001 1:41 pm
Subject: RE: [VirtualTreeview] FW: Problem with saving and loading tree structure and user data in Virtual TreeView...

Jim

There seem to be some confusion here. I did'nt get an email from you last
night, only one with a link to download the latest VT yesterday afternoon in
reply to my query on the canvas.lock fix. I have not yet tried it, but will
asap.

The structure load & save problem was an email sent to me privately by
Tomasz Trejderowski [trejderowski@q...], which I then forwarded to the group
as I've never dabbled in that side of things, forgetting about the
attachement. I'll forward him your explanation of the problem.

thanks
Justin

-----Original Message-----
From: Jim Kueneman [mailto:[jimdk@m...]]
Sent: 28 November 2001 02:50
To: VirtualTreeview@yahoogroups.com
Subject: Re: [VirtualTreeview] FW: Problem with saving and loading tree
structure and user data in Virtual TreeView...

Hi Justin,

>[Non-text portions of this message have been removed]

You have to upload to the files area, not attachments allowed.

Also I sent you an email privately last night did you not get it or did the
fix not work? The problem was the string in the record was a WideString
and the SaveTo/LoadFrom Stream routines were casting it to a PChar instead
of a PWideChar.

Jim

To unsubscribe from this group, send an email to:
VirtualTreeview-unsubscribe@egroups.com

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/


re: GDI FAULT

From: "Justin Turberville" [justin@d...]
Date: Wed Nov 28, 2001 3:57 pm
Subject: RE: [VirtualTreeview] GDI FAULT

Putting the canvas lock there won't work because it is not yet assigned,
rather a little further down...

PaintInfo.Canvas := NodeBitmap.Canvas;
PaintInfo.Canvas.Lock; < ADD THIS

> Go into VirtualTrees.pas and search for the PaintTree
> method and add the
> lock cavas calls Mike outlined a few message ago.

> begin
> .......
> // For alpha blending we need the 32 bit pixel format.
> NodeBitmap.PixelFormat := pf32Bit;
> try
> PaintInfo.Canvas.Lock; < ADD THIS
> ......... // *many* lines of paint code
> finally
> PaintInfo.Canvas.UnLock; < ADD THIS
> NodeBitmap.Free;
> end;

I'll report on whether it helps.

I've noticed that in v2.6.11's OnBeforeItemPaint, ItemRect no longer takes
the vertical scrollbar into account, therefore my node tiles no longer has a
right edge when the scrollbar is showing :(

At least the effect of when the mouse cursor was within the vertical
scrollbar area, the recursive drawing of the left area too far to the left
and then back again (seemed to have been a wraparound issue - the whole tree
looked like it was shivering!) no longer occurs with v2.6.11 in a particular
application :)

regards
Justin

 | Replies | Author | Date
4825 | Re: GDI FAULT | Mike Lischke | Wed 11/28/2001
4833 | Re: GDI FAULT - no more! | Justin Turberville | Thu 11/29/2001
4850 | Re: GDI FAULT - no more! | Mike Lischke | Sun 12/2/2001


Bug 76 is still alive

From: "Paul D'Agosta" [pdagosta@c...]
Date: Wed Nov 28, 2001 4:30 pm
Subject: Bug 76 is still alive

Hi Mike,
Sorry I've taken so long to verify the fix for Bug 76. (We just had
a baby girl week before last!! :) )

I think you're close to the solution, but the check for FUpdateCount >
0 in DoSetOffsetXY doesn't help the last EndUpdate, because
fUpdateCount is 0, and you still don't want to do the scroll drawing.
(Invalidate will handle the drawing later)

Like I've said in an earlier message, this is not just a problem with
my own scrolling requirements. It shows up in every VT with the last
node scrolled into view and a node deleted off screen.

Thank you very much,

Paul

PS
I haven't changed the Bug Status in the database.

 | Replies | Author | Date
4826 | Re: Bug 76 is still alive | Mike Lischke | Wed 11/28/2001
4827 | Re: Bug 76 is still alive | Paul D'Agosta | Wed 11/28/2001
4845 | Re: Bug 76 is still alive | Mike Lischke | Sat 12/1/2001
4864 | Re: Bug 76 is still alive | Paul D'Agosta | Mon 12/3/2001


re: Adding a node

From: "Mike Lischke" [lists@l...]
Date: Wed Nov 28, 2001 7:44 pm
Subject: RE: [VirtualTreeview] Adding a node

Peter,

> It is odd there is not an event that signals when the tree (via the property
> RootNodeCount) has finished initialising the tree. Is there such an event?

Such an event would not make much sense, don't you think? Either initialization
is finished right
after you set the RootNodeCount property then can act there or initialization
is never finished
because not all nodes are shown or touched. Between these two extremes
everything is possible.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: Re: GDI FAULT

From: "Mike Lischke" [lists@l...]
Date: Wed Nov 28, 2001 8:17 pm
Subject: RE: [VirtualTreeview] Re: GDI FAULT

Hi Frans,

> I noticed that the problem I reported a few days ago is not fixed in
> this almost next beta release.
> The problem is the source object of the dragover event, it should be
> the originating object, but it is actually the dragobject.
> Note that adding this line also requires a begin end in the else part.

Sorry for overlooking this, but I guess the inproper subject line was the cause
(or simply my
ignorance). This is now fixed (not the ignorance, but the CM_DRAG handling :o]).

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: HTML aware VirtualStringTree

From: "Mike Lischke" [lists@l...]
Date: Wed Nov 28, 2001 8:20 pm
Subject: RE: [VirtualTreeview] HTML aware VirtualStringTree

Hi Martijn,

> I would like to have a VirtualStringTree that can display text with HTML
markup (like
> different font, colors etc.). Is there someone who knows if there is some
label component
> which I can use for the HTML part?

I assume you mean you want to pass in HTML text and get out the same result as
with Internet
Explorer (in a smaller extent)? Well, I guess this another hundreds or
thousands of lines for a good
HTML rendering engine. If there were a windowless rendering service (like
ITextServices for RTF)
then it could be done but without this the HTML rendering engine would be
larger than the entire
treeview implementation.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net

 | Replies | Author | Date
4828 | Re: HTML aware VirtualStringTree | Helge Jung (ECO-Logic) | Wed 11/28/2001
4846 | Re: HTML aware VirtualStringTree | Mike Lischke | Sat 12/1/2001


re: Replacing the collapse expand image with another!

From: "Mike Lischke" [lists@l...]
Date: Wed Nov 28, 2001 8:21 pm
Subject: RE: [VirtualTreeview] Replacing the collapse expand image with another!

Hi Dion,

> How do I replace the 'collapse', 'expand' node image in the tree with
> another?

These images are hardcoded. Look up TBaseVirtualTree.PrepareBitmaps. This is
the place where the
bitmaps are built. You can change it as you like.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: GDI FAULT

From: "Mike Lischke" [lists@l...]
Date: Wed Nov 28, 2001 8:23 pm
Subject: RE: [VirtualTreeview] GDI FAULT

Hi Justin,

> Putting the canvas lock there won't work because it is not yet assigned,
> rather a little further down...
>
> PaintInfo.Canvas := NodeBitmap.Canvas;
> PaintInfo.Canvas.Lock; < ADD THIS

A canvas will usually not be assigned but built on demand. That means the first
time you access it
(and it is not yet there) then it is created.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net

 | Replies | Author | Date
4833 | Re: GDI FAULT - no more! | Justin Turberville | Thu 11/29/2001
4850 | Re: GDI FAULT - no more! | Mike Lischke | Sun 12/2/2001


re: Bug 76 is still alive

From: "Mike Lischke" [lists@l...]
Date: Wed Nov 28, 2001 8:49 pm
Subject: RE: [VirtualTreeview] Bug 76 is still alive

Hi Paul,

> Sorry I've taken so long to verify the fix for Bug 76. (We just had
> a baby girl week before last!! :) )

What does this mean? Have you got a new child or was it "only" a child on
visit? Anyway, I bet it
was fun ;-)

> I think you're close to the solution, but the check for FUpdateCount >
> 0 in DoSetOffsetXY doesn't help the last EndUpdate, because
> fUpdateCount is 0, and you still don't want to do the scroll drawing.
> (Invalidate will handle the drawing later)

I'm not sure what now causes extra paints. In EndUpdate there is an Invalidate
call which should
finally paint everything. Except for the scrollbar setting there is no further
excecution which
could cause a change to OffsetXY.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net

 | Replies | Author | Date
4827 | Re: Bug 76 is still alive | Paul D'Agosta | Wed 11/28/2001
4845 | Re: Bug 76 is still alive | Mike Lischke | Sat 12/1/2001
4864 | Re: Bug 76 is still alive | Paul D'Agosta | Mon 12/3/2001


re: Bug 76 is still alive

From: "Paul D'Agosta" [pdagosta@c...]
Date: Wed Nov 28, 2001 9:16 pm
Subject: Re: Bug 76 is still alive

--- In [VirtualTreeview@y...], "Mike Lischke" [lists@l...] wrote:
> Have you got a new child or was it "only" a child on visit? Anyway,
I bet it was fun ;-)

I'm sorry for not being clearer. I used to be a parent node with a
ChildCount of 1; now I have a ChildCount of 2 :)

> I'm not sure what now causes extra paints. In EndUpdate there is an
Invalidate call which should
> finally paint everything. Except for the scrollbar setting there is
no further excecution which
> could cause a change to OffsetXY.

The scollbar setting is causing the extra paint when it gets to
ScrollWindow in DoOffsetXY. The paint in the DoOffsetXY is immediate
(before Invalidate is called).

The problem is that there was no scrolling, only a structure change.
So, the DoOffsetXY paints the client area incorrectly and then later
the Invalidate() causes the canvas to be painted correctly.

IMO, while in a Begin/End Update block, I don't think DoOffsetXY()
ever needs to repaint the canvas via the ScrollWindow() call. Just
let Invalidate take care of it.

Thank you,
Paul

 | Replies | Author | Date
4845 | Re: Bug 76 is still alive | Mike Lischke | Sat 12/1/2001
4864 | Re: Bug 76 is still alive | Paul D'Agosta | Mon 12/3/2001


re: HTML aware VirtualStringTree

From: "Helge Jung \(ECO-Logic\)" [helge@e...]
Date: Wed Nov 28, 2001 9:30 pm
Subject: Re: [VirtualTreeview] HTML aware VirtualStringTree

> I assume you mean you want to pass in HTML text and get out the
> same result as with Internet Explorer (in a smaller extent)?
> Well, I guess this another hundreds or thousands of lines for a
> good HTML rendering engine. If there were a windowless rendering
> service (like ITextServices for RTF) then it could be done but
> without this the HTML rendering engine would be larger than the
> entire treeview implementation.

Maybe it would be enough if that "HTML rendering engine" only supports the
<font>, the <b>, <i>, <u> statements? IMO it would be unnecessarily if you
implement something like <table>, <frame>, etc. A small routine which can
handle <font face="..." color="...">, <b>, <u> and <i> shouldn't be that
complicated. Maybe I'll try to implement such a basic html renderer when
I've enough time. I don't see any major problems with these basic tags but
if there are any hidden problems please inform me about them ;-)

Helge.

 | Replies | Author | Date
4846 | Re: HTML aware VirtualStringTree | Mike Lischke | Sat 12/1/2001


re: HTML aware VirtualStringTree

From: "Martijn Brinkers" [martijnbrinkers@p...]
Date: Thu Nov 29, 2001 3:32 am
Subject: Re: [VirtualTreeview] HTML aware VirtualStringTree

I am sorry I was not very clear ... was already too late when I wrote it:).
What I want is some simple HTML rendering. Just color, font perhaps bitmap and
no fancy things as nested tags tables etc. I want to use some
CustumVirtualStringTree descendent and store the HTML in the strings. I somehow
need to change the calculation of the width of a string because I now need to
render them differently and therefore the width is not the same as the text
with the markup. Do you forsee any difficulties with using
TCustumVirtualStringTree as a base for this or should I use TBaseVirtualTree as
the base class?

Thanks,

Martijn Brinkers

----- Original Message -----
From: Mike Lischke
To: VirtualTreeview@yahoogroups.com
Sent: Thursday, November 29, 2001 5:20 AM
Subject: RE: [VirtualTreeview] HTML aware VirtualStringTree

Hi Martijn,

> I would like to have a VirtualStringTree that can display text with HTML
markup (like
> different font, colors etc.). Is there someone who knows if there is some
label component
> which I can use for the HTML part?

I assume you mean you want to pass in HTML text and get out the same result
as with Internet
Explorer (in a smaller extent)? Well, I guess this another hundreds or
thousands of lines for a good
HTML rendering engine. If there were a windowless rendering service (like
ITextServices for RTF)
then it could be done but without this the HTML rendering engine would be
larger than the entire
treeview implementation.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net

Yahoo! Groups Sponsor
ADVERTISEMENT

To unsubscribe from this group, send an email to:
VirtualTreeview-unsubscribe@egroups.com

Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.

[Non-text portions of this message have been removed]

 | Replies | Author | Date
4847 | Re: HTML aware VirtualStringTree | Mike Lischke | Sat 12/1/2001


re: HTML aware VirtualStringTree

From: "Martijn Brinkers" [martijnbrinkers@p...]
Date: Thu Nov 29, 2001 3:38 am
Subject: Re: [VirtualTreeview] HTML aware VirtualStringTree

Yes you are right (I was not very clear). I just want some simple rendering
like for instance Imca's RapidTree.

Martijn

----- Original Message -----
From: Helge Jung (ECO-Logic)
To: VirtualTreeview@yahoogroups.com
Sent: Thursday, November 29, 2001 6:30 AM
Subject: Re: [VirtualTreeview] HTML aware VirtualStringTree

Maybe it would be enough if that "HTML rendering engine" only supports the
<font>, the <b>, <i>, <u> statements? IMO it would be unnecessarily if you
implement something like <table>, <frame>, etc. A small routine which can
handle <font face="..." color="...">, <b>, <u> and <i> shouldn't be that
complicated. Maybe I'll try to implement such a basic html renderer when
I've enough time. I don't see any major problems with these basic tags but
if there are any hidden problems please inform me about them ;-)

Helge.

Yahoo! Groups Sponsor
ADVERTISEMENT

To unsubscribe from this group, send an email to:
VirtualTreeview-unsubscribe@egroups.com

Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.

[Non-text portions of this message have been removed]


Improved Exception handling

From: "Peter Evans" [pgevans@m...]
Date: Thu Nov 29, 2001 3:35 am
Subject: Improved Exception handling

Subject - Improved Exception handling

In VST version 2.6.5 there is an exception handler EVirtualTreeError. (see
unit VirtualTrees). It is called by the procedure ShowError.

Currently, there are a number of different ways to handle exceptions when
you use VST in a program ::-

1) do not bother about exceptions
2) Code
...
EXCEPT
ShowMessage('Got exception');
END;
{You do not see the message generated by ShowError. You do not see any other
exceptions from say Third Party tools}
3) Code
...
EXCEPT
ON E: Exception DO BEGIN
ShowMessage(E.Message);
END;
END;
{You see the message generated by ShowError. You see messages from say Third
Party tools}
4) Log all messages
5) Put message to TStatusBar.

Of course there are other combinations.

What are the disadvantages?
1) All exceptions are together and can not be separated.
2) Not possible to decide on basis of message what action to take. Some
messages you want to Log, some want to TStatusBar etc.
At the moment you have to Parse all messages, and look for particular VST
ones. If the text changes from release to release you are stuffed.
3) Not possible to do Hints.
4) Not good for translation into non English. (Yes, I know about
ResourceStrings)
5) If the message is spelt incorrectly than you need to parse to correct it.
Example : SStreamToSmall.
"Unabled ....." ==> "Unable ....". Aside the constant should read
"SStreamTooSmall".

A better way.
1) move EVirtualTreeError from Implementation to Interface.
Now you can code
...
EXCEPT
ON E: EVirtualTreeError DO BEGIN
...
END;
ON E: EThirdPartyTool DO BEGIN
...
END;
ON E: Exception DO BEGIN
{all other errors}
...
END;

2) Prefix all ResourceString with "VST". Keep them in Implementation.
Eg. for SEditLinkIsNil = 'Edit link must not be nil.'; ==>
SEditLinkIsNil = 'VST: Edit link must not be nil.';
People can still use popular way to change languages using ResourceString.
The programmer can strip out "VST:" if you want.

3) Provide Hint strings in Interface
code
CONST
hcTFUnexpected = 2000;

4) Use call to FmtHelp when raise errors.
Eg. code

procedure TGpTextFile.Append(flags: TCreateFlags; bufferSize: integer;
codePage: word);
begin
if AppendSafe(flags,bufferSize,0,0,0,codePage) <> hfOK then
raise
EGpTextFile.CreateFmtHelp(sFailedToAppendFile,[FileName],hcTFFailedToAppend)
;
end;

It is now possible to determine exactly what error has occurred in what
Third Party tool. It is now possible to use popular ResourceString ways to
get non English. It is now possible to use better ways to handle errors and
translate them into non English. It is now possible to take appropriate
action viz logging on the basis of the message.

These are the suggested Hints. Just copy and paste them.

=============================
CONST
hcTFEditLinkIsNil = 2000;
hcTFWrongMoveError = 2001;
hcTFWrongStreamFormat = 2002;
hcTFWrongStreamVersion = 2003;
hcTFStreamTooSmall = 2004;
hcTFCorruptStream1 = 2005;
hcTFCorruptStream2 = 2006;
hcTFClipboardFailed = 2007;
hcTFCannotSetUserData = 2008;
============================

Regards, Peter Evans

 | Replies | Author | Date
4832 | Re: Improved Exception handling | Helge Jung (ECO-Logic) | Thu 11/29/2001
4849 | Re: Improved Exception handling | Mike Lischke | Sun 12/2/2001
4848 | Re: Improved Exception handling | Mike Lischke | Sat 12/1/2001
4858 | Re: Improved Exception handling | Peter Evans | Sun 12/2/2001


re: Improved Exception handling

From: "Helge Jung \(ECO-Logic\)" [helge@e...]
Date: Thu Nov 29, 2001 6:13 am
Subject: Re: [VirtualTreeview] Improved Exception handling

> What are the disadvantages?
> 1) All exceptions are together and can not be separated.
> 2) Not possible to decide on basis of message what action to take. Some
> messages you want to Log, some want to TStatusBar etc.
> At the moment you have to Parse all messages, and look for
> particular VST
> ones. If the text changes from release to release you are stuffed.
> 3) Not possible to do Hints.

And what is about a tiny event OnVTError which is triggered by e.g.
"procedure TBaseVirtualTree.RaiseVTError (Module, Introtext, ExceptionClass,
ExceptionText: widestring);" ?

Explanation:
Module - i thought about the name of the procedure in which the error
occurs -> Module-text is always hardcoded
Introtext - some basic text for the end-user (e.g. "The following has
occured while doing stuff:")
ExceptionClass - E.ClassName
ExceptionText - E.Msg

The Introtext can be done by constants, ressource strings or whatever you
like - it's just a thought.

In the VT's OnVTError event you give all the above strings and the
programmer can say e.g. display it as a hint, put it in the statusbar or
abort the whole program - then it's the programmer's choice.

Because I don't know much of translation I bet someone out there has
a(nother) fantastic idea.

Helge.

 | Replies | Author | Date
4849 | Re: Improved Exception handling | Mike Lischke | Sun 12/2/2001


re: GDI FAULT - no more!

From: "Justin Turberville" [justin@d...]
Date: Thu Nov 29, 2001 7:12 am
Subject: RE: [VirtualTreeview] GDI FAULT - no more!

Mike

> A canvas will usually not be assigned but built on demand. That means the
first time you access it
> (and it is not yet there) then it is created.

I did get an access violation on lock before the assignment.

The good news is that I could'nt get any faults in the program afterwards,
so it definately seems to have been the solution - congratulations!
I'm sure you will be glad to have that issue over with.

regards
Justin

 | Replies | Author | Date
4850 | Re: GDI FAULT - no more! | Mike Lischke | Sun 12/2/2001


double click to start editing

From: "Martijn Brinkers" [martijnbrinkers@p...]
Date: Thu Nov 29, 2001 8:05 am
Subject: double click to start editing

If I double click on a node I want to start editing the node. I have tried
the following:

procedure TForm1.VirtualStringTree1DblClick(Sender: TObject);
var
node : PVirtualNode;
column : TColumnIndex;
begin
node := VirtualStringTree1.FocusedNode;
column := VirtualStringTree1.FocusedColumn;
if node <> nil then
begin
VirtualStringTree1.EditNode(node, column);
end;
end;

But is pops-up the editor briefly and then closes it immediately. Can
someone tell me how I canget dbl click edit to work?

Thanks,

Martijn Brinkers

 | Replies | Author | Date
4835 | Re: double click to start editing | Martijn Brinkers | Thu 11/29/2001
4851 | Re: double click to start editing | Mike Lischke | Sun 12/2/2001


re: double click to start editing

From: "Martijn Brinkers" [martijnbrinkers@p...]
Date: Thu Nov 29, 2001 8:22 am
Subject: Re: [VirtualTreeview] double click to start editing

I see that default behaviour of

procedure TBaseVirtualTree.HandleMouseDblClick(var Message: TWMMouse; const
HitInfo: THitInfo);

is that it stops Editing because of

if not (tsEditing in FStates) or DoEndEdit then

is this intended? caus it makes dbl-clk editing impossible (I think)

Martijn Brinkers

----- Original Message -----
From: Martijn Brinkers
To: virtualTreeview@yahoogroups.com
Sent: Thursday, November 29, 2001 5:05 PM
Subject: [VirtualTreeview] double click to start editing

If I double click on a node I want to start editing the node. I have tried
the following:

procedure TForm1.VirtualStringTree1DblClick(Sender: TObject);
var
node : PVirtualNode;
column : TColumnIndex;
begin
node := VirtualStringTree1.FocusedNode;
column := VirtualStringTree1.FocusedColumn;
if node <> nil then
begin
VirtualStringTree1.EditNode(node, column);
end;
end;

But is pops-up the editor briefly and then closes it immediately. Can
someone tell me how I canget dbl click edit to work?

Thanks,

Martijn Brinkers

Yahoo! Groups Sponsor
ADVERTISEMENT

To unsubscribe from this group, send an email to:
VirtualTreeview-unsubscribe@egroups.com

Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.

[Non-text portions of this message have been removed]

 | Replies | Author | Date
4851 | Re: double click to start editing | Mike Lischke | Sun 12/2/2001


How to display two images

From: "Jacco" [Jacco@j...]
Date: Thu Nov 29, 2001 12:55 pm
Subject: [VirtualTreeview] How to display two images

I want to display an extra image on the right side of the standard image of
some nodes.

How can I accomplish this?

Thanks,

Jacco Bezemer

[Non-text portions of this message have been removed]

 | Replies | Author | Date
4838 | Re: How to display two images | Jim Kueneman | Fri 11/30/2001


Bug 83 description

From: "Paul D'Agosta" [pdagosta@c...]
Date: Thu Nov 29, 2001 9:26 pm
Subject: Bug 83 description

A simple demo app description for Bug 83:
1) Add a VST to a form
2) Set RootNodeCount to some number (1000)
3) Add a Button to the form with an accelerator (ex Alt-M)
4) Add the following OnClickEvent for the Button:
procedure TForm1.Button1Click(Sender: TObject);
var
newparent :PVirtualNode;
begin
with VST1 do
begin
if Assigned(FocusedNode) then
begin
newparent := GetPrevious(FocusedNode);
if Assigned(newparent) then
begin
MoveTo(FocusedNode,newparent,amAddChildLast,false);
Expanded[newParent] := true;
end;
end;
end;
end;
5) Run the app
6) Select the second node
7) Hit the button's accelerator key (Alt-M)
8) Push the Down Arrow

It now appears that there are 2 nodes selected.

The problem arises in MoveTo, when InternalDisconnectNode sets
FocusedNode to nil.
Ideally IMO, MoveTo would check if the Node being moved is the
FocusedNode at the beginning and reset it as the focused node at the
end.

Thank you,
Paul

 | Replies | Author | Date
4852 | Re: Bug 83 description | Mike Lischke | Sun 12/2/2001
4868 | Re: Bug 83 description | Paul D'Agosta | Mon 12/3/2001
4889 | Re: Bug 83 description | Mike Lischke | Sat 12/8/2001
4907 | Re: Bug 83 description | padagosta | Mon 12/10/2001


re: How to display two images

From: Jim Kueneman [jimdk@m...]
Date: Fri Nov 30, 2001 1:25 am
Subject: Re: [VirtualTreeview] How to display two images

At 01:55 PM 11/29/2001 +0100, you wrote:
>I want to display an extra image on the right side of the standard image
>of some nodes.
>
>How can I accomplish this?

A couple ideas both untested.

1) Define the node in an image list and assign it to customcheck images
property. Now in OnInitNode assign those nodes to have checkboxes. I am
not sure of the full impact of doing that.

2) Draw the node yourself using the custom drawing events.. Maybe you can
declare the first standard image to be wide enough for both but have the
standard image only cover the first half of the area and the other half
blank. This way VT can handle the text drawing and the drawing of the
standard image and still leave enough room for the new image that you can
draw in the custom event. This means that node without the second image
will have a big blank spot though.

Jim


Static Text Disabled Color: Bug or intention?

From: Ralf Junker [ralfjunker@g...]
Date: Fri Nov 30, 2001 12:35 am
Subject: Static Text Disabled Color: Bug or intention?

Hi Mike, Hi Group,

I noticed that VirtualStringTree does not change the static text color to
disabled when a node is disabled, whereas the normal text color does change. It
turns out that the two texts have two (different) colors when disabled and only
one color when enabled.

Is this behaviour intended or did I spot a small bug?

The former can be handled in the OnPaintNode event, the latter can easily be
fixed by copying

// Disabled node color overrides all other variants.
if (vsDisabled in Node.States) or not Enabled then
Canvas.Font.Color := FColors.DisabledColor;

from PaintNormalText to PaintStaticText.

Greetings,

Ralf

 | Replies | Author | Date
4853 | Re: Static Text Disabled Color: Bug or intention? | Mike Lischke | Sun 12/2/2001


re: How to display two images

From: Werner Lehmann [wl@b...]
Date: Fri Nov 30, 2001 8:34 am
Subject: Re: [VirtualTreeview] How to display two images

Jim Kueneman wrote:
>
> 1) Define the node in an image list and assign it to customcheck images
> property. Now in OnInitNode assign those nodes to have checkboxes. I am
> not sure of the full impact of doing that.
>
> 2) Draw the node yourself using the custom drawing events.. Maybe you can
> declare the first standard image to be wide enough for both but have the
> standard image only cover the first half of the area and the other half
> blank. This way VT can handle the text drawing and the drawing of the
> standard image and still leave enough room for the new image that you can
> draw in the custom event. This means that node without the second image
> will have a big blank spot though.

3) Use StateImages and either live with the second image *left* to the normal
image or misuse state images as normal images and vice versa. Note, that (AFAIK)
state images do not support overlay or different selected images.

Werner

 | Replies | Author | Date
4841 | GetNodeAt | Justin Turberville | Fri 11/30/2001
4854 | Re: GetNodeAt | Mike Lischke | Sun 12/2/2001
4871 | Check boxes | Justin Turberville | Tue 12/4/2001


GetNodeAt

From: "Justin Turberville" [justin@d...]
Date: Fri Nov 30, 2001 3:10 pm
Subject: GetNodeAt

Mike

That new var parameter in VT v2.6.11's GetNodeAt is a real pain in the arse.
Could you not overload it or have a seperate GetNodeAtEx for those who
require it?

Justin

 | Replies | Author | Date
4854 | Re: GetNodeAt | Mike Lischke | Sun 12/2/2001


re: GetNodeAt

From: Werner Lehmann [wl@b...]
Date: Fri Nov 30, 2001 4:49 pm
Subject: Re: [VirtualTreeview] GetNodeAt

Justin Turberville wrote:
>
> Mike
>
> That new var parameter in VT v2.6.11's GetNodeAt is a real pain in the arse.
> Could you not overload it or have a seperate GetNodeAtEx for those who
> require it?

I wouldn't have used exactly these words :) - but it's true, until now I had to
declare a local dummy var every time...

Werner


full version software and games

From: [chopman8080@y...]
Date: Sat Dec 1, 2001 8:05 pm
Subject: full version software and games

Hi All:

I got almost all software and computer games as well as
ebooks/etutorial for IT certification study.
You can go to httP://uk.briefcase.yahoo.com/chopman8080 to download a
guide about all stuff I got.
Cheers
David

 | Replies | Author | Date
4844 | Re: full version software and games | Mike Lischke | Sat 12/1/2001


re: full version software and games

From: "Mike Lischke" [lists@l...]
Date: Sat Dec 1, 2001 8:39 pm
Subject: RE: [VirtualTreeview] full version software and games

> I got almost all software and computer games as well as
> ebooks/etutorial for IT certification study.

Those guys will never die out, I'm afraid. Removed from the list.


re: Re: Bug 76 is still alive

From: "Mike Lischke" [lists@l...]
Date: Sat Dec 1, 2001 9:13 pm
Subject: RE: [VirtualTreeview] Re: Bug 76 is still alive

> IMO, while in a Begin/End Update block, I don't think DoOffsetXY()
> ever needs to repaint the canvas via the ScrollWindow() call. Just
> let Invalidate take care of it.

I just reviewed this again and found that the SetUpdateState lock setting is
too early taken back.
Try moving it to just before the

if HandleAllocated then
Invalidate;

command in Tree.EndUpdate.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net

 | Replies | Author | Date
4864 | Re: Bug 76 is still alive | Paul D'Agosta | Mon 12/3/2001


re: HTML aware VirtualStringTree

From: "Mike Lischke" [lists@l...]
Date: Sat Dec 1, 2001 9:18 pm
Subject: RE: [VirtualTreeview] HTML aware VirtualStringTree

> Maybe it would be enough if that "HTML rendering engine" only supports the
> <font>, the <b>, <i>, <u> statements? IMO it would be unnecessarily if you
> implement something like <table>, <frame>, etc. A small routine which can
> handle <font face="..." color="...">, <b>, <u> and <i> shouldn't be that
> complicated.

The rendering is perhaps not that difficult but the size calculation is. For
display, hints etc. I'd
need a method which does a very quick, but still accurate size calculation. A
lot of things would
then be possible with text.

>Maybe I'll try to implement such a basic html renderer when
> I've enough time. I don't see any major problems with these basic tags but
> if there are any hidden problems please inform me about them ;-)

Please go ahead and try it. But before you send me your copy please make sure
it works in all cases
(editing, alignment, bidi modes, shortened text, custom drawing etc.).

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: HTML aware VirtualStringTree

From: "Mike Lischke" [lists@l...]
Date: Sat Dec 1, 2001 9:21 pm
Subject: RE: [VirtualTreeview] HTML aware VirtualStringTree

Martijn,

> Do you forsee any difficulties with using
> TCustumVirtualStringTree as a base for this or should I use TBaseVirtualTree
as the base class?

I would be quite happy if you could come up with a very quick but yet flexible
way to calculate node
sizes (particularly with regard to html rendering). TCustomVirtualStringTree is
a good starting
point you just have to override CalculateTextWidth. I have just made it virtual
so you can do that.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: Improved Exception handling

From: "Mike Lischke" [lists@l...]
Date: Sat Dec 1, 2001 9:42 pm
Subject: RE: [VirtualTreeview] Improved Exception handling

Hi Peter,

> Subject - Improved Exception handling

You made a good argumentation which convinced me to do most of the changes you
suggested.

> 1) move EVirtualTreeError from Implementation to Interface.

Done.

> 2) Prefix all ResourceString with "VST". Keep them in Implementation.

Rejected. It is already quite bad that sometimes end users get english error
messages in, say,
german products. I don't want to make them even more cryptic. The origin of the
error can be seen
from the exception class if somebody is interested. In code you can use on
Exception do

> 3) Provide Hint strings in Interface

Done.

> 4) Use call to FmtHelp when raise errors.

Done.

> These are the suggested Hints. Just copy and paste them.

I assume you have already compared those values with other components, so there
is no conflict.
Hence I see no reason why not to use your identifiers and numbers.

Thank you,

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: Improved Exception handling

From: "Mike Lischke" [lists@l...]
Date: Sun Dec 2, 2001 9:11 am
Subject: RE: [VirtualTreeview] Improved Exception handling

Hi Helge,

> And what is about a tiny event OnVTError which is triggered by e.g.
> "procedure TBaseVirtualTree.RaiseVTError (Module, Introtext, ExceptionClass,
> ExceptionText: widestring);" ?

Mmh, I don't see any advantage over normal exception handling. The entire
meaning of structured
exception handling is to interrupt execution of the erronous code path and
display an error message.
If you only put that into a statusbar then you don't need exceptions, just
messages (btw: you can
modify the app's behavior in this regard by using Application.OnException).

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: GDI FAULT - no more!

From: "Mike Lischke" [lists@l...]
Date: Sun Dec 2, 2001 9:26 am
Subject: RE: [VirtualTreeview] GDI FAULT - no more!

Hi Justin,

> I did get an access violation on lock before the assignment.

Ok, I have moved the assignment just before the lock.

> The good news is that I could'nt get any faults in the program afterwards,
> so it definately seems to have been the solution - congratulations!
> I'm sure you will be glad to have that issue over with.

Indeed! This is good news. I also have included another change in the source. I
vaguely remember
that Win9x/Me does not really support ILC_COLOR32 in image lists (although I
can't say where I got
this knowledge from and MSDN does also not mention any obvious limitation).
Anyway, since it makes
only sense on Windows XP I have included a switch for Win9x/Me. Changing to
ILC_COLOR32 was one of
the latest modifications after which you got your problems.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: double click to start editing

From: "Mike Lischke" [lists@l...]
Date: Sun Dec 2, 2001 9:34 am
Subject: RE: [VirtualTreeview] double click to start editing

Hi Martijn,

> procedure TBaseVirtualTree.HandleMouseDblClick(var Message: TWMMouse; const
HitInfo: THitInfo);
> is that it stops Editing because of
> if not (tsEditing in FStates) or DoEndEdit then
> is this intended? caus it makes dbl-clk editing impossible (I think)

Yes this is intented. VT ought to behave like other standard controls which
includes also how the
edit mode is entered. There is usually a lot of housekeeping to do and many
things in user input
handling have evolved over time to be necessary. Hence I wouldn't change this
just so.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: Bug 83 description

From: "Mike Lischke" [lists@l...]
Date: Sun Dec 2, 2001 12:29 pm
Subject: RE: [VirtualTreeview] Bug 83 description

Hi Paul,

> A simple demo app description for Bug 83:

Thank you for this description. It helped me to quickly find the problem. This
is fixed now.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net

 | Replies | Author | Date
4868 | Re: Bug 83 description | Paul D'Agosta | Mon 12/3/2001
4889 | Re: Bug 83 description | Mike Lischke | Sat 12/8/2001
4907 | Re: Bug 83 description | padagosta | Mon 12/10/2001


re: Static Text Disabled Color: Bug or intention?

From: "Mike Lischke" [lists@l...]
Date: Sun Dec 2, 2001 12:37 pm
Subject: RE: [VirtualTreeview] Static Text Disabled Color: Bug or intention?

Hi Ralf,

> I noticed that VirtualStringTree does not change the static text color to
disabled when a
> node is disabled, whereas the normal text color does change. It turns out
that the two
> texts have two (different) colors when disabled and only one color when
enabled.

Good point. This one is also fixed now.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: GetNodeAt

From: "Mike Lischke" [lists@l...]
Date: Sun Dec 2, 2001 12:38 pm
Subject: RE: [VirtualTreeview] GetNodeAt

> That new var parameter in VT v2.6.11's GetNodeAt is a real pain in the arse.
> Could you not overload it or have a seperate GetNodeAtEx for those who
> require it?

Overloaded variant now.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


VT update

From: "Mike Lischke" [lists@l...]
Date: Sun Dec 2, 2001 2:21 pm
Subject: VT update

Hi all,

I just have uploaded the new build of Virtual Treeview to
www.lischke-online.de/VirtualTreeview/beta/VirtualTree_2.7.3.zip. It contains
all lately mentioned bug fixes as well as some other improvements.

Werner, could you please send me what you have written for the help file?

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net

 | Replies | Author | Date
4865 | Re: VT update | Ralf Junker | Mon 12/3/2001
4887 | Re: VT update | Mike Lischke | Sat 12/8/2001
4866 | Re: VT update | Vandrovec Milan | Mon 12/3/2001
4867 | Node alignment | Justin Turberville | Mon 12/3/2001
4888 | Re: Node alignment | Mike Lischke | Sat 12/8/2001
4873 | Re: VT update | Ralf Junker | Tue 12/4/2001


Bug #80

From: "Anders Thomsen" [anders@t...]
Date: Sun Dec 2, 2001 3:57 pm
Subject: Bug #80

Hi Mike,

How come bug #80 is by design?
It's not pretty : )

-Thomsen

----- Original Message -----
From: Mike Lischke
To: Virtual Treeview mailing list
Sent: Sunday, December 02, 2001 3:21 PM
Subject: [VirtualTreeview] VT update

Hi all,

I just have uploaded the new build of Virtual Treeview to
www.lischke-online.de/VirtualTreeview/beta/VirtualTree_2.7.3.zip. It contains
all lately mentioned bug fixes as well as some other improvements.

Werner, could you please send me what you have written for the help file?

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net

Yahoo! Groups Sponsor
ADVERTISEMENT

To unsubscribe from this group, send an email to:
VirtualTreeview-unsubscribe@egroups.com

Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.

[Non-text portions of this message have been removed]

 | Replies | Author | Date
4857 | Re: Bug #80 | Mike Lischke | Sun 12/2/2001
4958 | Bug #80 | Anders Thomsen | Sun 12/16/2001
4959 | Re: Bug #80 | Mike Lischke | Sun 12/16/2001
4960 | Re: Bug #80 | jimkueneman | Sun 12/16/2001
4961 | Re: Bug #80 | Vandrovec Milan | Mon 12/17/2001
4963 | Re: Bug #80 | Anders Thomsen | Mon 12/17/2001


re: Bug #80

From: "Mike Lischke" [lists@l...]
Date: Sun Dec 2, 2001 5:51 pm
Subject: RE: [VirtualTreeview] Bug #80

> How come bug #80 is by design?

I think the description refers to the height of the background fill area in
full row selection mode.
It is one pixel less than the entire node height. The reason is that I think it
is the lesser of two
devils. If I make it the same height then it looks (e.g. with certain color
schemes) as would it be
too large since the dotted grid lines are very light.

The problem disappears entirely if no horizontal grid lines are shown.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: Improved Exception handling

From: "Peter Evans" [pgevans@m...]
Date: Sun Dec 2, 2001 10:35 pm
Subject: Re: [VirtualTreeview] Improved Exception handling

Mike,

> > 1) move EVirtualTreeError from Implementation to Interface.
>
> Done.

Excellent. This is the most important step.

>
> > 2) Prefix all ResourceString with "VST". Keep them in Implementation.
>
> Rejected. It is already quite bad that sometimes end users get english
error messages in, say,
> german products. I don't want to make them even more cryptic. The origin
of the error can be seen
> from the exception class if somebody is interested. In code you can use on
Exception do

OK.

>
> > 3) Provide Hint strings in Interface
>
> Done.

Excellent.

>
> > 4) Use call to FmtHelp when raise errors.
>
> Done.

Looking again at 'VirtualTrees.pas' in section ResourceStrings. I now see
that there is no "%s" characters in the strings. So it should only be
necessary to call like ::-

raise EVirtualTreeError.CreateHelp(sEditLinkIsNil, hcTFEditLinkIsNil);

So to change ShowError it becomes ::-

procedure ShowError(Msg : WideString; HelpContext : Integer);

begin
raise EVirtualTreeError.CreateHelp(Msg, HelpContext);
end;

>
> > These are the suggested Hints. Just copy and paste them.
>
> I assume you have already compared those values with other components, so
there is no conflict.
> Hence I see no reason why not to use your identifiers and numbers.
>

I am open to suggestion here. Better to put string "VT" in value. Perhaps
renumber them 1000, 1001...
This is the result.

=============================
CONST
hcVTEditLinkIsNil = 1000;
hcVTWrongMoveError = 1001;
hcVTWrongStreamFormat = 1002;
hcVTWrongStreamVersion = 1003;
hcVTStreamTooSmall = 1004;
hcVTCorruptStream1 = 1005;
hcVTCorruptStream2 = 1006;
hcVTClipboardFailed = 1007;
hcVTCannotSetUserData = 1008;
============================

These changes will make 'VirtualTrees' a very good tool with excellent error
handling.

Regards, Peter Evans


Blended images and Ghosted

From: GIANNAKOPOULOS KOSTAS [kyan@s...]
Date: Mon Dec 3, 2001 9:49 am
Subject: Blended images and Ghosted

Good morning everyone

I have noticed than when you do not specify toUseBlendedImages in
PaintOptions then the "Ghosted" parameter in OnGetImageIndex has no effect.
Is this intentional? I thought that toUseBlendedImages affects only
selection image blending, why should it affect ghosting as well since it is
explicitly controlled by the "Ghosted" parameter?
My argument is that selection blending is purely aesthetic (for instance you
turn it off if you want VT to look like a TreeView and on for it to look
like a ListView) whereas the "Ghosted" effect has a special meaning, it is
commonly used to indicate that a node is somehow "hidden".

Also, Mike, could you please add an "A" or something else to the names of
event handler parameters that may conflict with common property names (such
as "Text" to "AText", "Index" to "AIndex" or "AnIndex" etc.). The reason is
that they may cause ambiguities especially if the "with" keyword is used.
This change will not break existing code, it will only affect newly added
event handlers.
I know Borland does the same (or at least used to do it) but i consider it
wrong practice, since it can cause silly but very hard to track bugs.

Thank you.

<KY>

 | Replies | Author | Date
4861 | Re: Blended images and Ghosted | Werner Lehmann | Mon 12/3/2001
4862 | Re: Blended images and Ghosted | Illya Kysil | Mon 12/3/2001
4863 | Re: Blended images and Ghosted | GIANNAKOPOULOS KOSTAS | Mon 12/3/2001
4869 | Re: Blended images and Ghosted | Werner Lehmann | Mon 12/3/2001
4870 | Re: Blended images and Ghosted | Werner Lehmann | Mon 12/3/2001
4874 | Re: Blended images and Ghosted | GIANNAKOPOULOS KOSTAS | Tue 12/4/2001
4886 | Re: Blended images and Ghosted | Mike Lischke | Sat 12/8/2001
4906 | Re: Blended images and Ghosted | GIANNAKOPOULOS KOSTAS | Mon 12/10/2001


How to have combo box in the tree

From: "Punch ML" [punch_ml@i...]
Date: Mon Dec 3, 2001 10:33 am
Subject: How to have combo box in the tree

Hi,

How can have combo box in the treeview for selecting different options,
The example does not work with the VirtualTreeview version 2.6.5

Have you some simply demos...

Thanks...Thierry


re: Blended images and Ghosted

From: Werner Lehmann [wl@b...]
Date: Mon Dec 3, 2001 10:43 am
Subject: Re: [VirtualTreeview] Blended images and Ghosted

GIANNAKOPOULOS KOSTAS wrote:
>
> Also, Mike, could you please add an "A" or something else to the names of
> event handler parameters that may conflict with common property names (such
> as "Text" to "AText", "Index" to "AIndex" or "AnIndex" etc.). The reason is
> that they may cause ambiguities especially if the "with" keyword is used.
> This change will not break existing code, it will only affect newly added
> event handlers.
> I know Borland does the same (or at least used to do it) but i consider it
> wrong practice, since it can cause silly but very hard to track bugs.

Just wanted to add my 2 cents to this topic. IMO the AParameters *look* very
bad. Can't stress this enough. Borland does not use this most of the time.
Some rare exceptions can be found though. Also, I don't remember that this is
mentioned in the OPAL style guide from Borland.

I have to prefix parameters at my company with the 'A' which is bad enough
(and put each parameter on a single line, and possibly even prefix local
variables
with a L in the future, among others), hence I know what I am speaking of.

The 'with' ambiguity exists, true. But we are using a developer tool, not an
end user tool. This requires some, uhm, professionality. A-prefixing is not
known for other languages like C C++ C# as far as I know. You can always add
the 'A' to some params in your existing event handlers without problems. On
a case by case basis...

Regards,
Werner


re: Blended images and Ghosted

From: "Illya Kysil" [ikysil@m...]
Date: Mon Dec 3, 2001 11:45 am
Subject: Re: [VirtualTreeview] Blended images and Ghosted

Werner Lehmann wrote:
> The 'with' ambiguity exists, true. But we are using a developer tool, not an
> end user tool. This requires some, uhm, professionality. A-prefixing is not
> known for other languages like C C++ C# as far as I know.
MY 2 cents ;) are following.
Yes, C++/C#/Java don't use A-prefixing.
But they have other facilities to bypass such ambiguity.
Lets assume a class definition:

class test{

int value;

void func( int value ){
this.value = value;
}

...

}

In line 'this.value = value;' we have: 'this.value' is referencing to an
instance variable
while 'value' is referencing to a parameter.

In Delphi 'Self.Value:= Value;' BOTH sides will reference to the same INSTANCE
VARIABLE.

Regards
Illya Kysil, software developer
Delphi/C/C++/Java/Forth/Assembler
If it is NOT SOURCE, it is NOT SOFTWARE. (C) NASA


re: Blended images and Ghosted

From: GIANNAKOPOULOS KOSTAS [kyan@s...]
Date: Mon Dec 3, 2001 12:17 pm
Subject: RE: [VirtualTreeview] Blended images and Ghosted

Werner,

> Just wanted to add my 2 cents to this topic. IMO the
> AParameters *look* very
> bad. Can't stress this enough. Borland does not use this most
> of the time.
> Some rare exceptions can be found though. Also, I don't
> remember that this is
> mentioned in the OPAL style guide from Borland.
>
> I have to prefix parameters at my company with the 'A' which
> is bad enough
> (and put each parameter on a single line, and possibly even
> prefix local variables
> with a L in the future, among others), hence I know what I am
> speaking of.

I'm as much a standards freak as you are, e.g. i use "S" as a name for most
of my local string variables.
I didn't want to force any "coding standards" to Mike's code, for crying out
loud!!! I just asked him a favour.

I did not imply that ALL parameters should be prefixed with "A", just that
those that can cause ambiguities could be renamed. If Mike does not like the
"A" convention he can just rename then completely, for instance "NodeText"
instead of "Text".

> The 'with' ambiguity exists, true. But we are using a
> developer tool, not an
> end user tool. This requires some, uhm, professionality.

Yes, but most of us would like to spend our brain cells solving problems
instead of watching out for landmines. I've found myself spending hours
trying to find bugs caused by a name conflict that just sat there and
laughed at my face and i think quite high of my "professionality"...
Programming is not easy as it is, so we should try not to make it any more
difficult.

> You can always add
> the 'A' to some params in your existing event handlers
> without problems. On
> a case by case basis...

Sure, i have done it many times, but the point is NOT having to think all
the time if an event handler you've just added may cause you conflicts. The
component writer (Mike in our case) will have to think about it only once
when a new event handler is introduced, while the user (me) will have to do
it all the time.

<KY>


re: Bug 76 is still alive

From: "Paul D'Agosta" [pdagosta@c...]
Date: Mon Dec 3, 2001 1:03 pm
Subject: Re: Bug 76 is still alive

> I just reviewed this again and found that the SetUpdateState lock
setting is too early taken back.
> Try moving it to just before the
>
> if HandleAllocated then
> Invalidate;
>
> command in Tree.EndUpdate.

That works!

Thank you!


re: VT update

From: Ralf Junker [ralfjunker@g...]
Date: Mon Dec 3, 2001 1:30 pm
Subject: Re: [VirtualTreeview] VT update

Hi Mike,

>I just have uploaded the new build of Virtual Treeview to
www.lischke-online.de/VirtualTreeview/beta/VirtualTree_2.7.3.zip. It contains
all lately mentioned bug fixes as well as some other improvements.

There are some new D4 compatability issues with this release:

VirtualTreesReg.pas:

Unit ColnEdit.pas is unknown to D4

ShowCollectionEditor is also unknown to D4

VirtualTrees.pas:

Function Supports (line 5004) is not available in D4. Maybe conditionally
substitute with Source taken from D5?

Greeting,

-- Ralf

 | Replies | Author | Date
4887 | Re: VT update | Mike Lischke | Sat 12/8/2001


re: VT update

From: Vandrovec Milan [milan_va@s...]
Date: Mon Dec 3, 2001 2:04 pm
Subject: RE: [VirtualTreeview] VT update

Hi.

> There are some new D4 compatability issues with this release:
>
> VirtualTreesReg.pas:
>
> Unit ColnEdit.pas is unknown to D4
>
> ShowCollectionEditor is also unknown to D4

It's interesting it did work up to now, I cannot see any changes of it,
although the VirtualTreesReg has changed. Are you sure it worked in 2.6.11?
Also, could you try to add a line similar to
-LU"dclstd40"
at the end of both VirtualTreesD4*.cfg ? I don't know if it can help, but is
worth a try. You can also try full path to $(delphi)\lib\dclstd40.dcp there.

> VirtualTrees.pas:
>
> Function Supports (line 5004) is not available in D4. Maybe
> conditionally substitute with Source taken from D5?

It is defined in SysUtils as

function Supports(const Instance: IUnknown; const Intf: TGUID; out Inst):
Boolean;
begin
Result := (Instance <> nil) and (Instance.QueryInterface(Intf, Inst) = 0);
end;

 | Replies | Author | Date
4867 | Node alignment | Justin Turberville | Mon 12/3/2001
4888 | Re: Node alignment | Mike Lischke | Sat 12/8/2001
4873 | Re: VT update | Ralf Junker | Tue 12/4/2001


Node alignment

From: "Justin Turberville" [justin@d...]
Date: Mon Dec 3, 2001 2:57 pm
Subject: Node alignment

I've noticed that in v2.6.11, if scrolled down a bit, the bottommost visible
node is aligned to the bottom and only part of the topmost visible node is
shown instead of the other way round as one would expect.
Is there a property that reverses this behaviour?
NodeAlignment does'nt seem to do anything & the description of its
functionality is <erm> "murky":

// Determines how to use the align member of a node.
TVTNodeAlignment = (
naFromBottom, // the align member specifies amount of units
(usually pixels) from top border of the node
naFromTop, // align is to be measured from bottom
naProportional // align is to be measure in percent of the
entire node height and relative to top
);

 | Replies | Author | Date
4888 | Re: Node alignment | Mike Lischke | Sat 12/8/2001


re: Bug 83 description

From: "Paul D'Agosta" [pdagosta@c...]
Date: Mon Dec 3, 2001 3:50 pm
Subject: Re: Bug 83 description

Mike,

> Thank you for this description. It helped me to quickly find the
problem. This is fixed now.

There is no longer 2 selected nodes, but the functionality seems
awkward.
Using the same demo app:
After I move the row, it appears to still be the focused node.
When I immediately afterwards use the arrow keys, either the first or
last node becomes focused. This leads me to believe that even though
the display showed a focused node, there really wasn't any.

If I am on a row and the row is moved somewhere else, I would expect
that it would still be selected/focused, and when I use the arrow keys
the selection change would be relative to the current row.

I hope this makes sense. :)

Thanks,
Paul

 | Replies | Author | Date
4889 | Re: Bug 83 description | Mike Lischke | Sat 12/8/2001
4907 | Re: Bug 83 description | padagosta | Mon 12/10/2001


re: Blended images and Ghosted

From: Werner Lehmann [wl@b...]
Date: Mon Dec 3, 2001 6:20 pm
Subject: Re: [VirtualTreeview] Blended images and Ghosted

Hi Illya,

> MY 2 cents ;) are following.
> Yes, C++/C#/Java don't use A-prefixing.
> But they have other facilities to bypass such ambiguity.
> Lets assume a class definition:
>
> class test{
>
> int value;
>
> void func( int value ){
> this.value = value;
> }
>
> ...
>
> }
>
> In line 'this.value = value;' we have: 'this.value' is referencing to an
instance variable
> while 'value' is referencing to a parameter.
>
> In Delphi 'Self.Value:= Value;' BOTH sides will reference to the same
INSTANCE VARIABLE.

No. Don't think so. A small test confirms this. The output of the following
test is:

self.Test = FALSE
Test = TRUE

---

program Project2;

{$APPTYPE CONSOLE}

uses
SysUtils;

type
TFoo = class
public
Test: Boolean;
constructor Create;
procedure Bar(Test: Boolean);
end;

{ TFoo }

constructor TFoo.Create;
begin
Test := false; // Not necessary but to demonstrate the point here.
end;

procedure TFoo.Bar(Test: Boolean);
begin
WriteLn('self.Test = ', self.Test);
WriteLn('Test = ', Test);
end;

begin
with TFoo.Create do
try
Bar(true);
ReadLn;
finally
Free;
end;
end.

---

Werner


re: Blended images and Ghosted

From: Werner Lehmann [wl@b...]
Date: Mon Dec 3, 2001 6:27 pm
Subject: Re: [VirtualTreeview] Blended images and Ghosted

Hi KOSTAS,

> I'm as much a standards freak as you are, e.g. i use "S" as a name for most
> of my local string variables.

If that means that you prefix string var names with S we are not on the same
line. Although I can imagine this as benefit. Not so with a general L-prefix
for all local vars.

> I didn't want to force any "coding standards" to Mike's code, for crying out
> loud!!! I just asked him a favour.

Sorry. Code formatting is one of the last and most important open questions in
this world :)

> I did not imply that ALL parameters should be prefixed with "A", just that
> those that can cause ambiguities could be renamed. If Mike does not like the
> "A" convention he can just rename then completely, for instance "NodeText"
> instead of "Text".

The renaming suggestion makes the most sense to me. Of course someone would have
to provide a list of problem cases or even code ready for copy and paste. If
Mike agrees at all. After all, this is just another obstacle to the final
release
version...

> Yes, but most of us would like to spend our brain cells solving problems
> instead of watching out for landmines. I've found myself spending hours
> trying to find bugs caused by a name conflict that just sat there and
> laughed at my face and i think quite high of my "professionality"...
> Programming is not easy as it is, so we should try not to make it any more
> difficult.

Ack.

Werner


Check boxes

From: "Justin Turberville" [justin@d...]
Date: Tue Dec 4, 2001 9:20 am
Subject: [VirtualTreeview] Check boxes

I drop a VST (v2.6.11) onto a form, set RootNodeCount to 5, set
voCheckSupport to true. No check boxes appear. No matter what I try with
Margin, etc, I don't get them. Neither can I get my program to show them at
runtime.
Any hints as to what I must do?


re: Check boxes

From: Vandrovec Milan [milan_va@s...]
Date: Tue Dec 4, 2001 9:39 am
Subject: RE: [VirtualTreeview] Check boxes

Hi, Justin.

> I drop a VST (v2.6.11) onto a form, set RootNodeCount to 5, set
> voCheckSupport to true. No check boxes appear.
> Any hints as to what I must do?

Try adding

Sender.CheckType[Node]:=ctCheckBox;

to OnInitNode handler.
Looks like we need a FAQ in the help file.

Milan Vandrovec

P.S.: Where is the newest help file? Is there no progress from june 2001?

 | Replies | Author | Date
4875 | Re: Check boxes | Justin Turberville | Tue 12/4/2001
4890 | Re: Check boxes | Mike Lischke | Sat 12/8/2001


re: VT update

From: Ralf Junker [ralfjunker@g...]
Date: Tue Dec 4, 2001 9:38 am
Subject: RE: [VirtualTreeview] VT update

Hi Milan,

>> Unit ColnEdit.pas is unknown to D4
>>
>> ShowCollectionEditor is also unknown to D4
>
>It's interesting it did work up to now, I cannot see any changes of it,
>although the VirtualTreesReg has changed. Are you sure it worked in 2.6.11?
>Also, could you try to add a line similar to
>-LU"dclstd40"
>at the end of both VirtualTreesD4*.cfg ? I don't know if it can help, but is
>worth a try. You can also try full path to $(delphi)\lib\dclstd40.dcp there.

How stupid of me. I forgot to include it into a new VT package. Of course
everythings works fine.

Mike, maybe you want to add a little comment directing us forgetful out there
the right way?

>> VirtualTrees.pas:
>>
>> Function Supports (line 5004) is not available in D4. Maybe
>> conditionally substitute with Source taken from D5?
>
>It is defined in SysUtils as
>
>function Supports(const Instance: IUnknown; const Intf: TGUID; out Inst):
>Boolean;
>begin
> Result := (Instance <> nil) and (Instance.QueryInterface(Intf, Inst) = 0);
>end;

Thanks, I already have it, but also wanted to make Mike aware of it. Isn't
anyone using D4 any more?

Greetings,

-- Ralf


re: Blended images and Ghosted

From: GIANNAKOPOULOS KOSTAS [kyan@s...]
Date: Tue Dec 4, 2001 9:47 am
Subject: RE: [VirtualTreeview] Blended images and Ghosted

> If that means that you prefix string var names with S we are
> not on the same
> line. Although I can imagine this as benefit. Not so with a
> general L-prefix
> for all local vars.

No, i meant the variable's whole name e.g.:

var
S: string;

or

var
I: Integer;

> The renaming suggestion makes the most sense to me. Of course
> someone would have
> to provide a list of problem cases or even code ready for
> copy and paste. If
> Mike agrees at all. After all, this is just another obstacle
> to the final release version...

OK, here's a list of names that i think can cause conflicts:

Enevt type Parameter Suggested new name Possible conflicts
----------------------------------------------------------------------------
------
TVSTGetTextEvent Text NodeText or
CellText
TVSTNewTextEvent Text NewText TControl.Text,
TVirtualTreeColumn.Text
TVTIncrementalSearchEvent Text NodeText or
CellText

TVTGetImageEvent Index NodeImageIndex or
TCollectionItem.Index, TVirtualNode.Index
CellImageIndex

<All paint events> Canvas TreeCanvas or
TWinControl.Canvas, TForm.Canvas, TBitmap.Canvas
PaintCanvas

Now it's up to Mike...

<KY>


re: Check boxes

From: "Justin Turberville" [justin@d...]
Date: Tue Dec 4, 2001 11:35 am
Subject: RE: [VirtualTreeview] Check boxes

> Sender.CheckType[Node]:=ctCheckBox;

Thanks for the prompt aid, Milan. I would have thought that setting
voCheckSupport would automatically set that on node add, but suppose that
would make someone else complain...


Animated Toggle

From: GIANNAKOPOULOS KOSTAS [kyan@s...]
Date: Tue Dec 4, 2001 4:57 pm
Subject: Animated Toggle

Does anyone know the way to find which setting makes Windows TreeViews do
animated expand?
I thought it was SPI_GETLISTBOXSMOOTHSCROLLING (SystemParametersInfo) but it
doesn't seem to be correct.
My purpose is to respect the system's settings for my VT's AnimatedToggle
setting.

Thank you for any help.

<KY>

 | Replies | Author | Date
4877 | Re: Animated Toggle | Jim Kueneman | Wed 12/5/2001


re: Animated Toggle

From: "Jim Kueneman" [jimdk@m...]
Date: Wed Dec 5, 2001 12:15 am
Subject: Re: Animated Toggle

Hi KY,

> doesn't seem to be correct.
> My purpose is to respect the system's settings for my VT's
AnimatedToggle

Well the Treeview has a TVM_SETSCROLLTIME to set its scroll time and
to get the max scroll time. TweakUI will disable it so I am guessing
it is in the registry somewhere.

Jim


CopyTo does not copy data

From: Sanjay Kanade [skanade@v...]
Date: Wed Dec 5, 2001 4:47 am
Subject: CopyTo does not copy data

I have a problem. The CopyTo does not copy node data to
the other tree. Also, none of the events gives both the
source and target node so that I can do a copy myself.
Any ideas?

Thanks,
Sanjay

 | Replies | Author | Date
4880 | Re: CopyTo does not copy data | rm198de | Wed 12/5/2001
4881 | Re: CopyTo does not copy data | rm198de | Wed 12/5/2001
4884 | Re: CopyTo does not copy data | Sanjay Kanade | Thu 12/6/2001


OnExpanded Bug: Called when expanding childless node

From: Ralf Junker [ralfjunker@g...]
Date: Wed Dec 5, 2001 10:44 am
Subject: OnExpanded Bug: Called when expanding childless node

Hi Mike,

there is a small (probably typo) bug in TBaseVirtualTree.ToggleNode, which
causes the OnExpanded event to be fired even if the node is not actually
expanded because it does not have any children.

This causes recursive calls of OnExpanded when expanding a node without
children, for example, at the following scenario, which automatically causes a
full expand once the 1st level node is expanded:

procedure TfrmMain.TreeViewExpanded(Sender: TBaseVirtualTree; Node:
PVirtualNode);
begin
with Sender do
if GetNodeLevel(Node) = 0 then
FullExpand(Node);
end;

As a bug-fix I propose to move the command

DoExpanded(Node);

(line 25007 in TBaseVirtualTree.ToggleNode) one line up, so it is inlucded into
the

if Node.ChildCount > 0 then

block.

DeExpanded(Node) is then implemented the same way as DoCollapsed(Node); (same
procedure, on block above), which generally seems to make more sense anyway.

Greetings,

-- Ralf

 | Replies | Author | Date
4891 | Re: OnExpanded Bug: Called when expanding childle | Mike Lischke | Sat 12/8/2001


re: CopyTo does not copy data

From: "rm198de" [rmelles@g...]
Date: Wed Dec 5, 2001 11:45 am
Subject: Re: CopyTo does not copy data

--- In [VirtualTreeview@y...], Sanjay Kanade [skanade@v...] wrote:
> I have a problem. The CopyTo does not copy node data to
> the other tree. Also, none of the events gives both the
> source and target node so that I can do a copy myself.
> Any ideas?
>
> Thanks,
> Sanjay

Hi Janjay,

you have to use the Events OnSave & OnLoad to write and finally read
your userdata. These events are giving you a streamstructure to save
userdata into. VT is only copying the Nodes automaticly.

Hope that this helps you out...:-)

Regards
Ralf


re: CopyTo does not copy data

From: "rm198de" [rmelles@g...]
Date: Wed Dec 5, 2001 11:46 am
Subject: Re: CopyTo does not copy data

--- In [VirtualTreeview@y...], Sanjay Kanade [skanade@v...] wrote:
> I have a problem. The CopyTo does not copy node data to
> the other tree. Also, none of the events gives both the
> source and target node so that I can do a copy myself.
> Any ideas?
>
> Thanks,
> Sanjay

Ups...Sorry Sanjay for typing your name the wrong way-that was
the "toomanyfingersonkeyboarderror" ;-)

Ralf


Drag&Drop

From: GIANNAKOPOULOS KOSTAS [kyan@s...]
Date: Wed Dec 5, 2001 2:26 pm
Subject: Drag&Drop

Good afternoon everyone.

I'm having a strange effect i can't suppress:

In a VT that accepts (VCL) drag-drop if have written a OnDragOver event
handler like:

procedure TMyForm.vtDocsDragOver(Sender: TBaseVirtualTree;
Source: TObject; Shift: TShiftState; State: TDragState; Pt: TPoint;
Mode: TDropMode; var Effect: Integer; var Accept: Boolean);
DragNode, NewParent, NewAfter: INode;
begin
Effect := DROPEFFECT_NONE;
Accept := (TDragControlObject(Source).Control = Sender);
if not Accept then Exit;
...
end;

because i only want the VT to accept only dragging from itself.

The side-effect i'm getting is that the "drop indicators" are drawn along
with a "No" cursor when ANY control is dragged over the VT, such as toolbars
from other forms.

The side-effect seems a little bit ..uhmmm... odd, so does anyone know a
solution other than excluding toShowDropmark from options or changing to OLE
drag-drop which i do not fully understand?

Thank you.

<KY>

 | Replies | Author | Date
4892 | Re: Drag&Drop | Mike Lischke | Sat 12/8/2001


Refresh Problem when changing the BackGround color of node

From: "anbazhahan_s" [anbazhahan_s@y...]
Date: Wed Dec 5, 2001 2:53 pm
Subject: Refresh Problem when changing the BackGround color of node

Hi,
I have VirtualStringTree with two columns. In first column, i am
showing image,checkbox and text. Depends on some cases, i am changing
the background color of the node. When i select any of the node, it
shows only the text highlighted instead of showing the whole line
heightlighted. I am using the following function achive:

void __fastcall onBeforeItemErase(
TBaseVirtualTree* sender, TCanvas* canvas, PVirtualNode node,
TRect& itemRect, TColor& color, TItemEraseAction& eraseAction)
{
TData* data = NULL;
data = static_cast<TPlayListData*>(
VirtualStringTree_PlayList->GetNodeData(node));
if (data != NULL && data->isGrayed)
{
color = clScrollBar;
}
else
{
color = VirtualStringTree_PlayList->Color;
}
eraseAction = eaColor;
}

and options which i set is
Options =
[voAcceptOLEDrop,voAutoDropExpand,voAutoScroll,voAutoTristateTracking,
voCheckSupport,voFullRowSelect,voInitOnSave,voMultiSelect,voToggleOnDb
lClick]

Please let me know, Is any functions i need to implement,If so,
How to achive???

Also I tried with one more way by setting the options

Options =
[voAcceptOLEDrop,voAutoDropExpand,voAutoScroll,voAutoTristateTracking,
voCheckSupport,voFullRowSelect,voGridExtensions,voInitOnSave,voMultiSe
lect,voToggleOnDblClick]
In that case, it shows the whole line as selected, but it doesnt
show checkBox and Image.

Expecting yours help.

 | Replies | Author | Date
4893 | Re: Refresh Problem when changing the BackGround | Mike Lischke | Sat 12/8/2001


re: CopyTo does not copy data

From: Sanjay Kanade [skanade@v...]
Date: Thu Dec 6, 2001 2:41 pm
Subject: Re: CopyTo does not copy data

Hi Ralf,

Thanks for the tip. It works!

Regards,
Sanjay


Using VT as a string grid in C++Builder

From: "Malcolm Smith" [mjfreelancing@o...]
Date: Sat Dec 8, 2001 6:16 am
Subject: Using VT as a string grid in C++Builder

Hi,

I've been away from VT for a long time (never really got to use it).

I now want to use it in a current project, have downloaded what I believe is
the latest version but can't see any demo applications to show me how to
make use of its power in C++Builder.

I specifically want to use it as a string grid to show information about
files. I have some demos from my earlier investigations of VT but none of
them are compatible with the current version.

Can someone give me a head start.

Malcolm Smith
MJ Freelancing
ABN: 30 671 763 146
http://www.mjfreelancing.com

CORintel
ABN: 30 336 110 329

[Non-text portions of this message have been removed]

 | Replies | Author | Date
4894 | Re: Using VT as a string grid in C++Builder | Mike Lischke | Sat 12/8/2001
4895 | Re: Using VT as a string grid in C++Builder | Malcolm Smith | Sat 12/8/2001
4896 | Re: Using VT as a string grid in C++Builder | Mike Lischke | Sat 12/8/2001


re: Blended images and Ghosted

From: "Mike Lischke" [lists@l...]
Date: Sat Dec 8, 2001 12:38 pm
Subject: RE: [VirtualTreeview] Blended images and Ghosted

Hi Kostas,

> My argument is that selection blending is purely aesthetic (for instance you
> turn it off if you want VT to look like a TreeView and on for it to look
> like a ListView) whereas the "Ghosted" effect has a special meaning, it is
> commonly used to indicate that a node is somehow "hidden".

From the point of view of VT blended images and ghosted images are the same. In
fact the blending
effect is used to paint ghosted nodes as well as cut nodes. But Werner already
gave some comments on
this already.

> Also, Mike, could you please add an "A" or something else to the names of
> event handler parameters that may conflict with common property names (such
> as "Text" to "AText", "Index" to "AIndex" or "AnIndex" etc.).

Well, I have done a rename for the cases most likely to cause trouble, but
basically I do not agree
with you here. You are shifting your responsibility on VT (in this case). Every
developer should be
aware of such conflicts as you described. I can fix VT but what do you want to
do with other
controls? Even after the changes I made, you can never be sure that there
aren't still some
conflicts. You simply have to check in any case. But I (believe to) know your
anser: it makes it
easier for you when *I* change the code ;-). Well, so be it then...

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: VT update

From: "Mike Lischke" [lists@l...]
Date: Sat Dec 8, 2001 1:07 pm
Subject: RE: [VirtualTreeview] VT update

Hi Ralf,

> Function Supports (line 5004) is not available in D4. Maybe conditionally
substitute
> with Source taken from D5?

I have changed this to a QueryInterface call.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: Node alignment

From: "Mike Lischke" [lists@l...]
Date: Sat Dec 8, 2001 1:11 pm
Subject: RE: [VirtualTreeview] Node alignment

Hi Justin,

> I've noticed that in v2.6.11, if scrolled down a bit, the bottommost visible
> node is aligned to the bottom and only part of the topmost visible node is
> shown instead of the other way round as one would expect.

As soon as the bottom node is focused it is also fully scrolled into view. I
wouldn't also not say
that it is expected to have the bottom node fully visible. Many people always
want the top node
displayed so.

> NodeAlignment does'nt seem to do anything & the description of its
> functionality is <erm> "murky":
>
> // Determines how to use the align member of a node.
> TVTNodeAlignment = (
> naFromBottom, // the align member specifies amount of units
> (usually pixels) from top border of the node
> naFromTop, // align is to be measured from bottom
> naProportional // align is to be measure in percent of the
> entire node height and relative to top
> );

It describes TVirtualNode.Align and how it is to be used. This member
determines how the images and
the lines are to be aligned within a node.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: Re: Bug 83 description

From: "Mike Lischke" [lists@l...]
Date: Sat Dec 8, 2001 1:16 pm
Subject: RE: [VirtualTreeview] Re: Bug 83 description

> If I am on a row and the row is moved somewhere else, I would expect
> that it would still be selected/focused, and when I use the arrow keys
> the selection change would be relative to the current row.

I think this is now fixed (already with 2.7.3). Did you check this problem
again?

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net

 | Replies | Author | Date
4907 | Re: Bug 83 description | padagosta | Mon 12/10/2001


re: Check boxes

From: "Mike Lischke" [lists@l...]
Date: Sat Dec 8, 2001 1:17 pm
Subject: RE: [VirtualTreeview] Check boxes

> P.S.: Where is the newest help file? Is there no progress from june 2001?

I have not yet uploaded the latest version since I'm still working on it.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: OnExpanded Bug: Called when expanding childless node

From: "Mike Lischke" [lists@l...]
Date: Sat Dec 8, 2001 1:24 pm
Subject: RE: [VirtualTreeview] OnExpanded Bug: Called when expanding childless node

> As a bug-fix I propose to move the command
>
> DoExpanded(Node);
>
> (line 25007 in TBaseVirtualTree.ToggleNode) one line up, so it is inlucded
into the
>
> if Node.ChildCount > 0 then
>
> block.

Done.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: Drag&Drop

From: "Mike Lischke" [lists@l...]
Date: Sat Dec 8, 2001 1:28 pm
Subject: RE: [VirtualTreeview] Drag&Drop

Hi Kostas,

> The side-effect seems a little bit ..uhmmm... odd, so does anyone know a
> solution other than excluding toShowDropmark from options or changing to OLE
> drag-drop which i do not fully understand?

Switching to OLE drag would not help here since the tree would still accept VCL
dragging.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: Refresh Problem when changing the BackGround color of node

From: "Mike Lischke" [lists@l...]
Date: Sat Dec 8, 2001 1:29 pm
Subject: RE: [VirtualTreeview] Refresh Problem when changing the BackGround color of node

> Subject: [VirtualTreeview] Refresh Problem when changing the BackGround
> color of node

Answered in private mail since it was crossposted.


re: Using VT as a string grid in C++Builder

From: "Mike Lischke" [lists@l...]
Date: Sat Dec 8, 2001 1:55 pm
Subject: RE: [VirtualTreeview] Using VT as a string grid in C++Builder

Hi Malcolm,

> I specifically want to use it as a string grid to show information about
> files. I have some demos from my earlier investigations of VT but none of
> them are compatible with the current version.

There is nothing special to consider. You can active some help by including
toGridExtensions in
VT.TreeOptions.MiscOptions. Enable also WantTabs to have tabulators advancing
the focus in the
cells. Define several columns and hide tree lines. If you like you can enable
grid lines too
(separately horizontal and vertical lines, see also the tree options).

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net

 | Replies | Author | Date
4895 | Re: Using VT as a string grid in C++Builder | Malcolm Smith | Sat 12/8/2001
4896 | Re: Using VT as a string grid in C++Builder | Mike Lischke | Sat 12/8/2001


re: Using VT as a string grid in C++Builder

From: "Malcolm Smith" [mjfreelancing@o...]
Date: Sat Dec 8, 2001 1:55 pm
Subject: RE: [VirtualTreeview] Using VT as a string grid in C++Builder

Mike,

Thanks for the head start. Is there any up-to-date demos for C++Builder?

Malcolm Smith
MJ Freelancing
ABN: 30 671 763 146
http://www.mjfreelancing.com

CORintel
ABN: 30 336 110 329

-----Original Message-----
From: Mike Lischke [mailto:[lists@l...]]
Sent: Sunday, 9 December 2001 00:55
To: VirtualTreeview@yahoogroups.com
Subject: RE: [VirtualTreeview] Using VT as a string grid in C++Builder

Hi Malcolm,

> I specifically want to use it as a string grid to show information about
> files. I have some demos from my earlier investigations of VT but none of
> them are compatible with the current version.

There is nothing special to consider. You can active some help by including
toGridExtensions in
VT.TreeOptions.MiscOptions. Enable also WantTabs to have tabulators
advancing the focus in the
cells. Define several columns and hide tree lines. If you like you can
enable grid lines too
(separately horizontal and vertical lines, see also the tree options).

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net

To unsubscribe from this group, send an email to:
VirtualTreeview-unsubscribe@egroups.com

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/

 | Replies | Author | Date
4896 | Re: Using VT as a string grid in C++Builder | Mike Lischke | Sat 12/8/2001


re: Using VT as a string grid in C++Builder

From: "Mike Lischke" [lists@l...]
Date: Sat Dec 8, 2001 2:19 pm
Subject: RE: [VirtualTreeview] Using VT as a string grid in C++Builder

> Thanks for the head start. Is there any up-to-date demos for C++Builder?

Not that I'm aware of it, but try browsing the file area (descentants and demos
subfolder) on Yahoo
Groups (http://groups.yahoo.com/group/VirtualTreeview/files).

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: Drag&Drop

From: Werner Lehmann [wl@b...]
Date: Sat Dec 8, 2001 3:15 pm
Subject: Re: [VirtualTreeview] Drag&Drop

GIANNAKOPOULOS KOSTAS wrote:
>
> The side-effect seems a little bit ..uhmmm... odd, so does anyone know a
> solution other than excluding toShowDropmark from options or changing to OLE
> drag-drop which i do not fully understand?

It would probably be best to not draw the dropmark (maybe even the droptarget
node) if OnDragOver indicates that the drag is not accepted... but both sides
have the procs and cons I suppose.

Werner


Move nodes with data

From: "Helge Jung \(ECO-Logic\)" [helge@e...]
Date: Sun Dec 9, 2001 12:23 pm
Subject: Move nodes with data

Hi everyone!

I think this was answered sometime before but I couldn't find the message
any more (neither in my vt-mail-folder nor in the YG).

I want to move a node from VST1 to VST2 - both have the same data structure.
I use "VST1.MoveTo (VST1.GetFirstSelected, VST2, amAddLastChild, false);"
but the node data isn't copied with it - maybe I just forgot to set up a
tiny option?

If nobody has a hint, I'll continue performing the move manually (adding new
node to VST2, copying the data, deleting the selected node in VST1)...

Helge.

 | Replies | Author | Date
4899 | Re: Move nodes with data | Mike Lischke | Sun 12/9/2001
4901 | Re: Move nodes with data | Helge Jung (ECO-Logic) | Sun 12/9/2001


re: Move nodes with data

From: "Mike Lischke" [lists@l...]
Date: Sun Dec 9, 2001 12:35 pm
Subject: RE: [VirtualTreeview] Move nodes with data

Helge,

> I think this was answered sometime before but I couldn't find the message
> any more (neither in my vt-mail-folder nor in the YG).

It was last Wednesday when Ralf answered a very similar question (#4880) ;-).
Use OnSaveNode and
OnLoadNode to transfer your data. However if you are moving nodes within the
same tree then these
events are never triggered because the node is physically moved (inluding all
its data) instead that
another node is created, data is copied and the original node is deleted.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net

 | Replies | Author | Date
4901 | Re: Move nodes with data | Helge Jung (ECO-Logic) | Sun 12/9/2001


New to VirtualTreeView - Where do I get the New version

From: "jayanck" [jayan@g...]
Date: Sun Dec 9, 2001 12:39 pm
Subject: New to VirtualTreeView - Where do I get the New version

Hello everyone,

I am new to VT. I saw the Old version on the authors site. Where do
I go for the latest version, which everyone are discussing in this
group.

Best Regards,

Jayan Chandrasekhar.

 | Replies | Author | Date
4902 | Re: New to VirtualTreeView - Where do I get the N | Mike Lischke | Sun 12/9/2001
4903 | Hint shadow | Justin Turberville | Sun 12/9/2001
4946 | Re: Hint shadow | Mike Lischke | Sat 12/15/2001
4953 | Re: Hint shadow | Justin Turberville | Sun 12/16/2001
4991 | Re: Hint shadow | Mike Lischke | Sat 12/22/2001


re: Move nodes with data

From: "Helge Jung \(ECO-Logic\)" [helge@e...]
Date: Sun Dec 9, 2001 1:01 pm
Subject: Re: [VirtualTreeview] Move nodes with data

> It was last Wednesday when Ralf answered a very similar question
> (#4880) ;-).

Shame on me - never thought of OnLoadNode and OnSaveNode either... thanks
for the hint, will try it in a few minutes.

Helge.


re: New to VirtualTreeView - Where do I get the New version

From: "Mike Lischke" [lists@l...]
Date: Sun Dec 9, 2001 1:28 pm
Subject: RE: [VirtualTreeview] New to VirtualTreeView - Where do I get the New version

Hi Jayan,

> I am new to VT. I saw the Old version on the authors site. Where do
> I go for the latest version, which everyone are discussing in this
> group.

Try www.lischke-online.de/VirtualTreeview/beta/VirtualTree_2.7.3.zip. It is
likely that I'll upload
a newer version tonight, though. I'll do an announcement here and in the
newsgroups on
news://forums.talkto.net/delphi-gems.support.virtualtreeview.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net

 | Replies | Author | Date
4903 | Hint shadow | Justin Turberville | Sun 12/9/2001
4946 | Re: Hint shadow | Mike Lischke | Sat 12/15/2001
4953 | Re: Hint shadow | Justin Turberville | Sun 12/16/2001
4991 | Re: Hint shadow | Mike Lischke | Sat 12/22/2001


Hint shadow

From: "Justin Turberville" [justin@d...]
Date: Sun Dec 9, 2001 5:26 pm
Subject: Hint shadow

Mike

Could you convert the hint ShadowSize constant to a property please?

 | Replies | Author | Date
4946 | Re: Hint shadow | Mike Lischke | Sat 12/15/2001
4953 | Re: Hint shadow | Justin Turberville | Sun 12/16/2001
4991 | Re: Hint shadow | Mike Lischke | Sat 12/22/2001


Examples

From: "xdamien" [enrique@x...]
Date: Mon Dec 10, 2001 3:24 am
Subject: Examples

Hello,

I'm a newbie to VTV. I downloaded the latest build
VirtualTree_2.7.3.zip. None of the (latest) examples in the FILES
section seem to RUN. I get a a runtime exception
("VST.Colors.BorderColor" propety does not exists) when running the
MININIAL project in the "VirtualTree Demos.zip" file
and
a ("VS.IncrementalSearchDirection" property does not exist) runtime
exception on the
"VT_Basics.zip" sample. (also the VT.GetFirst does not exists)

Can somebody point me to some working code and an updated help file.

p.s: I'm using the delphi package: VirtualTreesD5D.dpk (DELPHI5 pro
SP1) on Win2K SP2

Thanks in advance,
Enrique Benedetti

 | Replies | Author | Date
4905 | Re: Examples | Helge Jung (ECO-Logic) | Mon 12/10/2001
4913 | Re: Examples | Werner Lehmann | Wed 12/12/2001


re: Examples

From: "Helge Jung \(ECO-Logic\)" [helge@e...]
Date: Mon Dec 10, 2001 6:08 am
Subject: Re: [VirtualTreeview] Examples

> Can somebody point me to some working code and an updated help file.

Mike is still working on the help file and so there isn't an updated help
file yet. But in the current one there are some basic steps on how to use VT
which should also work with the newest versions (I mean the FAQs or
How-To-Start articles). If you read this and then have questions, then you
can come back here and ask - I did it the same way and I have to say the
responses here are quick and very helpful!

Helge.


re: Blended images and Ghosted

From: GIANNAKOPOULOS KOSTAS [kyan@s...]
Date: Mon Dec 10, 2001 9:36 am
Subject: RE: [VirtualTreeview] Blended images and Ghosted

> From the point of view of VT blended images and ghosted
> images are the same. In fact the blending
> effect is used to paint ghosted nodes as well as cut nodes.
> But Werner already gave some comments on
> this already.

OK.

> Well, I have done a rename for the cases most likely to cause
> trouble,

Thank you very much.

> but basically I do not agree
> with you here. You are shifting your responsibility on VT (in
> this case). Every developer should be
> aware of such conflicts as you described. I can fix VT but
> what do you want to do with other
> controls? Even after the changes I made, you can never be
> sure that there aren't still some
> conflicts. You simply have to check in any case.

No, i'm not shifting my responsibility to you, as i said in later mail to
Werner i was just asking you a favour. And of course i'll have to check in
any case. I just wish that people in Borland would see this issue and do
something about it like you did.

> But I (believe to) know your anser: it makes it
> easier for you when *I* change the code ;-). Well, so be it then...

Well, you'll have to do it once whereas i/we would have to be careful all
the time.

Thank you again.


re: Bug 83 description

From: "padagosta" [pdagosta@c...]
Date: Mon Dec 10, 2001 1:10 pm
Subject: Re: Bug 83 description

> I think this is now fixed (already with 2.7.3). Did you check this
problem again?

I was still having trouble with 2.7.3 :)

Thank you,
Paul


2.7.3 missing in the files section

From: "trivialriot" [trivialriot@y...]
Date: Tue Dec 11, 2001 10:30 am
Subject: 2.7.3 missing in the files section

Hi.

Maybe I'm just too stupid, but I can't find the current version 2.7.3
in the Files-Section where the latest files used to be...

Regards from Vienna,
Mike G. Zinner

 | Replies | Author | Date
4909 | Re: 2.7.3 missing in the files section | rm198de | Tue 12/11/2001


re: 2.7.3 missing in the files section

From: "rm198de" [rmelles@g...]
Date: Tue Dec 11, 2001 11:34 am
Subject: Re: 2.7.3 missing in the files section

--- In [VirtualTreeview@y...], "trivialriot" [trivialriot@y...] wrote:
> Hi.
>
> Maybe I'm just too stupid, but I can't find the current version
2.7.3
> in the Files-Section where the latest files used to be...
>
> Regards from Vienna,
> Mike G. Zinner

Hi Mike,

if you checked out the previous messages you would probably found
this link:

www.lischke-online.de/VirtualTreeview/beta/VirtualTree_2.7.3.zip

regards

Ralf


VCL right Click

From: "Dion" [dion@n...]
Date: Tue Dec 11, 2001 8:52 pm
Subject: VCL right Click

Hi All,

Is it possible to simulate the right click as it happens in windows explorer,
or even the VCL?

Thanks,
Dion.

[Non-text portions of this message have been removed]

 | Replies | Author | Date
4911 | Re: VCL right Click | Jim Kueneman | Wed 12/12/2001
4912 | Re: VCL right Click | Werner Lehmann | Wed 12/12/2001
4914 | Re: VCL right Click | Dion | Wed 12/12/2001
4915 | Re: VCL right Click | GIANNAKOPOULOS KOSTAS | Wed 12/12/2001


re: VCL right Click

From: Jim Kueneman [jimdk@m...]
Date: Wed Dec 12, 2001 3:09 am
Subject: Re: [VirtualTreeview] VCL right Click

At 10:52 PM 12/11/2001 +0200, you wrote:
>Hi All,
>
>Is it possible to simulate the right click as it happens in windows
>explorer, or even the VCL?

Yes, VET does it just like
explorer. http://groups.yahoo.com/group/VirtualExplorerTree/ in the
VirtualExplorerTree.pas file. You will have too look through a lot of noise
to find it but look at the overridden DoMouseXXX methods and the
ContextMenuManager class, It encapsulate a lot of how I did it.

Jim


re: VCL right Click

From: Werner Lehmann [wl@b...]
Date: Wed Dec 12, 2001 9:35 am
Subject: Re: [VirtualTreeview] VCL right Click

Hi Jim, Dion,

> >Is it possible to simulate the right click as it happens in windows
> >explorer, or even the VCL?
>
> Yes, VET does it just like
> explorer. http://groups.yahoo.com/group/VirtualExplorerTree/ in the
> VirtualExplorerTree.pas file. You will have too look through a lot of noise
> to find it but look at the overridden DoMouseXXX methods and the
> ContextMenuManager class, It encapsulate a lot of how I did it.

It sounds more as if he wants to get a non selecting right click on the
treeview. The comctrl treeview does this intentionally to allow, for instance,
a right click on a disk drive with an unformatted floppy to get the context
menu and format the disk. The problem with the VCL wrapper of the treeview
is here that the mouseup / contextmenu event handler sees the selected item
not as the one below the mouse cursor but as the one which is really selected.
This leads to the common problem that you select node A, right click node B,
maybe choose "Delete" from the context menu and node A will be deleted, not B.

I am not sure but it might be fixed or better "workarounded" in D6.

This behaviour might be simulated in VST by turning off the right click select
option and handle the mouse up event manually. GetNodeAt will help to determine
the clicked node. Maybe even OnContextMenu suffices. But the clicked node will
then not be selected as in the standard comctrl treeview.

Werner


re: Examples

From: Werner Lehmann [wl@b...]
Date: Wed Dec 12, 2001 9:40 am
Subject: Re: [VirtualTreeview] Examples

Enrique,

> I'm a newbie to VTV. I downloaded the latest build
> VirtualTree_2.7.3.zip. None of the (latest) examples in the FILES
> section seem to RUN. I get a a runtime exception
> ("VST.Colors.BorderColor" propety does not exists) when running the
> MININIAL project in the "VirtualTree Demos.zip" file
> and
> a ("VS.IncrementalSearchDirection" property does not exist) runtime
> exception on the
> "VT_Basics.zip" sample. (also the VT.GetFirst does not exists)

this description sounds more as if you are still using an outdated treeview
somewhere on your system. Be sure to rebuild the 2.7.3 package. If that does
not help: delete all *.dcu and *.dcp from the VTree package (search your
computer to find all, look especially in delphi5\projects\bpl if you don't
use this normally) and reinstall.

> Can somebody point me to some working code and an updated help file.

Mike has uploaded the latest help file here:

http://www.lischke-online.de/VirtualTreeview/VTHelp/!VTMain.html

Werner


re: VCL right Click

From: "Dion" [dion@n...]
Date: Wed Dec 12, 2001 11:41 am
Subject: Re: [VirtualTreeview] VCL right Click

Hi Guys,

All I want to do is have the node I right Clicked on highlighted, and the
actual(selected) node displayed in a broken line frame. If I escape from the
popup, the actual selected node becomes the focused node again(ala Windows
Explorer).

VT does all of this, except the right clicked node is not highlighted. Must
I change source code to simulate this, or is there built in functionality?

Thanks,
Dion.

----- Original Message -----
From: "Werner Lehmann" [wl@b...]
To: <VirtualTreeview@yahoogroups.com>
Sent: Wednesday, December 12, 2001 11:35 AM
Subject: Re: [VirtualTreeview] VCL right Click

> Hi Jim, Dion,
>
> > >Is it possible to simulate the right click as it happens in windows
> > >explorer, or even the VCL?
> >
> > Yes, VET does it just like
> > explorer. http://groups.yahoo.com/group/VirtualExplorerTree/ in the
> > VirtualExplorerTree.pas file. You will have too look through a lot of
noise
> > to find it but look at the overridden DoMouseXXX methods and the
> > ContextMenuManager class, It encapsulate a lot of how I did it.
>
> It sounds more as if he wants to get a non selecting right click on the
> treeview. The comctrl treeview does this intentionally to allow, for
instance,
> a right click on a disk drive with an unformatted floppy to get the
context
> menu and format the disk. The problem with the VCL wrapper of the treeview
> is here that the mouseup / contextmenu event handler sees the selected
item
> not as the one below the mouse cursor but as the one which is really
selected.
> This leads to the common problem that you select node A, right click node
B,
> maybe choose "Delete" from the context menu and node A will be deleted,
not B.
>
> I am not sure but it might be fixed or better "workarounded" in D6.
>
> This behaviour might be simulated in VST by turning off the right click
select
> option and handle the mouse up event manually. GetNodeAt will help to
determine
> the clicked node. Maybe even OnContextMenu suffices. But the clicked node
will
> then not be selected as in the standard comctrl treeview.
>
> Werner
>
>
>
>
> To unsubscribe from this group, send an email to:
> VirtualTreeview-unsubscribe@egroups.com
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>
>


re: VCL right Click

From: GIANNAKOPOULOS KOSTAS [kyan@s...]
Date: Wed Dec 12, 2001 12:13 pm
Subject: RE: [VirtualTreeview] VCL right Click

> It sounds more as if he wants to get a non selecting right
> click on the
> treeview. The comctrl treeview does this intentionally to
> allow, for instance,
> a right click on a disk drive with an unformatted floppy to
> get the context
> menu and format the disk. The problem with the VCL wrapper of
> the treeview
> is here that the mouseup / contextmenu event handler sees the
> selected item
> not as the one below the mouse cursor but as the one which is
> really selected.
> This leads to the common problem that you select node A,
> right click node B,
> maybe choose "Delete" from the context menu and node A will
> be deleted, not B.
>
> I am not sure but it might be fixed or better "workarounded" in D6.

This happens because when you click an item in a popup menu a WM_COMMAND
message is posted (not sent) to the owner window of the menu which finally
leads to the OnClick event handler of the TMenuItem object being fired.
Since the WM_COMMAND message is posted instead of sent the treeview has
ample time to deselect the temporarily selected right-clicked node.

To workaround this the popup menu must be executed with TPM_RETURNCMD
included TrackPopupMenu's Flags parameter and use the result (which is an
Integer instead of a BOOL as it is defined wrong in Windows.pas) to find the
corresponding item using TMenu.FindItem() and manually call its OnClick
event handler.
The problem with this is that you can't explicitly call
TMenuItem.InternalRethinkHotkeys, InternalRethinkLines and RebuildHandle
(they are private) to hide unwanted lines and adjust hot keys.

I don't think this issue is been dealt with in D6, since the code in
Menus.pas is pretty much the same.

The only possible solution i can think of is storing the temporarily
selected node in a data member (something like "LastPopupNode") and using
this in the OnClick event handler of the menuitem instead of the
focused/selected node.


How find node?

From: "Piotr Miara" [p.miara@s...]
Date: Wed Dec 12, 2001 12:13 pm
Subject: How find node?

Hi,
I want to find node with Data: Pointer and to select it . Data I know. Can
I use IterateSubTree? How use it? Send me example, please.
My english is weak, but I hope that you understand me.

Thank you for any help.

Klosz

[Non-text portions of this message have been removed]

 | Replies | Author | Date
4917 | Re: How find node? | rm198de | Wed 12/12/2001


re: How find node?

From: "rm198de" [rmelles@g...]
Date: Wed Dec 12, 2001 1:25 pm
Subject: Re: How find node?

--- In [VirtualTreeview@y...], "Piotr Miara" [p.miara@s...] wrote:
> Hi,
> I want to find node with Data: Pointer and to select it . Data
I know. Can I use IterateSubTree? How use it? Send me example,
please.
> My english is weak, but I hope that you understand me.
>
> Thank you for any help.
>
> Klosz
>
>
> [Non-text portions of this message have been removed]

Hi Klosz,

you can use IterateSubTree too, but you can simply use:

Found:=False;
LoopNode:=VST.GetFirst;
while Assigned(LoopNode) do
begin
Data1:=VST.GetNodeData(LoopNode);
if Data1=Data then
begin
Found:=True;
Break;
end;
LoopNode:=VST.GetNext(LoopNode);
end;

where LoopNode is PVirtualNode-type and Data1 is Pointer-type.

Hope this helps you out...

Regards
Ralf


onExpanding

From: "silvenra" [maeh2@g...]
Date: Wed Dec 12, 2001 4:44 pm
Subject: onExpanding

Hello

I look for double nodes at the "expanding-Event". Exists the node twice the=
n the node aren´t allowed to expand. It works great. But when I press the tr=
eeview-Shortcut "*" (to expand all the child and their children...) the "exp=
anding-Event" will ignore the allowed-set and open the node. Consequence: th=
e tree will be in an infinite loop. I want use the shortcut "*" further on. =
Solution?

 | Replies | Author | Date
4921 | Re: onExpanding | Jim Kueneman | Thu 12/13/2001
4923 | Re: onExpanding | silvenra | Thu 12/13/2001
4924 | Re: onExpanding | silvenra | Thu 12/13/2001
4927 | Re: onExpanding | Ralf Junker | Thu 12/13/2001
4947 | Re: onExpanding | Mike Lischke | Sat 12/15/2001


setting data of RootNode

From: "el_guapo5" [rhymebusta@h...]
Date: Wed Dec 12, 2001 9:50 pm
Subject: setting data of RootNode

hi i was wondering if anyone knew how to set the data of the RootNode
because what i've tried so far gives me an "Access Violation" error
in BCB....also, are u even allowed to do what i'm trying to do?
here's a snip of my code

typedef struct
{
int imageindex;
char caption[50];
}mystruct;

mystruct *root_info;
root_info = (OMi_Node_Info_Struct *)tree->GetNodeData( tree-
>RootNode );
root_info->imageindex = 0; //this is where i get the error

thanks for any help given

 | Replies | Author | Date
4920 | Re: setting data of RootNode | Jim Kueneman | Thu 12/13/2001
4929 | Re: setting data of RootNode | el_guapo5 | Thu 12/13/2001
4925 | Re: setting data of RootNode | el_guapo5 | Thu 12/13/2001
4926 | Re: setting data of RootNode | Vadim Sedulin | Thu 12/13/2001
4928 | Re: setting data of RootNode | el_guapo5 | Thu 12/13/2001
4930 | Re: setting data of RootNode | Vadim Sedulin | Thu 12/13/2001
4931 | Re: setting data of RootNode | el_guapo5 | Thu 12/13/2001
4933 | Re: setting data of RootNode | el_guapo5 | Thu 12/13/2001
4932 | Re: setting data of RootNode | Vandrovec Milan | Thu 12/13/2001


re: setting data of RootNode

From: Jim Kueneman [jimdk@m...]
Date: Thu Dec 13, 2001 2:08 am
Subject: Re: [VirtualTreeview] setting data of RootNode

>hi i was wondering if anyone knew how to set the data of the RootNode
>because what i've tried so far gives me an "Access Violation" error
>in BCB....also, are u even allowed to do what i'm trying to do?
>here's a snip of my code

I am assuming that you have actually allocated the memory for the data
through NodeDataSize? If so I don't know, I am using the RootNode's data
field in VET. Are you use a newer version of VT? I have been doing it
since version 2.4 or so although I have been doing it from a decentant of
VT which allocates the node data a bit differently than NodeDataSize.

Jim

 | Replies | Author | Date
4929 | Re: setting data of RootNode | el_guapo5 | Thu 12/13/2001


re: onExpanding

From: Jim Kueneman [jimdk@m...]
Date: Thu Dec 13, 2001 2:10 am
Subject: Re: [VirtualTreeview] onExpanding

>I look for double nodes at the "expanding-Event". Exists the node twice the=

Can you post some code of what you are doing in the event?

Jim

 | Replies | Author | Date
4923 | Re: onExpanding | silvenra | Thu 12/13/2001
4924 | Re: onExpanding | silvenra | Thu 12/13/2001


Some offtopic question

From: Yur Ovchinnikov [Yur@s...]
Date: Thu Dec 13, 2001 8:30 am
Subject: Some offtopic question

Hello falks,

I worked recently under own implementation of the IVTEditLink and
have some question about using tComboBox in OwnerDraw style - what i
need to do for making combobox editabled (as csDropDown) in that style?

--
Best regards,
Yur Ovchinnikov E-mail: [yur@s...]
JSC Summit WWW: http://alone.come.to
ICQ: 1400397


re: onExpanding

From: "silvenra" [maeh2@g...]
Date: Thu Dec 13, 2001 9:10 am
Subject: Re: onExpanding

> Can you post some code of what you are doing in the event?
>
> Jim

Here a the onExpanding-Event:

procedure TFormVTree.vTreeExpanding(Sender: TBaseVirtualTree; Node: PVirtua=
lNode; var Allowed: Boolean);
begin
allowed := allowedExpanding(node);
end;

function allowedExpanding(node: pVirtualNode): boolean;
var data: pData;
findNode: pVirtualNode;
begin
data := formVTree.vTree.GetNodeData(node);
if data.myDataKind in dataSet then
begin
findNode := findNodeWithID(data.id); // Search node with the same id =
and return the node; else return is NIL
result := not(assigned(findNode) and not(findNode = node)); // not al=
lowed when: findNode <> NIL and node different to findnode
end
else
result := true; // the expansion is allowed
end;

When I try to open a node (who have an image) the program don´t allowed the=
expansion. When I use * to open, the tree open the node. Because the imagen=
ode has the same children, the tree is in a loop.

Needful?

Mäh


re: onExpanding

From: "silvenra" [maeh2@g...]
Date: Thu Dec 13, 2001 9:11 am
Subject: Re: onExpanding

> Can you post some code of what you are doing in the event?
>
> Jim

Here a the onExpanding-Event:

procedure TFormVTree.vTreeExpanding(Sender: TBaseVirtualTree; Node: PVirtua=
lNode; var Allowed: Boolean);
begin
allowed := allowedExpanding(node);
end;

function allowedExpanding(node: pVirtualNode): boolean;
var data: pData;
findNode: pVirtualNode;
begin
data := formVTree.vTree.GetNodeData(node);
if data.myDataKind in dataSet then
begin
findNode := findNodeWithID(data.id); // Search node with the same id =
and return the node; else return is NIL
result := not(assigned(findNode) and not(findNode = node)); // not al=
lowed when: findNode <> NIL and node different to findnode
end
else
result := true; // the expansion is allowed
end;

When I try to open a node (who have an image) the program don´t allowed the=
expansion. When I use * to open, the tree open the node. Because the imagen=
ode has the same children, the tree is in a loop.

Needful?

Mäh


re: setting data of RootNode

From: "el_guapo5" [rhymebusta@h...]
Date: Thu Dec 13, 2001 2:13 pm
Subject: Re: [VirtualTreeview] setting data of RootNode

>I am assuming that you have actually allocated the memory for the
>data
>through NodeDataSize? If so I don't know, I am using the RootNode's
>data
>field in VET. Are you use a newer version of VT? I have been doing
>it
>since version 2.4 or so although I have been doing it from a
>decentant of
>VT which allocates the node data a bit differently than NodeDataSize.

>Jim

yeah i already set the NodeDataSize to the sizeof(mystruct)

typedef struct
{
int imageindex;
char caption[50];
}mystruct;

mytree->NodeDataSize = sizeof(mystruct);


re: setting data of RootNode

From: "Vadim Sedulin" [wsntrl@o...]
Date: Thu Dec 13, 2001 1:18 pm
Subject: Re: [VirtualTreeview] setting data of RootNode

Hello All!

> >hi i was wondering if anyone knew how to set the data of the RootNode
> >because what i've tried so far gives me an "Access Violation" error
> >in BCB....also, are u even allowed to do what i'm trying to do?
> >here's a snip of my code
>
> I am assuming that you have actually allocated the memory for the data
> through NodeDataSize? If so I don't know, I am using the RootNode's data
> field in VET. Are you use a newer version of VT? I have been doing it
> since version 2.4 or so although I have been doing it from a decentant of
> VT which allocates the node data a bit differently than NodeDataSize.

There is no user data area in the root node (alas).

2 el_guapo5: You can use next technique (delphi):

type THackTree = TBaseVirtualTree;
...
// Tree.RootNodeCount must be zero!
MyDataOffset := THackTree(Tree).AllocateInternalDataArea (SyzeOf(mystruct));
...
MyRootData := Pointer(Cardinal(Tree.RootNode) + MyDataOffset);
MyData := Pointer(Cardinal(SomeNode) + MyDataOffset);

Bye.

Vadim Sedulin
E-Mail: [wsntrl@o...]

 | Replies | Author | Date
4928 | Re: setting data of RootNode | el_guapo5 | Thu 12/13/2001


re: onExpanding

From: Ralf Junker [ralfjunker@g...]
Date: Thu Dec 13, 2001 2:04 pm
Subject: Re: [VirtualTreeview] onExpanding

>I look for double nodes at the "expanding-Event". Exists the node twice the=
>n the node aren´t allowed to expand. It works great. But when I press the tr=
>eeview-Shortcut "*" (to expand all the child and their children...) the "exp=
>anding-Event" will ignore the allowed-set and open the node. Consequence: th=
>e tree will be in an infinite loop. I want use the shortcut "*" further on. =
>Solution?

Ther is a bug in VT. I reported it to Mike and it will be fixed in the next
release. Look for my one of previous postings for a temporary fix.

Regards,

Ralf


re: setting data of RootNode

From: "el_guapo5" [rhymebusta@h...]
Date: Thu Dec 13, 2001 2:26 pm
Subject: Re: setting data of RootNode

> There is no user data area in the root node (alas).
>
> 2 el_guapo5: You can use next technique (delphi):
>
> type THackTree = TBaseVirtualTree;
> ...
> // Tree.RootNodeCount must be zero!
> MyDataOffset := THackTree(Tree).AllocateInternalDataArea (SyzeOf
(mystruct));
> ...
> MyRootData := Pointer(Cardinal(Tree.RootNode) + MyDataOffset);
> MyData := Pointer(Cardinal(SomeNode) + MyDataOffset);
>
> Bye.
>
> Vadim Sedulin
> E-Mail: [wsntrl@o...]

ummm.....where did u get MyDataOffset or what is it, and i can't find
any function called AllocateInternalDataArea()...im using v2.4


re: setting data of RootNode

From: "el_guapo5" [rhymebusta@h...]
Date: Thu Dec 13, 2001 2:14 pm
Subject: Re: setting data of RootNode

> I am assuming that you have actually allocated the memory for the
data
> through NodeDataSize? If so I don't know, I am using the
RootNode's data
> field in VET. Are you use a newer version of VT? I have been
doing it
> since version 2.4 or so although I have been doing it from a
decentant of
> VT which allocates the node data a bit differently than
NodeDataSize.
>
> Jim

yeah i already set the NodeDataSize to the sizeof(mystruct)

typedef struct
{
int imageindex;
char caption[50];
}mystruct;

mytree->NodeDataSize = sizeof(mystruct);


re: Re: setting data of RootNode

From: "Vadim Sedulin" [wsntrl@o...]
Date: Thu Dec 13, 2001 4:11 pm
Subject: Re: [VirtualTreeview] Re: setting data of RootNode

Hello!

> > There is no user data area in the root node (alas).
> >
> > 2 el_guapo5: You can use next technique (delphi):
> >
> > type THackTree = TBaseVirtualTree;
> > ...
> > // Tree.RootNodeCount must be zero!
> > MyDataOffset := THackTree(Tree).AllocateInternalDataArea (SyzeOf
> (mystruct));
> > ...
> > MyRootData := Pointer(Cardinal(Tree.RootNode) + MyDataOffset);
> > MyData := Pointer(Cardinal(SomeNode) + MyDataOffset);
>
> ummm.....where did u get MyDataOffset or what is it, and i can't find
> any function called AllocateInternalDataArea()...im using v2.4

1. MyDataOffset - any variable (type cardinal).

2. function AllocateInternalDataArea(Size: Cardinal): Cardinal; (protected
fn. in TBaseVirtualTree).

--- VirtualTrees.pas ---
// Simple registration method to be called by each descentant to claim their
internal data area.
// Result is the offset from the begin of the node to the internal data area
of the calling tree class.

Bye.

Vadim Sedulin
E-Mail: [wsntrl@o...]

 | Replies | Author | Date
4931 | Re: setting data of RootNode | el_guapo5 | Thu 12/13/2001
4933 | Re: setting data of RootNode | el_guapo5 | Thu 12/13/2001


re: setting data of RootNode

From: "el_guapo5" [rhymebusta@h...]
Date: Thu Dec 13, 2001 4:23 pm
Subject: Re: setting data of RootNode

> 1. MyDataOffset - any variable (type cardinal).
>
> 2. function AllocateInternalDataArea(Size: Cardinal): Cardinal;
(protected
> fn. in TBaseVirtualTree).
>
> --- VirtualTrees.pas ---
> // Simple registration method to be called by each descentant to
claim their
> internal data area.
> // Result is the offset from the begin of the node to the internal
data area
> of the calling tree class.

that function is not in v2.4 so i can't use it...and i can't get
later versions to install properly....so i'm stuck with v2.4 for now
until i dedicate more time(which i have non of) to finding a work
around to install 2.6 or 2.7

 | Replies | Author | Date
4933 | Re: setting data of RootNode | el_guapo5 | Thu 12/13/2001


re: setting data of RootNode

From: Vandrovec Milan [milan_va@s...]
Date: Thu Dec 13, 2001 4:33 pm
Subject: Re: setting data of RootNode

Hello.

> that function is not in v2.4 so i can't use it...and i can't get
> later versions to install properly....so i'm stuck with v2.4 for now
> until i dedicate more time(which i have non of) to finding a work
> around to install 2.6 or 2.7

Could you be more specific about the error installing newer versions? (If I
remember correctly, you are using BCB)

Milan Vandrovec

 | Replies | Author | Date
4934 | Re: setting data of RootNode | el_guapo5 | Thu 12/13/2001


re: setting data of RootNode

From: "el_guapo5" [rhymebusta@h...]
Date: Thu Dec 13, 2001 4:40 pm
Subject: Re: setting data of RootNode

ok.....so i was wondering if anyone *cough*cough*Mike* :) knows if i
can allocate space for the Data field of the RootNode....because when
i try to access the Data field i get an error:

typedef struct
{
int imageindex;
char caption[50];
}mystruct;

mystruct *root_info;
root_info = (mystruct *)tree->GetNodeData( tree->RootNode );

root_info->imageindex = -1; //i get the error here

or a better question....how come i can't access the Data field if i
have already set the tree->NodeDataSize = sizeof(mystruct) ????

wait!! i just checked the VirtualTreeview.pas file and looked at the
GetNodeData method and it returns nil/NULL if the node passed in is
the RootNode....ummm....so if i change the code to return what's
stored in the RootNode->Data field shouldn't i be alright?


re: setting data of RootNode

From: "el_guapo5" [rhymebusta@h...]
Date: Thu Dec 13, 2001 4:43 pm
Subject: Re: setting data of RootNode

> Could you be more specific about the error installing newer
versions? (If I
> remember correctly, you are using BCB)
>
> Milan Vandrovec

if i remember correctly, last time i tried installing 2.6x i needed
to have some .lib files(i'm really not sure since it's been over a
month since i tried installing VT) but when i tried compiling the
files that created the .lib files i kept getting more errors so i
gave up...i'll try installing it again (with your instructions) and
tell u what i come across.


New user

From: "Glenn MacGregor" [gtm@o...]
Date: Thu Dec 13, 2001 5:51 pm
Subject: New user

Hi All,

I am new to the virtual tree view. I am using it in C++builder 5. The String
Tree works fine. Is there a good tutorial on using it? How do I set the name
of the node (what I see on the screen)?

Thanks

[Non-text portions of this message have been removed]

 | Replies | Author | Date
4936 | Re: New user | Bender Heri | Thu 12/13/2001
4937 | Re: New user | Helge Jung (ECO-Logic) | Thu 12/13/2001


re: New user

From: Bender Heri [HBender@E...]
Date: Thu Dec 13, 2001 5:52 pm
Subject: RE: [VirtualTreeview] New user

Hi Glenn

welcome to VT.

There are some demo apps in the files area of YG.
Showing text: have a look at the callback OnGetText. There you define what
the VT displays.

Heri

> -----Original Message-----
> From: Glenn MacGregor [mailto:[gtm@o...]]
> Sent: Thursday, December 13, 2001 6:52 PM
> To: virtualtreeview@yahoogroups.com
> Subject: [VirtualTreeview] New user
>
>
> Hi All,
>
> I am new to the virtual tree view. I am using it in
> C++builder 5. The String Tree works fine. Is there a good
> tutorial on using it? How do I set the name of the node
> (what I see on the screen)?
>
> Thanks
>
>
> [Non-text portions of this message have been removed]
>
>
> ------------------------ Yahoo! Groups Sponsor
> ---------------------~-->
> Unlimited calling with 3-way conferencing. Only $1/Mo.
> with CrystalVoice! FREE trial. Click Here.
> http://us.click.yahoo.com/Hb1xVB/HxbDAA/ySSFAA/i7folB/TM
> --------------------------------------------------------------
> -------~->
>
> To unsubscribe from this group, send an email to:
> VirtualTreeview-unsubscribe@egroups.com
>
>
>
> Your use of Yahoo! Groups is subject to
> http://docs.yahoo.com/info/terms/
>
>


re: New user

From: "Helge Jung \(ECO-Logic\)" [helge@e...]
Date: Thu Dec 13, 2001 5:57 pm
Subject: Re: [VirtualTreeview] New user

> I am new to the virtual tree view. I am using it in C++builder
> 5. The String Tree works fine. Is there a good tutorial on
> using it? How do I set the name of the node (what I see on the screen)?

There's a section called "Getting started" in the help file - maybe it helps
you on the way...

Helge.


Scrollbar color

From: "markatfm" [lholmes@s...]
Date: Thu Dec 13, 2001 6:38 pm
Subject: Scrollbar color

Are the VT scrollbars inherited from the common windows scrollbar
controls or are they written new for VT? The reason i ask is to
determine how much of a pain it will be to customize the scollbar
color.

Thanks,
Mark

 | Replies | Author | Date
4943 | Re: Scrollbar color | jimkueneman | Fri 12/14/2001


Last Version

From: "Andrew P.Rybin" [magicode@m...]
Date: Fri Dec 14, 2001 3:46 am
Subject: Last Version

Hello!

Where can i download last TV version?

PS:
And what version is last?
=====
Thank for patience!
Best regards,
Andrew P.Rybin

 | Replies | Author | Date
4940 | Re: Last Version | Illya Kysil | Fri 12/14/2001
4950 | Re: Last Version | Andrew P.Rybin | Sun 12/16/2001
4951 | Re: Last Version | Mike Lischke | Sun 12/16/2001
4952 | Re: Last Version | Andrew P.Rybin | Sun 12/16/2001


re: Last Version

From: "Illya Kysil" [ikysil@m...]
Date: Fri Dec 14, 2001 10:24 am
Subject: Re: [VirtualTreeview] Last Version

> Hello!
>
> Where can i download last TV version?
>
> PS:
> And what version is last?
AFAIK
http://www.lischke-online.de/VirtualTreeview/beta/VirtualTree_2.7.3.zip

Regards
Illya Kysil, software developer
Delphi/C/C++/Java/Forth/Assembler
If it is not SOURCE, it is not a SOFTWARE. (C) NASA


data as a pointer (BCB)

From: "Glenn MacGregor" [gtm@o...]
Date: Fri Dec 14, 2001 2:02 pm
Subject: data as a pointer (BCB)

Hi All,

Thanks for the responses. I hold my own datastructure (map of pointers to
objectx). Is there a way to set the data portion of the node (in oninitnode)
to that pointer. Right now I am copying the info.

By the way I just tried to use the bcb example treeview and the compile failed,
has anyone used that one?

Thanks

Glenn

[Non-text portions of this message have been removed]


OnFreeNode

From: "Glenn MacGregor" [gtm@o...]
Date: Fri Dec 14, 2001 4:09 pm
Subject: OnFreeNode

Hi Again,

I am getting a access violation in my app on exit. I am using BCB and I have
implemented the OnFreeNode function. The Nodes data is a struct with two
AnsiStrings, I set it right after I call AddChild I do the setting then I call
ValidateNode(node, false). Everything is fine if I don't expand anything or if
I only expand the first node. Do I need to call ValidateNode? It seems that
all that does is call onInit, I have already set my data so what should I
do/check for in the onInit function?

Thanks

[Non-text portions of this message have been removed]

 | Replies | Author | Date
4944 | Re: OnFreeNode | padagosta | Fri 12/14/2001


re: Scrollbar color

From: "jimkueneman" [jimdk@m...]
Date: Fri Dec 14, 2001 6:09 pm
Subject: Re: Scrollbar color

--- In [VirtualTreeview@y...], "markatfm" [lholmes@s...] wrote:
> Are the VT scrollbars inherited from the common windows scrollbar
> controls or are they written new for VT? The reason i ask is to
> determine how much of a pain it will be to customize the scollbar
> color.

Hi Mark,

If you define "UseFlatScrollbars" and the target platform has a
new enough Common control (4.71) dll then you can use Flat Scroll
bars in VT

http://msdn.microsoft.com/library/default.asp?url=/library/en-
us/shellcc/platform/CommCtls/FlatSB/Functions/FlatSB_GetScrollInfo.asp

Other than that they are normal windows defined scrollbars

Jim


re: OnFreeNode

From: "padagosta" [pdagosta@c...]
Date: Fri Dec 14, 2001 9:45 pm
Subject: Re: OnFreeNode

--- In [VirtualTreeview@y...], "Glenn MacGregor" [gtm@o...] wrote:
>Do I need to call ValidateNode? It seems that all that does is call
onInit, I have already set my data so what should I do/check for in
the onInit function?

OnFreeNode is only called for nodes that have been initialized. Nodes
are initialized on an as-needed basis. Nodes are initialized when they
are displayed for the first time; Children nodes are initialized when
their parent is expanded; etc.
Since you are initializing your nodes manually (not in an OnInitNode
callback) you must call ValidateNode for each Node created (including
children nodes) or at least add vsInitialized to Node.States.
You do not need an OnInitNode handler for manually initialized nodes.

Paul


VirtualTree_2.6.5 random image in imagelist?

From: "windmaomao" [windmaomao@h...]
Date: Sat Dec 15, 2001 6:31 am
Subject: VirtualTree_2.6.5 random image in imagelist?

I just downloaded 2.6.5;
It seemed there is a bug where vcl can not use the image in a
imagelist correctly.It just gave me random image in that imagelist.
Any idea?

 | Replies | Author | Date
4948 | Re: VirtualTree_2.6.5 random image in imagelist? | Mike Lischke | Sat 12/15/2001
4949 | Re: VirtualTree_2.6.5 random image in imagelist? | windmaomao | Sat 12/15/2001


re: Hint shadow

From: "Mike Lischke" [lists@l...]
Date: Sat Dec 15, 2001 11:02 am
Subject: RE: [VirtualTreeview] Hint shadow

Justin,

> Could you convert the hint ShadowSize constant to a property please?

This makes not much sense. Do you want different shadow sizes for a tree?

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net

 | Replies | Author | Date
4953 | Re: Hint shadow | Justin Turberville | Sun 12/16/2001
4991 | Re: Hint shadow | Mike Lischke | Sat 12/22/2001


re: onExpanding

From: "Mike Lischke" [lists@l...]
Date: Sat Dec 15, 2001 12:15 pm
Subject: RE: [VirtualTreeview] onExpanding

Hi silvenra,

> I look for double nodes at the "expanding-Event". Exists the node twice the=
n the node
> aren´t allowed to expand. It works great. But when I press the tr=
eeview-Shortcut "*"
> (to expand all the child and their children...) the "exp= anding-Event" will
ignore the
> allowed-set and open the node. Consequence: th= e tree will be in an infinite
loop. I
> want use the shortcut "*" further on. = Solution?

I wonder what your real problem is. FullExpand (which is called by pressing
'*') uses ToggleNode
which respects the result returned from DoExpanding (OnExpanding). You can
check this by simply
returning False all the time in OnExpanding. You will see that you can't expand
any node anymore.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: VirtualTree_2.6.5 random image in imagelist?

From: "Mike Lischke" [lists@l...]
Date: Sat Dec 15, 2001 7:38 pm
Subject: RE: [VirtualTreeview] VirtualTree_2.6.5 random image in imagelist?

> It seemed there is a bug where vcl can not use the image in a
> imagelist correctly.It just gave me random image in that imagelist.

Can we see some code please? I bet you did not check the ImageKind in the
event. You have to check
for ikNormal and ikSelected.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net

 | Replies | Author | Date
4949 | Re: VirtualTree_2.6.5 random image in imagelist? | windmaomao | Sat 12/15/2001


re: VirtualTree_2.6.5 random image in imagelist?

From: "windmaomao" [windmaomao@h...]
Date: Sat Dec 15, 2001 10:56 pm
Subject: Re: VirtualTree_2.6.5 random image in imagelist?

Thanks. It works again:).
This is really a good component!

--- In [VirtualTreeview@y...], "Mike Lischke" [lists@l...] wrote:
> > It seemed there is a bug where vcl can not use the image in a
> > imagelist correctly.It just gave me random image in that
imagelist.
>
> Can we see some code please? I bet you did not check the ImageKind
in the event. You have to check
> for ikNormal and ikSelected.
>
> Ciao, Mike
> --
> www.lischke-online.de
> www.delphi-unicode.net


re: Last Version

From: "Andrew P.Rybin" [magicode@m...]
Date: Sun Dec 16, 2001 7:58 am
Subject: Re: [VirtualTreeview] Last Version

> > Where can i download last TV version?
> >
> > PS:
> > And what version is last?
> AFAIK
> http://www.lischke-online.de/VirtualTreeview/beta/VirtualTree_2.7.3.zip
>
> Regards
> Illya Kysil, software developer

What version VT better all is recommended for using in commercial projects?

 | Replies | Author | Date
4951 | Re: Last Version | Mike Lischke | Sun 12/16/2001


re: Last Version

From: "Mike Lischke" [lists@l...]
Date: Sun Dec 16, 2001 8:43 am
Subject: RE: [VirtualTreeview] Last Version

> What version VT better all is recommended for using in commercial projects?

Since VT is used every day in my company for various inhouse tools as well as
most of our products
you can be assured it is stable enough for commercial use, even in its latest
(non-official)
version.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: Last Version

From: "Andrew P.Rybin" [magicode@m...]
Date: Sun Dec 16, 2001 9:04 am
Subject: Re: [VirtualTreeview] Last Version

> > What version VT better all is recommended for using in commercial
projects?
>
> Since VT is used every day in my company for various inhouse tools as well
as most of our products
> you can be assured it is stable enough for commercial use, even in its
latest (non-official)
> version.
>
> Ciao, Mike
Thank you!
But when will release (i see only one release v2.4)?


re: Hint shadow

From: "Justin Turberville" [justin@d...]
Date: Sun Dec 16, 2001 10:27 am
Subject: RE: [VirtualTreeview] Hint shadow

Mike

The reason I asked was that I was told to get rid of it, thus I set that
constant to 0 in the source, which is hardly ideal.

>> Could you convert the hint ShadowSize constant to a property please?

> This makes not much sense. Do you want different shadow sizes for a tree?

In a similar vein, I had to remove the OS exception raised when the OLE
drag&drop registration in the initialization section failed - it was failing
on certain win9x pc's in a particular implementation resulting in an invalid
page fault. Perhaps an assertion would be a better choice especially as that
feature is not likely to be used often.

Justin

 | Replies | Author | Date
4991 | Re: Hint shadow | Mike Lischke | Sat 12/22/2001


New release

From: "Mike Lischke" [lists@l...]
Date: Sun Dec 16, 2001 4:18 pm
Subject: New release

Hi all,

I would like to put a minor update to my web site. First however I'd like to
know more about bug #85 as it is the last open entry and I want to have it
closed. Ralf, how did you assign the node height? Did you use the property from
VT?

I'm also collecting now all files for the next distribution because I will make
it ready over christmas so I can post it early in the new year. I will not be
online from saturday (noon) next week until the end of the first week in the
new year. So I'll take what I get in the coming week. If anybody of you wants
to update a file then do it quickly and tell me privately what you have done.
I'm also open for further contributions to the official distribution. Just
contact me and send what you want to contribute so I can check it against the
latest VT build.

For the impatient I have uploaded
www.lischke-online.de/VirtualTreeview/beta/VirtualTree_2.7.5.zip. Depending on
Ralf's problem this must be updated however.

Have a nice week.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net

 | Replies | Author | Date
4955 | Re: New release | rm198de | Sun 12/16/2001
4957 | Re: New release | Mike Lischke | Sun 12/16/2001
4965 | Re: New release | rm198de | Tue 12/18/2001
4993 | Re: New release | Mike Lischke | Sat 12/22/2001
4956 | Re: New release | rm198de | Sun 12/16/2001


re: New release

From: "rm198de" [rmelles@g...]
Date: Sun Dec 16, 2001 5:51 pm
Subject: Re: New release

...Depending on Ralf's problem this must be updated however.
>
> Have a nice week.
>
> Ciao, Mike
> --
> www.lischke-online.de
> www.delphi-unicode.net

Hey Mike,

I'm not sitting on my developing-computer in the office, so I'm not
sure what I really did...

I think, I tried "TBaseVirtualTree.NodeHeight(Node):=0;"

I will do a remote-connection later this evening "I my wife doesn't
kill me until then" an check the used code... ;-)

have fun...

Ralf

 | Replies | Author | Date
4957 | Re: New release | Mike Lischke | Sun 12/16/2001
4965 | Re: New release | rm198de | Tue 12/18/2001
4993 | Re: New release | Mike Lischke | Sat 12/22/2001


re: New release

From: "rm198de" [rmelles@g...]
Date: Sun Dec 16, 2001 5:51 pm
Subject: Re: New release

...Depending on Ralf's problem this must be updated however.
>
> Have a nice week.
>
> Ciao, Mike
> --
> www.lischke-online.de
> www.delphi-unicode.net

Hey Mike,

I'm not sitting on my developing-computer in the office, so I'm not
sure what I really did...

I think, I tried "TBaseVirtualTree.NodeHeight(Node):=0;"

I will do a remote-connection later this evening "I my wife doesn't
kill me until then" an check the used code... ;-)

have fun...

Ralf


re: Re: New release

From: "Mike Lischke" [lists@l...]
Date: Sun Dec 16, 2001 6:08 pm
Subject: RE: [VirtualTreeview] Re: New release

> I will do a remote-connection later this evening "I my wife doesn't
> kill me until then" an check the used code... ;-)

OK, you can also contact me tomorrow if you are able to ;-) I'll be offline
after 22:00 for my
favoured game so ...

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net

 | Replies | Author | Date
4965 | Re: New release | rm198de | Tue 12/18/2001
4993 | Re: New release | Mike Lischke | Sat 12/22/2001


Bug #80

From: "Anders Thomsen" [anders@t...]
Date: Sun Dec 16, 2001 6:57 pm
Subject: Bug #80

Hi Mike,

I still don't get why bug #80 is "by design".

I've uploaded a small demo showing the problem:

http://groups.yahoo.com/group/VirtualTreeview/files/BugDemos/VT%20bug%2080.zip

Best regards and Happy xmas,
Thomsen

[Non-text portions of this message have been removed]

 | Replies | Author | Date
4959 | Re: Bug #80 | Mike Lischke | Sun 12/16/2001
4960 | Re: Bug #80 | jimkueneman | Sun 12/16/2001


re: Bug #80

From: "Mike Lischke" [lists@l...]
Date: Sun Dec 16, 2001 7:30 pm
Subject: RE: [VirtualTreeview] Bug #80

Hi Anders,

> I still don't get why bug #80 is "by design".
>
> I've uploaded a small demo showing the problem:

From the comments on the demo form it seems we are talking about two different
things. But
unfortunately I don't get what you mean. Your demo shows a black tree with some
nodes and when I
select one or more of them they are painted with the selection color. There is
nothing like a white
gap. I have only tried it on XP, so perhaps there is a difference between
Windows versions? Could
you please add a screen shot so that I can at least understand what the problem
is?

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net

 | Replies | Author | Date
4960 | Re: Bug #80 | jimkueneman | Sun 12/16/2001


re: Bug #80

From: "jimkueneman" [jimdk@m...]
Date: Sun Dec 16, 2001 8:05 pm
Subject: Re: Bug #80

Hi Mike,

> select one or more of them they are painted with the selection
color. There is nothing like a white
> gap. I have only tried it on XP, so perhaps there is a difference

Seems to work ok in Win2k D5 as well using VT 2.7.5

Jim


re: Bug #80

From: Vandrovec Milan [milan_va@s...]
Date: Mon Dec 17, 2001 11:10 am
Subject: RE: Bug #80

> There is nothing like a white gap.

It was present in 2.7.3, but is fixed in 2.7.5. (I could easily reproduce it
with 2.7.3, I have saved the screenshot, but it is irrelevant now, so it is
not uploaded).

Milan Vandrovec


Multi-Select and Right Click Problem

From: "el_guapo5" [rhymebusta@h...]
Date: Mon Dec 17, 2001 8:37 pm
Subject: Multi-Select and Right Click Problem

hi i was wondering if anyone has come across this problem:
everytime i want to multi-select some nodes by holding down CTRL and
then using the LEFT mouse button to SELECT the nodes and then i want
a popup menu to show(therefore i choose ANY NODE and press the RIGHT
mouse button) the node that is selected with the RIGHT mouse button
becomes unselected and is not included in the selected list of
PVirtualNode's that is returned of myTree->GetSortedSelection(false).
I've already tried using the OnMouseUp/Down OnGetPopupMenu, i even
tried using the myTree->HotNode property but to no avail....so does
anyone know what i mean? has anyone else come across this problem?
thanks for any help given

 | Replies | Author | Date
4977 | Re: Multi-Select and Right Click Problem | el_guapo5 | Wed 12/19/2001
4978 | Re: Multi-Select and Right Click Problem | Werner Lehmann | Wed 12/19/2001
4979 | Re: Multi-Select and Right Click Problem | el_guapo5 | Wed 12/19/2001
4983 | Re: Multi-Select and Right Click Problem | Jim Kueneman | Thu 12/20/2001
4980 | Re: Multi-Select and Right Click Problem | Werner Lehmann | Wed 12/19/2001
4987 | Re: Multi-Select and Right Click Problem | Werner Lehmann | Thu 12/20/2001
4988 | Re: Multi-Select and Right Click Problem | Jim Kueneman | Thu 12/20/2001


re: Bug #80

From: "Anders Thomsen" [anders@t...]
Date: Mon Dec 17, 2001 9:29 pm
Subject: Re: [VirtualTreeview] Bug #80

Hi Mike,

Sorry about this. I didn't know you had fixed it with ver. 2.7.5

-Thomsen
----- Original Message -----
From: Mike Lischke
To: VirtualTreeview@yahoogroups.com
Sent: Sunday, December 16, 2001 8:30 PM
Subject: RE: [VirtualTreeview] Bug #80

Hi Anders,

> I still don't get why bug #80 is "by design".
>
> I've uploaded a small demo showing the problem:

From the comments on the demo form it seems we are talking about two
different things. But
unfortunately I don't get what you mean. Your demo shows a black tree with
some nodes and when I
select one or more of them they are painted with the selection color. There
is nothing like a white
gap. I have only tried it on XP, so perhaps there is a difference between
Windows versions? Could
you please add a screen shot so that I can at least understand what the
problem is?

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net

Yahoo! Groups Sponsor
ADVERTISEMENT

To unsubscribe from this group, send an email to:
VirtualTreeview-unsubscribe@egroups.com

Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.

[Non-text portions of this message have been removed]


Problem overriding methods

From: Sanjay Kanade [skanade@v...]
Date: Tue Dec 18, 2001 4:27 am
Subject: Problem overriding methods

I want CopyTo to only copy the top level children. Since there is
no direct way to do this, I thought, I will override WriteChunks
and avoid writing children. However, if I override WriteChunks
in an inherited class, it gives lots of compilation errors
because lot of the record types that it needs are in implementation
section of the VirtualTree unit. I will be able to pull off
my compilation with some tweaking, but I think this issue should
be addressed in future versions so that all virtual methods will
be able to get the definitions for customizing the code.

BTW, this is a great component! Do you accept donations?

Thanks,
Sanjay

 | Replies | Author | Date
4992 | Re: Problem overriding methods | Mike Lischke | Sat 12/22/2001


re: New release

From: "rm198de" [rmelles@g...]
Date: Tue Dec 18, 2001 9:19 am
Subject: Re: New release

--- In [VirtualTreeview@y...], "Mike Lischke" [lists@l...] wrote:
> > I will do a remote-connection later this evening "I my wife
doesn't
> > kill me until then" an check the used code... ;-)
>
> OK, you can also contact me tomorrow if you are able to ;-) I'll be
offline after 22:00 for my
> favoured game so ...
>
> Ciao, Mike
> --
> www.lischke-online.de
> www.delphi-unicode.net

Hi Mike,

I`m not sure but I think I`m getting a little bit stupid in my
forehead! I saw the problem one week ago, but I cannot reproduce it
anymore. I`m not sure what I did, possibly nothing - the only thing I
was doing was cleaning up my harddisk. Maybe I deleted some old
dcu´s ... ;-)

So don`t get sweat about this - might be a stupid STOP!!!!!
Right in this moment I`ve got the problem again!!!!!

Trying to explain:

I have 2 RootNodes (MainRoot & DelRoot) - Both with NodeHeight=0
(Using MainRoot.NodeHeight:=0;)

- MainRoot has 25 Childs; DelRoot has no Childs
- MainRoot is not visible (because of the NodeHeight) but expanded

Now, VT is showing the 25 ChildNodes + 2 empty lines!

OK, now I try to hide the Childs by collapsing MainRoot and trying to
expand DelRoot (remember: DelRoot has no childs right now)

VST.Expanded[MainRoot]:=True;
VST.Expanded[DelRoot]:=False;

And roll back to MainRoot by expanding MainRoot & collapsing DelRoot.

VST.Expanded[DelRoot]:=True;
VST.Expanded[MainRoot]:=False;

Now VT is showing the 25 Childs again + 1 empty line!!!!!

Sounds weared, right? Think so too ;-)
I cannot produce a small sample, because I`m still running out of
time, but if you cannot reproduce it, maybe I can send you the
application...

Take care
Ralf

 | Replies | Author | Date
4993 | Re: New release | Mike Lischke | Sat 12/22/2001


Help!

From: "Lolo Robo" [luo73@m...]
Date: Tue Dec 18, 2001 3:06 pm
Subject: Help!

Hi,sir:
I have tried to install the package downloaded on the Homepage of
VirtualTreeview in my C++Builder5.0 Acording to the help file("Virtual
Tree.chm") and succeed,but I failed when I use the virtualTree in my program.A
error occur as follows:

[C++ Error] VirtualTrees.hpp(523): E2076 Overloadable operator expected

And this is the Row 523 in VirtualTrees.hpp:

public:
operator IDropTarget*(void) { return (IDropTarget*)&__IDropTarget; }

What can I do?

Thanks for your attention.´ÓÍøÕ¾µÃµ½¸ü¶àÐÅÏ¢¡£MSN Explorer
Ãâ·ÑÏÂÔØ:http://explorer.msn.com/lccn

[Non-text portions of this message have been removed]

 | Replies | Author | Date
4968 | Re: Help! | el_guapo5 | Tue 12/18/2001
4969 | Re: Help! | el_guapo5 | Tue 12/18/2001


Sort progress?

From: Sanjay Kanade [skanade@v...]
Date: Tue Dec 18, 2001 3:43 pm
Subject: Sort progress?

When a sort is in progress, I want to give a progress bar to the user.
Any ideas on what events or modifications to make to the vtree to
get the progress indicators? I am not asking the GUI question, I know
how to add a progress bar. What I need is a sort of property, callback
or event to show how much sorting is done.

Thanks,
Sanjay

 | Replies | Author | Date
4970 | Re: Sort progress? | Jim Kueneman | Wed 12/19/2001
4971 | Re: Sort progress? | rm198de | Wed 12/19/2001
4972 | Re: Sort progress? | Wim van der Vegt | Wed 12/19/2001
4995 | Re: Sort progress? | Mike Lischke | Sat 12/22/2001
4994 | Re: Sort progress? | Mike Lischke | Sat 12/22/2001
5022 | Re: Sort progress? | Wim van der Vegt | Fri 12/28/2001


re: Help!

From: "el_guapo5" [rhymebusta@h...]
Date: Tue Dec 18, 2001 8:30 pm
Subject: Re: Help!

--- In [VirtualTreeview@y...], "Lolo Robo" [luo73@m...] wrote:
> Hi,sir:
> I have tried to install the package downloaded on the Homepage of
VirtualTreeview in my C++Builder5.0 Acording to the help file
("Virtual Tree.chm") and succeed,but I failed when I use the
virtualTree in my program.A error occur as follows:
>
> [C++ Error] VirtualTrees.hpp(523): E2076 Overloadable operator
expected
>
> And this is the Row 523 in VirtualTrees.hpp:
>
> public:
> operator IDropTarget*(void) { return (IDropTarget*)
&__IDropTarget; }
>

comment out that section where it says
public:
operator IDropTarget*(void) { return (IDropTarget*)
&__IDropTarget; }
operator IDropSource*(void) { return (IDropSource*)
&__IDropSource; }
operator IDataObject*(void) { return (IDataObject*)
&__IDataObject; }

and then re-compile.

 | Replies | Author | Date
4969 | Re: Help! | el_guapo5 | Tue 12/18/2001


re: Help!

From: "el_guapo5" [rhymebusta@h...]
Date: Tue Dec 18, 2001 8:31 pm
Subject: Re: Help!

> comment out that section where it says
> public:
> operator IDropTarget*(void) { return (IDropTarget*)
> &__IDropTarget; }
> operator IDropSource*(void) { return (IDropSource*)
> &__IDropSource; }
> operator IDataObject*(void) { return (IDataObject*)
> &__IDataObject; }
>
>
> and then re-compile.
oops i forgot to mentiont that it's in the .hpp file and also,
comment out the "public:" part also.


re: Sort progress?

From: Jim Kueneman [jimdk@m...]
Date: Wed Dec 19, 2001 1:10 am
Subject: Re: [VirtualTreeview] Sort progress?

Hi,

>get the progress indicators? I am not asking the GUI question, I know
>how to add a progress bar. What I need is a sort of property, callback
>or event to show how much sorting is done.

It does not look like it does based on the code. I am not sure where you
could tap into it and get useful information.

Jim

 | Replies | Author | Date
4971 | Re: Sort progress? | rm198de | Wed 12/19/2001


re: Sort progress?

From: "rm198de" [rmelles@g...]
Date: Wed Dec 19, 2001 8:27 am
Subject: Re: Sort progress?

--- In [VirtualTreeview@y...], Jim Kueneman [jimdk@m...] wrote:
>
> Hi,
>
> >get the progress indicators? I am not asking the GUI question, I
know
> >how to add a progress bar. What I need is a sort of property,
callback
> >or event to show how much sorting is done.

Hi,

maybe you can use following:

1. Store the total count of Nodes in your progress.max property
2. start sorting manually
3. in the sortroutine increment the progress.position (maybe check
here too, if the position reached the max value and hide the
progressbar)

Regards
Ralf


re: Sort progress?

From: "Wim van der Vegt" [wvd_vegt@k...]
Date: Wed Dec 19, 2001 12:35 pm
Subject: Re: [VirtualTreeview] Sort progress?

Hi,

All you need to know is how often the OnCompareNodes is called. This depends on
the
number of nodes to be sorted and the sort algoritme used. So the hook is
already
there in a way (the OnCompareNodes ).

The worst case number of compares for plain MergeSort is n*log2(n).
I did some testing and it seems closer to 50-60% of it so perhaphs it's a
slightly improved version of merge sort.

Strange comments in the VT sources is the following statement:

// The idea behind this code is to use a kind of reverse merge sort.
QuickSort is quite fast
// and would do the job here too but has a serious problem with already
sorted lists like FSelection.

I tried both sorted/reversed and random lists and didn't see any differences in
the count.

Quicksort only performs bad on a specifically ordered array (not reverse or
already ordered but very specially ordered).
It performs n*log2(n) most of the time but worst case is n*n. MergeSort is of
n*log2(n) order but can lead to storage problems due to the merging.

But searching on the internet reveils :

>When Quicksort is implemented well, it is typically 2-3 times faster than
mergesort or heapsort. The primary reason is that >the operations in the
innermost loop are simpler.

Code used :

procedure TForm1.VirtualStringTree1CompareNodes(Sender: TBaseVirtualTree;
Node1, Node2: PVirtualNode; Column: Integer; var Result: Integer);
var
n1,n2 : Integer;
begin
n1:=Integer(Sender.GetNodeData(Node1)^);
n2:=Integer(Sender.GetNodeData(Node2)^);
if (n1>n2)
then Result:=1
else
if (n1=n2)
then Result:= 0
else Result:=-1;
Inc(fCnt);
StatusBar1.Panels[0].Text:=IntToStr(fCnt);
ProgressBar1.Position:=fCnt;
end;

procedure TForm1.Button1Click(Sender: TObject);
var
i : Integer;
begin
VirtualStringTree1.Clear;
VirtualStringTree1.NodeDataSize:=Sizeof(Integer);
for i:=1 to siz do

PInteger(VirtualStringTree1.GetNodeData(VirtualStringTree1.AddChild(nil,nil)))^:\
=siz-i;
fCnt:=0;
ProgressBar1.Max :=Round(siz*Log2(siz)/2);
ProgressBar1.Position:=fCnt;
StatusBar1.Panels[1].Text:=FloatToStr(siz*Log2(siz));
end;

procedure TForm1.VirtualStringTree1GetText(Sender: TBaseVirtualTree;
Node: PVirtualNode; Column: Integer; TextType: TVSTTextType;
var Text: WideString);
begin
Text:=IntToStr(Integer(Sender.GetNodeData(Node)^));
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
VirtualStringTree1.SortTree(0,sdAscending);
end;

----------------
Wim van der Vegt

[Non-text portions of this message have been removed]

 | Replies | Author | Date
4995 | Re: Sort progress? | Mike Lischke | Sat 12/22/2001


Drag and Drop Help

From: "Glenn MacGregor" [gtm@o...]
Date: Wed Dec 19, 2001 2:55 pm
Subject: Drag and Drop Help

Hi All,

I am using virtualtreeview for an app that accesses a database. I have got
working drag and drop from within a single tree and from one tree to another.
I am now stuck on the following problem: when I drag from one to another I
first want to check if the node I am dragging (dropping) already exists in the
tree I am dropping on, so I do a check in the NodeCopied function to see if the
name exists in the database if it does I don't add it to the database, but for
some reason it still gets added to the tree. I am not sure where that addition
happens. I use ProcessDrop in the dragdrop functions. Is there a way to get a
TVirutalNode from the DataObject that is passed into dragdrop?

Thanks

Glenn

[Non-text portions of this message have been removed]

 | Replies | Author | Date
4984 | Re: Drag and Drop Help | Jim Kueneman | Thu 12/20/2001


Initialize Problem with newer VirtualTreeView

From: "tsoyran" [tsoyran@o...]
Date: Wed Dec 19, 2001 3:29 pm
Subject: Initialize Problem with newer VirtualTreeView

I Updated to the last versions of VirtualTreeView but after the
changes running my application I get starting this error
"The application failed to initialize properly (0xc0000005)"
and then the CPU window in an ntDll.RtlWaitForCriticalSection

I thought that was my mistake so I tried with an empty project (just
a button and a TVirtualStringTree, not any code at all) but I get the
same error.
When I insert a TVirtualDrawTree I didn't get the same error.

I have w2k Serv pack 2,
Delphi 5 With Update pack 1
and I tried both newer versions 2.7.3 and 2.6.11
Please can you help me
(my old vers was 2.0)

 | Replies | Author | Date
4975 | Re: Initialize Problem with newer VirtualTreeView | Helge Jung (ECO-Logic) | Wed 12/19/2001
4976 | Re: Initialize Problem with newer VirtualTreeView | Helge Jung (ECO-Logic) | Wed 12/19/2001
4981 | Re: Initialize Problem with newer VirtualTreeView | tsoyran | Wed 12/19/2001
4982 | Re: Initialize Problem with newer VirtualTreeView | Helge Jung (ECO-Logic) | Wed 12/19/2001
4985 | Re: Initialize Problem with newer VirtualTreeView | tsoyran | Thu 12/20/2001
4996 | Re: Initialize Problem with newer VirtualTreeView | Mike Lischke | Sat 12/22/2001
5003 | Re: Initialize Problem with newer VirtualTreeView | Tsourinakis Antonis | Sat 12/22/2001


re: Initialize Problem with newer VirtualTreeView

From: "Helge Jung \(ECO-Logic\)" [helge@e...]
Date: Wed Dec 19, 2001 4:22 pm
Subject: RE: [VirtualTreeview] Initialize Problem with newer VirtualTreeView

> I tried both newer versions 2.7.3 and 2.6.11

IIRC there's already a 2.7.5 ... try it with that version. But your error
doesn't seem to have to do with VT... do you have installed or deleted any
other components, language packs or something like these?

Helge.


re: Initialize Problem with newer VirtualTreeView

From: "Helge Jung \(ECO-Logic\)" [helge@e...]
Date: Wed Dec 19, 2001 4:24 pm
Subject: Re: [VirtualTreeview] Initialize Problem with newer VirtualTreeView

> I Updated to the last versions of VirtualTreeView [...]
> (my old vers was 2.0)

Did you upgrade directly? If so there are maybe some old DCUs from 2.0
left - either delete them or in the package, click right on the package name
in the "package explorer" and select "Build"... Delphi should recompile all
files included in the package (I mean the VT-package).

Helge.

 | Replies | Author | Date
4981 | Re: Initialize Problem with newer VirtualTreeView | tsoyran | Wed 12/19/2001
4982 | Re: Initialize Problem with newer VirtualTreeView | Helge Jung (ECO-Logic) | Wed 12/19/2001
4985 | Re: Initialize Problem with newer VirtualTreeView | tsoyran | Thu 12/20/2001
4996 | Re: Initialize Problem with newer VirtualTreeView | Mike Lischke | Sat 12/22/2001
5003 | Re: Initialize Problem with newer VirtualTreeView | Tsourinakis Antonis | Sat 12/22/2001


re: Multi-Select and Right Click Problem

From: "el_guapo5" [rhymebusta@h...]
Date: Wed Dec 19, 2001 6:08 pm
Subject: Re: Multi-Select and Right Click Problem

--- In [VirtualTreeview@y...], "el_guapo5" [rhymebusta@h...] wrote:
> hi i was wondering if anyone has come across this problem:
> everytime i want to multi-select some nodes by holding down CTRL
and
> then using the LEFT mouse button to SELECT the nodes and then i
want
> a popup menu to show(therefore i choose ANY NODE and press the
RIGHT
> mouse button) the node that is selected with the RIGHT mouse button
> becomes unselected and is not included in the selected list of
> PVirtualNode's that is returned of myTree->GetSortedSelection
(false).
> I've already tried using the OnMouseUp/Down OnGetPopupMenu, i even
> tried using the myTree->HotNode property but to no avail....so does
> anyone know what i mean? has anyone else come across this problem?
> thanks for any help given
um....if no one understands this question do they want me to re-word
it? i just wanna know if anyone has come across this same problem
before or if it's been discussed....i checked the archives but didn't
find anything that really helped.


re: Re: Multi-Select and Right Click Problem

From: Werner Lehmann [wl@b...]
Date: Wed Dec 19, 2001 7:16 pm
Subject: Re: [VirtualTreeview] Re: Multi-Select and Right Click Problem

el_guapo5 wrote:
>
> um....if no one understands this question do they want me to re-word
> it? i just wanna know if anyone has come across this same problem
> before or if it's been discussed....i checked the archives but didn't
> find anything that really helped.

usually I work around this "feature" as it is rather annoying. Not anymore
since VT of course. But, VT does not support it yet. You can try and work-
around it by switching focus and selection after rightclick and context
menu or put it on the wishlist.

Werner

 | Replies | Author | Date
4979 | Re: Multi-Select and Right Click Problem | el_guapo5 | Wed 12/19/2001
4983 | Re: Multi-Select and Right Click Problem | Jim Kueneman | Thu 12/20/2001


re: Multi-Select and Right Click Problem

From: "el_guapo5" [rhymebusta@h...]
Date: Wed Dec 19, 2001 7:59 pm
Subject: Re: Multi-Select and Right Click Problem

> usually I work around this "feature" as it is rather annoying. Not
anymore
> since VT of course. But, VT does not support it yet. You can try
and work-
> around it by switching focus and selection after rightclick and
context
> menu or put it on the wishlist.
>
> Werner

what do u mean "Not since VT of course"?


re: Re: Multi-Select and Right Click Problem

From: Werner Lehmann [wl@b...]
Date: Wed Dec 19, 2001 7:27 pm
Subject: Re: [VirtualTreeview] Re: Multi-Select and Right Click Problem

el_guapo5 wrote:
>
> > usually I work around this "feature" as it is rather annoying. Not
> anymore
> > since VT of course. But, VT does not support it yet. You can try
> and work-
> > around it by switching focus and selection after rightclick and
> context
> > menu or put it on the wishlist.
> >
> > Werner
>
> what do u mean "Not since VT of course"?

That the "feature" is not annoying with VT because VT does not do this.
Hence I do not have to work around it.

Werner


re: Initialize Problem with newer VirtualTreeView

From: "tsoyran" [tsoyran@o...]
Date: Wed Dec 19, 2001 9:40 pm
Subject: Re: Initialize Problem with newer VirtualTreeView

Thanks for your answers.
I have a very large project (more than 80000 lines) and I used
recently the VT (ver 2) with no problem. I Updated with ver 2.6.11
and then with 2.7.3 and except some minor problems (with the
different checkstates and the renaming of some methods, everything is
OK.

As this project is too heavy for experiments I tried to make a small
one to try some conditions with the VT. So here is were the problem
arises:
In this second almost empty project the VT arises the error I
mention. In the large one everything is ok.
This sounds crazy but I tried a lot of times, switching from one
project to other and with tha same results.
I don't know how to face all these.
(I deleted any VirtualTree*.= from my computer, I reinstaled the new
version, I build the big project and runs ok,
then
a)I made a new project with a form,
b) add a Button, build run ,ok
c) Add VT build ok, run I get exception.
Thats all.

Where can I found the version you mention ?

 | Replies | Author | Date
4982 | Re: Initialize Problem with newer VirtualTreeView | Helge Jung (ECO-Logic) | Wed 12/19/2001
4985 | Re: Initialize Problem with newer VirtualTreeView | tsoyran | Thu 12/20/2001
4996 | Re: Initialize Problem with newer VirtualTreeView | Mike Lischke | Sat 12/22/2001
5003 | Re: Initialize Problem with newer VirtualTreeView | Tsourinakis Antonis | Sat 12/22/2001


re: Re: Initialize Problem with newer VirtualTreeView

From: "Helge Jung \(ECO-Logic\)" [helge@e...]
Date: Wed Dec 19, 2001 10:02 pm
Subject: Re: [VirtualTreeview] Re: Initialize Problem with newer VirtualTreeView

> Where can I found the version you mention ?
>

www.lischke-online.de/VirtualTreeview/beta/VirtualTree_2.7.5.zip.

See also Mike's Message from Sunday, 16.12.2001 for this.

Helge.

 | Replies | Author | Date
4985 | Re: Initialize Problem with newer VirtualTreeView | tsoyran | Thu 12/20/2001


re: Re: Multi-Select and Right Click Problem

From: Jim Kueneman [jimdk@m...]
Date: Thu Dec 20, 2001 1:40 am
Subject: Re: [VirtualTreeview] Re: Multi-Select and Right Click Problem

>since VT of course. But, VT does not support it yet. You can try and work-
>around it by switching focus and selection after rightclick and context
>menu or put it on the wishlist.

I never noticed this. Is this by design Werner?

Jim


re: Drag and Drop Help

From: Jim Kueneman [jimdk@m...]
Date: Thu Dec 20, 2001 1:45 am
Subject: Re: [VirtualTreeview] Drag and Drop Help

Hi Glenn

>f the node I am dragging (dropping) already exists in the tree I am
>dropping on, so I do a check in the NodeCopied function to see if the name
>exists in the database if it does I don't add it to the database, but for
>some reason it still gets added to the

Take a look at OnNodeCopying instead of Copied. By OnNodeCopied it is too
late.

Jim


re: Initialize Problem with newer VirtualTreeView

From: "tsoyran" [tsoyran@o...]
Date: Thu Dec 20, 2001 7:03 am
Subject: Re: Initialize Problem with newer VirtualTreeView

--- In [VirtualTreeview@y...], "Helge Jung \(ECO-Logic\)" [helge@e...]
wrote:
> > Where can I found the version you mention ?
> >
>
> www.lischke-online.de/VirtualTreeview/beta/VirtualTree_2.7.5.zip.
>
> See also Mike's Message from Sunday, 16.12.2001 for this.
>
> Helge.

Thanks a lot

I Downloaded and installed it but unfortunately the same results.
Anyway I think that I must stay back in ver 2 as don't know what to
try.

Antonis Tsourinakis, Piraeus, Greece


Editor autosize.

From: GIANNAKOPOULOS KOSTAS [kyan@s...]
Date: Thu Dec 20, 2001 9:08 am
Subject: Editor autosize.

Good morning mike.

I remember reading that you were trying to close the buglist in YG, so i'm
reporting this directly:

I believe that in grid mode the editor sould not try to autosize itself when
you type as it does now but it should always occupy the whole cell rect.
Don't you agree?

Thank you.

<KY>

 | Replies | Author | Date
4997 | Re: Editor autosize. | Mike Lischke | Sat 12/22/2001


re: Re: Multi-Select and Right Click Problem

From: Werner Lehmann [wl@b...]
Date: Thu Dec 20, 2001 10:45 am
Subject: Re: [VirtualTreeview] Re: Multi-Select and Right Click Problem

Jim Kueneman wrote:
>
> >since VT of course. But, VT does not support it yet. You can try and work-
> >around it by switching focus and selection after rightclick and context
> >menu or put it on the wishlist.
>
> I never noticed this. Is this by design Werner?

By design of what? I already wrote in this thread what the comctrl TTreeview
does on right click - and VT is different here (thank god IMO).

Werner

 | Replies | Author | Date
4988 | Re: Multi-Select and Right Click Problem | Jim Kueneman | Thu 12/20/2001


re: Re: Multi-Select and Right Click Problem

From: Jim Kueneman [jimdk@m...]
Date: Thu Dec 20, 2001 12:07 pm
Subject: Re: [VirtualTreeview] Re: Multi-Select and Right Click Problem

To be honest I didn't understand your post, either of them <g>

> > I never noticed this. Is this by design Werner?
>
>By design of what? I already wrote in this thread what the comctrl TTreeview
>does on right click - and VT is different here (thank god IMO).

Huh now I don't see what I thought I saw yesterday. Forget it. Too much
holiday cheer I guess ;^)

Jim


Setting Screen->Cursor

From: "Glenn MacGregor" [gtm@o...]
Date: Fri Dec 21, 2001 1:59 pm
Subject: Setting Screen->Cursor

Hi All,

I tried to set the Screen->Cursor = crHourGlass for a lengthy operation. If I
am over anything but the treeview it is the hourglass but when I am over the
treeview I get the regular cursor. Is there a way to make the treeview obey
the Screen->Cursor variable?

Thanks

Glenn

[Non-text portions of this message have been removed]

 | Replies | Author | Date
4990 | Re: Setting Screen->Cursor | Helge Jung (ECO-Logic) | Fri 12/21/2001
4998 | Re: Setting Screen->Cursor | Mike Lischke | Sat 12/22/2001


re: Setting Screen->Cursor

From: "Helge Jung \(ECO-Logic\)" [helge@e...]
Date: Fri Dec 21, 2001 2:06 pm
Subject: Re: [VirtualTreeview] Setting Screen->Cursor

> Is there a way to make the treeview obey the
> Screen->Cursor variable?

IIRC VST has also a Cursor variable...

Maybe it has also an OnGetCursor (just thinking - haven't checked).

Helge.


re: Hint shadow

From: "Mike Lischke" [lists@l...]
Date: Sat Dec 22, 2001 10:43 am
Subject: RE: [VirtualTreeview] Hint shadow

Hi Justin,

> The reason I asked was that I was told to get rid of it, thus I set that
> constant to 0 in the source, which is hardly ideal.

This is totally ok. This is the reason why I used a constant instead hard
coding it. Not many people
will want to customize the shadow size (5 is the value also used by W2K and XP).

> In a similar vein, I had to remove the OS exception raised when the OLE
> drag&drop registration in the initialization section failed - it was failing
> on certain win9x pc's in a particular implementation resulting in an invalid
> page fault. Perhaps an assertion would be a better choice especially as that
> feature is not likely to be used often.

Better try to find out why it fails instead handling only symptoms. An error
message usually tells
something important ;-)

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: Problem overriding methods

From: "Mike Lischke" [lists@l...]
Date: Sat Dec 22, 2001 11:50 am
Subject: RE: [VirtualTreeview] Problem overriding methods

Hi Sanjay,

> I want CopyTo to only copy the top level children. Since there is
> no direct way to do this, I thought, I will override WriteChunks
> and avoid writing children.

Mmmh, this is quite tricky as you are trying to modify the streaming mechanism
in a way which is not
intended. In your situation it would be better to write a simple method which
creates nodes and
assigns all source to the appropriated target nodes. This will avoid using all
the streaming stuff
for this very special case.

> BTW, this is a great component! Do you accept donations?

Thank you. Yes, getting donations is one of the major goals why I made the tree
open source.
However, today I'm the last day online for the next 3 weeks, so I cannot answer
if you send
something to me. Once I'm back I plan to publish the VT version officially (if
nothing bad happens
meanwhile). So you donation must be ready to include without much work by me.
Can you make it so?

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: Re: New release

From: "Mike Lischke" [lists@l...]
Date: Sat Dec 22, 2001 12:40 pm
Subject: RE: [VirtualTreeview] Re: New release

Hi Ralf,

> - MainRoot has 25 Childs; DelRoot has no Childs
> - MainRoot is not visible (because of the NodeHeight) but expanded
>
> Now, VT is showing the 25 ChildNodes + 2 empty lines!

Sorry, but I still cannot reproduce this behavior. How do you set the node
height? Can you please
upload a demo which shows the problem?

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: Sort progress?

From: "Mike Lischke" [lists@l...]
Date: Sat Dec 22, 2001 12:43 pm
Subject: RE: [VirtualTreeview] Sort progress?

Hi Sanjay,

> When a sort is in progress, I want to give a progress bar to the user.
> Any ideas on what events or modifications to make to the vtree to
> get the progress indicators?

The main problem is that it is not known in advance how many comparisons must
be made to sort the
tree. So you cannot setup a maximum amount. There is a worst case of course but
I think it looks
quite strange when the progressbar does not go to the end when less than the
worst case comparisons
are made (which is of course the general case).

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: Sort progress?

From: "Mike Lischke" [lists@l...]
Date: Sat Dec 22, 2001 12:59 pm
Subject: RE: [VirtualTreeview] Sort progress?

Hi Wim,

> Strange comments in the VT sources is the following statement:
>
> // The idea behind this code is to use a kind of reverse merge sort.
QuickSort is quite fast
> // and would do the job here too but has a serious problem with already
sorted lists
> like FSelection.

You mixed something here. The case above applies to sorting the selection
array. This has nothing to
do with sorting the tree. The latter is done using a merge sort on linked lists
(as VT uses
internally).

> >When Quicksort is implemented well, it is typically 2-3 times faster than
mergesort or
> heapsort. The primary reason is that >the operations in the innermost loop
are simpler.

The point here is that quick sort does not work with linked lists. The fastest
algorithm I found was
the merge sort (Robert Sedgewick, "Algorithms in C++", Edison Wesly).

> ProgressBar1.Max :=Round(siz*Log2(siz)/2);
> ProgressBar1.Position:=fCnt;

As i already wrote, the worst case is often not reached and so the progress bar
often does not reach
the end in such an implementation. However for *some* feedback it is perhaps
good enough.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: Re: Initialize Problem with newer VirtualTreeView

From: "Mike Lischke" [lists@l...]
Date: Sat Dec 22, 2001 1:03 pm
Subject: RE: [VirtualTreeview] Re: Initialize Problem with newer VirtualTreeView

> (I deleted any VirtualTree*.= from my computer, I reinstaled the new
> version, I build the big project and runs ok,
> then
> a)I made a new project with a form,
> b) add a Button, build run ,ok
> c) Add VT build ok, run I get exception.

This is very strange because simply adding a VT does not crash, otherwise
nobody could use VT. You
should check why the initialization failed. I can't be so difficult to step
through the code to find
the offending line.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net

 | Replies | Author | Date
5003 | Re: Initialize Problem with newer VirtualTreeView | Tsourinakis Antonis | Sat 12/22/2001


re: Editor autosize.

From: "Mike Lischke" [lists@l...]
Date: Sat Dec 22, 2001 1:20 pm
Subject: RE: [VirtualTreeview] Editor autosize.

Hi Kostas,

> I remember reading that you were trying to close the buglist in YG, so i'm
> reporting this directly:

The bug list is still open and used. I closed the todo list and moved the
remaining entries to the
wish list.

> I believe that in grid mode the editor sould not try to autosize itself when
> you type as it does now but it should always occupy the whole cell rect.
> Don't you agree?

Yes, I do. Changed.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: Setting Screen->Cursor

From: "Mike Lischke" [lists@l...]
Date: Sat Dec 22, 2001 1:34 pm
Subject: RE: [VirtualTreeview] Setting Screen->Cursor

Hi Glenn,

> I tried to set the Screen->Cursor = crHourGlass for a lengthy operation. If
I am over
> anything but the treeview it is the hourglass but when I am over the treeview
I get the
> regular cursor. Is there a way to make the treeview obey the Screen->Cursor
variable?

This was a mistake in the implementation and is fixed now.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


bug list

From: "Mike Lischke" [lists@l...]
Date: Sat Dec 22, 2001 1:55 pm
Subject: bug list

Hi all,

some notes to the recently added bug entries:

#85 Ralf, as I already wrote, I cannot reproduce the problem.
#86 Wim, indeed this was a leftover from the original code.
#87 Jim, I wonder how that could happen. I have always taken care that edits
scroll with the tree. Also, everything works correctly here.
#88 Frank, your entry is wrong there. This is not a bug but an entry for the
wish list. And even then I don't see any need for the file you posted. Most of
the characters are translated one-to-one, so the whole translation makes nearly
no sense. Secondly, the loop is accessing/writing characters one at a time,
this is very slow. And thirdly, why do you need that at all? VT uses Unicode,
we don't have to care about ANSI stuff anymore. The HTML code created by VT
uses UTF-8 as encoding.

Btw: Please everyone deletes his/her bug demos if no longer needed. Also if you
have other outdated files in the YG file area then remove them!

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net

 | Replies | Author | Date
5000 | Re: bug list | Jim Kueneman | Sat 12/22/2001
5001 | Re: bug list | Jim Kueneman | Sat 12/22/2001
5002 | Re: bug list | Mike Lischke | Sat 12/22/2001
5006 | Re: bug list | rm198de | Sun 12/23/2001
5009 | Re: bug list | rm198de | Sun 12/23/2001
5103 | Re: bug list | Mike Lischke | Thu 1/10/2002


re: bug list

From: Jim Kueneman [jimdk@m...]
Date: Sat Dec 22, 2001 2:28 pm
Subject: Re: [VirtualTreeview] bug list

>#87 Jim, I wonder how that could happen. I have always taken care that
>edits scroll with the tree. Also, everything works correctly here.

Sorry Mike I am alway too quick to blame VT <g>. I just tried a simple VST
demo and it works right. I must be doing something in VET to screw it up.

Jim


re: bug list

From: Jim Kueneman [jimdk@m...]
Date: Sat Dec 22, 2001 2:44 pm
Subject: Re: [VirtualTreeview] bug list

Sorry for the too quick response,

>#87 Jim, I wonder how that could happen. I have always taken care that
>edits scroll with the tree. Also, everything works correctly here.

It is VT Mike. The problem is when you are using a background image. If
you have toShowBackground option set the editbox does not scroll with the tree.

Jim

 | Replies | Author | Date
5002 | Re: bug list | Mike Lischke | Sat 12/22/2001


re: bug list

From: "Mike Lischke" [lists@l...]
Date: Sat Dec 22, 2001 3:56 pm
Subject: RE: [VirtualTreeview] bug list

Jim,

> It is VT Mike. The problem is when you are using a background image. If
> you have toShowBackground option set the editbox does not scroll with the
tree.

Thanks for letting me know. I was not aware of this bug. Well, I always wanted
to know what
DeferWindowPos is for. Now I know it ;-)

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: Re: Initialize Problem with newer VirtualTreeView

From: "Tsourinakis Antonis" [tsoyran@o...]
Date: Sat Dec 22, 2001 7:19 pm
Subject: RE: [VirtualTreeview] Re: Initialize Problem with newer VirtualTreeView

Thanks for your answer

Finally I solved it
I tried the same steps in a Win98 environment with the same components
installed in D5.
As a result there was not problem.
Then I tried again in win2000 and I found that the problem is in the
InitializeGlobalStructures in Watcher := TCriticalSection.Create.
I tried to find why in a big project with ~120 not auto created forms was
no problem and after a little checking I found that the problem is with the
component (?) W2kDebugFix50.bpl from Dennis M. Passmore for the w2000
debug fix, which sets a delay.
I don't know exactly what it does but as a read in the NG it was a must for
a W2000 and delphi 5.
I disabled it and now there is no problem ( I hope to have no problem in
the future also)
If I found something more I will let you know.
Any way, thanks a lot and keep up your excellent work.

Antonis Tsourinakis
Piraeus - Greece

*********** STAR OF ORIGINAL MESSAGE ***********

On 22/12/2001 at 2:03 ìì Mike Lischke wrote:

>> (I deleted any VirtualTree*.= from my computer, I reinstaled the new
>> version, I build the big project and runs ok,
>> then
>> a)I made a new project with a form,
>> b) add a Button, build run ,ok
>> c) Add VT build ok, run I get exception.
>
>This is very strange because simply adding a VT does not crash, otherwise
>nobody could use VT. You
>should check why the initialization failed. I can't be so difficult to
>step through the code to find
>the offending line.
>
>
>Ciao, Mike
>--
>www.lischke-online.de
>www.delphi-unicode.net


Where is the latest "virtual treeview" beta and a help file ?

From: "fastpartner" [m.jensen@w...]
Date: Sun Dec 23, 2001 11:10 am
Subject: Where is the latest "virtual treeview" beta and a help file ?

Hello,

Can anybody tell me where exactly I can find the latest version ( or
beta ) of "virtual treeview" and a help file ?

Thanks,
Matthias J.

 | Replies | Author | Date
5005 | Re: Where is the latest "virtual treeview" beta a | Helge Jung (ECO-Logic) | Sun 12/23/2001


re: Where is the latest "virtual treeview" beta and a help file ?

From: "Helge Jung \(ECO-Logic\)" [helge@e...]
Date: Sun Dec 23, 2001 11:30 am
Subject: Re: [VirtualTreeview] Where is the latest "virtual treeview" beta and a help file ?

> Can anybody tell me where exactly I can find the latest version ( or
> beta ) of "virtual treeview" and a help file ?
>

www.lischke-online.de/VirtualTreeview/beta/VirtualTree_2.7.5.zip.

And you might want to look in the YG for the help and some older versions of
VT: http://groups.yahoo.com/group/VirtualTreeview/files/

Helge.


re: bug list

From: "rm198de" [rmelles@g...]
Date: Sun Dec 23, 2001 2:56 pm
Subject: Re: bug list

--- In [VirtualTreeview@y...], "Mike Lischke" [lists@l...] wrote:
> Hi all,
>
> some notes to the recently added bug entries:
>
> #85 Ralf, as I already wrote, I cannot reproduce the problem.

Hi Mike,

sorry but I was very busy with christmas stuff and the whole nine
yards ;-)

OK, I uploaded a small demo for showing the wrong Displayheight of VT
when using NodeHeight:=0.

Have fun and I wish you and your family and all at this Group a nice
merry christmas!!

Ralf

 | Replies | Author | Date
5009 | Re: bug list | rm198de | Sun 12/23/2001
5103 | Re: bug list | Mike Lischke | Thu 1/10/2002


VT vs. C++Builder 4

From: Alexander Bunakov [bunakov@p...]
Date: Sun Dec 23, 2001 5:49 am
Subject: VT vs. C++Builder 4

Hello All,

I have a problem installing VT 2.7.5 in C++Builder 4. I've been able
to compile VirtualTreesD4 (runtime) package, but I can't compile the
VirtualTreesD4D (design time) package.

VirtualTreesReg unit uses ColnEdit unit, and the compiler wants
ColnEdit.dcu to compile VirtualTreesReg. But C++Builder doesn't have
ColnEdit.dcu. It only has ColnEdit.hpp (C++ header file) and
ColnEdit.obj, which is a part of dclstd40.bpi (compiled package).

I have included dclstd40.bpi in the "Requires" section of the
VirtualTreesD4D package, but the compiler is still unable to find
ColnEdit.obj and wants ColnEdit.dcu.

I have downloaded BCB packages from group's file area, but they are
are for BCB 5, and therefore they can not be used with BCB 4.
Moreover, I doubt this would help.

Could anyone please help me?

--
Best regards,
Alexander Sunday, December 23, 2001 10:31
RISC: Reduced Into Silly Code


minor bug in 2.7.5

From: "kcm999999" [kcm@m...]
Date: Sun Dec 23, 2001 11:20 pm
Subject: minor bug in 2.7.5

Happy holidays to all.

If you have toGridExtensions enabled and a vst with no columns, then
when creating the editor you get an "list out of bounds" error.
Perhaps a small change in the IF statement of line 20373 can fix this
quickly.

 | Replies | Author | Date
5102 | Re: minor bug in 2.7.5 | Mike Lischke | Thu 1/10/2002


re: bug list

From: "rm198de" [rmelles@g...]
Date: Sun Dec 23, 2001 11:44 pm
Subject: Re: bug list

--- In [VirtualTreeview@y...], "rm198de" [rmelles@g...] wrote:
> --- In [VirtualTreeview@y...], "Mike Lischke" [lists@l...] wrote:
> > Hi all,
> >
> > some notes to the recently added bug entries:
> >
> > #85 Ralf, as I already wrote, I cannot reproduce the problem.
>
Hi Mike,

if I change VST.NodeHeight[MainRoot]:=0 then everthing works ok! I'm
not sure why I can use the (maybe) bug version
PVirtualNode.NodeHeight too.

Bye
Ralf

 | Replies | Author | Date
5103 | Re: bug list | Mike Lischke | Thu 1/10/2002


About conditional defines

From: Valentin Vasiliev [valv@e...]
Date: Mon Dec 24, 2001 10:04 pm
Subject: [VirtualTreeview] About conditional defines

Hi all.
File "www.lischke-online.de/VirtualTreeview/beta/VirtualTree_2.7.5.zip"
is latest version ?
It's include different conditional defines in
"Compilers.inc" and "VirtualTreesReg.pas".
(DELPHI_6_UP <> DELPHI_6+, etc.)

With best regards
Valentin Vasiliev

 | Replies | Author | Date
5011 | Re: About conditional defines | Jim Kueneman | Mon 12/24/2001


re: About conditional defines

From: Jim Kueneman [jimdk@m...]
Date: Mon Dec 24, 2001 10:40 pm
Subject: Re: [VirtualTreeview] About conditional defines

At 12:04 AM 12/25/2001 +0200, you wrote:
>Hi all.
>File "www.lischke-online.de/VirtualTreeview/beta/VirtualTree_2.7.5.zip"
>is latest version ?
>It's include different conditional defines in
>"Compilers.inc" and "VirtualTreesReg.pas".
>(DELPHI_6_UP <> DELPHI_6+, etc.)

I think this was an oversight by Mike if I recall the thread. It was "+"
but BCB had trouble with that so Mike changed it to "UP". Just change the
pas file as required.

Jim


More drag and drop

From: Werner Lehmann [wl@b...]
Date: Tue Dec 25, 2001 1:35 am
Subject: More drag and drop

Hi Jim (Mike),

I am afraid there's more drag and drop trouble ahead. Correct me if I am wrong
(which might very well be) but I suspect that not each StgMedium which is
created
by TVTDataObject.GetData / RenderOLEData is freed.

I have created a TMemoryStream descendant with overridden destructor and am
using
it in TBaseVirtualTree.RenderOLEData():

StreamAdapter := TStreamAdapter.Create(TMS.Create, soOwned);

Breakpoints here and in the destructor of the stream.

In OnDragOver I do DataObject.GetData (not QueryGetData) to inspect the data to
see
if it is really accepted. The destructor is never reached (only once after a
drop
has occurred) but RenderOLEData is executed very often, at least for each mouse
move.

Should I release the StgMedium in OnDragOver once I got it from GetData? How?
According
to the help I can't just ReleaseStgMedium because then "the specified storage
medium is
invalid and can no longer be used."

And is it really necessary to render the data over and over again? Shouldn't it
be
enough when it's done one time and not if it's already available?

Regards,
Werner

 | Replies | Author | Date
5013 | Re: More drag and drop | Jim Kueneman | Tue 12/25/2001
5014 | Re: More drag and drop | Werner Lehmann | Tue 12/25/2001
5016 | Re: More drag and drop | Jim Kueneman | Tue 12/25/2001
5015 | Re: More drag and drop | Werner Lehmann | Tue 12/25/2001
5020 | Re: More drag and drop | Werner Lehmann | Thu 12/27/2001


re: More drag and drop

From: Jim Kueneman [jimdk@m...]
Date: Tue Dec 25, 2001 4:23 am
Subject: Re: [VirtualTreeview] More drag and drop

Hi Werner,

>I am afraid there's more drag and drop trouble ahead. Correct me if I am wrong
>(which might very well be) but I suspect that not each StgMedium which is
>created
>by TVTDataObject.GetData / RenderOLEData is freed.

Maybe depends on the StgMedium, IStream is should be only be increased in
reference count.

>I have created a TMemoryStream descendant with overridden destructor and
>am using
>it in TBaseVirtualTree.RenderOLEData():
>
> StreamAdapter := TStreamAdapter.Create(TMS.Create, soOwned);
>
>Breakpoints here and in the destructor of the stream.

So are you passing this as an IStream or HGlobal?

>In OnDragOver I do DataObject.GetData (not QueryGetData) to inspect the
>data to see
>if it is really accepted. The destructor is never reached (only once after
>a drop
>has occurred) but RenderOLEData is executed very often, at least for each
>mouse move.
>Should I release the StgMedium in OnDragOver once I got it from GetData?
>How? According
>to the help I can't just ReleaseStgMedium because then "the specified
>storage medium is
>invalid and can no longer be used."

If you call GetData it will cause the IDataObject to render the data from
the source, as such you are responsible for freeing it regardless if you
use it or not. Is there a reason you keep calling it? Can't you call it
once then hang onto it? Another possiblity is to use SetData when
RenderData is called. If you create the data then "give it to the
IDataObject" through SetData on the first call to RenderData. Maybe I am
missing the big picture as to what you are really after.

>And is it really necessary to render the data over and over again?
>Shouldn't it be
>enough when it's done one time and not if it's already available?

But you are calling GetData over and over right? If that is so then it
will call RenderData from the source over and over. The IDataObject has no
intellegence in this regard. If you use QueryData and find the format not
there then call RenderData and the Source uses SetData to give the
IDataObject responsibilty of the Data then the next call to QueryData will
return true and all is handled until you drop. When you drop the
IDataObject will grab the data is was given earlier and pass it back in
GetData instead of calling the source through RenderData again. Once the
DataObject is destroyed it will release the data automagiclly

Did that make *any* sense?

Jim


re: More drag and drop

From: Werner Lehmann [wl@b...]
Date: Tue Dec 25, 2001 2:17 pm
Subject: Re: [VirtualTreeview] More drag and drop

Jim Kueneman wrote:
>
> Maybe depends on the StgMedium, IStream is should be only be increased in
> reference count.

I must call _Release manually on StgMedium.stm if I get the data with GetData
in OnDragOver?

> So are you passing this as an IStream or HGlobal?

IStream. I am experimenting with CF_VIRTUALTREE which prefers IStream (as you
know
of course). I had my own stream format before and found it wasn't freed which
lead
to this all.

> If you call GetData it will cause the IDataObject to render the data from
> the source, as such you are responsible for freeing it regardless if you
> use it or not. Is there a reason you keep calling it? Can't you call it
> once then hang onto it? Another possiblity is to use SetData when
> RenderData is called. If you create the data then "give it to the
> IDataObject" through SetData on the first call to RenderData. Maybe I am
> missing the big picture as to what you are really after.

It's not such a big deal what I want. I must inspect the actual data in
OnDragOver
to tell if I accept it or not. Only looking at the cfFormat is not enough
because
I tried to use a generic application format with differing contents to have to
main-
tain only one registered format.

Apparently this is not the way to go, I have to register a separate format for
each
different application data which might be dragged. Do you agree?

> >And is it really necessary to render the data over and over again?
> >Shouldn't it be
> >enough when it's done one time and not if it's already available?
>
> But you are calling GetData over and over right? If that is so then it
> will call RenderData from the source over and over. The IDataObject has no
> intellegence in this regard. If you use QueryData and find the format not
> there then call RenderData and the Source uses SetData to give the
> IDataObject responsibilty of the Data then the next call to QueryData will
> return true and all is handled until you drop. When you drop the
> IDataObject will grab the data is was given earlier and pass it back in
> GetData instead of calling the source through RenderData again. Once the
> DataObject is destroyed it will release the data automagiclly
>
> Did that make *any* sense?

Sort of. I thought that the DataObject would cache everything which is rendered
once by GetData. I did not even waste a thought that this might not be the case.
Now that I look at GetData it is obvious. But I am not sure if this must really
be implemented this way. Couldn't the data just be appended to
InternalStgMediumArray?
After all, it does not make much sense if the data supplier renders different
data for each GetData call. But it adds much overhead if he has to render it
again
and again.

If I understand you right you suggest this in OnDragOver:
- QueryData (which does not exist, but it would be logical if this would just
do the same stuff as FindInternalStgMedium())
- if data is not found (already in the DataObject) try to get it with GetData
- if successful use SetData with the returned medium to have it available via
QueryData for the next time

This would make sense to me but: QueryData does not exist (and QueryGetData is
something different), and even then the DataObject could do this on its own...

Sorry if I bug you so much with this stuff. The IDataObject documentation does
not say whether data achieved by GetData may or may not be followed by an
implicit
SetData from within the dataobject itself.

Ok, I have just stepped through my own code with my own stream format to see
where
the RefCount is _AddRef'ed and _Release'd. I did that by deriving a descendant
from
TStreamAdapter with breakpoints in _AddRef, _Release and Destroy.

In OnDragOver I call this function:

function FormatExtractIStream(DataObject: IDataObject;
Format: TClipFormat): IStream;
var
FormatEtc: TFormatEtc;
StgMedium: TStgMedium;
begin
with FormatEtc do
begin
cfFormat := Format;
ptd := nil;
dwAspect := DVASPECT_CONTENT;
lindex := -1;
tymed := TYMED_ISTREAM;
end;

if DataObject.GetData(FormatEtc, StgMedium) = S_OK then
result := IUnknown(StgMedium.stm) as IStream
else
result := nil;
end;

It calls OnRenderOLEData eventually which sets the RefCount of the
TStreamAdapter
to 1 after this line:

IUnknown(Medium.stm) := Stream as IStream; // Stream is the
TStreamAdapter

Then FormatExtractIStream() is left and RefCount is 2 after

result := IUnknown(StgMedium.stm) as IStream

Back in OnDragOver I create a TOLEStream, work with it and free it again
(RefCount
-> 3, then -> 2). When OnDragOver is left RefCount goes down to 1. Therefore I
do
an additional Stream._Release at the end of OnDragOver and the stream is freed
correctly when OnDragOver is left and RefCount drops to 0.

I am never totally sure if the stream is freed until I debug it and make it
sure.
But that may be a problem of my understanding of the OLE and refcounting stuff.
And it is not acceptable that the data is rendered so often redundantly, hence I
must use a special cfFormat which lets me know if I accept the data without
actually
looking at the data.

Thanks for reading the long mail, and feel free to comment anything...

Werner

 | Replies | Author | Date
5016 | Re: More drag and drop | Jim Kueneman | Tue 12/25/2001


re: More drag and drop

From: Werner Lehmann [wl@b...]
Date: Tue Dec 25, 2001 7:00 pm
Subject: Re: [VirtualTreeview] More drag and drop

First of all, to say it explicitely, I have found an acceptable solution now and
removed all debugging code. I use very specific clipboard formats now and don't
need to examine the data in OnDragOver.

But let me ask one more question (please :). One of my VST can supply two
formats
now. But whether the second format can actually be supplied depends on the
dragged node.
Is it correct that this case is not covered by the VST drag and drop
implementation?
I mean I can only register my formats in OnGetUserClipboardFormats. From now on
the DataObject will pretend that it can supply both formats - even if one is
dependent
on the node which is dragged. I return E_FAIL in OnRenderOLEData but this does
not
matter in OnDragOver for the target if it only calls QueryGetData and the
dataobject
thinks it can always deliver all user formats.

In OnDragDrop, when the user could already drop the node, I discover eventually
that
the drop is not possible because the format can not be rendered (at least with
this
particular node). But it would be better if the drop weren't allowed in the
first place...

Regards,
Werner


re: More drag and drop

From: Jim Kueneman [jimdk@m...]
Date: Tue Dec 25, 2001 8:07 pm
Subject: Re: [VirtualTreeview] More drag and drop

> > Maybe depends on the StgMedium, IStream is should be only be increased in
> > reference count.
>
>I must call _Release manually on StgMedium.stm if I get the data with GetData
>in OnDragOver?

Yes, in the drag source when RenderOLEData is called you will create the
IStream and put a reference to it in the stg param, since it is a pointer
you will need to call _AddRef explicitly or when the IStream variable goes
out of scope in the RenderOLEData function it will be destroyed. (This is
dependant on the implementation which I now see how you did it later in the
message, so read on)

>It's not such a big deal what I want. I must inspect the actual data in
>OnDragOver
>to tell if I accept it or not. Only looking at the cfFormat is not enough
>because
>I tried to use a generic application format with differing contents to
>have to main-
>tain only one registered format.
>
>Apparently this is not the way to go, I have to register a separate format
>for each
>different application data which might be dragged. Do you agree?

I think your approach is fine, especially with IStream, we just need to get
the particulars worked out <g>.

>This would make sense to me but: QueryData does not exist (and QueryGetData is
>something different), and even then the DataObject could do this on its own...

Sorry Werner I lead you down the wrong path. What I was trying to say was
when you call GetData and RenderOLEData is called in the drag source return
the data in the passed storage medium plus call SetData and with the same
FormatEtc and with the same StgMedium (I think you will need to call
_AddRef twice to make this work right, one for the stgmedium that will be
returned to GetData and one for the medium stored by SetData) passing True
to DoRelease. Now the DataObject will have its own copy of the stream
interface and will not release it until the DataObject is freed. In this
case the next time you call GetData the DataObject will just return the
interface *with an increased reference count* so this means you *must* call
_Release on the stm parameter of the StgMedium for every time you call GetData.

>Sorry if I bug you so much with this stuff. The IDataObject documentation does
>not say whether data achieved by GetData may or may not be followed by an
>implicit
>SetData from within the dataobject itself.

I don't see why not, although I think that is the reason for SetData so you
can cache the data in the IDataObject. I have never seen it done that way
though.

>Ok, I have just stepped through my own code with my own stream format to
>see where
>the RefCount is _AddRef'ed and _Release'd. I did that by deriving a
>descendant from
>TStreamAdapter with breakpoints in _AddRef, _Release and Destroy.

The problem is that pesky StgMedium.stm defined as a pointer and Delphi's
automatic reference counting.

Lets work this from the Source end first:

> IUnknown(Medium.stm) := Stream as IStream; // Stream is the TStreamAdapter

This increases the reference count as you mentioned due to the "as" operator.

> if DataObject.GetData(FormatEtc, StgMedium) = S_OK then
> result := IUnknown(StgMedium.stm) as IStream
> else
> result := nil;
>end;

Ok, now on the other side of the pipe you are casting the pointer as
IUnknown and using "as" again increasing the reference count
again. Unfortunately this gets things out of wack. You have increased the
reference for the result of the function but you have not accounted for the
increase in the the reference to take the interface across the IDataObject,
basiclly the casting has overridden Delphi's reference counting and gotten
it out of sync. I would do this:

RenderOLEData:

Medium.stm := Stream; // I think this will compile
{ Explicit addref so it is clear what we are doing, needing to take the
interface across the IDataObject}
IUnknown(Medium.stm)._AddRef
YourLocalCopyOfIDataObjectFromPreviousPost.SetData(FormatEct, Medium, True);
{ Now add one for the medium stored by SetData}
IUnknown(Medium.stm)._AddRef

DragOver:

var
Unknown: IUnknown;
begin
if DataObject.GetData(FormatEtc, StgMedium) = S_OK then
begin
UnKnown := IUnknown(StgMedium.stm);
UnKnown._Release; // Explicit release of AddRef get across IDataObject
{ Now we are in sync with Delphi auto Reference counting }
Result := Unknown as IStream
end else
Result := nil
end;

This should do several things:

1) only call GetOLEData once to create the stream
2) cache the stream in the IDataObject
3) Keep the reference counting in sync

Note this only works correctly if you get the reference counting for the
IDataObject you are saving during the drag right and allow it to be freed
after the DragDrop is over <g> If not the next drag the IDataObject will
have the old stream cached and that is what will be returned by GetData.

>I am never totally sure if the stream is freed until I debug it and make
>it sure.
>But that may be a problem of my understanding of the OLE and refcounting
>stuff.

Don't feel bad I do it all the time to make sure. The auto reference count
of Delphi is both a blessing and a nuisance as you have already expressed
an opinion on. You have to be real careful when you mix the auto reference
counting and Windows COM interfaces that for some stupid reason declare
them as pointers.

>And it is not acceptable that the data is rendered so often redundantly,
>hence I
>must use a special cfFormat which lets me know if I accept the data
>without actually
>looking at the data.

If you use the SetData method and IStream (HGlobal is another matter,
GetData will copy the HGlobal cached by SetData and pass you the copy so
there is no real savings there) then will be RenderOLEData is called once
and the stream interface is stored in the DataObject though SetData further
calls to GetData only return the same IStream pointer with an increase in
reference counting.

Am I helping or hindering <g>

Jim


Another Q: Which message will be send out?

From: "Lolo Robo" [luo73@m...]
Date: Wed Dec 26, 2001 10:32 am
Subject: Another Q: Which message will be send out?

Hi, sir:
As we know, if a Form become invisible, it will stimulate an event called
"OnHide()", But if another visible control component (such as a TreeView or a
Button) become invisible, no event like "OnHide()" available. I want to know
the event or Which message will be send out?

Thanks for your attention...
Robo.Lolo´ÓÍøÕ¾µÃµ½¸ü¶àÐÅÏ¢¡£MSN Explorer Ãâ·ÑÏÂÔØ:http://explorer.msn.com/lccn

[Non-text portions of this message have been removed]

 | Replies | Author | Date
5018 | Re: Another Q: Which message will be send out? | Robert Fitzjohn | Wed 12/26/2001
5019 | Re: Another Q: Which message will be send out? | Lolo Robo | Wed 12/26/2001


re: Another Q: Which message will be send out?

From: "Robert Fitzjohn" [robfitsy@y...]
Date: Wed Dec 26, 2001 11:50 am
Subject: Re: [VirtualTreeview] Another Q: Which message will be send out?

>>As we know, if a Form become invisible, it will stimulate an event called
"OnHide()", But if another visible control component (such as a TreeView or
a Button) become invisible, no event like "OnHide()" available. I want to
know the event or Which message will be send out?

message CM_VISIBLECHANGED (controls.pas)

_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


re:Another Q: Which message will be send out?

From: "Lolo Robo" [luo73@m...]
Date: Wed Dec 26, 2001 12:15 pm
Subject: re:[VirtualTreeview] Another Q: Which message will be send out?

----- ÔÊ¼ÓÊ¼þ -----
·¢¼þÈË: Robert Fitzjohn
·¢ËÍÊ±¼ä: 2001Äê12ÔÂ26ÈÕ 19:56
ÊÕ¼þÈË: VirtualTreeview@yahoogroups.com
Ö÷Ìâ: Re: [VirtualTreeview] Another Q: Which message will be send out?

>>As we know, if a Form become invisible, it will stimulate an event called
"OnHide()", But if another visible control component (such as a TreeView or
a Button) become invisible, no event like "OnHide()" available. I want to
know the event or Which message will be send out?

message CM_VISIBLECHANGED (controls.pas)

I have tried to make a message mapping on this in delphi (controls.pas) and
c++builder(controls.hpp) , I succeeded.
Thank you,Mr Fitzjohn! ´ÓÍøÕ¾µÃµ½¸ü¶àÐÅÏ¢¡£MSN Explorer
Ãâ·ÑÏÂÔØ:http://explorer.msn.com/lccn

[Non-text portions of this message have been removed]


re: More drag and drop

From: Werner Lehmann [wl@b...]
Date: Thu Dec 27, 2001 11:16 am
Subject: Re: [VirtualTreeview] More drag and drop

Hi Jim,

> >I must call _Release manually on StgMedium.stm if I get the data with GetData
> >in OnDragOver?
>
> Yes, in the drag source when RenderOLEData is called you will create the
> IStream and put a reference to it in the stg param, since it is a pointer
> you will need to call _AddRef explicitly or when the IStream variable goes
> out of scope in the RenderOLEData function it will be destroyed. (This is
> dependant on the implementation which I now see how you did it later in the
> message, so read on)

As a rule it seems to be best to render and deliver the IStream with a ref'count
of 0.

> I think your approach is fine, especially with IStream, we just need to get
> the particulars worked out <g>.

I had already switched to HGLOBAL as I tried to point out in my second mail,
sent
one hour before this reply from you, and I cannot say I regret it. The stream
handling code was definitely more complicated. In my application it is
unnecessary
at the moment, there is only the data of one selected node in the DataObject.
As always, I tried to be smart and employ a flexible and growable IStream
approach,
but I decided to cut it down to my real needs for now.

Plus, no more refcount worrying (which may not be the least advantage, really).

> >This would make sense to me but: QueryData does not exist (and QueryGetData
is
> >something different), and even then the DataObject could do this on its
own...
>
> Sorry Werner I lead you down the wrong path. What I was trying to say was
> when you call GetData and RenderOLEData is called in the drag source return
> the data in the passed storage medium plus call SetData and with the same
> FormatEtc and with the same StgMedium (I think you will need to call
> _AddRef twice to make this work right, one for the stgmedium that will be
> returned to GetData and one for the medium stored by SetData) passing True
> to DoRelease. Now the DataObject will have its own copy of the stream
> interface and will not release it until the DataObject is freed. In this
> case the next time you call GetData the DataObject will just return the
> interface *with an increased reference count* so this means you *must* call
> _Release on the stm parameter of the StgMedium for every time you call
GetData.

Understood. But sounds like "debugperimenting" each time I need it to make sure
everything passes away when not needed anymore...

> The problem is that pesky StgMedium.stm defined as a pointer and Delphi's
> automatic reference counting.

Well, the C++ people don't distinguish here that much, they have no automatic
ref counting, as far as I know.

> Lets work this from the Source end first:
>
> > IUnknown(Medium.stm) := Stream as IStream; // Stream is the TStreamAdapter
>
> This increases the reference count as you mentioned due to the "as" operator.
>
> > if DataObject.GetData(FormatEtc, StgMedium) = S_OK then
> > result := IUnknown(StgMedium.stm) as IStream
> > else
> > result := nil;
> >end;
>
> Ok, now on the other side of the pipe you are casting the pointer as
> IUnknown and using "as" again increasing the reference count
> again. Unfortunately this gets things out of wack. You have increased the
> reference for the result of the function but you have not accounted for the
> increase in the the reference to take the interface across the IDataObject,
> basiclly the casting has overridden Delphi's reference counting and gotten
> it out of sync. I would do this:

I agree to this analysis (but this was more or less that what I wanted to
express
in my original posting :).

> RenderOLEData:
>
> Medium.stm := Stream; // I think this will compile
> { Explicit addref so it is clear what we are doing, needing to take the
> interface across the IDataObject}
> IUnknown(Medium.stm)._AddRef
> YourLocalCopyOfIDataObjectFromPreviousPost.SetData(FormatEct, Medium, True);
> { Now add one for the medium stored by SetData}
> IUnknown(Medium.stm)._AddRef
>
> DragOver:
>
> var
> Unknown: IUnknown;
> begin
> if DataObject.GetData(FormatEtc, StgMedium) = S_OK then
> begin
> UnKnown := IUnknown(StgMedium.stm);
> UnKnown._Release; // Explicit release of AddRef get across
IDataObject
> { Now we are in sync with Delphi auto Reference counting }
> Result := Unknown as IStream
> end else
> Result := nil
> end;
>
> This should do several things:
>
> 1) only call GetOLEData once to create the stream
> 2) cache the stream in the IDataObject
> 3) Keep the reference counting in sync
>
> Note this only works correctly if you get the reference counting for the
> IDataObject you are saving during the drag right and allow it to be freed
> after the DragDrop is over <g> If not the next drag the IDataObject will
> have the old stream cached and that is what will be returned by GetData.

Ok, thanks for all the support effort you have put into this. I am glad though
that the HGLOBAL way is acceptable for now. Especially for the reason of your
last sentence, that the DataObject might hold outdated stream data if I don't
pay enough attention to the refcounting anywhere.

> Don't feel bad I do it all the time to make sure. The auto reference count
> of Delphi is both a blessing and a nuisance as you have already expressed
> an opinion on. You have to be real careful when you mix the auto reference
> counting and Windows COM interfaces that for some stupid reason declare
> them as pointers.

Why did they have to mix the interface and the refcounting ideas? I simply don't
get it. (can't help pointless rambling, ignore)

> If you use the SetData method and IStream (HGlobal is another matter,
> GetData will copy the HGlobal cached by SetData and pass you the copy so
> there is no real savings there) then will be RenderOLEData is called once
> and the stream interface is stored in the DataObject though SetData further
> calls to GetData only return the same IStream pointer with an increase in
> reference counting.

Makes sense. But the price is too high for the moment.

> Am I helping or hindering <g>

Helping! Only that the show moved on in this particular case before your reply
arrived, I am sorry about that.

Werner


Utilities

From: Werner Lehmann [wl@b...]
Date: Thu Dec 27, 2001 3:55 pm
Subject: Utilities

Hi,

in case someone might be able to use this I am posting two units where
some utility functions and procedures are assembled. This stuff can be
useful if you do OLE drag and drop, especially to / from the shell
(Desktop, Explorer -> CF_HDROP) with a plain VST and without Jims
OleDragManager because you want to use the built in OLE drag drop support.

There is also one unit which wraps around ShFileOperation with some functions.

I have pasted the interface sections below and am attaching a zip file to
this posting which is send to both the mailing list and the newsgroup. Hope-
fully the attachment will end up in the group ;)

Werner

===================

unit uShFileOperation;

interface

uses
Windows, Classes, SysUtils, ShellAPI;

//------------------------------------------------------------------------------
// For descriptions see implementation part.
//------------------------------------------------------------------------------

function StringsToNullSeparated(SL: TStrings): PChar;

//------------------------------------------------------------------------------

function SingleFileOperation(Filename, TargetDirectory: string;
wFunc: UINT = FO_COPY; Window: THandle = 0;
fFlags: FILEOP_FLAGS = FOF_ALLOWUNDO or FOF_NOCONFIRMMKDIR;
Mappings: TStrings = nil): Boolean;

function StringsFileOperation(Filenames: TStrings; TargetDirectory: string;
wFunc: UINT = FO_COPY; Window: THandle = 0;
fFlags: FILEOP_FLAGS = FOF_ALLOWUNDO or FOF_NOCONFIRMMKDIR;
Mappings: TStrings = nil): Boolean; overload;

function StringsFileOperation(Filenames, Targets: TStrings;
wFunc: UINT = FO_COPY; Window: THandle = 0;
fFlags: FILEOP_FLAGS = FOF_ALLOWUNDO or FOF_NOCONFIRMMKDIR;
Mappings: TStrings = nil): Boolean; overload;

===================

unit uDataObjectUtils;

interface

uses
Windows, Classes, SysUtils, ActiveX, ShlObj, ShellAPI, uShFileOperation,
VirtualTrees;

//------------------------------------------------------------------------------
// For descriptions see implementation part.
//------------------------------------------------------------------------------

procedure AddFormat(var Formats: TFormatEtcArray; NewFormat: TClipFormat;
NewTymed: Longint = TYMED_HGLOBAL);
function IsFormatSupported(DataObject: IDataObject; Format: TClipFormat;
ATYMED: LongInt = TYMED_HGLOBAL): Boolean;

//------------------------------------------------------------------------------

function StringsToHDrop(Names: TStrings; out Medium: tagSTGMEDIUM): Boolean;
procedure HDropToStrings(Medium: TStgMedium; out Filenames: TStringlist);
function ProcessHDrop(DataObject: IDataObject; TargetDirectory: string;
Effect: Integer; Window: THandle): Boolean;

//------------------------------------------------------------------------------

function GetDataPerformedEffect(DataObject: IDataObject): Integer;
procedure SetDataPerformedEffect(DataObject: IDataObject; Effect: Integer);

//------------------------------------------------------------------------------

function FormatExtractIStream(DataObject: IDataObject;
Format: TClipFormat): IStream;

//------------------------------------------------------------------------------

procedure PutObjectIntoMedium(Obj: TObject; out Medium: TStgMedium);
function GetObjectFromMedium(Medium: TStgMedium; out Obj: TObject): Boolean;

//------------------------------------------------------------------------------
const
CFSTR_LOGICALPERFORMEDDROPEFFECT = 'Logical Performed DropEffect'; // from
ShlObj.h

var
CF_PERFORMEDDROPEFFECT: UINT = 0;
CF_LOGICALPERFORMEDDROPEFFECT: UINT = 0;

[Non-text portions of this message have been removed]

 | Replies | Author | Date
5024 | Re: Utilities | wurzelchook | Sun 12/30/2001
5025 | Re: Utilities | Werner Lehmann | Sun 12/30/2001
5026 | Re: Utilities | Justin Stenning | Sun 12/30/2001
5027 | Re: Utilities | Jim Kueneman | Sun 12/30/2001
5028 | Re: Utilities | Justin Stenning | Mon 12/31/2001
5029 | Re: Utilities | Jim Kueneman | Mon 12/31/2001


re: Sort progress?

From: "Wim van der Vegt" [wvd_vegt@k...]
Date: Fri Dec 28, 2001 12:42 pm
Subject: Re: [VirtualTreeview] Sort progress?

Hi,

I was expecting this answer as quicksort is only good on random accessible
structures indeed. Linked lists are more like magnetic tapes (especially single
linked ones) and for that other and far better sort methods exist. Thanks for
reminding me ;-)

------------
Wim van der Vegt
----- Original Message -----
From: Mike Lischke
To: VirtualTreeview@yahoogroups.com
Sent: Saturday, December 22, 2001 01:59 PM
Subject: RE: [VirtualTreeview] Sort progress?

Hi Wim,

> Strange comments in the VT sources is the following statement:
>
> // The idea behind this code is to use a kind of reverse merge sort.
QuickSort is quite fast
> // and would do the job here too but has a serious problem with already
sorted lists
> like FSelection.

You mixed something here. The case above applies to sorting the selection
array. This has nothing to
do with sorting the tree. The latter is done using a merge sort on linked
lists (as VT uses
internally).

> >When Quicksort is implemented well, it is typically 2-3 times faster than
mergesort or
> heapsort. The primary reason is that >the operations in the innermost loop
are simpler.

The point here is that quick sort does not work with linked lists. The
fastest algorithm I found was
the merge sort (Robert Sedgewick, "Algorithms in C++", Edison Wesly).

> ProgressBar1.Max :=Round(siz*Log2(siz)/2);
> ProgressBar1.Position:=fCnt;

As i already wrote, the worst case is often not reached and so the progress
bar often does not reach
the end in such an implementation. However for *some* feedback it is perhaps
good enough.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net

Yahoo! Groups Sponsor

To unsubscribe from this group, send an email to:
VirtualTreeview-unsubscribe@egroups.com

Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.

[Non-text portions of this message have been removed]


Donation

From: Sanjay Kanade [skanade@v...]
Date: Sat Dec 29, 2001 2:55 pm
Subject: Donation

Mike,

>>Thank you. Yes, getting donations is one of the major goals why I made
the tree open source. However, today I'm the last day online for the next 3
weeks, so I cannot answer if you send something to me. Once I'm back I plan
to publish the VT version officially (if nothing bad happens meanwhile). So
you donation must be ready to include without much work by me. Can you make
it so?<<

I am not sure what you mean here. I mean a donation and not a contribution.
Do you have a way to get a secure payment by credit card? If not, email me
details on sending a check.

Thanks,
Sanjay


re: Utilities

From: "wurzelchook" [jstenning@e...]
Date: Sun Dec 30, 2001 11:12 am
Subject: Re: Utilities

Hi Werner,

I am interested in taking a look at these units... As the attachments
get removed by Yahoo Groups server, would it be possible for you to
post the files to the Files section? I couldn't find them there so I
presume you haven't put them up...

Cheers,
Justin

--- In [VirtualTreeview@y...], Werner Lehmann [wl@b...] wrote:
> Hi,
>
> in case someone might be able to use this I am posting two units
where
> some utility functions and procedures are assembled. This stuff can
be
> useful if you do OLE drag and drop, especially to / from the shell
> (Desktop, Explorer -> CF_HDROP) with a plain VST and without Jims
> OleDragManager because you want to use the built in OLE drag drop
support.
>
> I have pasted the interface sections below and am attaching a zip
file to
> this posting which is send to both the mailing list and the
newsgroup. Hope-
> fully the attachment will end up in the group ;)
>
> Werner


re: Re: Utilities

From: Werner Lehmann [wl@b...]
Date: Sun Dec 30, 2001 3:27 pm
Subject: Re: [VirtualTreeview] Re: Utilities

Hi Justin,

> I am interested in taking a look at these units... As the attachments
> get removed by Yahoo Groups server, would it be possible for you to
> post the files to the Files section? I couldn't find them there so I
> presume you haven't put them up...

no I posted that last message to both this list and the newsgroup - and
the attachment is accessible via the group. Uploading the file to the YG
filespace now.

Werner


re: Re: Utilities

From: "Justin Stenning" [jstenning@e...]
Date: Sun Dec 30, 2001 10:56 pm
Subject: Re: [VirtualTreeview] Re: Utilities

Hi Werner,

Excuse my ignorance, but isn't the Group and the mail list the same (via
Yahoo Groups)? I looked on Yahoo Groups at the message, and no attachments,
instead the following line:

[Non-text portions of this message have been removed]

When I receive the emails (from the Group) it is the same. Is there another
seperate mail list?....

Sorry for the irelevance of this message but I have noticed a number of
messages that are supposed to have attachments, but have the above line
inserted instead....

Justin

--- In [VirtualTreeview@y...], Werner Lehmann [wl@b...] wrote:
> no I posted that last message to both this list and the newsgroup - and
> the attachment is accessible via the group. Uploading the file to the YG
> filespace now.

 | Replies | Author | Date
5027 | Re: Utilities | Jim Kueneman | Sun 12/30/2001


re: Re: Utilities

From: Jim Kueneman [jimdk@m...]
Date: Sun Dec 30, 2001 11:41 pm
Subject: Re: [VirtualTreeview] Re: Utilities

At 09:56 AM 12/31/2001 +1100, you wrote:
>Hi Werner,
>
>Excuse my ignorance, but isn't the Group and the mail list the same (via
>Yahoo Groups)? I looked on Yahoo Groups at the message, and no attachments,
>instead the following line:
>
>[Non-text portions of this message have been removed]
>
>When I receive the emails (from the Group) it is the same. Is there another
>seperate mail list?....

Hi Justin,

Yes, Mike started a real newsgroups at:

delphi-gems.support.virtualtreeview on the forums.talkto.net server.

Look on his homepage for links to the unicode and graphicex groups too.

Jim


re: Re: Utilities

From: "Justin Stenning" [jstenning@e...]
Date: Mon Dec 31, 2001 12:06 am
Subject: Re: [VirtualTreeview] Re: Utilities

>Yes, Mike started a real newsgroups at:
>delphi-gems.support.virtualtreeview on the forums.talkto.net server.
>Look on his homepage for links to the unicode and graphicex groups too.
>Jim

Great thanks.

One question... When submitting posts, should they be done to both groups? Or
only to one, and if only one which one will be the "master copy" so to speak
(i.e. some people will benefit from the answers to the post etc... and if only
in one of the lists some people may miss out....)....

Justin

[Non-text portions of this message have been removed]

 | Replies | Author | Date
5029 | Re: Utilities | Jim Kueneman | Mon 12/31/2001


re: Re: Utilities

From: Jim Kueneman [jimdk@m...]
Date: Mon Dec 31, 2001 12:26 am
Subject: Re: [VirtualTreeview] Re: Utilities

>One question... When submitting posts, should they be done to both groups?
>Or only to one, and if only one which one will be the "master copy" so to
>speak (i.e. some people will benefit from the answers to the post etc...
>and if only in one of the lists some people may miss out....)....

So far it has been one or the other so you have to check both for new
stuff. Important notices Mike posts to both.

Jim


VirtualTrees! Programmer in despair

From: "kanenasanonakis" [kanenasanonas@h...]
Date: Tue Jan 1, 2002 9:34 am
Subject: VirtualTrees! Programmer in despair

Hi, I have an enigmatic problem. Help will be appreciated

a) I am using WinME and Delphi 6 (with Update Pack 1)

b) I use the current official VirtualTrees release (2.0), but the
problem existed on previous versions (1.22, 1.30 also)

The problem is simplified to this:

If you simply drop a number of VirtualStringTreeViews in an blank
form and run it, you get a VERY LARGE decrease on GDI resources. A 6%
decrease for an application that does nothing is a lot!

The original problem:

I have a very-graphic intense application which, when run gets about
6-7% GDI resources. I added six VirtualTrees with NO DATA WHATSOEVER
makes this decrease on GDI resources about 22-26%. When the IDE is
running this gets even worse. You cant run Photoshop, IE and delphi
on a machine with 512MB of RAM (btw RAM does not improve GDI
resources).

Deleting all VirtualTrees immediately solves this.

Note: I dont know how WinME actually measures free GDI resources, but
running Photoshop together with a dummy application with VirtualTrees
shows that Photoshop gets les GDI resources.

Thanx in advance

Giannis

 | Replies | Author | Date
5031 | Re: VirtualTrees! Programmer in despair | Stephen Quinn | Tue 1/1/2002
5032 | Re: VirtualTrees! Programmer in despair | Werner Lehmann | Tue 1/1/2002


re: VirtualTrees! Programmer in despair

From: "Stephen Quinn" [squinn@b...]
Date: Tue Jan 1, 2002 10:27 am
Subject: Re: [VirtualTreeview] VirtualTrees! Programmer in despair

Giannis

Win95/98/ME have ~64K GDI & USER resources due to the 16bit code in the OS,
it's a limitation you can't get around in those OS.

Moving to Win2K or WinXP (recommend Pro versions) for your development will
solve the problem as those resources (~1M) are virtually<g> inexhaustable.

HTH
Steve Quinn
BRUTE Computer Services - Australia


re: VirtualTrees! Programmer in despair

From: Werner Lehmann [wl@b...]
Date: Tue Jan 1, 2002 12:58 pm
Subject: Re: [VirtualTreeview] VirtualTrees! Programmer in despair

Stephen Quinn wrote:
>
> Giannis
>
> Win95/98/ME have ~64K GDI & USER resources due to the 16bit code in the OS,
> it's a limitation you can't get around in those OS.
>
> Moving to Win2K or WinXP (recommend Pro versions) for your development will
> solve the problem as those resources (~1M) are virtually<g> inexhaustable.

You might also try the new version 2.7.5. Since 2.0 some GDI problems were
reported and fixed (if memory serves).

www.lischke-online.de/VirtualTreeview/beta/VirtualTree_2.7.5.zip

Werner


Sort problem when not completely visible

From: "fransbouwmans" [frans.bouwmans@z...]
Date: Tue Jan 1, 2002 2:05 pm
Subject: Sort problem when not completely visible

Hi,

I noticed the following problem (although it might be incorrect use
of me):

I have a VT with locally saved data in my own data structures. To
initialize a node I use the node.index as an index in my own data
structures to find the related data (InitNode).

I noticed this is only done for the visible nodes.
After that I sort the tree. The sorting is done with all nodes (also
invisible, and therefor unitialized). when I resize the tree and
invisible nodes are made visible they are initialized, but the index
is now the sorted index and therefor the init is incorrect because
the node.index will point to another entry in my own datastructures.

Is there a way to force all nodes to be initialized on expand (and
not only the visible nodes)

 | Replies | Author | Date
5034 | Re: Sort problem when not completely visible | fransbouwmans | Tue 1/1/2002
5035 | Re: Sort problem when not completely visible | Jim Kueneman | Tue 1/1/2002
5036 | Re: Sort problem when not completely visible | fransbouwmans | Tue 1/1/2002
5038 | Re: Sort problem when not completely visible | Jim Kueneman | Tue 1/1/2002
5045 | Re: Sort problem when not completely visible | padagosta | Wed 1/2/2002
5048 | Re: Sort problem when not completely visible | fransbouwmans | Wed 1/2/2002


re: Sort problem when not completely visible

From: "fransbouwmans" [frans.bouwmans@z...]
Date: Tue Jan 1, 2002 2:17 pm
Subject: Re: Sort problem when not completely visible

I checked VT myself and found that with the procedure SortTree a
option initnodes can be set. In my code it is set to false, setting
this to true helps, but it initializes all nodes, not only the
expanded nodes, this is not necessary. Only the expanded nodes need
to be expanded.

Because of the full init there is a noticeable delay in the sort as a
result of the init.


re: Sort problem when not completely visible

From: Jim Kueneman [jimdk@m...]
Date: Tue Jan 1, 2002 4:04 pm
Subject: Re: [VirtualTreeview] Sort problem when not completely visible

At 02:05 PM 1/1/2002 +0000, you wrote:
>Hi,
>
>I noticed the following problem (although it might be incorrect use
>of me):
>
>I have a VT with locally saved data in my own data structures. To
>initialize a node I use the node.index as an index in my own data
>structures to find the related data (InitNode).
>
>I noticed this is only done for the visible nodes.

That is why it is virtual <g>.

>Is there a way to force all nodes to be initialized on expand (and
>not only the visible nodes)

Look at ReInitNode and ReInitChildren

Jim

 | Replies | Author | Date
5036 | Re: Sort problem when not completely visible | fransbouwmans | Tue 1/1/2002
5038 | Re: Sort problem when not completely visible | Jim Kueneman | Tue 1/1/2002


re: Sort problem when not completely visible

From: "fransbouwmans" [frans.bouwmans@z...]
Date: Tue Jan 1, 2002 5:06 pm
Subject: Re: Sort problem when not completely visible

> >I noticed this is only done for the visible nodes.
>
> That is why it is virtual <g>.

I understand the virtual concept, the problem is that when a node is
expanded, the only way to know which node to initialize is to use the
node.index
When a node is expanded and only 5 of the 10 children are visible
then only 5 are initialized (by using the node.index).
If after this a sort is performed, the OnCompareNodes is called with
uninitialized nodes.
Initialization is not possible anymore because the index has changed
(as a result of the sort).

As this was a tree derived from TCustomVirtualTreeOptions I was not
able to set the treeoptions, I'm currently busy to make the
treeoptions visible (the same as TVirtualTreeOptions) so I can set
autoSort, this might help.

 | Replies | Author | Date
5038 | Re: Sort problem when not completely visible | Jim Kueneman | Tue 1/1/2002


Node dependent user clipboard format?

From: Werner Lehmann [wl@b...]
Date: Tue Jan 1, 2002 5:37 pm
Subject: Node dependent user clipboard format?

Hi all,

maybe this question has not been noticed somehow... let me put it up once more
;)

> But let me ask one more question (please :). One of my VST can supply two
formats
> now. But whether the second format can actually be supplied depends on the
dragged node.
> Is it correct that this case is not covered by the VST drag and drop
implementation?
> I mean I can only register my formats in OnGetUserClipboardFormats. From now
on
> the DataObject will pretend that it can supply both formats - even if one is
dependent
> on the node which is dragged. I return E_FAIL in OnRenderOLEData but this
does not
> matter in OnDragOver for the target if it only calls QueryGetData and the
dataobject
> thinks it can always deliver all user formats.
>
> In OnDragDrop, when the user could already drop the node, I discover
eventually that
> the drop is not possible because the format can not be rendered (at least
with this
> particular node). Or the user gets an error message from the shell if a
CF_HDROP got
> dropped but the dragged node could not really supply this format at the time
being.
> It would be better if the drop weren't allowed in the first place...

Regards,
Werner

 | Replies | Author | Date
5039 | Re: Node dependent user clipboard format? | Jim Kueneman | Tue 1/1/2002
5041 | Re: Node dependent user clipboard format? | Werner Lehmann | Wed 1/2/2002


re: Re: Sort problem when not completely visible

From: Jim Kueneman [jimdk@m...]
Date: Tue Jan 1, 2002 7:50 pm
Subject: Re: [VirtualTreeview] Re: Sort problem when not completely visible

>
>As this was a tree derived from TCustomVirtualTreeOptions I was not
>able to set the treeoptions, I'm currently busy to make the
>treeoptions visible (the same as TVirtualTreeOptions) so I can set
>autoSort, this might help.

What you are doing has been talked about here before (don't remember why
something to do with fast retrieval of a given node based on an outside
dataset if memory serves) but I am not sure if anyone has actually tried to
do it. It is not possible to call ReInitChildren in the OnExpanded event
(or DoExpanded since you are creating a decendant)?

It will call InitNode for every node all over again then you can save the
index.

Jim


re: Node dependent user clipboard format?

From: Jim Kueneman [jimdk@m...]
Date: Tue Jan 1, 2002 8:04 pm
Subject: Re: [VirtualTreeview] Node dependent user clipboard format?

Hi Werner,

Happy New Year.

> > But let me ask one more question (please :). One of my VST can supply
> two formats
> > now. But whether the second format can actually be supplied depends on
> the dragged node.
> > Is it correct that this case is not covered by the VST drag and drop
> implementation?
> > I mean I can only register my formats in OnGetUserClipboardFormats.
> From now on
> > the DataObject will pretend that it can supply both formats - even if
> one is dependent
> > on the node which is dragged. I return E_FAIL in OnRenderOLEData but
> this does not
> > matter in OnDragOver for the target if it only calls QueryGetData and
> the dataobject
> > thinks it can always deliver all user formats.

If I understand you the Drag source VST is capable of delivering 2 formats
but it may only be logical to do so for some nodes. Other nodes only make
sense to have one format. This is not changing during the drag right? You
are not trying the dynamiclly change the contents of the Dataobject during
the drag? If not then putting a conditional test in
OnGetUserClipboardFormats based on what the node can supply..... but you
may have the OnGetUserClipboardFormats set up in the other VST to use both
formats. How about a conditional define in all VST and only supply formats
if you are the drag source. You can continue to Query for all format in
the DragOver. The reason this will work is that OnGetUserClipboardFormats
is called on demand each time a DataObject is created (I think <g>)

Jim


How to fill the tree using a ADO Express connection ?

From: "fastpartner" [m.jensen@w...]
Date: Wed Jan 2, 2002 12:00 am
Subject: How to fill the tree using a ADO Express connection ?

Hi,

I am developing a small Delphi application using ADO/Access2000.

Now I want use the virtual treeview component and fill it with data
from my ADO connection.

1.) Which tree view do I have to use , the Virtual Draw tree or the
other one ?

2.) How to fill the tree using a ADO Express connection, eg. ADO
DataSet and so on?

I wanted to use this Virtual Tree for navigation, so when I click an
item in the virtual tree then it should open the detail form to this
record.

Thanks for any good advice!

Matthias Jensen

 | Replies | Author | Date
5042 | Re: How to fill the tree using a ADO Express conn | Helge Jung (ECO-Logic) | Wed 1/2/2002


re: Node dependent user clipboard format?

From: Werner Lehmann [wl@b...]
Date: Wed Jan 2, 2002 12:08 am
Subject: Re: [VirtualTreeview] Node dependent user clipboard format?

Hi Jim,

> Happy New Year.

thanks - for you too.

> If I understand you the Drag source VST is capable of delivering 2 formats
> but it may only be logical to do so for some nodes. Other nodes only make

Correct.

> sense to have one format. This is not changing during the drag right? You

No.

> are not trying the dynamiclly change the contents of the Dataobject during
> the drag? If not then putting a conditional test in
> OnGetUserClipboardFormats based on what the node can supply..... but you
> may have the OnGetUserClipboardFormats set up in the other VST to use both
> formats. How about a conditional define in all VST and only supply formats
> if you are the drag source. You can continue to Query for all format in
> the DragOver. The reason this will work is that OnGetUserClipboardFormats
> is called on demand each time a DataObject is created (I think <g>)

No, your first idea is already enough and it is embarassing that I didn't
check that first, it never came to mind that OnGetUserClipboardFormats is
called always when a drag begins. I took for certain that this is only called
one time, when the treeview is created or something. Therefore I always added
both formats in the handler. Doh!

Glad to have that sorted out, thank you.

Werner


re: How to fill the tree using a ADO Express connection ?

From: "Helge Jung \(ECO-Logic\)" [helge@e...]
Date: Wed Jan 2, 2002 11:19 am
Subject: Re: [VirtualTreeview] How to fill the tree using a ADO Express connection ?

> 1.) Which tree view do I have to use , the Virtual Draw tree or the
> other one ?

I suggest the VirtualStringTree - so it's "the other one".

> 2.) How to fill the tree using a ADO Express connection, eg. ADO
> DataSet and so on?

I used VST with InterBase and that's the code - it should be easily
adaptable to ADO. I put a small demo in the YG:

http://groups.yahoo.com/group/VirtualTreeview/files/Examples/Delphi_Examples
/Database/VST_IB_Demo.zip

I hope you understand what I do/mean in the demo because it's nearly
undocumented but I think it should explain itself.

Best regards,

Helge.


Right Align Text in node column?

From: "Dion" [dion@n...]
Date: Wed Jan 2, 2002 9:42 pm
Subject: Right Align Text in node column?

Hi All,

How do I do the above. I am using a virtual string tree.

Many Thanks,
Dion.

 | Replies | Author | Date
5044 | Re: Right Align Text in node column? | Helge Jung (ECO-Logic) | Wed 1/2/2002
5046 | Re: Right Align Text in node column? | Jim Kueneman | Wed 1/2/2002


re: Right Align Text in node column?

From: "Helge Jung \(ECO-Logic\)" [helge@e...]
Date: Wed Jan 2, 2002 1:13 pm
Subject: Re: [VirtualTreeview] Right Align Text in node column?

> How do I do the above. I am using a virtual string tree.
>

Please write your question again in your message - there are some people who
don't read subjects (don't know why but there seem to be some).

In Header.Columns you have a property "Alignment" - simply set this to
"taRight..."! Should also work if the header isn't been displayed. If you
only have one column and you don't show it you maybe want to set
AutoSizeColumn to 0 and enabled the AutoSizing of column (in
Header.Options).

Helge.


re: Sort problem when not completely visible

From: "padagosta" [pdagosta@c...]
Date: Wed Jan 2, 2002 1:56 pm
Subject: Re: Sort problem when not completely visible

> I have a VT with locally saved data in my own data structures. To
> initialize a node I use the node.index as an index in my own data
> structures to find the related data (InitNode).

My personal recommendation is to not use node.index as an index for
your data. Instead, add an index to your user data section for each
node. If you need to be able to tie a node to your data, then store
the address on the node in your data structures. These values (your
data index and the pointer to the node) should never change so you
have no tree restructuring issues (ie sorts).

Paul

 | Replies | Author | Date
5048 | Re: Sort problem when not completely visible | fransbouwmans | Wed 1/2/2002


re: Right Align Text in node column?

From: Jim Kueneman [jimdk@m...]
Date: Wed Jan 2, 2002 2:06 pm
Subject: Re: [VirtualTreeview] Right Align Text in node column?

>How do I do the above. I am using a virtual string tree.

What version. The newer beta version does it.

www.lischke-online.de/VirtualTreeview/beta/VirtualTree_2.7.5.zip

Jim


re: Sort progress

From: Sanjay Kanade [skanade@v...]
Date: Wed Jan 2, 2002 1:50 pm
Subject: Re: Sort progress

Hi Wim,

I am back from vacation and tried this code. Brilliant! It works like
a charm. Thanks.

Sanjay

> From: "Wim van der Vegt" [wvd_vegt@k...]
>Code used :
>
>procedure TForm1.VirtualStringTree1CompareNodes(Sender: TBaseVirtualTree;
> Node1, Node2: PVirtualNode; Column: Integer; var Result: Integer);
>var
> n1,n2 : Integer;
>begin
> n1:=Integer(Sender.GetNodeData(Node1)^);
> n2:=Integer(Sender.GetNodeData(Node2)^);
> if (n1>n2)
> then Result:=1
> else
> if (n1=n2)
> then Result:= 0
> else Result:=-1;
> Inc(fCnt);
> StatusBar1.Panels[0].Text:=IntToStr(fCnt);
> ProgressBar1.Position:=fCnt;
>end;
>
>procedure TForm1.Button1Click(Sender: TObject);
>var
> i : Integer;
>begin
> VirtualStringTree1.Clear;
> VirtualStringTree1.NodeDataSize:=Sizeof(Integer);
> for i:=1 to siz do
>
PInteger(VirtualStringTree1.GetNodeData(VirtualStringTree1.AddChild(nil,nil)
))^:=siz-i;
> fCnt:=0;
> ProgressBar1.Max :=Round(siz*Log2(siz)/2);
> ProgressBar1.Position:=fCnt;
> StatusBar1.Panels[1].Text:=FloatToStr(siz*Log2(siz));
>end;
>
>procedure TForm1.VirtualStringTree1GetText(Sender: TBaseVirtualTree;
> Node: PVirtualNode; Column: Integer; TextType: TVSTTextType;
> var Text: WideString);
>begin
> Text:=IntToStr(Integer(Sender.GetNodeData(Node)^));
>end;
>
>procedure TForm1.Button2Click(Sender: TObject);
>begin
> VirtualStringTree1.SortTree(0,sdAscending);
>end;
>
>----------------
>Wim van der Vegt


re: Sort problem when not completely visible

From: "fransbouwmans" [frans.bouwmans@z...]
Date: Wed Jan 2, 2002 4:39 pm
Subject: Re: Sort problem when not completely visible

--- In [VirtualTreeview@y...], "padagosta" [pdagosta@c...] wrote:
>
> > I have a VT with locally saved data in my own data structures. To
> > initialize a node I use the node.index as an index in my own data
> > structures to find the related data (InitNode).
>
> My personal recommendation is to not use node.index as an index for
> your data. Instead, add an index to your user data section for
each
> node. If you need to be able to tie a node to your data, then
store
> the address on the node in your data structures. These values
(your
> data index and the pointer to the node) should never change so you
> have no tree restructuring issues (ie sorts).
>
> Paul
This is exactly what I did, I defined a data structure with a pointer
to my internal data.
It was the way I did initialize the nodedata which caused the problem.
In initchildren I changed childcount to set the number of children
and then let the initnode do the initialization (using node.index)
to know which node it was.
The problem was raised because not all nodes are initialized with
this method (only the visible ones) and doing a sorttree caused the
node.index to change and therefor the nodes were wrongly initialised
when they became visible.

I have now modified the code to also initialize the pointers in the
children in the initchildren event (by addchild, and filling the
pointer in the returned node).

I noticed that although the childs were created using addchilds, I
still have to set childcount to the correct value, else the childs
will not be visible.

Frans


problem making treeoptions visible in derived VT

From: "fransbouwmans" [frans.bouwmans@z...]
Date: Wed Jan 2, 2002 4:50 pm
Subject: problem making treeoptions visible in derived VT

I tried to make treeoptions visible in a derived VT. I looked at the
code from TVirtualStringTree on how to do this (as I derived from
TCustomVirtualStringTree).
FOptions is made private which means that it is not visible in my own
module containing the derived tree.
Using TreeOptions i.s.o. FOptions makes the code compile, however
delphi crashes after doing this.
I finally changed the original virtualtrees and made FOptions
protected. This workes fine.

Greetings Frans Bouwmans

If somebody is interested in a VT derived tree which can display Mp3
tag info, let me know, then I will publish my code. Some features are:

threaded scanner
search
drag & drop to playlists
tree based on directory structure/genre or artist

 | Replies | Author | Date
5050 | Re: problem making treeoptions visible in derived | thegwimweaper | Wed 1/2/2002
5055 | Re: problem making treeoptions visible in derived | fransbouwmans | Thu 1/3/2002
5109 | Re: problem making treeoptions visible in derived | Mike Lischke | Thu 1/10/2002


re: problem making treeoptions visible in derived VT

From: "thegwimweaper" [me@j...]
Date: Wed Jan 2, 2002 6:08 pm
Subject: Re: problem making treeoptions visible in derived VT

Hi Frans,

Just declare the following as a public property...

property TreeOptions: TVirtualTreeOptions read GetOptions write
SetOptions;

You can of, course declare your own VirtualTreeOptions and use them.
The trick is in the implementation of GetOptions and SetOptions.

function TMyVirtualTree.GetOptions(): TVirtualTreeOptions;
begin
Result := inherited TreeOptions as TVirtualTreeOptions;
end;

procedure TMyVirtualTree.SetOptions(const Value: TVirtualTreeOptions);
begin
inherited TreeOptions.Assign(Value);
end;

This is how I do it... anyone else know a better way?

> I tried to make treeoptions visible in a derived VT. I looked at
the
> code from TVirtualStringTree on how to do this (as I derived from
> TCustomVirtualStringTree).
> FOptions is made private which means that it is not visible in my
own
> module containing the derived tree.
> Using TreeOptions i.s.o. FOptions makes the code compile, however
> delphi crashes after doing this.
> I finally changed the original virtualtrees and made FOptions
> protected. This workes fine.

 | Replies | Author | Date
5055 | Re: problem making treeoptions visible in derived | fransbouwmans | Thu 1/3/2002


wheres the latest file.... (2.7.5 ?)? tia. and Happy New Year!!

From: "asel98" [asel98@y...]
Date: Wed Jan 2, 2002 8:10 pm
Subject: wheres the latest file.... (2.7.5 ?)? tia. and Happy New Year!!

 | Replies | Author | Date
5052 | Re: wheres the latest file.... (2.7.5 ?)? tia. an | Jim Kueneman | Wed 1/2/2002


re: wheres the latest file.... (2.7.5 ?)? tia. and Happy New Year!!

From: Jim Kueneman [jimdk@m...]
Date: Wed Jan 2, 2002 9:34 pm
Subject: Re: [VirtualTreeview] wheres the latest file.... (2.7.5 ?)? tia. and Happy New Year!!

www.lischke-online.de/VirtualTreeview/beta/VirtualTree_2.7.5.zip

Jim


New file uploaded to VirtualTreeview

From: VirtualTreeview@yahoogroups.com
Date: Thu Jan 3, 2002 2:43 am
Subject: New file uploaded to VirtualTreeview

Hello,

This email message is a notification to let you know that
a file has been uploaded to the Files area of the VirtualTreeview
group.

File : /Descendants/VirtualDBTreeEx.zip
Uploaded by : zai_xiong [csphua@t...]
Description : Modified from VirtualDBTree, this new component now accepts
type Double field as IDs, allow custom sorting via OnCompareNodes event, able
to configure trees using TreeOptions property, plus more...

You can access this file at the URL

http://groups.yahoo.com/group/VirtualTreeview/files/Descendants/VirtualDBTreeEx.\
zip

To learn more about file sharing for your group, please visit

http://help.yahoo.com/help/us/groups/files

Regards,

zai_xiong [csphua@t...]

 | Replies | Author | Date
5054 | Re: New file uploaded to VirtualTreeview | fastpartner | Thu 1/3/2002
5057 | Re: New file uploaded to VirtualTreeview | zai_xiong | Thu 1/3/2002
5059 | Re: New file uploaded to VirtualTreeview | fastpartner | Thu 1/3/2002
5060 | Re: New file uploaded to VirtualTreeview | zai_xiong | Fri 1/4/2002
5068 | Re: New file uploaded to VirtualTreeview | fastpartner | Fri 1/4/2002
5071 | Re: New file uploaded to VirtualTreeview | zai_xiong | Sat 1/5/2002
5072 | Re: New file uploaded to VirtualTreeview | Helge Jung (ECO-Logic) | Sat 1/5/2002


re: New file uploaded to VirtualTreeview

From: "fastpartner" [m.jensen@w...]
Date: Thu Jan 3, 2002 7:55 am
Subject: Re: New file uploaded to VirtualTreeview

Hi,

I have installed this new uploaded file. There appear 3 different
dbtree - components ( VirtualIDTree, DBCheck...etc. ).

How can I use this 3 components with a database. Are there any help
files available ?

Thanks,
Matthias Jensen

--- In [VirtualTreeview@y...], [VirtualTreeview@y...] wrote:
>
> Hello,
>
> This email message is a notification to let you know that
> a file has been uploaded to the Files area of the VirtualTreeview
> group.
>
> File : /Descendants/VirtualDBTreeEx.zip
> Uploaded by : zai_xiong [csphua@t...]
> Description : Modified from VirtualDBTree, this new component now
accepts type Double field as IDs, allow custom sorting via
OnCompareNodes event, able to configure trees using TreeOptions
property, plus more...
>
> You can access this file at the URL
>
>
http://groups.yahoo.com/group/VirtualTreeview/files/Descendants/Virtua
lDBTreeEx.zip
>
> To learn more about file sharing for your group, please visit
>
> http://help.yahoo.com/help/us/groups/files
>
> Regards,
>
> zai_xiong [csphua@t...]

 | Replies | Author | Date
5057 | Re: New file uploaded to VirtualTreeview | zai_xiong | Thu 1/3/2002
5059 | Re: New file uploaded to VirtualTreeview | fastpartner | Thu 1/3/2002
5060 | Re: New file uploaded to VirtualTreeview | zai_xiong | Fri 1/4/2002
5068 | Re: New file uploaded to VirtualTreeview | fastpartner | Fri 1/4/2002
5071 | Re: New file uploaded to VirtualTreeview | zai_xiong | Sat 1/5/2002
5072 | Re: New file uploaded to VirtualTreeview | Helge Jung (ECO-Logic) | Sat 1/5/2002


re: problem making treeoptions visible in derived VT

From: "fransbouwmans" [frans.bouwmans@z...]
Date: Thu Jan 3, 2002 9:19 am
Subject: Re: problem making treeoptions visible in derived VT

In my try to do the same I left out the keyword "inherited", this
most likely will introduce a recursive loop (getoptions calling
getoptions), I didn't think of that one, and the delphi IDE crashes
as a result of this.

Thanks for the reply, I'll try this (i.s.o. modifying the
virtualtrees.pas)

Frans Bouwmans
--- In [VirtualTreeview@y...], "thegwimweaper" [me@j...] wrote:
> Hi Frans,
>
> Just declare the following as a public property...
>
> property TreeOptions: TVirtualTreeOptions read GetOptions write
> SetOptions;
>
> You can of, course declare your own VirtualTreeOptions and use them.
> The trick is in the implementation of GetOptions and SetOptions.
>
> function TMyVirtualTree.GetOptions(): TVirtualTreeOptions;
> begin
> Result := inherited TreeOptions as TVirtualTreeOptions;
> end;
>
> procedure TMyVirtualTree.SetOptions(const Value:
TVirtualTreeOptions);
> begin
> inherited TreeOptions.Assign(Value);
> end;
>
> This is how I do it... anyone else know a better way?
>
> > I tried to make treeoptions visible in a derived VT. I looked at
> the
> > code from TVirtualStringTree on how to do this (as I derived from
> > TCustomVirtualStringTree).
> > FOptions is made private which means that it is not visible in my
> own
> > module containing the derived tree.
> > Using TreeOptions i.s.o. FOptions makes the code compile, however
> > delphi crashes after doing this.
> > I finally changed the original virtualtrees and made FOptions
> > protected. This workes fine.


re: New file uploaded to VirtualTreeview

From: GIANNAKOPOULOS KOSTAS [kyan@s...]
Date: Thu Jan 3, 2002 9:41 am
Subject: RE: [VirtualTreeview] New file uploaded to VirtualTreeview

A suggestion:

Some people are using GUIDs to identify records instead of integers or
floats.
The advantages of GUID IDs are many:

- They can be created by the client without any database access.
- They do not need a database object (generator, sequence) for their
creation.
- They are database-independent.
- They do not need adjustments when you try to merge two databases (anyone
who's tried it knows exactly how painful this is).

The only down side is their size (38 bytes) which can be reduced to 24 if
you use a base64 algorithm to convert them to strings instead of the usual
format.

So, why don't you turn the ID to a VARIANT that can contain any basic type?
After all, aren't IDs supposed to be opaque?
I think that the only thing you will need is a function to test for
equality. For scalar variants the function VarEquals() will do, if you want
to support variant arrays (for instance if the ID consists of 2 database
columns) i can send you code that compares 2 arbitrary variants. You can
even define an event handler (OnCompareIDs) that delegates the comparison of
IDs to the user.

> -----Original Message-----
> From: [VirtualTreeview@yahoogroups.com
> [mailto:VirtualTreeview@yahoogroups.com]
> Sent: Thursday, January 03, 2002 4:44 AM
> To: VirtualTreeview@yahoogroups.com
> Subject: [VirtualTreeview] New file uploaded to VirtualTreeview
>
>
>
> Hello,
>
> This email message is a notification to let you know that
> a file has been uploaded to the Files area of the VirtualTreeview
> group.
>
> File : /Descendants/VirtualDBTreeEx.zip
> Uploaded by : zai_xiong <csphua@t...]
> Description : Modified from VirtualDBTree, this new
> component now accepts type Double field as IDs, allow custom
> sorting via OnCompareNodes event, able to configure trees
> using TreeOptions property, plus more...
>
> You can access this file at the URL
>
> http://groups.yahoo.com/group/VirtualTreeview/files/Descendant
s/VirtualDBTreeEx.zip

 | Replies | Author | Date
5058 | Re: New file uploaded to VirtualTreeview | zai_xiong | Thu 1/3/2002


re: New file uploaded to VirtualTreeview

From: "zai_xiong" [csphua@t...]
Date: Thu Jan 3, 2002 5:28 pm
Subject: Re: New file uploaded to VirtualTreeview

--- In [VirtualTreeview@y...], "fastpartner" [m.jensen@w...] wrote:
> Hi,
>
> I have installed this new uploaded file. There appear 3 different
> dbtree - components ( VirtualIDTree, DBCheck...etc. ).
>

These trees serve different purposes. VirtualDBTreeEx give a plain
DBTree, which the remaining gives a checkbox enabled DBTree. To
complicated things further, DBCheckVirtualDBTreeEx is the data bound
version of CheckVirtualDBTreeEx... I mainly used VirtualDBTreeEx in
my project.

> How can I use this 3 components with a database. Are there any
help
> files available ?

Well, you can point these 3 components to a same datasource which
will give what you want.

I guess help file is not necessary. Here is some guide lines:-

1. Assign a datasource to VirtualDBTreeEx
2. Assign the minimum 3 field names of fields in your database
pointed to by the datasource to property KeyFieldName,
ParentFieldName and ViewFieldName, respectively.
3. Open you dataset. You should be able to see the tree populated
by the records in your dataset. Note that you need to have
Parent-Child relationship setup properly in your dataset in order
to see the results. In my own database, I used these fields:-
ID, ParentID, NType
4. If you would like to see Icons in the tree, assign a ImageList to
the tree, then assign a field name to property ImgIdxFieldName.

hope I can help you clear your doubts regarding VirtualDBTreeEx

Regards,
C.S. Phua

 | Replies | Author | Date
5059 | Re: New file uploaded to VirtualTreeview | fastpartner | Thu 1/3/2002
5060 | Re: New file uploaded to VirtualTreeview | zai_xiong | Fri 1/4/2002
5068 | Re: New file uploaded to VirtualTreeview | fastpartner | Fri 1/4/2002
5071 | Re: New file uploaded to VirtualTreeview | zai_xiong | Sat 1/5/2002
5072 | Re: New file uploaded to VirtualTreeview | Helge Jung (ECO-Logic) | Sat 1/5/2002


re: New file uploaded to VirtualTreeview

From: "zai_xiong" [csphua@t...]
Date: Thu Jan 3, 2002 5:42 pm
Subject: Re: New file uploaded to VirtualTreeview

--- In [VirtualTreeview@y...], GIANNAKOPOULOS KOSTAS [kyan@s...] wrote:
> A suggestion:
>
> Some people are using GUIDs to identify records instead of
integers or
> floats.
> The advantages of GUID IDs are many:
>
> - They can be created by the client without any database access.
> - They do not need a database object (generator, sequence) for
their
> creation.
> - They are database-independent.
> - They do not need adjustments when you try to merge two databases
(anyone
> who's tried it knows exactly how painful this is).
>
> The only down side is their size (38 bytes) which can be reduced
to 24 if
> you use a base64 algorithm to convert them to strings instead of
the usual
> format.
>
> So, why don't you turn the ID to a VARIANT that can contain any
basic type?
> After all, aren't IDs supposed to be opaque?
> I think that the only thing you will need is a function to test for
> equality. For scalar variants the function VarEquals() will do, if
you want
> to support variant arrays (for instance if the ID consists of 2
database
> columns) i can send you code that compares 2 arbitrary variants.
You can
> even define an event handler (OnCompareIDs) that delegates the
comparison of
> IDs to the user.

Thanks for your suggestion. What I afraid is Variant type ID and
also the algorithm used to generate GUID might slow down the tree
too much when accessing or adding new nodes to it. Currently, a
float type ID is enough for me. If more people ask for GUID as ID, I
will try to turn your suggestion into reality.

regards,
C.S. Phua


re: New file uploaded to VirtualTreeview

From: "fastpartner" [m.jensen@w...]
Date: Thu Jan 3, 2002 11:37 pm
Subject: Re: New file uploaded to VirtualTreeview

Hello Zai,

I used a TADODataSet component and I connected it to a TDatasource
component.

Then I placed the "VirtualDBTreeEx" on my database form
and connected it the DataSource property to the
TDataSource component.

Now I have tried to enter the properties for
KeyFieldName, ParentFieldName and ViewFieldName.
As KeyFieldName I entered " article_id " and as
the other 2 properties I added " article_title "
because these are the field names.

All datasource components are working but the
"VirtualDBTreeEx" doesn`t show anything.

Maybe I have to enter other field names in the property
for KeyFieldName and so on?

Do you have any idea what I am doing wrong!

Do you maybe have a sample file with a working "VirtualDBTreeEx"
and a database because my "VirtualDBTreeEx" doesn`t show
anything.

Best regards,
Matthias Jensen
[m.jensen@w...]

--- In [VirtualTreeview@y...], "zai_xiong" [csphua@t...] wrote:
> --- In [VirtualTreeview@y...], "fastpartner" [m.jensen@w...] wrote:
> > Hi,
> >
> > I have installed this new uploaded file. There appear 3 different
> > dbtree - components ( VirtualIDTree, DBCheck...etc. ).
> >
>
> These trees serve different purposes. VirtualDBTreeEx give a plain
> DBTree, which the remaining gives a checkbox enabled DBTree. To
> complicated things further, DBCheckVirtualDBTreeEx is the data
bound
> version of CheckVirtualDBTreeEx... I mainly used VirtualDBTreeEx in
> my project.
>
> > How can I use this 3 components with a database. Are there any
> help
> > files available ?
>
> Well, you can point these 3 components to a same datasource which
> will give what you want.
>
> I guess help file is not necessary. Here is some guide lines:-
>
> 1. Assign a datasource to VirtualDBTreeEx
> 2. Assign the minimum 3 field names of fields in your database
> pointed to by the datasource to property KeyFieldName,
> ParentFieldName and ViewFieldName, respectively.
> 3. Open you dataset. You should be able to see the tree populated
> by the records in your dataset. Note that you need to have
> Parent-Child relationship setup properly in your dataset in
order
> to see the results. In my own database, I used these fields:-
> ID, ParentID, NType
> 4. If you would like to see Icons in the tree, assign a ImageList
to
> the tree, then assign a field name to property ImgIdxFieldName.
>
> hope I can help you clear your doubts regarding VirtualDBTreeEx
>
> Regards,
> C.S. Phua

 | Replies | Author | Date
5060 | Re: New file uploaded to VirtualTreeview | zai_xiong | Fri 1/4/2002
5068 | Re: New file uploaded to VirtualTreeview | fastpartner | Fri 1/4/2002
5071 | Re: New file uploaded to VirtualTreeview | zai_xiong | Sat 1/5/2002
5072 | Re: New file uploaded to VirtualTreeview | Helge Jung (ECO-Logic) | Sat 1/5/2002


re: New file uploaded to VirtualTreeview

From: "zai_xiong" [csphua@t...]
Date: Fri Jan 4, 2002 8:23 am
Subject: Re: New file uploaded to VirtualTreeview

--- In [VirtualTreeview@y...], "fastpartner" [m.jensen@w...] wrote:
> Hello Zai,
You can call me "C.S."

>
> I used a TADODataSet component and I connected it to a TDatasource
> component.
>
> Then I placed the "VirtualDBTreeEx" on my database form
> and connected it the DataSource property to the
> TDataSource component.
>
> Now I have tried to enter the properties for
> KeyFieldName, ParentFieldName and ViewFieldName.
> As KeyFieldName I entered " article_id " and as
> the other 2 properties I added " article_title "
> because these are the field names.

You need to form Parent-Child relationship in order for the tree to
show it's nodes. Eg. the follow data could help you understand
better:-

ID ParentID NType Descrp
-----------------------------------------------------------
1 0 (Root) 1 Organization Structure
2 1 2 Dept 1
3 1 2 Dept 2
4 2 3 Manager
5 2 3 Asst. Manager
6 3 4 Staff

will produce this tree:-

Organization Structure
|
+---- Dept 1
| |
| +---- Manager
| |
| +---- Asst. Manager
|
+---- Dept 2
|
+---- Staff

You need to have this assignment:-
VirtualDBTreeEx1.KeyFieldName := 'ID';
VirtualDBTreeEx1.ParentFieldName := 'ParentID';
VirtualDBTreeEx1.ViewFieldName := 'Descrp';
VirtualDBTreeEx1.ImgIdxFieldName := 'NType';

VirtualDBTreeEx1.Images := ImageList1;

This ImageList1 should have at least 5 images... to be shown in the
tree as icon of nodes.

Got it?

Regards,
C.S. Phua

 | Replies | Author | Date
5068 | Re: New file uploaded to VirtualTreeview | fastpartner | Fri 1/4/2002
5071 | Re: New file uploaded to VirtualTreeview | zai_xiong | Sat 1/5/2002
5072 | Re: New file uploaded to VirtualTreeview | Helge Jung (ECO-Logic) | Sat 1/5/2002


VirtualDBTreeEx brief explanation

From: "zai_xiong" [csphua@t...]
Date: Fri Jan 4, 2002 8:34 am
Subject: VirtualDBTreeEx brief explanation

Dear DBVT user,

You need to form Parent-Child relationship in order for the tree to
show it's nodes. Eg. the follow data could help you understand
better:-

ID ParentID NType Descrp
-----------------------------------------------------------
1 0 (Root) 0 Organization Structure
2 1 1 Dept 1
3 1 1 Dept 2
4 2 2 Manager
5 2 2 Asst. Manager
6 3 3 Staff

will produce this tree:-

Organization Structure
|
+---- Dept 1
| |
| +---- Manager
| |
| +---- Asst. Manager
|
+---- Dept 2
|
+---- Staff

You need to have this assignment:-
VirtualDBTreeEx1.KeyFieldName := 'ID';
VirtualDBTreeEx1.ParentFieldName := 'ParentID';
VirtualDBTreeEx1.ViewFieldName := 'Descrp';
VirtualDBTreeEx1.ImgIdxFieldName := 'NType';

VirtualDBTreeEx1.Images := ImageList1;

This ImageList1 should have at least 4 images... to be shown in the
tree as icon of nodes.

Got it? Happy dbtrees planting... :)

Regards,
C.S. Phua

 | Replies | Author | Date
5081 | Re: VirtualDBTreeEx brief explanation | fastpartner | Sun 1/6/2002
5082 | Re: VirtualDBTreeEx brief explanation | fransbouwmans | Sun 1/6/2002


Slow on DeleteNode

From: "vespaman66" [micael.beronius@a...]
Date: Fri Jan 4, 2002 1:31 pm
Subject: Slow on DeleteNode

Hello,

I am having a problem with VT being very slow on DeleteNode;

I have a fairly large tree, with only one or two levels of the tree,
i.e. lots of siblings. (I am currently testing with 10000).

The problem is that, when I delete the first node among these
siblings, it takes a long time. With my _very_ limited experience of
Pascal (I'm using BCB), I have traced the problems to the
InternalDisconnectNode function, where there seems to be some
indexing of the whole list when one node is deleted;

if Assigned(Node.NextSibling) then
begin
Node.NextSibling.PrevSibling := Node.PrevSibling;
// reindex all following nodes
Run := Node.NextSibling;
while Assigned(Run) do
begin
Dec(Run.Index);
Run := Run.NextSibling;
end;
end

I obviously don't know the reason for the re-indexing, since my
belief is that this is a linked list(?). But is there any other way
of deleteing one node, which is faster (w/o re-indexing)?

Thanks,
- Micael

 | Replies | Author | Date
5063 | Re: Slow on DeleteNode | Helge Jung (ECO-Logic) | Fri 1/4/2002
5064 | Re: Slow on DeleteNode | vespaman66 | Fri 1/4/2002
5066 | Re: Slow on DeleteNode | Werner Lehmann | Fri 1/4/2002
5067 | Re: Slow on DeleteNode | vespaman66 | Fri 1/4/2002
5069 | Re: Slow on DeleteNode | Werner Lehmann | Fri 1/4/2002
5073 | Re: Slow on DeleteNode | vespaman66 | Sat 1/5/2002
5079 | Re: Slow on DeleteNode | Werner Lehmann | Sun 1/6/2002


re: Slow on DeleteNode

From: "Helge Jung \(ECO-Logic\)" [helge@e...]
Date: Fri Jan 4, 2002 1:34 pm
Subject: Re: [VirtualTreeview] Slow on DeleteNode

> (...) But is there any other way
> of deleteing one node, which is faster (w/o re-indexing)?

Wild guess: Using of BeginUpdate and EndUpdate?

Helge.

 | Replies | Author | Date
5064 | Re: Slow on DeleteNode | vespaman66 | Fri 1/4/2002


re: Slow on DeleteNode

From: "vespaman66" [micael.beronius@a...]
Date: Fri Jan 4, 2002 3:09 pm
Subject: Re: Slow on DeleteNode

--- In [VirtualTreeview@y...], "Helge Jung \(ECO-Logic\)" [helge@e...]
wrote:
> > (...) But is there any other way
> > of deleteing one node, which is faster (w/o re-indexing)?
>
> Wild guess: Using of BeginUpdate and EndUpdate?
>
> Helge.

I'm already using it!
Will try to use move and reuse the node again, but maybe this will re-
index as well...

- Micael


Beta 2.7.5

From: "edu2mauro" [mauroe@u...]
Date: Fri Jan 4, 2002 3:22 pm
Subject: Beta 2.7.5

I downloaded the latest beta and I couldn´t install it. The problem
is tha the defines in COMPILERS.INC do not match with the used in
VirtualTreeRegs.pas. In that file is used the define DELPHI_5+, which
is not defined in COMPILERS.INC.

Best regards
Eduardo Mauro

 | Replies | Author | Date
5070 | Re: Beta 2.7.5 | Jim Kueneman | Fri 1/4/2002


re: Slow on DeleteNode

From: Werner Lehmann [wl@b...]
Date: Fri Jan 4, 2002 3:36 pm
Subject: Re: [VirtualTreeview] Slow on DeleteNode

Hi Micael,

> I obviously don't know the reason for the re-indexing, since my
> belief is that this is a linked list(?). But is there any other way
> of deleteing one node, which is faster (w/o re-indexing)?

Each node record carries an index which might be used for node initialization
among others. It must always be kept up to date (Helge, I doubt that BeginUpdate
would change a thing here, at least with respect to the node indices. It only
freezes visual updates - which can also help here of course.)

I have not noticed that the reindexing takes so much time but on the other
hand I haven't deleted very many nodes at once. If you have 10000 siblings
and delete each one beginning with the first VT would loop that code 9999 +
9998 + ... + 1 = 49,995,000 times. That would be a worst case of course.

But since only subsequent node's indices must be adjusted you might save some
time if you delete nodes backwards, from bottom to top. With the example above
no index corrections would be necessary.

Another possibility to save time could be to delete the whole parent node if
almost all child nodes are to be deleted and add those few child nodes again
after that. Depends on the situation.

Werner

 | Replies | Author | Date
5067 | Re: Slow on DeleteNode | vespaman66 | Fri 1/4/2002


re: Slow on DeleteNode

From: "vespaman66" [micael.beronius@a...]
Date: Fri Jan 4, 2002 6:20 pm
Subject: Re: Slow on DeleteNode

Hi Werner,

>I have not noticed that the reindexing takes so much time but on
>the other hand I haven't deleted very many nodes at once. If you

I basically tried having a button, deleting the first 1000 nodes.
On my Athlon 1800+, this takes about 3 seconds (using my brains
internal timer, no quartz!;-), and eats 100% of one CPU.

>have 10000 siblings
>and delete each one beginning with the first VT would loop that
>code 9999 + 9998 + ... + 1 = 49,995,000 times.

Yes, put that way, it is clear why this occupies my CPU! ;-)

In my application, I need to use these little siblings as FIFO, so
your idea of deleting from bottom is only good if I insert the new
ones at the top, in which case, I get the delay there instead (with
the re-indexing).

I had an idea of reusing the nodes, by moving them, but that also re-
indexes. I also thought about doing a function that deletes some (say
the first 100 hundred) in one go, with only one re-indexing. But
that's not a very clean solution.. So another idea would be to have a
timer that deletes when time permit, and to leave those old nodes
hanging around for a while.

I realize that I may be abusing VT, by adding so many siblings, but
it is a very nice component, meeting up to many needs that I have,
apart from the speed problem.

- Micael


re: New file uploaded to VirtualTreeview

From: "fastpartner" [m.jensen@w...]
Date: Fri Jan 4, 2002 6:28 pm
Subject: Re: New file uploaded to VirtualTreeview

Hello "C.S."

Thanks a lot for your reply regarding "VirtualDBTreeEx" and how
it works.

The best way to learn how it works is probably a downloadable sample
file "VirtualDBTreeEx with a sample database" on a Delphi form, so
people can look at the code and learn how it really works.

But this it up to you.

Thanks,
Matthias Jensen

--- In [VirtualTreeview@y...], "zai_xiong" [csphua@t...] wrote:
> --- In [VirtualTreeview@y...], "fastpartner" [m.jensen@w...] wrote:
> > Hello Zai,
> You can call me "C.S."
>
> >
> > I used a TADODataSet component and I connected it to a
TDatasource
> > component.
> >
> > Then I placed the "VirtualDBTreeEx" on my database form
> > and connected it the DataSource property to the
> > TDataSource component.
> >
> > Now I have tried to enter the properties for
> > KeyFieldName, ParentFieldName and ViewFieldName.
> > As KeyFieldName I entered " article_id " and as
> > the other 2 properties I added " article_title "
> > because these are the field names.
>
> You need to form Parent-Child relationship in order for the tree to
> show it's nodes. Eg. the follow data could help you understand
> better:-
>
> ID ParentID NType Descrp
> -----------------------------------------------------------
> 1 0 (Root) 1 Organization Structure
> 2 1 2 Dept 1
> 3 1 2 Dept 2
> 4 2 3 Manager
> 5 2 3 Asst. Manager
> 6 3 4 Staff
>
> will produce this tree:-
>
> Organization Structure
> |
> +---- Dept 1
> | |
> | +---- Manager
> | |
> | +---- Asst. Manager
> |
> +---- Dept 2
> |
> +---- Staff
>
>
> You need to have this assignment:-
> VirtualDBTreeEx1.KeyFieldName := 'ID';
> VirtualDBTreeEx1.ParentFieldName := 'ParentID';
> VirtualDBTreeEx1.ViewFieldName := 'Descrp';
> VirtualDBTreeEx1.ImgIdxFieldName := 'NType';
>
> VirtualDBTreeEx1.Images := ImageList1;
>
> This ImageList1 should have at least 5 images... to be shown in
the
> tree as icon of nodes.
>
> Got it?
>
> Regards,
> C.S. Phua

 | Replies | Author | Date
5071 | Re: New file uploaded to VirtualTreeview | zai_xiong | Sat 1/5/2002
5072 | Re: New file uploaded to VirtualTreeview | Helge Jung (ECO-Logic) | Sat 1/5/2002


re: Re: Slow on DeleteNode

From: Werner Lehmann [wl@b...]
Date: Fri Jan 4, 2002 6:56 pm
Subject: Re: [VirtualTreeview] Re: Slow on DeleteNode

vespaman66 wrote:
>
> I basically tried having a button, deleting the first 1000 nodes.
> On my Athlon 1800+, this takes about 3 seconds (using my brains
> internal timer, no quartz!;-), and eats 100% of one CPU.

:)

> >have 10000 siblings
> >and delete each one beginning with the first VT would loop that
> >code 9999 + 9998 + ... + 1 = 49,995,000 times.
>
> Yes, put that way, it is clear why this occupies my CPU! ;-)

You need a faster CPU. One of those which can handle even endless loops
in less a second.

> In my application, I need to use these little siblings as FIFO, so
> your idea of deleting from bottom is only good if I insert the new
> ones at the top, in which case, I get the delay there instead (with
> the re-indexing).
>
> I had an idea of reusing the nodes, by moving them, but that also re-
> indexes. I also thought about doing a function that deletes some (say
> the first 100 hundred) in one go, with only one re-indexing. But
> that's not a very clean solution.. So another idea would be to have a
> timer that deletes when time permit, and to leave those old nodes
> hanging around for a while.
>
> I realize that I may be abusing VT, by adding so many siblings, but
> it is a very nice component, meeting up to many needs that I have,
> apart from the speed problem.

There's another possibility. Don't init your nodes but use the node index
as index into your own data structure, TList or something. Then, if you
insert an entry at the beginning of the list, simply append one node to
siblings and call Invalidate on the tree (when your done in case there are
more insertions). In OnGetText use only the node index to get the text from
your data. Delete works similar. This avoids reindexing the nodes alto-
gether. Of course you can't use the built in sort capability of the VT
but you don't want this anyway with a FIFO. There might also be some other
gotchas, for example with drag and drop...

Werner

 | Replies | Author | Date
5073 | Re: Slow on DeleteNode | vespaman66 | Sat 1/5/2002


re: Beta 2.7.5

From: Jim Kueneman [jimdk@m...]
Date: Fri Jan 4, 2002 11:46 pm
Subject: Re: [VirtualTreeview] Beta 2.7.5

At 03:22 PM 1/4/2002 +0000, you wrote:
>I downloaded the latest beta and I couldn´t install it. The problem
>is tha the defines in COMPILERS.INC do not match with the used in
>VirtualTreeRegs.pas. In that file is used the define DELPHI_5+, which
>is not defined in COMPILERS.INC.

Just an oversight, change every thing to the *UP version. It was a change
necessary for BCB if I remember right.

Jim


re: New file uploaded to VirtualTreeview

From: "zai_xiong" [csphua@t...]
Date: Sat Jan 5, 2002 1:07 am
Subject: Re: New file uploaded to VirtualTreeview

I wanted to do so, but I do not have Delphi compiler installed. I'm
using C++ Builder. I afraid Delphi user cannot see my C++ Builder
codes and forms... I believe a simple explaination will do, since it
is not that hard to use VirtualDBTreeEx...

--- In [VirtualTreeview@y...], "fastpartner" [m.jensen@w...] wrote:
> Hello "C.S."
>
> Thanks a lot for your reply regarding "VirtualDBTreeEx" and how
> it works.
>
> The best way to learn how it works is probably a downloadable
sample
> file "VirtualDBTreeEx with a sample database" on a Delphi form, so
> people can look at the code and learn how it really works.
>
> But this it up to you.
>
> Thanks,
> Matthias Jensen
>
>
>
> --- In [VirtualTreeview@y...], "zai_xiong" [csphua@t...] wrote:
> > --- In [VirtualTreeview@y...], "fastpartner" [m.jensen@w...] wrote:
> > > Hello Zai,
> > You can call me "C.S."
> >
> > >
> > > I used a TADODataSet component and I connected it to a
> TDatasource
> > > component.
> > >
> > > Then I placed the "VirtualDBTreeEx" on my database form
> > > and connected it the DataSource property to the
> > > TDataSource component.
> > >
> > > Now I have tried to enter the properties for
> > > KeyFieldName, ParentFieldName and ViewFieldName.
> > > As KeyFieldName I entered " article_id " and as
> > > the other 2 properties I added " article_title "
> > > because these are the field names.
> >
> > You need to form Parent-Child relationship in order for the tree
to
> > show it's nodes. Eg. the follow data could help you understand
> > better:-
> >
> > ID ParentID NType Descrp
> > -----------------------------------------------------------
> > 1 0 (Root) 1 Organization Structure
> > 2 1 2 Dept 1
> > 3 1 2 Dept 2
> > 4 2 3 Manager
> > 5 2 3 Asst. Manager
> > 6 3 4 Staff
> >
> > will produce this tree:-
> >
> > Organization Structure
> > |
> > +---- Dept 1
> > | |
> > | +---- Manager
> > | |
> > | +---- Asst. Manager
> > |
> > +---- Dept 2
> > |
> > +---- Staff
> >
> >
> > You need to have this assignment:-
> > VirtualDBTreeEx1.KeyFieldName := 'ID';
> > VirtualDBTreeEx1.ParentFieldName := 'ParentID';
> > VirtualDBTreeEx1.ViewFieldName := 'Descrp';
> > VirtualDBTreeEx1.ImgIdxFieldName := 'NType';
> >
> > VirtualDBTreeEx1.Images := ImageList1;
> >
> > This ImageList1 should have at least 5 images... to be shown in
> the
> > tree as icon of nodes.
> >
> > Got it?
> >
> > Regards,
> > C.S. Phua

 | Replies | Author | Date
5072 | Re: New file uploaded to VirtualTreeview | Helge Jung (ECO-Logic) | Sat 1/5/2002


re: Re: New file uploaded to VirtualTreeview

From: "Helge Jung \(ECO-Logic\)" [helge@e...]
Date: Sat Jan 5, 2002 1:11 am
Subject: Re: [VirtualTreeview] Re: New file uploaded to VirtualTreeview

> I wanted to do so, but I do not have Delphi compiler installed. I'm
> using C++ Builder. I afraid Delphi user cannot see my C++ Builder
> codes and forms... I believe a simple explaination will do, since it
> is not that hard to use VirtualDBTreeEx...

Suggestion: Write a short text-file explaining the basic stuff and include
it into the zip-file.

Helge.

P.S. Please don't append all e-mails when you reply - only the important
stuff.


re: Slow on DeleteNode

From: "vespaman66" [micael.beronius@a...]
Date: Sat Jan 5, 2002 11:10 am
Subject: Re: Slow on DeleteNode

Werner Lehmann [wl@b...] wrote:

> > Yes, put that way, it is clear why this occupies my CPU! ;-)
>
> You need a faster CPU. One of those which can handle even endless
> loops in less a second.

I can see that you are an experienced computer addict, knowing what
the *real* solution is! :-)

> There's another possibility. Don't init your nodes but use the node
index
> as index into your own data structure, TList or something. Then, if
you
> insert an entry at the beginning of the list, simply append one
node to
> siblings and call Invalidate on the tree (when your done in case
there are
> more insertions). In OnGetText use only the node index to get the
text from
> your data. Delete works similar. This avoids reindexing the nodes
alto-
> gether. Of course you can't use the built in sort capability of the
VT
> but you don't want this anyway with a FIFO. There might also be
some other
> gotchas, for example with drag and drop...
>
> Werner

I had to sleep on this one, and I think this is a way forward. I have
yet to do more thinking, I may be back .. ;-)

Thankyou for your help!

- Micael


Application triggert focus change

From: Dieter Köhler [dieter.koehler@p...]
Date: Sun Jan 6, 2002 2:40 am
Subject: Application triggert focus change

I use the following piece of code to add a new node to a VirtualStringTree (with
SelectionOptions = [toExtendedFocus,toFullRowSelect]) when a certain toolbutton
is clicked:

fn:= FocusedNode;
EndEditNode;
tn:= InsertNode(fn,amInsertAfter);
... // Connect my tree data with tn (omitted)
FocusedNode:= tn;

The problem is, that tn seems to get the focus (the Node parameter of the
triggered OnFocusChanged event is set to tn; also FocusedNode returns correctly
tn), but incorrectly the row of fn remains grayed instead of the row of tn.

Dieter Köhler

 | Replies | Author | Date
5075 | Re: Application triggert focus change | Jim Kueneman | Sun 1/6/2002
5076 | Re: Application triggert focus change | Dieter Köhler | Sun 1/6/2002
5077 | Re: Application triggert focus change | Jim Kueneman | Sun 1/6/2002
5078 | Re: Application triggert focus change | rm198de | Sun 1/6/2002
5080 | Re: Application triggert focus change | Dieter Köhler | Sun 1/6/2002
5112 | Re: Application triggert focus change | Mike Lischke | Thu 1/10/2002
5120 | Re: Application triggert focus change | Dieter Köhler | Fri 1/11/2002


re: Application triggert focus change

From: Jim Kueneman [jimdk@m...]
Date: Sun Jan 6, 2002 3:04 am
Subject: Re: [VirtualTreeview] Application triggert focus change

>The problem is, that tn seems to get the focus (the Node parameter of the
>triggered OnFocusChanged event is set to tn; also FocusedNode returns
>correctly
>tn), but incorrectly the row of fn remains grayed instead of the row of tn.

Try either wrapping the block with Begin/Endupdates or call InvalidateNode
for each node.

Jim


re: Application triggert focus change

From: Dieter Köhler [dieter.koehler@p...]
Date: Sun Jan 6, 2002 4:29 am
Subject: Re: [VirtualTreeview] Application triggert focus change

> >The problem is, that tn seems to get the focus (the Node parameter of the
> >triggered OnFocusChanged event is set to tn; also FocusedNode returns
> >correctly
> >tn), but incorrectly the row of fn remains grayed instead of the row of tn.
>
> Try either wrapping the block with Begin/Endupdates or call InvalidateNode
> for each node.

I already tried that, but none of it did work.

Dieter

 | Replies | Author | Date
5077 | Re: Application triggert focus change | Jim Kueneman | Sun 1/6/2002


re: Application triggert focus change

From: Jim Kueneman [jimdk@m...]
Date: Sun Jan 6, 2002 6:18 am
Subject: Re: [VirtualTreeview] Application triggert focus change

> > Try either wrapping the block with Begin/Endupdates or call InvalidateNode
> > for each node.
>
>I already tried that, but none of it did work.

Can you post a small demo that show the problem to the files area of Yahoo
Groups?

Jim


re: Application triggert focus change

From: "rm198de" [rmelles@g...]
Date: Sun Jan 6, 2002 12:46 pm
Subject: Re: Application triggert focus change

>...but incorrectly the row of fn remains grayed instead of the row
of tn.
>
> Dieter Köhler

Hi Dieter,

if multiselect is enabled, you have to clear the selection manually
by using: Selected[fn]:=False;

Regards
Ralf


re: Re: Slow on DeleteNode

From: Werner Lehmann [wl@b...]
Date: Sun Jan 6, 2002 11:24 am
Subject: Re: [VirtualTreeview] Re: Slow on DeleteNode

vespaman66 wrote:
>
> I had to sleep on this one, and I think this is a way forward. I have
> yet to do more thinking, I may be back .. ;-)

Sure. But I have just come to think about a maybe more serious problem
with that approach. The VST holds the width of each node in a cache at
the beginning of the internal data section (of each node). Now, if your
node texts are differing in length and they are shifting up or down be-
cause of deletes or inserts VST will not know that and still relies on
its internal width cache. This results in cut off node captions or too
large selection rectangles.

Should this turn out to be a problem there are some countermeasures:

- call ReinitNode for each FIFO node that is already init'ed (check for
vsInitialized in the Node.States set, usually only those which have
been visible, not all 10000 siblings), this will reset the text width
cache

- manually reset the node width to 0 (meaning for the VST: this width
is not yet cached, get it when needed). This requires a VST hack
though, for details look at the ReinitNode code

- width is only cached for maincolumn; make maincolumn width 0, use
other column instead. Not sure about the visual effect with expand
buttons here

- use virtual drawtree; no width cache here of course. You must draw
the caption and image of each node yourself

Regards,
Werner


re: Re: Application triggert focus change

From: Dieter Köhler [dieter.koehler@p...]
Date: Sun Jan 6, 2002 2:14 pm
Subject: Re: [VirtualTreeview] Re: Application triggert focus change

> if multiselect is enabled, you have to clear the selection manually
> by using: Selected[fn]:=False;

Hi Ralf,

thanks for the hint! It works if I use it twice, for the old as well as for the
new node:

fn:= FocusedNode;
EndEditNode;
tn:= InsertNode(fn,amInsertAfter);
... // Connect my tree data with tn (omitted)
FocusedNode:= tn;
Selected[fn]:= False;
Selected[tn]:= True;

Digging in the sources I found the reason for it: Neither DoFocusNode() nor
SetFocusedNode() modify the selection. Selections need always to be modified
explicitly in addition to modifying the focus. However, I would intuitively
expect that changing the focus always triggers the selection. Would it not be
better to synchronize it? Mike?

Dieter

 | Replies | Author | Date
5112 | Re: Application triggert focus change | Mike Lischke | Thu 1/10/2002


re: VirtualDBTreeEx brief explanation

From: "fastpartner" [m.jensen@w...]
Date: Sun Jan 6, 2002 2:53 pm
Subject: Re: VirtualDBTreeEx brief explanation

Hello C.S.,

I have read your brief explaination about VirtualDBTreeEx but without
code is it hard to figure that out.
I am new to VirtualTree view and new to VirtualDBTreeEx but I would
like to learn it.

I have a Access2000 database with following fields:

1. article_id
2. article_title
3. article_desc

Now I just want to load this database in the VirtualDBTreeEx. Now I
have connected it to the DataSource but what do I have to do now
because you write that the following fields have to be called:

VirtualDBTreeEx1.KeyFieldName := 'ID';
VirtualDBTreeEx1.ParentFieldName := 'ParentID';
VirtualDBTreeEx1.ViewFieldName := 'Descrp';
VirtualDBTreeEx1.ImgIdxFieldName := 'NType';

How can the tree know that eg. my field article_id is the key field
and the ViewFieldName I would call article_title but is that right?

Do I have to add something in the code?
I am new to those kind of db-treeviews but when I know how this works
then I can do the rest myself and adapt it to other developments.

Thanks, if you have the time to reply to a beginner.
Best regards,
Matthias Jensen

--- In [VirtualTreeview@y...], "zai_xiong" [csphua@t...] wrote:
> Dear DBVT user,
>
> You need to form Parent-Child relationship in order for the tree to
> show it's nodes. Eg. the follow data could help you understand
> better:-
>
> ID ParentID NType Descrp
> -----------------------------------------------------------
> 1 0 (Root) 0 Organization Structure
> 2 1 1 Dept 1
> 3 1 1 Dept 2
> 4 2 2 Manager
> 5 2 2 Asst. Manager
> 6 3 3 Staff
>
> will produce this tree:-
>
> Organization Structure
> |
> +---- Dept 1
> | |
> | +---- Manager
> | |
> | +---- Asst. Manager
> |
> +---- Dept 2
> |
> +---- Staff
>
>
> You need to have this assignment:-
> VirtualDBTreeEx1.KeyFieldName := 'ID';
> VirtualDBTreeEx1.ParentFieldName := 'ParentID';
> VirtualDBTreeEx1.ViewFieldName := 'Descrp';
> VirtualDBTreeEx1.ImgIdxFieldName := 'NType';
>
> VirtualDBTreeEx1.Images := ImageList1;
>
> This ImageList1 should have at least 4 images... to be shown in
the
> tree as icon of nodes.
>
> Got it? Happy dbtrees planting... :)
>
> Regards,
> C.S. Phua

 | Replies | Author | Date
5082 | Re: VirtualDBTreeEx brief explanation | fransbouwmans | Sun 1/6/2002


re: VirtualDBTreeEx brief explanation

From: "fransbouwmans" [frans.bouwmans@z...]
Date: Sun Jan 6, 2002 4:31 pm
Subject: Re: VirtualDBTreeEx brief explanation

--- In [VirtualTreeview@y...], "fastpartner" [m.jensen@w...] wrote:
> Hello C.S.,
>
> I have read your brief explaination about VirtualDBTreeEx but
without
> code is it hard to figure that out.
> I am new to VirtualTree view and new to VirtualDBTreeEx but I would
> like to learn it.
>
> I have a Access2000 database with following fields:
>
> 1. article_id
> 2. article_title
> 3. article_desc

It seems clear that when you want it to show in a tree, that there
should be some kind of tree info in your database. a parent child
relationship.
Without this there is no tree needed, and you can use a normal
dbgrid.

Frans Bouwmans


MoveTo() and OnFocusChange

From: Dieter Köhler [dieter.koehler@p...]
Date: Sun Jan 6, 2002 10:47 pm
Subject: MoveTo() and OnFocusChange

I realized that when using the MoveTo() command on a focused node an
OnFocusChange event is triggert (via InternalDisconnectNode() in MoveTo()) with
a Node parameter nil. This behavior is somewhat awkward for my purpose, since I
use the OnFocusChange event to update another display showing details about the
focused data. When the focused node is only moved it is not necessary to
invalidate this display. This is only necessary when the focused node is
deleted.

I therefore want to suggest adding a new toMovedRemainFocused option to
TVTSelectionOption: "Nodes remain focused when moved".

To implement it the following changes are necessary:

1. In TBaseVirtualTree.InternalDisconnectNode() delete:

if Node = FFocusedNode then
begin
DoFocusNode(nil, False);
DoFocusChange(FFocusedNode, FFocusedColumn);
end;

2. In TBaseVirtualTree.DeleteNode() change

InternalDisconnectNode(Node);

to

if Node = FFocusedNode then
begin
DoFocusNode(nil, False);
DoFocusChange(FFocusedNode, FFocusedColumn);
end;
InternalDisconnectNode(Node);

3. In TBaseVirtualTree.MoveTo() change the _two_ occurences of

InternalDisconnectNode(Source);

to

if (Source = FFocusedNode) and not (toMovedRemainFocused in
FSelectionOptions) then
begin
DoFocusNode(nil, False);
DoFocusChange(FFocusedNode, FFocusedColumn);
end;
InternalDisconnectNode(Source);

--
=====================================================================
Dieter Köhler, M. A. - [dieter.koehler@p...]
Schiffgasse 4a, D-69117 Heidelberg, +49(0)6221-485995
"http://www.philo.de/Philosophie-Seiten/": 1000+ Philosophie-Links
"http://www.philo.de/VirtualLibrary/14.de.htm": Deutsche Philo-Links
"http://www.philo.de/xml/": Open XML - XML-Komponenten für Delphi
=====================================================================

 | Replies | Author | Date
5113 | Re: MoveTo() and OnFocusChange | Mike Lischke | Thu 1/10/2002
5121 | Re: MoveTo() and OnFocusChange | Dieter Köhler | Fri 1/11/2002
5126 | Re: MoveTo() and OnFocusChange | Mike Lischke | Fri 1/11/2002


TVTEdit: Does not accept changes when another control gets the focus

From: Dieter Köhler [dieter.koehler@p...]
Date: Mon Jan 7, 2002 2:55 am
Subject: TVTEdit: Does not accept changes when another control gets the focus

In section "Editors and editing" the Virtual Tree help says: "The most important
action is when the edit looses the focus (e.g. because the user switched to
another control or clicked the tree). In this case editing should stop. The
default action in such a case is btw. to accept any changes." -- However, the
TVTEdit class does not behave in this way. It neither ends nor cancels
editing. The effect is that if one, for example, puts a VirtualStringTree on a
modal form and clicks the OK-Button editing cancels silently. Well, a
workaround is to call EndEditNode() in the OnExit event of the
VitrualStringTree. But a more natural way would be to let TVTEdit itself accept
the changes by directly reacting on a CM_EXIT message by calling
FLink.EndEdit().

--
=====================================================================
Dieter Köhler, M. A. - [dieter.koehler@p...]
Schiffgasse 4a, D-69117 Heidelberg, +49(0)6221-485995
"http://www.philo.de/Philosophie-Seiten/": 1000+ Philosophie-Links
"http://www.philo.de/VirtualLibrary/14.de.htm": Deutsche Philo-Links
"http://www.philo.de/xml/": Open XML - XML-Komponenten für Delphi
=====================================================================

 | Replies | Author | Date
5114 | Re: TVTEdit: Does not accept changes when another | Mike Lischke | Thu 1/10/2002
5119 | Re: TVTEdit: Does not accept changes when another | Dieter Köhler | Fri 1/11/2002
5125 | Re: TVTEdit: Does not accept changes when another | Mike Lischke | Fri 1/11/2002


Problem with empty columns when editing

From: Andrew Cumming [andrew@k...]
Date: Mon Jan 7, 2002 8:52 am
Subject: Problem with empty columns when editing

Hello,

My problem is with a tree that has multiple columns where for example,
columns 2 and 3 contain string fields to be edited. If these fields are
initially empty (0 length strings) then it is not possible to edit these
fields. I have traced the problem to the following parts of the treeview
component.

The following function is called to determine if a column is empty (pretty
obvious but just in case it can determine this in any other way);

function TCustomVirtualStringTree.ColumnIsEmpty(Node: PVirtualNode; Column:
Integer): Boolean;

// For hit tests it is necessary to consider cases where columns are empty
and automatic column spanning is enabled.
// This method simply checks the given column's text and if this is empty
then the column is considered as being empty.

var
Text: WideString;

begin
DoGetText(Node, Column, ttNormal, Text);
Result := Length(Text) = 0;
end;

When I try to edit the one of these empty fields, the following procedure
is called to determine what column I have clicked on.

procedure TBaseVirtualTree.GetHitTestInfoAt(X, Y: Integer; var HitInfo:
THitInfo);
....
// if auto column spanning is enabled then look for the last non
empty column
if voAutoSpanColumns in FOptions then
while (HitInfo.HitColumn > -1) and
ColumnIsEmpty(HitInfo.HitNode, HitInfo.HitColumn) do
HitInfo.HitColumn :=
FHeader.FColumns.GetPreviousVisibleColumn(HitInfo.HitColumn);

The HitColumn is used to put a value into FFocusedColumn and in this code,
it finds my empty column, then back tracks to previous columns until it
finds one that is not empty. Unfortunately, this makes it impossible to
edit the column I clicked on to put any data into it.

Does anyone have a solution for this (short of making sure the GetText
event doesnt return an empty string) ?

or is this a problem with the treeview engine ?

Andrew Cumming.

 | Replies | Author | Date
5086 | Re: Problem with empty columns when editing | rm198de | Mon 1/7/2002
5087 | Delphi 6 Problem | Manfred Mueller-Spaeth | Mon 1/7/2002
5088 | Re: Delphi 6 Problem | milan_vacz | Mon 1/7/2002
5090 | AW: [VirtualTreeview] Re: Delphi 6 Problem | Manfred Mueller-Spaeth | Mon 1/7/2002
5115 | Re: Problem with empty columns when editing | Mike Lischke | Thu 1/10/2002


re: Problem with empty columns when editing

From: "rm198de" [rmelles@g...]
Date: Mon Jan 7, 2002 9:23 am
Subject: Re: Problem with empty columns when editing

> Does anyone have a solution for this (short of making sure the
GetText
> event doesnt return an empty string) ?
>
> or is this a problem with the treeview engine ?

Hi,

I`m still using "if Text='' then Text:=' '" in GetText but I think it
has to work too, if you enable option GridExtensions...

Regards
Ralf

 | Replies | Author | Date
5087 | Delphi 6 Problem | Manfred Mueller-Spaeth | Mon 1/7/2002
5088 | Re: Delphi 6 Problem | milan_vacz | Mon 1/7/2002
5090 | AW: [VirtualTreeview] Re: Delphi 6 Problem | Manfred Mueller-Spaeth | Mon 1/7/2002


Delphi 6 Problem

From: "Manfred Mueller-Spaeth" [manfred@m...]
Date: Mon Jan 7, 2002 9:52 am
Subject: Delphi 6 Problem

Hello!

I believe, VT and VET are the solutions for the problems caused by the &$%?"
TTreeView component ;-)))

But: under Delphi 6 Enterprise there ist no dsgnintf.pas, an older version
(from Delphi 3) won't work either. So how may I get this tool to work in my
environment? I would appreciate any hints, thanks!

Manfred Muller-Spath

[Non-text portions of this message have been removed]

 | Replies | Author | Date
5088 | Re: Delphi 6 Problem | milan_vacz | Mon 1/7/2002
5090 | AW: [VirtualTreeview] Re: Delphi 6 Problem | Manfred Mueller-Spaeth | Mon 1/7/2002


re: Delphi 6 Problem

From: "milan_vacz" [milan_va@s...]
Date: Mon Jan 7, 2002 5:38 pm
Subject: Re: Delphi 6 Problem

Hello.

> But: under Delphi 6 Enterprise there ist no dsgnintf.pas

Do you have the version 2.7.5? Try changing
{$IFDEF COMPILER_6+}
to
{$IFDEF COMPILER_6_UP}
in VirtualTreesReg.pas.

Version 2.7.5 can be found on
www.lischke-online.de/VirtualTreeview/beta/VirtualTree_2.7.5.zip

Milan Vandrovec

 | Replies | Author | Date
5090 | AW: [VirtualTreeview] Re: Delphi 6 Problem | Manfred Mueller-Spaeth | Mon 1/7/2002


Is forums.talkto.net OK?

From: "milan_vacz" [milan_va@s...]
Date: Mon Jan 7, 2002 5:52 pm
Subject: Is forums.talkto.net OK?

Hello.

Since the new year, I cannot connect to the newsgroup, it says
"Cannot find server forums.talkto.net".

Other news servers are OK, so I believe it's not my connection.

Milan Vandrovec

 | Replies | Author | Date
5091 | Re: Is forums.talkto.net OK? | Justin Stenning | Mon 1/7/2002
5116 | Re: Is forums.talkto.net OK? | Mike Lischke | Thu 1/10/2002


AW: Re: Delphi 6 Problem

From: "Manfred Mueller-Spaeth" [manfred@m...]
Date: Mon Jan 7, 2002 7:12 pm
Subject: AW: [VirtualTreeview] Re: Delphi 6 Problem

Milan,

Thank you for your hint!

>Do you have the version 2.7.5? Try changing
>{$IFDEF COMPILER_6+}
>to
>{$IFDEF COMPILER_6_UP}
>in VirtualTreesReg.pas.

But I had to change all COMPILER_x+ occurrences in the mentioned file, then
all was ok! Thanks again ...

Regards, Manfred Muller-Spath

[Non-text portions of this message have been removed]


re: Is forums.talkto.net OK?

From: "Justin Stenning" [jstenning@e...]
Date: Mon Jan 7, 2002 10:22 pm
Subject: Re: [VirtualTreeview] Is forums.talkto.net OK?

>Hello.
>
>Since the new year, I cannot connect to the newsgroup, it says
>"Cannot find server forums.talkto.net".
>
>Other news servers are OK, so I believe it's not my connection.
>
> Milan Vandrovec

I have been able to connect with no problems..

Justin Stenning


How to get the virtual size of the tree

From: "Anders Thomsen" [anders@t...]
Date: Mon Jan 7, 2002 11:25 pm
Subject: How to get the virtual size of the tree

Hi,

I'm looking for a function that returns the virtual size of the tree, similar
to GetTreeRect, but without specifying the tree canvas as a minimum.
It should just return the FRangeX and FRangeY.

I'm a little tired of adding this function manually everytime there's an update
of the vcl out, and I believe it would be a good idea to make a function that
returns these values
(GetVirtualTreeRect() perhaps?)

Or has this function already been implented?

Also, it seems that FRangeX and FRangeY is not updated when the tree calls
OnCollapsed/Expanded. Is that possible to change?

Cheers and happy new year!
Anders Thomsen

[Non-text portions of this message have been removed]

 | Replies | Author | Date
5117 | Re: How to get the virtual size of the tree | Mike Lischke | Thu 1/10/2002
5118 | Re: How to get the virtual size of the tree | Anders Thomsen | Thu 1/10/2002
5124 | Re: How to get the virtual size of the tree | Mike Lischke | Fri 1/11/2002


Documentation

From: "domenic_parisi" [domenic@g...]
Date: Wed Jan 9, 2002 3:15 am
Subject: Documentation

Hi,

Does anyone have an updated help file for Treeview version 2.6.5 or
2.7.5?

Thanks

Domenic

 | Replies | Author | Date
5094 | Re: Documentation | Helge Jung (ECO-Logic) | Wed 1/9/2002


re: Documentation

From: "Helge Jung \(ECO-Logic\)" [helge@e...]
Date: Wed Jan 9, 2002 6:13 am
Subject: Re: [VirtualTreeview] Documentation

> Does anyone have an updated help file for Treeview version 2.6.5 or
> 2.7.5?

AFAIK no. What do you want to know? As long as the help file isn't finished
I suggest asking your questions here ;-)

Helge.


IncrementalSearch (How To Use)

From: "jemke2000" [jemke2000@y...]
Date: Wed Jan 9, 2002 12:22 pm
Subject: IncrementalSearch (How To Use)

Hi

It is not clear for me how to use the IncrementalSearch event.
I will appreciate any example.

P.S. I would like to combine an TEdit field with the
IncrementalSearch event

Thanks in advance
Jean-Marie

 | Replies | Author | Date
5096 | Re: IncrementalSearch (How To Use) | Werner Lehmann | Wed 1/9/2002
5097 | Re: IncrementalSearch (How To Use) | hornungrainer | Wed 1/9/2002


re: IncrementalSearch (How To Use)

From: Werner Lehmann [wl@b...]
Date: Wed Jan 9, 2002 1:57 pm
Subject: Re: [VirtualTreeview] IncrementalSearch (How To Use)

jemke2000 wrote:
>
> It is not clear for me how to use the IncrementalSearch event.
> I will appreciate any example.
>
> P.S. I would like to combine an TEdit field with the
> IncrementalSearch event

The following comes from the online help. Text formatting is lost... If there
are
more questions, feel free to ask.

Regards,
Werner

"OnIncrementalSearch Event
Miscellanous event. Applies to TBaseVirtualTree

Declaration
TVTIncrementalSearchEvent = Procedure(Sender: TBaseVirtualTree; Node:
PVirtualNode; const Text: WideString; var Result: Integer) of object;

Description
This event is integral part of the incremental search functionality (see also
Keyboard, hotkeys and incremental search). It is triggered during search for a
node which matches the given string. Similar to other compare routines return a
value < 0 if the node's caption is considered as being before the given text, =
0 if it is the same and > 0 if it is considered being after the given text.

Note
Usually incremental search allows to match also partially. Hence it is
recommended to do comparation only up to the length of the shorter string.

Here is sample code taken from the Advanced demo.

procedure TfrmProperties.VST3IncrementalSearch(
Sender: TBaseVirtualTree; Node: PVirtualNode; const Text: WideString;
var Result: Integer);
var
S, PropText: string;
begin
// Note: This code requires a proper Unicode/WideString comparation routine
which I did not want to link here for
// size and clarity reasons. For now strings are (implicitely) converted to
ANSI to make the comparation work.
// Search is not case sensitive.
S := Text;
if Node.Parent = Sender.RootNode then
begin
// root nodes
if Node.Index = 0 then
PropText := 'Description'
else
PropText := 'Origin';
end
else
begin
PropText := PropertyTexts[Node.Parent.Index, Node.Index, ptkText];
end;

// By using StrLIComp we can specify a maximum length to compare. This allows
us to find also nodes
// which match only partially.
Result := StrLIComp(PChar(S), PChar(PropText), Min(Length(S),
Length(PropText)))
end;

--------------------------------------------------------------------------------
Copyright © 1999, 2001 Mike Lischke
http://www.lischke-online.de


re: IncrementalSearch (How To Use)

From: "hornungrainer" [HornungRainer@g...]
Date: Wed Jan 9, 2002 4:15 pm
Subject: Re: IncrementalSearch (How To Use)

--- In [VirtualTreeview@y...], "jemke2000" [jemke2000@y...] wrote:
> Hi
>
> It is not clear for me how to use the IncrementalSearch event.
> I will appreciate any example.
>
> P.S. I would like to combine an TEdit field with the
> IncrementalSearch event
>
> Thanks in advance
> Jean-Marie

Frist you need a new

type
TMyVirtualStringTree = class(TVirtualStringTree);

So you can use protected functions.

and then there is a search button and a edit box

procedure Tfrm_ELE_Vorgabe.SpeedButton1Click(Sender: TObject);
var
I: Integer;
Text: String;
begin
Text := edt_Suche.Text;
for I := 1 to Length(Text) do
TMyVirtualStringTree(VST).HandleIncrementalSearch(ord(Text[I]));
end;


VT as a grid - capabilites

From: marek jedlinski [eristic@l...]
Date: Wed Jan 9, 2002 5:49 pm
Subject: VT as a grid - capabilites

Hello all,

This is from someone who's not even a newbie, but a candidate for one. I
have used Mike Lischke's TTreeNT extensively, but I will want to switch
over to the VirtualTree for new versions of my applications.

This is for a (open-source) notebook program. Currently, I currently use
TreeNT for a list of items, whose text is editable in a TRichEdit (see URL
in the sig, or http://www.lodz.pdi.net/~eristic/free/knt_tree.gif for a
small screenshot)

In the new version which I'm now designing, I want to have two types of
notes: each tree node will point either to the RTF editor, or to a grid
(since trichedit is not suitable for storing tabular data, such as to-do
lists, etc.). I need to decide what control to use for the grid. It would
be great to use VirtualTree instead of a TStringGrid descendant, but can
the grid support the typical grid-like behavior? Specifically, when used as
a grid:

* Can VT multi-select an arbitrary, rectangular range of "cells" (e.g. from
"B2" to "C3")? The "advanced" demo project only allows vertical
multiselection, but multiselection cannot span columns. (This is really the
major point; if the answer to this is no, I won't be using VT for the
grid.)

* Can it use a TCheckbox as a custom in-place editor? (in the demo,
in-place editors all descend from TWinControl, so I expect it's possible)

* Can VT sort by column? (This could be implemented in the OnClick event
for the "column", but it seems that sorting would be very counter-intuitive
to program, due to the different layout data, tree vs grid)

* In the "advanced" demo, the cells which are used as column headers
respond to mouse clicks, but the "fixed column" cells (i.e. the tree items
drawn as a fixed column) do not. Is it possible to have both the "fixed
row" and "fixed column" respond to mouse clicks and provide visual feedback
of the click?

* Continuing with the above, would it be possible to draw sort indicators
(arrows) in the column headers, besides the text?

That's all I can think of right now, but there might be other gotchas I'm
missing. I realize that just about all will be possible, technically
speaking, but I'd like to know if the above features can be implemented in
VT "as is", without too much digging in VT's internal code (I'm not new to
Delphi, but I have little experience with custom drawing and I don't
necessarily crave such experience :)

Thanks a lot in advance for any hints or suggestions,
.marek jedlinski

--
/"\ ASCII Ribbon Campaign - Say NO to HTML in email
\ / Homepage, PGP Public Key: http://www.pdi.net/~eristic/
X No ads, no nags freeware: http://www.pdi.net/~eristic/free/
/ \
"So tell me, just how long have you had this feeling that no one
is watching you?" (Christopher Locke: Entropy Gradient Reversals)

 | Replies | Author | Date
5100 | Re: VT as a grid - capabilites | Werner Lehmann | Wed 1/9/2002


Happy new year...

From: "Mike Lischke" [lists@l...]
Date: Wed Jan 9, 2002 8:11 pm
Subject: Happy new year...

... to all of you. Finally, I'm back from my vacation and ready to fight the
everyday battle again.

I will first have a look on the newsgroups and will tomorrow start with
answering the emails in my inbox.

Have a nice day/night.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: VT as a grid - capabilites

From: Werner Lehmann [wl@b...]
Date: Wed Jan 9, 2002 8:54 pm
Subject: Re: [VirtualTreeview] VT as a grid - capabilites

Hi Marek,

> * Can VT multi-select an arbitrary, rectangular range of "cells" (e.g. from
> "B2" to "C3")? The "advanced" demo project only allows vertical
> multiselection, but multiselection cannot span columns. (This is really the
> major point; if the answer to this is no, I won't be using VT for the
> grid.)

The answer is no. :)

> * Can it use a TCheckbox as a custom in-place editor? (in the demo,
> in-place editors all descend from TWinControl, so I expect it's possible)

Correct, but you would have to implement the IVTEditLink interface to create
your own inplace editor.

> * Can VT sort by column? (This could be implemented in the OnClick event
> for the "column", but it seems that sorting would be very counter-intuitive
> to program, due to the different layout data, tree vs grid)

I don't understand this question. The tree can be sorted by column. How the
sort order turns out is up to your OnCompareNodes handler.

> * In the "advanced" demo, the cells which are used as column headers
> respond to mouse clicks, but the "fixed column" cells (i.e. the tree items
> drawn as a fixed column) do not. Is it possible to have both the "fixed
> row" and "fixed column" respond to mouse clicks and provide visual feedback
> of the click?

Of course you can respond to the click. If you want to draw the faked fixed
column differently in the clicked cell you must do it on your own, there is
a windows API function for it, forgot its name and cannot look it up now.

> * Continuing with the above, would it be possible to draw sort indicators
> (arrows) in the column headers, besides the text?

This is a feature of the column class.

Regards,
Werner


TCheckState of csCheckedGrayed

From: "Dion" [dion@n...]
Date: Thu Jan 10, 2002 6:18 pm
Subject: TCheckState of csCheckedGrayed

Hi,

How do I determine the following:-
1. if a node is in the csCheckedGrayed state in v 2.7.5?
2. GetFirstNode in v2.7.5

Thanks,
Dion.

 | Replies | Author | Date
5104 | Re: TCheckState of csCheckedGrayed | Helge Jung (ECO-Logic) | Thu 1/10/2002
5105 | Re: TCheckState of csCheckedGrayed | thegwimweaper | Thu 1/10/2002
5108 | Re: TCheckState of csCheckedGrayed | Dion | Thu 1/10/2002
5106 | Re: TCheckState of csCheckedGrayed | Werner Lehmann | Thu 1/10/2002
5107 | Re: TCheckState of csCheckedGrayed | thegwimweaper | Thu 1/10/2002


re: minor bug in 2.7.5

From: "Mike Lischke" [lists@l...]
Date: Thu Jan 10, 2002 10:16 am
Subject: RE: [VirtualTreeview] minor bug in 2.7.5

> If you have toGridExtensions enabled and a vst with no columns, then
> when creating the editor you get an "list out of bounds" error.
> Perhaps a small change in the IF statement of line 20373 can fix this
> quickly.

Thanks for letting me know. This is fixed now.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: Re: bug list

From: "Mike Lischke" [lists@l...]
Date: Thu Jan 10, 2002 10:18 am
Subject: RE: [VirtualTreeview] Re: bug list

Hi Ralf,

> if I change VST.NodeHeight[MainRoot]:=0 then everthing works ok! I'm
> not sure why I can use the (maybe) bug version
> PVirtualNode.NodeHeight too.

The point is, I have not obscured the internals of the nodes. So you can
directly access the field
members. However most changes in them require to either update other nodes, the
tree or both.
Therefore I have introduced access methods for all members to let this happen
automatically. So when
you assign a value directly to TVirtualNode.NodeHeight then you have to update
the tree etc.
manually.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: TCheckState of csCheckedGrayed

From: "Helge Jung \(ECO-Logic\)" [helge@e...]
Date: Thu Jan 10, 2002 12:40 pm
Subject: Re: [VirtualTreeview] TCheckState of csCheckedGrayed

> How do I determine the following:-
> 1. if a node is in the csCheckedGrayed state in v 2.7.5?
> 2. GetFirstNode in v2.7.5
>

I don't understand your question. There exist a CheckState property in the
node and IIRC there's also a function in the tree (use that one). And to get
the first node you've a GetFirstNode method... I don't see your problem.

Helge.

 | Replies | Author | Date
5105 | Re: TCheckState of csCheckedGrayed | thegwimweaper | Thu 1/10/2002
5108 | Re: TCheckState of csCheckedGrayed | Dion | Thu 1/10/2002


re: TCheckState of csCheckedGrayed

From: "thegwimweaper" [me@j...]
Date: Thu Jan 10, 2002 1:01 pm
Subject: Re: TCheckState of csCheckedGrayed

> How do I determine the following:-
> 1. if a node is in the csCheckedGrayed state in v 2.7.5?
> 2. GetFirstNode in v2.7.5
>

1. As Helge stated, the node has a CheckState field.
2. Older versions of VT had GetFirstNode(), newer versions just use
GetFirstChild(nil);

Hope this helps,

Gwim


re: Re: TCheckState of csCheckedGrayed

From: Werner Lehmann [wl@b...]
Date: Thu Jan 10, 2002 1:26 pm
Subject: Re: [VirtualTreeview] Re: TCheckState of csCheckedGrayed

thegwimweaper wrote:
>
> 2. Older versions of VT had GetFirstNode(), newer versions just use
> GetFirstChild(nil);

GetFirstNode has been superseded by GetFirst.

Werner

 | Replies | Author | Date
5107 | Re: TCheckState of csCheckedGrayed | thegwimweaper | Thu 1/10/2002


re: TCheckState of csCheckedGrayed

From: "thegwimweaper" [me@j...]
Date: Thu Jan 10, 2002 2:11 pm
Subject: Re: TCheckState of csCheckedGrayed

> GetFirstNode has been superseded by GetFirst.
>
> Werner

Lol, I hadn't even noticed GetFirst(). I just thought GetFirstChild
(nil) when I couldn't find GetFirstNode().

Thanks, Werner.


re: TCheckState of csCheckedGrayed

From: "Dion" [dion@n...]
Date: Fri Jan 11, 2002 12:41 am
Subject: RE: [VirtualTreeview] TCheckState of csCheckedGrayed

Hi,

Is there a csCheckedGrayed state in v 2.7.5? I couldn't find it in the
source. What I want to determine is if the user has selected certain nodes
in a subtree( the box is checked and the background is grayed).

Cheers,
Dion.

-----Original Message-----
From: Helge Jung (ECO-Logic) [mailto:[helge@e...]]
Sent: Thursday, January 10, 2002 4:40 AM
To: VirtualTreeview@yahoogroups.com
Subject: Re: [VirtualTreeview] TCheckState of csCheckedGrayed

> How do I determine the following:-
> 1. if a node is in the csCheckedGrayed state in v 2.7.5?
> 2. GetFirstNode in v2.7.5
>

I don't understand your question. There exist a CheckState property in the
node and IIRC there's also a function in the tree (use that one). And to get
the first node you've a GetFirstNode method... I don't see your problem.

Helge.

To unsubscribe from this group, send an email to:
VirtualTreeview-unsubscribe@egroups.com

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/


re: problem making treeoptions visible in derived VT

From: "Mike Lischke" [lists@l...]
Date: Thu Jan 10, 2002 2:36 pm
Subject: RE: [VirtualTreeview] problem making treeoptions visible in derived VT

Hi Frans,

> If somebody is interested in a VT derived tree which can display Mp3
> tag info, let me know, then I will publish my code. Some features are:
>
> threaded scanner
> search
> drag & drop to playlists
> tree based on directory structure/genre or artist

How far has this project come? Could I use it as demo project in the official
version? If yes, then
please send me a copy to my private eMail address ([public@l...]).

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


VirtualDBTreeEx - Using path

From: "arvur" [arvur@m...]
Date: Thu Jan 10, 2002 3:44 pm
Subject: VirtualDBTreeEx - Using path

As far as I understand table can be also Path-structured.
There Path is something like ID.ID.ID

So I have a simple table ("ID", "ParentID", "Name"). TreeView was
working fine.
Then I added calculated field "Path", set dboPathStructure in
DBOptions and set PathFieldName to "Path".
Oops...nothing! The tree is clear :(

What is wrong?
Please explain path-structure behavior more detailed.

Thanx

 | Replies | Author | Date
5143 | Re: VirtualDBTreeEx - Using path | Dion | Mon 1/14/2002
5144 | Re: VirtualDBTreeEx - Using path | arvur | Mon 1/14/2002


re: Re: Application triggert focus change

From: "Mike Lischke" [lists@l...]
Date: Thu Jan 10, 2002 7:54 pm
Subject: RE: [VirtualTreeview] Re: Application triggert focus change

Hi Dieter,

> Digging in the sources I found the reason for it: Neither DoFocusNode() nor
> SetFocusedNode() modify the selection. Selections need always to be modified
> explicitly in addition to modifying the focus. However, I would intuitively
> expect that changing the focus always triggers the selection. Would it not be
> better to synchronize it? Mike?

Focus and selection are two totally different things. I see the advantage in
some cases to also
select when the focus changes but in VT it is a bit different because you also
can have
multiselection (e.g. ctrl-click a node which is already selected).
Additionally, when doing this
automatically all the time then you prevent an application only to change the
focus without
modifications in the selection. And since it is only a one-liner to do the
selection when changing
the focus I'd say it is acceptable.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: MoveTo() and OnFocusChange

From: "Mike Lischke" [lists@l...]
Date: Thu Jan 10, 2002 7:55 pm
Subject: RE: [VirtualTreeview] MoveTo() and OnFocusChange

> I realized that when using the MoveTo() command on a focused node an
> OnFocusChange event is triggert (via InternalDisconnectNode() in MoveTo())
with
> a Node parameter nil. This behavior is somewhat awkward for my purpose,
since I
> use the OnFocusChange event to update another display showing details about
the
> focused data.

What about doing:

if Assigned(Node) then
begin
...
end;

?

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: TVTEdit: Does not accept changes when another control gets the focus

From: "Mike Lischke" [lists@l...]
Date: Thu Jan 10, 2002 8:04 pm
Subject: RE: [VirtualTreeview] TVTEdit: Does not accept changes when another control gets the focus

> In section "Editors and editing" the Virtual Tree help says: "The most
important
> action is when the edit looses the focus (e.g. because the user switched to
> another control or clicked the tree). In this case editing should stop. The
> default action in such a case is btw. to accept any changes." --

Oh, thanks for letting me know. This info is outdated since I found out that it
must indeed be
possible to take the focus from the editor (e.g. when you have a TDataTime
control or want to change
things in an external edit).

>However, the
> TVTEdit class does not behave in this way. It neither ends nor cancels
> editing. The effect is that if one, for example, puts a VirtualStringTree on
a
> modal form and clicks the OK-Button editing cancels silently. Well, a
> workaround is to call EndEditNode() in the OnExit event of the
> VitrualStringTree. But a more natural way would be to let TVTEdit itself
accept
> the changes by directly reacting on a CM_EXIT message by calling
> FLink.EndEdit().

OnExit/CM_EXIT/WM_KILLFOCUS are not good places for this. I guess it should be
something like a
message which indicates that the control is hiddden. However the question
appears then what to do in
this case (accept or cancel). Both cases might be possible so I tend to say it
is better to let the
application decide.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: Problem with empty columns when editing

From: "Mike Lischke" [lists@l...]
Date: Thu Jan 10, 2002 8:12 pm
Subject: RE: [VirtualTreeview] Problem with empty columns when editing

Hi Andrew,

>
> The HitColumn is used to put a value into FFocusedColumn and in this code,
> it finds my empty column, then back tracks to previous columns until it
> finds one that is not empty. Unfortunately, this makes it impossible to
> edit the column I clicked on to put any data into it.
>
> Does anyone have a solution for this (short of making sure the GetText
> event doesnt return an empty string) ?
>
> or is this a problem with the treeview engine ?

Indeed this is a core problem. It is a conflict between the autospan feature
and editing. Per
definition the empty column does virtually not exist for the particular node if
it is empty, so you
also cannot edit it (because you cannot focus this column and only focused
columns can be edited).
Of course this holds true only for mouse actions. In code you can still start
editing.

I have no idea how to solve this conflict and I doubt there is a solution if
you want to keep
autospanning. Imagine, a caption reaches over three columns. How would you make
it possible to
select this caption but at the same time allow to edit one of the empty columns?

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: Is forums.talkto.net OK?

From: "Mike Lischke" [lists@l...]
Date: Thu Jan 10, 2002 8:14 pm
Subject: RE: [VirtualTreeview] Is forums.talkto.net OK?

> Since the new year, I cannot connect to the newsgroup, it says
> "Cannot find server forums.talkto.net".
>
> Other news servers are OK, so I believe it's not my connection.

FYI, you were reported as bouncing emails recently. There might have been
another problem on your
side (provider etc.).

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: How to get the virtual size of the tree

From: "Mike Lischke" [lists@l...]
Date: Thu Jan 10, 2002 8:16 pm
Subject: RE: [VirtualTreeview] How to get the virtual size of the tree

Hi Anders,

> I'm looking for a function that returns the virtual size of the tree, similar
to
> GetTreeRect, but without specifying the tree canvas as a minimum.
> It should just return the FRangeX and FRangeY.

I'm not sure what the problem is. GetTreeRect does indeed return the true size
(with the minimum
being the client area). Why isn't it suitable for you?

> Also, it seems that FRangeX and FRangeY is not updated when the tree calls
> OnCollapsed/Expanded. Is that possible to change?

Oh, this would be a serious bug. I'm not aware of this problem, so where did
you see it?

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: How to get the virtual size of the tree

From: "Anders Thomsen" [anders@t...]
Date: Thu Jan 10, 2002 10:41 pm
Subject: Re: [VirtualTreeview] How to get the virtual size of the tree

>> Also, it seems that FRangeX and FRangeY is not updated when the tree
calls
>> OnCollapsed/Expanded. Is that possible to change?

>Oh, this would be a serious bug. I'm not aware of this problem, so where
did you see it?

I call GetTreeRect in the OnCollapsed/OnExpanded event, and the values in
the resulting Trect is not updated.

-Thomsen

 | Replies | Author | Date
5124 | Re: How to get the virtual size of the tree | Mike Lischke | Fri 1/11/2002


re: TVTEdit: Does not accept changes when another control gets the focus

From: Dieter Köhler [dieter.koehler@p...]
Date: Fri Jan 11, 2002 1:36 am
Subject: Re: [VirtualTreeview] TVTEdit: Does not accept changes when another control gets the focus

> OnExit/CM_EXIT/WM_KILLFOCUS are not good places for this. I guess it should
be something like a
> message which indicates that the control is hiddden. However the question
appears then what to do in
> this case (accept or cancel). Both cases might be possible so I tend to say
it is better to let the
> application decide.

I agree. However, I think it would be better to implement a default behavior
which can be changed by the application ('accept on exit'/'cancel on exit'
option or something similar), because neither an onAccept nor an onCancel event
is triggered at the moment. So currently the editor is by default just
vanishing without event, and I see no good reason why this should be so.

Dieter

--
=====================================================================
Dieter Köhler, M. A. - [dieter.koehler@p...]
Schiffgasse 4a, D-69117 Heidelberg, +49(0)6221-485995
"http://www.philo.de/Philosophie-Seiten/": 1000+ Philosophie-Links
"http://www.philo.de/VirtualLibrary/14.de.htm": Deutsche Philo-Links
"http://www.philo.de/xml/": Open XML - XML-Komponenten für Delphi
=====================================================================

 | Replies | Author | Date
5125 | Re: TVTEdit: Does not accept changes when another | Mike Lischke | Fri 1/11/2002


re: Re: Application triggert focus change

From: Dieter Köhler [dieter.koehler@p...]
Date: Fri Jan 11, 2002 12:20 am
Subject: Re: [VirtualTreeview] Re: Application triggert focus change

> Focus and selection are two totally different things. I see the advantage
> in some cases to also select when the focus changes but in VT it is a bit
> different because you also can have multiselection (e.g. ctrl-click a node
> which is already selected).

Multiselection should not be a problem, because when the application is changing
the focus, then the newly focused node is just added to the selections.

> Additionally, when doing this automatically all the time then you prevent
> an application only to change the focus without modifications in the
> selection.

Well, the problem is that the reverse is not true: The application cannot
prevent the modification of the selection when it wants to allow "automatic"
focus changes (at least not easily; one can check the selection state of the
node in the onFocusChanging event and if it was FALSE reset it in
onFocusChanged; but one needs a global variable to bookmark the value which is
anything but far from elegant). So if you are thinking of use cases were focus
and selection are really independent from each other, it is not desirable that
HandleMouseDown() triggers both without the application being able to
interfere. Therefore I would advocate the following solution: When the focus
changes the node is always selected (or added to the multiple selection
respectively) no matter whether the focus change was initiated by mouse click or
by the application itself. To give the application the opportunity to cancel
the selection an OnSelection event is introduced.

Dieter

--
=====================================================================
Dieter Köhler, M. A. - [dieter.koehler@p...]
Schiffgasse 4a, D-69117 Heidelberg, +49(0)6221-485995
"http://www.philo.de/Philosophie-Seiten/": 1000+ Philosophie-Links
"http://www.philo.de/VirtualLibrary/14.de.htm": Deutsche Philo-Links
"http://www.philo.de/xml/": Open XML - XML-Komponenten für Delphi
=====================================================================


re: MoveTo() and OnFocusChange

From: Dieter Köhler [dieter.koehler@p...]
Date: Fri Jan 11, 2002 1:15 am
Subject: Re: [VirtualTreeview] MoveTo() and OnFocusChange

> > I realized that when using the MoveTo() command on a focused node an
> > OnFocusChange event is triggert (via InternalDisconnectNode() in MoveTo())
with
> > a Node parameter nil. This behavior is somewhat awkward for my purpose,
since I
> > use the OnFocusChange event to update another display showing details about
the
> > focused data.
>
> What about doing:
>
> if Assigned(Node) then
> begin
> ...
> end;
>
> ?

This is what I am doing at the moment. The problem with this solution is, that
FocusedNode is set to nil by MoveTo() command. However, I need the moved node
remaining focused, because it is part of an interactive tree editor where the
editing commands apply on the focused node, e.g. repetately clicking an "up"
button to move the focused node up in the tree. Here is what the up action
does:

procedure TStructDispFrame.UpActionExecute(Sender: TObject);
var
tn,previous_tn: PVirtualNode;
begin
with VirtualStringTree1 do begin
BeginUpdate;
try
tn:= FocusedNode;
if assigned(tn) then begin
previous_tn:= tn.PrevSibling;
if assigned(previous_tn)
then MoveTo(tn,previous_tn,amInsertBefore,false);
end; {if ...}
FocusedNode:= tn; // [A]
ScrollIntoView(tn,false,false);
finally
EndUpdate;
end;
end; {with ...}
end;

Since the MoveTo command is setting FocusedNode to nil, I must refocus it in the
line marked [A]. A side effect of this is that an OnFocusChange event is
triggered which unnecessarily forces other controls to update (in fact this is a
cascade of TWebBrowser.navigate commands, which take a long time to carry out).
However, I need this OnFocusChange event to update the WebBrowsers when the user
deliberately changes the focused node by clicking on another node. The only
solution I found was to modify the above procedure to temporarily set the
OnFocusNode event itself to nil. Kind of a workaround, though ...

Dieter

--
=====================================================================
Dieter Köhler, M. A. - [dieter.koehler@p...]
Schiffgasse 4a, D-69117 Heidelberg, +49(0)6221-485995
"http://www.philo.de/Philosophie-Seiten/": 1000+ Philosophie-Links
"http://www.philo.de/VirtualLibrary/14.de.htm": Deutsche Philo-Links
"http://www.philo.de/xml/": Open XML - XML-Komponenten für Delphi
=====================================================================

 | Replies | Author | Date
5126 | Re: MoveTo() and OnFocusChange | Mike Lischke | Fri 1/11/2002


Selected/hit area after update of text

From: "njlo555" [njlo555@h...]
Date: Fri Jan 11, 2002 7:20 am
Subject: Selected/hit area after update of text

After updating some text in the treeview from code, the hit area (I
can click on with a mouse) is now expanded!

How can I make that happen or is it a bug?

 | Replies | Author | Date
5123 | Re: Selected/hit area after update of text | njlo555 | Fri 1/11/2002
5128 | Re: Selected/hit area after update of text | Mike Lischke | Fri 1/11/2002
5129 | Re: Selected/hit area after update of text | njlo555 | Fri 1/11/2002
5130 | Re: Selected/hit area after update of text (scree | njlo555 | Fri 1/11/2002
5140 | Re: Selected/hit area after update of text | Justin Stenning | Sun 1/13/2002


re: Selected/hit area after update of text

From: "njlo555" [njlo555@h...]
Date: Fri Jan 11, 2002 7:23 am
Subject: Re: Selected/hit area after update of text

--- In [VirtualTreeview@y...], "njlo555" [njlo555@h...] wrote:
> After updating some text in the treeview from code, the hit area (I
> can click on with a mouse) is now expanded!
I meant "NOT expanded!", sorry

>
> How can I make that happen or is it a bug?

Nikolaj

 | Replies | Author | Date
5128 | Re: Selected/hit area after update of text | Mike Lischke | Fri 1/11/2002
5129 | Re: Selected/hit area after update of text | njlo555 | Fri 1/11/2002
5130 | Re: Selected/hit area after update of text (scree | njlo555 | Fri 1/11/2002


re: How to get the virtual size of the tree

From: "Mike Lischke" [lists@l...]
Date: Fri Jan 11, 2002 9:31 am
Subject: RE: [VirtualTreeview] How to get the virtual size of the tree

> I call GetTreeRect in the OnCollapsed/OnExpanded event, and the values in
> the resulting Trect is not updated.

Well, the tree size update happens in the scroll bar update, which is done
after the event (simply
for efficiency reasons).

Ciao, Mike


re: TVTEdit: Does not accept changes when another control gets the focus

From: "Mike Lischke" [lists@l...]
Date: Fri Jan 11, 2002 10:09 am
Subject: RE: [VirtualTreeview] TVTEdit: Does not accept changes when another control gets the focus

> I agree. However, I think it would be better to implement a default behavior
> which can be changed by the application ('accept on exit'/'cancel on exit'
> option or something similar), because neither an onAccept nor an onCancel
event
> is triggered at the moment. So currently the editor is by default just
> vanishing without event, and I see no good reason why this should be so.

OK, I have included a new string option and now WM_DESTROY for the edit is
handled. By default any
change is now accepted. However no OnEdited event is triggered because nobody
can say when the
WM_DESTROY message arrives and which other conditions can be expected.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: MoveTo() and OnFocusChange

From: "Mike Lischke" [lists@l...]
Date: Fri Jan 11, 2002 10:22 am
Subject: RE: [VirtualTreeview] MoveTo() and OnFocusChange

> This is what I am doing at the moment. The problem with this solution is,
that
> FocusedNode is set to nil by MoveTo() command. However, I need the moved node
> remaining focused, because it is part of an interactive tree editor where the
> editing commands apply on the focused node, e.g. repetately clicking an "up"
> button to move the focused node up in the tree. Here is what the up action
> does:

Well, this is a scenario which did not come to my mind yet. Indeed, it is
perfectly acceptable that
an application wants to keep the focused node while moving it around in a tree.
So I changed
InternalDisconnectNode so that it can be directed to reset the currently
focused node or leave it
alone.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


OnInitChildren newbie

From: "Rony Cesana" [cesana@c...]
Date: Fri Jan 11, 2002 10:22 am
Subject: OnInitChildren newbie

hello everybody.
i'm a newbie (or, at least, a sort of), and would like to use the virtuality
of this component... so far, i've used it loading the whole tree at startup,
as if i used ttreeview.
now i'd like to load information about a node's children only when it's
expanded.
i guess i should use the oninitchildren event, though i don't know how to
start... how can it be invoked the first time? do i need to set
rootnodecount anyway?

sorry if all these questions sound silly, but i just need a small example :)

thank you,
rony.

 | Replies | Author | Date
5131 | Re: OnInitChildren newbie | Jim Kueneman | Fri 1/11/2002


re: Re: Selected/hit area after update of text

From: "Mike Lischke" [lists@l...]
Date: Fri Jan 11, 2002 10:27 am
Subject: RE: [VirtualTreeview] Re: Selected/hit area after update of text

> > After updating some text in the treeview from code, the hit area (I
> > can click on with a mouse) is now expanded!
> I meant "NOT expanded!", sorry

The width of a node's caption is cached, so if you change the caption you have
to invalidate the
node explicitly to tell the tree to update the width (see InvalidateNode).

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net

 | Replies | Author | Date
5129 | Re: Selected/hit area after update of text | njlo555 | Fri 1/11/2002
5130 | Re: Selected/hit area after update of text (scree | njlo555 | Fri 1/11/2002


re: Selected/hit area after update of text

From: "njlo555" [njlo555@h...]
Date: Fri Jan 11, 2002 10:55 am
Subject: Re: Selected/hit area after update of text

> > > can click on with a mouse) is now expanded!
> > I meant "NOT expanded!", sorry
> The width of a node's caption is cached, so if you change the
>caption you have to invalidate the node explicitly to tell the
>tree to update the width (see InvalidateNode).

Thanks for the very prompt answer, but InvalidateNode does not work
for me. The NodeText is not correctly drawn. Here is a snippet from
my code:

procedure frmForm1.txtTextChange(Sender: TObject);
var
Node : PVirtualNode;
NodeData : PTreeData;
begin
if VSTree.SelectedCount > 0 then
begin
Node:=VSTree.GetFirstSelected;
NodeData:=VSTree.GetNodeData(Node);
if txtText.Text <> NodeData.Text then
begin
NodeData.Text:=txtPgmname.Text;

// update caption and focused/clickable rectangle
// caption is updated - but not the focused/clickable rectangle
VSTree.InvalidateNode(Node);
end;
end;
end;

 | Replies | Author | Date
5130 | Re: Selected/hit area after update of text (scree | njlo555 | Fri 1/11/2002


re: Selected/hit area after update of text (screen shot)

From: "njlo555" [njlo555@h...]
Date: Fri Jan 11, 2002 11:09 am
Subject: Re: Selected/hit area after update of text (screen shot)

Screen shot: http://www.mikroklubben.adsl.dk/~nikse/vt.jpg

Editing a text with F2 does the same.


re: OnInitChildren newbie

From: Jim Kueneman [jimdk@m...]
Date: Fri Jan 11, 2002 2:01 pm
Subject: Re: [VirtualTreeview] OnInitChildren newbie

Hi,

>i guess i should use the oninitchildren event, though i don't know how to
>start... how can it be invoked the first time? do i need to set
>rootnodecount anyway?
>
>sorry if all these questions sound silly, but i just need a small example :)

A small example is though because it really depends on your data as to how
to go about this. Do a search on the Yahoo Groups on my name (Kueneman)
and OnIntChildren. There are a number of messages where I "tried" to
explain how to use OnIntNode and OnInitChildren.

To quickly recap. In its purest form you add a root node(s). When VT is
ready to know something about those nodes it calls OnInitNode. Here you
can set up your data (it may be necessary to set some up earlier, really
depends on your situation) and add the hasChildren flag. As the user
scrolls a new node is uncovered and VT needs the info from that node and
OnInitNode is called, and so on.

Now the user clicks the "+" sign. Again in purest form OnInitChildren
returns the number of children and VT expands that number of nodes, calling
OnInitNode for them. Note here it is totally up to you to have your data
understand its relationship to any other data in the tree so during an
expand you know how to handle the new node initialization using only the
nodes parent (and the previous data you stored in it) In the case of my
VET that is not possible because I don't know how many children there are
until I enumerate the directory/folder so in OnInitChildren I use AddChild
and set up the minimal amount of data in the node so when VT finally does
call InitNode I have a frame of reference using that bit of data to create
the rest of the infomation I will need.

As you can see there are many levels of the "virtualness" of VT and it
really depends on what you are trying to do and how the
data is retrieved/implemented.

HTH

Jim


DBCheckVirtualDBTreeEx

From: "jeff30161" [Jeff_Byrd@v...]
Date: Sat Jan 12, 2002 2:33 pm
Subject: DBCheckVirtualDBTreeEx

Can anyone tell me how to use the DBCheckVirtualDBTreeEx component? I
cannot seem to get it to work and I've tried all I know.

Thanks, Jeff

 | Replies | Author | Date
5147 | Re: DBCheckVirtualDBTreeEx | Dion | Mon 1/14/2002
5148 | Re: DBCheckVirtualDBTreeEx | Vandrovec Milan | Mon 1/14/2002
5162 | Workaround for DBCheckVirtualDBTreeEx | zai_xiong | Tue 1/15/2002


Drag&Drop with TDragObject

From: "gbehnke2000" [Behnke@h...]
Date: Sun Jan 13, 2002 12:33 pm
Subject: Drag&Drop with TDragObject

Hello All,

the following Problem:

CBUILDER 5

i use a Form in a DLL including a TVirtualStringTree. I need the Drag
& Drop
functionality for drag and drop from the DLL to the .EXE and
therefore i use a TDragObject like follows:

class TMyDragObject : public TDragObject
{

public:
Thread_IndexListView *ptrTextElements;
__fastcall TMyDragObject(void);
};

In the OnStartDrag Event i have the following Code:

void __fastcall Tform_SearchMask::virtualstringtree_ListViewStartDrag(
TObject *Sender, TDragObject *&DragObject)
{

tm = new TMyDragObject(); // Create my DragObject
tm->ptrTextElements = tdbindexlist_ListView.get(); // put the
necessary Address in my Object
DragObject = tm;

}

What happens is that i get the Error-Messages:
Invalid class typecast
when i move the cursor with the selectet item.

Any Ideas ?!

Best regards Gerhard Behnke

P.S with other controls like TEdit it works without any Problems !

 | Replies | Author | Date
5135 | Re: Drag&Drop with TDragObject | Jim Kueneman | Sun 1/13/2002
5136 | Re: Drag&Drop with TDragObject | gbehnke2000 | Sun 1/13/2002
5137 | Re: Drag&Drop with TDragObject | Mike Lischke | Sun 1/13/2002


Version 3.0

From: "Mike Lischke" [lists@l...]
Date: Sun Jan 13, 2002 1:43 pm
Subject: Version 3.0

Hi all,

finally it is done. I have just uploaded the new official version of Virtual
Treeview together most with most of the demos and additions which where in the
file area of the mailing list. In this process I updated my two domains
entirely. This time I even managed to get Netscape and Opera working with the
HTML code (was though, really though, I must say).

Please try the new site/files and tell me if you find errors, omission etc.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net

 | Replies | Author | Date
5138 | Re: Version 3.0 | wvd_vegt | Sun 1/13/2002
5139 | Re: Version 3.0 | briggsoft | Sun 1/13/2002
5191 | Re: Version 3.0 | Mike Lischke | Sat 1/19/2002
5193 | Re: Version 3.0 | briggsoft | Sat 1/19/2002
5163 | Re: Version 3.0 | gregkza | Tue 1/15/2002
5197 | Re: Version 3.0 | Mike Lischke | Sun 1/20/2002


re: Drag&Drop with TDragObject

From: Jim Kueneman [jimdk@m...]
Date: Sun Jan 13, 2002 2:30 pm
Subject: Re: [VirtualTreeview] Drag&Drop with TDragObject

Hi Gerhard,

>What happens is that i get the Error-Messages:
> Invalid class typecast
>when i move the cursor with the selectet item.
>
>Any Ideas ?!

Derive your custom drag object from TDragDockObject. I think Mike is
fixing this in, well version 3.0 by the look of the other post!

Jim

 | Replies | Author | Date
5136 | Re: Drag&Drop with TDragObject | gbehnke2000 | Sun 1/13/2002
5137 | Re: Drag&Drop with TDragObject | Mike Lischke | Sun 1/13/2002


re: Drag&Drop with TDragObject

From: "gbehnke2000" [Behnke@h...]
Date: Sun Jan 13, 2002 4:13 pm
Subject: Re: Drag&Drop with TDragObject

Hello Jim,

many thank's for your hint. But as you can see Mike has uploaded the
version 3.0 and first i'll try to do this with this new version.
At this point i like to say many thanks to Mike for this powerfull
component

Best regards
Gerhard
--- In [VirtualTreeview@y...], Jim Kueneman [jimdk@m...] wrote:
>
> Hi Gerhard,
>
> >What happens is that i get the Error-Messages:
> > Invalid class typecast
> >when i move the cursor with the selectet item.
> >
> >Any Ideas ?!
>
> Derive your custom drag object from TDragDockObject. I think Mike
is
> fixing this in, well version 3.0 by the look of the other post!
>
>
> Jim

 | Replies | Author | Date
5137 | Re: Drag&Drop with TDragObject | Mike Lischke | Sun 1/13/2002


re: Re: Drag&Drop with TDragObject

From: "Mike Lischke" [lists@l...]
Date: Sun Jan 13, 2002 4:21 pm
Subject: RE: [VirtualTreeview] Re: Drag&Drop with TDragObject

> At this point i like to say many thanks to Mike for this powerfull
> component

It's my pleasure :-) Please let me know if we still have to fix something.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: Version 3.0

From: "wvd_vegt" [wvd_vegt@k...]
Date: Sun Jan 13, 2002 5:09 pm
Subject: Re: Version 3.0

Hi,

Congrats Mike!, a very nice piece of work. I've already downloaded
3.0 and i'll be testing it later this week.

I'm confident that you (and all others helping) killed the vast
majority of the bugs in the past period. Even the helpfile seems
right this time (according to it's size there's load of info in it
this time).

So again thanks to you all.

----------
Wim van der Vegt


re: Version 3.0

From: "briggsoft" [kbriggs@b...]
Date: Sun Jan 13, 2002 10:25 pm
Subject: Re: Version 3.0

--- In [VirtualTreeview@y...], "Mike Lischke" [lists@l...] wrote:
> Hi all,
>
> Please try the new site/files and tell me if you find errors,
omission etc.

Mike,

I just migrated from version 2.5.21 to 3.04 and came across an
"Invalid property value" error and traced it to the coAllowClick
option in header.columns.options. If you try and set this value to
false for any column in the tree, it crashes.

 | Replies | Author | Date
5191 | Re: Version 3.0 | Mike Lischke | Sat 1/19/2002
5193 | Re: Version 3.0 | briggsoft | Sat 1/19/2002


re: Re: Selected/hit area after update of text

From: "Justin Stenning" [jstenning@e...]
Date: Sun Jan 13, 2002 10:43 pm
Subject: Re: [VirtualTreeview] Re: Selected/hit area after update of text

--- In [VirtualTreeview@y...], "njlo555" [njlo555@h...] wrote:
>> After updating some text in the treeview from code, the hit area (I
>> can click on with a mouse) is now expanded!
>I meant "NOT expanded!", sorry

>>
>> How can I make that happen or is it a bug?

I had a similar problem where I was setting the text to bold. Eventually I
found that in the VST code there is code that determines the size of the
drawing area (of course - what I mean is I found where it was occuring ;-),
I found that within this event you can change the text canvas and still end
up with the correct draw size. Hope this helps.

procedure TfrmPnlExpTypeGeneric.vsTreePaintText(Sender: TBaseVirtualTree;
const Canvas: TCanvas; Node: PVirtualNode; Column: Integer;
TextType: TVSTTextType);
var
data: PTypeGenNode;
begin
data := vsTree.GetNodeData(node);

if data.Green then
begin
Canvas.Font.Color := clGreen;
end;

if data.Checked then
Canvas.Font.Style := [fsBold];
end;

Justin


Change node height

From: "briggsoft" [kbriggs@b...]
Date: Sun Jan 13, 2002 10:47 pm
Subject: Change node height

I need to be able to change the node heights of a populated tree
without reloading the node data. I know that defaultnodeheight only
applies to new nodes so I run a loop through the whole tree changing
each individual node height. That works but now the painting and node
selection is all out of whack. I see partial lines and clicking one
node causes another one near by to get selected, etc. What do I need
to do to get the tree display back in sync?

Kent Briggs

 | Replies | Author | Date
5142 | Re: Change node height | Jim Kueneman | Mon 1/14/2002
5149 | Re: Change node height | briggsoft | Mon 1/14/2002
5154 | Re: Change node height | Jim Kueneman | Mon 1/14/2002


re: Change node height

From: Jim Kueneman [jimdk@m...]
Date: Mon Jan 14, 2002 12:15 am
Subject: Re: [VirtualTreeview] Change node height

Hi,

>I need to be able to change the node heights of a populated tree
>without reloading the node data. I know that defaultnodeheight only
>applies to new nodes so I run a loop through the whole tree changing
>each individual node height. That works but now the painting and node
>selection is all out of whack. I see partial lines and clicking one
>node causes another one near by to get selected, etc. What do I need
>to do to get the tree display back in sync?

Just a WAG, call InvalidateNode after each change or use

property NodeHeight[Node: PVirtualNode]: Cardinal

So VT knows what you did.

Jim

 | Replies | Author | Date
5149 | Re: Change node height | briggsoft | Mon 1/14/2002
5154 | Re: Change node height | Jim Kueneman | Mon 1/14/2002


re: VirtualDBTreeEx - Using path

From: "Dion" [dion@n...]
Date: Sun Jan 13, 2002 3:25 pm
Subject: RE: [VirtualTreeview] VirtualDBTreeEx - Using path

Hi Arvur,

Where did you get VirtualDBTreeEx from?

Ragards,
Dion.

-----Original Message-----
From: arvur [mailto:[arvur@m...]]
Sent: Thursday, January 10, 2002 7:45 AM
To: VirtualTreeview@yahoogroups.com
Subject: [VirtualTreeview] VirtualDBTreeEx - Using path

As far as I understand table can be also Path-structured.
There Path is something like ID.ID.ID

So I have a simple table ("ID", "ParentID", "Name"). TreeView was
working fine.
Then I added calculated field "Path", set dboPathStructure in
DBOptions and set PathFieldName to "Path".
Oops...nothing! The tree is clear :(

What is wrong?
Please explain path-structure behavior more detailed.

Thanx

To unsubscribe from this group, send an email to:
VirtualTreeview-unsubscribe@egroups.com

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/

 | Replies | Author | Date
5144 | Re: VirtualDBTreeEx - Using path | arvur | Mon 1/14/2002


re: VirtualDBTreeEx - Using path

From: "arvur" [arvur@m...]
Date: Mon Jan 14, 2002 11:39 am
Subject: Re: VirtualDBTreeEx - Using path

http://groups.yahoo.com/group/VirtualTreeview/files/Descendants/Virtua
lDBTreeEx.zip

--- In [VirtualTreeview@y...], "Dion" [dion@n...] wrote:
> Hi Arvur,
>
> Where did you get VirtualDBTreeEx from?
>
> Ragards,
> Dion.
>
>
> -----Original Message-----
> From: arvur [mailto:[arvur@m...]]
> Sent: Thursday, January 10, 2002 7:45 AM
> To: [VirtualTreeview@y...]
> Subject: [VirtualTreeview] VirtualDBTreeEx - Using path
>
>
> As far as I understand table can be also Path-structured.
> There Path is something like ID.ID.ID
>
> So I have a simple table ("ID", "ParentID", "Name"). TreeView was
> working fine.
> Then I added calculated field "Path", set dboPathStructure in
> DBOptions and set PathFieldName to "Path".
> Oops...nothing! The tree is clear :(
>
> What is wrong?
> Please explain path-structure behavior more detailed.
>
> Thanx
>
>
>
> To unsubscribe from this group, send an email to:
> [VirtualTreeview-unsubscribe@e...]
>
>
>
> Your use of Yahoo! Groups is subject to
http://docs.yahoo.com/info/terms/


Bug on compile VirtualTreeView 3.0

From: Ven ven [vasut_v_y@y...]
Date: Mon Jan 14, 2002 12:13 pm
Subject: Bug on compile VirtualTreeView 3.0

Hello All !!!

I'm downloading newest version of VirtualTreeView from
Mike's site (www.lischke-online.de)
When I try to compile and install new pakages Delphi
show this:

[Error] VirtualTrees.pas(20414): Undeclared
identifier: 'MakeObjectInstance'
[Error] VirtualTrees.pas(20414): Not enough actual
parameters
+-- This line raise Error
|
--> SetWindowLong(FPanningWindow, GWL_WNDPROC,
Integer(Classes.MakeObjectInstance(PanningWindowProc)));

[Error] VirtualTrees.pas(20444): Undeclared
identifier: 'FreeObjectInstance'
+-- This line raise Error
|
--> if Instance <> @DefWindowProc then
--> Classes.FreeObjectInstance(Instance);

[Fatal Error] VirtualTreesD5.dpk(35): Could not
compile used unit 'VirtualTrees.pas'

Before installing I remove all old files (bpl,pas,dcu
etc.)
I'm using Delphi5+Update Pack1

__________________________________________________
Do You Yahoo!?
Send FREE video emails in Yahoo! Mail!
http://promo.yahoo.com/videomail/

 | Replies | Author | Date
5156 | Re: Bug on compile VirtualTreeView 3.0 | Jim Kueneman | Mon 1/14/2002


NotImageList images

From: "Andrew P.Rybin" [magicode@m...]
Date: Mon Jan 14, 2002 12:57 pm
Subject: NotImageList images

Hello!
VT Version: 3

I have a problem. Every node in my TVirtualStringTree (StringTree is best
for my task) has custom dynamically changing "Icon".
PMyData = ^packed record
Icon: TBitmap; //I use Icon.Canvas for frequent painting
end;
TImageList absolutely does not approach because of large icon's number
(every node has own image) and their constant renovation.

How can i EASY draw "Icon: TBitmap" instead of "Images: TImageList"?

PS:
TCustomVirtualDrawTree has useful event:
property OnDrawNode: TVTDrawNodeEvent read FOnDrawNode write
FOnDrawNode;

PaintInfo: TVTPaintInfo contain all necessary information for paint.
May be add this event to TVirtualStringTree too?

=====
Thank for patience!
Best regards,
Andrew P.Rybin

 | Replies | Author | Date
5192 | Re: NotImageList images | Mike Lischke | Sat 1/19/2002
5198 | Re: NotImageList images | Andrew P.Rybin | Mon 1/21/2002


re: DBCheckVirtualDBTreeEx

From: "Dion" [dion@n...]
Date: Mon Jan 14, 2002 11:17 pm
Subject: RE: [VirtualTreeview] DBCheckVirtualDBTreeEx

Hi,

Where can one get this component?

Regards,
Dion.

-----Original Message-----
From: jeff30161 [mailto:[Jeff_Byrd@v...]]
Sent: Saturday, January 12, 2002 6:33 AM
To: VirtualTreeview@yahoogroups.com
Subject: [VirtualTreeview] DBCheckVirtualDBTreeEx

Can anyone tell me how to use the DBCheckVirtualDBTreeEx component? I
cannot seem to get it to work and I've tried all I know.

Thanks, Jeff

To unsubscribe from this group, send an email to:
VirtualTreeview-unsubscribe@egroups.com

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/


re: DBCheckVirtualDBTreeEx

From: Vandrovec Milan [milan_va@s...]
Date: Mon Jan 14, 2002 1:38 pm
Subject: RE: [VirtualTreeview] DBCheckVirtualDBTreeEx

Hi,

> > Can anyone tell me how to use the DBCheckVirtualDBTreeEx component? I
> > cannot seem to get it to work and I've tried all I know.
> >
>
> Where can one get this component?
>

1. Original is at
http://groups.yahoo.com/group/VirtualTreeview/files/Descendants/VirtualDBTre
eEx.zip

2. Version compatible with BCB (Delphi 5 and Delphi6 included as well) are
at
http://groups.yahoo.com/group/VirtualTreeview/files/Examples/BCB_Examples/Co
mpatibility/VT_Addons_3_0_4.zip

Milan Vandrovec


re: Change node height

From: "briggsoft" [kbriggs@b...]
Date: Mon Jan 14, 2002 6:39 pm
Subject: Re: Change node height

--- In [VirtualTreeview@y...], Jim Kueneman [jimdk@m...] wrote:
>
> Just a WAG, call InvalidateNode after each change or use
>
> property NodeHeight[Node: PVirtualNode]: Cardinal
>
> So VT knows what you did.

Bingo, that's it. I was using node.nodeheight:=h. Changing that to
nodeheight[node]:=h fixed the problem. Thanks.

Kent Briggs

 | Replies | Author | Date
5154 | Re: Change node height | Jim Kueneman | Mon 1/14/2002


VT 3.0.4 Bug: Node collapse does not update tree ...

From: Ralf Junker [ralfjunker@g...]
Date: Mon Jan 14, 2002 11:53 am
Subject: VT 3.0.4 Bug: Node collapse does not update tree ...

Hi Mike,

there is a condition where collapsing a node does not update the tree: To save
resources, I am deleting a node's children if the node is collapsed. This
worked just fine until 3.0.4.

Here is the code:

procedure TfrmMain.TreeViewCollapsed(Sender: TBaseVirtualTree; Node:
PVirtualNode);
begin
Sender.DeleteChildren(Node);
end;

I guess this is somewhere related to the new vsClearing node state.

If I do not Sender.DeleteChildren(Node), everything works just fine.

Regards,

Ralf

PS: Are you interested in a VT-demo (Addressbook application), including
source, which has multiple node types, all completely virtual, limited Drag &
Drop, and does a little owner drawing to the node's background?

PPS: Do you prefer postings to this list or to the newsgroup?

 | Replies | Author | Date
5196 | Re: VT 3.0.4 Bug: Node collapse does not update t | Mike Lischke | Sun 1/20/2002


coAllowClick

From: "briggsoft" [kbriggs@b...]
Date: Mon Jan 14, 2002 8:33 pm
Subject: coAllowClick

I mentioned this problem in the Version 3.0 thread but while I'm
waiting for a response from Mike, I wonder if anyone can reproduce it
themselves:

In a new app, drop a virtual tree on the main form. In the Object
Inspector, go into header and add a column (name it "Test"). In the
options for that column, set coAllowClick to false. Now run the app.
Do you get the "Invalid property value" error message? I'm running
Delphi 5.

Kent Briggs

 | Replies | Author | Date
5153 | Re: coAllowClick | luceerad | Mon 1/14/2002
5160 | Re: coAllowClick | Jim Kueneman | Mon 1/14/2002
5164 | Re: coAllowClick | briggsoft | Tue 1/15/2002


InitChildren

From: "thegwimweaper" [me@j...]
Date: Mon Jan 14, 2002 8:55 pm
Subject: InitChildren

Hi, Mike,

I need to set a node as having children even if it doesn't because my
application retrieves nodes using a nested set model. I know the
node has children, they just aren't returned from the db yet. I like
to retrieve them on the 'OnExpanding' event which I can only cause if
the node has children.

Any chance of making InitChildren virtual so I can override?

Cheers,

Jerry Griffiths

 | Replies | Author | Date
5155 | Re: InitChildren | Jim Kueneman | Mon 1/14/2002
5157 | Re: InitChildren | thegwimweaper | Mon 1/14/2002


re: coAllowClick

From: "luceerad" [ljee@s...]
Date: Mon Jan 14, 2002 9:42 pm
Subject: Re: coAllowClick

D4 and D6 ... no, no problem at all.
Version 3.0.3, though.

Lucian


re: Re: Change node height

From: Jim Kueneman [jimdk@m...]
Date: Mon Jan 14, 2002 10:57 pm
Subject: Re: [VirtualTreeview] Re: Change node height

>Bingo, that's it. I was using node.nodeheight:=h. Changing that to
>nodeheight[node]:=h fixed the problem. Thanks.

Rule of Thumb, if you find yourself changing the Nodes record directly
rethink it and look for a property. The only "safe" place to do it is in
the OnInitNode event.

Jim


re: InitChildren

From: Jim Kueneman [jimdk@m...]
Date: Mon Jan 14, 2002 11:02 pm
Subject: Re: [VirtualTreeview] InitChildren

Jerry,

At 08:55 PM 1/14/2002 +0000, you wrote:
>Hi, Mike,
>
>I need to set a node as having children even if it doesn't because my
>application retrieves nodes using a nested set model. I know the
>node has children, they just aren't returned from the db yet. I like
>to retrieve them on the 'OnExpanding' event which I can only cause if
>the node has children.
>
>Any chance of making InitChildren virtual so I can override?

Set the ivsHasChildren of the InitStates flag in the OnInitNode event (or
DoInitNode if a decentant) if you know (or think it may) the node has
children. Then in OnInitChildren (or DoInitChildren) return the number of
children which in turn will fire OnInitNode for the new children. You may
also actually add the children in the OnInitChildren handler too.

Jim

 | Replies | Author | Date
5157 | Re: InitChildren | thegwimweaper | Mon 1/14/2002


re: Bug on compile VirtualTreeView 3.0

From: Jim Kueneman [jimdk@m...]
Date: Mon Jan 14, 2002 11:05 pm
Subject: Re: [VirtualTreeview] Bug on compile VirtualTreeView 3.0

>[Error] VirtualTrees.pas(20414): Undeclared
>identifier: 'MakeObjectInstance'
>[Error] VirtualTrees.pas(20414): Not enough actual
>parameters
> +-- This line raise Error

Down load it again, D5 this is in Forms not Classes. Mike fixed it in
3.0.4 (maybe in 3.03).

Jim


re: InitChildren

From: "thegwimweaper" [me@j...]
Date: Mon Jan 14, 2002 11:23 pm
Subject: Re: InitChildren

Thanks, Jim.

I hadn't noticed that 'count' was a var in DoInitChildren.

Cheers.

Jerry.

--- In [VirtualTreeview@y...], Jim Kueneman [jimdk@m...] wrote:
> Set the ivsHasChildren of the InitStates flag in the OnInitNode
event (or
> DoInitNode if a decentant) if you know (or think it may) the node
has
> children. Then in OnInitChildren (or DoInitChildren) return the
number of
> children which in turn will fire OnInitNode for the new children.
You may
> also actually add the children in the OnInitChildren handler too.
>
> Jim


Fwd: VirtualShellTools_0.9.0.2 > To Bill Miller

From: Jim Kueneman [jimdk@m...]
Date: Mon Jan 14, 2002 11:30 pm
Subject: Fwd: VirtualShellTools_0.9.0.2 > To Bill Miller

Hi Bill,

Your email address bounces so

>I am new to this group. I just downloaded VirtualShellTools and
>tried to install it in WinXP and Delphi 6 (Patched). It will not
>install. Are there other components that are needed to install? I
>have Mikes latest verion of the VirtualTreeList Version 4 installed.

Latest version is 3.0.4 and what is the exact problem?

>Bill Miller
>Adirondack Software & Graphics

^^^ Where abouts? I spent many a winter vacation as a kid
snowmobiling Old Forge with my folks.

 | Replies | Author | Date
5159 | Fwd: VirtualShellTools_0.9.0.2 > To Bill Miller | Jim Kueneman | Mon 1/14/2002


Fwd: VirtualShellTools_0.9.0.2 > To Bill Miller

From: Jim Kueneman [jimdk@m...]
Date: Mon Jan 14, 2002 11:40 pm
Subject: Fwd: VirtualShellTools_0.9.0.2 > To Bill Miller

>Hi Bill,
>
>Your email address bounces so

Crap wrong group, I apologize

Jim


re: coAllowClick

From: Jim Kueneman [jimdk@m...]
Date: Tue Jan 15, 2002 12:04 am
Subject: Re: [VirtualTreeview] coAllowClick

>In a new app, drop a virtual tree on the main form. In the Object
>Inspector, go into header and add a column (name it "Test"). In the
>options for that column, set coAllowClick to false. Now run the app.
>Do you get the "Invalid property value" error message? I'm running
>Delphi 5.

Ok for me, D5 sp1 Win2k VT 3.0.4 Is this an old project? This usually
happens when you change a components code (Like delete a property) but the
DFM file still has a reference to that property. Which is wierd since Mike
is not using Default on that apparently and all the options are saved in
the DFM. You are *removing* the coAllowClick. Strange. Are you sure you
have any old DCU's removed or the path to old versions of VT removed from
the path?

Jim

 | Replies | Author | Date
5164 | Re: coAllowClick | briggsoft | Tue 1/15/2002


New file uploaded to VirtualTreeview

From: VirtualTreeview@yahoogroups.com
Date: Tue Jan 15, 2002 8:11 am
Subject: New file uploaded to VirtualTreeview

Hello,

This email message is a notification to let you know that
a file has been uploaded to the Files area of the VirtualTreeview
group.

File : /Descendants/DBCheckVirtualDBTreeEx_Demo.zip
Uploaded by : zai_xiong [csphua@t...]
Description : A simple example of DBCheckVirtualDBTreeEx in C++ Builder.
There is a bug in DBCheckVirtualDBTreeEx which prevented design time creation
to work. Thus, this example uses run time creation method as workaround to this
bug. Currently, if the result table is not active when assigning
ResultFieldName, the tree will not be built. Thus, result table must be opened
before creation of DBCheckVirtualDBTreeEx.

You can access this file at the URL

http://groups.yahoo.com/group/VirtualTreeview/files/Descendants/DBCheckVirtualDB\
TreeEx_Demo.zip

To learn more about file sharing for your group, please visit

http://help.yahoo.com/help/us/groups/files

Regards,

zai_xiong [csphua@t...]


Workaround for DBCheckVirtualDBTreeEx

From: "zai_xiong" [csphua@t...]
Date: Tue Jan 15, 2002 8:31 am
Subject: Workaround for DBCheckVirtualDBTreeEx

Hi, after spending one whole day of working hours checking out how
to use DBCheckVirtualDBTreeEx, I finally found the way to make it
work.

Briefly, DBCheckVirtualDBTreeEx is a component which show a check
virtual tree, getting its data from a dataset. It will save the
checking state of nodes to a second dataset (assigned via a
TDataSource component in CheckDataSource). This is useful to
preserve the check state of your CheckVirtualDBTreeEx. The second
dataset (or Result Table) need to have at least one type Double
field. You will have to assign the fieldname of this type Double
field to property ResultFieldName.

The problem is due to a checking in the following lines:-

If FCheckDataLink.Active Then Begin
If FResultFieldName <> '' Then FResultField :=
FCheckDataLink.DataSet.FieldByName(FResultFieldName);
End;

Somehow the FCheckDataLink is false when assigning ResultFieldName,
which prevented the internal TField FResultField to be assigned.

Thus, the DBCheckVirtualDBTreeEx does not show a tree because it
still waiting for a result field to be assigned.

The workaround is to open the result table first, before manual
creation of DBCheckVirtualDBTreeEx. I'd posted an example in C++
Builder at
http://groups.yahoo.com/group/VirtualTreeview/files/Descendants/DBChe
ckVirtualDBTreeEx_Demo.zip

Check it out. That's all I can do to help for now. Can anybody help
me to solve this bug?


re: Version 3.0

From: "gregkza" [gregkza@y...]
Date: Tue Jan 15, 2002 9:03 am
Subject: Re: Version 3.0

--- In [VirtualTreeview@y...], "Mike Lischke" [lists@l...] wrote:
> Hi all,
>
> finally it is done. I have just uploaded the new official version
of Virtual Treeview together most with most of the demos and
additions which where in the file area of the mailing list. In this
process I updated my two domains entirely. This time I even managed
to get Netscape and Opera working with the HTML code (was though,
really though, I must say).
>
> Please try the new site/files and tell me if you find errors,
omission etc.

Any chance of updating the online version history?
(http://www.lischke-online.de/VirtualTreeview/VTHistory.html)

Btw, fantastic component :)

Thanks

Greg

 | Replies | Author | Date
5197 | Re: Version 3.0 | Mike Lischke | Sun 1/20/2002


re: coAllowClick

From: "briggsoft" [kbriggs@b...]
Date: Tue Jan 15, 2002 3:24 pm
Subject: Re: coAllowClick

--- In [VirtualTreeview@y...], Jim Kueneman [jimdk@m...] wrote:
>
> Ok for me, D5 sp1 Win2k VT 3.0.4 Is this an old project? This
usually
> happens when you change a components code (Like delete a property)
but the
> DFM file still has a reference to that property. Which is wierd
since Mike
> is not using Default on that apparently and all the options are
saved in
> the DFM. You are *removing* the coAllowClick. Strange. Are you
sure you
> have any old DCU's removed or the path to old versions of VT removed
from
> the path?

Ok, I got it working now. Initially I installed 3.04 by just opening
up the .dpk file and compiling it. I've since gone back and did a
Component/Install Component and compiled the VTReg.pas file and the
problem went away.

Kent Briggs


Autospancolumns and RightJustify

From: "lehma2401" [mlehmann@w...]
Date: Tue Jan 15, 2002 9:13 pm
Subject: Autospancolumns and RightJustify

Hi group,

IMHO the AutoSpanColumn property (if set to TRUE) should be ignored
when drawing the cell for columns whose content is right aligned or
centered. Let me give an example: VT has a column with right-aligned
floating point numbers (for example: order total) and to the right of
that column is another one which is occasionally empty (example:
shipping date) and left-aligned. If AutoSpanColumns is set to TRUE,
rows with no empty shipping date will display the order total IN THAT
COLUMN, not in the order total column.

Thanks

MARTIN

P.S. this is based on VT 2.7.x, so please ignore this post in case
it's now fixed.

P.P.S. I put this in feature request also, but got left and right
wrong.....

 | Replies | Author | Date
5166 | Re: Autospancolumns and RightJustify | Werner Lehmann | Tue 1/15/2002
5244 | Re: Autospancolumns and RightJustify | Mike Lischke | Sun 1/27/2002
5245 | Re: Autospancolumns and RightJustify | Werner Lehmann | Sun 1/27/2002


re: Autospancolumns and RightJustify

From: Werner Lehmann [wl@b...]
Date: Tue Jan 15, 2002 10:38 pm
Subject: Re: [VirtualTreeview] Autospancolumns and RightJustify

Hi Martin,

> IMHO the AutoSpanColumn property (if set to TRUE) should be ignored
> when drawing the cell for columns whose content is right aligned or
> centered. Let me give an example: VT has a column with right-aligned
> floating point numbers (for example: order total) and to the right of
> that column is another one which is occasionally empty (example:
> shipping date) and left-aligned. If AutoSpanColumns is set to TRUE,
> rows with no empty shipping date will display the order total IN THAT
> COLUMN, not in the order total column.

IMO the right behaviour should be that for left aligned columns the
spanning should look to the right for empty columns (as it is now) and
for right aligned columns the spanning should go to the left.

I have not checked / verified the current state in this respect. Mike?

Regards,
Werner

 | Replies | Author | Date
5244 | Re: Autospancolumns and RightJustify | Mike Lischke | Sun 1/27/2002


No screenupdate after calling deleteNode method?

From: "spiriller" [cas@c...]
Date: Wed Jan 16, 2002 2:31 am
Subject: No screenupdate after calling deleteNode method?

Hello

After upgrading to v3.0, my VT does not get updated automatically
after calling the deleteNode method. Earlier versions of VT did
delete the deleted node visually by itself when the method was
called. Is that on purpose or?

- Simon

 | Replies | Author | Date
5246 | Re: No screenupdate after calling deleteNode meth | Mike Lischke | Sun 1/27/2002


re: No screenupdate after calling deleteNode me thod?

From: GIANNAKOPOULOS KOSTAS [kyan@s...]
Date: Wed Jan 16, 2002 9:08 am
Subject: RE: [VirtualTreeview] No screenupdate after calling deleteNode me thod?

I confirm this. I've already added it to the buglist.

> -----Original Message-----
> From: spiriller [mailto:[cas@c...]]
> Sent: Wednesday, January 16, 2002 4:32 AM
> To: VirtualTreeview@yahoogroups.com
> Subject: [VirtualTreeview] No screenupdate after calling deleteNode
> method?
>
>
> Hello
>
> After upgrading to v3.0, my VT does not get updated automatically
> after calling the deleteNode method. Earlier versions of VT did
> delete the deleted node visually by itself when the method was
> called. Is that on purpose or?
>
> - Simon
>
>
> To unsubscribe from this group, send an email to:
> VirtualTreeview-unsubscribe@egroups.com
>
>
>
> Your use of Yahoo! Groups is subject to
> http://docs.yahoo.com/info/terms/
>
>


Printing routine

From: Sanjay Kanade [skanade@v...]
Date: Wed Jan 16, 2002 12:56 pm
Subject: Printing routine

I would like to make up something like FORMATRANGE feature of
RichEdit for printing VTree. The tree should be scaled into
the page width available but the proportional height might
run into several pages similar to FORMATRANGE. I have seen
the printing example. But, it will need some rework to do
what I want. I am not too clear on coordinate transforms. If
someone can give a hint in the form of some sample code for the
above task, I will appreciate it.

Thanks,
Sanjay


(possible) bug in ContentToHTML

From: "Anders Thomsen" [anders@t...]
Date: Wed Jan 16, 2002 1:39 pm
Subject: (possible) bug in ContentToHTML

Hi,

When using ContentToHTML, I have some troubles when a node text contains the ´
symbol (for instance é , or just the ´symbol alone).
´ is converted to : Â´
and
é is converted to: Ã©

Regards, and congratulations on the new public version!
-Thomsen

[Non-text portions of this message have been removed]

 | Replies | Author | Date
5247 | Re: (possible) bug in ContentToHTML | Mike Lischke | Sun 1/27/2002


Pending and direct clearance are mutual exclusive!

From: "gbehnke2000" [Behnke@h...]
Date: Wed Jan 16, 2002 3:26 pm
Subject: Pending and direct clearance are mutual exclusive!

Hello All,

using BCB5 & VirtualTrees.
From Time to Time i get the Error-Messages
"Pending and direct clearance are mutual exclusive!"
What that exactly mean and what can i do to avoid this error

Many thanks in advance

Gerhard Behnke

 | Replies | Author | Date
5175 | Re: Pending and direct clearance are mutual exclu | Jim Kueneman | Thu 1/17/2002


Inplace editors

From: "avatopia" [ian.yahoogroups1@a...]
Date: Wed Jan 16, 2002 3:37 pm
Subject: Inplace editors

i originally looked into the VirtualTreeview for it's inplace
editors. i was willing to put up with the rest of it's operation in
order to get easy to use editors.

Well...i've fought with it for a year in a live project...and i'm
about to tear the damn thing out, and use a customized ListView that
i wrote.

Can anyone give me a good example of InPlace editing? i do not mean
the EditLinks and VST examples in the files area.

i need to be able to edit like it was a grid. Cursoring up and down,
left and right. As well as left in the left column collapse the tree,
right in the right column expand the tree. Up and down, navigate up
and down, but not always begins the editor, since some cells are non-
editable.

i've been fighting for months with:

* calling methods of the Tree from my edit link.
* Subclassing the tree to get messages.
* Subclassing my TEdit to get keydowns, keyups, presses.
* What method in the EditLink to reset internal state information so
that calling EndEdit from inside the editor doesn't mangle it when
i'm still running.
* What combination of tree methods and edit link methods to fake all
the calls to end editing of one cell, and begin editing of the next
cell, when i want to navigate left and right.
* Paging up and down.

No examples handle cursor navigation around the tree properly.

The only of the Virtual Treeview (to me) was it's inplace editors.
Without them, i may as well not use it.

Any help?

 | Replies | Author | Date
5248 | Re: Inplace editors | Mike Lischke | Sun 1/27/2002


DoubleClick and OnExpanded

From: "adriangallero" [agallero@n...]
Date: Wed Jan 16, 2002 11:09 pm
Subject: DoubleClick and OnExpanded

Hi,
I've just downloaded the last version of virtuatreeview, and now I
can't get double-clicking in the nodes to work.

I used to use the OnExpanded event for this, as Mike recommended in
Message "2302 Re: double clicking", but now searching this
newsgroups, I've found that the event is no longer fired if the node
has no children. (Message 4891 Re: OnExpanded Bug: Called when
expanding childle")

Is there a new way to handle double clicks? Sorry if this has already
been answered, but I can't find anything. I can't use OnDblClk
because it fires if I click on empty part of the grid (not in a
node), and it doesn't give any info on where the user is clicking.
Any Ideas? ... Maybe a new event that behaves like good old
OnExpanded... I think it would be good to have another double click
event better than the default, wich fires only if a node has been
clicked, and gives you the node as a parameter

Well, that's all
As allways, thanks for everything
Adrian.

 | Replies | Author | Date
5174 | Re: DoubleClick and OnExpanded | Werner Lehmann | Wed 1/16/2002
5176 | Re: DoubleClick and OnExpanded | adriangallero | Thu 1/17/2002
5185 | Re: DoubleClick and OnExpanded | fransbouwmans | Fri 1/18/2002
5189 | Re: DoubleClick and OnExpanded | adriangallero | Fri 1/18/2002


re: DoubleClick and OnExpanded

From: Werner Lehmann [wl@b...]
Date: Wed Jan 16, 2002 11:14 pm
Subject: Re: [VirtualTreeview] DoubleClick and OnExpanded

adriangallero wrote:
>
> OnExpanded... I think it would be good to have another double click
> event better than the default, wich fires only if a node has been
> clicked, and gives you the node as a parameter

Probably. But as a workaround you could OnDblClick, and use the global
Mouse variable with VST.ScreenToClient and VST.GetNodeAt...

Regards,
Werner

 | Replies | Author | Date
5176 | Re: DoubleClick and OnExpanded | adriangallero | Thu 1/17/2002
5185 | Re: DoubleClick and OnExpanded | fransbouwmans | Fri 1/18/2002
5189 | Re: DoubleClick and OnExpanded | adriangallero | Fri 1/18/2002


re: Pending and direct clearance are mutual exclusive!

From: Jim Kueneman [jimdk@m...]
Date: Thu Jan 17, 2002 4:00 am
Subject: Re: [VirtualTreeview] Pending and direct clearance are mutual exclusive!

At 03:26 PM 1/16/2002 +0000, you wrote:
>Hello All,
>
>using BCB5 & VirtualTrees.
> From Time to Time i get the Error-Messages
>"Pending and direct clearance are mutual exclusive!"
>What that exactly mean and what can i do to avoid this error

I was getting these when I would try to do sneaky things like change
RightMouseSelect options in the middle of a mousedown mouseup cycle or not
calling inhertied on mouse messages or context menu messages (assuming
creating a decendant)

Jim


re: DoubleClick and OnExpanded

From: "adriangallero" [agallero@n...]
Date: Thu Jan 17, 2002 12:35 pm
Subject: Re: DoubleClick and OnExpanded

Thanks for the Hint! I'll see what I can do.

Anyway, I think it would be a good thing to have a OnDblClickNode
event... It's rather a basic thing, and you shouldn't have to mess
with a global mouse variable.

Good bye
Adrian.

--- In [VirtualTreeview@y...], Werner Lehmann [wl@b...] wrote:
> adriangallero wrote:
> >
> > OnExpanded... I think it would be good to have another double
click
> > event better than the default, wich fires only if a node has been
> > clicked, and gives you the node as a parameter
>
> Probably. But as a workaround you could OnDblClick, and use the
global
> Mouse variable with VST.ScreenToClient and VST.GetNodeAt...
>
> Regards,
> Werner

 | Replies | Author | Date
5185 | Re: DoubleClick and OnExpanded | fransbouwmans | Fri 1/18/2002
5189 | Re: DoubleClick and OnExpanded | adriangallero | Fri 1/18/2002


Bug in source of "Advanced Demo"

From: Ven ven [vasut_v_y@y...]
Date: Thu Jan 17, 2002 12:36 pm
Subject: Bug in source of "Advanced Demo"

Hello All !!!

I could'nt compile project "Advanced Demo"
Here is these errors:

[Error] Editors.pas(58): Declaration of 'PrepareEdit'
differs from declaration in interface 'IVTEditLink'
+-- This line raise Error
|
--> function PrepareEdit(Tree: TBaseVirtualTree;
Node: PVirtualNode; Column: TColumnIndex): Boolean;
stdcall;

[Error] Editors.pas(184): Declaration of 'PrepareEdit'
differs from declaration in interface 'IVTEditLink'
+-- This line raise Error
|
--> function PrepareEdit(Tree: TBaseVirtualTree;
Node: PVirtualNode; Column: TColumnIndex): Boolean;
stdcall;

[Fatal Error] Editors.pas(191): Could not compile used
unit 'GridDemo.pas'

I'm using Delphi5+Update Pack1, VT v 3.0.4

Best regards, Ven

__________________________________________________
Do You Yahoo!?
Send FREE video emails in Yahoo! Mail!
http://promo.yahoo.com/videomail/

 | Replies | Author | Date
5178 | Re: Bug in source of "Advanced Demo" | Jim Kueneman | Thu 1/17/2002


re: Bug in source of "Advanced Demo"

From: Jim Kueneman [jimdk@m...]
Date: Thu Jan 17, 2002 1:19 pm
Subject: Re: [VirtualTreeview] Bug in source of "Advanced Demo"

> --> function PrepareEdit(Tree: TBaseVirtualTree;
>Node: PVirtualNode; Column: TColumnIndex): Boolean;
>stdcall;

This is the right definition for PrepareEdit in V3.0.4. My guess is you
still have an old version VirtualTrees.dcu floating around somewhere on
your search path.

Jim


VirtualTreeview/IBO4

From: "kdfdatentechnik" [info@k...]
Date: Thu Jan 17, 2002 1:40 pm
Subject: VirtualTreeview/IBO4

Hi together,

Does somebody have a data-sensitive component, that works with D6,
VirtualTreeviewV3 and the native components of IBO4.2?

Regards
K.- D.

 | Replies | Author | Date
5180 | Re: VirtualTreeview and BCB5 | Shawn Anderson | Thu 1/17/2002
5181 | Re: VirtualTreeview and BCB5 | gbehnke2000 | Thu 1/17/2002
5182 | Re: VirtualTreeview and BCB5 | Shawn Anderson | Thu 1/17/2002
5183 | Re: VirtualTreeview and BCB5 | gbehnke2000 | Thu 1/17/2002
5184 | Re: VirtualTreeview and BCB5 | milan_vacz | Thu 1/17/2002


re: VirtualTreeview and BCB5

From: "Shawn Anderson" [sanderson@e...]
Date: Thu Jan 17, 2002 2:25 pm
Subject: RE: [VirtualTreeview] VirtualTreeview and BCB5

Has anyone been able to get v3.0 to compile under BCB 5 Pro?

Shawn

[Non-text portions of this message have been removed]

 | Replies | Author | Date
5181 | Re: VirtualTreeview and BCB5 | gbehnke2000 | Thu 1/17/2002
5182 | Re: VirtualTreeview and BCB5 | Shawn Anderson | Thu 1/17/2002
5183 | Re: VirtualTreeview and BCB5 | gbehnke2000 | Thu 1/17/2002
5184 | Re: VirtualTreeview and BCB5 | milan_vacz | Thu 1/17/2002


re: VirtualTreeview and BCB5

From: "gbehnke2000" [Behnke@h...]
Date: Thu Jan 17, 2002 2:50 pm
Subject: Re: VirtualTreeview and BCB5

Hello Shawn,

yes, i use V3.0.4 with BCB5. But i maked some modifications in
VirtualtreesReg.PAS because i had problems with the
TVirtualTreeEditor and therefore don'nt use this but the VirtualTrees
itselfs works great. If you like i can send you my project files
inlcuding the modified VirtualtreesReg.PAS.

Best regards
Gerhard Behnke

--- In [VirtualTreeview@y...], "Shawn Anderson" [sanderson@e...] wrote:
> Has anyone been able to get v3.0 to compile under BCB 5 Pro?
>
> Shawn
>
>
> [Non-text portions of this message have been removed]

 | Replies | Author | Date
5182 | Re: VirtualTreeview and BCB5 | Shawn Anderson | Thu 1/17/2002
5183 | Re: VirtualTreeview and BCB5 | gbehnke2000 | Thu 1/17/2002
5184 | Re: VirtualTreeview and BCB5 | milan_vacz | Thu 1/17/2002


re: Re: VirtualTreeview and BCB5

From: "Shawn Anderson" [sanderson@e...]
Date: Thu Jan 17, 2002 3:02 pm
Subject: RE: [VirtualTreeview] Re: VirtualTreeview and BCB5

I would appreciate that. Thanks.

Shawn

-----Original Message-----
From: gbehnke2000 [mailto:[Behnke@h...]]
Sent: Thursday, January 17, 2002 9:50 AM
To: [VirtualTreeview@yahoogroups.com
Subject: [VirtualTreeview] Re: VirtualTreeview and BCB5

Hello Shawn,

yes, i use V3.0.4 with BCB5. But i maked some modifications in
VirtualtreesReg.PAS because i had problems with the
TVirtualTreeEditor and therefore don'nt use this but the VirtualTrees
itselfs works great. If you like i can send you my project files
inlcuding the modified VirtualtreesReg.PAS.

Best regards
Gerhard Behnke

--- In [VirtualTreeview@y...], "Shawn Anderson" <sanderson@e...] wrote:
> Has anyone been able to get v3.0 to compile under BCB 5 Pro?
>
> Shawn
>
>
> [Non-text portions of this message have been removed]

To unsubscribe from this group, send an email to:
VirtualTreeview-unsubscribe@egroups.com

Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service
<http://docs.yahoo.com/info/terms/> .

[Non-text portions of this message have been removed]

 | Replies | Author | Date
5183 | Re: VirtualTreeview and BCB5 | gbehnke2000 | Thu 1/17/2002
5184 | Re: VirtualTreeview and BCB5 | milan_vacz | Thu 1/17/2002


re: VirtualTreeview and BCB5

From: "gbehnke2000" [Behnke@h...]
Date: Thu Jan 17, 2002 3:08 pm
Subject: Re: VirtualTreeview and BCB5

Can you send me your E-Mail Address to
[Behnke@h...]

Regards
Gerhard

--- In [VirtualTreeview@y...], "Shawn Anderson" [sanderson@e...] wrote:
> I would appreciate that. Thanks.
>
> Shawn
>
> -----Original Message-----
> From: gbehnke2000 [mailto:[Behnke@h...]]
> Sent: Thursday, January 17, 2002 9:50 AM
> To: [VirtualTreeview@y...]
> Subject: [VirtualTreeview] Re: VirtualTreeview and BCB5
>
>
> Hello Shawn,
>
> yes, i use V3.0.4 with BCB5. But i maked some modifications in
> VirtualtreesReg.PAS because i had problems with the
> TVirtualTreeEditor and therefore don'nt use this but the
VirtualTrees
> itselfs works great. If you like i can send you my project files
> inlcuding the modified VirtualtreesReg.PAS.
>
> Best regards
> Gerhard Behnke
>
> --- In [VirtualTreeview@y...], "Shawn Anderson" [sanderson@e...]
wrote:
> > Has anyone been able to get v3.0 to compile under BCB 5 Pro?
> >
> > Shawn
> >
> >
> > [Non-text portions of this message have been removed]
>
>
> To unsubscribe from this group, send an email to:
> [VirtualTreeview-unsubscribe@e...]
>
>
>
> Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service
> <http://docs.yahoo.com/info/terms/> .
>
>
>
>
> [Non-text portions of this message have been removed]

 | Replies | Author | Date
5184 | Re: VirtualTreeview and BCB5 | milan_vacz | Thu 1/17/2002


re: VirtualTreeview and BCB5

From: "milan_vacz" [milan_va@s...]
Date: Thu Jan 17, 2002 6:59 pm
Subject: Re: VirtualTreeview and BCB5

Sorry for jumping in.

The file in files\Examples\BCB_Examples\Compatibility should work as
well.

Milan Vandrovec


re: DoubleClick and OnExpanded

From: "fransbouwmans" [frans.bouwmans@z...]
Date: Fri Jan 18, 2002 9:04 am
Subject: Re: DoubleClick and OnExpanded

--- In [VirtualTreeview@y...], "adriangallero" [agallero@n...] wrote:
> Thanks for the Hint! I'll see what I can do.
>
> Anyway, I think it would be a good thing to have a OnDblClickNode
> event... It's rather a basic thing, and you shouldn't have to mess
> with a global mouse variable.
>

Hi, I had a similar problem (I think) this is my code, in a VST
derived tree, I handles the windows message dbl click,
it will give you the dblclicked node and position (label, column etc)
Hope this helps

Frans Bouwmans

procedure VTTrackTreeView.WMLButtonDblClk(var Message:
TWMLButtonDblClk);
var
HitInfo: THitInfo;
p: PNodeData;
begin
inherited;
GetHitTestInfoAt(Message.XPos, Message.YPos, true, HitInfo);
if hiOnItemLabel in HitInfo.HitPositions then
begin
DblCLick(HitInfo.HitNode);
end;
end;

 | Replies | Author | Date
5189 | Re: DoubleClick and OnExpanded | adriangallero | Fri 1/18/2002


Can not click on Nodes

From: "Johannes Teitge" [teitge@t...]
Date: Fri Jan 18, 2002 10:21 am
Subject: Can not click on Nodes

Hi,

first i want to write an Easy-Example to learn using VirtualTrees.
Now I have an Problem: After Insert a new Node i can not
click an activate an Node. Why that?
When i remove the OnGetText Event its able to click on Node.

Here ist my Code:

unit Unit1;

interface

uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, VirtualTrees, StdCtrls;

type

PTVTRec = ^TVTRec; // My own Data
TVTRec = record
Caption : WideString;
end;

TForm1 = class(TForm)
VT: TVirtualStringTree;
GroupBox1: TGroupBox;
Label1: TLabel;
Edit1: TEdit;
Button1: TButton;
procedure FormCreate(Sender: TObject);
procedure VTGetText(Sender: TBaseVirtualTree; Node: PVirtualNode;
Column: Integer; TextType: TVSTTextType; var CellText: WideString);
procedure Button1Click(Sender: TObject);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;

var
Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.FormCreate(Sender: TObject); // ***** Initializing Size
*****
begin
VT.NodeDataSize := SizeOf(TVTRec);
end;

procedure TForm1.VTGetText(Sender: TBaseVirtualTree; Node: PVirtualNode; //
***** Get Text of Node *****
Column: Integer; TextType: TVSTTextType; var CellText: WideString);
Var
P : PTVTRec;
begin
P := Sender.GetNodeData(Node);
if assigned(P) then
CellText := WideString(P.Caption);

end;

procedure TForm1.Button1Click(Sender: TObject); // ***** Insert New Node
*****
Var
NewNode : PVirtualNode;
P : PTVTRec;
begin
NewNode := VT.AddChild(nil);
P := VT.GetNodeData(NewNode);
P.Caption := WideString(Edit1.Text);
end;

end.

Greetings
Dscho

[Non-text portions of this message have been removed]

 | Replies | Author | Date
5187 | Re: Can not click on Nodes | Johannes Teitge | Fri 1/18/2002


re: Can not click on Nodes

From: "Johannes Teitge" [teitge@t...]
Date: Fri Jan 18, 2002 10:38 am
Subject: Re: [VirtualTreeview] Can not click on Nodes

I have solved the problem by adding the following line
after insert an nwe node:

...
VT.InvalidateNode(NewNode);
...

----- Original Message -----
From: "Johannes Teitge" [teitge@t...]
To: <VirtualTreeview@yahoogroups.com>
Sent: Friday, January 18, 2002 11:21 AM
Subject: [VirtualTreeview] Can not click on Nodes

> Hi,
>
> first i want to write an Easy-Example to learn using VirtualTrees.
> Now I have an Problem: After Insert a new Node i can not
> click an activate an Node. Why that?
> When i remove the OnGetText Event its able to click on Node.
>
>
>
> Here ist my Code:
>
> unit Unit1;
>
> interface
>
> uses
> Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls,
Forms,
> Dialogs, VirtualTrees, StdCtrls;
>
> type
>
> PTVTRec = ^TVTRec; // My own Data
> TVTRec = record
> Caption : WideString;
> end;
>
>
>
> TForm1 = class(TForm)
> VT: TVirtualStringTree;
> GroupBox1: TGroupBox;
> Label1: TLabel;
> Edit1: TEdit;
> Button1: TButton;
> procedure FormCreate(Sender: TObject);
> procedure VTGetText(Sender: TBaseVirtualTree; Node: PVirtualNode;
> Column: Integer; TextType: TVSTTextType; var CellText: WideString);
> procedure Button1Click(Sender: TObject);
> private
> { Private-Deklarationen }
> public
> { Public-Deklarationen }
> end;
>
> var
> Form1: TForm1;
>
> implementation
>
> {$R *.dfm}
>
> procedure TForm1.FormCreate(Sender: TObject); // ***** Initializing Size
> *****
> begin
> VT.NodeDataSize := SizeOf(TVTRec);
> end;
>
>
> procedure TForm1.VTGetText(Sender: TBaseVirtualTree; Node: PVirtualNode;
//
> ***** Get Text of Node *****
> Column: Integer; TextType: TVSTTextType; var CellText: WideString);
> Var
> P : PTVTRec;
> begin
> P := Sender.GetNodeData(Node);
> if assigned(P) then
> CellText := WideString(P.Caption);
>
> end;
>
> procedure TForm1.Button1Click(Sender: TObject); // ***** Insert New Node
> *****
> Var
> NewNode : PVirtualNode;
> P : PTVTRec;
> begin
> NewNode := VT.AddChild(nil);
> P := VT.GetNodeData(NewNode);
> P.Caption := WideString(Edit1.Text);
> end;
>
> end.
>
>
> Greetings
> Dscho
>
>
>
>
>
>
> [Non-text portions of this message have been removed]
>
>
>
> To unsubscribe from this group, send an email to:
> VirtualTreeview-unsubscribe@egroups.com
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>
>


MultiLines in VT

From: Ven ven [vasut_v_y@y...]
Date: Fri Jan 18, 2002 10:58 am
Subject: MultiLines in VT

Hello All !!!

I'm interesting for this feature - multiline in VT.
Using this feature for showing very long string can be
need, particularly in my project.

Maybe who works at this problem and have finished
solution.
I will be glad to see a part of source code.

Best regards, Ven

__________________________________________________
Do You Yahoo!?
Send FREE video emails in Yahoo! Mail!
http://promo.yahoo.com/videomail/

 | Replies | Author | Date
5249 | Re: MultiLines in VT | Mike Lischke | Sun 1/27/2002
5254 | Re: MultiLines in VT | Peter Evans | Tue 1/29/2002


re: DoubleClick and OnExpanded

From: "adriangallero" [agallero@n...]
Date: Fri Jan 18, 2002 1:33 pm
Subject: Re: DoubleClick and OnExpanded

Thanks, Frans. I think I'll be using this.

Regards, adrian.

--- In [VirtualTreeview@y...], "fransbouwmans" [frans.bouwmans@z...]
wrote:
> --- In [VirtualTreeview@y...], "adriangallero" [agallero@n...] wrote:
> > Thanks for the Hint! I'll see what I can do.
> >
> > Anyway, I think it would be a good thing to have a OnDblClickNode
> > event... It's rather a basic thing, and you shouldn't have to
mess
> > with a global mouse variable.
> >
>
> Hi, I had a similar problem (I think) this is my code, in a VST
> derived tree, I handles the windows message dbl click,
> it will give you the dblclicked node and position (label, column
etc)
> Hope this helps
>
> Frans Bouwmans
>
> procedure VTTrackTreeView.WMLButtonDblClk(var Message:
> TWMLButtonDblClk);
> var
> HitInfo: THitInfo;
> p: PNodeData;
> begin
> inherited;
> GetHitTestInfoAt(Message.XPos, Message.YPos, true, HitInfo);
> if hiOnItemLabel in HitInfo.HitPositions then
> begin
> DblCLick(HitInfo.HitNode);
> end;
> end;


Ghost Drag Image

From: "jimkueneman" [jimdk@m...]
Date: Sat Jan 19, 2002 2:31 pm
Subject: Ghost Drag Image

Hi Mike,

Remember when I asked about the ghost drag image after the context
menu was shown? I finally reproduced it so I can explain what is
happening.

Ok RightButtonDrag is on:

-RMouseButton down, wanting a context menu.
-toOLEDragPending true.
-RMouseButton up.
-Call inherited of WM_RBUTTONUP.
-System generates a WM_CONTEXTMENU.
-Shows Shell Context menu in private message loop.
-Moves mouse to select item.
-Selects Item.
-Menu Closes.
-Now Mouse is in different spot.
-Shell Starts to execute selection in a different thread.
-Application now gets a WM_MOUSEMOVE message while still in the
WM_CONTEXTMENU handler!!!!!!!!!!!
-Since toOLEDragPending is true VT starts a drag!
-ActiveX.DoDragDrop returns immediatly and appears to forget to call
DragLeave.
-Return to WM_RBUTTONUP handler were VT finally calls HandleMouseUp
and the toOLEDragPending is set to false.

WOW, what a debugging nightmare.

I see two problems here.

1) How to I make VT clear the toOLEDragPending flag (maybe VT should
clear it once it sees a WM_CONTEXTMENU message since a drag should
not take place if the mouse button was for a context menu)

2) Why does the OLE drag system call DragEnter without a
corresponding DragLeave or DragDrop? Maybe the enter/leaves should
be tracked and if the object is destroyed with a enter count > 0 then
the IDropTargetHandler.DragLeave can be called.

Fixing 2 is a only fixing the symptoms not the cause. 1 is really
the cause.

Jim

 | Replies | Author | Date
5218 | Re: Ghost Drag Image | Mike Lischke | Wed 1/23/2002


re: Re: Version 3.0

From: "Mike Lischke" [lists@l...]
Date: Sat Jan 19, 2002 4:27 pm
Subject: RE: [VirtualTreeview] Re: Version 3.0

Hi,

> I just migrated from version 2.5.21 to 3.04 and came across an
> "Invalid property value" error and traced it to the coAllowClick
> option in header.columns.options. If you try and set this value to
> false for any column in the tree, it crashes.

This is strange. I can modify these values without problems. Make sure you did
a build-all for the
packages and your application. If this does not help then try making a small
demo which shows this
problem.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net

 | Replies | Author | Date
5193 | Re: Version 3.0 | briggsoft | Sat 1/19/2002


re: NotImageList images

From: "Mike Lischke" [lists@l...]
Date: Sat Jan 19, 2002 4:35 pm
Subject: RE: [VirtualTreeview] NotImageList images

Hi Andrew,

> PMyData = ^packed record
> Icon: TBitmap; //I use Icon.Canvas for frequent painting
> end;
> TImageList absolutely does not approach because of large icon's number
> (every node has own image) and their constant renovation.
>
> How can i EASY draw "Icon: TBitmap" instead of "Images: TImageList"?

Actually, an image list would be perfect here. It is made for a large number of
images. You're
wasting a lot of system resources when you create individual bitmaps for each
node.

If you want to draw the icons yourself then you will have to use owner draw and
paint everything
yourself.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: Version 3.0

From: "briggsoft" [kbriggs@b...]
Date: Sat Jan 19, 2002 8:29 pm
Subject: Re: Version 3.0

--- In [VirtualTreeview@y...], "Mike Lischke" [lists@l...] wrote:
> Hi,
>
> > I just migrated from version 2.5.21 to 3.04 and came across an
> > "Invalid property value" error and traced it to the coAllowClick
> > option in header.columns.options. If you try and set this value to
> > false for any column in the tree, it crashes.
>
> This is strange. I can modify these values without problems. Make
sure you did a build-all for the
> packages and your application. If this does not help then try making
a small demo which shows this
> problem.

Yeah, it was just a bad install problem. See the coAllowClick thread
where I figured it out.

Kent Briggs


A litte Qustion: What mean "AFAIK"?

From: "silvenra" [maeh2@g...]
Date: Sun Jan 20, 2002 4:28 pm
Subject: A litte Qustion: What mean "AFAIK"?

 | Replies | Author | Date
5195 | Re: A litte Qustion: What mean "AFAIK"? | Tom Hahn | Sun 1/20/2002


re: A litte Qustion: What mean "AFAIK"?

From: "Tom Hahn" [thahn@h...]
Date: Sun Jan 20, 2002 4:30 pm
Subject: RE: [VirtualTreeview] A litte Qustion: What mean "AFAIK"?

As Far As I Know

> -----Original Message-----
> From: silvenra [mailto:[maeh2@g...]]
> Sent: Sunday, January 20, 2002 11:28 AM
> To: VirtualTreeview@yahoogroups.com
> Subject: [VirtualTreeview] A litte Qustion: What mean "AFAIK"?
>
>
>
>
>
>
> To unsubscribe from this group, send an email to:
> VirtualTreeview-unsubscribe@egroups.com
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>
>
>


re: VT 3.0.4 Bug: Node collapse does not update tree ...

From: "Mike Lischke" [lists@l...]
Date: Sun Jan 20, 2002 7:27 pm
Subject: RE: [VirtualTreeview] VT 3.0.4 Bug: Node collapse does not update tree ...

Hi Ralf,

> there is a condition where collapsing a node does not update the tree: To
save resources,
> I am deleting a node's children if the node is collapsed. This worked just
fine until 3.0.4.

It still works on my side. How do you determine if the children are deleted? I
found that when you
later try to expand the node its children get reinitialized again (as it should
be). So one could
think they were never deleted.

> PS: Are you interested in a VT-demo (Addressbook application), including
source, which
> has multiple node types, all completely virtual, limited Drag & Drop, and
does a little
> owner drawing to the node's background?

Sure! If it works with the latest build and does not require too many
additional software to install
(ideally: nothing) then I could include it into the distribution.

> PPS: Do you prefer postings to this list or to the newsgroup?

I prefer the newsgroups.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: Re: Version 3.0

From: "Mike Lischke" [lists@l...]
Date: Sun Jan 20, 2002 7:34 pm
Subject: RE: [VirtualTreeview] Re: Version 3.0

Hi Greg,

> Any chance of updating the online version history?
> (http://www.lischke-online.de/VirtualTreeview/VTHistory.html)

There is nothing to update. The version history includes December last year.
Everything else is in
the source code (as I did it for a while now).

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: NotImageList images

From: "Andrew P.Rybin" [magicode@m...]
Date: Mon Jan 21, 2002 6:25 am
Subject: Re: [VirtualTreeview] NotImageList images

----- Original Message -----
From: "Mike Lischke" [lists@l...]
To: <VirtualTreeview@yahoogroups.com>
Sent: Saturday, January 19, 2002 9:35 PM
Subject: RE: [VirtualTreeview] NotImageList images

> Hi Andrew,
>
> > PMyData = ^packed record
> > Icon: TBitmap; //I use Icon.Canvas for frequent painting
> > end;
> > TImageList absolutely does not approach because of large icon's number
> > (every node has own image) and their constant renovation.
> >
> > How can i EASY draw "Icon: TBitmap" instead of "Images: TImageList"?
>
> Actually, an image list would be perfect here. It is made for a large
number of images. You're
> wasting a lot of system resources when you create individual bitmaps for
each node.
Main problem:
the nodes often appear, and often disappear.
=> Icons often appear, and often disappear.
=> Icons ImageIndex is constantly changed

> If you want to draw the icons yourself then you will have to use owner
draw and paint everything
> yourself.
How can i find Icon.Left & Icon.Top coordinates?
And what event is best for Icon painting?

> Ciao, Mike
thank you!
VST is TheBest! ;-)


FORMCHECKBOX Your PIN may contain

From: Dion Oliphant [dion@n...]
Date: Mon Jan 21, 2002 8:04 am
Subject: FORMCHECKBOX Your PIN may contain

Receiving a system-generated PIN
Initiate a login session. After you respond to the usual prompt for your login,
the system will prompt you to enter a PASSCODE.

[Non-text portions of this message have been removed]

 | Replies | Author | Date
5200 | Re: FORMCHECKBOX Your PIN may contain | Helge Jung (ECO-Logic) | Mon 1/21/2002


re: FORMCHECKBOX Your PIN may contain

From: "Helge Jung \(ECO-Logic\)" [helge@e...]
Date: Mon Jan 21, 2002 1:01 pm
Subject: RE: [VirtualTreeview] FORMCHECKBOX Your PIN may contain

> Receiving a system-generated PIN
> Initiate a login session. After you respond to the usual prompt
> for your login, the system will prompt you to enter a PASSCODE.

Sorry but what does your question has to do with VT or VET? And what do you
want to ask by the way ... I don't understand what you want (maybe 'cause my
English isn't that good - I'm a German pupil).

Helge.


Virtual Tree View - How do you resize to column vertical line dur ing runtime like Object Inspector

From: "Richter, Len" [len@c...]
Date: Mon Jan 21, 2002 5:28 pm
Subject: Virtual Tree View - How do you resize to column vertical line dur ing runtime like Object Inspector

How do you resize to column vertical line during runtime like Object
Inspector? This is by moving the cursor over column vertical line and the
cursor changes to resize and then
drag and resizing it.

The only thing I can think of is using OnMouseMove to change the cursor but
I can not find how to get the column width. Then in the OnDrag change the
column width.

Does any one have a better idea? If not how do I get/set the column width

Len Richter

 | Replies | Author | Date
5202 | Re: Virtual Tree View - How do you resize to colu | rm198de | Mon 1/21/2002


re: Virtual Tree View - How do you resize to column vertical line dur ing runtime like Object Inspector

From: "rm198de" [rmelles@g...]
Date: Mon Jan 21, 2002 7:30 pm
Subject: Re: Virtual Tree View - How do you resize to column vertical line dur ing runtime like Object Inspector

--- In [VirtualTreeview@y...], "Richter, Len" [len@c...] wrote:
> How do you resize to column vertical line during runtime like
Object
> Inspector? This is by moving the cursor over column vertical line
and the
> cursor changes to resize and then
> drag and resizing it.
>

Hi Len,

I´m not really sure what you need to do. If you only want to change
the columnsize by runtime, you need to enable resizing in
vst.header.columns (can be done by designtime). Mike still included
all the heavy handling stuff in VT! ;-)

don´t get sweat...

Ralf


re: Re: Virtual Tree View - How do you resize t o column vertical line during runtime like Object Inspector

From: "Richter, Len" [len@c...]
Date: Mon Jan 21, 2002 7:55 pm
Subject: RE: [VirtualTreeview] Re: Virtual Tree View - How do you resize t o column vertical line during runtime like Object Inspector

During runtime, I have no headers and therefore the only way user can resize
the window is having the capability as resizing column in the Object
Inspector window. When moving the cursor over the column vertical line have
the cursor change to resize. Then the user can click and drag/change the
column width. Mike use to have this but removed it because vt was not
passing the mouse messages along. Therefore I am trying to recreate this
myself.

Len

-----Original Message-----
From: rm198de [mailto:[rmelles@g...]]
Sent: Monday, January 21, 2002 12:30 PM
To: [VirtualTreeview@yahoogroups.com
Subject: [VirtualTreeview] Re: Virtual Tree View - How do you resize to
column vertical line dur ing runtime like Object Inspector

--- In [VirtualTreeview@y...], "Richter, Len" <len@c...] wrote:
> How do you resize to column vertical line during runtime like
Object
> Inspector? This is by moving the cursor over column vertical line
and the
> cursor changes to resize and then
> drag and resizing it.
>

Hi Len,

I´m not really sure what you need to do. If you only want to change
the columnsize by runtime, you need to enable resizing in
vst.header.columns (can be done by designtime). Mike still included
all the heavy handling stuff in VT! ;-)

don´t get sweat...

Ralf

To unsubscribe from this group, send an email to:
VirtualTreeview-unsubscribe@egroups.com

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/


Virtual Tree View - Has anyone added a Button as an editor on the right side of the cell.

From: "Richter, Len" [len@c...]
Date: Tue Jan 22, 2002 9:44 pm
Subject: Virtual Tree View - Has anyone added a Button as an editor on the right side of the cell.

I am currently drawing an image in the cell with a button on the right had
side of the cell. Unfortunately the button is there but it is always white.
It does not get painted properly. Has anyone placed a button in the cell.
If so, how.

Len

 | Replies | Author | Date
5205 | Virtual Tree View - Has anyone added a Button as | Richter, Len | Tue 1/22/2002
5206 | Refresh problem with ActiveX in MFC | Justin Turberville | Wed 1/23/2002
5250 | Re: Refresh problem with ActiveX in MFC | Mike Lischke | Sun 1/27/2002
5251 | Re: Refresh problem with ActiveX in MFC | Justin Turberville | Mon 1/28/2002


Virtual Tree View - Has anyone added a Button as an editor on the right side of the cell.

From: "Richter, Len" [len@c...]
Date: Tue Jan 22, 2002 10:02 pm
Subject: Virtual Tree View - Has anyone added a Button as an editor on the right side of the cell.

Disregard. Found the problem.

Len

I am currently drawing an image in the cell with a button on the right had
side of the cell. Unfortunately the button is there but it is always white.
It does not get painted properly. Has anyone placed a button in the cell.
If so, how.

Len

 | Replies | Author | Date
5206 | Refresh problem with ActiveX in MFC | Justin Turberville | Wed 1/23/2002
5250 | Re: Refresh problem with ActiveX in MFC | Mike Lischke | Sun 1/27/2002
5251 | Re: Refresh problem with ActiveX in MFC | Justin Turberville | Mon 1/28/2002


Refresh problem with ActiveX in MFC

From: "Justin Turberville" [justin@d...]
Date: Wed Jan 23, 2002 11:14 am
Subject: Refresh problem with ActiveX in MFC

Hi

We use VT (TVirtualStringTree) in an application that is built in an ActiveX
control, in that the main viewer form is opened when the ActiveX control is
clicked on. This way our product can be hosted by another application in a
platform independant way.

If the ActiveX control's host is a MFC / MS Visual C++ program, the main
viewer's (owned by the ActiveX control) VT does not generally want to paint
itself. I've tried calling refresh, update & invalidate without success - it
is visible and enabled and has nodes, but OnBeforeItemPaint is not being
called.

The only thing that works is:

with tvBrowser do
begin
visible:=false;
visible:=true;

scrollbaroptions.scrollbars:=ssNone;
scrollbaroptions.scrollbars:=ssVertical;

if (assigned(focusednode)) then
scrollintoview(focusednode);
end;

- which is not nice, especially as this has to be done whenever the
contents are changed or the focused node is changed in code.

The above scrollbar fudge is also required to get VT to update it.

Any VT's on other forms opening off the main one work fine and all other
controls on the main viewer form also work fine.

Any suggestions?

Sorry about hitting you with this one!

Justin

 | Replies | Author | Date
5250 | Re: Refresh problem with ActiveX in MFC | Mike Lischke | Sun 1/27/2002
5251 | Re: Refresh problem with ActiveX in MFC | Justin Turberville | Mon 1/28/2002


Small FullyVisible problem

From: Yur Ovchinnikov [Yur@s...]
Date: Wed Jan 23, 2002 11:53 am
Subject: Small FullyVisible problem

Hello folks,

I have some problem with setting node visible (not show/hide)

I have vst with align = alClient and panel with align = alBottom and
visible = false.
vst has i.e. about 100 items. If i focused some node (i.e. 40), it becomes
fully visible. After setting panel.vsisble = true this node becomes
invisible (because of tree hight decreased) but FullyVisible[this node]
still returned true and no way to become it visible again.

For standart tListItem we have procedure MakeVisible and I used
FullyVisible[node] for vst for making such effect but it's not worked
in situation described above.

--
Best regards,
Yur Ovchinnikov E-mail: [yur@s...]
JSC Summit WWW: http://alone.come.to
ICQ: 1400397

 | Replies | Author | Date
5208 | Re: Small FullyVisible problem | Werner Lehmann | Wed 1/23/2002
5210 | Re[2]: [VirtualTreeview] Small FullyVisible probl | Yur Ovchinnikov | Wed 1/23/2002


re: Small FullyVisible problem

From: Werner Lehmann [wl@b...]
Date: Wed Jan 23, 2002 12:50 pm
Subject: Re: [VirtualTreeview] Small FullyVisible problem

Hi Yur.

> For standart tListItem we have procedure MakeVisible and I used
> FullyVisible[node] for vst for making such effect but it's not worked
> in situation described above.

Try ScrollIntoView.

Werner

 | Replies | Author | Date
5210 | Re[2]: [VirtualTreeview] Small FullyVisible probl | Yur Ovchinnikov | Wed 1/23/2002


[VirtualExplorerTree] Problem: Resource DLL Wizard with VirtualTree

From: "peperu39" [jimdk@m...] (by way of Jim Kueneman [jimdk@m...])
Date: Wed Jan 23, 2002 2:14 pm
Subject: [VirtualExplorerTree] Problem: Resource DLL Wizard with VirtualTree

Hi, my name is SangGu, a Korean.
I can't speak English very well, so please regard my poor English.

I'm working with TVirtualStringTree version 3.0.4 under C++ Builder
5.
My application supports multi language(English, Korean, Japanese) and
I'm using Resource DLL Wizard.
Recently, I have replaced all the TListView controls of my app to
the TVirtualStringTree, I found some problems.
All Header->Columns informations were droped..
The properties of TVTHeader is not saved to the new resource dfm
file. Text, Width, ... etc

So, I tried testing under Delphi 6, Resource DLL Wizard makes an
error this time.
The error:

ObjectTextToResource failed: "=" expected on line 23
- File saved: c:\dev\delphi6\Projects\KOR\Unit1.ERR_DFM

I have tested folling steps.

1. Insert a TVirtualStringTree to an empty form
2. Add tree columns to the Header property. (by double clicking the
control)
3. Set Text property of each TVTHeader to "Province", "Zipcode"
and "Range".
4. Set Width property of each TVTHeader to 150, 75, 100
5. Save
6. Run
7. File-New-Others Resource DLL Wizard
8. Next..Next..Select Korean Language...Next...Finish
Error Occurs..
9. If I try to open a Form1 unit from the newly created
project 'Project1.KOR', I get "Invalid stream format" error message.

In C++ Builder 5, there is no error message, but all properties of
TVTHeader is set to default values.. Width = 50, Text = "" etc

I think it is a bug of the VirtualTree control, and in Western.. it
may be a small problem, but in Eastern.. it may be a big problem.

I hope to solve this problem quickly...
Please help me~~~

peperu (peperu is my nick. my name is Kim, Sang Gu.. Kim is my last
name)

PS.. It is hard for me to write in English.. (^_^)

To unsubscribe from this group, send an email to:
VirtualExplorerTree-unsubscribe@yahoogroups.com

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/


Re[2]: Small FullyVisible problem

From: Yur Ovchinnikov [Yur@s...]
Date: Wed Jan 23, 2002 2:52 pm
Subject: Re[2]: [VirtualTreeview] Small FullyVisible problem

Hello Werner,

Wednesday, January 23, 2002, 2:50:47 PM, you wrote:

WL> Hi Yur.

>> For standart tListItem we have procedure MakeVisible and I used
>> FullyVisible[node] for vst for making such effect but it's not worked
>> in situation described above.

WL> Try ScrollIntoView.

Thanks

WL> Werner

--
Best regards,
Yur Ovchinnikov E-mail: [yur@s...]
JSC Summit WWW: http://alone.come.to
ICQ: 1400397


re: [VirtualExplorerTree] Problem: Resource DLL Wizard withVirtualTree

From: Werner Lehmann [wl@b...]
Date: Wed Jan 23, 2002 5:29 pm
Subject: Re: [VirtualTreeview] [VirtualExplorerTree] Problem: Resource DLL Wizard withVirtualTree

"peperu39 (by way of Jim Kueneman )" wrote:
>
> ObjectTextToResource failed: "=" expected on line 23
> - File saved: c:\dev\delphi6\Projects\KOR\Unit1.ERR_DFM

I can reproduce the error. Somehow the DFM in the new KOR project which is
created
by the wizard is messed up. It differs from the original DFM. Indentation is
missing
or is less than in the original DFM. And the header properties is completely
nuts:

Original DFM (works):

Header.Columns = <
item
Alignment = taLeftJustify
ImageIndex = -1
Layout = blGlyphLeft
Position = 0
Width = 150
WideText = 'Province'
end
item
Alignment = taLeftJustify
ImageIndex = -1
Layout = blGlyphLeft
Position = 1
Width = 75
WideText = 'Zipcode'
end
item
Alignment = taLeftJustify
ImageIndex = -1
Layout = blGlyphLeft
Position = 2
Width = 100
WideText = 'Range'
end>

Wizard created DFM (does not work):

Header Columns= <item Alignment = taLeftJustify
ImageIndex = -1
Layout = blGlyphLeft
Position = 0
Width = 150
WideText = 'Province' end
item Alignment = taLeftJustify
ImageIndex = -1
Layout = blGlyphLeft
Position = 1
Width = 75
WideText = 'Zipcode' end
item Alignment = taLeftJustify
ImageIndex = -1
Layout = blGlyphLeft
Position = 2
Width = 100
WideText = 'Range' end>

The differences are obvious. You can fix (replace) this manually of course but
this
does not help you much probably. The problem is probably the WideString property
which is stored as WideText and written with WriteWideString. Somehow this is
not
handled correctly but I don't know much (not enough) about Unicode <-> DFM
compatibility
to help you out.

Regards,
Werner

 | Replies | Author | Date
5224 | Re: [VirtualExplorerTree] Problem: Resource DLL W | peperu39 | Thu 1/24/2002


Problem with Delphi 4 and vt installation

From: "njlo555" [njlo555@h...]
Date: Wed Jan 23, 2002 6:12 pm
Subject: Problem with Delphi 4 and vt installation

Hi!

I'm running win2k and trying to install vt 3.

I've tried to install the design package for delphi 4 which resulted
in the following error:
[Fatal Error] VirtualTreesD4D.dpk(33): Required package '0+' not
found

I also tried the runtime only package which resultet in:
Access violation at address 0086A927 in module 'dcc40.dll'. Read of
address 02A91000.
The edit buffer of 'd:\dev\vt\VirtualTreesD4.dpk' is marked read-only.

Any ideas to what I can do to make it work?

Thanks
Nikolaj


How can I speed up painting?

From: Brett Fleming [bfleming@r...]
Date: Wed Jan 23, 2002 7:11 pm
Subject: How can I speed up painting?

I am finishing up a project using VST and things were running a bit slow. At
first we thought it was our command parsers, but after hiding the VST things
got extremely faster, down from minutes to 20 seconds. We are using the VST
as a grid, and do notice that there are a lot of GetText queries as a result
of getting column information. These requests are made about 3 to 4 times
per cell paint. Could this be the source of the slow painting?

Thanks.

 | Replies | Author | Date
5214 | Re: How can I speed up painting? | Werner Lehmann | Wed 1/23/2002
5215 | Re: How can I speed up painting? | Helge Jung (ECO-Logic) | Wed 1/23/2002
5216 | Re: How can I speed up painting? | Brett Fleming | Wed 1/23/2002
5217 | Re: How can I speed up painting? | Werner Lehmann | Wed 1/23/2002
5219 | Re: How can I speed up painting? | Brett Fleming | Wed 1/23/2002
5220 | Re: How can I speed up painting? | Daniel Rail | Wed 1/23/2002
5225 | Re: How can I speed up painting? | Werner Lehmann | Thu 1/24/2002


re: How can I speed up painting?

From: Werner Lehmann [wl@b...]
Date: Wed Jan 23, 2002 7:39 pm
Subject: Re: [VirtualTreeview] How can I speed up painting?

Brett Fleming wrote:
>
> I am finishing up a project using VST and things were running a bit slow. At
> first we thought it was our command parsers, but after hiding the VST things
> got extremely faster, down from minutes to 20 seconds. We are using the VST
> as a grid, and do notice that there are a lot of GetText queries as a result
> of getting column information. These requests are made about 3 to 4 times
> per cell paint. Could this be the source of the slow painting?

Are there unnecessary Invalidates or InvalidateNode's on the VST? Are you
caching your node texts or do they have to be retrieved by some lengthy routine
each time?

Werner

 | Replies | Author | Date
5215 | Re: How can I speed up painting? | Helge Jung (ECO-Logic) | Wed 1/23/2002


re: How can I speed up painting?

From: "Helge Jung \(ECO-Logic\)" [helge@e...]
Date: Wed Jan 23, 2002 7:44 pm
Subject: RE: [VirtualTreeview] How can I speed up painting?

> Are there unnecessary Invalidates or InvalidateNode's on the VST? Are you
> caching your node texts or do they have to be retrieved by some
> lengthy routine each time?
>
Another thought: Maybe you don't use BeginUpdate and EndUpdate when updating
your tree(s)?

Helge.


re: How can I speed up painting?

From: Brett Fleming [bfleming@r...]
Date: Wed Jan 23, 2002 8:00 pm
Subject: RE: [VirtualTreeview] How can I speed up painting?

The slowest part seems to be inserting rows. What we do on an insert is
increment the RootNodeCount. Then we respond to GetText events. Here is my
latest finding. The grid has 7 columns. This first insertion in an empty
grid causes 14 GetText calls. The second insert causes 28 GetText calls...
The third causes 42, the fourth causes 56, and onwards. Why would the grid
ask for all the previous rows data if it were not drawing them on every
insertion?

> -----Original Message-----
> From: Werner Lehmann [mailto:[wl@b...]]
> Sent: Wednesday, January 23, 2002 2:39 PM
> To: VirtualTreeview@yahoogroups.com
> Subject: Re: [VirtualTreeview] How can I speed up painting?
>
>
> Brett Fleming wrote:
> >
> > I am finishing up a project using VST and things were
> running a bit slow. At
> > first we thought it was our command parsers, but after
> hiding the VST things
> > got extremely faster, down from minutes to 20 seconds. We
> are using the VST
> > as a grid, and do notice that there are a lot of GetText
> queries as a result
> > of getting column information. These requests are made
> about 3 to 4 times
> > per cell paint. Could this be the source of the slow painting?
>
> Are there unnecessary Invalidates or InvalidateNode's on the
> VST? Are you
> caching your node texts or do they have to be retrieved by
> some lengthy routine
> each time?
>
> Werner
>
> ------------------------ Yahoo! Groups Sponsor
> ---------------------~-->
> Sponsored by VeriSign - The Value of Trust
> Pinpoint the right security solution for your company - FREE
> Guide from industry leader VeriSign gives you all the facts.
> http://us.click.yahoo.com/lWSNbC/WdiDAA/yigFAA/i7folB/TM
> --------------------------------------------------------------
> -------~->
>
> To unsubscribe from this group, send an email to:
> VirtualTreeview-unsubscribe@egroups.com
>
>
>
> Your use of Yahoo! Groups is subject to
http://docs.yahoo.com/info/terms/


re: How can I speed up painting?

From: Werner Lehmann [wl@b...]
Date: Wed Jan 23, 2002 8:20 pm
Subject: Re: [VirtualTreeview] How can I speed up painting?

Brett Fleming wrote:
>
> The slowest part seems to be inserting rows. What we do on an insert is
> increment the RootNodeCount. Then we respond to GetText events. Here is my
> latest finding. The grid has 7 columns. This first insertion in an empty
> grid causes 14 GetText calls. The second insert causes 28 GetText calls...
> The third causes 42, the fourth causes 56, and onwards. Why would the grid
> ask for all the previous rows data if it were not drawing them on every
> insertion?

Sounds as if you were doing inserts at the top. AFAIK the VST is drawing
everything below the inserted node again (InvalidateToBottom). OTOH you
say that you are only modifying the RootNodeCount. But you can't do an
insert with this - except if you constantly invalidate all nodes below the
'inserted' one (concept: node data is not used, node.index is used to access
the node data).

So: are you using the node data "properly"? are you using InsertNode or
RootNodeCount? And if you do more inserts at once BeginUpdate/EndUpdate can
delay the repaint until the last node in inserted (as Helge wrote).

Werner


re: Ghost Drag Image

From: "Mike Lischke" [lists@l...]
Date: Wed Jan 23, 2002 8:42 pm
Subject: RE: [VirtualTreeview] Ghost Drag Image

Hi Jim,

I took first a bit time to twist my brain to actually understand what is going
on but after that I
found that you did not only precisely find the reason for trouble but also the
best solution IMO.

> 1) How to I make VT clear the toOLEDragPending flag (maybe VT should
> clear it once it sees a WM_CONTEXTMENU message since a drag should
> not take place if the mouse button was for a context menu)

As you see this handler already cancels two other pending states (for good
reasons). I have not
thought about dragging though. I will include the exclusion :-) for the pending
drag operation there
too. Thank you!

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: How can I speed up painting?

From: Brett Fleming [bfleming@r...]
Date: Wed Jan 23, 2002 8:43 pm
Subject: RE: [VirtualTreeview] How can I speed up painting?

Nope, we're doing insert on the bottom (appends). I tried using
InsertNode(nil, amAddChildLast) instead of modifiying RootNodeCount and it
does the same thing. Adding a new item to the bottom repaints the entire
grid, placing a breakpoint inside of GetText will show that this is true.
Unfortunately I can't call begin/end update because rows are added via a
user script in most cases. The script it self is extremely fast as I noted
in my first email. Hiding the grid took the operation from 2.75 minutes down
to 21 seconds.

> -----Original Message-----
> From: Werner Lehmann [mailto:[wl@b...]]
> Sent: Wednesday, January 23, 2002 3:21 PM
> To: VirtualTreeview@yahoogroups.com
> Subject: Re: [VirtualTreeview] How can I speed up painting?
>
>
> Brett Fleming wrote:
> >
> > The slowest part seems to be inserting rows. What we do on
> an insert is
> > increment the RootNodeCount. Then we respond to GetText
> events. Here is my
> > latest finding. The grid has 7 columns. This first
> insertion in an empty
> > grid causes 14 GetText calls. The second insert causes 28
> GetText calls...
> > The third causes 42, the fourth causes 56, and onwards. Why
> would the grid
> > ask for all the previous rows data if it were not drawing
> them on every
> > insertion?
>
> Sounds as if you were doing inserts at the top. AFAIK the VST
> is drawing
> everything below the inserted node again
> (InvalidateToBottom). OTOH you
> say that you are only modifying the RootNodeCount. But you can't do an
> insert with this - except if you constantly invalidate all
> nodes below the
> 'inserted' one (concept: node data is not used, node.index is
> used to access
> the node data).
>
> So: are you using the node data "properly"? are you using
> InsertNode or
> RootNodeCount? And if you do more inserts at once
> BeginUpdate/EndUpdate can
> delay the repaint until the last node in inserted (as Helge wrote).
>
> Werner
>
> ------------------------ Yahoo! Groups Sponsor
> ---------------------~-->
> Sponsored by VeriSign - The Value of Trust
> Secure all your Web servers now - with a proven 5-part
> strategy. The FREE Server Security Guide shows you how.
> http://us.click.yahoo.com/iWSNbC/VdiDAA/yigFAA/i7folB/TM
> --------------------------------------------------------------
> -------~->
>
> To unsubscribe from this group, send an email to:
> VirtualTreeview-unsubscribe@egroups.com
>
>
>
> Your use of Yahoo! Groups is subject to
> http://docs.yahoo.com/info/terms/
>
>

 | Replies | Author | Date
5220 | Re: How can I speed up painting? | Daniel Rail | Wed 1/23/2002


re: How can I speed up painting?

From: Daniel Rail [drail@n...]
Date: Wed Jan 23, 2002 8:53 pm
Subject: RE: [VirtualTreeview] How can I speed up painting?

Did you try:

BeginUpdate;
...
User Script and whatever other code needs to be here;
...
EndUpdate;

Daniel Rail
Senior System Engineer
ACCRA Med Software Inc. (www.accramed.ca)

At 23/01/2002 04:43 PM, you wrote:
>Nope, we're doing insert on the bottom (appends). I tried using
>InsertNode(nil, amAddChildLast) instead of modifiying RootNodeCount and it
>does the same thing. Adding a new item to the bottom repaints the entire
>grid, placing a breakpoint inside of GetText will show that this is true.
>Unfortunately I can't call begin/end update because rows are added via a
>user script in most cases. The script it self is extremely fast as I noted
>in my first email. Hiding the grid took the operation from 2.75 minutes down
>to 21 seconds.


Installing in Delphi 4

From: "njlo555" [njlo555@h...]
Date: Wed Jan 23, 2002 10:52 pm
Subject: Installing in Delphi 4

Hi guys!

After reading a bit more, it sounds like this is the way to do it:

1. Compile VirtualTreesD4.dpk
2. Install VirtualTreesD4D.dpk

Step 1 goes fine... But step 2 gives this message:
[Error] Never-build package 'VirtualTreesD4D' requires always-build
package 'VirtualTreesD4'

Any hints will much appreciated

Nikolaj

 | Replies | Author | Date
5222 | Re: Installing in Delphi 4 | Justin Stenning | Wed 1/23/2002
5227 | Re: Installing in Delphi 4 | njlo555 | Thu 1/24/2002
5230 | Re: Installing in Delphi 4 | Werner Lehmann | Thu 1/24/2002
5235 | Re: Installing in Delphi 4 | Vandrovec Milan | Fri 1/25/2002
5255 | Re: Installing in Delphi 4 | Peter Evans | Tue 1/29/2002


re: Installing in Delphi 4

From: "Justin Stenning" [jstenning@e...]
Date: Wed Jan 23, 2002 11:04 pm
Subject: Re: [VirtualTreeview] Installing in Delphi 4

> After reading a bit more, it sounds like this is the way to do it:
>
> 1. Compile VirtualTreesD4.dpk
> 2. Install VirtualTreesD4D.dpk
>
> Step 1 goes fine... But step 2 gives this message:
> [Error] Never-build package 'VirtualTreesD4D' requires always-build
> package 'VirtualTreesD4'

Hi Nikolaj

You need to change the options for VirtualTreesD4D package so that it
"Builds on demand" rather than "Never build". So open the
VirtualTreesD4D.dpk and click the Options... the main tab I think has the
build options on it.

Justin

 | Replies | Author | Date
5227 | Re: Installing in Delphi 4 | njlo555 | Thu 1/24/2002


Problem: Resource DLL Wizard with Virtual Tree View

From: "peperu39" [peperu39@y...]
Date: Thu Jan 24, 2002 5:03 am
Subject: Problem: Resource DLL Wizard with Virtual Tree View

Hi, my name is SangGu, a Korean.
I can't speak English very well, so please regard my poor English.

I'm working with TVirtualStringTree version 3.0.4 under C++ Builder
5.
My application supports multi language(English, Korean, Japanese) and
I'm using Resource DLL Wizard.
Recently, I have replaced all the TListView controls of my app to
the TVirtualStringTree, I found some problems.
All Header->Columns informations were droped..
The properties of TVTHeader is not saved to the new resource dfm
file. Text, Width, ... etc

So, I tried testing under Delphi 6, Resource DLL Wizard makes an
error this time.
The error:

ObjectTextToResource failed: "=" expected on line 23
- File saved: c:\dev\delphi6\Projects\KOR\Unit1.ERR_DFM

I have tested folling steps.

1. Insert a TVirtualStringTree to an empty form
2. Add tree columns to the Header property. (by double clicking the
control)
3. Set Text property of each TVTHeader to "Province", "Zipcode"
and "Range".
4. Set Width property of each TVTHeader to 150, 75, 100
5. Save
6. Run
7. File-New-Others Resource DLL Wizard
8. Next..Next..Select Korean Language...Next...Finish
Error Occurs..
9. If I try to open a Form1 unit from the newly created
project 'Project1.KOR', I get "Invalid stream format" error message.

In C++ Builder 5, there is no error message, but all properties of
TVTHeader is set to default values.. Width = 50, Text = "" etc

I think it is a bug of the VirtualTree control, and in Western.. it
may be a small problem, but in Eastern.. it may be a big problem.

I hope to solve this problem quickly...
Please help me~~~

peperu (peperu is my nick. my name is Kim, Sang Gu.. Kim is my last
name)

PS.. It is hard for me to write in English.. (^_^)


re: [VirtualExplorerTree] Problem: Resource DLL Wizard withVirtualTree

From: "peperu39" [peperu39@y...]
Date: Thu Jan 24, 2002 5:08 am
Subject: Re: [VirtualExplorerTree] Problem: Resource DLL Wizard withVirtualTree

Thank you for your attension..
But.. to currect this problem manually, there are so many controls
and Whenever I change original design, I should do this eachtime.

peperu

--- In [VirtualTreeview@y...], Werner Lehmann [wl@b...] wrote:
> "peperu39 (by way of Jim Kueneman )" wrote:
> >
> > ObjectTextToResource failed: "=" expected on line 23
> > - File saved: c:\dev\delphi6\Projects\KOR\Unit1.ERR_DFM
>
> I can reproduce the error. Somehow the DFM in the new KOR project
which is created
> by the wizard is messed up. It differs from the original DFM.
Indentation is missing
> or is less than in the original DFM. And the header properties is
completely nuts:
>
> Original DFM (works):
>
> Header.Columns = <
> item
> Alignment = taLeftJustify
> ImageIndex = -1
> Layout = blGlyphLeft
> Position = 0
> Width = 150
> WideText = 'Province'
> end
> item
> Alignment = taLeftJustify
> ImageIndex = -1
> Layout = blGlyphLeft
> Position = 1
> Width = 75
> WideText = 'Zipcode'
> end
> item
> Alignment = taLeftJustify
> ImageIndex = -1
> Layout = blGlyphLeft
> Position = 2
> Width = 100
> WideText = 'Range'
> end>
>
> Wizard created DFM (does not work):
>
> Header Columns= <item Alignment = taLeftJustify
> ImageIndex = -1
> Layout = blGlyphLeft
> Position = 0
> Width = 150
> WideText = 'Province' end
> item Alignment = taLeftJustify
> ImageIndex = -1
> Layout = blGlyphLeft
> Position = 1
> Width = 75
> WideText = 'Zipcode' end
> item Alignment = taLeftJustify
> ImageIndex = -1
> Layout = blGlyphLeft
> Position = 2
> Width = 100
> WideText = 'Range' end>
>
> The differences are obvious. You can fix (replace) this manually
of course but this
> does not help you much probably. The problem is probably the
WideString property
> which is stored as WideText and written with WriteWideString.
Somehow this is not
> handled correctly but I don't know much (not enough) about Unicode
<-> DFM compatibility
> to help you out.
>
> Regards,
> Werner


re: How can I speed up painting?

From: Werner Lehmann [wl@b...]
Date: Thu Jan 24, 2002 11:34 am
Subject: Re: [VirtualTreeview] How can I speed up painting?

Brett Fleming wrote:
>
> Nope, we're doing insert on the bottom (appends). I tried using
> InsertNode(nil, amAddChildLast) instead of modifiying RootNodeCount and it
> does the same thing. Adding a new item to the bottom repaints the entire
> grid, placing a breakpoint inside of GetText will show that this is true.
> Unfortunately I can't call begin/end update because rows are added via a
> user script in most cases. The script it self is extremely fast as I noted
> in my first email. Hiding the grid took the operation from 2.75 minutes down
> to 21 seconds.

Ok. I can reproduce the behaviour in a test project. Here is the reason
for the problem. If you use AddChild(nil) the VTree will execute

InvalidateToBottom(Parent);

eventually with Parent = nil. This repaints the whole client area of course.
OTOH, if you increase RootNodeCount the VTree will do BeginUpdate/EndUpdate
implicitly. And the EndUpdate will again invalidate the whole client area.

Invalidation leads to repaint, repaint leads to OnGetText for each visible
node. I am not sure why and if this is really necessary to this extent. Hope-
fully Mike can comment on it. I have attached my test project to this posting
and CC'ed it to the newsgroup (attachments are removed from postings to the
mailing list).

Regards,
Werner

[Non-text portions of this message have been removed]


Re[2]: How can I speed up painting?

From: "Ralph Sickinger (R2)" [ralph@s...]
Date: Thu Jan 24, 2002 1:10 pm
Subject: Re[2]: [VirtualTreeview] How can I speed up painting?

What happens if you find the last child of the root, and use
insertNode(...,amInsertAfter)?

Ralph S.

================================================================
from: Werner Lehmann (01/24/2002 12:34)
================================================================
Brett Fleming wrote:
>
> Nope, we're doing insert on the bottom (appends). I tried using
> InsertNode(nil, amAddChildLast) instead of modifiying RootNodeCount and it
> does the same thing. Adding a new item to the bottom repaints the entire
> grid, placing a breakpoint inside of GetText will show that this is true.
> Unfortunately I can't call begin/end update because rows are added via a
> user script in most cases. The script it self is extremely fast as I noted
> in my first email. Hiding the grid took the operation from 2.75
minutes down
> to 21 seconds.

Ok. I can reproduce the behaviour in a test project. Here is the reason
for the problem. If you use AddChild(nil) the VTree will execute

InvalidateToBottom(Parent);

eventually with Parent = nil. This repaints the whole client area of course.
OTOH, if you increase RootNodeCount the VTree will do BeginUpdate/EndUpdate
implicitly. And the EndUpdate will again invalidate the whole client area.

Invalidation leads to repaint, repaint leads to OnGetText for each visible
node. I am not sure why and if this is really necessary to this extent.
Hope-
fully Mike can comment on it. I have attached my test project to this
posting
and CC'ed it to the newsgroup (attachments are removed from postings to the
mailing list).

Regards,
Werner

[Non-text portions of this message have been removed]

Yahoo! Groups Sponsor

To unsubscribe from this group, send an email to:
VirtualTreeview-unsubscribe@egroups.com

Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.

 | Replies | Author | Date
5236 | Re: Re[2]: [VirtualTreeview] How can I speed up p | Brett Fleming | Fri 1/25/2002


re: Installing in Delphi 4

From: "njlo555" [njlo555@h...]
Date: Thu Jan 24, 2002 6:32 pm
Subject: Re: Installing in Delphi 4

--- In [VirtualTreeview@y...], "Justin Stenning" [jstenning@e...] wrote:
> > 1. Compile VirtualTreesD4.dpk
> > 2. Install VirtualTreesD4D.dpk
> >
> > Step 1 goes fine... But step 2 gives this message:
> > [Error] Never-build package 'VirtualTreesD4D' requires always-
build
> > package 'VirtualTreesD4'
> You need to change the options for VirtualTreesD4D package so that
it
> "Builds on demand" rather than "Never build".

Thanks, now I just get the "Access violation at address 0086A927 in
module 'dcc40.dll'. Read of address 02bF1000.

After reinstalling delphi 3 times (I do not need to look at the
serial any more) - and still no Virtual Trees - I'm going nuts!

Any ideas?

Nikolaj


VT Addons 3.0.4

From: "gtmacgregor141" [gtm@o...]
Date: Thu Jan 24, 2002 6:39 pm
Subject: VT Addons 3.0.4

Hi All,

I am just installing the latest virtualtree from the site. Not sure
what version it is. I got the VT_Addons_3.0.4 from YG. I installed
the VT no problem. When I try to install the Addons I get link
errors:

[Linker Error] Unresolved external '__fastcall
Virtualtrees::TCustomVirtualStringTree::CreateEditor
(Virtualtrees::TVirtualNode *, int)' referenced from F:\PROGRAM
FILES\BORLAND\CBUILDER5\PROJECTS\INTERMED\VIRTUALTREESEX.OBJ

And others.

Has anyone seen this before?

Thanks

Glenn

 | Replies | Author | Date
5229 | Re: VT Addons 3.0.4 | Richter, Len | Thu 1/24/2002
5234 | Re: VT Addons 3.0.4 | Vandrovec Milan | Fri 1/25/2002


re: VT Addons 3.0.4

From: "Richter, Len" [len@c...]
Date: Thu Jan 24, 2002 6:52 pm
Subject: RE: [VirtualTreeview] VT Addons 3.0.4

I curious where you got these addons from?

Len

-----Original Message-----
From: gtmacgregor141 [mailto:[gtm@o...]]
Sent: Thursday, January 24, 2002 11:39 AM
To: VirtualTreeview@yahoogroups.com
Subject: [VirtualTreeview] VT Addons 3.0.4

Hi All,

I am just installing the latest virtualtree from the site. Not sure
what version it is. I got the VT_Addons_3.0.4 from YG. I installed
the VT no problem. When I try to install the Addons I get link
errors:

[Linker Error] Unresolved external '__fastcall
Virtualtrees::TCustomVirtualStringTree::CreateEditor
(Virtualtrees::TVirtualNode *, int)' referenced from F:\PROGRAM
FILES\BORLAND\CBUILDER5\PROJECTS\INTERMED\VIRTUALTREESEX.OBJ

And others.

Has anyone seen this before?

Thanks

Glenn

To unsubscribe from this group, send an email to:
VirtualTreeview-unsubscribe@egroups.com

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/


re: Re: Installing in Delphi 4

From: Werner Lehmann [wl@b...]
Date: Thu Jan 24, 2002 7:28 pm
Subject: Re: [VirtualTreeview] Re: Installing in Delphi 4

njlo555 wrote:
>
> Thanks, now I just get the "Access violation at address 0086A927 in
> module 'dcc40.dll'. Read of address 02bF1000.

Are you sure that no rogue bpls are lurking somewhere? %WINDIR%\system32
and %DELPHI%\Projects\BPL are nice habitats for those. Search for any
*.bpl on each local drive and get rid of anything old.

Werner


Replacing + with my own image

From: "Glenn MacGregor" [gtm@o...]
Date: Thu Jan 24, 2002 8:05 pm
Subject: Replacing + with my own image

Hi Again,

I want to replace the regular wings +, - on the tree with my own image. Is
this possible, if so can you point me the in the right direction?

Thanks

Glenn

[Non-text portions of this message have been removed]

 | Replies | Author | Date
5232 | Re: Replacing + with my own image | Jim Kueneman | Fri 1/25/2002


re: Replacing + with my own image

From: Jim Kueneman [jimdk@m...]
Date: Fri Jan 25, 2002 1:48 am
Subject: Re: [VirtualTreeview] Replacing + with my own image

At 03:05 PM 1/24/2002 -0500, you wrote:
>Hi Again,
>
>I want to replace the regular wings +, - on the tree with my own
>image. Is this possible, if so can you point me the in the right direction?

Only if you use the draw tree and do *all* the drawing yourself.

Jim


BevelInner etc does not seem to work...

From: "Dion" [dion@n...]
Date: Fri Jan 25, 2002 6:06 am
Subject: BevelInner etc does not seem to work...

Hi Folks,

How do you set the border settings of BevelInner etc. Does not seem to be
effective at design or run time.

Regards,
Dion.

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.314 / Virus Database: 175 - Release Date: 01/11/2002

 | Replies | Author | Date
5257 | Re: BevelInner etc does not seem to work... | Mike Lischke | Tue 1/29/2002


re: VT Addons 3.0.4

From: Vandrovec Milan [milan_va@s...]
Date: Fri Jan 25, 2002 9:11 am
Subject: RE: [VirtualTreeview] VT Addons 3.0.4

Hello.

> When I try to install the Addons I get link
> errors:
>
> [Linker Error] Unresolved external '__fastcall
> Virtualtrees::TCustomVirtualStringTree::CreateEditor
> (Virtualtrees::TVirtualNode *, int)' referenced from F:\PROGRAM
> FILES\BORLAND\CBUILDER5\PROJECTS\INTERMED\VIRTUALTREESEX.OBJ
>
> And others.

I have no problems. I believe this is related to that Mike has renamed
CreateEditor to DoCreateEditor a few versions ago.

> Has anyone seen this before?

Someone had the same problem in Delphi and solved it by deleting old *.dcus
(and *.objs for CBuilder) and rebuilding them.
I believe that running the clearVT.bat and rebuilding both packages will fix
it.

Milan Vandrovec

P.S. for Len:
http://groups.yahoo.com/group/VirtualTreeview/files/Examples/BCB_Examples/Co
mpatibility/VT_Addons_3_0_4.zip (works with Delphi 5 and 6 as well)

P.S. for all: Has anybody written a custom editor looking as a checkbox for
VSTEdit?


re: Re: Installing in Delphi 4

From: Vandrovec Milan [milan_va@s...]
Date: Fri Jan 25, 2002 9:23 am
Subject: RE: [VirtualTreeview] Re: Installing in Delphi 4

> Thanks, now I just get the "Access violation at address 0086A927 in
> module 'dcc40.dll'. Read of address 02bF1000.

> Any ideas?

Try writing debug info to a file during 'initialization' of VirtualTrees.pas
(and all other, if any). You cannot show a MessageBox during component
initialization (cannot remember why, but I'm pretty sure). For the start,
add line
ClearDebug; WriteDebug('init start');
right after the 'initialization' line (at the end of VirtualTrees.pas) and
WriteDebug('init end');
right before the 'finalization' line.
If the file 'c:\vtinst.log' contains only the first line, we have won - you
only need to narrow the interval by adding more WriteDebug's throughout the
code.

Milan Vandrovec

procedure ClearDebug;
var h: THandle;
begin
h:=CreateFile(PChar('c:\vtinst.log'),
GENERIC_WRITE,
FILE_SHARE_READ,
nil,
CREATE_ALWAYS,
0,
0);
if (h<>INVALID_HANDLE_VALUE) then
begin
CloseHandle(h);
WriteDebug(DateTimeToStr(Now));
WriteDebug('');
WriteDebug('-----------------------------------');
WriteDebug('');
end;
end;

procedure WriteDebug(line: String);
var h: THandle;
written: DWORD;
begin
h:=CreateFile(PChar('c:\vtinst.log'),
GENERIC_WRITE,
FILE_SHARE_READ,
nil,
OPEN_EXISTING,
0,
0);
if (h<>INVALID_HANDLE_VALUE) then
begin
SetFilePointer(h, 0, nil, FILE_END);
WriteFile(h, PChar(line+#13#10)^, Length(line)+2, written, nil);
CloseHandle(h);
end;
end;


re: Re[2]: How can I speed up painting?

From: Brett Fleming [bfleming@r...]
Date: Fri Jan 25, 2002 3:04 pm
Subject: RE: Re[2]: [VirtualTreeview] How can I speed up painting?

Doesn't seem to help. But not that VST is at a stable 3.0 i feel much better
about digging into the code and modifying it. Will keep you informed if I
find a way to speed this up.

> -----Original Message-----
> From: Ralph Sickinger (R2) [mailto:[ralph@s...]]
> Sent: Thursday, January 24, 2002 8:11 AM
> To: Werner Lehmann (Reply)
> Subject: Re[2]: [VirtualTreeview] How can I speed up painting?
>
>
> What happens if you find the last child of the root, and use
> insertNode(...,amInsertAfter)?
>
> Ralph S.
>
> ================================================================
> from: Werner Lehmann (01/24/2002 12:34)
> ================================================================
> Brett Fleming wrote:
> >
> > Nope, we're doing insert on the bottom (appends). I tried using
> > InsertNode(nil, amAddChildLast) instead of modifiying
> RootNodeCount and it
> > does the same thing. Adding a new item to the bottom
> repaints the entire
> > grid, placing a breakpoint inside of GetText will show that
> this is true.
> > Unfortunately I can't call begin/end update because rows
> are added via a
> > user script in most cases. The script it self is extremely
> fast as I noted
> > in my first email. Hiding the grid took the operation from 2.75
> minutes down
> > to 21 seconds.
>
> Ok. I can reproduce the behaviour in a test project. Here is
> the reason
> for the problem. If you use AddChild(nil) the VTree will execute
>
> InvalidateToBottom(Parent);
>
> eventually with Parent = nil. This repaints the whole client
> area of course.
> OTOH, if you increase RootNodeCount the VTree will do
> BeginUpdate/EndUpdate
> implicitly. And the EndUpdate will again invalidate the whole
> client area.
>
> Invalidation leads to repaint, repaint leads to OnGetText for
> each visible
> node. I am not sure why and if this is really necessary to
> this extent.
> Hope-
> fully Mike can comment on it. I have attached my test project to this
> posting
> and CC'ed it to the newsgroup (attachments are removed from
> postings to the
> mailing list).
>
> Regards,
> Werner
>
> [Non-text portions of this message have been removed]
>
>
> Yahoo! Groups Sponsor
>
>
>
>
> To unsubscribe from this group, send an email to:
> VirtualTreeview-unsubscribe@egroups.com
>
>
>
> Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
>
>
>
> ------------------------ Yahoo! Groups Sponsor
> ---------------------~-->
> Sponsored by VeriSign - The Value of Trust
> Pinpoint the right security solution for your company - FREE
> Guide from industry leader VeriSign gives you all the facts.
> http://us.click.yahoo.com/lWSNbC/WdiDAA/yigFAA/i7folB/TM
> --------------------------------------------------------------
> -------~->
>
> To unsubscribe from this group, send an email to:
> VirtualTreeview-unsubscribe@egroups.com
>
>
>
> Your use of Yahoo! Groups is subject to
> http://docs.yahoo.com/info/terms/
>
>


OnBeforeCellPaint Problem

From: "Glenn MacGregor" [gtm@o...]
Date: Fri Jan 25, 2002 4:53 pm
Subject: OnBeforeCellPaint Problem

Hi All,

I have virtaultreeview 3.0.4 running on BCB. I want to change the color =
of some cells, anything that has a child in the tree. I am using the =
onBeforeCellPaint callback. In there I put Canvas->Brush->Color =3D =
clBlack;
Canvas->FillRect(CellRect);

All the cells are still white background.

Thanks

Glenn

[Non-text portions of this message have been removed]

 | Replies | Author | Date
5238 | Re: OnBeforeCellPaint Problem | Brett Fleming | Fri 1/25/2002
5239 | Re: OnBeforeCellPaint Problem | Glenn MacGregor | Fri 1/25/2002
5240 | Re: OnBeforeCellPaint Problem | Brett Fleming | Fri 1/25/2002


re: OnBeforeCellPaint Problem

From: Brett Fleming [bfleming@r...]
Date: Fri Jan 25, 2002 4:57 pm
Subject: RE: [VirtualTreeview] OnBeforeCellPaint Problem

Confirmed. This seems to be either a bug, or a change in how things should
work. An app that modifies the colors was working up until 3.0.4 which I
just now checked. BTW it will draw if you drag the form off screen and then
back. So I recon you should be able to toss in an invalidate somewhere, but
NOT inside OnBeforeCellPaint.

> -----Original Message-----
> From: Glenn MacGregor [mailto:[gtm@o...]]
> Sent: Friday, January 25, 2002 11:54 AM
> To: virtualtreeview@yahoogroups.com
> Subject: [VirtualTreeview] OnBeforeCellPaint Problem
>
>
> Hi All,
>
> I have virtaultreeview 3.0.4 running on BCB. I want to
> change the color =
> of some cells, anything that has a child in the tree. I am
> using the =
> onBeforeCellPaint callback. In there I put Canvas->Brush->Color =3D =
> clBlack;
> Canvas->FillRect(CellRect);
>
> All the cells are still white background.
>
>
> Thanks
>
> Glenn
>
>
>
>
> [Non-text portions of this message have been removed]
>
>
> ------------------------ Yahoo! Groups Sponsor
> ---------------------~-->
> Sponsored by VeriSign - The Value of Trust
> Do you need to encrypt all your online transactions? Find
> the perfect solution in this FREE Guide from VeriSign.
> http://us.click.yahoo.com/jWSNbC/UdiDAA/yigFAA/i7folB/TM
> --------------------------------------------------------------
> -------~->
>
> To unsubscribe from this group, send an email to:
> VirtualTreeview-unsubscribe@egroups.com
>
>
>
> Your use of Yahoo! Groups is subject to
> http://docs.yahoo.com/info/terms/
>
>


re: OnBeforeCellPaint Problem

From: "Glenn MacGregor" [gtm@o...]
Date: Fri Jan 25, 2002 5:02 pm
Subject: Re: [VirtualTreeview] OnBeforeCellPaint Problem

Sorry,, Cockpit error. The CellPaint Function passes TargetCanvas in not
Canvas.
----- Original Message -----
From: Glenn MacGregor
To: virtualtreeview@yahoogroups.com
Sent: Friday, January 25, 2002 11:53 AM
Subject: [VirtualTreeview] OnBeforeCellPaint Problem

Hi All,

I have virtaultreeview 3.0.4 running on BCB. I want to change the color =
of some cells, anything that has a child in the tree. I am using the =
onBeforeCellPaint callback. In there I put Canvas->Brush->Color =3D =
clBlack;
Canvas->FillRect(CellRect);

All the cells are still white background.

Thanks

Glenn

[Non-text portions of this message have been removed]

Yahoo! Groups Sponsor

------------------------------------------------------------------------

To unsubscribe from this group, send an email to:
VirtualTreeview-unsubscribe@egroups.com

Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.

[Non-text portions of this message have been removed]


re: OnBeforeCellPaint Problem

From: Brett Fleming [bfleming@r...]
Date: Fri Jan 25, 2002 5:06 pm
Subject: RE: [VirtualTreeview] OnBeforeCellPaint Problem

Make that a me too! Crap! I retract my current confirmation. Apparently
while trying to track down the painting issue from a couple of days ago I
inadvertantly commented out a crucial invalidate inside my code :)

Fire in the hole!

> -----Original Message-----
> From: Glenn MacGregor [mailto:[gtm@o...]]
> Sent: Friday, January 25, 2002 12:03 PM
> To: VirtualTreeview@yahoogroups.com
> Subject: Re: [VirtualTreeview] OnBeforeCellPaint Problem
>
>
> Sorry,, Cockpit error. The CellPaint Function passes
> TargetCanvas in not Canvas.
> ----- Original Message -----
> From: Glenn MacGregor
> To: virtualtreeview@yahoogroups.com
> Sent: Friday, January 25, 2002 11:53 AM
> Subject: [VirtualTreeview] OnBeforeCellPaint Problem
>
>
> Hi All,
>
> I have virtaultreeview 3.0.4 running on BCB. I want to
> change the color =
> of some cells, anything that has a child in the tree. I am
> using the =
> onBeforeCellPaint callback. In there I put
> Canvas->Brush->Color =3D =
> clBlack;
> Canvas->FillRect(CellRect);
>
> All the cells are still white background.
>
>
> Thanks
>
> Glenn
>
>
>
>
> [Non-text portions of this message have been removed]
>
>
> Yahoo! Groups Sponsor
>
>
> --------------------------------------------------------------
> ----------
>
>
>
> To unsubscribe from this group, send an email to:
> VirtualTreeview-unsubscribe@egroups.com
>
>
>
> Your use of Yahoo! Groups is subject to the Yahoo! Terms of
> Service.
>
>
>
> [Non-text portions of this message have been removed]
>
>
> ------------------------ Yahoo! Groups Sponsor
> ---------------------~-->
> Sponsored by VeriSign - The Value of Trust
> When building an e-commerce site, you want to start with a
> secure foundation. Learn how with VeriSign's FREE Guide.
> http://us.click.yahoo.com/kWSNbC/XdiDAA/yigFAA/i7folB/TM
> --------------------------------------------------------------
> -------~->
>
> To unsubscribe from this group, send an email to:
> VirtualTreeview-unsubscribe@egroups.com
>
>
>
> Your use of Yahoo! Groups is subject to
> http://docs.yahoo.com/info/terms/
>
>


Scrollbar problems 3.0.4

From: "Glenn MacGregor" [gtm@o...]
Date: Fri Jan 25, 2002 6:49 pm
Subject: Scrollbar problems 3.0.4

Hi Again,

I have a tree view with two columns. The second column is my main column which
holds the tree. The first column is a selected icon column, just like the
advanced example. When I select an item in the tree an icon appers in the
first column on that row. When I implemented the two columns I now longer have
a horizontal scroll bar no matter how far off the screen the text goes.

Thanks

Glenn

[Non-text portions of this message have been removed]

 | Replies | Author | Date
5258 | Re: Scrollbar problems 3.0.4 | Mike Lischke | Tue 1/29/2002


Re[4]: How can I speed up painting?

From: "Ralph Sickinger (R2)" [ralph@s...]
Date: Fri Jan 25, 2002 7:53 pm
Subject: Re[4]: [VirtualTreeview] How can I speed up painting?

Brett,
I wrote a sample program that should be able to shed some light on the
problem; create a form containing the following:
1 virtualStringTree
1 label
1 memo
2 buttons

The code below assumes that all objects have their default names.
Modify the VST so that it has 6 columns (actually, doesn't matter how
many). I laid out my form so that the VST was roughly square
(400x400), in the upper left corner of the form. The memo was to the
right (same TOP value), and roughly 170x400. The label and the buttons
are at the bottom of the form. (This last is important, because you'll
generate onGetText events if the mouse moves across the nodes.) Button
1 will append a new row by incrementing RootNodeCount, which does
indeed invalidate the entire screen. Button 2 gets the node for the
last row, and uses InsertNode(node,amInsertAfter), which only
invalidates the last row. Try it and see for yourself!

Hope this helps,
Ralph S.

procedure TForm1.FormCreate(Sender: TObject);
begin
VirtualStringTree1.RootNodeCount:= 1;
end;

procedure TForm1.VirtualStringTree1GetText(Sender: TBaseVirtualTree;
Node: PVirtualNode; Column: Integer; TextType: TVSTTextType;
var CellText: WideString);
begin
cellText:= format('(%d,%d)',[node^.Index,column]);
memo1.Lines.add(cellText);
label1.tag:= label1.tag + 1;
label1.caption:= inttostr(label1.tag);
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
VirtualStringTree1.RootNodeCount:= VirtualStringTree1.RootNodeCount + 1;
end;

procedure TForm1.Button2Click(Sender: TObject);
var
node: PVirtualNode;
begin
node:= VirtualStringTree1.GetLastChild(nil);
VirtualStringTree1.InsertNode(node,amInsertAfter);
end;

procedure TForm1.Label1DblClick(Sender: TObject);
begin
label1.tag:= 0;
label1.caption:= '0';
memo1.lines.clear;
end;

Thanks,
Ralph

================================================================
from: Brett Fleming (01/25/2002 10:04)
================================================================
Doesn't seem to help. But not that VST is at a stable 3.0 i feel much better
about digging into the code and modifying it. Will keep you informed if I
find a way to speed this up.

> -----Original Message-----
> From: Ralph Sickinger (R2) [mailto:[ralph@s...]]
> Sent: Thursday, January 24, 2002 8:11 AM
> To: Werner Lehmann (Reply)
> Subject: Re[2]: [VirtualTreeview] How can I speed up painting?
>
>
> What happens if you find the last child of the root, and use
> insertNode(...,amInsertAfter)?
>
> Ralph S.
>


New file uploaded to VirtualTreeview

From: VirtualTreeview@yahoogroups.com
Date: Sat Jan 26, 2002 9:08 am
Subject: New file uploaded to VirtualTreeview

Hello,

This email message is a notification to let you know that
a file has been uploaded to the Files area of the VirtualTreeview
group.

File : /Examples/Delphi_Examples/Misc_Examples/ZipUnzipDemo.zip
Uploaded by : benadembaba [adembaba@e...]
Description : Fully working Zip & Unzip demo with source. (Includes Zip&Unzip
DLLs; compiles with VT 3.0.4)

You can access this file at the URL

http://groups.yahoo.com/group/VirtualTreeview/files/Examples/Delphi_Examples/Mis\
c_Examples/ZipUnzipDemo.zip

To learn more about file sharing for your group, please visit

http://help.yahoo.com/help/us/groups/files

Regards,

benadembaba [adembaba@e...]


re: Autospancolumns and RightJustify

From: "Mike Lischke" [lists@l...]
Date: Sun Jan 27, 2002 5:26 pm
Subject: RE: [VirtualTreeview] Autospancolumns and RightJustify

> IMO the right behaviour should be that for left aligned columns the
> spanning should look to the right for empty columns (as it is now) and
> for right aligned columns the spanning should go to the left.

This is the way it should work then, but this would require to switch the paint
order of columns on
demand. Columns are always drawn from left to right.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: Autospancolumns and RightJustify

From: Werner Lehmann [wl@b...]
Date: Sun Jan 27, 2002 5:47 pm
Subject: Re: [VirtualTreeview] Autospancolumns and RightJustify

Mike Lischke wrote:
>
> > IMO the right behaviour should be that for left aligned columns the
> > spanning should look to the right for empty columns (as it is now) and
> > for right aligned columns the spanning should go to the left.
>
> This is the way it should work then, but this would require to switch the
paint order of columns on
> demand. Columns are always drawn from left to right.

Yes. It probably means a two pass paint cycle.

(1) determine paint data incl. spanned cell rects
(2) painting

Well. I am not really needing it (and this wasn't my proposal btw).

Werner


re: No screenupdate after calling deleteNode method?

From: "Mike Lischke" [lists@l...]
Date: Sun Jan 27, 2002 8:00 pm
Subject: RE: [VirtualTreeview] No screenupdate after calling deleteNode method?

Hi Simon,

> After upgrading to v3.0, my VT does not get updated automatically
> after calling the deleteNode method. Earlier versions of VT did
> delete the deleted node visually by itself when the method was
> called. Is that on purpose or?

No, it is not on purpose but a little bug (concerns only nodes which are not
selected when they are
deleted). This problem is fixed now.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: (possible) bug in ContentToHTML

From: "Mike Lischke" [lists@l...]
Date: Sun Jan 27, 2002 8:07 pm
Subject: RE: [VirtualTreeview] (possible) bug in ContentToHTML

Hi Anders,

> When using ContentToHTML, I have some troubles when a node text contains the
´ symbol
> (for instance é , or just the ´symbol alone).
> ´ is converted to : Â´
> and
> é is converted to: Ã©

I guess you have saved the output into a html file, right? If so then write the
UTF-8 encoding
scheme together with the file. Otherwise ISO-8859-1 is assumed which will of
course not handle the
UTF-8 encoding right.

Btw: you entered bug #90 in the bug database, but I cannot reproduce this
problem. Can you send me a
small demo project?

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: Inplace editors

From: "Mike Lischke" [lists@l...]
Date: Sun Jan 27, 2002 8:41 pm
Subject: RE: [VirtualTreeview] Inplace editors

Hi avatopia,

> Can anyone give me a good example of InPlace editing? i do not mean
> the EditLinks and VST examples in the files area.

Why do you reject the examples which are supposed to show you how things work?
You ask for code here
which you can get from those sources. I know they do not cover everything but
what remains there is
mainly a matter of general Windows knowledge, not VT know how.

> i need to be able to edit like it was a grid. Cursoring up and down,

What is so difficult to forward the up/down keys to the owning tree?

> left and right.

Not possible without modifier keys, since the edit needs them to operate the
cursor.

>As well as left in the left column collapse the tree,
> right in the right column expand the tree. Up and down, navigate up
> and down, but not always begins the editor, since some cells are non-
> editable.

All a matter of message forwarding.

> * calling methods of the Tree from my edit link.

Keep the tree reference given in IVTEditLink.PrepareEdit in a private variable.
Then you can always
call the tree's methods and access its properties.

> * Subclassing the tree to get messages.

Same as with any other TWinControl: assign your own window procedure to
VT.WindowProc. Don't forget
to keep the old window procedure to forward all messages to and to restore it
before application
shutdown.

> * Subclassing my TEdit to get keydowns, keyups, presses.

Same as above. Additionally, you can also assign handlers to events like
Edit.OnKeyDown, since the
are not used by the application.

> * What method in the EditLink to reset internal state information so
> that calling EndEdit from inside the editor doesn't mangle it when
> i'm still running.

No special action necessary. Always call tree methods not edit link methods (to
avoid recursions).

> * What combination of tree methods and edit link methods to fake all
> the calls to end editing of one cell, and begin editing of the next
> cell, when i want to navigate left and right.

There are surely several possible ways to accomplish continous editing. What I
use is to have a
handler for focus change in the tree and call EditNode from there. The tree
will take care to stop
editing when you navigate in it.

> * Paging up and down.

What about forwarding the keys (VK_PRIOR, VK_NEXT) to the tree, let it focus
the new node (which
will end previous editing) and have the mentioned handler to restart editing?

> No examples handle cursor navigation around the tree properly.

What did you try? You disqualify all demos and I bet you have not tried the
grid emulation in the
Advanced demo. If you would have then you'd seen that key navigation works well
in VT (also in
extended/grid mode).

> The only of the Virtual Treeview (to me) was it's inplace editors.
> Without them, i may as well not use it.

Then you did a bad decision. Why don't you simply use TStringGrid? This control
has already
implemented all the things you need.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: MultiLines in VT

From: "Mike Lischke" [lists@l...]
Date: Sun Jan 27, 2002 8:47 pm
Subject: RE: [VirtualTreeview] MultiLines in VT

Hi Ven,

> I'm interesting for this feature - multiline in VT.
> Using this feature for showing very long string can be
> need, particularly in my project.

Currently you have to do this yourself (e.g. using owner draw in the string
tree). The main reason
is that text in nodes is vertical aligned which is difficult to accomplish with
multiline text.
Additionally, line breaking in Unicode is non-trivial.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: Refresh problem with ActiveX in MFC

From: "Mike Lischke" [lists@l...]
Date: Sun Jan 27, 2002 9:04 pm
Subject: RE: [VirtualTreeview] Refresh problem with ActiveX in MFC

Hi Justin,

> If the ActiveX control's host is a MFC / MS Visual C++ program, the main
> viewer's (owned by the ActiveX control) VT does not generally want to paint
> itself. I've tried calling refresh, update & invalidate without success - it
> is visible and enabled and has nodes, but OnBeforeItemPaint is not being
> called.

Mmh, this is very strange. Must have to do with message processing in ActiveX.
Have you already
looked through the VCL source code to see if there is some hint how to deal
with messages in
ActiveX? You also can try to use RedrawWindow with all miningfull flags instead
of Invalidate. I
found this API very useful to force windows to update itself.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net

 | Replies | Author | Date
5251 | Re: Refresh problem with ActiveX in MFC | Justin Turberville | Mon 1/28/2002


re: Refresh problem with ActiveX in MFC

From: "Justin Turberville" [justin@d...]
Date: Mon Jan 28, 2002 11:51 am
Subject: RE: [VirtualTreeview] Refresh problem with ActiveX in MFC

>> If the ActiveX control's host is a MFC / MS Visual C++ program, the main
>> viewer's (owned by the ActiveX control) VT does not generally want to
paint
>> itself. I've tried calling refresh, update & invalidate without success -
it
>> is visible and enabled and has nodes, but OnBeforeItemPaint is not being
>> called.

> Mmh, this is very strange. Must have to do with message processing in
>ActiveX. Have you already
> looked through the VCL source code to see if there is some hint how to
deal with messages in
> ActiveX? You also can try to use RedrawWindow with all miningfull flags
instead of Invalidate. I
> found this API very useful to force windows to update itself.

> Ciao, Mike

On doing a search through the VT source for RedrawWindow, it certainly seems
to be your favourate API call ;), but does not work here - maybe the windows
handle has to be recreated as its reference is being lost or something.
Anyway it is not serious as setting visible to false & true inside a
LockWindowUpdate block removes the flicker so it is probably not worth
spending time on finding a more elegant way of doing it.

regards
Justin


Shortened string

From: "Glenn MacGregor" [gtm@o...]
Date: Mon Jan 28, 2002 6:57 pm
Subject: Shortened string

Hi All,

This there a way to tell if the text shown for a node is shortened or not. I
want to have the hint be the text if it is shortened, but no hint if it is not
shortened.

Thanks

Glenn

[Non-text portions of this message have been removed]

 | Replies | Author | Date
5259 | Re: Shortened string | Mike Lischke | Tue 1/29/2002


re: Bug #90

From: "Anders Thomsen" [anders@t...]
Date: Mon Jan 28, 2002 9:07 pm
Subject: Re: [VirtualTreeview] Bug #90

>>Btw: you entered bug #90 in the bug database, but I cannot reproduce this
problem. Can you send me a
>>small demo project?

Hi Mike,

I'm sorry, I was wrong when reporting that error.

However, the "real" problem is:

I have a filter that uses selected nodes as a criteria. The filter procedure is
called by OnChage:

procedure TForm1.VTChange(Sender: TBaseVirtualTree; Node: PVirtualNode);
begin
if sender.Selected[Node] then
myFilterFunction
end

Since it's quite time consuming, I would like to only run it when a node is
selected, and not when it's deselected.
The problem occurs when selecting multiple nodes using the shift key. Then
onChange is not called with a (newly) selected node.

I hope I've made myself clear.

Cheers,
Anders Thomsen

[Non-text portions of this message have been removed]

 | Replies | Author | Date
5260 | Re: Bug #90 | Mike Lischke | Tue 1/29/2002


re: MultiLines in VT

From: "Peter Evans" [pgevans@m...]
Date: Tue Jan 29, 2002 3:50 am
Subject: Re: [VirtualTreeview] MultiLines in VT

> I'm interesting for this feature - multiline in VT.
> Using this feature for showing very long string can be
> need, particularly in my project.
>
> Maybe who works at this problem and have finished
> solution.
> I will be glad to see a part of source code.
>

I do not have a finished solution, but, the following thoughts.

If you work backwards from the component being able to display 250
characacters from a tool tip (or what ever its called).
So, split the String into strings of 250 characters.
For each string of 250 characters have a display row.
Have these rows as Child rows.
Hide the column that shows the Nodes.

Hope this helps.

Regards, Peter Evans


re: Re: Installing in Delphi 4

From: "Peter Evans" [pgevans@m...]
Date: Tue Jan 29, 2002 3:58 am
Subject: Re: [VirtualTreeview] Re: Installing in Delphi 4

This is what I did according to an earlier message of mine on 15Nov01. This
may solve your problem.

===============================
These are the steps I followed to install in Delphi 4.

1) remove any similar packages from Delphi IDE
2) rename any directories that contain old versions of Virtual Treeview.
3) copy 'VirtualTreeD4D.res' and rename it 'VirtualTreeD4.res'. Place in
same directory.
4) double click on file '~D4D.dpk'. This will run Delphi and the package
will
appear on screen.
5) Compile package by clicking the 'Compile' button.
6) Install package by clicking the 'Install' button. You should get the
message that 3 components have been registered.
7) Exit Delphi.
8) Run Delphi. If you get the message "Can't load package ...One of the
library files needed to run this application cannot be found..." Click Yes.
The message reappears. Click Yes.
You probably need to copy '~D4.dcp' and '~D4D.dcp' to 'c:\windows\system' or
whatever.
You may need to add browsing path to ::- dialog 'Environment Options', tab
'Library'.
9) The 3 components should be visible in Component Toolbar.
10) Exit Delphi. Run Delphi.
11) Are the 3 components still visible? If they are then Success.
If they are not then create a new project and place the 3 components on the
new form.Compile.
This should make the components "stick" to the Component Toolbar. Success.
======================

Regards, Peter Evans


Printing a tree to a Tmetacanvas

From: "wvd_vegt" [wvd_vegt@k...]
Date: Tue Jan 29, 2002 3:46 pm
Subject: Printing a tree to a Tmetacanvas

Hi

Does anyone have some delphi code to paint a vt to a TMetaCanvas?
I'm trying a printpreview with a preview dialog i wrote once (it has
pages in printer resolution i can paint onto).

The VT PaintTo method produces only stamp sized images in the wrong
place. The PaintTree method is private so i can't call that one (it
seemed the most logic choice).

-----------
Wim van der Vegt

 | Replies | Author | Date
5261 | Re: Printing a tree to a Tmetacanvas | Mike Lischke | Tue 1/29/2002
5264 | Re: Printing a tree to a Tmetacanvas | wvd_vegt | Wed 1/30/2002
5263 | Re: Printing a tree to a Tmetacanvas | GIANNAKOPOULOS KOSTAS | Wed 1/30/2002
5272 | Re: Printing a tree to a Tmetacanvas | Mike Lischke | Wed 1/30/2002
5274 | Re: Printing a tree to a Tmetacanvas | GIANNAKOPOULOS KOSTAS | Thu 1/31/2002


re: BevelInner etc does not seem to work...

From: "Mike Lischke" [lists@l...]
Date: Tue Jan 29, 2002 6:34 pm
Subject: RE: [VirtualTreeview] BevelInner etc does not seem to work...

Hi Dion,

> How do you set the border settings of BevelInner etc. Does not seem to be
> effective at design or run time.

You have also to set the BevelKind property to something else than bkNone.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: Scrollbar problems 3.0.4

From: "Mike Lischke" [lists@l...]
Date: Tue Jan 29, 2002 6:36 pm
Subject: RE: [VirtualTreeview] Scrollbar problems 3.0.4

Hi Glenn,

> I select an item in the tree an icon appers in the first column on that row.
When I
> implemented the two columns I now longer have a horizontal scroll bar no
matter how far
> off the screen the text goes.

The virtual size of VT (which defines the scrollbars) is determined either by
the largest entry in
view if no columns are defined or by the overall width of all visible columns
if there is at least
one.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: Shortened string

From: "Mike Lischke" [lists@l...]
Date: Tue Jan 29, 2002 7:49 pm
Subject: RE: [VirtualTreeview] Shortened string

Hi Glenn,

> This there a way to tell if the text shown for a node is shortened or not. I
want to
> have the hint be the text if it is shortened, but no hint if it is not
shortened.

Haven't you found tool tips or are you forced to use normal hints? Tool tips
are the way to go here,
normally. They are only displayed if the text of a node is not fully visible
(which also could be if
it is partially scrolled out).

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: Bug #90

From: "Mike Lischke" [lists@l...]
Date: Tue Jan 29, 2002 7:52 pm
Subject: RE: [VirtualTreeview] Bug #90

Hello Anders,

> The problem occurs when selecting multiple nodes using the shift key. Then
onChange is
> not called with a (newly) selected node.

Ah, now I understand. Indeed there is an accumulated change event in such cases
(for speed reasons)
so you won't come around some iteration (e.g. use IterateSubTree with selected
nodes only) to
recollect all selected nodes.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: Printing a tree to a Tmetacanvas

From: "Mike Lischke" [lists@l...]
Date: Tue Jan 29, 2002 8:02 pm
Subject: RE: [VirtualTreeview] Printing a tree to a Tmetacanvas

Hi Wim,

> The VT PaintTo method produces only stamp sized images in the wrong
> place. The PaintTree method is private so i can't call that one (it
> seemed the most logic choice).

Why in the hell has nobody told me that I still have PaintTree in the protected
section instead
making it public as it should be? Really stupid error I made here, sorry.

Btw: WM_PRINT would also have worked, but renders only the current client area
(as PrintTo does). In
opposition PaintTree renders everything. Tip: use viewport and window extens to
scale the result
implicitely (see SetViewportExtEx etc.).

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net

 | Replies | Author | Date
5264 | Re: Printing a tree to a Tmetacanvas | wvd_vegt | Wed 1/30/2002


Add-On CB5 code for creating your own MF Editor component or edit or link component

From: "Richter, Len" [len@c...]
Date: Wed Jan 30, 2002 2:56 am
Subject: Add-On CB5 code for creating your own MF Editor component or edit or link component

Does anyone have CB5 code for creating own MF Editor components? I want to
create just Glyph Button on the right side of the cell.

Len

[Non-text portions of this message have been removed]

 | Replies | Author | Date
5271 | Re: Add-On CB5 code for creating your own MF Edit | Mike Lischke | Wed 1/30/2002


re: Printing a tree to a Tmetacanvas

From: GIANNAKOPOULOS KOSTAS [kyan@s...]
Date: Wed Jan 30, 2002 9:10 am
Subject: RE: [VirtualTreeview] Printing a tree to a Tmetacanvas

> Btw: WM_PRINT would also have worked, but renders only the
> current client area (as PrintTo does).

Sorry to intervene, but this is not true according to MSDN. If you include
PRF_NONCLIENT in the message's LParam it will also paint the non-client
area. From looking at the code i see that Mike calls "inherited" which will
eventually pass the message to DefWindowProc which (unless it has a bug, i
didn't test it) will paint non-client area as well.

 | Replies | Author | Date
5272 | Re: Printing a tree to a Tmetacanvas | Mike Lischke | Wed 1/30/2002


re: Printing a tree to a Tmetacanvas

From: "wvd_vegt" [wvd_vegt@k...]
Date: Wed Jan 30, 2002 10:19 am
Subject: Re: Printing a tree to a Tmetacanvas

Hi Mike

Do you have some sample code. I'm terribly stuck on this topic ?

I created my TMetaFileCanvas with the printer as a reference device
so it's pretty huge (and it has a collection of pages). Anyhow it
works fine and allows me to draw in highres onto the printer
directly and show a preview of what will be printed.

BUT when i use PaintTree the output is very low-res (and i put it
mildly). It is approx the screen resulution but scaled to the
printer blowing up the pixelsize to almost a mm in square). If i use

VirtualStringTree2.PaintTree
(MetaCanvas,VirtualStringTree2.GetTreeRect,p,[poGridLines]);

to paint directly onto the metacanvas it generates the small stamp
size vt image.

When i use a GetTreeRect sized TPicture to render the VT on and
StretchDraw the TPicture onto the MetaCanvas i end up with a decent
sized but low-res preview.

The ExtEx routines you suggested don't seem to do very much. I also
noticed that the GetTreeRect returns a mich greated width that is
needed for a fully expanded tree. Besides that you didn't tell on
what to use them.

If you need the previewdlg for testing please let me know.

----------
Wim van der Vegt

--- In [VirtualTreeview@y...], "Mike Lischke" [lists@l...] wrote:
> Hi Wim,
>
> > The VT PaintTo method produces only stamp sized images in the
wrong
> > place. The PaintTree method is private so i can't call that one
(it
> > seemed the most logic choice).
>
> Why in the hell has nobody told me that I still have PaintTree in
the protected section instead
> making it public as it should be? Really stupid error I made here,
sorry.
>
> Btw: WM_PRINT would also have worked, but renders only the current
client area (as PrintTo does). In
> opposition PaintTree renders everything. Tip: use viewport and
window extens to scale the result
> implicitely (see SetViewportExtEx etc.).
>
> Ciao, Mike
> --
> www.lischke-online.de
> www.delphi-unicode.net


actually Node at MouseClick

From: "gbehnke2000" [Behnke@h...]
Date: Wed Jan 30, 2002 10:29 am
Subject: actually Node at MouseClick

Dear Members,

i work with BCB5 and my problem is to get the actually Node from the
MousePos e.g. MouseClick. Therefore
i use the following Code:

void __fastcall TMainForm::virtualstringtree_TreeViewClick(TObject
*Sender)
{

POINT MousePos;
GetCursorPos(&MousePos);
TVirtualNode * node = dynamic_cast <TVirtualStringTree*>
(Sender)->GetNodeAt(MousePos.x, MousePos.y);
TListViewElements *MyItems;
MyItems = (TListViewElements*)dynamic_cast <TVirtualStringTree*>
(Sender)->GetNodeData(node);de(node->Index))->GUID_CHANGED;

}

But this dos'nt work correct what means that i get not the node at
the mousepos but another from the list.

The same code works when is use the MouseUp-Event
void __fastcall TMainForm::virtualstringtree_TreeViewMouseUp(
TObject *Sender, TMouseButton Button, TShiftState Shift, int X,
int Y)
and using the X,Y Parameter.

Has anywhere a better solution to get the actual Node at MouseClick ?

Many thanks in advance
Gerhard Behnke

 | Replies | Author | Date
5266 | Re: actually Node at MouseClick | Werner Lehmann | Wed 1/30/2002


re: actually Node at MouseClick

From: Werner Lehmann [wl@b...]
Date: Wed Jan 30, 2002 11:20 am
Subject: Re: [VirtualTreeview] actually Node at MouseClick

Hi Gerhard,

why can't you use OnMouseDown if OnMouseUp is too late?

gbehnke2000 wrote:
>
> POINT MousePos;
> GetCursorPos(&MousePos);
> TVirtualNode * node = dynamic_cast <TVirtualStringTree*>
> (Sender)->GetNodeAt(MousePos.x, MousePos.y);

GetCursorPos will return screen coordinates. You have to transform
them with

MousePos = dynamic_cast <TVirtualStringTree*>
(Sender)->ScreenToClient(MousePos);

Regards,
Werner


AW: actually Node at MouseClick

From: [Behnke@h...]
Date: Wed Jan 30, 2002 12:20 pm
Subject: AW: [VirtualTreeview] actually Node at MouseClick

Hi Werner,

ups, you're so right. I don't know why i forgot to transform the
coordinates, Anyway now it works and thanks again for your fast response.
Sorry if i bother you again with another question, which is might be so
simple too.
My Problem is that when i click to a node and there are childs i like to
iterate through the childs which belongs to the node. GetNext or
GetNextSibling will only iterate through the next node but not through the
childs. What's my mistake.
Many thanks in advance
Gerhard

> -----Ursprüngliche Nachricht-----
> Von: Werner Lehmann [mailto:[wl@b...]]
> Gesendet: Mittwoch, 30. Januar 2002 12:20
> An: VirtualTreeview@yahoogroups.com
> Betreff: Re: [VirtualTreeview] actually Node at MouseClick
>
> Hi Gerhard,
>
> why can't you use OnMouseDown if OnMouseUp is too late?
>
> gbehnke2000 wrote:
> >
> > POINT MousePos;
> > GetCursorPos(&MousePos);
> > TVirtualNode * node = dynamic_cast <TVirtualStringTree*>
> > (Sender)->GetNodeAt(MousePos.x, MousePos.y);
>
> GetCursorPos will return screen coordinates. You have to transform
> them with
>
> MousePos = dynamic_cast <TVirtualStringTree*>
> (Sender)->ScreenToClient(MousePos);
>
> Regards,
> Werner
>
>
>
>
> Yahoo! Groups Sponsor
> []
> <http://rd.yahoo.com/M=153641.1824646.3335993.1261774/D=egroupweb/S=170511
> 5362:HM/A=919357/R=0/*http://shop.store.yahoo.com/cgi-bin/clink?gloss2+sho
> pping:dmad/M=153641.1824646.3335993.1261774/D=egroupweb/S=1705115362:HM/A=
> 919357/R=1/1012391187+http://us.rmi.yahoo.com/rmi/http://www.gloss.com/rmi
> -framed-url/http://www.gloss.com/module/Stila/templates/whatsnew/whatsnew_
> detail.jhtml%3FitemId=22100038%26mktAdTrack=22800125>
>
> _____
>
>
> <http://us.adserver.yahoo.com/l?M=153641.1824646.3335993.1261774/D=egroupm
> ail/S=1705115362:HM/A=919357/rand=220377858>
>
> To unsubscribe from this group, send an email to:
> VirtualTreeview-unsubscribe@egroups.com
>
>
>
> Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service
> <http://docs.yahoo.com/info/terms/>.

 | Replies | Author | Date
5268 | Re: AW: [VirtualTreeview] actually Node at MouseC | Werner Lehmann | Wed 1/30/2002


re: AW: actually Node at MouseClick

From: Werner Lehmann [wl@b...]
Date: Wed Jan 30, 2002 1:08 pm
Subject: Re: AW: [VirtualTreeview] actually Node at MouseClick

[Behnke@h...] wrote:
>
> ups, you're so right. I don't know why i forgot to transform the
> coordinates, Anyway now it works and thanks again for your fast response.
> Sorry if i bother you again with another question, which is might be so
> simple too.

Sure.

> My Problem is that when i click to a node and there are childs i like to
> iterate through the childs which belongs to the node. GetNext or
> GetNextSibling will only iterate through the next node but not through the
> childs. What's my mistake.

GetNext should work. However, if you are not using OnInitChildren / OnInitNode
but rather init nodes manually, and GetNext implictly tries to init your child
nodes and assumes there are non because of a missing OnInitChildren handler
you may end up with no children (vsHasChildren is reset) and GetNext returns
the next sibling. Can't say much more without knowing how you init the nodes.

But if the nodes are already there (and init'ed) it is easiest and fastest to
use the appropriate members of the node record:

TVirtualNode = packed record
...
Parent, // reference to the node's parent (for the root
this contains the treeview)
PrevSibling, // link to the node's previous sibling or nil if
it is the first node
NextSibling, // link to the node's next sibling or nil if it is
the last node
FirstChild, // link to the node's first child...
LastChild: PVirtualNode; // link to the node's last child...
...
end;

Example:

Node := ClickedNode.FirstChild;
while Node <> nil do
begin
// Stuff
Node := Node.NextSibling;
end;

Werner


AW: AW: actually Node at MouseClick

From: [Behnke@h...]
Date: Wed Jan 30, 2002 1:34 pm
Subject: AW: AW: [VirtualTreeview] actually Node at MouseClick

What should i say,
many thanks again for your help and fast response. It works how that it
should.
BTW. I use
virtualstringtree_TreeView->AddChild(NULL,NULL); and
virtualstringtree_TreeView->AddChild(Node,NULL);
for setting up my tree. The TTreeViewlements will be filled from a Database
(Interbase)

Best regards
Gerhard

> -----Ursprüngliche Nachricht-----
> Von: Werner Lehmann [mailto:[wl@b...]]
> Gesendet: Mittwoch, 30. Januar 2002 14:09
> An: [VirtualTreeview@yahoogroups.com
> Betreff: Re: AW: [VirtualTreeview] actually Node at MouseClick
>
> Behnke@h...] wrote:
> >
> > ups, you're so right. I don't know why i forgot to transform the
> > coordinates, Anyway now it works and thanks again for your fast
> response.
> > Sorry if i bother you again with another question, which is might be so
> > simple too.
>
> Sure.
>
> > My Problem is that when i click to a node and there are childs i like to
> > iterate through the childs which belongs to the node. GetNext or
> > GetNextSibling will only iterate through the next node but not through
> the
> > childs. What's my mistake.
>
> GetNext should work. However, if you are not using OnInitChildren /
> OnInitNode
> but rather init nodes manually, and GetNext implictly tries to init your
> child
> nodes and assumes there are non because of a missing OnInitChildren
> handler
> you may end up with no children (vsHasChildren is reset) and GetNext
> returns
> the next sibling. Can't say much more without knowing how you init the
> nodes.
>
> But if the nodes are already there (and init'ed) it is easiest and fastest
> to
> use the appropriate members of the node record:
>
> TVirtualNode = packed record
> ...
> Parent, // reference to the node's parent (for the
> root this contains the treeview)
> PrevSibling, // link to the node's previous sibling or nil
> if it is the first node
> NextSibling, // link to the node's next sibling or nil if
> it is the last node
> FirstChild, // link to the node's first child...
> LastChild: PVirtualNode; // link to the node's last child...
> ...
> end;
>
> Example:
>
> Node := ClickedNode.FirstChild;
> while Node <> nil do
> begin
> // Stuff
> Node := Node.NextSibling;
> end;
>
>
> Werner
>
>
> Yahoo! Groups Sponsor
> []
> <http://rd.yahoo.com/M=153641.1824646.3335993.1261774/D=egroupweb/S=170511
> 5362:HM/A=889707/R=0/*http://shop.store.yahoo.com/cgi-bin/clink?gloss2+sho
> pping:dmad/M=153641.1824646.3335993.1261774/D=egroupweb/S=1705115362:HM/A=
> 889707/R=1/1012396118+http://us.rmi.yahoo.com/rmi/http://www.gloss.com/rmi
> -framed-url/http://www.gloss.com/module/EsteeLauder/templates/product/prod
> _multi.jhtml%3FmCategoryId=cat40207%26mktAdTrack=22000072>
>
> _____
>
>
> <http://us.adserver.yahoo.com/l?M=153641.1824646.3335993.1261774/D=egroupm
> ail/S=1705115362:HM/A=889707/rand=458288582>
>
> To unsubscribe from this group, send an email to:
> VirtualTreeview-unsubscribe@egroups.com
>
>
>
> Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service
> <http://docs.yahoo.com/info/terms/>.


VSTEdit - OnChange & OnKeyDown not triggering in CB5

From: "Richter, Len" [len@c...]
Date: Wed Jan 30, 2002 3:30 pm
Subject: VSTEdit - OnChange & OnKeyDown not triggering in CB5

Hello
Maybe Manfred Fuchs (the author of VSTEdit) or someone can answer this. The
OnChange and OnKeydown do not trigger at all in the MFButtonEdit, MFEdit,
MFCombobx in CB5. Has this worked for anyone?

Also does anyone have CB5 code to add your own MF editor? I do not speak
Delphi very well.

Len

-----Original Message-----
From: Werner Lehmann [mailto:[wl@b...]]
Sent: Wednesday, January 30, 2002 6:09 AM
To: [VirtualTreeview@yahoogroups.com
Subject: Re: AW: [VirtualTreeview] actually Node at MouseClick

Behnke@h...] wrote:
>
> ups, you're so right. I don't know why i forgot to transform the
> coordinates, Anyway now it works and thanks again for your fast response.
> Sorry if i bother you again with another question, which is might be so
> simple too.

Sure.

> My Problem is that when i click to a node and there are childs i like to
> iterate through the childs which belongs to the node. GetNext or
> GetNextSibling will only iterate through the next node but not through the
> childs. What's my mistake.

GetNext should work. However, if you are not using OnInitChildren /
OnInitNode
but rather init nodes manually, and GetNext implictly tries to init your
child
nodes and assumes there are non because of a missing OnInitChildren handler
you may end up with no children (vsHasChildren is reset) and GetNext returns
the next sibling. Can't say much more without knowing how you init the
nodes.

But if the nodes are already there (and init'ed) it is easiest and fastest
to
use the appropriate members of the node record:

TVirtualNode = packed record
...
Parent, // reference to the node's parent (for the root
this contains the treeview)
PrevSibling, // link to the node's previous sibling or nil
if it is the first node
NextSibling, // link to the node's next sibling or nil if it
is the last node
FirstChild, // link to the node's first child...
LastChild: PVirtualNode; // link to the node's last child...
...
end;

Example:

Node := ClickedNode.FirstChild;
while Node <> nil do
begin
// Stuff
Node := Node.NextSibling;
end;

Werner

Yahoo! Groups Sponsor
[]

_____

<http://us.adserver.yahoo.com/l?M=153641.1824646.3335993.1261774/D=egroupmai
l/S=1705115362:HM/A=889707/rand=458288582>

To unsubscribe from this group, send an email to:
VirtualTreeview-unsubscribe@egroups.com

Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service
<http://docs.yahoo.com/info/terms/> .

[Non-text portions of this message have been removed]

 | Replies | Author | Date
5275 | Re: VSTEdit - OnChange & OnKeyDown not triggering | roland_beduerftig | Thu 1/31/2002


re: Add-On CB5 code for creating your own MF Editor component or editor link component

From: "Mike Lischke" [lists@l...]
Date: Wed Jan 30, 2002 7:59 pm
Subject: RE: [VirtualTreeview] Add-On CB5 code for creating your own MF Editor component or editor link component

Hi Len,

> Does anyone have CB5 code for creating own MF Editor components? I want to
> create just Glyph Button on the right side of the cell.

This is really easy:

.....
if WithDialog then
begin
FDialogButton := TSpeedButton.Create(nil);
FDialogButton.Parent := FTree;
FDialogButton.Caption := '...';
FDialogButton.Font.Style := [fsBold];
FDialogButton.OnClick := DoPropertyEditorEdit;
end;
.....

procedure TPropertyEditLink.SetBounds(R: TRect);

begin
InflateRect(R, 0, -1);

// Rearrange edit and dialog button if necessary.
if Assigned(FDialogButton) then
begin
FDialogButton.Height := R.Bottom - R.Top + 1;
FDialogButton.Width := FDialogButton.Height;
FDialogButton.Left := R.Right - FDialogButton.Width;
FDialogButton.Top := R.Top;
Dec(R.Right, FDialogButton.Width);
end;
with R do
begin
FEdit.SetBounds(Left, Top, Right - Left, Bottom - Top);
.....

(FDialogButton is a normal TSpeedButton).

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: Printing a tree to a Tmetacanvas

From: "Mike Lischke" [lists@l...]
Date: Wed Jan 30, 2002 8:01 pm
Subject: RE: [VirtualTreeview] Printing a tree to a Tmetacanvas

Hi Kostas,

> Sorry to intervene, but this is not true according to MSDN. If you include
> PRF_NONCLIENT in the message's LParam it will also paint the non-client
> area. From looking at the code i see that Mike calls "inherited" which will
> eventually pass the message to DefWindowProc which (unless it has a bug, i
> didn't test it) will paint non-client area as well.

ah yes, as exact as always ;o] Well, I wasn't very precise. What I meant was
only what is visible on
screen is rendered, so no hidden parts can be printed that way.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: Add-On CB5 code for creating your own MF Ed itor component or editor link component

From: "Richter, Len" [len@c...]
Date: Wed Jan 30, 2002 8:24 pm
Subject: RE: [VirtualTreeview] Add-On CB5 code for creating your own MF Ed itor component or editor link component

Yeah I that is what I am using now, but I wanted to create a MFButton that
could be used in the the Add-On drag & drop MFEditor component. It is much
cleaner way of doing it. Just drag and drop the component onto the form and
set up the events instead of doing it in code.

Len

-----Original Message-----
From: Mike Lischke [mailto:[lists@l...]]
Sent: Wednesday, January 30, 2002 1:00 PM
To: VirtualTreeview@yahoogroups.com
Subject: RE: [VirtualTreeview] Add-On CB5 code for creating your own MF
Editor component or editor link component

Hi Len,

> Does anyone have CB5 code for creating own MF Editor components? I want
to
> create just Glyph Button on the right side of the cell.

This is really easy:

.....
if WithDialog then
begin
FDialogButton := TSpeedButton.Create(nil);
FDialogButton.Parent := FTree;
FDialogButton.Caption := '...';
FDialogButton.Font.Style := [fsBold];
FDialogButton.OnClick := DoPropertyEditorEdit;
end;
.....

procedure TPropertyEditLink.SetBounds(R: TRect);

begin
InflateRect(R, 0, -1);

// Rearrange edit and dialog button if necessary.
if Assigned(FDialogButton) then
begin
FDialogButton.Height := R.Bottom - R.Top + 1;
FDialogButton.Width := FDialogButton.Height;
FDialogButton.Left := R.Right - FDialogButton.Width;
FDialogButton.Top := R.Top;
Dec(R.Right, FDialogButton.Width);
end;
with R do
begin
FEdit.SetBounds(Left, Top, Right - Left, Bottom - Top);
.....

(FDialogButton is a normal TSpeedButton).

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net

Yahoo! Groups Sponsor

ADVERTISEMENT

<http://rd.yahoo.com/M=218512.1856015.3360178.1269402/D=egroupweb/S=17051153
62:HM/A=928901/R=0/*http://ad.doubleclick.net/clk;3788034;6800959;v%3fhttp:/
/www.verisign.com/cgi-bin/go.cgi?a=b228473240057000>

<http://us.adserver.yahoo.com/l?M=218512.1856015.3360178.1269402/D=egroupmai
l/S=1705115362:HM/A=928901/rand=991896164>

To unsubscribe from this group, send an email to:
VirtualTreeview-unsubscribe@egroups.com

Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service
<http://docs.yahoo.com/info/terms/> .

[Non-text portions of this message have been removed]


re: Printing a tree to a Tmetacanvas

From: GIANNAKOPOULOS KOSTAS [kyan@s...]
Date: Thu Jan 31, 2002 9:24 am
Subject: RE: [VirtualTreeview] Printing a tree to a Tmetacanvas

> ah yes, as exact as always ;o] Well, I wasn't very precise.
> What I meant was only what is visible on
> screen is rendered, so no hidden parts can be printed that way.

Oops! now i got it. OK, i'm sorry, i feel a little bit stupid...


re: VSTEdit - OnChange & OnKeyDown not triggering in CB5

From: "roland_beduerftig" [Beduerftig@S...]
Date: Thu Jan 31, 2002 1:58 pm
Subject: Re: VSTEdit - OnChange & OnKeyDown not triggering in CB5

Hallo Len,

> Hello
> Maybe Manfred Fuchs (the author of VSTEdit) or someone can answer
> this. The OnChange and OnKeydown do not trigger at all in the
> MFButtonEdit, MFEdit, MFCombobx in CB5.
> Has this worked for anyone?
>
> Also does anyone have CB5 code to add your own MF editor?
> I do not speak Delphi very well.

when you want use OnChange or OnKeydown Event in CreateEditor you
must define our own Editor-Class for example a combobox, and then
these events will work very well.

Have a look in my source on
Files > Examples > BCB_Examples > Property_Editors
in this newsgroup, written in BCB5.

I think next week a will update the source for using VT version 3.x.

regards
Roland


re: Re: VSTEdit - OnChange & OnKeyDown not trig gering in CB5

From: "Richter, Len" [len@c...]
Date: Thu Jan 31, 2002 3:32 pm
Subject: RE: [VirtualTreeview] Re: VSTEdit - OnChange & OnKeyDown not trig gering in CB5

I have used Property_Editors but I want to create the same feature of drag
and drop that is in MFEdtiors. The problem with MFEditors and
Property_Editors is that they assign OnChange OnChange & OnKeydown to the
editor's internal event. Therefore causing these events not to trigger. I
have not been able to find a way around this. If OnChange & OnKeydown is
going to be updated, one big feature to add is the drag & drop that is in MF
Editors and solution around the events not firing.

TIA,
Len

-----Original Message-----
From: roland_beduerftig [mailto:[Beduerftig@S...]]
Sent: Thursday, January 31, 2002 6:59 AM
To: VirtualTreeview@yahoogroups.com
Subject: [VirtualTreeview] Re: VSTEdit - OnChange & OnKeyDown not triggering
in CB5

Hallo Len,

> Hello
> Maybe Manfred Fuchs (the author of VSTEdit) or someone can answer
> this. The OnChange and OnKeydown do not trigger at all in the
> MFButtonEdit, MFEdit, MFCombobx in CB5.
> Has this worked for anyone?
>
> Also does anyone have CB5 code to add your own MF editor?
> I do not speak Delphi very well.

when you want use OnChange or OnKeydown Event in CreateEditor you
must define our own Editor-Class for example a combobox, and then
these events will work very well.

Have a look in my source on
Files > Examples > BCB_Examples > Property_Editors
in this newsgroup, written in BCB5.

I think next week a will update the source for using VT version 3.x.

regards
Roland

Yahoo! Groups Sponsor

ADVERTISEMENT

<http://rd.yahoo.com/M=218512.1856015.3360178.1269402/D=egroupweb/S=17051153
62:HM/A=928901/R=0/*http://ad.doubleclick.net/clk;3788034;6800959;v%3fhttp:/
/www.verisign.com/cgi-bin/go.cgi?a=b228473240057000>

<http://us.adserver.yahoo.com/l?M=218512.1856015.3360178.1269402/D=egroupmai
l/S=1705115362:HM/A=928901/rand=802390687>

To unsubscribe from this group, send an email to:
VirtualTreeview-unsubscribe@egroups.com

Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service
<http://docs.yahoo.com/info/terms/> .

[Non-text portions of this message have been removed]

 | Replies | Author | Date
5284 | Re: VSTEdit - OnChange & OnKeyDown not trig gerin | roland_beduerftig | Fri 2/1/2002


please urgent Pending and direct clearance are mutual exclusive!

From: "gbehnke2000" [Behnke@h...]
Date: Thu Jan 31, 2002 4:12 pm
Subject: please urgent Pending and direct clearance are mutual exclusive!

Dear Members,

some time ago i asked about the following problem:

clicking (DoubleClick) on a item in the List i use the follwoing code
to get the information for reading a text in a Database:

void __fastcall TMainForm::virtualstringtree_ListViewDblClick(
TObject *Sender)
{
AnsiString strFName;
POINT MousePos;
GetCursorPos(&MousePos);
MousePos = dynamic_cast <TVirtualStringTree*> (Sender)-
>ScreenToClient(MousePos);

TVirtualNode * node = dynamic_cast <TVirtualStringTree*>(Sender)-
>GetNodeAt(MousePos.x, MousePos.y);
// TVirtualNode * node = dynamic_cast <TVirtualStringTree*>
(Sender)->HotNode;//GetNodeAt(MousePos.x, MousePos.y,true,i);
TListViewElements *MyItems;
MyItems = (TListViewElements*)dynamic_cast <TVirtualStringTree*>
(Sender)->GetNodeData(node);
strFName = ((TListViewElements*)tdbindexlist_ListView->GetNode
(node->Index))->GUID_CHANGED;

//strfName is the Name of the stored Item in the Database
}

But very often i get the Error Code:
Pending and direct clearance are mutual exclusive!

What can i do to avoid this Error

Best regards
Gerhard

 | Replies | Author | Date
5278 | Re: please urgent Pending and direct clearance ar | Mike Lischke | Thu 1/31/2002


re: please urgent Pending and direct clearance are mutual exclusive!

From: "Mike Lischke" [lists@l...]
Date: Thu Jan 31, 2002 9:15 pm
Subject: RE: [VirtualTreeview] please urgent Pending and direct clearance are mutual exclusive!

Hi Gerhard,

> But very often i get the Error Code:
> Pending and direct clearance are mutual exclusive!

I'm a bit perplex that you get the assertion failure. Since you do not modify
anything in the tree
in your method there must be something else which causes the trouble. Simply
writing a handler for
OnDblClick does not create the conflict. Can you try to seek back to your own
code once you got the
assertion message? This way we can perhaps work out what manipulation causes
the trouble.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


can I post a stupid question

From: "jamesnewid2000" [jamesnewid2000@y...]
Date: Fri Feb 1, 2002 7:33 am
Subject: can I post a stupid question

if I installed the component correctly?
I get:
3 VT
5 MVedit
but can not see vstedit.
I installed the .PAS files one by one. if I made mistaken?
and how to install it?
sorry, I am newbie of newbie :-(

BTW, I am from china. poor english. thanks in advanced.
james.

 | Replies | Author | Date
5281 | Re: can I post a stupid question | Vandrovec Milan | Fri 2/1/2002
5282 | Re: can I post a stupid question | james | Fri 2/1/2002


re: stupid question:)

From: "james" [jamesnewid2000@y...]
Date: Fri Feb 1, 2002 8:14 am
Subject: Re: stupid question:)

after installed .pas one by one.
I can see. vtstring,vtdraw,vtpopupmenu, and 5 MVedit.... edit component.
if I installed correctly?
thanks.
james.

[Non-text portions of this message have been removed]


re: can I post a stupid question

From: Vandrovec Milan [milan_va@s...]
Date: Fri Feb 1, 2002 8:20 am
Subject: RE: [VirtualTreeview] can I post a stupid question

Hello.

> if I installed the component correctly?
> I get:
> 3 VT
> 5 MVedit
> but can not see vstedit.
> I installed the .PAS files one by one. if I made mistaken?

Looks like you have forgotten to install VSTEdit.pas. Or maybe you installed
it on a different page. Check the
procedure Register;
in VSTEdit.pas to see the page, or use menu Components/Configure Palette,
choose [All] and look for VSTEdit.
Why you didn't use the packages?

Milan Vandrovec


re: can I post a stupid question

From: "james" [jamesnewid2000@y...]
Date: Fri Feb 1, 2002 8:40 am
Subject: Re: [VirtualTreeview] can I post a stupid question

vandrovec milan,
thanks!
yes, you are right, but if I add the vstedit package. once i complier, it
report me:
[error] VSTEDIT.pass(88):Declaration of 'prepareedit' differs from
declaration in interface 'ivteditlink'.
but once I change the declaration follow vrtstringtree.pas. another problem
face to me.
I ever try remove the comment markup {* followed with
'Ivteditlink:=Interface', but more error.
if I download wrong package?
I am using delphi 6.
Rgds,
james.

----- Original Message -----
From: "Vandrovec Milan" [milan_va@s...]
To: <VirtualTreeview@yahoogroups.com>
Sent: Friday, February 01, 2002 4:20 PM
Subject: RE: [VirtualTreeview] can I post a stupid question

>
> Hello.
>
> > if I installed the component correctly?
> > I get:
> > 3 VT
> > 5 MVedit
> > but can not see vstedit.
> > I installed the .PAS files one by one. if I made mistaken?
>
> Looks like you have forgotten to install VSTEdit.pas. Or maybe you
installed
> it on a different page. Check the
> procedure Register;
> in VSTEdit.pas to see the page, or use menu Components/Configure Palette,
> choose [All] and look for VSTEdit.
> Why you didn't use the packages?
>
> Milan Vandrovec
>
>
> To unsubscribe from this group, send an email to:
> VirtualTreeview-unsubscribe@egroups.com
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>

_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


Test to see if I can send to the list

From: Roger MacRae [rogermac@m...]
Date: Fri Feb 1, 2002 1:44 pm
Subject: Test to see if I can send to the list

This is a test


re: VSTEdit - OnChange & OnKeyDown not trig gering in CB5

From: "roland_beduerftig" [Beduerftig@S...]
Date: Fri Feb 1, 2002 2:09 pm
Subject: Re: VSTEdit - OnChange & OnKeyDown not trig gering in CB5

Hi Len,

> ... drag and drop that is in MFEdtiors. The problem with
> MFEditors and Property_Editors is that they assign OnChange
> OnChange & OnKeydown to the editor's internal event. ....

i think there two problems.

Of course we create for example the combobox internal with new(), in
the example "Propertyeditor" there is a method PrepareEdit() and this
is the right place to modify the property of the component, specially
the Property DragMode (default is here dmManual).

The next problem is when, you use drag'n drop VT will lost the focus,
when you click to an other component, and with this event VT stop the
own editor, VT will delete the own editor, now the component can't
trigger an event.

have a nice weekeed
Roland


AW: please urgent Pending and direct clearance are mutual exclusive!

From: [Behnke@h...]
Date: Fri Feb 1, 2002 3:02 pm
Subject: AW: [VirtualTreeview] please urgent Pending and direct clearance are mutual exclusive!

Hallo Mike,

many thanks for your fast response. Today, the whole day i try'd to find out
what happens without any success. I cuted my Code to this few lines:
void __fastcall TMainForm::virtualstringtree_ListViewDblClick(
TObject *Sender)
{
AnsiString strFName;
POINT MousePos;
GetCursorPos(&MousePos);
MousePos = dynamic_cast <TVirtualStringTree*>
(Sender)->ScreenToClient(MousePos);
}

not any more. First, for more understanding i show in this Tree simple
Textlines showing what for items are stored in my Database.
What i found out is the follows:
I click on one Line --> O.K
I click the next Line --->O.K

But
I click on one Line-->O.K
I click the second time on the same Line -->O.K
I click any other Line the Assert will be fired.

What i have now done is not the best way i know, but with this little
modifications it works without any problems. I disabled the Assert
(* Assert(not (tsClearPending in FStates), 'Pending and direct clearance are
mutual exclusive!');*)
and now as i mentioned it runs ??!. I'm sure that you use the Assert to
avoid some mistakes etc. Might be you can tell what can happens in the case
the assert is'nt available.

Many thanks and have a nice weekend

Gerhard

[Behnke, Gerhard] to:[lists@l...]]
> Gesendet: Donnerstag, 31. Januar 2002 22:16
[Behnke, Gerhard]

> An: VirtualTreeview@yahoogroups.com
> Betreff: RE: [VirtualTreeview] please urgent Pending and direct
> clearance are mutual exclusive!
>
> Hi Gerhard,
>
> > But very often i get the Error Code:
> > Pending and direct clearance are mutual exclusive!
>
> I'm a bit perplex that you get the assertion failure. Since you do not
> modify anything in the tree
> in your method there must be something else which causes the trouble.
> Simply writing a handler for
> OnDblClick does not create the conflict. Can you try to seek back to your
> own code once you got the
> assertion message? This way we can perhaps work out what manipulation
> causes the trouble.
>
> Ciao, Mike
> --
> www.lischke-online.de
> www.delphi-unicode.net
>
>
>
>
> Yahoo! Groups Sponsor
> []
> <http://rd.yahoo.com/M=153641.1824646.3335993.1261774/D=egroupweb/S=170511
> 5362:HM/A=919357/R=0/*http://shop.store.yahoo.com/cgi-bin/clink?gloss2+sho
> pping:dmad/M=153641.1824646.3335993.1261774/D=egroupweb/S=1705115362:HM/A=
> 919357/R=1/1012511744+http://us.rmi.yahoo.com/rmi/http://www.gloss.com/rmi
> -framed-url/http://www.gloss.com/module/Stila/templates/whatsnew/whatsnew_
> detail.jhtml%3FitemId=22100038%26mktAdTrack=22800125>
>
> _____
>
>
> <http://us.adserver.yahoo.com/l?M=153641.1824646.3335993.1261774/D=egroupm
> ail/S=1705115362:HM/A=919357/rand=764617780>
>
> To unsubscribe from this group, send an email to:
> VirtualTreeview-unsubscribe@egroups.com
>
>
>
> Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service
> <http://docs.yahoo.com/info/terms/>.


Drag Drop and waiting

From: "Glenn MacGregor" [gtm@o...]
Date: Fri Feb 1, 2002 6:05 pm
Subject: Drag Drop and waiting

Hi All,

I am building an application that I can drag and drop multiple nodes at a time.
I just call ProcessDrop in the dragDrop handler. I user the nodeMoved handler
to do the work in my structures. Is there a way to change one node, send info
over network and wait for response before moving on the next node?

Thanks

Glenn

[Non-text portions of this message have been removed]


IVTEditLink

From: "this_is_koen" [kvds@g...]
Date: Sat Feb 2, 2002 7:21 pm
Subject: IVTEditLink

I can make editors for cells with IVTEditLink, but how do I add
buttons to the right side of every cell? I can show them once the
cell is edited, but I want to show them for (almost) all cells/nodes?

Thanks (great component),

Koen


A Couple Questions

From: Roger MacRae [rogermac@m...]
Date: Sat Feb 2, 2002 5:24 pm
Subject: A Couple Questions

I am working with VT and am wondering if it is possible to have two events
added to the component.

1-OnAddNode
2-OnAddColumn

These two events would greatly improve the ability to work with VT and
would help me out alot.

Another thing I was wondering about is if it is possible to make the
initial creation of a VT component have header option preset and have a
given number of columns preset?

Thanks

[Non-text portions of this message have been removed]

 | Replies | Author | Date
5339 | Re: A Couple Questions | Mike Lischke | Sat 2/16/2002


Having some problems: Please help

From: Roger MacRae [rogermac@m...]
Date: Sun Feb 3, 2002 5:49 pm
Subject: Having some problems: Please help

Ok I am creating a descendant of VirtualStringTree and all is going pretty
good. I can get everything I need to work right except anything to do with
columns.

When my descendant gets created at design time I want it to have:

header.options := [hovisible];

I also want to have four columns created:

header.columns.add
header.columns.add
header.columns.add
header.columns.add

and then I want the first column to be invisible:

header.columns[0].options := []

The other thing I want at design time is for the first node (we'll call it
node 0) to be hidden.

NodeHeight[GetFirst] := 0;

I initially figured all these things would be easy to do but the column
stuff causes av's. Setting Node 0 to a height of 0 just doesn't do anything.

Any help on these matters would be greatly appreciated. Thanks in advance.

[Non-text portions of this message have been removed]


Virtualtress: when is resumed workerthread?

From: "luceerad" [ljee@s...]
Date: Mon Feb 4, 2002 7:32 pm
Subject: Virtualtress: when is resumed workerthread?

Hi,

I noticed in Delphi 6 all threads are created suspended
no matter what the user wants.
This is how the constructor looks like after taking out
conditional defines:

constructor TThread.Create(CreateSuspended: Boolean);
begin
inherited Create;
AddThread;
FSuspended := CreateSuspended;
FCreateSuspended := CreateSuspended;
FHandle := BeginThread(nil,
0,
@ThreadProc,
Pointer(Self),
CREATE_SUSPENDED, <-- check this out !!!
FThreadID);
....

So, no matter what you pass to the constructor you
end up with a SUSPENDED thread which must be resumed,
calling Resume or assigning False to Suspended
property.

So, the tree worker thread *is* created SUSPENDED (even
though we pass False to the constructor),
but I don't see when it is resumed.

WorkerThread := TWorkerThread.Create(False)

Anyone?

TIA,

Lucian

 | Replies | Author | Date
5291 | Re: Virtualtress: when is resumed workerthread? | Mike Lischke | Mon 2/4/2002
5292 | Re: Virtualtress: when is resumed workerthread? | luceerad | Mon 2/4/2002


re: Virtualtress: when is resumed workerthread?

From: "Mike Lischke" [lists@l...]
Date: Mon Feb 4, 2002 7:49 pm
Subject: RE: [VirtualTreeview] Virtualtress: when is resumed workerthread?

> So, the tree worker thread *is* created SUSPENDED (even
> though we pass False to the constructor),
> but I don't see when it is resumed.

TThread.AfterConstruction

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net

 | Replies | Author | Date
5292 | Re: Virtualtress: when is resumed workerthread? | luceerad | Mon 2/4/2002


re: Virtualtress: when is resumed workerthread?

From: "luceerad" [ljee@s...]
Date: Mon Feb 4, 2002 7:59 pm
Subject: Re: Virtualtress: when is resumed workerthread?

> TThread.AfterConstruction

He, he, he ... thanks Mike :-)

Lucian


Printing A Virtual TreeView

From: "warrenjw2861" [warrenjw@a...]
Date: Tue Feb 5, 2002 11:23 pm
Subject: Printing A Virtual TreeView

Hi all

Does anyone have any Delphi code that is able to print the entire
contents of a Virtual TreeView.

Any help greatly appreciated.

Warren Weber
[warrenjw@a...]

 | Replies | Author | Date
5297 | Assertion failed | Jiri Hajek | Wed 2/6/2002
5340 | Re: Assertion failed | Mike Lischke | Sat 2/16/2002


Simulate Windows Explorer

From: "Dion" [dion@n...]
Date: Wed Feb 6, 2002 1:01 pm
Subject: Simulate Windows Explorer

Hi,

Which properties must be set in order to get VT to behave like windows
explorer ie when you right click on a non focused node, it receives
(temporary focus ie highlighted), while the initially selected node has a
broken white border.

Are there predefined properties I have missed, or must I use the event to
get node states and adjust the painting accordingly?

Many Thanks,
Dion.

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.314 / Virus Database: 175 - Release Date: 01/11/2002

 | Replies | Author | Date
5295 | Re: Simulate Windows Explorer | GIANNAKOPOULOS KOSTAS | Wed 2/6/2002
5296 | Re: Simulate Windows Explorer | Dion | Wed 2/6/2002


re: Simulate Windows Explorer

From: GIANNAKOPOULOS KOSTAS [kyan@s...]
Date: Wed Feb 6, 2002 9:21 am
Subject: RE: [VirtualTreeview] Simulate Windows Explorer

> Which properties must be set in order to get VT to behave like windows
> explorer ie when you right click on a non focused node, it receives
> (temporary focus ie highlighted), while the initially
> selected node has a
> broken white border.

AFAIK Mike has chosen not to implement this behaviour because he thinks (and
i agree with him) that it is difficult to handle because popup menu's
OnClick event handler is asynchronous (after you click a menuitem the focus
goes back to the previously selected node BEFORE OnClick gets fired, common
problem with TTreeView).

 | Replies | Author | Date
5296 | Re: Simulate Windows Explorer | Dion | Wed 2/6/2002


re: Simulate Windows Explorer

From: "Dion" [dion@n...]
Date: Wed Feb 6, 2002 8:13 pm
Subject: RE: [VirtualTreeview] Simulate Windows Explorer

Has nobody implemeted this behaviour. I used it without much hastle using
TTreeView.

Dion,

-----Original Message-----
From: GIANNAKOPOULOS KOSTAS [mailto:[kyan@s...]]
Sent: Wednesday, February 06, 2002 1:21 AM
To: 'VirtualTreeview@yahoogroups.com'
Subject: RE: [VirtualTreeview] Simulate Windows Explorer

> Which properties must be set in order to get VT to behave like windows
> explorer ie when you right click on a non focused node, it receives
> (temporary focus ie highlighted), while the initially
> selected node has a
> broken white border.

AFAIK Mike has chosen not to implement this behaviour because he thinks (and
i agree with him) that it is difficult to handle because popup menu's
OnClick event handler is asynchronous (after you click a menuitem the focus
goes back to the previously selected node BEFORE OnClick gets fired, common
problem with TTreeView).

To unsubscribe from this group, send an email to:
VirtualTreeview-unsubscribe@egroups.com

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/

---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.314 / Virus Database: 175 - Release Date: 01/11/2002

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.314 / Virus Database: 175 - Release Date: 01/11/2002


Assertion failed

From: "Jiri Hajek" [JirkaHajek@s...]
Date: Wed Feb 6, 2002 3:15 pm
Subject: Assertion failed

Hi all,

I have a problem with VT (for example the latest compiled demo). The way to
reproduce the error is following:

Put focus to the VT but do not select any node. Press and holt shift key and
pres down arrow. It should select the first item in the tree, but instead it
shows an assertion error "Nodes must never be nil".

Regards,
Jiri

 | Replies | Author | Date
5340 | Re: Assertion failed | Mike Lischke | Sat 2/16/2002


re: sorry all, still stupid problem

From: "james tsang" [jamesnewid2000@y...]
Date: Wed Feb 6, 2002 3:22 pm
Subject: Re: sorry all, still stupid problem

pls,
anyone, can you tell me how you success in install this component? I am using
delphi 6.0.
thanks very much.
----- Original Message -----
From: "james" <VirtualTreeview@egroups.com>
Newsgroups: delphi-gems.support.virtualtreeview
Sent: Wednesday, February 06, 2002 12:42 PM
Subject: sorry all, still stupid problem

> hi, all,
> I do not know why I still can install stringtree, drawtree, popup, and
> mVedit, can not install vstedit. no matter how I install , change sequence,
> change package, etc. I still can not get all component work.
> who can tell me how...
> thanks.
> james.
>
>
>

 | Replies | Author | Date
5299 | Re: sorry all, still stupid problem | Werner Lehmann | Wed 2/6/2002
5301 | Re: sorry all, still stupid problem | james tsang | Thu 2/7/2002
5302 | Checking node | Yur Ovchinnikov | Thu 2/7/2002
5303 | Re: sorry all, still stupid problem | Werner Lehmann | Thu 2/7/2002
5305 | Re: sorry all, still stupid problem | Jim Kueneman | Thu 2/7/2002
5306 | Re: sorry all, still stupid problem | james tsang | Thu 2/7/2002


re: Re: sorry all, still stupid problem

From: Werner Lehmann [wl@b...]
Date: Wed Feb 6, 2002 5:29 pm
Subject: Re: [VirtualTreeview] Re: sorry all, still stupid problem

Hi James,

> anyone, can you tell me how you success in install this component? I am using
delphi 6.0.
> thanks very much.

noone can tell you a thing if you don't give more details about what exactly
is not working. Since it works for most people it is probably something on
your computer. My guess is the lib path is not correct or you have old dcus
or bpls lying around.

Werner


Desperate for help: Please read. Thanks

From: Roger MacRae [rogermac@m...]
Date: Wed Feb 6, 2002 12:49 am
Subject: Desperate for help: Please read. Thanks

Hi there.

I am in the process of making a decendant of VirtualStringTree. All has
gone well. It has taken and effort but it is worth it.

Anyway now I am trying to add SaveToCSV and LoadFromCSV procedure and am
really struggling. The SaveToCSV works great but I can't seem to get the
LoadFromCSV working at all. Every time I go to update a node I get an
access violation. The weird part is, if I have a ShowMessage('some
message') and then I try to update a node it works every time.

Anyway if someone could help me I would greatly appriciate it. I haven't
had any success getting help here before but maybe this time someone will
be able to.

Thanks.

PS if you need me to send you the work I have done just let me know.

[Non-text portions of this message have been removed]


re: Re: sorry all, still stupid problem

From: "james tsang" [jamesnewid2000@y...]
Date: Thu Feb 7, 2002 4:27 am
Subject: Re: [VirtualTreeview] Re: sorry all, still stupid problem

hi,werner,
like following:
> > if I installed the component correctly?
> > I get:
> > 3 VT
> > 5 MVedit
> > but can not see vstedit.
> > I installed the .PAS files one by one. if I made mistaken?
I ever try the add-ons from yahoo group. but, I still can not install VST
component.
I ever try, dpk,pas,register file etc.
thanks in advanced.
james.

----- Original Message -----
From: Werner Lehmann
To: VirtualTreeview@yahoogroups.com
Sent: Thursday, February 07, 2002 1:29 AM
Subject: Re: [VirtualTreeview] Re: sorry all, still stupid problem

Hi James,

> anyone, can you tell me how you success in install this component? I am
using delphi 6.0.
> thanks very much.

noone can tell you a thing if you don't give more details about what exactly
is not working. Since it works for most people it is probably something on
your computer. My guess is the lib path is not correct or you have old dcus
or bpls lying around.

Werner

Yahoo! Groups Sponsor
ADVERTISEMENT

To unsubscribe from this group, send an email to:
VirtualTreeview-unsubscribe@egroups.com

Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.

[Non-text portions of this message have been removed]

 | Replies | Author | Date
5302 | Checking node | Yur Ovchinnikov | Thu 2/7/2002


Checking node

From: Yur Ovchinnikov [Yur@s...]
Date: Thu Feb 7, 2002 11:38 am
Subject: Checking node

Hello all,

How can I check if node exists or not?

(In my structure I stored pointers to nodes)

--
Best regards,
Yur Ovchinnikov E-mail: [yur@s...]
JSC Summit WWW: http://alone.come.to
ICQ: 1400397


re: Re: sorry all, still stupid problem

From: Werner Lehmann [wl@b...]
Date: Thu Feb 7, 2002 11:51 am
Subject: Re: [VirtualTreeview] Re: sorry all, still stupid problem

james tsang wrote:
>
> > > if I installed the component correctly?
> > > I get:
> > > 3 VT
> > > 5 MVedit
> > > but can not see vstedit.
> > > I installed the .PAS files one by one. if I made mistaken?
> I ever try the add-ons from yahoo group. but, I still can not install VST
component.
> I ever try, dpk,pas,register file etc.

One by one? Why not using the packages?

I'm sorry but I don't know MVedit or vstedit. Maybe this can be answered
by the authors of these supposedly node editors.

Werner

 | Replies | Author | Date
5305 | Re: sorry all, still stupid problem | Jim Kueneman | Thu 2/7/2002


re: Checking node

From: Werner Lehmann [wl@b...]
Date: Thu Feb 7, 2002 1:30 pm
Subject: Re: [VirtualTreeview] Checking node

Yur Ovchinnikov wrote:
>
> How can I check if node exists or not?
>
> (In my structure I stored pointers to nodes)

- Keep your structures up to date.
- Iterate nodes and data, might be faster if you use the "speculative"
parent chain in the "speculative" node to find a path to your node if
it is still there. This avoids a full iteration.

If I understand you right you want to look at a pointer and be able
to decide if it still points to valid data or the data has been freed.
This is not possible, usually.

Werner


re: Re: sorry all, still stupid problem

From: Jim Kueneman [jimdk@m...]
Date: Thu Feb 7, 2002 1:57 pm
Subject: Re: [VirtualTreeview] Re: sorry all, still stupid problem

Hi Werner,

>One by one? Why not using the packages?
>
>I'm sorry but I don't know MVedit or vstedit. Maybe this can be answered
>by the authors of these supposedly node editors.

I think this is the BCB package.

Jim


re: Re: sorry all, still stupid problem

From: "james tsang" [jamesnewid2000@y...]
Date: Thu Feb 7, 2002 2:17 pm
Subject: Re: [VirtualTreeview] Re: sorry all, still stupid problem

thanks all, seems like I get all component now. :)
rgds,
james.
----- Original Message -----
From: Jim Kueneman
To: VirtualTreeview@yahoogroups.com
Sent: Thursday, February 07, 2002 9:57 PM
Subject: Re: [VirtualTreeview] Re: sorry all, still stupid problem

Hi Werner,

>One by one? Why not using the packages?
>
>I'm sorry but I don't know MVedit or vstedit. Maybe this can be answered
>by the authors of these supposedly node editors.

I think this is the BCB package.

Jim

Yahoo! Groups Sponsor
ADVERTISEMENT

To unsubscribe from this group, send an email to:
VirtualTreeview-unsubscribe@egroups.com

Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.

[Non-text portions of this message have been removed]


Header Shortcuts(clicks?)

From: "jimkueneman" [jimdk@m...]
Date: Fri Feb 8, 2002 4:56 am
Subject: Header Shortcuts(clicks?)

Hi Mike,

What are the supported mouse clicks in the VT header? Is it a double
click in the size area that auto sizes the column? If so how do you
detect a DblClick vs a regular click? Are there more? The help does
not go into mouse shortcuts, or I am overlooking it.

Jim

 | Replies | Author | Date
5341 | Re: Header Shortcuts(clicks?) | Mike Lischke | Sat 2/16/2002


Focus and Blue Color on current item

From: "Luiz" [cprmlao@i...]
Date: Sat Feb 9, 2002 1:49 pm
Subject: Focus and Blue Color on current item

I'm a newbie on VirtualTreeView.

I'm using the next code to fill a VT in runtime:

var save_nodei,Node: PVirtualNode;
MyData :PMyData
lsvHeaders.RootNodeCount:=0;
save_nodei:=nil;
for intIndex := 1 to inMsgCount do begin
lsvHeaders.RootNodeCount:=lsvHeaders.RootNodeCount+1;
Node:=lsvHeaders.GetLast(nil);
if not assigned(save_nodei) then save_nodei:=Node;
if Assigned(Node) then begin
{ Get a po inter to the data we reserved and initialized in
OnInitNode }
MyData := PMyData( lsvHeaders.GetNodeData(Node));
MyData.Numero:=format('%.4d',[intIndex]);
MyData.Assunto:=Msg.Subject;
end

end;
This code works well.

After this I'd like the node 'save_nodei' was the current. Then, I do:

if assigned(save_nodei) then lsvHeaders.FocusedNode:=save_nodei
else lsvHeaders.FocusedNode:=lsvHeaders.TopNode;
if lsvHeaders.CanFocus then lsvHeaders.setfocus;

Here is my problem:
After this, the selected color(Blue) never shows on Node 'save_nodei',
unless I click explictly in the item.
I have to click with mouse, explictly, on row corresponding to 'save_nodei'
to it appears focusing and selected with Blue Color.

I have SelectedOptions as [toMultiSelect,FullRowSelect,toExtendedFocus].
I have also in PaintOptions as toHideFocus=False and toHideSelection=False.

What do I have to simulate a click of mouse in a row, to show the Blue Color
in this row?

Thanks in advance,

Luiz.

 | Replies | Author | Date
5309 | Re: Focus and Blue Color on current item | Paul Istrate | Sun 2/10/2002
5310 | Re: Focus and Blue Color on current item | Luiz | Mon 2/11/2002


re: Focus and Blue Color on current item

From: "Paul Istrate" [istech@c...]
Date: Sun Feb 10, 2002 3:41 pm
Subject: Re: [VirtualTreeview] Focus and Blue Color on current item

Hi,

> if assigned(save_nodei) then
lsvHeaders.FocusedNode:=save_nodei

Try lsvHeaders.Selected[lsvHeaders.FocusedNode]:=True;

Regards,
Paul


re: Focus and Blue Color on current item

From: "Luiz" [cprmlao@i...]
Date: Mon Feb 11, 2002 4:39 am
Subject: Re: [VirtualTreeview] Focus and Blue Color on current item

----- Original Message -----
From: "Paul Istrate" [istech@c...]
> Hi,
>
> > if assigned(save_nodei) then
> lsvHeaders.FocusedNode:=save_nodei
>
> Try lsvHeaders.Selected[lsvHeaders.FocusedNode]:=True;

It works very well.

Very thanks, Paul.

Luiz.


Focusing a specific node(selecting it)

From: "Dion" [dion@n...]
Date: Tue Feb 12, 2002 4:30 am
Subject: Focusing a specific node(selecting it)

Hi,

How do you select a node(or give it focus, as in clicking on it)?

Regards,
Dion.

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.314 / Virus Database: 175 - Release Date: 01/11/2002

 | Replies | Author | Date
5318 | Re: Focusing a specific node(selecting it) | Helge Jung (ECO-Logic) | Mon 2/11/2002
5319 | Re: Focusing a specific node(selecting it) | Dion | Tue 2/12/2002
5327 | Re: Focusing a specific node(selecting it) | Radu Turcu | Wed 2/13/2002
5328 | Re: Focusing a specific node(selecting it) | Radu Turcu | Wed 2/13/2002
5336 | Re: Focusing a specific node(selecting it) | Dion | Fri 2/15/2002


Explorer Simulatation

From: "Dion" [dion@n...]
Date: Tue Feb 12, 2002 4:34 am
Subject: Explorer Simulatation

Hi,

I believe that VT has been designed not to behave like Microsoft
explorer(you can right click a node and have it be focused temporarily, as
in windows). I need this functionality(actually, my users). Is it possible
to simulate?

Many Thanks,
Dion.

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.314 / Virus Database: 175 - Release Date: 01/11/2002


IBO DB aware tree

From: "Dion" [dion@n...]
Date: Tue Feb 12, 2002 7:59 am
Subject: IBO DB aware tree

Hi,

Does such an animal exist(IBO DB aware tree, that is)?

Regards,
Dion.

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.314 / Virus Database: 175 - Release Date: 01/11/2002

 | Replies | Author | Date
5317 | Re: IBO DB aware tree | Helge Jung (ECO-Logic) | Mon 2/11/2002


re: IBO DB aware tree

From: "Helge Jung \(ECO-Logic\)" [helge@e...]
Date: Mon Feb 11, 2002 10:16 pm
Subject: Re: [VirtualTreeview] IBO DB aware tree

> Does such an animal exist(IBO DB aware tree, that is)?

IIRC there's one in the YG - you find it somewhere under files ... probably
"descendants" ...

Helge.


re: Focusing a specific node(selecting it)

From: "Helge Jung \(ECO-Logic\)" [helge@e...]
Date: Mon Feb 11, 2002 10:17 pm
Subject: Re: [VirtualTreeview] Focusing a specific node(selecting it)

> How do you select a node(or give it focus, as in clicking on it)?

VST.FocusedNode := TheNode;
VST.Selected[TheNode] := true;

Helge.

 | Replies | Author | Date
5319 | Re: Focusing a specific node(selecting it) | Dion | Tue 2/12/2002


re: Focusing a specific node(selecting it)

From: "Dion" [dion@n...]
Date: Tue Feb 12, 2002 10:09 am
Subject: RE: [VirtualTreeview] Focusing a specific node(selecting it)

Hi Helge,

I need to have the VT display the root node as the selected(ie must have
blue background) one when the form owning the VT gets created.

I tried the following with no success. This was a simple process using
TTreeView :-

with vtGradeTree do
begin
Selected[GetFirst] := true ;
end;

Many Thanks,
Dion.

-----Original Message-----
From: Helge Jung (ECO-Logic) [mailto:[helge@e...]]
Sent: Monday, February 11, 2002 2:18 PM
To: VirtualTreeview@yahoogroups.com
Subject: Re: [VirtualTreeview] Focusing a specific node(selecting it)

> How do you select a node(or give it focus, as in clicking on it)?

VST.FocusedNode := TheNode;
VST.Selected[TheNode] := true;

Helge.

To unsubscribe from this group, send an email to:
VirtualTreeview-unsubscribe@egroups.com

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/

---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.314 / Virus Database: 175 - Release Date: 01/11/2002

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.314 / Virus Database: 175 - Release Date: 01/11/2002


FW: [VirtualTreeview]Mike - Explorer Simulatation

From: "Dion" [dion@n...]
Date: Tue Feb 12, 2002 10:12 am
Subject: FW: [VirtualTreeview]Mike - Explorer Simulatation

-----Original Message-----
From: Dion [mailto:[dion@n...]]
Sent: Monday, February 11, 2002 8:34 PM
To: VirtualTreeview@yahoogroups.com
Subject: [VirtualTreeview] Explorer Simulatation

Hi,

I believe that VT has been designed not to behave like Microsoft
explorer(you can right click a node and have it be focused temporarily, as
in windows). I need this functionality(actually, my users). Is it possible
to simulate?

Many Thanks,
Dion.

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.314 / Virus Database: 175 - Release Date: 01/11/2002

To unsubscribe from this group, send an email to:
VirtualTreeview-unsubscribe@egroups.com

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/

---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.314 / Virus Database: 175 - Release Date: 01/11/2002

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.314 / Virus Database: 175 - Release Date: 01/11/2002


Want to use VirtualTree

From: "Carlos Eduardo Borrero" [cbarrer@e...]
Date: Wed Feb 13, 2002 1:32 am
Subject: Want to use VirtualTree

Hello:

Thank you for your attention.

I founded a legal information company that sells information based on a
Delphi 5 application I developped myself. I think until today (when I knew
about VirtualTreeview) I used to use Imcasys's FlyTreeView control to access
the information. I have trees of nearly 80.000 thousand nodes, each node can
have as far as 1000 characters (the control has wordwrap property), and when
the mouse is over a node an alternate window shows more information about
the node. Right know the additional information is saved on invisible cells
(the FlyTreeview simulates a stringgrid behavior). I think this control in
using too much memory. The second main control I use is Julian Ziersch's
WPTools.

I want to move to VirtualTreeview. Do you think it is suitable for my
application? What would be the cost of VirtualTreeview? Can I have nodes
(text) of different colors? Does VT support wordwrap? Can I change the font
of text? Can I change the height of nodes?

Please, where can I find a manual with examples about how to use
VirtualTree?

Thank you in advance for your help.

Best regards,

Carlos Borrero

 | Replies | Author | Date
5322 | Re: Want to use VirtualTree | Jim Kueneman | Wed 2/13/2002
5329 | Re: Want to use VirtualTree | Carlos Eduardo Borrero | Wed 2/13/2002


re: Want to use VirtualTree

From: Jim Kueneman [jimdk@m...]
Date: Wed Feb 13, 2002 2:00 am
Subject: Re: [VirtualTreeview] Want to use VirtualTree

Hi again,

>(the FlyTreeview simulates a stringgrid behavior). I think this control in
>using too much memory. The second main control I use is Julian Ziersch's
>WPTools.

> Do you think it is suitable for my application?

Maybe, With VT create an example and generate a tree with 80,000 nodes,
that is the memory it will take. The data is up to you, completely. VT
stores zero data it calls you back in events to ask for everything.

Wordwrap is not supported though some have decided to try to use the owner
draw decendant to try to do it themselves, I have never heard if they were
successful.

VT supports popup hint windows with a variaty of animation options.

>What would be the cost of VirtualTreeview?

The component is free, the cost comes from trying to learn how to use it <g>

> Can I have nodes (text) of different colors?

Yes,

> Does VT support wordwrap?

No

>Can I change the font of text?

Yes

>Can I change the height of nodes?

Yes (and make them invisible)

>Please, where can I find a manual with examples about how to use
>VirtualTree?

The help that comes with it is all you get other than this group which is
usually very helpful.

Jim


Creating a new editor...

From: "johnhutchings2001" [sales@d...]
Date: Wed Feb 13, 2002 3:34 am
Subject: Creating a new editor...

To build a working new editor outside VT.pas I need to do a lot of
messing around simply because a whole bunch of properties are
protected and not public.

Is it possible to make editor creating simpler by changing the access
to ALL properties and fields??

 | Replies | Author | Date
5324 | Re: Creating a new editor... | Jim Kueneman | Wed 2/13/2002
5331 | Re: Creating a new editor... | johnhutchings2001 | Wed 2/13/2002
5333 | Re: Creating a new editor... | Jim Kueneman | Thu 2/14/2002
5325 | Re: Creating a new editor... | GIANNAKOPOULOS KOSTAS | Wed 2/13/2002
5332 | Re: Creating a new editor... | johnhutchings2001 | Wed 2/13/2002
5334 | Re: Creating a new editor... | Peter Evans | Thu 2/14/2002
5335 | Re: Creating a new editor... | GIANNAKOPOULOS KOSTAS | Thu 2/14/2002


re: Creating a new editor...

From: Jim Kueneman [jimdk@m...]
Date: Wed Feb 13, 2002 3:53 am
Subject: Re: [VirtualTreeview] Creating a new editor...

Hi,

>To build a working new editor outside VT.pas I need to do a lot of
>messing around simply because a whole bunch of properties are
>protected and not public.
>
>Is it possible to make editor creating simpler by changing the access
>to ALL properties and fields??

You can't do what you want through the Editor Interface like the examples
and the text editor?

Jim

 | Replies | Author | Date
5331 | Re: Creating a new editor... | johnhutchings2001 | Wed 2/13/2002
5333 | Re: Creating a new editor... | Jim Kueneman | Thu 2/14/2002


re: Creating a new editor...

From: GIANNAKOPOULOS KOSTAS [kyan@s...]
Date: Wed Feb 13, 2002 9:10 am
Subject: RE: [VirtualTreeview] Creating a new editor...

> To build a working new editor outside VT.pas I need to do a lot of
> messing around simply because a whole bunch of properties are
> protected and not public.

I have implemented a bunch of editors for VT including Edit, ComboBox, Memo,
DateTimePicker and some of other controls i've written. I never had to
access anything other than those properties already available in VT. So i
really can't think of what your problem might be. If you can be more
specific then the group may be able to help you.

> Is it possible to make editor creating simpler by changing the access
> to ALL properties and fields??

I think this is out of the question, any Delphi component writer would tell
you this.

 | Replies | Author | Date
5332 | Re: Creating a new editor... | johnhutchings2001 | Wed 2/13/2002


OnCreateEditor

From: GIANNAKOPOULOS KOSTAS [kyan@s...]
Date: Wed Feb 13, 2002 10:42 am
Subject: OnCreateEditor

Good morning Mike.

If an OnCreateEditor event handler returns a nil IVTEditLink interface the
tree raises an Exception.
I know that i can prevent editing of a node using OnEditing and setting
Allowed to False, but just for convenience could you please not raise an
exception if OnCreateEditor returns nil. The nil editor interface be seen as
an indication that the cell cannot be edited at the time.

I took a look at the code and i don't think this will cause complications,
but of course you know better.

TIA

<KY>

 | Replies | Author | Date
5347 | Re: OnCreateEditor | Mike Lischke | Sun 2/17/2002
5367 | Re: OnCreateEditor | GIANNAKOPOULOS KOSTAS | Mon 2/18/2002


re: Focusing a specific node(selecting it)

From: "Radu Turcu" [rturcu@t...]
Date: Thu Feb 14, 2002 3:08 am
Subject: Re: [VirtualTreeview] Focusing a specific node(selecting it)

VST.FocusedNode := Node; - set focus to node "Node'

VST.Selected[Node] := true; - select the node "Node'

----- Original Message -----
From: "Dion" [dion@n...]
To: <VirtualTreeview@yahoogroups.com>
Sent: Monday, February 11, 2002 8:30 PM
Subject: [VirtualTreeview] Focusing a specific node(selecting it)

> Hi,
>
> How do you select a node(or give it focus, as in clicking on it)?
>
> Regards,
> Dion.
>
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.314 / Virus Database: 175 - Release Date: 01/11/2002
>
>
>
>
> To unsubscribe from this group, send an email to:
> VirtualTreeview-unsubscribe@egroups.com
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>


re: Focusing a specific node(selecting it)

From: "Radu Turcu" [rturcu@t...]
Date: Thu Feb 14, 2002 3:22 am
Subject: Re: [VirtualTreeview] Focusing a specific node(selecting it)

with vtGradeTree do
begin
ClearSelection();
Selected[GetFirst] := true ;
end;

or set
vtGradeTree.TreeOptions.SelectionOptions.toMultiSelect to True to allow
multiselect

----- Original Message -----
From: "Dion" [dion@n...]
To: [VirtualTreeview@yahoogroups.com>
Sent: Tuesday, February 12, 2002 2:09 AM
Subject: RE: [VirtualTreeview] Focusing a specific node(selecting it)

> Hi Helge,
>
> I need to have the VT display the root node as the selected(ie must have
> blue background) one when the form owning the VT gets created.
>
> I tried the following with no success. This was a simple process using
> TTreeView :-
>
> with vtGradeTree do
> begin
> Selected[GetFirst] := true ;
> end;
>
> Many Thanks,
> Dion.
>
>
> -----Original Message-----
> From: Helge Jung (ECO-Logic) [mailto:helge@e...]]
> Sent: Monday, February 11, 2002 2:18 PM
> To: VirtualTreeview@yahoogroups.com
> Subject: Re: [VirtualTreeview] Focusing a specific node(selecting it)
>
>
> > How do you select a node(or give it focus, as in clicking on it)?
>
> VST.FocusedNode := TheNode;
> VST.Selected[TheNode] := true;
>
> Helge.
>
>
>
> To unsubscribe from this group, send an email to:
> VirtualTreeview-unsubscribe@egroups.com
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>
> ---
> Incoming mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.314 / Virus Database: 175 - Release Date: 01/11/2002
>
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.314 / Virus Database: 175 - Release Date: 01/11/2002
>
>
>
>
> To unsubscribe from this group, send an email to:
> VirtualTreeview-unsubscribe@egroups.com
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>

 | Replies | Author | Date
5336 | Re: Focusing a specific node(selecting it) | Dion | Fri 2/15/2002


re: Want to use VirtualTree

From: "Carlos Eduardo Borrero" [cbarrer@e...]
Date: Wed Feb 13, 2002 6:32 pm
Subject: RE: [VirtualTreeview] Want to use VirtualTree

Hello again Jim:

Thank you very much for your valuable help.

Whenever you hear if someone succeeded with wordwarp, please tell it to me
if possible.

Best regards,

Carlos Borrero


Wordwrap support

From: "Carlos Eduardo Borrero" [cbarrer@e...]
Date: Wed Feb 13, 2002 6:38 pm
Subject: Wordwrap support

Hello:

Thank you for your attention.

I want to use VT but have to solve a feature that I need to have in my
application: WordWrap.

Maybe, do you know how to implement it?

Thank you in advance for your help.

Best regards,

Carlos Borrero

----- Mensaje original -----
De: "Jim Kueneman" [jimdk@m...]
Para: <VirtualTreeview@yahoogroups.com>
Enviado: martes, 12 de febrero de 2002 21:00
Asunto: Re: [VirtualTreeview] Want to use VirtualTree

>
> Hi again,
>
> >(the FlyTreeview simulates a stringgrid behavior). I think this control
in
> >using too much memory. The second main control I use is Julian Ziersch's
> >WPTools.
>
> > Do you think it is suitable for my application?
>
> Maybe, With VT create an example and generate a tree with 80,000 nodes,
> that is the memory it will take. The data is up to you, completely. VT
> stores zero data it calls you back in events to ask for everything.
>
> Wordwrap is not supported though some have decided to try to use the owner
> draw decendant to try to do it themselves, I have never heard if they were
> successful.
>
> VT supports popup hint windows with a variaty of animation options.
>
> >What would be the cost of VirtualTreeview?
>
> The component is free, the cost comes from trying to learn how to use it
<g>
>
> > Can I have nodes (text) of different colors?
>
> Yes,
>
> > Does VT support wordwrap?
>
> No
>
> >Can I change the font of text?
>
> Yes
>
> >Can I change the height of nodes?
>
> Yes (and make them invisible)
>
> >Please, where can I find a manual with examples about how to use
> >VirtualTree?
>
> The help that comes with it is all you get other than this group which is
> usually very helpful.
>
> Jim
>
>
>
> To unsubscribe from this group, send an email to:
> VirtualTreeview-unsubscribe@egroups.com
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>
>


re: Creating a new editor...

From: "johnhutchings2001" [sales@d...]
Date: Wed Feb 13, 2002 6:52 pm
Subject: Re: Creating a new editor...

--- In [VirtualTreeview@y...], Jim Kueneman [jimdk@m...] wrote:
>
>
> Hi,
>
> >To build a working new editor outside VT.pas I need to do a lot of
> >messing around simply because a whole bunch of properties are
> >protected and not public.
> >
> >Is it possible to make editor creating simpler by changing the
access
> >to ALL properties and fields??
>
> You can't do what you want through the Editor Interface like the
examples
> and the text editor?
>
> Jim

Jim,

Thanks for the pointers to working examples. I was working from the
editor found in VT.pas as a template and found that this works only
while in the VT.pas unit. I will have a good look at your examples.

I notice you pass a direct assignment back as the Innterface
reference, for example

procedure TVSTEditor.LinkNumEditor(var EditLink: IVTEditLink; Value:
Double);
begin
FLink := TVSTEditorLink.Create;
FLink.EditorLink := Self;
FLink.EditType := etNumEditor;
EditLink := FLink;

I have been using the call
Supports(FLink,IVTEditLink,EditLink);
rather than
EditLink:=FLink;
to make the assignment. Is this supports not necessary?

I presume the VT disposes of the editor after each use. If I have a
common editor for a column (say a select list), how can I keep a copy
of this and pass a reference back to VT each time. I thought that if
I kept a local copy of the interface (ie keep ref count>0) then I
could reuse this editor. I can't make this work for VT. Any
thoughts?

 | Replies | Author | Date
5333 | Re: Creating a new editor... | Jim Kueneman | Thu 2/14/2002


re: Creating a new editor...

From: "johnhutchings2001" [sales@d...]
Date: Wed Feb 13, 2002 6:57 pm
Subject: Re: Creating a new editor...

--- In [VirtualTreeview@y...], GIANNAKOPOULOS KOSTAS [kyan@s...] wrote:
> > To build a working new editor outside VT.pas I need to do a lot
of
> > messing around simply because a whole bunch of properties are
> > protected and not public.
>
> I have implemented a bunch of editors for VT including Edit,
ComboBox, Memo,
> DateTimePicker and some of other controls i've written. I never had
to
> access anything other than those properties already available in
VT. So i
> really can't think of what your problem might be. If you can be more
> specific then the group may be able to help you.
>
> > Is it possible to make editor creating simpler by changing the
access
> > to ALL properties and fields??
>
> I think this is out of the question, any Delphi component writer
would tell
> you this.

Thanks for the reply. I have some pointers to good examples. My
frustration came from working with the editor found in VT.pas and
trying to get it going outside vt.pas. I was lamenting that all the
properties necessary to make that editor work outside vt.pas be made
public NOT ALL properties. It seems that the functionality used
within VT.pas is not necessary to get an editor going.


re: Re: Creating a new editor...

From: Jim Kueneman [jimdk@m...]
Date: Thu Feb 14, 2002 2:54 am
Subject: Re: [VirtualTreeview] Re: Creating a new editor...

>Thanks for the pointers to working examples. I was working from the
>editor found in VT.pas as a template and found that this works only
>while in the VT.pas unit. I will have a good look at your examples.

Um, I think you have Manfred's examples. Mine is only one editor and very
simple.

>I notice you pass a direct assignment back as the Innterface
>reference, for example
>
>procedure TVSTEditor.LinkNumEditor(var EditLink: IVTEditLink; Value:
>Double);
>begin
> FLink := TVSTEditorLink.Create;
> FLink.EditorLink := Self;
> FLink.EditType := etNumEditor;
> EditLink := FLink;
>
>I have been using the call
> Supports(FLink,IVTEditLink,EditLink);
>rather than
> EditLink:=FLink;
> to make the assignment. Is this supports not necessary?

Not necessary. Supports is only necessary if you have an interface that
you don't know if it exposes another interface. Since you are
implementing the object that exposes the interface you know it is ok.

You should be able to make a local variable:

type
TForm1 = class(TForm)
private
{ Private declarations }
MyEditLink: IVTEditLink << Make sure this is the Interface
public
{ Public declarations }
end;

Then:

procedure TVSTEditor.LinkNumEditor(var EditLink: IVTEditLink; Value: Double);
var
FLink: TVSTEditorLink;
begin
if not Assigned(MyEditLink) then
begin
// This does not do anything with reference counting but we need the
delphi class for the property access
FLink := TVSTEditorLink.Create;
FLink.EditorLink := Self;
FLink.EditType := etNumEditor;
// This sets a reference count to 1so we can reuse the object
MyEditLink := FLink as IVTEditLink;
end;
// Should set count to 2 so when VT releases the object is not freed and
can be reused the next time around
EditLink := MyEditLink;
end;

Jim


re: Creating a new editor...

From: "Peter Evans" [pgevans@m...]
Date: Thu Feb 14, 2002 3:46 am
Subject: Re: [VirtualTreeview] Creating a new editor...

Giannakopoulos,

>
> I have implemented a bunch of editors for VT including Edit, ComboBox,
Memo,
> DateTimePicker and some of other controls i've written. I never had to
> access anything other than those properties already available in VT. So i
> really can't think of what your problem might be. If you can be more
> specific then the group may be able to help you.
>

I am particularly interested in a Memo editor and DateTimePicker editor.
Have you released your code to the VirtualTreeview site?
Are those editors available from the site and made available by someone
else?

Regards, Peter Evans


re: Creating a new editor...

From: GIANNAKOPOULOS KOSTAS [kyan@s...]
Date: Thu Feb 14, 2002 8:59 am
Subject: RE: [VirtualTreeview] Creating a new editor...

> Giannakopoulos,

OK, my first name is Constantine (Kostas for short), i haven't figured out
how to change this silly reverse notation in Outlook :-)

> I am particularly interested in a Memo editor and
> DateTimePicker editor.
> Have you released your code to the VirtualTreeview site?
> Are those editors available from the site and made available
> by someone
> else?

Well, i didn't want to release my code to the group because i didn't think
it was so important; other people have done similar work. I'll send it
directly to you by eMail. Hope it doesn't bounce back.


re: Focusing a specific node(selecting it)

From: "Dion" [dion@n...]
Date: Fri Feb 15, 2002 1:43 pm
Subject: RE: [VirtualTreeview] Focusing a specific node(selecting it)

Thanks,

Dion.

-----Original Message-----
From: Radu Turcu [mailto:[rturcu@t...]]
Sent: Wednesday, February 13, 2002 7:22 PM
To: [VirtualTreeview@yahoogroups.com
Subject: Re: [VirtualTreeview] Focusing a specific node(selecting it)

with vtGradeTree do
begin
ClearSelection();
Selected[GetFirst] := true ;
end;

or set
vtGradeTree.TreeOptions.SelectionOptions.toMultiSelect to True to allow
multiselect

----- Original Message -----
From: "Dion" [dion@n...]
To: <VirtualTreeview@yahoogroups.com>
Sent: Tuesday, February 12, 2002 2:09 AM
Subject: RE: [VirtualTreeview] Focusing a specific node(selecting it)

> Hi Helge,
>
> I need to have the VT display the root node as the selected(ie must have
> blue background) one when the form owning the VT gets created.
>
> I tried the following with no success. This was a simple process using
> TTreeView :-
>
> with vtGradeTree do
> begin
> Selected[GetFirst] := true ;
> end;
>
> Many Thanks,
> Dion.
>
>
> -----Original Message-----
> From: Helge Jung (ECO-Logic) [mailto:helge@e...]]
> Sent: Monday, February 11, 2002 2:18 PM
> To: VirtualTreeview@yahoogroups.com
> Subject: Re: [VirtualTreeview] Focusing a specific node(selecting it)
>
>
> > How do you select a node(or give it focus, as in clicking on it)?
>
> VST.FocusedNode := TheNode;
> VST.Selected[TheNode] := true;
>
> Helge.
>
>
>
> To unsubscribe from this group, send an email to:
> VirtualTreeview-unsubscribe@egroups.com
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>
> ---
> Incoming mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.314 / Virus Database: 175 - Release Date: 01/11/2002
>
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.314 / Virus Database: 175 - Release Date: 01/11/2002
>
>
>
>
> To unsubscribe from this group, send an email to:
> VirtualTreeview-unsubscribe@egroups.com
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>

To unsubscribe from this group, send an email to:
VirtualTreeview-unsubscribe@egroups.com

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/

---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.314 / Virus Database: 175 - Release Date: 01/11/2002

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.314 / Virus Database: 175 - Release Date: 01/11/2002


MIKE - Explorer

From: "Dion" [dion@n...]
Date: Fri Feb 15, 2002 1:45 pm
Subject: MIKE - Explorer

Can I simulate MS Explorer?

Many Thanks,
Dion

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.314 / Virus Database: 175 - Release Date: 01/11/2002

 | Replies | Author | Date
5338 | Re: MIKE - Explorer | Jim Kueneman | Fri 2/15/2002
5366 | Re: MIKE - Explorer | Dion | Mon 2/18/2002
5370 | Re: MIKE - Explorer | Jim Kueneman | Mon 2/18/2002
5372 | Re: MIKE - Explorer | Dion | Tue 2/19/2002
5377 | Re: MIKE - Explorer | Jim Kueneman | Wed 2/20/2002
5379 | Re: MIKE - Explorer | Dion | Wed 2/20/2002
5386 | Re: MIKE - Explorer | Jim Kueneman | Wed 2/20/2002
5613 | Re: MIKE - Explorer | Dion | Thu 3/21/2002
5413 | Re: MIKE - Explorer | jimkueneman | Sat 2/23/2002


re: MIKE - Explorer

From: Jim Kueneman [jimdk@m...]
Date: Fri Feb 15, 2002 4:09 am
Subject: Re: [VirtualTreeview] MIKE - Explorer

Hi,

>Can I simulate MS Explorer?

Sure you can but you will be duplicating 8 months of my work:

http://groups.yahoo.com/group/VirtualExplorerTree/

Jim

 | Replies | Author | Date
5366 | Re: MIKE - Explorer | Dion | Mon 2/18/2002
5370 | Re: MIKE - Explorer | Jim Kueneman | Mon 2/18/2002
5372 | Re: MIKE - Explorer | Dion | Tue 2/19/2002
5377 | Re: MIKE - Explorer | Jim Kueneman | Wed 2/20/2002
5379 | Re: MIKE - Explorer | Dion | Wed 2/20/2002
5386 | Re: MIKE - Explorer | Jim Kueneman | Wed 2/20/2002
5613 | Re: MIKE - Explorer | Dion | Thu 3/21/2002
5413 | Re: MIKE - Explorer | jimkueneman | Sat 2/23/2002
5435 | Re: MIKE - Explorer | Dion | Mon 2/25/2002


re: A Couple Questions

From: "Mike Lischke" [lists@l...]
Date: Sat Feb 16, 2002 3:31 pm
Subject: RE: [VirtualTreeview] A Couple Questions

Hi Roger,

> 1-OnAddNode

This action can be captured by the OnStructureChange event.

> 2-OnAddColumn

I'm not sure about this. General usage is rather limited.

> Another thing I was wondering about is if it is possible to make the
> initial creation of a VT component have header option preset and have a
> given number of columns preset?

What is the problem? Just add the columns and do other preparations in the
constructor of your
dervied class.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: Assertion failed

From: "Mike Lischke" [lists@l...]
Date: Sat Feb 16, 2002 3:58 pm
Subject: RE: [VirtualTreeview] Assertion failed

Hi Jiri,

> Put focus to the VT but do not select any node. Press and holt shift key and
> pres down arrow. It should select the first item in the tree, but instead it
> shows an assertion error "Nodes must never be nil".

This is indeed a bug, which is caused by an unassigned range anchor (because no
node is selected
yet). I have taken measures to avoid that problem in the future.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: Header Shortcuts(clicks?)

From: "Mike Lischke" [lists@l...]
Date: Sat Feb 16, 2002 4:16 pm
Subject: RE: [VirtualTreeview] Header Shortcuts(clicks?)

Hi Jim,

> What are the supported mouse clicks in the VT header?

Supported are all regular versions (single and double click, left, middle and
right button).

>Is it a double
> click in the size area that auto sizes the column?

If you mean the splitter with "size area" then yes.

>If so how do you
> detect a DblClick vs a regular click?

I do not detect that. Windows does this. I get either a single click message
(actually a mouse down
message) or a double click message. However, you will always also get a mouse
down message before a
double click message arrives.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


VT and Kylix

From: "Mike Lischke" [lists@l...]
Date: Sat Feb 16, 2002 7:58 pm
Subject: VT and Kylix

Hi all,

there is a saying which goes: "First do the possible, then do the necessary and
suddenly you have
done the impossible." (Hopefully the english translation is understandable :-)).

Now I got very interesting news. First the possible has been done: Virtual
Treeview; then the
necessary has been done: all ActiveX/OLE stuff commented out; and finally the
impossible happend:
there is a first version of Virtual Treeview compiled with Kylix 2 and running
on Linux.

The author told me that he wants to stabilize VT first ("... its like a
helpless little child...")
before he wants to go public (he talked about two weeks, but better add the
usual 100% offset).
However I want that you know what is going on with VT, so stay tuned ...

Ciao, Mike
--
Delphi Gems: http://delphigems.lischke-online.de
Delphi Unicode Center: http://www.delphi-unicode.net
Virtual Treeview: http://virtualtreeview.lischke-online.de
Windows XP Theme Manager: http://www.lischke-online.de/ThemeManager.html

 | Replies | Author | Date
5343 | Re: VT and Kylix | Helge Jung (ECO-Logic) | Sat 2/16/2002
5344 | Re: VT and Kylix | Mike Lischke | Sat 2/16/2002
5346 | Re: VT and Kylix | Werner Lehmann | Sat 2/16/2002
5418 | Re: VT and Kylix | Mike Lischke | Sat 2/23/2002
5369 | Re: VT and Kylix | Ralf Junker | Mon 2/18/2002
5415 | Re: VT and Kylix | Mike Lischke | Sat 2/23/2002


re: VT and Kylix

From: "Helge Jung \(ECO-Logic\)" [helge@e...]
Date: Sat Feb 16, 2002 8:17 pm
Subject: Re: [VirtualTreeview] VT and Kylix

> there is a saying which goes: "First do the possible, then do the
> necessary and suddenly you have
> done the impossible." (Hopefully the english translation is
> understandable :-)).

I could understand it ... and I don't know the original one (I assume you
meant a German one).

> there is a first version of Virtual Treeview compiled with Kylix
> 2 and running on Linux.

WOW!!! That means we can run our software under Linux, too! Super! That are
fantastic news! Wait a moment, I've to phone my boss!

> The author told me that he wants to stabilize VT first ("... its
> like a helpless little child...")
> before he wants to go public (he talked about two weeks, but
> better add the usual 100% offset).

That's no problem! I thought about looking at all that stuff for myself some
time ago but I realised that I don't have enough time for that.

Helge.

 | Replies | Author | Date
5344 | Re: VT and Kylix | Mike Lischke | Sat 2/16/2002


re: VT and Kylix

From: "Mike Lischke" [lists@l...]
Date: Sat Feb 16, 2002 8:25 pm
Subject: RE: [VirtualTreeview] VT and Kylix

> I could understand it ... and I don't know the original one (I assume you
> meant a German one).

Yes, one of my favourite: "Erst tue das Notwendige, dann das Mogliche und
plotzlich hast du das
Unmogliche geschafft".

Btw: I just realize I have translated in the wrong order. It should go: "First
do the necessary,
then the possible and suddenly you have done the impossible". Sorry, for being
off topic :-)

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


Multiline captions

From: "spdev00" [spdev00@y...]
Date: Sat Feb 16, 2002 9:02 pm
Subject: Multiline captions

Hi Mike,

I was reading the other posts regarding Multiline captions on VT
(http://groups.yahoo.com/group/VirtualTreeview/message/3585).
Mike said the problem with multiline text is the vertical alignment.

Wouldn't be possible to add a Multiline property to
TVirtualTreeColumn?
And then in VST PaintNormalText/PaintStaticText:
....
if not Header.Columns[PaintInfo.Column].Multiline then
DrawFormat := DT_VCENTER or DT_SINGLELINE;
....

Or add a new OnGetTextFormat to get the text format integer before
the paint occurs.

Is multiline captions planned for a future version of VT?

Is the alignment the only problem with multiline text? How about the
editors?

Regards,
Robert.

PD: I have posted this message to the forums.talkto.net newsgroup but
it seems it doesn't shows up.

 | Replies | Author | Date
5414 | Re: Multiline captions | Mike Lischke | Sat 2/23/2002


re: VT and Kylix

From: Werner Lehmann [wl@b...]
Date: Sat Feb 16, 2002 10:53 pm
Subject: Re: [VirtualTreeview] VT and Kylix

Mike Lischke wrote:
>
> > I could understand it ... and I don't know the original one (I assume you
> > meant a German one).
>
> Yes, one of my favourite: "Erst tue das Notwendige, dann das Mogliche und
plotzlich hast du das
> Unmogliche geschafft".
>
> Btw: I just realize I have translated in the wrong order. It should go:
"First do the necessary,
> then the possible and suddenly you have done the impossible". Sorry, for
being off topic :-)

I already wondered... :>

Congrats to the Kylix news. If I am not mistaken there is no message queue as
under Windows. How is this handled then? And: a Kylix version means two source
files, correct? Otherwise we would have far too many ifdefs. I believe I have
read somewhere that Borland even recommends this for components.

Werner

 | Replies | Author | Date
5418 | Re: VT and Kylix | Mike Lischke | Sat 2/23/2002


re: OnCreateEditor

From: "Mike Lischke" [lists@l...]
Date: Sun Feb 17, 2002 9:32 am
Subject: RE: [VirtualTreeview] OnCreateEditor

Hi Kostas,

> If an OnCreateEditor event handler returns a nil IVTEditLink interface the
> tree raises an Exception.
> I know that i can prevent editing of a node using OnEditing and setting
> Allowed to False, but just for convenience could you please not raise an
> exception if OnCreateEditor returns nil. The nil editor interface be seen as
> an indication that the cell cannot be edited at the time.

The point here is that the exception serves a very similar task as the
"abstract" directive. It is a
reminder that you have to provide an editor in your descentant class if your
tree is going into edit
mode. The semantic is quite different to what you want.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


Header popup menu

From: "Peter Evans" [pgevans@m...]
Date: Sun Feb 17, 2002 12:18 pm
Subject: Header popup menu

I am using the component TVTHeaderPopupMenu. I have set the property
Header.PopupMenu to
TVTHeaderPopupMenu.

I have succeeded in getting on the popup menu all the columns. I can then
click on the column on the menu so that the
column is not shown.

I now want to have one column to always appear on the screen. I do not want
the user to delete it.

How do I go about doing that?

Regards, Peter Evans

 | Replies | Author | Date
5349 | Re: Header popup menu | Mike Lischke | Sun 2/17/2002
5362 | Re: Header popup menu | Peter Evans | Mon 2/18/2002
5363 | Re: Header popup menu > Please read this one Mike | Jim Kueneman | Mon 2/18/2002
5419 | Re: Header popup menu > Please read this one Mik | Mike Lischke | Sat 2/23/2002


re: Header popup menu

From: "Mike Lischke" [lists@l...]
Date: Sun Feb 17, 2002 12:57 pm
Subject: RE: [VirtualTreeview] Header popup menu

Peter,

> I now want to have one column to always appear on the screen. I do not want
> the user to delete it.

In TVTHeaderPopupMenu.OnMenuItemClick you could check if the given menu item is
the last checked (if
it is being unchecked) and stop processing if it is the last one.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


problem with WideString

From: "ei97005" [ei97005@f...]
Date: Sun Feb 17, 2002 9:36 pm
Subject: problem with WideString

Hi!

I've been reading the problems with memory leaks because of some
datatypes like widestrings, and although I've been reading them, I
haven't solved my problem yet :

I have a structure like

record
name : widestring;
path : widestring;
... //integers and so on (not important on problem)
end;

....

what exactly do I have to write on events :
* InitNode
* FreeNode

so the memory leaks don't happen?

thanks

 | Replies | Author | Date
5356 | Re: problem with WideString | Jim Kueneman | Sun 2/17/2002
5357 | Re: problem with WideString | ei97005 | Sun 2/17/2002
5358 | Re: problem with WideString | Jim Kueneman | Sun 2/17/2002
5359 | Re: problem with WideString | Werner Lehmann | Sun 2/17/2002
5360 | Re: problem with WideString | ei97005 | Sun 2/17/2002
5361 | Re: problem with WideString | Jim Kueneman | Sun 2/17/2002
5364 | Re: problem with WideString | ei97005 | Mon 2/18/2002
5365 | Re: problem with WideString | Jim Kueneman | Mon 2/18/2002


re: problem with WideString

From: Jim Kueneman [jimdk@m...]
Date: Sun Feb 17, 2002 9:53 pm
Subject: Re: [VirtualTreeview] problem with WideString

>what exactly do I have to write on events :
>* InitNode

Nothing special

>* FreeNode

Get the Pointer to your structure using GetNodeData then call Finalize

var
Data: PMyDataStruct;

Data := GetNodeData(Node);
Finalize(Data^);
// or it may be Finalize(Data) the compiler will tell you

Jim

 | Replies | Author | Date
5357 | Re: problem with WideString | ei97005 | Sun 2/17/2002
5358 | Re: problem with WideString | Jim Kueneman | Sun 2/17/2002


re: problem with WideString

From: "ei97005" [ei97005@f...]
Date: Sun Feb 17, 2002 9:55 pm
Subject: Re: problem with WideString

thanks jim.

I made it thanks to your Finalize(), but the only way to REALLY
release all is :

procedure TFormMain.TreeFileListFreeNode(Sender: TBaseVirtualTree;
Node: PVirtualNode);
var teste : PTreeFileData;
begin
Teste := Sender.GetNodeData(Node);

if Assigned(teste) then
begin
teste.Name := '';
teste.Folder := '';
end;

Finalize(teste);
end;

 | Replies | Author | Date
5358 | Re: problem with WideString | Jim Kueneman | Sun 2/17/2002


re: Re: problem with WideString

From: Jim Kueneman [jimdk@m...]
Date: Sun Feb 17, 2002 10:15 pm
Subject: Re: [VirtualTreeview] Re: problem with WideString

> if Assigned(teste) then
> begin
> teste.Name := '';
> teste.Folder := '';
> end;

This should not be necessary with Finalize, this is the way I have done it
all along and have not leaks (as far as MemProof is concerned)

Ok I looked it up you need this:

Finalize(teste^);

assuming teste is a pointer to the record

> Finalize(teste);
>end;

Don't for get to free the record either!

FreeMem(Data)

Jim


re: Re: problem with WideString

From: Werner Lehmann [wl@b...]
Date: Sun Feb 17, 2002 11:03 pm
Subject: Re: [VirtualTreeview] Re: problem with WideString

Jim Kueneman wrote:
>
> Don't for get to free the record either!
>
> FreeMem(Data)

Shouldn't the tree itself do this?

Werner

 | Replies | Author | Date
5360 | Re: problem with WideString | ei97005 | Sun 2/17/2002
5361 | Re: problem with WideString | Jim Kueneman | Sun 2/17/2002
5364 | Re: problem with WideString | ei97005 | Mon 2/18/2002
5365 | Re: problem with WideString | Jim Kueneman | Mon 2/18/2002


re: problem with WideString

From: "ei97005" [ei97005@f...]
Date: Sun Feb 17, 2002 11:30 pm
Subject: Re: problem with WideString

freemem (data)???

where do I put it?

as Werner said, I thought the Tree should do it as well!

regards

--- In [VirtualTreeview@y...], Werner Lehmann [wl@b...] wrote:
> Jim Kueneman wrote:
> >
> > Don't for get to free the record either!
> >
> > FreeMem(Data)
>
> Shouldn't the tree itself do this?
>
> Werner


re: Re: problem with WideString

From: Jim Kueneman [jimdk@m...]
Date: Sun Feb 17, 2002 11:49 pm
Subject: Re: [VirtualTreeview] Re: problem with WideString

At 12:03 AM 2/18/2002 +0100, you wrote:
>Jim Kueneman wrote:
> >
> > Don't for get to free the record either!
> >
> > FreeMem(Data)
>
>Shouldn't the tree itself do this?

Sorry very incomplete thought there. Assuming you created the record by
using GetMem then use need to call FreeMem on the pointer. In this case
NodeDataSize is just a single pointer not the whole record. Hmmm.....
maybe that is why Finalize is not working for you, I have not done it that
way before. I seem to like to only store a Pointer in the tree and create
my own memory block of the record size and store just the pointer. In that
case I know Finalize works.

Jim

 | Replies | Author | Date
5364 | Re: problem with WideString | ei97005 | Mon 2/18/2002
5365 | Re: problem with WideString | Jim Kueneman | Mon 2/18/2002


re: Header popup menu

From: "Peter Evans" [pgevans@m...]
Date: Mon Feb 18, 2002 2:10 am
Subject: Re: [VirtualTreeview] Header popup menu

>
> > I now want to have one column to always appear on the screen. I do not
want
> > the user to delete it.
>

I should have made myself more clear.
I mean I do not want the Column's name to appear on the popup menu.
Currently all the Columns automatically appear on the menu.

Reagrds, Peter Evans

 | Replies | Author | Date
5363 | Re: Header popup menu > Please read this one Mike | Jim Kueneman | Mon 2/18/2002
5419 | Re: Header popup menu > Please read this one Mik | Mike Lischke | Sat 2/23/2002


re: Header popup menu > Please read this one Mike

From: Jim Kueneman [jimdk@m...]
Date: Mon Feb 18, 2002 3:20 am
Subject: Re: [VirtualTreeview] Header popup menu > Please read this one Mike

Hi Peter, Mike,

>I should have made myself more clear.
>I mean I do not want the Column's name to appear on the popup menu.
>Currently all the Columns automatically appear on the menu.

I uploaded a modified version of the VTHeaderPopup.zip to

http://groups.yahoo.com/group/VirtualTreeview/files/

It has a filter event to allow you to not show an item or disable it.

Mike:
This seems like a good addition to this component. Please concider
adding this to the official distrbution.

Jim

 | Replies | Author | Date
5419 | Re: Header popup menu > Please read this one Mik | Mike Lischke | Sat 2/23/2002


re: problem with WideString

From: "ei97005" [ei97005@f...]
Date: Mon Feb 18, 2002 4:26 am
Subject: Re: problem with WideString

Trying not to be asking for much troble, could you post a little
example, where you use a wide string var inside the record?

I'm sorry for asking this, but I've never been very confortable with
pointers

thanks

 | Replies | Author | Date
5365 | Re: problem with WideString | Jim Kueneman | Mon 2/18/2002


re: Re: problem with WideString

From: Jim Kueneman [jimdk@m...]
Date: Mon Feb 18, 2002 5:13 am
Subject: Re: [VirtualTreeview] Re: problem with WideString

Hi,

>I'm sorry for asking this, but I've never been very confortable with
>pointers

I uploaded an example called VT_and_Pointers.zip here

http://groups.yahoo.com/group/VirtualTreeview/files/Examples/Delphi_Examples/Mis\
c_Examples/

Jim


re: MIKE - Explorer

From: "Dion" [dion@n...]
Date: Mon Feb 18, 2002 1:04 pm
Subject: RE: [VirtualTreeview] MIKE - Explorer

Hi Jim,

Maybe my original question was a little misleading. What I wanted to know
was whether I could simulate the way MS Explorer handles the right
lick( not simulate MS in its entirety) ie the node right clicked becomes the
focused one, and when you either escape from the popup or make a selection
the selected nodes returns to the previous one. I have downloaded your
components, but before I spend too much time investigating it, I need to
know whether the above scenario can't be implemented without too much extra
coding using TVirtualStringTree(albeit fudged!). Or, would this be a whole
lot easier using you component, TVirtualExplorerTree, Taking into account
that I don't want to display records from a DB - no Explorer specific
devices etc. By the way, (once again, I have not spent much time with your
component) does TVirtualExplorerTree display only Explorer specific data ie
as in MS Explorer(OS info, folders, devices etc).

Many Thanks,
Dion.

-----Original Message-----
From: Jim Kueneman [mailto:[jimdk@m...]]
Sent: Thursday, February 14, 2002 8:10 PM
To: VirtualTreeview@yahoogroups.com
Subject: Re: [VirtualTreeview] MIKE - Explorer

Hi,

>Can I simulate MS Explorer?

Sure you can but you will be duplicating 8 months of my work:

http://groups.yahoo.com/group/VirtualExplorerTree/

Jim

To unsubscribe from this group, send an email to:
VirtualTreeview-unsubscribe@egroups.com

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/

---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.314 / Virus Database: 175 - Release Date: 01/11/2002

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.314 / Virus Database: 175 - Release Date: 01/11/2002

 | Replies | Author | Date
5370 | Re: MIKE - Explorer | Jim Kueneman | Mon 2/18/2002
5372 | Re: MIKE - Explorer | Dion | Tue 2/19/2002
5377 | Re: MIKE - Explorer | Jim Kueneman | Wed 2/20/2002
5379 | Re: MIKE - Explorer | Dion | Wed 2/20/2002
5386 | Re: MIKE - Explorer | Jim Kueneman | Wed 2/20/2002
5613 | Re: MIKE - Explorer | Dion | Thu 3/21/2002
5413 | Re: MIKE - Explorer | jimkueneman | Sat 2/23/2002
5435 | Re: MIKE - Explorer | Dion | Mon 2/25/2002


re: OnCreateEditor

From: GIANNAKOPOULOS KOSTAS [kyan@s...]
Date: Mon Feb 18, 2002 9:56 am
Subject: RE: [VirtualTreeview] OnCreateEditor

> The point here is that the exception serves a very similar
> task as the "abstract" directive. It is a
> reminder that you have to provide an editor in your
> descentant class if your tree is going into edit
> mode. The semantic is quite different to what you want.

I still disagree, but i will not insist.

Oh, well... i was hoping i could same me some event handlers...


MS Explorer simulation

From: "Dion" [dion@n...]
Date: Mon Feb 18, 2002 8:08 pm
Subject: MS Explorer simulation

Hi Jim,

Maybe my original question was a little misleading. What I wanted to know
was whether I could simulate the way MS Explorer handles the right
lick( not simulate MS in its entirety) ie the node right clicked becomes the
focused one, and when you either escape from the popup or make a selection
the selected nodes returns to the previous one. I have downloaded your
components, but before I spend too much time investigating it, I need to
know whether the above scenario can't be implemented without too much extra
coding using TVirtualStringTree(albeit fudged!). Or, would this be a whole
lot easier using you component, TVirtualExplorerTree, Taking into account
that I don't want to display records from a DB - no Explorer specific
devices etc. By the way, (once again, I have not spent much time with your
component) does TVirtualExplorerTree display only Explorer specific data ie
as in MS Explorer(OS info, folders, devices etc).

Many Thanks,
Dion.

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.314 / Virus Database: 175 - Release Date: 01/11/2002


re: VT and Kylix

From: Ralf Junker [ralfjunker@g...]
Date: Sun Feb 17, 2002 9:53 am
Subject: Re: [VirtualTreeview] VT and Kylix

Hi Mike!

>The author told me that he wants to stabilize VT first

From following this group and the news server, I realize that there are a
coulple of bugs already fixed and some of them still open (speaking of version
3.0.4).

Do you intend to release a fixed version soon, and what timeframe for updates
do you have in mind?

Or have I missed something and an update is already available?

Regards,

Ralf

 | Replies | Author | Date
5415 | Re: VT and Kylix | Mike Lischke | Sat 2/23/2002


re: MIKE - Explorer

From: Jim Kueneman [jimdk@m...]
Date: Mon Feb 18, 2002 12:04 pm
Subject: RE: [VirtualTreeview] MIKE - Explorer

Hi Dion,

>Maybe my original question was a little misleading. What I wanted to know
>was whether I could simulate the way MS Explorer handles the right
>lick( not simulate MS in its entirety) ie the node right clicked becomes the
>focused one, and when you either escape from the popup or make a selection

Dooh, now I see, sorry. Not that I know of. The problems is you get a
Change event when you click any node with any button. Mike has chosen not
to support this in VT so you will have to fake it. I may be possible
through a decendant and trapping WM_RBUTTONDOWN and WM_RBUTTONUP.

Jim

 | Replies | Author | Date
5372 | Re: MIKE - Explorer | Dion | Tue 2/19/2002
5377 | Re: MIKE - Explorer | Jim Kueneman | Wed 2/20/2002
5379 | Re: MIKE - Explorer | Dion | Wed 2/20/2002
5386 | Re: MIKE - Explorer | Jim Kueneman | Wed 2/20/2002
5613 | Re: MIKE - Explorer | Dion | Thu 3/21/2002
5413 | Re: MIKE - Explorer | jimkueneman | Sat 2/23/2002
5435 | Re: MIKE - Explorer | Dion | Mon 2/25/2002


Startup help please?

From: "skipbremer" [skip.bremer@t...]
Date: Mon Feb 18, 2002 9:20 pm
Subject: Startup help please?

I've been doing Delphi since its beginning, but VT is humbling me
badly. I've looked thorugh the help, tried the examples, etc., but I
am still stumped.

What I need is a simple example of how to build a tree from data in a
text file. My text file looks like this:

First node|data1|data2|data3...
{tab}first child|data1|data2|data3...
{tab}second child|data1|data2|data3...
Second node|data1|data2|data3...
{tab}first child|data1|data2|data3...
etc.

I know how to cycle and grab this data and place it into a standard
treeview and I am doing that for my app now: the "First node" stuff
becomes the Text of each node and the data1... stuff get placed into
the data defined record for each node.

BUT I can't see from any example how to do this with VT.

Does anyone have a fairly complete example of pulling something from
a text file and wrapping it into at program start, i.e, automatically
in FormCreate, etc., for a vitrual tree???

Thanks very much.

 | Replies | Author | Date
5388 | Re: Startup help please? | Jim Kueneman | Wed 2/20/2002


re: MIKE - Explorer

From: "Dion" [dion@n...]
Date: Tue Feb 19, 2002 9:30 pm
Subject: RE: [VirtualTreeview] MIKE - Explorer

Hi Jim,

I really want the right click feature. Did any of Mike's previous versions
implement this? Reason being that I would like to use this as a guide as how
to implement this feature in current VT versions, and the best way to do
this for future versions. Any help will be greatly appreciated. You
implement this in VET, don't you?

Many Thanks,
Dion.

-----Original Message-----
From: Jim Kueneman [mailto:[jimdk@m...]]
Sent: Monday, February 18, 2002 4:05 AM
To: VirtualTreeview@yahoogroups.com
Subject: RE: [VirtualTreeview] MIKE - Explorer

Hi Dion,

>Maybe my original question was a little misleading. What I wanted to know
>was whether I could simulate the way MS Explorer handles the right
>lick( not simulate MS in its entirety) ie the node right clicked becomes
the
>focused one, and when you either escape from the popup or make a selection

Dooh, now I see, sorry. Not that I know of. The problems is you get a
Change event when you click any node with any button. Mike has chosen not
to support this in VT so you will have to fake it. I may be possible
through a decendant and trapping WM_RBUTTONDOWN and WM_RBUTTONUP.

Jim

To unsubscribe from this group, send an email to:
VirtualTreeview-unsubscribe@egroups.com

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/

---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.314 / Virus Database: 175 - Release Date: 01/11/2002

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.314 / Virus Database: 175 - Release Date: 01/11/2002

 | Replies | Author | Date
5377 | Re: MIKE - Explorer | Jim Kueneman | Wed 2/20/2002
5379 | Re: MIKE - Explorer | Dion | Wed 2/20/2002
5386 | Re: MIKE - Explorer | Jim Kueneman | Wed 2/20/2002
5613 | Re: MIKE - Explorer | Dion | Thu 3/21/2002
5413 | Re: MIKE - Explorer | jimkueneman | Sat 2/23/2002
5435 | Re: MIKE - Explorer | Dion | Mon 2/25/2002


Highlited node

From: "Dion" [dion@n...]
Date: Tue Feb 19, 2002 10:51 pm
Subject: Highlited node

Hi,

When I click on the white space of a tree, my selected node becomes
unselected. When I focus another control, I don't know which node is the
selected one. How can I prevent the selected node from 'looking unselected'.

Thanks,
Dion.

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.314 / Virus Database: 175 - Release Date: 01/11/2002

 | Replies | Author | Date
5376 | Re: Highlited node | rm198de | Tue 2/19/2002


Long node text hints...

From: "Dion" [dion@n...]
Date: Tue Feb 19, 2002 10:37 pm
Subject: Long node text hints...

Hi,

Is it possible to have a 'cell hint' for node text as well as static text
when this text is not visible(too long) within the tree boundaries?

Thanks,
Dion.

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.314 / Virus Database: 175 - Release Date: 01/11/2002

 | Replies | Author | Date
5401 | Re: Long node text hints... | valerykvv | Thu 2/21/2002
5428 | Re: Long node text hints... | Dion | Mon 2/25/2002
5431 | Re: Long node text hints... | Werner Lehmann | Mon 2/25/2002
5436 | Re: Long node text hints... | Dion | Mon 2/25/2002
5482 | Re: Long node text hints... | Mike Lischke | Sat 3/2/2002
5446 | Re: Long node text hints... | Werner Lehmann | Tue 2/26/2002
5447 | Re: Long node text hints... | Dion | Wed 2/27/2002


re: MIKE - Explorer

From: Werner Lehmann [wl@b...]
Date: Tue Feb 19, 2002 1:21 pm
Subject: Re: [VirtualTreeview] MIKE - Explorer

Dion wrote:
>
> I really want the right click feature. Did any of Mike's previous versions
> implement this? Reason being that I would like to use this as a guide as how
> to implement this feature in current VT versions, and the best way to do
> this for future versions. Any help will be greatly appreciated. You
> implement this in VET, don't you?

VT has never supported this, at least not for the past months. And btw, I am not
missing it much because this 'feature' has caused us some troubles in the
company
and it is hardly intuitive.

Werner


re: Highlited node

From: "rm198de" [rmelles@g...]
Date: Tue Feb 19, 2002 9:29 pm
Subject: Re: Highlited node

--- In [VirtualTreeview@y...], "Dion" [dion@n...] wrote:
> Hi,
>
> When I click on the white space of a tree, my selected node becomes
> unselected. When I focus another control, I don't know which node
is the
> selected one. How can I prevent the selected node from 'looking
unselected'.
>
> Thanks,
> Dion.
>

Hi Dion,

use FullRowSelect in your treeoptions. If you don`t set this property
to True, VT will only select a node by clicking on nodes used
textrectangle.

Regards
Ralf


re: MIKE - Explorer

From: Jim Kueneman [jimdk@m...]
Date: Wed Feb 20, 2002 5:47 am
Subject: RE: [VirtualTreeview] MIKE - Explorer

Hi Dion,

>this for future versions. Any help will be greatly appreciated. You
>implement this in VET, don't you?

No, I don't. I have been thinking about it and a decendant may be able to
trap the WM_RBUTTONDOWN and set a flag then save the current selected
node. The OnChange event can be filtered with the flag so any "selection"
action is skipped then on WM__RBUTTONUP set the selection back to the
original node. If you get it working please share it <g>

Jim

 | Replies | Author | Date
5379 | Re: MIKE - Explorer | Dion | Wed 2/20/2002
5386 | Re: MIKE - Explorer | Jim Kueneman | Wed 2/20/2002
5613 | Re: MIKE - Explorer | Dion | Thu 3/21/2002
5413 | Re: MIKE - Explorer | jimkueneman | Sat 2/23/2002
5435 | Re: MIKE - Explorer | Dion | Mon 2/25/2002


OnHint

From: "Dion" [dion@n...]
Date: Wed Feb 20, 2002 5:17 pm
Subject: OnHint

Hi,

How do you display a hint displaying those node captions, both the normal
and static text, which are not fully displayed due to for eg the treeview's
width not being wide enough? Can the hint style be changed?

Thanks,
Dion.

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.314 / Virus Database: 175 - Release Date: 01/11/2002


re: MIKE - Explorer

From: "Dion" [dion@n...]
Date: Wed Feb 20, 2002 5:21 pm
Subject: RE: [VirtualTreeview] MIKE - Explorer

Sorry to disagree Jim, but run the VET demo app, expand one of the drives so
that some folders are visible. Select one by clicking on it. Now right click
another. The user will get the impression that the one right clicked on is
the current folder. The right click menu pops up. Press escape. The original
selection is reinstated...

This is the effect I am looking for. Is this a VET feature or did you
'fudge' this in the demo?

Thanks,
Dion.

-----Original Message-----
From: Jim Kueneman [mailto:[jimdk@m...]]
Sent: Tuesday, February 19, 2002 9:47 PM
To: VirtualTreeview@yahoogroups.com
Subject: RE: [VirtualTreeview] MIKE - Explorer

Hi Dion,

>this for future versions. Any help will be greatly appreciated. You
>implement this in VET, don't you?

No, I don't. I have been thinking about it and a decendant may be able to
trap the WM_RBUTTONDOWN and set a flag then save the current selected
node. The OnChange event can be filtered with the flag so any "selection"
action is skipped then on WM__RBUTTONUP set the selection back to the
original node. If you get it working please share it <g>

Jim

To unsubscribe from this group, send an email to:
VirtualTreeview-unsubscribe@egroups.com

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/

---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.314 / Virus Database: 175 - Release Date: 01/11/2002

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.314 / Virus Database: 175 - Release Date: 01/11/2002

 | Replies | Author | Date
5386 | Re: MIKE - Explorer | Jim Kueneman | Wed 2/20/2002
5613 | Re: MIKE - Explorer | Dion | Thu 3/21/2002
5413 | Re: MIKE - Explorer | jimkueneman | Sat 2/23/2002
5435 | Re: MIKE - Explorer | Dion | Mon 2/25/2002


GridFor.DesignSize property does not exist...

From: "Dion" [dion@n...]
Date: Wed Feb 20, 2002 6:47 pm
Subject: GridFor.DesignSize property does not exist...

Hi,

I am running VT3.0. When I run the demo app I get a 'GridFor.DesignSize
property does not exist...' error?

Any Ideas,

Thanks,
Dion.

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.314 / Virus Database: 175 - Release Date: 01/11/2002

 | Replies | Author | Date
5382 | Re: GridFor.DesignSize property does not exist... | Werner Lehmann | Wed 2/20/2002
5385 | Re: GridFor.DesignSize property does not exist... | Dion | Wed 2/20/2002


Undeclared indentifier...IDataObject

From: "Dion" [dion@n...]
Date: Wed Feb 20, 2002 6:53 pm
Subject: Undeclared indentifier...IDataObject

Hi,

I have VirtualTrees declared in my uses clause in the interface section but
get the following error 'Undeclared indentifier...IDataObject '.

How do I remedy...

Many Thanks,
Dion.

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.314 / Virus Database: 175 - Release Date: 01/11/2002


re: GridFor.DesignSize property does not exist...

From: Werner Lehmann [wl@b...]
Date: Wed Feb 20, 2002 11:28 am
Subject: Re: [VirtualTreeview] GridFor.DesignSize property does not exist...

Dion wrote:
>
> I am running VT3.0. When I run the demo app I get a 'GridFor.DesignSize
> property does not exist...' error?

IIRC a D6 introduced property. Ignore, save, and it should not come back.

Werner

 | Replies | Author | Date
5385 | Re: GridFor.DesignSize property does not exist... | Dion | Wed 2/20/2002


re: Undeclared indentifier...IDataObject

From: Werner Lehmann [wl@b...]
Date: Wed Feb 20, 2002 11:28 am
Subject: Re: [VirtualTreeview] Undeclared indentifier...IDataObject

Dion wrote:
>
> I have VirtualTrees declared in my uses clause in the interface section but
> get the following error 'Undeclared indentifier...IDataObject '.
>
> How do I remedy...

Uses ActiveX.

Werner

 | Replies | Author | Date
5384 | Re: Undeclared indentifier...IDataObject | Dion | Wed 2/20/2002


re: Undeclared indentifier...IDataObject

From: "Dion" [dion@n...]
Date: Wed Feb 20, 2002 9:37 pm
Subject: RE: [VirtualTreeview] Undeclared indentifier...IDataObject

Thanks

-----Original Message-----
From: Werner Lehmann [mailto:[wl@b...]]
Sent: Wednesday, February 20, 2002 3:28 AM
To: VirtualTreeview@yahoogroups.com
Subject: Re: [VirtualTreeview] Undeclared indentifier...IDataObject

Dion wrote:
>
> I have VirtualTrees declared in my uses clause in the interface section
but
> get the following error 'Undeclared indentifier...IDataObject '.
>
> How do I remedy...

Uses ActiveX.

Werner

To unsubscribe from this group, send an email to:
VirtualTreeview-unsubscribe@egroups.com

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/

---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.314 / Virus Database: 175 - Release Date: 01/11/2002

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.314 / Virus Database: 175 - Release Date: 01/11/2002


re: GridFor.DesignSize property does not exist...

From: "Dion" [dion@n...]
Date: Wed Feb 20, 2002 9:53 pm
Subject: RE: [VirtualTreeview] GridFor.DesignSize property does not exist...

Hi Werner,

if (ContainerPanel.ControlCount = 0) or not (ContainerPanel.Controls[0] is
NewDemoClass) then
begin
if ContainerPanel.ControlCount > 0 then
ContainerPanel.Controls[0].Free;

if Assigned(NewDemoClass) then
begin
NewDemo := NewDemoClass.Create(Self); << Problem seems to be
here - I am running D5 Ent
NewDemo.Hide;
NewDemo.BorderStyle := bsNone;

Cheers,
Dion.

-----Original Message-----
From: Werner Lehmann [mailto:[wl@b...]]
Sent: Wednesday, February 20, 2002 3:28 AM
To: VirtualTreeview@yahoogroups.com
Subject: Re: [VirtualTreeview] GridFor.DesignSize property does not
exist...

Dion wrote:
>
> I am running VT3.0. When I run the demo app I get a 'GridFor.DesignSize
> property does not exist...' error?

IIRC a D6 introduced property. Ignore, save, and it should not come back.

Werner

To unsubscribe from this group, send an email to:
VirtualTreeview-unsubscribe@egroups.com

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/

---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.314 / Virus Database: 175 - Release Date: 01/11/2002

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.314 / Virus Database: 175 - Release Date: 01/11/2002


re: MIKE - Explorer

From: Jim Kueneman [jimdk@m...]
Date: Wed Feb 20, 2002 1:37 pm
Subject: RE: [VirtualTreeview] MIKE - Explorer

Hi Dion,

>Sorry to disagree Jim, but run the VET demo app, expand one of the drives so
>that some folders are visible. Select one by clicking on it. Now right click
>another. The user will get the impression that the one right clicked on is
>the current folder. The right click menu pops up. Press escape. The original
>selection is reinstated...

??....... Huh, I am but the selection does fire an OnChange in the
component (which will change the contents of the listview in the ExplorerDemo.

Ok, I am fudging it look here

TContextMenuManager.RightClick

You will see I am doing what I suggested except I am not setting a flag to
stop the OnChange event action, which now looks possible.

Sorry I forgot I had done that. I only remember the OnChange problem and
assumed I did not implement it.

Jim

 | Replies | Author | Date
5613 | Re: MIKE - Explorer | Dion | Thu 3/21/2002


VT STARTUP + VT AND INTERBASE

From: "ePC TECH" [epctech@t...]
Date: Wed Feb 20, 2002 2:01 pm
Subject: VT STARTUP + VT AND INTERBASE

I have Delphi5 enterprise and I've installed without error the components
VirtualTree: VirtualString, VirtualDraw and VTHeaderPopUpMenu. I use Windows98
second edition. Then I try to compile the examples Advanced and I have this
kind of error message:

Error reading DrawTreeForm.DesignSize: property does not exist.

I'm begginner with VirtualTree and I spent some day to try to understand what
is necessary and what no in the use of these components. Many other examples
give me problems. Why? is good top have a lot of examples but some examples
must be in some folder like : ThisGoneAnyWay, and the others in the
MayBeThisWillGo.

My scope is to use VirtualTree with Interbase, but I haven't yet found some
examples in action with source to use these components.

I don't understand if the problem is that is too difficult the startup of
VirtualTree because too many components and variables are up, but I think that,
for Delphi programmers, there are not some basic explanation on how make the
startup, also in different O.S. (Win98, 2000, XP) and of what is possible to do
with VirtualTree and Data.

For examples why are changed the Main Panel in the Advanced example with the
precedent version?

Thanks a lot for any information about it.
Hello
Marco

[Non-text portions of this message have been removed]

 | Replies | Author | Date
5389 | Re: VT STARTUP + VT AND INTERBASE | Jim Kueneman | Wed 2/20/2002
5391 | Re: VT STARTUP + VT AND INTERBASE | ePC TECH | Wed 2/20/2002
5393 | Re: VT STARTUP + VT AND INTERBASE | ePC TECH | Wed 2/20/2002
5394 | Re: VT STARTUP + VT AND INTERBASE | Helge Jung (ECO-Logic) | Wed 2/20/2002
5395 | Re: VT STARTUP + VT AND INTERBASE | Helge Jung (ECO-Logic) | Wed 2/20/2002


re: Startup help please?

From: Jim Kueneman [jimdk@m...]
Date: Wed Feb 20, 2002 2:22 pm
Subject: Re: [VirtualTreeview] Startup help please?

Hi,

>Does anyone have a fairly complete example of pulling something from
>a text file and wrapping it into at program start, i.e, automatically
>in FormCreate, etc., for a vitrual tree???

You can *never* wrap up VT in the FormCreate it always requires several
events to be used since VT does not store any data, ever. Also it is
always a fair amout of work to even get a simple VT up and going due to the
fact this same fact. You have to manage your data such that you can supply
info about it when VT want it.

To use it in true Virtual Mode you use OnInitNode and OnInitChildren. You
start out by telling VT how may root nodes you have in the RootNodeCount
property. At this point VT will call OnInitNode for each node that is
needs to display in the window (and only the nodes that is deems
necessary). It passes the Node (PVirtualNode) then you call
GetNodeData(Node) to retrieve a pointer to the data that each node has
reserved for you through NodeDataSize property (usually set in the
FormCreate using SizeOf(MyData)). At this point the reserved data
structure can be fill in with any data necessary to manage your
strurcture. After this VT will call OnGetText which you can again call
GetNodeData (get friendly with this method) and get the text string you
normally store in your data and pass it back to VT. Image indexes are done
the same way along with any column strings or image indexes. Also there is
a InitialStates parameter in the OnInitNode event. This sets some
attributes of the node, such as if the node may have children, if it should
be expanded to start with, if it is selected to start with, etc.

When the user tries to expand a node VT will call OnInitChildren where you
simply return how many children the node has. Once VT knows this it
repeats the above calling OnInitNode for each node that needs to be shown
so you can set up the data.

Since your data file is already known it will fit into this easily. You
know how many nodes are needes and if each has any children. All you have
to do it think of how to link the data together so when VT calls you on a
node you can fill in the above data. That is the hardest part and it
varies so much from implementation to implentation that rarely no one has
an exact example to share. You can create a direct link from you node to
the data structure by adding a Node: PVirtualNode field to your record and
fill it in during the OnInitNode call. From this link you can search your
records for a match when VT calls back for information and it passes you
the node.

Another way that is not Virtual is you use AddChild(..) to fill in the
tree. It is not virtual and Mike will not be sympathic with any problems
you have with it <G> as you conciders this the wrong way to use
VT. Sometimes though it is the only way. Here you can call AddChild, get
the Node back and then call GetNodeData immediately and fill in the
data. It works much like TTreeview. Make sure you use BeginUpdate and
EndUpdate so VT won't call OnInitNode on any node until you are done
filling the tree.

If you take a shot at it and give us a small demo it is much easier to
point you in the right direction than to explain how to actually setup your
data for your specific application of VT since there is so many ways of
doing it.

Good luck,
Jim


re: VT STARTUP + VT AND INTERBASE

From: Jim Kueneman [jimdk@m...]
Date: Wed Feb 20, 2002 2:29 pm
Subject: Re: [VirtualTreeview] VT STARTUP + VT AND INTERBASE

Hi,

>Error reading DrawTreeForm.DesignSize: property does not exist.

D6 has this new property, just ignore it in D5. Save the form and you
won't notice a difference.

Jim


cannot focus virtualdrawtree...

From: "Rony Cesana" [pincius@l...]
Date: Wed Feb 20, 2002 3:09 pm
Subject: cannot focus virtualdrawtree...

hello everybody... i'm trying to use virtualdrawtree, but apparently i
cannot when i click on it no node is selected...

procedure TdlgSelectJob.lbJobsClick(Sender: TObject);
begin
btOk.Enabled := tvJobList.FocusedNode <> nil;
end;

btOk never gets enabled... :(((

what should i do?

here's the tree section in the .dfm:
object tvJobList: TVirtualDrawTree
Left = 18
Top = 24
Width = 201
Height = 201
AnimationDuration = 0
AutoExpandDelay = 0
AutoScrollDelay = 0
BevelWidth = 0
BorderStyle = bsSingle
EditDelay = 0
Header.AutoSizeIndex = 0
Header.Columns = <>
Header.Font.Charset = DEFAULT_CHARSET
Header.Font.Color = clWindowText
Header.Font.Height = -11
Header.Font.Name = 'MS Sans Serif'
Header.Font.Style = []
Header.MainColumn = -1
Header.Options = [hoColumnResize, hoDrag]
Header.Style = hsThickButtons
HintAnimation = hatNone
HintMode = hmDefault
IncrementalSearchDirection = sdForward
IncrementalSearchTimeout = 0
Indent = 0
TabOrder = 1
TreeOptions.MiscOptions = [toAcceptOLEDrop, toFullRepaintOnResize,
toInitOnSave]
TreeOptions.PaintOptions = [toHotTrack, toShowButtons, toShowDropmark,
toShowRoot, toThemeAware, toUseBlendedImages]
OnClick = lbJobsClick
OnDblClick = lbJobsDblClick
OnDrawNode = tvJobListDrawNode
end

thank you,
rony.

 | Replies | Author | Date
5399 | Re: cannot focus virtualdrawtree... | Paul Istrate | Wed 2/20/2002


re: VT STARTUP + VT AND INTERBASE

From: "ePC TECH" [epctech@t...]
Date: Wed Feb 20, 2002 3:18 pm
Subject: Re: [VirtualTreeview] VT STARTUP + VT AND INTERBASE

But before I have put GraphicEx in the search path and I compiled without
error, but when I run the program and I try to open one of the panel choice
give me an error:

Property does not exist
Error reading SpeedForm.DesignSize

and I can't return to the previous first error when called me to Ignore or
Cancel

It is no to simple!
Hello
Marco

--------------------------------------------------------------------------------

Original message:

Hi,

>Error reading DrawTreeForm.DesignSize: property does not exist.

D6 has this new property, just ignore it in D5. Save the form and you
won't notice a difference.

Jim

Yahoo! Groups Sponsor
ADVERTISEMENT

To unsubscribe from this group, send an email to:
VirtualTreeview-unsubscribe@egroups.com

Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.

[Non-text portions of this message have been removed]


HintMode=hmToolTip has no effect in TVirtualDbTreeEx. Why?

From: "valerykvv" [kvv@b...]
Date: Wed Feb 20, 2002 4:07 pm
Subject: HintMode=hmToolTip has no effect in TVirtualDbTreeEx. Why?


re: VT STARTUP + VT AND INTERBASE

From: "ePC TECH" [epctech@t...]
Date: Wed Feb 20, 2002 4:09 pm
Subject: Re: [VirtualTreeview] VT STARTUP + VT AND INTERBASE

OK, Thanks Jim
I found the solution saving all forms.
I'll come again for next questions of my first mail.
Hello
Marco

[Non-text portions of this message have been removed]


re: VT STARTUP + VT AND INTERBASE

From: "Helge Jung \(ECO-Logic\)" [helge@e...]
Date: Wed Feb 20, 2002 4:09 pm
Subject: Re: [VirtualTreeview] VT STARTUP + VT AND INTERBASE

> My scope is to use VirtualTree with Interbase, but I haven't yet
> found some examples in action with source to use these components.

I uploaded a demo a while ago:

http://groups.yahoo.com/group/VirtualTreeview/files/Examples/Delphi_Examples
/Database/VST_IB_Demo.zip

Maybe it helps you - if not, feel free to ask me (via YG or private).

Helge.

P.S. I send this message a few minutes ago but it didn't came back in the YG
and also didn't do by mail ... so I'll post it again!


re: VT STARTUP + VT AND INTERBASE

From: "Helge Jung \(ECO-Logic\)" [helge@e...]
Date: Wed Feb 20, 2002 3:02 pm
Subject: Re: [VirtualTreeview] VT STARTUP + VT AND INTERBASE

> My scope is to use VirtualTree with Interbase, but I haven't yet
> found some examples in action with source to use these components.

I uploaded a demo a while ago:

http://groups.yahoo.com/group/VirtualTreeview/files/Examples/Delphi_Examples
/Database/VST_IB_Demo.zip

Maybe it helps you - if not, feel free to ask me (via YG or private).

Helge.


R: VT STARTUP + VT AND INTERBASE

From: "ePC TECH" [epctech@t...]
Date: Wed Feb 20, 2002 5:05 pm
Subject: R: [VirtualTreeview] VT STARTUP + VT AND INTERBASE

Thanks, I have all components but the dpr call me THEDATABASE.GDB
Can you send me please
Hello
Marco

----- Original Message -----
From: Helge Jung (ECO-Logic)
To: VirtualTreeview@yahoogroups.com
Sent: Wednesday, February 20, 2002 4:02 PM
Subject: Re: [VirtualTreeview] VT STARTUP + VT AND INTERBASE

> My scope is to use VirtualTree with Interbase, but I haven't yet
> found some examples in action with source to use these components.

I uploaded a demo a while ago:

http://groups.yahoo.com/group/VirtualTreeview/files/Examples/Delphi_Examples
/Database/VST_IB_Demo.zip

Maybe it helps you - if not, feel free to ask me (via YG or private).

Helge.

Yahoo! Groups Sponsor
ADVERTISEMENT

To unsubscribe from this group, send an email to:
VirtualTreeview-unsubscribe@egroups.com

Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.

[Non-text portions of this message have been removed]

 | Replies | Author | Date
5397 | Re: VT STARTUP + VT AND INTERBASE | Helge Jung (ECO-Logic) | Wed 2/20/2002


re: VT STARTUP + VT AND INTERBASE

From: "Helge Jung \(ECO-Logic\)" [helge@e...]
Date: Wed Feb 20, 2002 5:25 pm
Subject: Re: [VirtualTreeview] VT STARTUP + VT AND INTERBASE

> Thanks, I have all components but the dpr call me THEDATABASE.GDB
> Can you send me please

No, because I deleted it a while ago not thinking about it *g* The structure
is easy:

create table TheTable (
Field1 varchar(200),
Field2 numeric(15,2),
Field3 varchar(5),
);

I just created it out of my mind ... the field types don't matter as long
they can be read by TheField.AsString .

Helge.


Drag Type OLE or VCL

From: "Glenn MacGregor" [gtm@o...]
Date: Wed Feb 20, 2002 6:24 pm
Subject: Drag Type OLE or VCL

Hi All,

What is the difference between drag type OLE and VCL. I am using the
default which seems to be OLE. When I drag a node which has children I
never get any callback for the children being moved, is there a way to get
that or is it that the children are never moved, only the parent. If so
what is the best way to process each child on the move of the parent?

Thanks

Glenn

 | Replies | Author | Date
5404 | Re: Drag Type OLE or VCL | Jim Kueneman | Fri 2/22/2002


re: cannot focus virtualdrawtree...

From: "Paul Istrate" [istech@c...]
Date: Wed Feb 20, 2002 9:44 pm
Subject: Re: [VirtualTreeview] cannot focus virtualdrawtree...

Hi Rony,

If I understood right when you click a node this will not be
focused/selected.

Be sure that you attach a handler to the OnGetNodeWidth event. Return a
proper NodeWidth and should work. This event does not exist in VST but is
very important in VDT.

(Also, after you fill your VDT, use VDT.FocusedNode:=YourNode, followed, if
you need, by VDT.Selected[YourNode]:=True)

I hope this help.

Regards,
Paul


re: Header popup menu > Please read this one Mike

From: "Peter Evans" [pgevans@m...]
Date: Thu Feb 21, 2002 12:37 am
Subject: Re: [VirtualTreeview] Header popup menu > Please read this one Mike

>
> I uploaded a modified version of the VTHeaderPopup.zip to
>
> http://groups.yahoo.com/group/VirtualTreeview/files/
>
> It has a filter event to allow you to not show an item or disable it.
>

I have downloaded this example.

I have not tried it yet because I am waiting to see if Mike will think it "a
good
addition to this component".

I like the ability to show or not show an item.

Regards, Peter Evans


re: Long node text hints...

From: "valerykvv" [kvv@b...]
Date: Thu Feb 21, 2002 7:17 am
Subject: Re: Long node text hints...

> Is it possible to have a 'cell hint' for node text as well as
static text
> when this text is not visible(too long) within the tree boundaries?
>

HintMode=hmToolTip
ShowHint=True

Good Luck.

 | Replies | Author | Date
5428 | Re: Long node text hints... | Dion | Mon 2/25/2002


NodeCheckedCount...

From: "Dion" [dion@n...]
Date: Thu Feb 21, 2002 11:12 pm
Subject: NodeCheckedCount...

Hi,

Is there a NodeCheckedCount, or must I add this to my structure for each
node?(seems a waste)

Thanks,
DIon.

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.314 / Virus Database: 175 - Release Date: 01/11/2002

 | Replies | Author | Date
5403 | Re: NodeCheckedCount... | Jim Kueneman | Fri 2/22/2002
5407 | Re: NodeCheckedCount... | Dion | Fri 2/22/2002


re: NodeCheckedCount...

From: Jim Kueneman [jimdk@m...]
Date: Fri Feb 22, 2002 1:30 am
Subject: Re: [VirtualTreeview] NodeCheckedCount...

Hi,

>Is there a NodeCheckedCount, or must I add this to my structure for each
>node?(seems a waste)

Iterate through the nodes recursivly starting with GetFirst

procedure IsNodeChecked(Node: PVirtual; var CheckCount: integer);
begin
while assigned(Node) do
begin
if Node.CheckState = csCheckedNormal then
inc(CheckCount);
if Node.ChildCount > 0 then
IsNodeChecked(Node.FirstChild, CheckCount);
Node := Node.NextSibling
end
end;

var
CheckCount: integer;

CheckCount := 0;
IsNodeChecked(GetFirst, CheckCount);

Untested

Jim

 | Replies | Author | Date
5407 | Re: NodeCheckedCount... | Dion | Fri 2/22/2002


re: Drag Type OLE or VCL

From: Jim Kueneman [jimdk@m...]
Date: Fri Feb 22, 2002 2:57 am
Subject: Re: [VirtualTreeview] Drag Type OLE or VCL

Hi Glenn,

>What is the difference between drag type OLE and VCL. I am using the

VCL is the drag/drop mechnisim that Delphi uses. OLE is the way Windows
does it. The OLE way allows data to be moved across process boundries. It
is more difficult to implement (well unless you reallly understand the OLE
and IDataObject)

>default which seems to be OLE. When I drag a node which has children I
>never get any callback for the children being moved, is there a way to get
>that or is it that the children are never moved, only the parent. If so
>what is the best way to process each child on the move of the parent?

What you can do (I think) is in the OnDragDrop call ProcessDrop (The target
node is a property). When VT writes each node to the stream it calls
OnSaveNode so any user defined data may be saved to the stream on a per
node basis. When the node structure is recreated after the move/copy it
calls OnLoadNode.

Jim


Drag Modes

From: "bkerrison" [bkerrison@y...]
Date: Fri Feb 22, 2002 5:23 am
Subject: Drag Modes

Hi there,

I was wondering whether there was any easy way to change the way that
the default drop modes are activated.

When I drag over my tree at the moment:

* if the mouse is over the text of a node then the mode is dmDropOn
and the node is highlighted.

* if the mouse is not on the text then the mode is either dmAbove or
dmBelow depending whether the mouse is in the top or bottom half of
the node's row. The node is not highlighted but a line between the
two nodes is displayed.

What I would like to be able to do is to have it so regardless of
where in the node's row the mouse is, the node is highlighted and if
the mouse were released would drop in dmDropOn mode. This is the way
that MS Explorer, operates.

Another alternative would be to have it so that it is dmDropOn node
when the mouse if over the text or the icon, other wise it drops
above or below.

Any ideas?

Regards

Brendan Kerrison

 | Replies | Author | Date
5406 | Re: Drag Modes | Jim Kueneman | Fri 2/22/2002


re: Drag Modes

From: Jim Kueneman [jimdk@m...]
Date: Fri Feb 22, 2002 5:56 am
Subject: Re: [VirtualTreeview] Drag Modes

Hi,

>What I would like to be able to do is to have it so regardless of
>where in the node's row the mouse is, the node is highlighted and if
>the mouse were released would drop in dmDropOn mode. This is the way
>that MS Explorer, operates.

TreeOptions->PaintOptions->toShowDropMark = False

Jim


re: NodeCheckedCount...

From: "Dion" [dion@n...]
Date: Fri Feb 22, 2002 6:04 pm
Subject: RE: [VirtualTreeview] NodeCheckedCount...

Haven't tested it yet...

Thanks, Jim
Dion.

-----Original Message-----
From: Jim Kueneman [mailto:[jimdk@m...]]
Sent: Thursday, February 21, 2002 5:30 PM
To: VirtualTreeview@yahoogroups.com
Subject: Re: [VirtualTreeview] NodeCheckedCount...

Hi,

>Is there a NodeCheckedCount, or must I add this to my structure for each
>node?(seems a waste)

Iterate through the nodes recursivly starting with GetFirst

procedure IsNodeChecked(Node: PVirtual; var CheckCount: integer);
begin
while assigned(Node) do
begin
if Node.CheckState = csCheckedNormal then
inc(CheckCount);
if Node.ChildCount > 0 then
IsNodeChecked(Node.FirstChild, CheckCount);
Node := Node.NextSibling
end
end;

var
CheckCount: integer;

CheckCount := 0;
IsNodeChecked(GetFirst, CheckCount);

Untested

Jim

To unsubscribe from this group, send an email to:
VirtualTreeview-unsubscribe@egroups.com

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/

---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.314 / Virus Database: 175 - Release Date: 01/11/2002

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.314 / Virus Database: 175 - Release Date: 01/11/2002


CheckSupport, FocusedNode and VK_SPACE

From: "mailinglistsde" [mailinglists@j...]
Date: Fri Feb 22, 2002 11:31 am
Subject: CheckSupport, FocusedNode and VK_SPACE

I've got a VST with CheckSupport enabled on my applicaion's main
form. At startup the VST gets the focus, but pressing space now
results in an AV, as long FocusedNode is not assigned.

In line 14464 the tree checks if FFocusedNode is assigned but it
already reads its CheckType member at 14462.

... or did i miss something?

 | Replies | Author | Date
5409 | Re: CheckSupport, FocusedNode and VK_SPACE | Vandrovec Milan | Fri 2/22/2002
5410 | Re: CheckSupport, FocusedNode and VK_SPACE | mailinglistsde | Fri 2/22/2002
5411 | Re: CheckSupport, FocusedNode and VK_SPACE | mailinglistsde | Fri 2/22/2002
5420 | Re: CheckSupport, FocusedNode and VK_SPACE | Mike Lischke | Sat 2/23/2002


re: CheckSupport, FocusedNode and VK_SPACE

From: Vandrovec Milan [milan_va@s...]
Date: Fri Feb 22, 2002 11:55 am
Subject: RE: [VirtualTreeview] CheckSupport, FocusedNode and VK_SPACE

Hello.

> I've got a VST with CheckSupport enabled on my applicaion's main
> form. At startup the VST gets the focus, but pressing space now
> results in an AV, as long FocusedNode is not assigned.
>
> In line 14464 the tree checks if FFocusedNode is assigned but it
> already reads its CheckType member at 14462.

The bug is really there. I pointed it out two weeks ago in the newsgroup.
Mike said he has fixed it in his version along with other numerous fixes,
but hasn't published anything for two months already. So we have to fix
things ourselves.

Solution: Add the check for FFocusedNode=nil on line 14462, as you would
expect.

Milan Vandrovec

 | Replies | Author | Date
5410 | Re: CheckSupport, FocusedNode and VK_SPACE | mailinglistsde | Fri 2/22/2002
5411 | Re: CheckSupport, FocusedNode and VK_SPACE | mailinglistsde | Fri 2/22/2002
5420 | Re: CheckSupport, FocusedNode and VK_SPACE | Mike Lischke | Sat 2/23/2002


re: CheckSupport, FocusedNode and VK_SPACE

From: "mailinglistsde" [mailinglists@j...]
Date: Fri Feb 22, 2002 12:19 pm
Subject: Re: CheckSupport, FocusedNode and VK_SPACE

Thank you.

--- In [VirtualTreeview@y...], Vandrovec Milan [milan_va@s...] wrote:
>
> Hello.
>
> > I've got a VST with CheckSupport enabled on my applicaion's main
> > form. At startup the VST gets the focus, but pressing space now
> > results in an AV, as long FocusedNode is not assigned.
> >
> > In line 14464 the tree checks if FFocusedNode is assigned but it
> > already reads its CheckType member at 14462.
>
> The bug is really there. I pointed it out two weeks ago in the
newsgroup.
> Mike said he has fixed it in his version along with other numerous
fixes,
> but hasn't published anything for two months already. So we have to
fix
> things ourselves.
>
> Solution: Add the check for FFocusedNode=nil on line 14462, as you
would
> expect.
>
> Milan Vandrovec


VTEditors

From: GIANNAKOPOULOS KOSTAS [kyan@s...]
Date: Fri Feb 22, 2002 3:03 pm
Subject: VTEditors

Hello group,

I have written a unit containing some simple classes that implement the
IVTEditLink interface and can perform cell editing using some basic controls
(edit, memo, combobox, date-time picker). It is VTEditors.pas. One can use
one of them or inherit from the abstract class TCustomEditLink and implement
his/her own editor based on some other control.

Since at least two people have asked me for the source i thought it would be
a good idea to upload the unit and a very small demo written by Peter Evans
to the files area. You will find it at Files/Misc/VTEditors.zip.

<KY>


re: MIKE - Explorer

From: "jimkueneman" [jimdk@m...]
Date: Sat Feb 23, 2002 12:30 am
Subject: Re: MIKE - Explorer

Hi Dion,

> This is the effect I am looking for. Is this a VET feature or did
you
> 'fudge' this in the demo?

In case you did not get this working I uploaded an example VT
decendant that shows you how to do this:

http://groups.yahoo.com/group/VirtualTreeview/files/Examples/Delphi_Ex
amples/Misc_Examples/

( watch the line break in the URL )

Jim

 | Replies | Author | Date
5435 | Re: MIKE - Explorer | Dion | Mon 2/25/2002


re: Multiline captions

From: "Mike Lischke" [lists@l...]
Date: Sat Feb 23, 2002 9:35 am
Subject: RE: [VirtualTreeview] Multiline captions

Hi Robert,

> Wouldn't be possible to add a Multiline property to TVirtualTreeColumn?
> And then in VST PaintNormalText/PaintStaticText:
> ....
> if not Header.Columns[PaintInfo.Column].Multiline then
> DrawFormat := DT_VCENTER or DT_SINGLELINE;

The point is that vertical centering only works for single lines (this is also
so in the API
DrawText) because calculating the vertical extent requires quite a lot of
extra processing. I don't
say it is impossible but I say the effort is large compared with the result of
this process.

> Or add a new OnGetTextFormat to get the text format integer before
> the paint occurs.

This is what I also thought about. But this is only a partial solution.

> Is multiline captions planned for a future version of VT?

It's on the wish list, but I have no time for this.

> Is the alignment the only problem with multiline text? How about the editors?

This is indeed another major problem with vertical alignment. Yet another level
of processing the
text.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: VT and Kylix

From: "Mike Lischke" [lists@l...]
Date: Sat Feb 23, 2002 10:03 am
Subject: RE: [VirtualTreeview] VT and Kylix

> Do you intend to release a fixed version soon, and what timeframe for updates
do you have in mind?

I'm going to fix the things not yet closed in the bug database today and will
release a minor update
then. This will then be the last update for a longer time unless a serious bug
appears.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


New file uploaded to VirtualTreeview

From: VirtualTreeview@yahoogroups.com
Date: Sat Feb 23, 2002 10:32 am
Subject: New file uploaded to VirtualTreeview

Hello,

This email message is a notification to let you know that
a file has been uploaded to the Files area of the VirtualTreeview
group.

File : /VirtualTrees Patch 1.zip
Uploaded by : mikelischke [lists@l...]
Description : First patch for the official VT package.

You can access this file at the URL

http://groups.yahoo.com/group/VirtualTreeview/files/VirtualTrees%20Patch%201.zip\

To learn more about file sharing for your group, please visit

http://help.yahoo.com/help/us/groups/files

Regards,

mikelischke [lists@l...]

 | Replies | Author | Date
5417 | Re: New file uploaded to VirtualTreeview | Mike Lischke | Sat 2/23/2002
5423 | Re: New file uploaded to VirtualTreeview | hj_schnorrenberg | Sun 2/24/2002
5480 | Re: New file uploaded to VirtualTreeview | Mike Lischke | Sat 3/2/2002
5483 | Re: New file uploaded to VirtualTreeview | mailinglistsde | Sat 3/2/2002


re: New file uploaded to VirtualTreeview

From: "Mike Lischke" [lists@l...]
Date: Sat Feb 23, 2002 10:50 am
Subject: RE: [VirtualTreeview] New file uploaded to VirtualTreeview

Hi all,

> This email message is a notification to let you know that
> a file has been uploaded to the Files area of the VirtualTreeview
> group.

Here is the first patch for the official distribution. I have uploaded it only
here (instead of my
homepage) because I'm again near my transfer limit of 15GB/month (~1800
downloads per week only for
VT). As soon as the new month arrieved I will also place a copy on my homepage
and officially
announce it.

Changes are minimal in this patch. There are only some minor bug fixes and the
new header popup
changed by Jim Kuenemann. Simply copy the two files into your library folder.

For the latest bug entries:

#91: It seems you have some older files laying around. VirtualTreesReg is
already for a long time as
you requested. However the design time package *must* contain designide.dcp
because it needs access
to IDE stuff. I'm sorry that you cannot use package collections then, but this
is a design flaw in
the package management, not a problem of the VT design package.

#92: This is very much related to the recent problem I answered in the
newsgroup. VT does not
correctly paint the NC area if bevels are used, because it is very difficult to
avoid overpainting
the scrollbars then (which results in heavy flicker). So I recommend not to use
bevels (which are a
VCL thing, not provided by Windows) with VT. Normal borders do it better (and
are XP compatible,
while bevels are not).

#93: I recommend not to write a bug entry if you don't understand something.
Better ask here or in
the news group first. It is fully intended that the user cannot explicitely
switch on the mixed
style for three-state check boxes, because it is unclear what then should
happen. It simply makes no
sense.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net

 | Replies | Author | Date
5423 | Re: New file uploaded to VirtualTreeview | hj_schnorrenberg | Sun 2/24/2002
5480 | Re: New file uploaded to VirtualTreeview | Mike Lischke | Sat 3/2/2002
5483 | Re: New file uploaded to VirtualTreeview | mailinglistsde | Sat 3/2/2002


re: VT and Kylix

From: "Mike Lischke" [lists@l...]
Date: Sat Feb 23, 2002 11:56 am
Subject: RE: [VirtualTreeview] VT and Kylix

> If I am not mistaken there is no message queue as under Windows. How is this
handled then?

This is managed by the Qt library.

>And: a Kylix version means two source
> files, correct? Otherwise we would have far too many ifdefs. I believe I have
> read somewhere that Borland even recommends this for components.

Currently it is one source code with a lot of ifdefs. The problem with two
components is that you
cannot simply port your apps to Linux, since you would have to replace
components. I have never done
any Delphi development under Linux, so I'm only guessing here.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: Header popup menu > Please read this one Mike

From: "Mike Lischke" [lists@l...]
Date: Sat Feb 23, 2002 11:57 am
Subject: RE: [VirtualTreeview] Header popup menu > Please read this one Mike

Jim,

> I uploaded a modified version of the VTHeaderPopup.zip to

Thank you for the update. I have taken the new unit into the latest VT patch.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: CheckSupport, FocusedNode and VK_SPACE

From: "Mike Lischke" [lists@l...]
Date: Sat Feb 23, 2002 12:05 pm
Subject: RE: [VirtualTreeview] CheckSupport, FocusedNode and VK_SPACE

Milan,

> The bug is really there. I pointed it out two weeks ago in the newsgroup.
> Mike said he has fixed it in his version along with other numerous fixes,
> but hasn't published anything for two months already.

Actually, it was only one month. The publication date of the last official
version was 11. January
2002.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


New file uploaded to VirtualTreeview

From: VirtualTreeview@yahoogroups.com
Date: Sat Feb 23, 2002 12:31 pm
Subject: New file uploaded to VirtualTreeview

Hello,

This email message is a notification to let you know that
a file has been uploaded to the Files area of the VirtualTreeview
group.

File : /VTHeaderPopup.zip
Uploaded by : ralfjunkergmxde [ralfjunker@g...]
Description : This is another update to TVTHeaderPopup not included in the VT
Patch 1. There are two new options: 1: Show the menu items in the order of the
columns. 2: Prevent the user from hiding the very last column. This update
fixes a small bug to properly free all memory and also includes Jims latest
OnAddHeaderPopupItem.

You can access this file at the URL

http://groups.yahoo.com/group/VirtualTreeview/files/VTHeaderPopup.zip

To learn more about file sharing for your group, please visit

http://help.yahoo.com/help/us/groups/files

Regards,

ralfjunkergmxde [ralfjunker@g...]


New file uploaded to VirtualTreeview

From: VirtualTreeview@yahoogroups.com
Date: Sun Feb 24, 2002 8:37 am
Subject: New file uploaded to VirtualTreeview

Hello,

This email message is a notification to let you know that
a file has been uploaded to the Files area of the VirtualTreeview
group.

File : /VTHeaderPopup.zip
Uploaded by : ralfjunkergmxde [ralfjunker@g...]
Description : This is another update to TVTHeaderPopup not included in the VT
Patch 1. There are two new options: 1: Show the menu items in the order of the
columns. 2: Prevent the user from hiding the very last column. This update
fixes a small bug to properly free all memory and also includes Jims latest
OnAddHeaderPopupItem.

You can access this file at the URL

http://groups.yahoo.com/group/VirtualTreeview/files/VTHeaderPopup.zip

To learn more about file sharing for your group, please visit

http://help.yahoo.com/help/us/groups/files

Regards,

ralfjunkergmxde [ralfjunker@g...]


re: New file uploaded to VirtualTreeview

From: "hj_schnorrenberg" [hj_schnorrenberg@y...]
Date: Sun Feb 24, 2002 9:56 pm
Subject: Re: New file uploaded to VirtualTreeview

Hello Mike,

>
> For the latest bug entries:
>
> #91: It seems you have some older files laying around.
VirtualTreesReg is already for a long time as
> you requested. However the design time package *must* contain
designide.dcp because it needs access
> to IDE stuff.

I think, that's wrong. The required IDE stuff is contained in
dclstd.dpc, which is also shipped with Delphi Std. Designide.dcp is
only available with Delphi Pro and Delphi Ent (and I think,
Designide.dcp is only neccessary for writing wizzards, which should
not be possible for Delphi Std).

>I'm sorry that you cannot use package collections then, but this is
a design flaw in
> the package management, not a problem of the VT design package.
>

I tested VirtualTreesD6.dpk requiring only vcl.dcp and vclx.dcp, and
VirtualTreesD6D.dpk requiring only dclstd.dcp. Since I modified
VirtualTreesD6.dpk and VirtualTreesD6D.dpk as described, I do not
have any problems. So, I can use both, package collections and
packages in both, Delphi 6 Std and Delp 6 Pro (However, I was
searching some hours for the reason, why VT cannot be shipped with
package collections. Perhaps, somebody else want to use VT in a
package collection, too?).

> #92: This is very much related to the recent problem I answered in
the newsgroup. VT does not
> correctly paint the NC area if bevels are used, because it is very
difficult to avoid overpainting
> the scrollbars then (which results in heavy flicker). So I
recommend not to use bevels (which are a
> VCL thing, not provided by Windows) with VT. Normal borders do it
better (and are XP compatible,
> while bevels are not).

Perhaps, it is not neccssary to publish the bevel properties? In
constrast, everybody, who wants to use these properties, and who
expects same behaviour of TPanel-Bevel, and who does not know
anything about the discussion in this group, will be disappointed
like me (only my opion, I do not want to use bevels of VT anymore)!

> #93: I recommend not to write a bug entry if you don't understand
something. Better ask here or in
> the news group first.

Sorry, in the future I will ask such questions in the newsgroup:

I do not understand, why in the method DetermineNextCheckState for
CheckType = ctNone, which corresponds to the else branch of the case
statement, is choosen by Result := csMixededNormal (It makes no sense
for me, and then I try to find the reason).

>It is fully intended that the user cannot explicitely switch on the
mixed
> style for three-state check boxes, because it is unclear what then
should happen. It simply makes no
> sense.

IMO, sometimes it would be nice, to switch between three states (like
the checkbox demo of VET). However, the method
DetermineNextCheckState is declared as private, and therefore, it is
not possible to override the standard behaviour. It's a great
advantage of VT, that many methods are declared as protected and
virtual (in constrast to VCL)! Why do not declare this method as
protected and virtual, too?

There is another point, which I do not understand, and which I will
now ask here:

The method GetLastChild(Node: PVirtualNode) does initialize, if
neccessary, the "Node". In contrast, the method GetFirstChild(Node:
PVirtualNode) does not initialize the "Node", even if neccessary. Is
there any reason, why GetFirstChild does not initialize "Node"? (I
know, there exists the method GetLastChildNoInit, but at first I
expected the same behaviour of GetFirstChild and GetLastChild, until
a bug demonstrated me the difference)

best regards,

Hans-Jürgen

 | Replies | Author | Date
5480 | Re: New file uploaded to VirtualTreeview | Mike Lischke | Sat 3/2/2002
5483 | Re: New file uploaded to VirtualTreeview | mailinglistsde | Sat 3/2/2002


OnChange question

From: "bkerrison" [bkerrison@y...]
Date: Mon Feb 25, 2002 3:16 am
Subject: OnChange question

Hi,

I am working on an application that contains two VirtualTreeViews.
When a node in one tree is selected the contents of the second tree
change. The function to update the secondtree is contained in the
OnChange even of the first tree.

The problem I am encountering is that when I click on the first tree
the OnChange event is triggered immediately the mouse button is
pressed down. That means that I cannot drag a node to second tree
before it changes.

In MS Explorer when you click directly on to a node it does not
change the contents of the listview until after the mouse button has
been raised. This allows you to drag to the listview.

I have been looking for a way to get the VirtualTreeView to operate
like this but I haven't been successful. If anyone knows how this
might be done I'd appreciate some pointers.

Regards

Brendan Kerrison

trying to get the a VirtualTreeView to operate in a similar way to
the MS Explorer tree in regards to when a OnChange event is
triggered.

Currently as soon as I click on a node the OnChange events is
triggered. The problem is that if when I click on the node in order
to drag it I don't want the OnChange event triggered because it
changes what appears in the target for my drag operation. I can't
test for Dragging because it isn't set until I start dragging.

In MS Explorer when you click on the indent or to the right of a
treenode it selects on the MouseDown. But it you click direclty on
the node it doesn't change seem to trigger the OnChange even until
the MouseUp event

 | Replies | Author | Date
5425 | Re: OnChange question | Jim Kueneman | Mon 2/25/2002
5426 | Re: OnChange question | bkerrison | Mon 2/25/2002
5460 | Re: OnChange question | bkerrison | Thu 2/28/2002
5469 | Re: OnChange question | Jim Kueneman | Thu 2/28/2002
5488 | Re: OnChange question | Mike Lischke | Sun 3/3/2002
5481 | Re: OnChange question | Mike Lischke | Sat 3/2/2002


re: OnChange question

From: Jim Kueneman [jimdk@m...]
Date: Mon Feb 25, 2002 3:40 am
Subject: Re: [VirtualTreeview] OnChange question

Hi,

>The problem I am encountering is that when I click on the first tree
>the OnChange event is triggered immediately the mouse button is
>pressed down. That means that I cannot drag a node to second tree
>before it changes.

You will most likely have to create a decenant of VT to do this. If you
look here:

http://groups.yahoo.com/group/VirtualTreeview/files/Examples/Delphi_Examples/Mis\
c_Examples/

and download the ExplorerRightClick example (mimics the rightclick that
TTreeview does, select the new node only during the click then return to
the original node wiith out firing an OnChange event) it may get you
started.

It can be modified to do what you want. Set a flag to skip the OnChange
inherited then call DoChange in the decendant on WM_LBUTTONUP.

Just a thought.

Jim

 | Replies | Author | Date
5426 | Re: OnChange question | bkerrison | Mon 2/25/2002
5460 | Re: OnChange question | bkerrison | Thu 2/28/2002
5469 | Re: OnChange question | Jim Kueneman | Thu 2/28/2002
5488 | Re: OnChange question | Mike Lischke | Sun 3/3/2002


re: OnChange question

From: "bkerrison" [bkerrison@y...]
Date: Mon Feb 25, 2002 6:00 am
Subject: Re: OnChange question

Thanks Jim,

I was hoping to avoid creating a new descendant, but I'll have a look
into it.

Cheers

Brendan

--- In [VirtualTreeview@y...], Jim Kueneman [jimdk@m...] wrote:
>
> Hi,
>
> >The problem I am encountering is that when I click on the first
tree
> >the OnChange event is triggered immediately the mouse button is
> >pressed down. That means that I cannot drag a node to second tree
> >before it changes.
>
>
> You will most likely have to create a decenant of VT to do this.
If you
> look here:
>
>
http://groups.yahoo.com/group/VirtualTreeview/files/Examples/Delphi_Ex
amples/Misc_Examples/
>
> and download the ExplorerRightClick example (mimics the rightclick
that
> TTreeview does, select the new node only during the click then
return to
> the original node wiith out firing an OnChange event) it may get
you
> started.
>
> It can be modified to do what you want. Set a flag to skip the
OnChange
> inherited then call DoChange in the decendant on WM_LBUTTONUP.
>
> Just a thought.
>
> Jim


Another Selection question

From: "bkerrison" [bkerrison@y...]
Date: Mon Feb 25, 2002 6:14 am
Subject: Another Selection question

Hi,

Another Selection question. Is there any easy way to inhibit
selection on anything other than the main column. I want to deselect
all nodes if the tree is clicked on anywhere other than the icon or
label of a node in the tree. Currently the node is selected if the
text in any of the columns is clicked on.

Regards

Brendan

 | Replies | Author | Date
5430 | Re: Another Selection question | Werner Lehmann | Mon 2/25/2002
5444 | Re: Another Selection question | bkerrison | Tue 2/26/2002
5445 | Re: Another Selection question | Werner Lehmann | Tue 2/26/2002


re: Re: Long node text hints...

From: "Dion" [dion@n...]
Date: Sat Feb 23, 2002 5:54 pm
Subject: RE: [VirtualTreeview] Re: Long node text hints...

Great! It works for the nodes text but NOT the static text.

Cheers,
Dion.

-----Original Message-----
From: valerykvv [mailto:[kvv@b...]]
Sent: Wednesday, February 20, 2002 11:17 PM
To: VirtualTreeview@yahoogroups.com
Subject: [VirtualTreeview] Re: Long node text hints...

> Is it possible to have a 'cell hint' for node text as well as
static text
> when this text is not visible(too long) within the tree boundaries?
>

HintMode=hmToolTip
ShowHint=True

Good Luck.

To unsubscribe from this group, send an email to:
VirtualTreeview-unsubscribe@egroups.com

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/

---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.314 / Virus Database: 175 - Release Date: 01/11/2002

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.314 / Virus Database: 175 - Release Date: 01/11/2002


How to AutoSort Virtual Treeview

From: GK [gkrishna@j...]
Date: Mon Feb 25, 2002 11:45 am
Subject: How to AutoSort Virtual Treeview

Hi,

The help says that Virtual Treeview supports AutoSort

"Sorting a node is supported via an application defined compare callback
additionally a tree can be set to auto sort"

I have set autosort property to true in tree options auto options

In the header click event

I am toggling the VT.Header.SortDirection.

I am setting the VT.Header.SortColumn = Column which comes as the parameter in
this event.

Then I am calling VT.SortTree(column,VT.Header.sortDirection)

Auto Sort is not working.
I just have a set of columns which are displaying strings.

What am I doing wrong.

 | Replies | Author | Date
5432 | Re: How to AutoSort Virtual Treeview | Werner Lehmann | Mon 2/25/2002
5433 | Re: How to AutoSort Virtual Treeview | Brian Read | Mon 2/25/2002
5434 | Re: How to AutoSort Virtual Treeview | Jim Kueneman | Mon 2/25/2002
5439 | Re: How to AutoSort Virtual Treeview | GK | Tue 2/26/2002
5440 | Re: How to AutoSort Virtual Treeview | Werner Lehmann | Tue 2/26/2002
5441 | Re: How to AutoSort Virtual Treeview | GK | Tue 2/26/2002


re: Another Selection question

From: Werner Lehmann [wl@b...]
Date: Mon Feb 25, 2002 11:26 am
Subject: Re: [VirtualTreeview] Another Selection question

bkerrison wrote:
>
> Another Selection question. Is there any easy way to inhibit
> selection on anything other than the main column. I want to deselect
> all nodes if the tree is clicked on anywhere other than the icon or
> label of a node in the tree. Currently the node is selected if the
> text in any of the columns is clicked on.

You can try to set toReportMode.

Werner

 | Replies | Author | Date
5444 | Re: Another Selection question | bkerrison | Tue 2/26/2002


re: Re: Long node text hints...

From: Werner Lehmann [wl@b...]
Date: Mon Feb 25, 2002 11:29 am
Subject: Re: [VirtualTreeview] Re: Long node text hints...

Dion wrote:
>
> Great! It works for the nodes text but NOT the static text.

Use OnGetHint. Hints do not work for static text and you have to
put the hint together yourself. I am not sure about the meaning
of the TextType parameter of this event. Maybe it is only the
usual OnGetText event type and TextType will always be ttNormal.

Werner

 | Replies | Author | Date
5436 | Re: Long node text hints... | Dion | Mon 2/25/2002
5482 | Re: Long node text hints... | Mike Lischke | Sat 3/2/2002


re: How to AutoSort Virtual Treeview

From: Werner Lehmann [wl@b...]
Date: Mon Feb 25, 2002 11:46 am
Subject: Re: [VirtualTreeview] How to AutoSort Virtual Treeview

GK wrote:

> What am I doing wrong.

You ignore what you quote yourself:

> "Sorting a node is supported via an application defined compare callback
additionally a tree can be set to auto sort"

So add an OnCompareNodes handler.

Werner

 | Replies | Author | Date
5433 | Re: How to AutoSort Virtual Treeview | Brian Read | Mon 2/25/2002
5434 | Re: How to AutoSort Virtual Treeview | Jim Kueneman | Mon 2/25/2002


re: How to AutoSort Virtual Treeview

From: Brian Read [brianr@b...]
Date: Mon Feb 25, 2002 12:14 pm
Subject: Re: [VirtualTreeview] How to AutoSort Virtual Treeview

Hi

I am just trying out VirtualTreeView, and have installed the design time
package into my Delphi 5.

However when I then try to compile the "advanced" example, I get
"Treeform.DesignSize - property does not exist".

What have I done wrong?

cheers

Brian

 | Replies | Author | Date
5434 | Re: How to AutoSort Virtual Treeview | Jim Kueneman | Mon 2/25/2002


re: How to AutoSort Virtual Treeview

From: Jim Kueneman [jimdk@m...]
Date: Mon Feb 25, 2002 12:49 pm
Subject: Re: [VirtualTreeview] How to AutoSort Virtual Treeview

Hi,

>I am just trying out VirtualTreeView, and have installed the design time
>package into my Delphi 5.
>
>However when I then try to compile the "advanced" example, I get
>"Treeform.DesignSize - property does not exist".
>
>What have I done wrong?

Nothing, it is a new D6 property. Save the form close the project,
reopen and it should be gone.

Jim


re: Re: MIKE - Explorer

From: "Dion" [dion@n...]
Date: Mon Feb 25, 2002 8:22 pm
Subject: RE: [VirtualTreeview] Re: MIKE - Explorer

Many Thanks, Jim

Regards,
Dion.

-----Original Message-----
From: jimkueneman [mailto:[jimdk@m...]]
Sent: Friday, February 22, 2002 4:30 PM
To: VirtualTreeview@yahoogroups.com
Subject: [VirtualTreeview] Re: MIKE - Explorer

Hi Dion,

> This is the effect I am looking for. Is this a VET feature or did
you
> 'fudge' this in the demo?

In case you did not get this working I uploaded an example VT
decendant that shows you how to do this:

http://groups.yahoo.com/group/VirtualTreeview/files/Examples/Delphi_Ex
amples/Misc_Examples/

( watch the line break in the URL )

Jim

To unsubscribe from this group, send an email to:
VirtualTreeview-unsubscribe@egroups.com

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/

---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.314 / Virus Database: 175 - Release Date: 01/11/2002

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.314 / Virus Database: 175 - Release Date: 01/11/2002


re: Re: Long node text hints...

From: "Dion" [dion@n...]
Date: Mon Feb 25, 2002 11:36 pm
Subject: RE: [VirtualTreeview] Re: Long node text hints...

Werner, I would like the hint to look like it does for the nodes text when
the hint type is tooltip. I would like the same effect for the Static text.

Description
This event will only be fired if HintMode is not hmTooltip. The delay for
hints can be set as usual: adjust the properties HintPause and
HintShortPause of the global Application object.

Regards,
Dion.

-----Original Message-----
From: Werner Lehmann [mailto:[wl@b...]]
Sent: Monday, February 25, 2002 3:30 AM
To: [VirtualTreeview@yahoogroups.com
Subject: Re: [VirtualTreeview] Re: Long node text hints...

Dion wrote:
>
> Great! It works for the nodes text but NOT the static text.

Use OnGetHint. Hints do not work for static text and you have to
put the hint together yourself. I am not sure about the meaning
of the TextType parameter of this event. Maybe it is only the
usual OnGetText event type and TextType will always be ttNormal.

Werner

To unsubscribe from this group, send an email to:
VirtualTreeview-unsubscribe@egroups.com

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/

---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.314 / Virus Database: 175 - Release Date: 01/11/2002

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.314 / Virus Database: 175 - Release Date: 01/11/2002

 | Replies | Author | Date
5482 | Re: Long node text hints...] | Mike Lischke | Sat 3/2/2002


Selected color when losting the focus

From: "Luiz" [cprmlao@i...]
Date: Mon Feb 25, 2002 11:49 pm
Subject: Selected color when losting the focus

Hi,

Which property do I have to set in VT to selected row stays allways with
selected color(BLUE) although it have lost the focus?

In my tests when VT lost focus the selected row take the color clBtnFace.

Thanks,

Luiz.

 | Replies | Author | Date
5438 | Re: Selected color when losting the focus | Jim Kueneman | Tue 2/26/2002


re: Selected color when losting the focus

From: Jim Kueneman [jimdk@m...]
Date: Tue Feb 26, 2002 1:31 am
Subject: Re: [VirtualTreeview] Selected color when losting the focus

Hi,

>Which property do I have to set in VT to selected row stays allways with
>selected color(BLUE) although it have lost the focus?
>
>In my tests when VT lost focus the selected row take the color clBtnFace.

PaintOptions.toPopup

Jim


re: Re: How to AutoSort Virtual Treeview

From: GK [gkrishna@j...]
Date: Tue Feb 26, 2002 6:29 am
Subject: Re: Re: [VirtualTreeview] How to AutoSort Virtual Treeview

At 25/02/02 12:46:00 PM, you wrote:
>GK wrote:
>
>> What am I doing wrong.
>
>You ignore what you quote yourself:
>
>> "Sorting a node is supported via an application defined compare callback
additionally a tree can be set to auto sort"
>
>So add an OnCompareNodes handler.
>
>Werner

Werner,

Thanks

Seems to be some problem because of translation between english and German or
something.

I got the sorting to work by writing a OnCompareNodes Handler.

But reading the manual I got the feeling that there were two options
1. Write a OnCompareNode handler
2. Virtual Tree View will do a sort on its own

GK.


re: How to AutoSort Virtual Treeview

From: Werner Lehmann [wl@b...]
Date: Tue Feb 26, 2002 10:30 am
Subject: Re: [VirtualTreeview] How to AutoSort Virtual Treeview

GK wrote:
>
> But reading the manual I got the feeling that there were two options
> 1. Write a OnCompareNode handler
> 2. Virtual Tree View will do a sort on its own

I admit that the sentence could have been put somewhat clearer. Nevertheless,
the part "additionally a tree can be set to auto sort" only refers to an
additional (sic) feature - an automatism which does the header-click-sorting
for you - at the expense of the virtuality, as with a manual sort.

The tree could sort itself by using OnGetText events and comparing lexically.
But after all it is virtual, application controled data, and there might be
different sort criteria or number values which should not or cannot be compared
lexically.

Werner


re: How to AutoSort Virtual Treeview

From: GK [gkrishna@j...]
Date: Tue Feb 26, 2002 12:34 pm
Subject: Re: [VirtualTreeview] How to AutoSort Virtual Treeview

At 26/02/02 11:30:00 AM, you wrote:
>GK wrote:
>>
>> But reading the manual I got the feeling that there were two options
>> 1. Write a OnCompareNode handler
>> 2. Virtual Tree View will do a sort on its own
>
>I admit that the sentence could have been put somewhat clearer. Nevertheless,
>the part "additionally a tree can be set to auto sort" only refers to an
>additional (sic) feature - an automatism which does the header-click-sorting
>for you - at the expense of the virtuality, as with a manual sort.
>
>The tree could sort itself by using OnGetText events and comparing lexically.
>But after all it is virtual, application controled data, and there might be
>different sort criteria or number values which should not or cannot be compared
>lexically.
>
>Werner
>
>
Clear now..
Thanks
GK


DBVT - about dbVirtualTreeView

From: "ePC TECH" [epctech@t...]
Date: Tue Feb 26, 2002 2:28 pm
Subject: DBVT - about dbVirtualTreeView

I'm trying to use dbvt Components, descendents of VirtualTreeView, but I found
only the component and 3 applications of demo, without source.
There is someone in the newsgroup who use this component or have work something
with it?
I'm interested to have some outline in use of it.
Hello
Marco

[Non-text portions of this message have been removed]


FW: Re: Long node text hints...

From: "Dion" [dion@n...]
Date: Wed Feb 27, 2002 4:45 am
Subject: FW: [VirtualTreeview] Re: Long node text hints...

-----Original Message-----
From: Dion [mailto:[dion@n...]]
Sent: Monday, February 25, 2002 3:37 PM
To: [VirtualTreeview@yahoogroups.com
Subject: RE: [VirtualTreeview] Re: Long node text hints...

Werner, I would like the hint to look like it does for the nodes text when
the hint type is tooltip. I would like the same effect for the Static text.

Description
This event will only be fired if HintMode is not hmTooltip. The delay for
hints can be set as usual: adjust the properties HintPause and
HintShortPause of the global Application object.

Regards,
Dion.

-----Original Message-----
From: Werner Lehmann [mailto:wl@b...]]
Sent: Monday, February 25, 2002 3:30 AM
To: VirtualTreeview@yahoogroups.com
Subject: Re: [VirtualTreeview] Re: Long node text hints...

Dion wrote:
>
> Great! It works for the nodes text but NOT the static text.

Use OnGetHint. Hints do not work for static text and you have to
put the hint together yourself. I am not sure about the meaning
of the TextType parameter of this event. Maybe it is only the
usual OnGetText event type and TextType will always be ttNormal.

Werner

To unsubscribe from this group, send an email to:
VirtualTreeview-unsubscribe@egroups.com

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/

---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.314 / Virus Database: 175 - Release Date: 01/11/2002

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.314 / Virus Database: 175 - Release Date: 01/11/2002

To unsubscribe from this group, send an email to:
VirtualTreeview-unsubscribe@egroups.com

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/

---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.314 / Virus Database: 175 - Release Date: 01/11/2002

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.314 / Virus Database: 175 - Release Date: 01/11/2002


re: Another Selection question

From: "bkerrison" [bkerrison@y...]
Date: Tue Feb 26, 2002 10:24 pm
Subject: Re: Another Selection question

Thanks Werner,

That worked a treat. I wasn't sure what that option actually did.

However I now have the problem that when I am dragging to the
Treeview the drop target tracks the node that the mouse is over
regardless of which column I am over. Ideally I would like it to only
highlight the node when I am over the label or icon and if I am
elsewhere then the drap target is nil and nothing is highlighted.
Again if there is an easy way to achieve this any pointers would be
appreciated.

Regards

Brendan

--- In [VirtualTreeview@y...], Werner Lehmann [wl@b...] wrote:
> bkerrison wrote:
> >
> > Another Selection question. Is there any easy way to inhibit
> > selection on anything other than the main column. I want to
deselect
> > all nodes if the tree is clicked on anywhere other than the icon
or
> > label of a node in the tree. Currently the node is selected if the
> > text in any of the columns is clicked on.
>
> You can try to set toReportMode.
>
> Werner


re: Re: Another Selection question

From: Werner Lehmann [wl@b...]
Date: Tue Feb 26, 2002 11:19 pm
Subject: Re: [VirtualTreeview] Re: Another Selection question

bkerrison wrote:
>
> That worked a treat. I wasn't sure what that option actually did.

It is meant to mimic the listview behaviour which clears the selection
if you click on a column other than the main column.

> However I now have the problem that when I am dragging to the
> Treeview the drop target tracks the node that the mouse is over
> regardless of which column I am over. Ideally I would like it to only
> highlight the node when I am over the label or icon and if I am
> elsewhere then the drap target is nil and nothing is highlighted.
> Again if there is an easy way to achieve this any pointers would be
> appreciated.

Well I would put this in the responsibility of toReportMode, too. It is
probably just an oversight but maybe Mike can comment on this?

Werner


re: Re: Long node text hints...

From: Werner Lehmann [wl@b...]
Date: Tue Feb 26, 2002 11:22 pm
Subject: Re: [VirtualTreeview] Re: Long node text hints...

Dion wrote:
>
> Werner, I would like the hint to look like it does for the nodes text when
> the hint type is tooltip. I would like the same effect for the Static text.
>
> Description
> This event will only be fired if HintMode is not hmTooltip. The delay for
> hints can be set as usual: adjust the properties HintPause and
> HintShortPause of the global Application object.

If you want to have the hint for the static text appear right above the
static text I am afraid that there is no such funtionality built in. Static
text is special in several cases, for instance it isn't "ellipsified". You
would have to live with what is offered currently or do your own hintwindow
(which is not too hard, the problem is only to know when the static text is
cut off so that a hint is needed).

Werner

 | Replies | Author | Date
5447 | Re: Long node text hints... | Dion | Wed 2/27/2002


re: Re: Long node text hints...

From: "Dion" [dion@n...]
Date: Wed Feb 27, 2002 5:19 pm
Subject: RE: [VirtualTreeview] Re: Long node text hints...

Thanks.

-----Original Message-----
From: Werner Lehmann [mailto:[wl@b...]]
Sent: Tuesday, February 26, 2002 3:23 PM
To: VirtualTreeview@yahoogroups.com
Subject: Re: [VirtualTreeview] Re: Long node text hints...

Dion wrote:
>
> Werner, I would like the hint to look like it does for the nodes text when
> the hint type is tooltip. I would like the same effect for the Static
text.
>
> Description
> This event will only be fired if HintMode is not hmTooltip. The delay for
> hints can be set as usual: adjust the properties HintPause and
> HintShortPause of the global Application object.

If you want to have the hint for the static text appear right above the
static text I am afraid that there is no such funtionality built in. Static
text is special in several cases, for instance it isn't "ellipsified". You
would have to live with what is offered currently or do your own hintwindow
(which is not too hard, the problem is only to know when the static text is
cut off so that a hint is needed).

Werner

To unsubscribe from this group, send an email to:
VirtualTreeview-unsubscribe@egroups.com

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/

---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.314 / Virus Database: 175 - Release Date: 01/11/2002

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.314 / Virus Database: 175 - Release Date: 01/11/2002


A little bug report

From: "valerykvv" [kvv@b...]
Date: Wed Feb 27, 2002 12:09 pm
Subject: A little bug report

AnimationDuration prop. has no effect on the last node in a tree,
when it expands. The expansion fires immediately, while collapsing is
OK.

(Version 3.1.2)

P.S. Mike, thanks for the great work! Thanks to everybody here!

 | Replies | Author | Date
5485 | Re: A little bug report | Mike Lischke | Sun 3/3/2002


Another minor bug report

From: "valerykvv" [kvv@b...]
Date: Wed Feb 27, 2002 12:45 pm
Subject: Another minor bug report

Conditions to reproduce the bug are:
- MDI application;
- VirtualTree is on the child form and has the bottom part overlapped
with boundary of main window (i.e. partly invisible);
- AnimationDuration > 0 ( must be no less than 200 to catch the
effect)

Bug visual effect: collapsing node having children beyond the main
window boundry leads to the appearance of the long vertical colored
strips wich disappear a while after collapsing of the node.

Version 3.1.2, NT4/SP6

 | Replies | Author | Date
5486 | Re: Another minor bug report | Mike Lischke | Sun 3/3/2002


Changing text 'on the fly'

From: "valerykvv" [kvv@b...]
Date: Wed Feb 27, 2002 1:13 pm
Subject: Changing text 'on the fly'

What event should I use to make node's text
change its appearance (color, font etc.), when
the mouse cursor is over it?

 | Replies | Author | Date
5452 | Changing text 'on the fly' | valerykvv | Wed 2/27/2002


onSaveNode and Drag and Drop

From: "Glenn MacGregor" [gtm@o...]
Date: Wed Feb 27, 2002 1:23 pm
Subject: onSaveNode and Drag and Drop

Hello,

If I am moving from within the same tree a node which has children, should I
get the onSaveNode callback for each node that is moved? My problem is that
I just call processDrop and I can't seem to find a call back which will call
me on every node even children. This there a way to get this, again this is
all within the same tree so it is a move not a copy.

Thanks

Glenn

 | Replies | Author | Date
5453 | Re: onSaveNode and Drag and Drop | jimkueneman | Wed 2/27/2002
5487 | Re: onSaveNode and Drag and Drop | Mike Lischke | Sun 3/3/2002


Changing text 'on the fly'

From: "valerykvv" [kvv@b...]
Date: Wed Feb 27, 2002 1:57 pm
Subject: Changing text 'on the fly'

--- In [VirtualTreeview@y...], "valerykvv" [kvv@b...] wrote:
> What event should I use to make node's text
> change its appearance (color, font etc.), when
> the mouse cursor is over it?

Solved. Playing with 'hot track' stuff. Nicely!


re: onSaveNode and Drag and Drop

From: "jimkueneman" [jimdk@m...]
Date: Wed Feb 27, 2002 2:55 pm
Subject: Re: onSaveNode and Drag and Drop

Hi,

> If I am moving from within the same tree a node which has children,
should I
> get the onSaveNode callback for each node that is moved? My
problem is that

OnSaveNode is only called if the nodes are being writtin to stream,
such as if the node is being moved to a different tree. Same tree
moves execute an "optimized" move as Mike calls it which simply moves
the node with respect to the other nodes and fires a NodeMoved event
with the root node that moved.

> I just call processDrop and I can't seem to find a call back which
will call
> me on every node even children. This there a way to get this,
again this is

I think you will have to walk the children manually in the
OnNodeMoved event using Node.FirstChild - Child.NextSibling.

Jim


OnGetImageIndex

From: Lucas Franzen [luc@r...]
Date: Wed Feb 27, 2002 3:31 pm
Subject: OnGetImageIndex

Hello,

I've got some problems with the OnGetImageIndex event.

My Data structure holds an Integer of a certain state - so in dependency
of this state I'm going to show a corresponding image out of an
ImageList in the TreeView (in column 0).

The code's sth. like:

procedure TMyForm.vTreeStatusGetImageIndex(Sender: TBaseVirtualTree;
Node: PVirtualNode; Kind: TVTImageKind; Column: Integer;
var Ghosted: Boolean; var Index: Integer);
var Data: PStatus;
begin
inherited;
if Column > 0 then Index := -1
else begin
Data := Sender.GetNodeData ( Node );
if Assigned ( Data ) then
begin
Index := data.Status;
end
else Index := -1;
end;
end;

Now my problem:
even though data.Status is assigned properly (I can test it by showing
the value in another column) the ImageIndex is NOT assigned properly all
the time.

Example: I've got a value of 4 and the ImageIndex is 0.

For testing I switched the Images 4 and 0 in the ImageList with the
effect that BOTH Images are shown now (one's covering the other).

Even more puzzling I've got another treeView where everything's working
correct - so I copied this TreeView to the form and linked the events it
- now this treeView decided to behave that way, too....

Is there anything basically I'm missing?

TIA
Luc.

 | Replies | Author | Date
5455 | Re: OnGetImageIndex | valerykvv | Wed 2/27/2002
5456 | Re: OnGetImageIndex | jimkueneman | Wed 2/27/2002
5457 | Re: OnGetImageIndex | Lucas Franzen | Wed 2/27/2002
5458 | Re: OnGetImageIndex | Lucas Franzen | Wed 2/27/2002
5459 | Re: OnGetImageIndex | Lucas Franzen | Wed 2/27/2002


re: OnGetImageIndex

From: "valerykvv" [kvv@b...]
Date: Wed Feb 27, 2002 4:01 pm
Subject: Re: OnGetImageIndex

What is your version of VT?


re: OnGetImageIndex

From: "jimkueneman" [jimdk@m...]
Date: Wed Feb 27, 2002 4:20 pm
Subject: Re: OnGetImageIndex

Hi,
> procedure TMyForm.vTreeStatusGetImageIndex(Sender: TBaseVirtualTree;
> Node: PVirtualNode; Kind: TVTImageKind; Column: Integer;
> var Ghosted: Boolean; var Index: Integer);

>
> Is there anything basically I'm missing?

Yes, you must look at the Kind parameter. If the method asks for a
state image and you return a value that makes no sense to the
imagelist it will act screwy. Only return a value for conditions
that make sense based on Kind.

Jim


re: Re: OnGetImageIndex

From: Lucas Franzen [luc@r...]
Date: Wed Feb 27, 2002 6:54 pm
Subject: Re: [VirtualTreeview] Re: OnGetImageIndex

valerykvv schrieb:
>
> What is your version of VT?

It happens as well with 2.65 as with 3.04


re: Re: OnGetImageIndex

From: Lucas Franzen [luc@r...]
Date: Wed Feb 27, 2002 6:55 pm
Subject: Re: [VirtualTreeview] Re: OnGetImageIndex

> Yes, you must look at the Kind parameter. If the method asks for a
> state image and you return a value that makes no sense to the
> imagelist it will act screwy. Only return a value for conditions
> that make sense based on Kind.

Okay, any further details?
I can see :

TVTImageKind = (
ikNormal,
ikSelected,
ikState,
ikOverlay
);

in the source but this doesn't help me too much.

Luc.


re: Re: OnGetImageIndex

From: Lucas Franzen [luc@r...]
Date: Wed Feb 27, 2002 7:31 pm
Subject: Re: [VirtualTreeview] Re: OnGetImageIndex

Lucas Franzen schrieb:
>
> > Yes, you must look at the Kind parameter. If the method asks for a
> > state image and you return a value that makes no sense to the
> > imagelist it will act screwy. Only return a value for conditions
> > that make sense based on Kind.
>
> Okay, any further details?
> I can see :
>
> TVTImageKind = (
> ikNormal,
> ikSelected,
> ikState,
> ikOverlay
> );
>
> in the source but this doesn't help me too much.

Ok, I see.

I just have to set the Index when the Kind is ikNormal or ikSelected and
otherwise leave it the way it is.

So changing my code to:

procedure TMyForm.vTreeStatusGetImageIndex(Sender: TBaseVirtualTree;
Node: PVirtualNode; Kind: TVTImageKind; Column: Integer;
var Ghosted: Boolean; var Index: Integer);
var Data: PStatus;
begin
inherited;
if ( Column = 0 ) AND ( Kind in ( [ikNormal, ikSelected] ) ) then
begin
Data := Sender.GetNodeData ( Node );
Index := data.Status;
end;
end;

did to solve the problem.

- sometimes having a closer look at the adavcend-demo is quite helpful;
at least it's better than looking up this property in the .chm where it
is stated tht it's a property ;-)

Thanks for the hints.

Luc.


re: OnChange question

From: "bkerrison" [bkerrison@y...]
Date: Thu Feb 28, 2002 4:47 am
Subject: Re: OnChange question

Jim,

I'm not sure if this actually has anything to do with the tree itself
but I'm wondering why in the descendant I'm trying to create, when I
click with the left button the WMLButtonDown procedure is called, but
then the WMLButtonUp procedure is called prior to my releasing the
button? Is there someway I can determine whether the mouse button
really has been released? When I release the button the WMLButtonUp
procedure is called again by itself.

Cheers

Brendan

--- In [VirtualTreeview@y...], Jim Kueneman [jimdk@m...] wrote:
>
> Hi,
>
> >The problem I am encountering is that when I click on the first
tree
> >the OnChange event is triggered immediately the mouse button is
> >pressed down. That means that I cannot drag a node to second tree
> >before it changes.
>
>
> You will most likely have to create a decenant of VT to do this.
If you
> look here:
>
>
http://groups.yahoo.com/group/VirtualTreeview/files/Examples/Delphi_Ex
amples/Misc_Examples/
>
> and download the ExplorerRightClick example (mimics the rightclick
that
> TTreeview does, select the new node only during the click then
return to
> the original node wiith out firing an OnChange event) it may get
you
> started.
>
> It can be modified to do what you want. Set a flag to skip the
OnChange
> inherited then call DoChange in the decendant on WM_LBUTTONUP.
>
> Just a thought.
>
> Jim

 | Replies | Author | Date
5469 | Re: OnChange question | Jim Kueneman | Thu 2/28/2002
5488 | Re: OnChange question | Mike Lischke | Sun 3/3/2002


Is this the right way to display a node as bold?

From: GK [gkrishna@j...]
Date: Thu Feb 28, 2002 6:39 am
Subject: Is this the right way to display a node as bold?

Hello,
I am using Virtual treeview and i want to make some of the nodes display in
bold.

I am able to do so by writing a AfterSelPaint event handler.
I am using cellRect and Canvas passed in as parameters to this handler and
using DrawTextEx to print text in Bold.

Is this the right way or is there something easier.

TIA
GK

 | Replies | Author | Date
5462 | Re: Is this the right way to display a node as bo | valerykvv | Thu 2/28/2002


re: Is this the right way to display a node as bold?

From: "valerykvv" [kvv@b...]
Date: Thu Feb 28, 2002 9:05 am
Subject: Re: Is this the right way to display a node as bold?

--- In [VirtualTreeview@y...], GK [gkrishna@j...] wrote:
> Hello,
> I am using Virtual treeview and i want to make some of the nodes
display in bold.
>
> I am able to do so by writing a AfterSelPaint event handler.
> I am using cellRect and Canvas passed in as parameters to this
handler and using DrawTextEx to print text in Bold.
>
> Is this the right way or is there something easier.
>
> TIA
> GK

I think that using event

OnPaintText(Sender: TBaseVirtualTree; const Canvas: TCanvas; Node:
PVirtualNode; Column: Integer; TextType: TVSTTextType);

Canvas.Font.Style := Canvas.Font.Style + [fsBold];

is more correct.


Expanding Up?

From: "hunti1234" [hunti1234@y...]
Date: Thu Feb 28, 2002 1:29 pm
Subject: Expanding Up?

Is is possible to expand the tree up, not down as it is normal?

e.g.

node4
| node3 ^ expanding this way
node2--| |
| |
node1 <-- starting here

christoph

 | Replies | Author | Date
5489 | Re: Expanding Up? | Mike Lischke | Sun 3/3/2002


AbsoluteIndex

From: "ePC TECH" [epctech@t...]
Date: Thu Feb 28, 2002 3:06 pm
Subject: AbsoluteIndex

I haven't found the property AbsoluteIndex of TreeView in TV.
There is something like that in TV or how can I do to obtain the same
result?
Hello and thanks
Marco

[Non-text portions of this message have been removed]

 | Replies | Author | Date
5471 | Re: AbsoluteIndex | jstarsovertherhinet | Fri 3/1/2002


Place a progressbar on each node

From: "ei97005" [ei97005@f...]
Date: Thu Feb 28, 2002 3:23 pm
Subject: Place a progressbar on each node

is that possible to do with VirtualStringTree?

thanks

 | Replies | Author | Date
5466 | Re: Place a progressbar on each node | Helge Jung (ECO-Logic) | Thu 2/28/2002
5478 | Re: Place a progressbar on each node | ei97005 | Sat 3/2/2002
5479 | Re: Place a progressbar on each node | Helge Jung (ECO-Logic) | Sat 3/2/2002


re: Place a progressbar on each node

From: "Helge Jung \(ECO-Logic\)" [helge@e...]
Date: Thu Feb 28, 2002 5:02 pm
Subject: Re: [VirtualTreeview] Place a progressbar on each node

> is that possible to do with VirtualStringTree?

Only if you draw the cell yourself ...

Helge.

 | Replies | Author | Date
5478 | Re: Place a progressbar on each node | ei97005 | Sat 3/2/2002
5479 | Re: Place a progressbar on each node | Helge Jung (ECO-Logic) | Sat 3/2/2002


Child Node Not Displayed

From: "slackmeister" [slackmeister@y...]
Date: Thu Feb 28, 2002 7:25 pm
Subject: Child Node Not Displayed

hi,

I've recently changed versions of the treeview, and now the child
nodes are not displayed at all. when the parent node is clicked, it
fails to expand at all. I have debugged using the parent node's
first child to ensure that the child's data is complete. The parent
node's child count is also correct. If anyone has any suggestions...

thanks
t

 | Replies | Author | Date
5468 | Re: Child Node Not Displayed | lance8722 | Thu 2/28/2002


re: Child Node Not Displayed

From: "lance8722" [lance8722@y...]
Date: Thu Feb 28, 2002 9:25 pm
Subject: Re: Child Node Not Displayed

--- In [VirtualTreeview@y...], "slackmeister" [slackmeister@y...] wrote:
> hi,
>
> I've recently changed versions of the treeview, and now the child
> nodes are not displayed at all. when the parent node is clicked,
it
> fails to expand at all. I have debugged using the parent node's
> first child to ensure that the child's data is complete. The
parent
> node's child count is also correct. If anyone has any
suggestions...
>
> thanks
> t

I had this problem also... Make sure you are not clearing the
vsVisible state. Look for "TVirtualNodeState" in the help.


re: Re: OnChange question

From: Jim Kueneman [jimdk@m...]
Date: Thu Feb 28, 2002 11:55 pm
Subject: Re: [VirtualTreeview] Re: OnChange question

Hi,

>I'm not sure if this actually has anything to do with the tree itself
>but I'm wondering why in the descendant I'm trying to create, when I
>click with the left button the WMLButtonDown procedure is called, but
>then the WMLButtonUp procedure is called prior to my releasing the
>button? Is there someway I can determine whether the mouse button
>really has been released? When I release the button the WMLButtonUp
>procedure is called again by itself.

This should not happen. Do you have a demo?

Jim


Tristate parent's child's checkstate changes

From: "benadembaba" [adembaba@e...]
Date: Fri Mar 1, 2002 2:13 am
Subject: Tristate parent's child's checkstate changes

Hi,

This must have been asked and solved before, but
I cant find where and when.

If the parent is tristate, then, should it not
automagically reflect its children's (or posterity
for that matter) when one of the children's check
state is altered by code?

If so, how do you make that happen --at the moment
what I am doing is recursively make it reflected
up the tree by my own code. Is that the way to do
it?

Cheers,
Adem

 | Replies | Author | Date
5472 | Re: Tristate parent's child's checkstate changes | Jim Kueneman | Fri 3/1/2002
5475 | Re: Tristate parent's child's checkstate changes | benadembaba | Sat 3/2/2002
5477 | Re: Tristate parent's child's checkstate changes | Jim Kueneman | Sat 3/2/2002
5491 | Re: Tristate parent's child's checkstate changes | benadembaba | Sun 3/3/2002
5492 | Popup menu node? | Brian Read | Mon 3/4/2002
5493 | Re: Popup menu node? | Jim Kueneman | Mon 3/4/2002
5494 | Re: Popup menu node? | Brian Read | Mon 3/4/2002


re: AbsoluteIndex

From: "jstarsovertherhinet" [jstarsovertherhinet@y...]
Date: Fri Mar 1, 2002 3:00 am
Subject: Re: AbsoluteIndex

--- In [VirtualTreeview@y...], "ePC TECH" [epctech@t...] wrote:
> I haven't found the property AbsoluteIndex of TreeView in TV.
> There is something like that in TV or how can I do to obtain the
same
> result?
> Hello and thanks
> Marco
>
>
>
>
>
> [Non-text portions of this message have been removed]
Marco,
TBaseVirtualTree has a function named AbsoluteIndex. Pass this
function a PVirtualNode and the AbsoluteIndex will be returned.

For Example:

var
I: Integer;
begin
I := TBaseVirtualTree.AbsoluteIndex(aPVirtualNode);
end;

Heffa~
Tigue Technologies


re: Tristate parent's child's checkstate changes

From: Jim Kueneman [jimdk@m...]
Date: Fri Mar 1, 2002 3:36 am
Subject: Re: [VirtualTreeview] Tristate parent's child's checkstate changes

Hi Adem,

>If the parent is tristate, then, should it not
>automagically reflect its children's (or posterity
>for that matter) when one of the children's check
>state is altered by code?

Make sure TreeOptions->AutoOptions->toAutoTristateTracking is on. Also
*always* use the CheckState[Node] property in VT, don't set the Nodes
CheckState directly.

Jim

 | Replies | Author | Date
5475 | Re: Tristate parent's child's checkstate changes | benadembaba | Sat 3/2/2002
5477 | Re: Tristate parent's child's checkstate changes | Jim Kueneman | Sat 3/2/2002
5491 | Re: Tristate parent's child's checkstate changes | benadembaba | Sun 3/3/2002
5492 | Popup menu node? | Brian Read | Mon 3/4/2002
5493 | Re: Popup menu node? | Jim Kueneman | Mon 3/4/2002
5494 | Re: Popup menu node? | Brian Read | Mon 3/4/2002


re: New file uploaded to VirtualTreeview

From: "Peter Evans" [pgevans@m...]
Date: Fri Mar 1, 2002 11:54 pm
Subject: Re: [VirtualTreeview] New file uploaded to VirtualTreeview

> File : /VTHeaderPopup.zip
> Uploaded by : ralfjunkergmxde [ralfjunker@g...]
> Description : This is another update to TVTHeaderPopup not included in
the VT Patch 1. There are two new options: 1: Show the menu items in the
order of the columns. 2: Prevent the user from hiding the very last column.
This update fixes a small bug to properly free all memory and also includes
Jims latest OnAddHeaderPopupItem.
>

I have now installed and tested this upgrade. It seems to work well.

Thank you Ralf Junker and Jim Kueneman.

Regards, Peter Evans


VSTEdit fixes

From: "Peter Evans" [pgevans@m...]
Date: Fri Mar 1, 2002 11:51 pm
Subject: VSTEdit fixes

------------------
subject VSTEdit fixes

Way back on 7Nov01 I sent the message ' VSTEdit "Range check error." '.

This was the end of a thread on the subject. This was about 2 known
problems.

I will repeat the fix to Problem 1; fix Problems 2; provide a fix to
the unrecorded Problem 3; and give a alert on unrecorded Problem 4.

Problem 1.
This is "Range check error". The solution was suggested by Martijn
Brinkers.
See code fix below.

Problem 2.
When the mouse is being moved to the right hand side. The number in the
Gauge
increases. When the mouse travels past the end of the Gauge the number still
increase. The number can increase above the maximum set in the Property
GaugeMaxValue.
See code fix below.

Problem 3.
When you do not want the Gauge you set the property GaugeHeight = 0.
Thus the Gauge is not visible.
However you can with the mouse drag the invisible Gauge causing the number
in the edit box to move!
It would be preferrable to fix this problem by adding a Property
GaugeEnabled just like the Property TrackbarEnabled.
However, for expediency, see code fix below.

Problem 4.
Infrequently I get the error "Can not focus a disabled or invisible
window". I do not know how this error is triggered. Any suggestions?

In procedure TMFNumEditGauge.WMMouseMove ::-

begin
if ( not MouseCapture ) then
Exit;
IF FEdit.GaugeHeight = 0 THEN {PGE - Gauge is not seen and shouldn't be
detected}
EXIT; {PGE}
IF Message.LParamLo > (High(SmallInt) - 1) THEN {PGE}
Pos := 0 {PGE}
ELSE {PGE}
Pos := Message.LParamLo + 1;
.....
if FIncrement > 0 then
V := FIncrement * Round( V / FIncrement );
IF V > FEdit.GaugeMaxValue THEN {PGE}
V := FEdit.GaugeMaxValue; {PGE}
FEdit.Value := V;
inherited;
end;

Regards, Peter Evans


re: Tristate parent's child's checkstate changes

From: "benadembaba" [adembaba@e...]
Date: Sat Mar 2, 2002 10:24 am
Subject: Re: Tristate parent's child's checkstate changes

Hi Jim,

I tried it, but the result is the same. Here is the way
I add the nodes. Parent node(s) remains unaltered.

Procedure AddChildren(AParentNode: PVirtualNode);
Var
Node1: PVirtualNode;
Index1: Integer;
Data1: PNodeData;
Begin
Index1 := 0;
While Index1 < 10 Do Begin
Node1 := VT1.AddChild(AParentNode);
Data1 := VT1.GetNodeData(Node1);
Data1.Index := Index1;
If Random(10) >= 5 Then VT1.CheckState[Node1] := csCheckedNormal
Else VT1.CheckState[Node1] := csUnCheckedNormal;
Inc(Index1);
End;
End;

Do I have to add any code in OnInitNode, or OnInitChildren
as at the moment those events are not assigned.

Cheers,
Adem

> >If the parent is tristate, then, should it not
> >automagically reflect its children's (or posterity
> >for that matter) when one of the children's check
> >state is altered by code?
>
> Make sure TreeOptions->AutoOptions->toAutoTristateTracking is on.
Also
> *always* use the CheckState[Node] property in VT, don't set the
Nodes
> CheckState directly.
>
> Jim

 | Replies | Author | Date
5477 | Re: Tristate parent's child's checkstate changes | Jim Kueneman | Sat 3/2/2002
5491 | Re: Tristate parent's child's checkstate changes | benadembaba | Sun 3/3/2002
5492 | Popup menu node? | Brian Read | Mon 3/4/2002
5493 | Re: Popup menu node? | Jim Kueneman | Mon 3/4/2002
5494 | Re: Popup menu node? | Brian Read | Mon 3/4/2002


New file uploaded to VirtualTreeview

From: VirtualTreeview@yahoogroups.com
Date: Sat Mar 2, 2002 1:33 pm
Subject: New file uploaded to VirtualTreeview

Hello,

This email message is a notification to let you know that
a file has been uploaded to the Files area of the VirtualTreeview
group.

File : /VTCLX.zip
Uploaded by : mikelischke [lists@l...]
Description : First public beta of the VT port to CLX. Currently, Delphi and
Kylix versions are in the same file separated by IFDEFs. This might not be the
final solution. Help for finishing the Kylix port is highly welcome.

You can access this file at the URL

http://groups.yahoo.com/group/VirtualTreeview/files/VTCLX.zip

To learn more about file sharing for your group, please visit

http://help.yahoo.com/help/us/groups/files

Regards,

mikelischke [lists@l...]


re: Re: Tristate parent's child's checkstate changes

From: Jim Kueneman [jimdk@m...]
Date: Sat Mar 2, 2002 1:45 pm
Subject: Re: [VirtualTreeview] Re: Tristate parent's child's checkstate changes

Hi Adem,

>I tried it, but the result is the same. Here is the way
>I add the nodes. Parent node(s) remains unaltered.

See inline.

> Procedure AddChildren(AParentNode: PVirtualNode);
> Var
> Node1: PVirtualNode;
> Index1: Integer;
> Data1: PNodeData;
> Begin
> Index1 := 0;
> While Index1 < 10 Do Begin
> Node1 := VT1.AddChild(AParentNode);

// AddChild and checkboxes are a bit screwy (remember Mike says
// AddChild is not the way to use VT <G>
// The node is not initialized before the check is handled so
this is
// not set yet. Set it now so it is known from the start
Node1.CheckType := ctTriStateCheckBox;

> Data1 := VT1.GetNodeData(Node1);
> Data1.Index := Index1;
> If Random(10) >= 5 Then VT1.CheckState[Node1] := csCheckedNormal
> Else VT1.CheckState[Node1] := csUnCheckedNormal;
> Inc(Index1);
> End;
> End;

Jim

 | Replies | Author | Date
5491 | Re: Tristate parent's child's checkstate changes | benadembaba | Sun 3/3/2002
5492 | Popup menu node? | Brian Read | Mon 3/4/2002
5493 | Re: Popup menu node? | Jim Kueneman | Mon 3/4/2002
5494 | Re: Popup menu node? | Brian Read | Mon 3/4/2002


re: Place a progressbar on each node

From: "ei97005" [ei97005@f...]
Date: Sat Mar 2, 2002 3:11 pm
Subject: Re: Place a progressbar on each node

can you please show me a little code of that?

thanks in advance!

best regards

--- In [VirtualTreeview@y...], "Helge Jung \(ECO-Logic\)" [helge@e...]
wrote:
> > is that possible to do with VirtualStringTree?
>
> Only if you draw the cell yourself ...
>
> Helge.

 | Replies | Author | Date
5479 | Re: Place a progressbar on each node | Helge Jung (ECO-Logic) | Sat 3/2/2002


re: Re: Place a progressbar on each node

From: "Helge Jung \(ECO-Logic\)" [helge@e...]
Date: Sat Mar 2, 2002 3:34 pm
Subject: Re: [VirtualTreeview] Re: Place a progressbar on each node

> can you please show me a little code of that?

Something like that:

procedure TForm1.VirtualStringTree1AfterCellPaint(Sender: TBaseVirtualTree;
TargetCanvas: TCanvas; Node: PVirtualNode; Column: Integer;
CellRect: TRect);
var
Data : TData;
lx,ly,lw,lh : integer;

begin
if Column = 1 then // the column in which the progress bar shall be shown
begin
Data := PData (Sender.GetNodeData (Node))^;
TargetCanvas.Brush.Color := clWhite;
TargetCanvas.Brush.Style := bsSolid;
TargetCanvas.FillRect (CellRect);
TargetCanvas.Brush.Color := clNavy;
lx := CellRect.Left +2;
ly := CellRect.Top +2;
lh := CellRect.Bottom - CellRect.Top -4;
// Data.p is the progress in percent
lw := Round((CellRect.Right - CellRect.Left - 4) / 100 * Data.p);
TargetCanvas.FilLRect (Rect (lx,ly,lx+lw,ly+lh));
end;
end;

Helge.


re: Re: New file uploaded to VirtualTreeview

From: "Mike Lischke" [lists@l...]
Date: Sat Mar 2, 2002 4:01 pm
Subject: RE: [VirtualTreeview] Re: New file uploaded to VirtualTreeview

Hi Hans-Jürgen,

> I think, that's wrong. The required IDE stuff is contained in
> dclstd.dpc, which is also shipped with Delphi Std. Designide.dcp is
> only available with Delphi Pro and Delphi Ent (and I think,
> Designide.dcp is only neccessary for writing wizzards, which should
> not be possible for Delphi Std).

So far I have tens of thousands of downloads and nobody complained about this
problem. So it doesn't
seem to hurt. However I'm curious about how you would add dclstd.dpc to a
package? I only get
offered to add *.dcp files.

> I tested VirtualTreesD6.dpk requiring only vcl.dcp and vclx.dcp, and
> VirtualTreesD6D.dpk requiring only dclstd.dcp. Since I modified
> VirtualTreesD6.dpk and VirtualTreesD6D.dpk as described, I do not
> have any problems.

This is very interesting. I have removed the designide.dcp file and added
instead dclstd.dcp and the
package can still be installed. I investigated further and found out that
dclstd does require
designide and so the needed units are still included. The only question which
remains is how to know
which package to add if you don't have any list? It was said that
DesignIntf.pas is in designide.dcp
so this was the reason to add this package. How can I come to the idea to
install another one
instead?

> Perhaps, it is not neccssary to publish the bevel properties?

Sure, but now it is out for a while and people would be very surprised if those
properties would
suddenly disappear. Nobody complaint, so I leave it as it is.

> virtual (in constrast to VCL)! Why do not declare this method as
> protected and virtual, too?

There was no need yet to have this method in the protected section. I can make
the necessary changes
right now, no problem.

> The method GetLastChild(Node: PVirtualNode) does initialize, if
> neccessary, the "Node". In contrast, the method GetFirstChild(Node:
> PVirtualNode) does not initialize the "Node", even if neccessary.

This is just an omission. Thank your for pointing this out. It is fixed now.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net

 | Replies | Author | Date
5483 | Re: New file uploaded to VirtualTreeview | mailinglistsde | Sat 3/2/2002


re: OnChange question

From: "Mike Lischke" [lists@l...]
Date: Sat Mar 2, 2002 4:20 pm
Subject: RE: [VirtualTreeview] OnChange question

Hi Brendan,

> The problem I am encountering is that when I click on the first tree
> the OnChange event is triggered immediately the mouse button is
> pressed down. That means that I cannot drag a node to second tree
> before it changes.

I guess for you the tree states are perfect. In the OnChange event there are
several states active,
which you could use. With a ChangeDelay > 0 you get tsChangePending in
VT.TreeStates. With enabled
drag you get tsOLEDragPending or tsVCLDragPending. Additionally, when clicking
with the mouse you
also have tsLeftButtonDown (or middle/right). So you can check for one of those
states and decide
not to perform the change until mouse up (if no dragging started).

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: Re: Long node text hints...

From: "Mike Lischke" [lists@l...]
Date: Sat Mar 2, 2002 4:21 pm
Subject: RE: [VirtualTreeview] Re: Long node text hints...

Dion,

> Werner, I would like the hint to look like it does for the nodes text when
> the hint type is tooltip. I would like the same effect for the Static text.

The static text has a very special definition and also some limitations to make
design easier. If
you want all the things as the normal text offers, then you have to stay with
the normal text
(perhaps custom drawn or at least somehow customized).

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: New file uploaded to VirtualTreeview

From: "mailinglistsde" [mailinglists@j...]
Date: Sat Mar 2, 2002 4:51 pm
Subject: Re: New file uploaded to VirtualTreeview

I'm sorry, but it seems that Hans-Jürgen is wrong. I have D6 Personal
and I do have the Designide.dcp package in my "lib" folder. And I
helped some friends to convert their D5 packages to D6 Personal and I
added several times the Designide.dcp package to many other packages
and it always was there ;-)
Designide.dcp is not only necessary for writing wizards but also
contains base classes for all custom property editors.

But you can check it yourself by downloading D6 Personal from
Borland. ;-)

Regards, Daniel Rikowski

--- In [VirtualTreeview@y...], "Mike Lischke" [lists@l...] wrote:
> Hi Hans-Jürgen,
>
> > I think, that's wrong. The required IDE stuff is contained in
> > dclstd.dpc, which is also shipped with Delphi Std. Designide.dcp
is
> > only available with Delphi Pro and Delphi Ent (and I think,
> > Designide.dcp is only neccessary for writing wizzards, which
should
> > not be possible for Delphi Std).
>
> So far I have tens of thousands of downloads and nobody complained
about this problem. So it doesn't
> seem to hurt. However I'm curious about how you would add
dclstd.dpc to a package? I only get
> offered to add *.dcp files.
>
> > I tested VirtualTreesD6.dpk requiring only vcl.dcp and vclx.dcp,
and
> > VirtualTreesD6D.dpk requiring only dclstd.dcp. Since I modified
> > VirtualTreesD6.dpk and VirtualTreesD6D.dpk as described, I do not
> > have any problems.
>
> This is very interesting. I have removed the designide.dcp file and
added instead dclstd.dcp and the
> package can still be installed. I investigated further and found
out that dclstd does require
> designide and so the needed units are still included. The only
question which remains is how to know
> which package to add if you don't have any list? It was said that
DesignIntf.pas is in designide.dcp
> so this was the reason to add this package. How can I come to the
idea to install another one
> instead?
>
> > Perhaps, it is not neccssary to publish the bevel properties?
>
> Sure, but now it is out for a while and people would be very
surprised if those properties would
> suddenly disappear. Nobody complaint, so I leave it as it is.
>
> > virtual (in constrast to VCL)! Why do not declare this method as
> > protected and virtual, too?
>
> There was no need yet to have this method in the protected section.
I can make the necessary changes
> right now, no problem.
>
> > The method GetLastChild(Node: PVirtualNode) does initialize, if
> > neccessary, the "Node". In contrast, the method GetFirstChild
(Node:
> > PVirtualNode) does not initialize the "Node", even if neccessary.
>
> This is just an omission. Thank your for pointing this out. It is
fixed now.
>
> Ciao, Mike
> --
> www.lischke-online.de
> www.delphi-unicode.net


Problem with OnEditing

From: "mailinglistsde" [mailinglists@j...]
Date: Sat Mar 2, 2002 5:16 pm
Subject: Problem with OnEditing

I don't know if this is a known issue. If so, please forgive me.

When I singleclick on a selected node the OnEditing event gets fired.
After the EditDelay (1000ms) the node editor is created. If you
change the focused node during that time tsEditPending is no longer
in the tree state, but there is no OnEditCancelled event. I think
calling the OnEditCancelled event handler or not calling the
OnEditing event would be much better, especially if your application
needs a complementary call of OnEditCancelled or OnEdited for every
OnEditing.

I'm using the latest patch of VirtualTreeview.

Daniel Rikowski

 | Replies | Author | Date
5510 | Re: Problem with OnEditing | mailinglistsde | Thu 3/7/2002
5511 | Re: Problem with OnEditing | Jim Kueneman | Thu 3/7/2002
5516 | Re: Problem with OnEditing | GIANNAKOPOULOS KOSTAS | Thu 3/7/2002
5520 | Re: Problem with OnEditing | Mike Lischke | Fri 3/8/2002
5525 | Re: Problem with OnEditing | mailinglistsde | Fri 3/8/2002
5531 | Re: Problem with OnEditing | Mike Lischke | Sat 3/9/2002
5535 | Re: Problem with OnEditing | mailinglistsde | Sun 3/10/2002


re: A little bug report

From: "Mike Lischke" [lists@l...]
Date: Sun Mar 3, 2002 9:17 am
Subject: RE: [VirtualTreeview] A little bug report

Hi Valery,

> AnimationDuration prop. has no effect on the last node in a tree,
> when it expands. The expansion fires immediately, while collapsing is
> OK.

This is intended. The animation is mainly a scroll effect of the content, which
is already in the
tree. For the last node however there is no content below it, so it makes no
sense to animate this
"nothing".

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: Another minor bug report

From: "Mike Lischke" [lists@l...]
Date: Sun Mar 3, 2002 9:20 am
Subject: RE: [VirtualTreeview] Another minor bug report

Valery,

> Bug visual effect: collapsing node having children beyond the main
> window boundry leads to the appearance of the long vertical colored
> strips wich disappear a while after collapsing of the node.

Yes, I know this effect. I have put some effort to minimize it but under
certain conditions it
appears again. It has to do with the size of the client area to scroll which
can not always be
determined reliably to be exact the needed area. Changing the current
implementation only cause the
effect to appear under other conditions.

No solution known yet.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: onSaveNode and Drag and Drop

From: "Mike Lischke" [lists@l...]
Date: Sun Mar 3, 2002 9:22 am
Subject: RE: [VirtualTreeview] onSaveNode and Drag and Drop

Hi Glenn,

> If I am moving from within the same tree a node which has children, should I
> get the onSaveNode callback for each node that is moved? My problem is that
> I just call processDrop and I can't seem to find a call back which will call
> me on every node even children. This there a way to get this, again this is
> all within the same tree so it is a move not a copy.

Actually, you will never get an OnSaveNode/OnLoadNode event for moving nodes
within the same tree.
This is because it is not needed to stream the content (only a couple of
pointers need to be
adjusted). To force streaming you can however use node copies and delete the
old nodes manually.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: Re: OnChange question

From: "Mike Lischke" [lists@l...]
Date: Sun Mar 3, 2002 9:36 am
Subject: RE: [VirtualTreeview] Re: OnChange question

Hi Brendan,

> I'm not sure if this actually has anything to do with the tree itself
> but I'm wondering why in the descendant I'm trying to create, when I
> click with the left button the WMLButtonDown procedure is called, but
> then the WMLButtonUp procedure is called prior to my releasing the
> button?

This can happen with automatic drag start. The VCL has this strange behavior
for dd.

Is there someway I can determine whether the mouse button
> really has been released? When I release the button the WMLButtonUp
> procedure is called again by itself.

The tree carries some states for dragging in VT.TreeStates. Check for
tsOLEDragging/DragPending and
tsVCLDragPending/Dragging.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: Expanding Up?

From: "Mike Lischke" [lists@l...]
Date: Sun Mar 3, 2002 9:37 am
Subject: RE: [VirtualTreeview] Expanding Up?

Hi Christoph,

> Is is possible to expand the tree up, not down as it is normal?

No, this is not possible. You need special implementations like TeeTree for
such cases.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


TargetCanvas.Font.Charset -- no effect

From: "mypoza" [mypoza@y...]
Date: Sun Mar 3, 2002 2:33 pm
Subject: TargetCanvas.Font.Charset -- no effect

Hi!

I try to use different charsets for different columns in VST (with
grid extensions) by changing it in OnPaintText event (but it has no
effect -- russian text is painted as with DEFAULT_CHARSET):

======
procedure TForm1.MyVSTGridPaintText(Sender: TBaseVirtualTree;
const TargetCanvas: TCanvas; Node: PVirtualNode; Column: Integer;
TextType: TVSTTextType);
begin
case Column of
1:
TargetCanvas.Font.Color := clRed; // Works OK
2:
begin
//TargetCanvas.Font := FGridCanvasFont;
TargetCanvas.Font.Name := 'Arial'; // Works OK
TargetCanvas.Font.Color := clBlue; // Works OK
TargetCanvas.Font.Charset := RUSSIAN_CHARSET; // Doesn't work
end;
end;

// Reset the text color for selected and drop target nodes.
if ((Node = Sender.DropTargetNode) or (vsSelected in Node.States))
and
(Column = Sender.FocusedColumn) then
TargetCanvas.Font.Color := clHighlightText;
end;
======

So, what I'm doing wrong here?
Or how can I correctly paint russian characters, for example?

Btw, for my EditLink RUSSIAN_CHARSET and Arial are working just
fine, as well if I try to paint text to TStringGrid.

I guess, there is some paint problem here that I don't understand.

Cheers, MP

NB! Delphi 5 Ent / WinNT 4 / VST 3.0.4

 | Replies | Author | Date
5529 | Re: TargetCanvas.Font.Charset -- no effect | Mike Lischke | Sat 3/9/2002
5530 | Re: TargetCanvas.Font.Charset -- no effect | Jim Kueneman | Sat 3/9/2002
5534 | Re: TargetCanvas.Font.Charset -- no effect | Mike Lischke | Sat 3/9/2002


re: Tristate parent's child's checkstate changes

From: "benadembaba" [adembaba@e...]
Date: Sun Mar 3, 2002 5:36 pm
Subject: Re: Tristate parent's child's checkstate changes

Hi Jim,

It turned out to be a lot more than that.

One thing about VT: You have to think in a
completely different set and integrate VT into
your project in the beginning or else you will
have plenty of code reorgs and modifs... I did.

Thanks, it works now.

Cheers,
Adem

--- In [VirtualTreeview@y...], Jim Kueneman [jimdk@m...] wrote:
>
> Hi Adem,
>
> >I tried it, but the result is the same. Here is the way
> >I add the nodes. Parent node(s) remains unaltered.
>
> See inline.
>
>
>
> > Procedure AddChildren(AParentNode: PVirtualNode);
> > Var
> > Node1: PVirtualNode;
> > Index1: Integer;
> > Data1: PNodeData;
> > Begin
> > Index1 := 0;
> > While Index1 < 10 Do Begin
> > Node1 := VT1.AddChild(AParentNode);
>
> // AddChild and checkboxes are a bit screwy (remember
Mike says
> // AddChild is not the way to use VT <G>
> // The node is not initialized before the check is
handled so
> this is
> // not set yet. Set it now so it is known from the start
> Node1.CheckType := ctTriStateCheckBox;
>
> > Data1 := VT1.GetNodeData(Node1);
> > Data1.Index := Index1;
> > If Random(10) >= 5 Then VT1.CheckState[Node1] :=
csCheckedNormal
> > Else VT1.CheckState[Node1] := csUnCheckedNormal;
> > Inc(Index1);
> > End;
> > End;
>
>
> Jim

 | Replies | Author | Date
5492 | Popup menu node? | Brian Read | Mon 3/4/2002
5493 | Re: Popup menu node? | Jim Kueneman | Mon 3/4/2002
5494 | Re: Popup menu node? | Brian Read | Mon 3/4/2002


Popup menu node?

From: Brian Read [brianr@b...]
Date: Mon Mar 4, 2002 11:48 am
Subject: [VirtualTreeview] Popup menu node?

This may be obvious, but....

How can i tell which node is currently selected when the user right clicks
for a popup menu?

Cheers

Brian

 | Replies | Author | Date
5493 | Re: Popup menu node? | Jim Kueneman | Mon 3/4/2002
5494 | Re: Popup menu node? | Brian Read | Mon 3/4/2002


re: Popup menu node?

From: Jim Kueneman [jimdk@m...]
Date: Mon Mar 4, 2002 12:29 pm
Subject: Re: [VirtualTreeview] Popup menu node?

>How can i tell which node is currently selected when the user right clicks
>for a popup menu?

Use OnContextPopup then

VT.GetHitTestInfoAt(MousePos.x, MousePos.y, HitInfo)

to get the node and column

or just GetNodeAt for the node

Jim

 | Replies | Author | Date
5494 | Re: Popup menu node? | Brian Read | Mon 3/4/2002


re: Popup menu node?

From: Brian Read [brianr@b...]
Date: Mon Mar 4, 2002 3:38 pm
Subject: Re: [VirtualTreeview] Popup menu node?

Thanks Jim, for that.

Another question, how do I force the tree, or part of the tree to be
redrawn, after adding a node, so that the new node becomes visible,
preferably without loosing the current level of expansion?

cheers

Brian

At 12:29 04/03/2002, you wrote:

> >How can i tell which node is currently selected when the user right clicks
> >for a popup menu?
>
>Use OnContextPopup then
>
>VT.GetHitTestInfoAt(MousePos.x, MousePos.y, HitInfo)
>
>to get the node and column
>
>or just GetNodeAt for the node
>
>Jim
>
>
>Yahoo! Groups Sponsor
>ADVERTISEMENT
><http://rd.yahoo.com/M=217097.1902236.3412362.1261774/D=egroupweb/S=1705115362:\
HM/A=991349/R=0/*http://service.bfast.com/bfast/click?bfmid=29150849&siteid=3928\
2504&bfpage=account>15d6da64.jpg
>15d6db4a.jpg
>
>To unsubscribe from this group, send an email to:
>VirtualTreeview-unsubscribe@egroups.com
>
>
>
>Your use of Yahoo! Groups is subject to the
><http://docs.yahoo.com/info/terms/>Yahoo! Terms of Service.

[Non-text portions of this message have been removed]


Fwd: Re: Popup menu node?

From: Brian Read [brianr@b...]
Date: Tue Mar 5, 2002 2:01 pm
Subject: Fwd: Re: [VirtualTreeview] Popup menu node?

Anyone?

Brian

>Thanks Jim, for that.
>
>Another question, how do I force the tree, or part of the tree to be
>redrawn, after adding a node, so that the new node becomes visible,
>preferably without loosing the current level of expansion?
>
>cheers
>
>Brian
>
>
>
>At 12:29 04/03/2002, you wrote:
>
>
>
> > >How can i tell which node is currently selected when the user right clicks
> > >for a popup menu?
> >
> >Use OnContextPopup then
> >
> >VT.GetHitTestInfoAt(MousePos.x, MousePos.y, HitInfo)
> >
> >to get the node and column
> >
> >or just GetNodeAt for the node
> >
> >Jim
> >
> >
> >Yahoo! Groups Sponsor
>VirtualTreeview-unsubscribe@egroups.com
>
>
>
>Your use of Yahoo! Groups is subject to the
><http://docs.yahoo.com/info/terms/>Yahoo! Terms of Service.

[Non-text portions of this message have been removed]

 | Replies | Author | Date
5498 | Fwd: Re: [VirtualTreeview] Popup menu node? | jimkueneman | Tue 3/5/2002
5501 | Re: Fwd: Re: [VirtualTreeview] Popup menu node? | Brian Read | Wed 3/6/2002
5502 | Re: Fwd: Re: [VirtualTreeview] Popup menu node? | Werner Lehmann | Wed 3/6/2002
5518 | Display of new child nodes. | Brian Read | Thu 3/7/2002


re: Popup menu node?

From: Werner Lehmann [wl@b...]
Date: Tue Mar 5, 2002 11:55 am
Subject: Re: [VirtualTreeview] Popup menu node?

Brian Read wrote:
>
> Thanks Jim, for that.
>
> Another question, how do I force the tree, or part of the tree to be
> redrawn, after adding a node, so that the new node becomes visible,
> preferably without loosing the current level of expansion?

ScrollIntoView. But this may expand parent nodes if necessary (AFAIK).
Hence you might want to check if it is visible in the notion of "all
parent nodes are expanded" to avoid any expansion (which you seemingly
want to achieve). This test is done by one of the IsVisible, (Is)FullyVisible,
Visible properties, I always have to look this up and have no source
available here.

Werner

 | Replies | Author | Date
5500 | Re: Popup menu node? | GIANNAKOPOULOS KOSTAS | Wed 3/6/2002


Change font by column?

From: "Ralph Sickinger (R2)" [ralph@s...]
Date: Tue Mar 5, 2002 3:27 pm
Subject: Change font by column?

Is there a way to change the display font for one specific column in
the virtualStringTree? (Short of custom drawing the entire node?)

TIA,
Ralph S.

 | Replies | Author | Date
5499 | Re: Change font by column? | Justin Holloway | Wed 3/6/2002
5505 | Re: Change font by column? | Jim Kueneman | Wed 3/6/2002


Fwd: Re: Popup menu node?

From: "jimkueneman" [jimdk@m...]
Date: Tue Mar 5, 2002 4:06 pm
Subject: Fwd: Re: [VirtualTreeview] Popup menu node?

> >
> >Another question, how do I force the tree, or part of the tree to
be
> >redrawn, after adding a node, so that the new node becomes visible,
> >preferably without loosing the current level of expansion?
> >

InvalidateNode(Node)

or

VT.BeginUpdate;
..Add Nodes
VT.EndUpdate

Jim

 | Replies | Author | Date
5501 | Re: Fwd: Re: [VirtualTreeview] Popup menu node? | Brian Read | Wed 3/6/2002


re: Change font by column?

From: "Justin Holloway" [justin@s...]
Date: Tue Mar 5, 2002 10:03 pm
Subject: RE: [VirtualTreeview] Change font by column?

In the OnPaintText event put something like:

case Column of
1,3: TargetCanvas.Font.Color := clWindowText;
4: if (Node<>VSTHistory.FocusedNode) then
TargetCanvas.Font.Color := clBlue
else
TargetCanvas.Font.Color := clRed;
end;

Joost


re: Re: Popup menu node?

From: GIANNAKOPOULOS KOSTAS [kyan@s...]
Date: Tue Mar 5, 2002 3:20 pm
Subject: RE: Re: [VirtualTreeview] Popup menu node?

> >Another question, how do I force the tree, or part of the tree to be
> >redrawn, after adding a node, so that the new node becomes visible,
> >preferably without loosing the current level of expansion?
> >
>
> Anyone?
>

If i understand correctly what you are asking for, take a look at method
ScrollIntoView.


re: Fwd: Re: Popup menu node?

From: Brian Read [brianr@b...]
Date: Wed Mar 6, 2002 10:35 am
Subject: Re: Fwd: Re: [VirtualTreeview] Popup menu node?

Actually neither ScrollIntoView nor invalidatenode seems to do anything at all!

Let me explain what I want to do in more detail:

I am "driving" VT from an XML file (managed using xmldom). This works very
well.

However I if I "add" another XML node (as the result of a popup on the VT),
I then want the VT to show the new node instantly . At the moment, the only
way I seem to be able to see the new node is to Save the XML to a file, and
re-load it, having cleared the VT, this is rather heavy, slow and destroys
the current expansion.

If I edit the captions for the VT nodes (via the XML), this is shown up
instantly, as I presume that VT does not store the captions, but calls
"getText" whenever it needs them.

I need to be able to "tell" VT that this part of the structure must be
refreshed from the underlying data structure (i.e. the XML), in others
words re-call "initNode" and "initChildren", for this branch.

Any ideas?

Cheers

Brian

At 16:06 05/03/2002, jimkueneman wrote:
> > >
> > >Another question, how do I force the tree, or part of the tree to
>be
> > >redrawn, after adding a node, so that the new node becomes visible,
> > >preferably without loosing the current level of expansion?
> > >
>
>InvalidateNode(Node)
>
>or
>
>VT.BeginUpdate;
>..Add Nodes
>VT.EndUpdate
>
>
>Jim
>
>
>Yahoo! Groups Sponsor
>ADVERTISEMENT
><http://rd.yahoo.com/M=215002.1818248.3328688.1261774/D=egroupweb/S=1705115362:\
HM/A=847665/R=0/*http://ads.x10.com/?bHlhaG9vbW9uc3RlcjcuZGF0=1015371290%3eM=215\
002.1818248.3328688.1261774/D=egroupweb/S=1705115362:HM/A=847665/R=1>1f0d9665.jp\
g
>1f0d9741.jpg
>
>To unsubscribe from this group, send an email to:
>VirtualTreeview-unsubscribe@egroups.com
>
>
>
>Your use of Yahoo! Groups is subject to the
><http://docs.yahoo.com/info/terms/>Yahoo! Terms of Service.

[Non-text portions of this message have been removed]


re: Fwd: Re: Popup menu node?

From: Werner Lehmann [wl@b...]
Date: Wed Mar 6, 2002 10:45 am
Subject: Re: Fwd: Re: [VirtualTreeview] Popup menu node?

Hi Brian,

> Actually neither ScrollIntoView nor invalidatenode seems to do anything at
all!
>
> Let me explain what I want to do in more detail:
>
> I am "driving" VT from an XML file (managed using xmldom). This works very
> well.
>
> However I if I "add" another XML node (as the result of a popup on the VT),
> I then want the VT to show the new node instantly . At the moment, the only
> way I seem to be able to see the new node is to Save the XML to a file, and
> re-load it, having cleared the VT, this is rather heavy, slow and destroys
> the current expansion.
>
> If I edit the captions for the VT nodes (via the XML), this is shown up
> instantly, as I presume that VT does not store the captions, but calls
> "getText" whenever it needs them.

I still don't get the problem. Do you see a new node but the node text is
missing? Then InvalidateNode is your friend. Don't you see the node although
you added it with AddChild / InsertNode / ChildCount[]? Then make sure you
don't have a BeginUpdate without corresponding EndUpdate pending. The node
is added somewhere but it is not visible on screen? ScrollIntoView is the
solution.

Probably none of this is your problem as these suggestions have already been
made. Maybe you show us the code snippet which adds the node?

> I need to be able to "tell" VT that this part of the structure must be
> refreshed from the underlying data structure (i.e. the XML), in others
> words re-call "initNode" and "initChildren", for this branch.

ReInitNode, ReInitChildren.

Werner

 | Replies | Author | Date
5518 | Display of new child nodes. | Brian Read | Thu 3/7/2002


Can't use most VT Demos (at least not As-Is)

From: "eljarec" [eljarec@y...]
Date: Wed Mar 6, 2002 4:30 pm
Subject: Can't use most VT Demos (at least not As-Is)

Hi,

I downloaded and installed VT yesterday and all went without a hitch,
however when I wanted to take a look at the demos I stumbled on a
problem. It seems the person packaging the demos, has touched them
with D6 and did not bother to include conditionals to separate any
new D6 stuf from the other versions...

As such most of the demos won't run because in D5 the TForm does not
know the DesignSize property, and there is no Variants unit in D5.

Also I get in several of the demos errors about parameterlists which
are incomatible...probably also a result of touching with D6.

TIA
JarC

 | Replies | Author | Date
5504 | Re: Can't use most VT Demos (at least not As-Is) | jimkueneman | Wed 3/6/2002
5506 | Re: Can't use most VT Demos (at least not As-Is) | Justin Stenning | Wed 3/6/2002


re: Can't use most VT Demos (at least not As-Is)

From: "jimkueneman" [jimdk@m...]
Date: Wed Mar 6, 2002 6:36 pm
Subject: Re: Can't use most VT Demos (at least not As-Is)

> know the DesignSize property, and there is no Variants unit in D5.

Ignore the property, remove the Varients unit, then resave the
project and it will work.

> Also I get in several of the demos errors about parameterlists
which
> are incomatible...probably also a result of touching with D6.

The demos are mostly a collection of things enthusiastic users put
together, so there may be issues. I asked Mike about this too but he
is too busy to try to get them all running under new version of VT
and Delphi.

Jim


re: Change font by column?

From: Jim Kueneman [jimdk@m...]
Date: Wed Mar 6, 2002 1:39 am
Subject: Re: [VirtualTreeview] Change font by column?

Hi,

>Is there a way to change the display font for one specific column in
>the virtualStringTree? (Short of custom drawing the entire node?)

procedure TForm1.VirtualStringTree1PaintText(Sender: TBaseVirtualTree;
const TargetCanvas: TCanvas; Node: PVirtualNode; Column: TColumnIndex;
TextType: TVSTTextType);
begin
if Column = 1 then
begin
TargetCanvas.Font.Color := clRed;
TargetCanvas.Font.Name := 'Courier New';
TargetCanvas.Font.Style := [fsBold, fsItalic]
end
end;

Jim


re: Re: Can't use most VT Demos (at least not As-Is)

From: "Justin Stenning" [jstenning@e...]
Date: Wed Mar 6, 2002 9:48 pm
Subject: Re: [VirtualTreeview] Re: Can't use most VT Demos (at least not As-Is)

I found with the Parameter lists that you just need to update some of the
events... All the events that have Column need to be changed from integer to
TColumnIndex...
----- Original Message -----
From: jimkueneman
To: VirtualTreeview@yahoogroups.com
Sent: Thursday, March 07, 2002 5:36 AM
Subject: [VirtualTreeview] Re: Can't use most VT Demos (at least not As-Is)

> know the DesignSize property, and there is no Variants unit in D5.

Ignore the property, remove the Varients unit, then resave the
project and it will work.

> Also I get in several of the demos errors about parameterlists
which
> are incomatible...probably also a result of touching with D6.

The demos are mostly a collection of things enthusiastic users put
together, so there may be issues. I asked Mike about this too but he
is too busy to try to get them all running under new version of VT
and Delphi.

Jim

To unsubscribe from this group, send an email to:
VirtualTreeview-unsubscribe@egroups.com

Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.

[Non-text portions of this message have been removed]


newbie question please

From: [shawnh@h...]
Date: Thu Mar 7, 2002 2:12 am
Subject: newbie question please

Hi...
I just joined and brand new to VirtualTreeView. I'm just getting it
up and running and I think I installed it correctly, but when I try to
compile and run one of the examples (the 'Minimal' one), it gives a
"File Not Found 'VirtualTrees.dcu'" error during compilation.

The file is right there in the \VirtualTree\VirtualTree\ directory. I'm
using D6 Personal.

Thanks!
Shawn

 | Replies | Author | Date
5508 | Re: newbie question please | Helge Jung (ECO-Logic) | Wed 3/6/2002


re: newbie question please

From: "Helge Jung \(ECO-Logic\)" [helge@e...]
Date: Wed Mar 6, 2002 10:22 pm
Subject: Re: [VirtualTreeview] newbie question please

> I just joined and brand new to VirtualTreeView. I'm just getting it
> up and running and I think I installed it correctly, but when I try to
> compile and run one of the examples (the 'Minimal' one), it gives a
> "File Not Found 'VirtualTrees.dcu'" error during compilation.
>
> The file is right there in the \VirtualTree\VirtualTree\ directory. I'm
> using D6 Personal.

Be sure to have the source dir in your library path!

Helge.


BCB 5 Examples

From: "fabe12345" [debate@g...]
Date: Wed Mar 6, 2002 8:27 am
Subject: BCB 5 Examples

I managed to install VT in BCB and it seems to work.
Could someone plz help me out with one or two simple working
examples on how to use VT in BCB.

I'm using Version 3.0.4 with the Combatibility Patches for BCB.

Thanks
Mike

 | Replies | Author | Date
5539 | Re: BCB 5 Examples | bifmud | Sun 3/10/2002


re: Problem with OnEditing

From: "mailinglistsde" [mailinglists@j...]
Date: Wed Mar 6, 2002 9:56 am
Subject: Re: Problem with OnEditing

Is this such a stupid question that no one wants to answer? (No
offense)

--- In [VirtualTreeview@y...], "mailinglistsde" [mailinglists@j...]
wrote:
> I don't know if this is a known issue. If so, please forgive me.
>
> When I singleclick on a selected node the OnEditing event gets
fired.
> After the EditDelay (1000ms) the node editor is created. If you
> change the focused node during that time tsEditPending is no longer
> in the tree state, but there is no OnEditCancelled event. I think
> calling the OnEditCancelled event handler or not calling the
> OnEditing event would be much better, especially if your
application
> needs a complementary call of OnEditCancelled or OnEdited for every
> OnEditing.
>
> I'm using the latest patch of VirtualTreeview.
>
> Daniel Rikowski

 | Replies | Author | Date
5511 | Re: Problem with OnEditing | Jim Kueneman | Thu 3/7/2002


re: Re: Problem with OnEditing

From: Jim Kueneman [jimdk@m...]
Date: Thu Mar 7, 2002 2:06 am
Subject: Re: [VirtualTreeview] Re: Problem with OnEditing

>Is this such a stupid question that no one wants to answer? (No

No this is really a Mike question since it is a basic functionality issue
with VT. We are just waiting for him to answer <G>

Jim


Re[2]: Change font by column?

From: "Ralph Sickinger (R2)" [ralph@s...]
Date: Wed Mar 6, 2002 7:39 pm
Subject: Re[2]: [VirtualTreeview] Change font by column?

Thanks Jim - Asked and already answered (Thank you Justin!)

The key that I was missing was the onPaintText event; I was looking at
the beforeXXXXpaint series of events, which didn't work, or the
onGetXXXX series (looking for GetNodeFont or something like that)

PaintText works like a charm!

Ralph S.

================================================================
from: Jim Kueneman (03/05/2002 18:39)
================================================================

Hi,

>Is there a way to change the display font for one specific column in
>the virtualStringTree? (Short of custom drawing the entire node?)

procedure TForm1.VirtualStringTree1PaintText(Sender: TBaseVirtualTree;
const TargetCanvas: TCanvas; Node: PVirtualNode; Column: TColumnIndex;
TextType: TVSTTextType);
begin
if Column = 1 then
begin
TargetCanvas.Font.Color := clRed;
TargetCanvas.Font.Name := 'Courier New';
TargetCanvas.Font.Style := [fsBold, fsItalic]
end
end;

Jim

Yahoo! Groups Sponsor
ADVERTISEMENT

To unsubscribe from this group, send an email to:
VirtualTreeview-unsubscribe@egroups.com

Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.

 | Replies | Author | Date
5513 | Re[2]: [VirtualTreeview] Change font by column? | Jim Kueneman | Thu 3/7/2002


Re[2]: Change font by column?

From: Jim Kueneman [jimdk@m...]
Date: Thu Mar 7, 2002 4:52 am
Subject: Re[2]: [VirtualTreeview] Change font by column?

>Thanks Jim - Asked and already answered (Thank you Justin!)

Yea, I sent this yesterday! It must have made a few trips aound the world.

Jim


Hot Track

From: "Dion" [dion@n...]
Date: Thu Mar 7, 2002 9:46 am
Subject: Hot Track

Hi,

When I move my cursor over node items in a tree, the cursor changes to the
cursor to be displayed over an item(in my case the hand), some not. In fact
those items cannot even be focused, until I move the cursor over the check
box. Only then does the cursor change and the item(node) become focused, if
I click on it.

Is this normal behaviour? I am using XP check box style.

Many Thanks,
Dion.

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.314 / Virus Database: 175 - Release Date: 01/11/2002

 | Replies | Author | Date
5526 | Re: Hot Track | lysergeic | Fri 3/8/2002


TWideStringList -missing properties

From: "benadembaba" [adembaba@e...]
Date: Thu Mar 7, 2002 8:25 am
Subject: TWideStringList -missing properties

Hi Mike,

In the latest VT package'e WideStrings unit,
the following properties are missing from
TWideStringList:

BeginUpdate
LoadFromFile
EndUpdate
Text

(These were the ones TXMLTree needed, I did not
check for other ones, but I did notice that
the whole unit is halved.)

Are they likely to come back, do you expect us to
use some other alternatives?

Cheers,
Adem

 | Replies | Author | Date
5517 | Re: TWideStringList -missing properties | Jim Kueneman | Thu 3/7/2002
5522 | Re: TWideStringList -missing properties | benadembaba | Fri 3/8/2002
5523 | Re: TWideStringList -missing properties | jimkueneman | Fri 3/8/2002
5524 | Re: TWideStringList -missing properties | benadembaba | Fri 3/8/2002


re: Re: Problem with OnEditing

From: GIANNAKOPOULOS KOSTAS [kyan@s...]
Date: Thu Mar 7, 2002 9:01 am
Subject: RE: [VirtualTreeview] Re: Problem with OnEditing

> Is this such a stupid question that no one wants to answer? (No
> offense)

No, but only Mike has the authority to answer it. The rest of us can only
agree or disagree with you.
Probably noone cas come across this quirk yet.


re: TWideStringList -missing properties

From: Jim Kueneman [jimdk@m...]
Date: Thu Mar 7, 2002 12:33 pm
Subject: Re: [VirtualTreeview] TWideStringList -missing properties

Hi Adem,

>In the latest VT package'e WideStrings unit,

You are yelling at the wrong guy, that is in VET.

>the following properties are missing from
>TWideStringList:
>
> BeginUpdate
> LoadFromFile
> EndUpdate
> Text

I only took pieces from Mikes Unicode unit that I needed for the
Autocomplete and that did not need all the paging and mapping overhead from
that unit. Look at the Unicode unit that is on Mikes website and see if
those (expcially the LoadFromFile) relied some of the IsXXXXX
functions. If so then is likely needed the 1Meg of ram mapping code which
most VET users made clear they did not want. One way is to only save
unicode if the OS is Unicode aware. This way you can use the built in W
function to duplicate Mikes unit. If not the file will be saved as ASCI
then read back in and converted to a WideString. Mikes unit allows Win9x
to work 100% in Unicode.

Jim

 | Replies | Author | Date
5522 | Re: TWideStringList -missing properties | benadembaba | Fri 3/8/2002
5523 | Re: TWideStringList -missing properties | jimkueneman | Fri 3/8/2002
5524 | Re: TWideStringList -missing properties | benadembaba | Fri 3/8/2002


Display of new child nodes.

From: Brian Read [brianr@b...]
Date: Thu Mar 7, 2002 2:59 pm
Subject: Display of new child nodes.

Ok, instead of just adding nodes to the XML, and expecting the VT to
display them, I am now adding nodes to the VT at the same time, and this
works fine, EXCEPT if I add a child node(s) to a node which is not
expanded, it shows the new nodes (i.e. expands down to them), but does not
show the existing child nodes for that node. Worse than that, it refuses
to show the child nodes even if I collapse, then do an expand.

I am not sure if this is a bug or not, but to "fix" it I need to be able to
"force" the display of the children for a node (but not necessarily a
"full" expand), so that the new ones just get added onto the end.

cheers

Brian

At 10:45 06/03/2002, Werner Lehmann wrote:
>Hi Brian,
>
> > Actually neither ScrollIntoView nor invalidatenode seems to do anything
> at all!
> >
> > Let me explain what I want to do in more detail:
> >
> > I am "driving" VT from an XML file (managed using xmldom). This works very
> > well.
> >
> > However I if I "add" another XML node (as the result of a popup on the VT),
> > I then want the VT to show the new node instantly . At the moment, the only
> > way I seem to be able to see the new node is to Save the XML to a file, and
> > re-load it, having cleared the VT, this is rather heavy, slow and destroys
> > the current expansion.
> >
> > If I edit the captions for the VT nodes (via the XML), this is shown up
> > instantly, as I presume that VT does not store the captions, but calls
> > "getText" whenever it needs them.
>
>I still don't get the problem. Do you see a new node but the node text is
>missing? Then InvalidateNode is your friend. Don't you see the node although
>you added it with AddChild / InsertNode / ChildCount[]? Then make sure you
>don't have a BeginUpdate without corresponding EndUpdate pending. The node
>is added somewhere but it is not visible on screen? ScrollIntoView is the
>solution.
>
>Probably none of this is your problem as these suggestions have already been
>made. Maybe you show us the code snippet which adds the node?
>
> > I need to be able to "tell" VT that this part of the structure must be
> > refreshed from the underlying data structure (i.e. the XML), in others
> > words re-call "initNode" and "initChildren", for this branch.
>
>ReInitNode, ReInitChildren.
>
>Werner
>
>
>
>Yahoo! Groups Sponsor
>ADVERTISEMENT
><http://rd.yahoo.com/M=215002.1818248.3328688.1261774/D=egroupweb/S=1705115362:\
HM/A=847665/R=0/*http://ads.x10.com/?bHlhaG9vbW9uc3RlcjcuZGF0=1015412306%3eM=215\
002.1818248.3328688.1261774/D=egroupweb/S=1705115362:HM/A=847665/R=1>5fe7da9.jpg
>5fe7f80.jpg
>
>To unsubscribe from this group, send an email to:
>[VirtualTreeview-unsubscribe@egroups.com
>
>
>
>Your use of Yahoo! Groups is subject to the
><http://docs.yahoo.com/info/terms/>Yahoo! Terms of Service.

Brian J Read
brianr@b...]
www.bjsystems.co.uk
01695 723723

[Non-text portions of this message have been removed]


re: Display of new child nodes.

From: GIANNAKOPOULOS KOSTAS [kyan@s...]
Date: Thu Mar 7, 2002 3:38 pm
Subject: RE: [VirtualTreeview] Display of new child nodes.

> Ok, instead of just adding nodes to the XML, and expecting the VT to
> display them, I am now adding nodes to the VT at the same
> time, and this
> works fine, EXCEPT if I add a child node(s) to a node which is not
> expanded, it shows the new nodes (i.e. expands down to them),
> but does not
> show the existing child nodes for that node. Worse than
> that, it refuses
> to show the child nodes even if I collapse, then do an expand.
>
> I am not sure if this is a bug or not, but to "fix" it I need
> to be able to
> "force" the display of the children for a node (but not necessarily a
> "full" expand), so that the new ones just get added onto the end.

I think that if a node has not been expanded then it may be in a state where
it does not actually have any child nodes, only the [+] button. This is
detected by testing if (vsHasChildren in Node.States) and (Node.ChildCount =
0). If the node is in such a state and a child object is being added to the
object it points to then you must not add a child node in VT. When the node
is expanded its children will be init'ed then and the new object will be
displayed. Now, if the node is init'ed but it didn't have any children (not
(vsHasChildren in Node.States)) you must either add the new child node (so
its children will be considered init'ed) or just change its vsHasChildren
state and invalidate it so that it gets a [+] button.

I hope you get my point, i'm not very good at writing instructions <g>

Alternatively i think you can ensure that the node's children are init'ed
before you add the new child node by calling ReInitChildren. This must be a
lot simpler but a little less efficient.

<KY>

 | Replies | Author | Date
5521 | Re: Display of new child nodes. | Werner Lehmann | Fri 3/8/2002
5581 | Re: Display of new child nodes. | marek jedlinski | Fri 3/15/2002
5583 | Re: Display of new child nodes. | Werner Lehmann | Fri 3/15/2002


re: Problem with OnEditing

From: "Mike Lischke" [lists@l...]
Date: Thu Mar 7, 2002 8:14 pm
Subject: RE: [VirtualTreeview] Problem with OnEditing

Hi Daniel,

> When I singleclick on a selected node the OnEditing event gets fired.
> After the EditDelay (1000ms) the node editor is created. If you
> change the focused node during that time tsEditPending is no longer
> in the tree state, but there is no OnEditCancelled event.

The point is that at that time editing has not yet started, so there is no
meaning to call the
OnEditCancelled event.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net

 | Replies | Author | Date
5525 | Re: Problem with OnEditing | mailinglistsde | Fri 3/8/2002
5531 | Re: Problem with OnEditing | Mike Lischke | Sat 3/9/2002
5535 | Re: Problem with OnEditing | mailinglistsde | Sun 3/10/2002


re: Display of new child nodes.

From: Werner Lehmann [wl@b...]
Date: Fri Mar 8, 2002 12:45 am
Subject: Re: [VirtualTreeview] Display of new child nodes.

GIANNAKOPOULOS KOSTAS wrote:
>
> I think that if a node has not been expanded then it may be in a state where
> it does not actually have any child nodes, only the [+] button. This is
> detected by testing if (vsHasChildren in Node.States) and (Node.ChildCount =
> 0). If the node is in such a state and a child object is being added to the
> object it points to then you must not add a child node in VT. When the node
> is expanded its children will be init'ed then and the new object will be
> displayed. Now, if the node is init'ed but it didn't have any children (not
> (vsHasChildren in Node.States)) you must either add the new child node (so
> its children will be considered init'ed) or just change its vsHasChildren
> state and invalidate it so that it gets a [+] button.

I agree with Kostas. If you dont populate the tree completely but defer this
to the OnExpand event no problems arise - the tree will init the nodes if it
finds that the to-be-expanded node has the vsHasChildren flag set (you can see
a little plus button) *and* there are currently no children.

Now if you have such a node and add a child manually without being asked for by
the tree and then expand the node, the VT will think that all children are
already present and wont ask for them anymore.

In essence, either always add all nodes to the tree regardless of expanded or
collapsed nodes *or* do in it OnExpanding, only! The latter recommended of
course.

Werner

 | Replies | Author | Date
5581 | Re: Display of new child nodes. | marek jedlinski | Fri 3/15/2002


re: TWideStringList -missing properties

From: "benadembaba" [adembaba@e...]
Date: Thu Mar 7, 2002 9:59 pm
Subject: Re: TWideStringList -missing properties

Hi Jim,

> >In the latest VT package'e WideStrings unit,
>
> You are yelling at the wrong guy, that is in VET.

Ooop, sorry Mike :-)

> I only took pieces from Mikes Unicode unit that I needed for the
> Autocomplete and that did not need all the paging and mapping
overhead from
> that unit. Look at the Unicode unit that is on Mikes website and
see if
> those (expcially the LoadFromFile) relied some of the IsXXXXX
> functions. If so then is likely needed the 1Meg of ram mapping
code which
> most VET users made clear they did not want. One way is to only
save
> unicode if the OS is Unicode aware. This way you can use the built
in W
> function to duplicate Mikes unit. If not the file will be saved as
ASCI
> then read back in and converted to a WideString. Mikes unit allows
Win9x
> to work 100% in Unicode.

I can see the reason --though I was not among them.

But, would you consider someting like producing a different
unit like VETWideStrings or WideStringsVET (or even WideVETStrings)
so that the two will not clash (especially for those of us who
still put all VT related code in the same folder; or even for
that dont).

Cheers,
Adem

 | Replies | Author | Date
5523 | Re: TWideStringList -missing properties | jimkueneman | Fri 3/8/2002
5524 | Re: TWideStringList -missing properties | benadembaba | Fri 3/8/2002


re: TWideStringList -missing properties

From: "jimkueneman" [jimdk@m...]
Date: Fri Mar 8, 2002 3:25 am
Subject: Re: TWideStringList -missing properties

> But, would you consider someting like producing a different
> unit like VETWideStrings or WideStringsVET (or even WideVETStrings)
> so that the two will not clash (especially for those of us who
> still put all VT related code in the same folder; or even for
> that dont).

Where is the collision? Mike's unit is called Unicode.pas? Is it
just to differentiate between VET and VT files? Maybe the more
problematic issue is me calling my TWideStringList the same as Mike
in his Unicode.pas file.

Jim

 | Replies | Author | Date
5524 | Re: TWideStringList -missing properties | benadembaba | Fri 3/8/2002


re: TWideStringList -missing properties

From: "benadembaba" [adembaba@e...]
Date: Fri Mar 8, 2002 6:21 am
Subject: Re: TWideStringList -missing properties

Hi Jim,

An interesting question: I just checked again, and
you are right, Mike's unit is Unicode. But...

I have had a unit called WideStrings.pas for longer
than I remember and IIRC, there are others using it.
I believe 'WideStrings' was what Mike used to call
Unicode.pas; so there are other units using things
like WideStrings --such as IBObjects, XDOM to name
but a couple.

Maybe it is they that should start using Unicode.pas,
but so far they haven't. And, it is somewhat annoying
to have something automatically added to the 'requires'
list just because that VCL contains a unit wiyh similar
name.

I'd rather you consider renaming the unit; the class
name is not that important --unless of course someone
tries to use VT and VET on the same form.

Cheers,
Adem

--- In [VirtualTreeview@y...], "jimkueneman" [jimdk@m...] wrote:
>
> > But, would you consider someting like producing a different
> > unit like VETWideStrings or WideStringsVET (or even
WideVETStrings)
> > so that the two will not clash (especially for those of us who
> > still put all VT related code in the same folder; or even for
> > that dont).
>
> Where is the collision? Mike's unit is called Unicode.pas? Is it
> just to differentiate between VET and VT files? Maybe the more
> problematic issue is me calling my TWideStringList the same as Mike
> in his Unicode.pas file.
>
> Jim


re: Problem with OnEditing

From: "mailinglistsde" [mailinglists@j...]
Date: Fri Mar 8, 2002 10:18 am
Subject: Re: Problem with OnEditing

Thats what I said. So why is the OnEditing event called if "at that
time editing has not yet started" The OnEditing event has no meaning
at that time, too, and should be called when the editing really gets
started.

Daniel Rikowski

--- In [VirtualTreeview@y...], "Mike Lischke" [lists@l...] wrote:
> Hi Daniel,
>
> > When I singleclick on a selected node the OnEditing event gets
fired.
> > After the EditDelay (1000ms) the node editor is created. If you
> > change the focused node during that time tsEditPending is no
longer
> > in the tree state, but there is no OnEditCancelled event.
>
> The point is that at that time editing has not yet started, so
there is no meaning to call the
> OnEditCancelled event.
>
> Ciao, Mike
> --
> www.lischke-online.de
> www.delphi-unicode.net

 | Replies | Author | Date
5531 | Re: Problem with OnEditing | Mike Lischke | Sat 3/9/2002
5535 | Re: Problem with OnEditing | mailinglistsde | Sun 3/10/2002


re: Hot Track

From: "lysergeic" [serge@t...]
Date: Fri Mar 8, 2002 12:01 pm
Subject: Re: Hot Track

This has to do with the way you add the nodes to the tree. If you're
not using columns, the tree has to use a different way of finding
the width of the tree contents (to add horizontal scrollbar etc.).
So, when you add a node it's asked for the width, and the width that
is returned is then stored for future use. This is done before
AddChild or InsertNode finishes executing.

Of course, when you've just added the node, you haven't had a chance
to set the caption of the node and thus the width of the caption is
not used in calculating the width of the node. So the width of the
node that is stored in the node's internal data is wrong, but will
be used in the future in the hit testing, which is used to check
what part of the tree the mouse is over when clicking, hovering etc.

According to Mike, there are three ways to get around this:

1. Add a BeginUpdate/EndUpdate (methods of the tree) around the code
you use to add the node, and be sure to set the caption before the
EndUpdate.

2. Do an InvalidateNode after setting the caption. This will cause
the width to be recalculated.

3. Use the OnInitNode and OnInitChildren event handlers to set the
data.

- Jimmi Thøgersen

--- In [VirtualTreeview@y...], "Dion" [dion@n...] wrote:
> Hi,
>
> When I move my cursor over node items in a tree, the cursor
changes to the
> cursor to be displayed over an item(in my case the hand), some
not. In fact
> those items cannot even be focused, until I move the cursor over
the check
> box. Only then does the cursor change and the item(node) become
focused, if
> I click on it.
>
> Is this normal behaviour? I am using XP check box style.
>
> Many Thanks,
> Dion.
>
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.314 / Virus Database: 175 - Release Date: 01/11/2002


Rg. Exception in Graphics Driver

From: "SeanCG26" [seang@l...]
Date: Fri Mar 8, 2002 12:43 pm
Subject: Rg. Exception in Graphics Driver

Hi,

I have been playing with the VirtualStringTree object and found it
quite impressive.

I then tried to run it on a Windows95 workstation that has an ATI 3D
charger (Rage IIc chipset). That when all hell broke loose.

I have just stepped through the creation and drawing methods>
I found that with the Bitmap.PixleFormat set to pf32Bit, when it
tries to do a BitBlt this causes a "General Protection Fault" within
the graphics card.

I have tried to place the calls to the object in Try & Except but it
fails.
Even tried to modify the source and wrapped up all BitBlt's in
Try&Excepts but none of them trap the exception.

I then just to see what would happen I replaced the PixleFormat from
pf32bit to pfDevice in the VirtualTrees.PAS

Hey this then allowed the tree to work .... yes theres a but, when I
clicked on a header the app froze the machine so I'm to square one.

Has anybody else has experienced problems of this nature and if so
how did you get around it?

Many thanks for any help...

Sean Graves
[seang@p...]

 | Replies | Author | Date
5532 | Re: Rg. Exception in Graphics Driver | Mike Lischke | Sat 3/9/2002


New file uploaded to VirtualTreeview

From: VirtualTreeview@yahoogroups.com
Date: Sat Mar 9, 2002 12:29 am
Subject: New file uploaded to VirtualTreeview

Hello,

This email message is a notification to let you know that
a file has been uploaded to the Files area of the VirtualTreeview
group.

File : /Descendants/Addon.zip
Uploaded by : rogermacrae [rogermac@m...]
Description : Virtual Grid Addon

You can access this file at the URL

http://groups.yahoo.com/group/VirtualTreeview/files/Descendants/Addon.zip

To learn more about file sharing for your group, please visit

http://help.yahoo.com/help/us/groups/files

Regards,

rogermacrae [rogermac@m...]

 | Replies | Author | Date
5533 | Re: New file uploaded to VirtualTreeview | Mike Lischke | Sat 3/9/2002


re: TargetCanvas.Font.Charset -- no effect

From: "Mike Lischke" [lists@l...]
Date: Sat Mar 9, 2002 12:35 pm
Subject: RE: [VirtualTreeview] TargetCanvas.Font.Charset -- no effect

Hi MP,

> I try to use different charsets for different columns in VST (with
> grid extensions) by changing it in OnPaintText event (but it has no
> effect -- russian text is painted as with DEFAULT_CHARSET):

This is one of the great improvments of Unicode over ANSI. You have no longer
to care about
character sets. What you try to do is to tell the font that you want to paint
text whose format is
to interpreted as being russian. If you wouldn't tell then nobody would know
that it is the case and
could easily think it's polish or something totally different.

Unicode, in opposition, has defined an own area only for cyrillic characters.
There can't be
misinterpretation since this area is exclusively defined for cyrillic and is
much more powerfull
than the old style ANSI variant, as there are also glyphs included for ancient
writing or special
cases which simply have no room in the ANSI counterpart.

So what I would recommend is that you take your russian text (which is likely
MBCS encoded) and
convert it to Unicode. There is an API to do so (MultibyteToWideChar) where you
have to specifiy
that your text is russian by giving the correct code page (which is 1250 IIRC).
Use this Unicode
text then to do assign it in OnGetText.

For more Unicode functions see my Unicode library at www.delphi-unicode.net.
For simple conversion
however, it is enough to use the MultiByteToWideChar API.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net

 | Replies | Author | Date
5530 | Re: TargetCanvas.Font.Charset -- no effect | Jim Kueneman | Sat 3/9/2002
5534 | Re: TargetCanvas.Font.Charset -- no effect | Mike Lischke | Sat 3/9/2002


re: TargetCanvas.Font.Charset -- no effect

From: Jim Kueneman [jimdk@m...]
Date: Sat Mar 9, 2002 1:20 pm
Subject: RE: [VirtualTreeview] TargetCanvas.Font.Charset -- no effect

Hi Mike,

>For more Unicode functions see my Unicode library at
>www.delphi-unicode.net. For simple conversion
>however, it is enough to use the MultiByteToWideChar API.

I know there is unicode.org but is there something like a "Unicode for
Dummies" page somewhere that you know of? I have read MSDN and the
unicode.org but I need something a bit more.... well "dumbed down" so I get
a good foundational understanding. Then maybe those resources will make
more sense.

Jim

 | Replies | Author | Date
5534 | Re: TargetCanvas.Font.Charset -- no effect | Mike Lischke | Sat 3/9/2002


re: Re: Problem with OnEditing

From: "Mike Lischke" [lists@l...]
Date: Sat Mar 9, 2002 2:13 pm
Subject: RE: [VirtualTreeview] Re: Problem with OnEditing

Daniel,

> Thats what I said. So why is the OnEditing event called if "at that
> time editing has not yet started" The OnEditing event has no meaning
> at that time, too, and should be called when the editing really gets
> started.

Of course it has a meaning. Please read the help file. As with all similar
named events it is used
to determine if something is allowed to happen.

I guess your real problem is that you want to know when editing really starts,
isn't it? Usually,
this is not necessary to know, but it might be in special cases. Special cases
however need special
solutions, so you can e.g. instantiate an own edit linke (just use the
built-in, no need to write a
new one). Then you will get notified about everything regarding an edit action
in the tree.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net

 | Replies | Author | Date
5535 | Re: Problem with OnEditing | mailinglistsde | Sun 3/10/2002


re: Rg. Exception in Graphics Driver

From: "Mike Lischke" [lists@l...]
Date: Sat Mar 9, 2002 2:16 pm
Subject: RE: [VirtualTreeview] Rg. Exception in Graphics Driver

Hi Sean,

> I then tried to run it on a Windows95 workstation that has an ATI 3D
> charger (Rage IIc chipset). That when all hell broke loose.
> Has anybody else has experienced problems of this nature and if so
> how did you get around it?

No, I have never heard about such a problem. And since VT is used in several
products of my company
which must also work on plain old Win95, special care has been taken to ensure
compatibility.
However it could well be that your graphics drive has a serious problem with 32
bit bitmaps.
Unfortunately, this is nothing I can do about it.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: New file uploaded to VirtualTreeview

From: "Mike Lischke" [lists@l...]
Date: Sat Mar 9, 2002 2:25 pm
Subject: RE: [VirtualTreeview] New file uploaded to VirtualTreeview

Hi Roger,

> This email message is a notification to let you know that
> a file has been uploaded to the Files area of the VirtualTreeview
> group.

Your virtual string grid looks quite promising, however I recomend that you use
an internal data
block to store the grid's data (see AllocateInternalDataArea etc.).

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: TargetCanvas.Font.Charset -- no effect

From: "Mike Lischke" [lists@l...]
Date: Sat Mar 9, 2002 3:38 pm
Subject: RE: [VirtualTreeview] TargetCanvas.Font.Charset -- no effect

Hi Jim,

> I know there is unicode.org but is there something like a "Unicode for
> Dummies" page somewhere that you know of? I have read MSDN and the
> unicode.org but I need something a bit more.... well "dumbed down" so I get
> a good foundational understanding. Then maybe those resources will make
> more sense.

Mmmh, to my knowledge there is not much more than what I have linked on my
Unicode site regarding
general Unicode info. I recommend that you buy the Unicode book (e.g. form
Amazon), which contains a
lot about Unicode and its history as well as info to all of the supported
scripts (relationship to
other language, where spoken etc.). You can download pdf files of older
versions (I think 2.0) for
free from the Unicode site. So it might be the cheaper variant, but having the
book is generally the
better choice if you want to go deeper into Unicode. Another option for
learning is to subscribe to
the Unicode mailing list (read only via Yahoo or read/write by using the
original list, address on
Unicode site). But be warned: at times the traffic is quite high there and goes
also in very deep
detail for some things.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: Problem with OnEditing

From: "mailinglistsde" [mailinglists@j...]
Date: Sat Mar 9, 2002 2:50 pm
Subject: Re: Problem with OnEditing

--- In [VirtualTreeview@y...], "Mike Lischke" [lists@l...] wrote:
> Daniel,
>
> > Thats what I said. So why is the OnEditing event called if "at
that
> > time editing has not yet started" The OnEditing event has no
meaning
> > at that time, too, and should be called when the editing really
gets
> > started.
>
> Of course it has a meaning. Please read the help file. As with all
similar named events it is used
> to determine if something is allowed to happen.

Of course, "no meaning" was definitly the wrong term.

>
> I guess your real problem is that you want to know when editing
really starts, isn't it? Usually,
> this is not necessary to know, but it might be in special cases.
Special cases however need special
> solutions, so you can e.g. instantiate an own edit linke (just use
the built-in, no need to write a
> new one). Then you will get notified about everything regarding an
edit action in the tree.

I wise answer. ;-) It works, thank you very much!!

>
> Ciao, Mike
> --
> www.lischke-online.de
> www.delphi-unicode.net


Drag Source type???

From: "Dion" [dion@n...]
Date: Sun Mar 10, 2002 3:35 pm
Subject: Drag Source type???

Hi,

When using Drag and drop with a TTreeView, the Drag object becomes the
Source in the OnDragOver event of a control. Not the VT, as far as I can
tell.
How do I get the custom drag object created in the OnStartDrag event of the
Source Control in the OnDragOver event of VT. Am I going about this
incorrectly for VT??

Many Thanks,
Dion.

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.314 / Virus Database: 175 - Release Date: 01/11/2002

 | Replies | Author | Date
5537 | Re: Drag Source type??? | Jim Kueneman | Sun 3/10/2002
5540 | Re: Drag Source type??? | Dion | Mon 3/11/2002
5543 | Re: Drag Source type??? | Jim Kueneman | Mon 3/11/2002
5550 | Re: Drag Source type??? | Dion | Tue 3/12/2002
5557 | Re: Drag Source type??? | jimkueneman | Wed 3/13/2002


re: Drag Source type???

From: Jim Kueneman [jimdk@m...]
Date: Sun Mar 10, 2002 1:45 pm
Subject: Re: [VirtualTreeview] Drag Source type???

>When using Drag and drop with a TTreeView, the Drag object becomes the
>Source in the OnDragOver event of a control. Not the VT, as far as I can
>tell.
>How do I get the custom drag object created in the OnStartDrag event of the
>Source Control in the OnDragOver event of VT. Am I going about this
>incorrectly for VT??

There is no guarantee that VT is bug free in the VCL D&D. There was some
discussion as to what VT passed in these methods, especially with
TDragControlObject. I would say put together a simple example an single
step into VT to see if you can see where/why it is not doing what you
expect. If you can't get it post the example to the BugDemo folder on
Yahoo groups and someone will take a took at it.

Jim

 | Replies | Author | Date
5540 | Re: Drag Source type??? | Dion | Mon 3/11/2002
5543 | Re: Drag Source type??? | Jim Kueneman | Mon 3/11/2002
5550 | Re: Drag Source type??? | Dion | Tue 3/12/2002
5557 | Re: Drag Source type??? | jimkueneman | Wed 3/13/2002


re: Digest Number 489

From: Tom [Tom@s...]
Date: Sun Mar 10, 2002 3:15 pm
Subject: Re: [VirtualTreeview] Digest Number 489

Dear Jim,
I found the first few questions of this FAQ a decent introduction:
http://www.cl.cam.ac.uk/~mgk25/unicode.html
Tom

>I know there is unicode.org but is there something like a "Unicode for
>Dummies" page somewhere that you know of? I have read MSDN and the
>unicode.org but I need something a bit more.... well "dumbed down" so I get
>a good foundational understanding. Then maybe those resources will make
>more sense.


re: BCB 5 Examples

From: "bifmud" [wcmudd@e...]
Date: Sun Mar 10, 2002 10:44 pm
Subject: Re: BCB 5 Examples

Mike,

Virtual Explorer Treeview at
<http://groups.yahoo.com/group/VirtualExplorerTree/> is the premier
example of what you can do with VT. First update your VT with the
latest Version (3.1.2) and the updated VTHeaderPopup from the "files"
section of the VT group.

After you join the VET group download the latest VET at
<http://groups.yahoo.com/group/VirtualExplorerTree/files/VirtualShellT
ools_0.9.80_Beta.zip> located in the "files" section.
Then while still in the "files" section go into "Alternative
Packages" and download the BCB install packages for VET at
<http://groups.yahoo.com/group/VirtualExplorerTree/files/Alternative_p
ackages/VST0_9_60b_for_CPPB_v2.zip> or try installing VET on your own.

Once you have VET (and of course VT) successfully installed on your
BCB component palette, drop a (VET) Explorer Treeview component and a
Explorer Listview component on a new form. For your Explorer
Treeview, in Object Inspector, change the "active" property
to "true". Do the same for the Explorer Listview component.
Next in the Properties for the Explorer Treeview component at the
bottom click on the VirtualExplorerListview dropdown box and chose
ExplorerListview1. Now in the Properties for the Explorer Listview
component at the bottom click on the VirtualExplorerTreeview dropdown
box and chose ExplorerTreeview1.

Compile it and see what you get. Next you can start experimenting
with the other properties and see what they do. Use the help files
for a guide.

For other examples of what VT can do peruse previous posts and check
out other contributions ot the "files" section.

HTH,

Bill Mudd

--- In [VirtualTreeview@y...], "fabe12345" [debate@g...] wrote:
> I managed to install VT in BCB and it seems to work.
> Could someone plz help me out with one or two simple working
> examples on how to use VT in BCB.
>
> I'm using Version 3.0.4 with the Combatibility Patches for BCB.
>
> Thanks
> Mike


re: Drag Source type???

From: "Dion" [dion@n...]
Date: Mon Mar 11, 2002 7:25 pm
Subject: RE: [VirtualTreeview] Drag Source type???

I have used a simple example to figure out what VT does with the custom drag
object. What I found was that the OnStartDrag (from a dbgrid) created the
object, but OnMoveOver over VT the object is the Sender(ie the dbGrid).
Help!!!! This feature is needed.

Many Thanks
Dion.

-----Original Message-----
From: Jim Kueneman [mailto:[jimdk@m...]]
Sent: Sunday, March 10, 2002 5:46 AM
To: VirtualTreeview@yahoogroups.com
Subject: Re: [VirtualTreeview] Drag Source type???

>When using Drag and drop with a TTreeView, the Drag object becomes the
>Source in the OnDragOver event of a control. Not the VT, as far as I can
>tell.
>How do I get the custom drag object created in the OnStartDrag event of the
>Source Control in the OnDragOver event of VT. Am I going about this
>incorrectly for VT??

There is no guarantee that VT is bug free in the VCL D&D. There was some
discussion as to what VT passed in these methods, especially with
TDragControlObject. I would say put together a simple example an single
step into VT to see if you can see where/why it is not doing what you
expect. If you can't get it post the example to the BugDemo folder on
Yahoo groups and someone will take a took at it.

Jim

To unsubscribe from this group, send an email to:
VirtualTreeview-unsubscribe@egroups.com

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/

---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.314 / Virus Database: 175 - Release Date: 01/11/2002

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.314 / Virus Database: 175 - Release Date: 01/11/2002

 | Replies | Author | Date
5543 | Re: Drag Source type??? | Jim Kueneman | Mon 3/11/2002
5550 | Re: Drag Source type??? | Dion | Tue 3/12/2002
5557 | Re: Drag Source type??? | jimkueneman | Wed 3/13/2002


BCB6 - old error again! Help!!!

From: Oleg Kraynov [olegvkr@y...]
Date: Mon Mar 11, 2002 9:57 am
Subject: BCB6 - old error again! Help!!!

Hi,

VirtualTrees.hpp
------------------------------
TVTDragManager
...
public:
operator IDropTarget*(void) { return (IDropTarget*)&__IDropTarget; }
...

------------------------------
[C++ Error] VirtualTrees.hpp(1875): E2076 Overloadable operator expected

Long ago the same error was in BCB5.
Please, help!!!

My change:
Compilers.inc
------------------------------
{$ifdef VER140}
{$define COMPILER_6}
{$define DELPHI}
{$define DELPHI_6}
{$endif}
to:
{$ifdef VER140}
{$define COMPILER_6}
{$ifdef BCB}
{$define CPPB}
{$define CPPB_6}
{$else}
{$define DELPHI}
{$define DELPHI_6}
{$endif}
{$endif}
...
{$ifdef CPPB_6}
{$define CPPB_3_UP}
{$define CPPB_4_UP}
{$define CPPB_5_UP}
{$define CPPB_6_UP}
{$endif}

VirtualTreesReg.pas
------------------------------
{$ifdef DELPHI_6_UP}
resourcestring
sVTHeaderCategoryName = 'Header';
sVTPaintingCategoryName = 'Custom painting';
sVTIncremenalCategoryName = 'Incremental search';
{$endif}
to:
{$ifdef COMPILER_6_UP}
resourcestring
sVTHeaderCategoryName = 'Header';
sVTPaintingCategoryName = 'Custom painting';
sVTIncremenalCategoryName = 'Incremental search';
{$endif}

--
Best regards,
Oleg

_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com

 | Replies | Author | Date
5542 | Re: BCB6 - old error again! Help!!! | Milan Vandrovec | Mon 3/11/2002
5544 | Re[2]: [VirtualTreeview] BCB6 - old error again! | Oleg Kraynov | Mon 3/11/2002
5546 | Re[2]: [VirtualTreeview] BCB6 - old error again! | Oleg Kraynov | Mon 3/11/2002
5555 | Re: BCB6 - old error again! Help!!! | Milan Vandrovec | Tue 3/12/2002
5556 | Re: BCB6 - old error again! Help!!! | Oleg Kraynov | Tue 3/12/2002
5576 | Re: BCB6 - old error again! Help!!! | Oleg Kraynov | Thu 3/14/2002
5578 | Re: BCB6 - old error again! Help!!! | Jim Kueneman | Thu 3/14/2002
5582 | Re[2]: [VirtualTreeview] BCB6 - old error again! | Oleg Kraynov | Fri 3/15/2002
5596 | Re: BCB6 - old error again! Help!!! | Mike Lischke | Sun 3/17/2002


re: BCB6 - old error again! Help!!!

From: "Milan Vandrovec" [milan_va@s...]
Date: Mon Mar 11, 2002 10:59 am
Subject: RE: [VirtualTreeview] BCB6 - old error again! Help!!!

> Hi,
>
> VirtualTrees.hpp
> ------------------------------
> TVTDragManager
> ...
> public:
> operator IDropTarget*(void) { return (IDropTarget*)&__IDropTarget; }
> ...
>
> ------------------------------
> [C++ Error] VirtualTrees.hpp(1875): E2076 Overloadable
> operator expected
>
> Long ago the same error was in BCB5.
> Please, help!!!

That's crazy. It simply must work.
In VirtualTrees.hpp, there is
#include <objidl.h> (line 30)
in objidl.h, there is
#include "ole2.h" (line 35)
in ole2.h, there is
#include <oleidl.h> (line 111)
in oleidl.h, IDropTarget is defined.

Adding a syntax error on these lines, you can check where the include
chain is broken. Also, does it still work in BCB5?

Milan Vandrovec

 | Replies | Author | Date
5544 | Re[2]: [VirtualTreeview] BCB6 - old error again! | Oleg Kraynov | Mon 3/11/2002
5546 | Re[2]: [VirtualTreeview] BCB6 - old error again! | Oleg Kraynov | Mon 3/11/2002


re: Drag Source type???

From: Jim Kueneman [jimdk@m...]
Date: Mon Mar 11, 2002 1:01 pm
Subject: RE: [VirtualTreeview] Drag Source type???

At 11:25 AM 3/11/2002 -0800, you wrote:
>I have used a simple example to figure out what VT does with the custom drag
>object. What I found was that the OnStartDrag (from a dbgrid) created the
>object, but OnMoveOver over VT the object is the Sender(ie the dbGrid).
>Help!!!! This feature is needed.

Can the demo (not requiring a database being present) be uploaded to the
Yahoo Groups Files area?

Are you using a TDragObject or TDragControlObject decendant? These are
different from what I understand. The TDragObject decendant should give
you the Drag Object as the Sender. The TDragControlObject should give you
the Control as the sender.

Jim

 | Replies | Author | Date
5550 | Re: Drag Source type??? | Dion | Tue 3/12/2002
5557 | Re: Drag Source type??? | jimkueneman | Wed 3/13/2002


Re[2]: BCB6 - old error again! Help!!!

From: Oleg Kraynov [olegvkr@y...]
Date: Mon Mar 11, 2002 2:16 pm
Subject: Re[2]: [VirtualTreeview] BCB6 - old error again! Help!!!

Hi, Milan.

MV> Adding a syntax error on these lines, you can check where the include
MV> chain is broken. Also, does it still work in BCB5?

Yes, the same code in BCB5 - no problem!

--
Best regards,
Oleg

_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


Re[2]: BCB6 - old error again! Help!!!

From: "Milan Vandrovec" [milan_va@s...]
Date: Mon Mar 11, 2002 2:50 pm
Subject: Re[2]: BCB6 - old error again! Help!!!

> Hi, Milan.
>
> Yes, the same code in BCB5 - no problem!

And does the <oleidl.h> get compiled? Add a line
iamerror;
at the beginning of the file and see if the compilation stops here. If
no, do the same for files ole2.h and objidl.h. Anyway, it looks like
it's up to you to solve it...
Don't forget to compare project files (*.bpk) to see if all options and
conditional defines are the same. You may also try using header files
from BCB6 in BCB5, or from BCB5 in BCB6 (objidl.h, ole2.h, oleidl.h).

Milan Vandrovec

 | Replies | Author | Date
5547 | Re[2]: BCB6 - old error again! Help!!! | Milan Vandrovec | Mon 3/11/2002
5554 | Re: BCB6 - old error again! Help!!! | Oleg Kraynov | Tue 3/12/2002


Re[2]: BCB6 - old error again! Help!!!

From: Oleg Kraynov [olegvkr@y...]
Date: Mon Mar 11, 2002 3:15 pm
Subject: Re[2]: [VirtualTreeview] BCB6 - old error again! Help!!!

Hi, Milan.

MV> That's crazy. It simply must work.
MV> In VirtualTrees.hpp, there is
MV> #include <objidl.h> (line 30)
MV> in objidl.h, there is
MV> #include "ole2.h" (line 35)
MV> in ole2.h, there is
MV> #include <oleidl.h> (line 111)
MV> in oleidl.h, IDropTarget is defined.

#include <objidl.h> - exists, ole2.h - no included (after adding
{$HPPEMIT '#include <ole2.h>'} - all ok).

in objidl.h:
#ifndef COM_NO_WINDOWS_H
#include "windows.h"
#include "ole2.h"
#endif /*COM_NO_WINDOWS_H*/

COM_NO_WINDOWS_H defined? Where? I do not know where search for.

--
Best regards,
Oleg

_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


Re[2]: BCB6 - old error again! Help!!!

From: "Milan Vandrovec" [milan_va@s...]
Date: Mon Mar 11, 2002 4:08 pm
Subject: Re[2]: BCB6 - old error again! Help!!!

Hello.

> after adding {$HPPEMIT '#include <ole2.h>'} - all ok.

Looks like the way to go for now, until somebody finds what's up.

> in objidl.h:
> #ifndef COM_NO_WINDOWS_H
> #include "windows.h"
> #include "ole2.h"
> #endif /*COM_NO_WINDOWS_H*/
>
> COM_NO_WINDOWS_H defined? Where? I do not know where search for.
It's probably defined in vcl0.h, included from vcl.h. When I checked
'Show general messages' in Project Options\Compiler, it said
Including vcl2.h instead of vcl.h due to -Hr switch
(you may need to delete intermediate files *.dcu, *.obj, *.csm... if it
says Loaded precompiled headers). In vcl2.h or vcl3.h, INC_OLE_HEADERS
is defined which solves the trouble. However, there is no Hr in my
project files:
<OPTIONS>
<CFLAG1 value="-vGc -vGt -vGd -Od -H=..\Intermed\SEAdemo.csm -Hc -Vx
-Ve -X- -r- -a8 -b-
-k -y -v -vi- -c -tW -tWM"/>
<PFLAGS value="-N2..\Intermed -N0..\Intermed -$Y+ -$W -$R -$Q -$O-
-v -JPHNE -M -LUdclstd50"/>
<RFLAGS value=""/>
<AFLAGS value="/mx /w2 /zi"/>
<LFLAGS value="-I..\Intermed -D&quot;&quot; -aa -Tpe -x -Gn -v"/>
</OPTIONS>

Could it be you are the FIRST one to use VirtualTree's D&D in BCB? Try
adding NO_WIN32_LEAN_AND_MEAN to conditional defines of your project. It
has to be done in VirtualShellTools.

Hope some of this helps.

Milan Vandrovec

 | Replies | Author | Date
5554 | Re: BCB6 - old error again! Help!!! | Oleg Kraynov | Tue 3/12/2002


Latest version?

From: Sanjay Kanade [skanade@v...]
Date: Tue Mar 12, 2002 2:29 am
Subject: Latest version?

The version I have of VT is 3.0.4. What is the latest version for
Delphi 5? I looked in the Files area but there is no download for
VT itself. All I can see is a Beta for CLX and a museum folder
for old files. Shouldn't there be a file always pointing to the
last released official (non beta) version?

Thanks,
Sanjay

 | Replies | Author | Date
5549 | Re: Latest version? | Jim Kueneman | Tue 3/12/2002
5551 | Re: Latest version? | Bender Heri | Tue 3/12/2002
5594 | Re: Latest version? | Mike Lischke | Sun 3/17/2002


re: Latest version?

From: Jim Kueneman [jimdk@m...]
Date: Tue Mar 12, 2002 2:53 am
Subject: Re: [VirtualTreeview] Latest version?

>The version I have of VT is 3.0.4. What is the latest version for
>Delphi 5? I looked in the Files area but there is no download for

Mike has 3.1.? on his website now.

http://www.lischke-online.de/VirtualTreeView.html

Jim


re: Drag Source type???

From: "Dion" [dion@n...]
Date: Tue Mar 12, 2002 6:32 am
Subject: RE: [VirtualTreeview] Drag Source type???

Jim, If I use TDragObject and not TDragControlObject, it works with VT.

Regards,
Dion.

-----Original Message-----
From: Jim Kueneman [mailto:[jimdk@m...]]
Sent: Monday, March 11, 2002 5:01 AM
To: VirtualTreeview@yahoogroups.com
Subject: RE: [VirtualTreeview] Drag Source type???

At 11:25 AM 3/11/2002 -0800, you wrote:
>I have used a simple example to figure out what VT does with the custom
drag
>object. What I found was that the OnStartDrag (from a dbgrid) created the
>object, but OnMoveOver over VT the object is the Sender(ie the dbGrid).
>Help!!!! This feature is needed.

Can the demo (not requiring a database being present) be uploaded to the
Yahoo Groups Files area?

Are you using a TDragObject or TDragControlObject decendant? These are
different from what I understand. The TDragObject decendant should give
you the Drag Object as the Sender. The TDragControlObject should give you
the Control as the sender.

Jim

To unsubscribe from this group, send an email to:
VirtualTreeview-unsubscribe@egroups.com

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/

---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.314 / Virus Database: 175 - Release Date: 01/11/2002

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.314 / Virus Database: 175 - Release Date: 01/11/2002

 | Replies | Author | Date
5557 | Re: Drag Source type??? | jimkueneman | Wed 3/13/2002


re: Latest version?

From: Bender Heri [HBender@E...]
Date: Tue Mar 12, 2002 8:32 am
Subject: RE: [VirtualTreeview] Latest version?

I recently had the same problem.

I wanted to download the official Version 3. But in the files area I didn't
find it, and on Mike's site there is only the latest one to download (as it
seems to me).

Or I am wrong? Is this the officially releasec version 3?

Thanks for clarifying!

Heri Bender

> -----Original Message-----
> From: Sanjay Kanade [mailto:[skanade@v...]]
> Sent: Tuesday, March 12, 2002 3:29 AM
> To: VirtualTreeview@yahoogroups.com
> Subject: [VirtualTreeview] Latest version?
>
>
> The version I have of VT is 3.0.4. What is the latest version for
> Delphi 5? I looked in the Files area but there is no download for
> VT itself. All I can see is a Beta for CLX and a museum folder
> for old files. Shouldn't there be a file always pointing to the
> last released official (non beta) version?
>
> Thanks,
> Sanjay
>
> To unsubscribe from this group, send an email to:
> VirtualTreeview-unsubscribe@egroups.com
>
>
>
> Your use of Yahoo! Groups is subject to
> http://docs.yahoo.com/info/terms/
>
>


New file uploaded to VirtualTreeview

From: VirtualTreeview@yahoogroups.com
Date: Tue Mar 12, 2002 9:40 am
Subject: New file uploaded to VirtualTreeview

Hello,

This email message is a notification to let you know that
a file has been uploaded to the Files area of the VirtualTreeview
group.

File : /Examples/Delphi_Examples/Printing/PrtVTree.pas
Uploaded by : norgepaul [paul.thornton@c...]
Description : Example of how to print a Virtualtree using Delphi

You can access this file at the URL

http://groups.yahoo.com/group/VirtualTreeview/files/Examples/Delphi_Examples/Pri\
nting/PrtVTree.pas

To learn more about file sharing for your group, please visit

http://help.yahoo.com/help/us/groups/files

Regards,

norgepaul [paul.thornton@c...]


Printing example converted to Delphi

From: "norgepaul" [paul.thornton@c...]
Date: Tue Mar 12, 2002 9:43 am
Subject: Printing example converted to Delphi

Hi All,

I've converted Mathias Thorells C Builder Virtualtree printing
example into Delphi. It's now in the files section.

Hope this is of use to somebody.

If you improve it, please pass the improvements back to the group.

Cheers,
Paul Thornton

 | Replies | Author | Date
5558 | Re: Printing example converted to Delphi | james | Wed 3/13/2002
5559 | Re: Printing example converted to Delphi | benadembaba | Wed 3/13/2002
5595 | Re: Printing example converted to Delphi | Mike Lischke | Sun 3/17/2002
5600 | Re: Printing example converted to Delphi | Jim Kueneman | Mon 3/18/2002
5623 | Re: Printing example converted to Delphi | Mike Lischke | Sat 3/23/2002
5625 | Re: Printing example converted to Delphi | Jim Kueneman | Sat 3/23/2002
5564 | Re: Printing example converted to Delphi | Wim van der Vegt | Thu 3/14/2002
5566 | Re: Printing example converted to Delphi | Illya Kysil | Thu 3/14/2002
5568 | Re: Printing example converted to Delphi | Wim van der Vegt | Thu 3/14/2002


re: BCB6 - old error again! Help!!!

From: Oleg Kraynov [olegvkr@y...]
Date: Tue Mar 12, 2002 3:01 pm
Subject: Re: BCB6 - old error again! Help!!!

Hi, Milan.

Thank you for help!

cpp-files from packages, created in BCB6, include <basepch.h> instead
of <vcl.h>.

--
Best regards,
Oleg

_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


re: BCB6 - old error again! Help!!!

From: "Milan Vandrovec" [milan_va@s...]
Date: Tue Mar 12, 2002 3:18 pm
Subject: RE: BCB6 - old error again! Help!!!

Hello.

> cpp-files from packages, created in BCB6, include <basepch.h> instead
> of <vcl.h>.

So, is there a way to fix VirtualTrees.pas so it would work in BCB6
without modification? Or any project settings?

Milan Vandrovec

 | Replies | Author | Date
5556 | Re: BCB6 - old error again! Help!!! | Oleg Kraynov | Tue 3/12/2002
5576 | Re: BCB6 - old error again! Help!!! | Oleg Kraynov | Thu 3/14/2002
5578 | Re: BCB6 - old error again! Help!!! | Jim Kueneman | Thu 3/14/2002
5582 | Re[2]: [VirtualTreeview] BCB6 - old error again! | Oleg Kraynov | Fri 3/15/2002
5596 | Re: BCB6 - old error again! Help!!! | Mike Lischke | Sun 3/17/2002


re: BCB6 - old error again! Help!!!

From: Oleg Kraynov [olegvkr@y...]
Date: Tue Mar 12, 2002 8:48 pm
Subject: Re: [VirtualTreeview] BCB6 - old error again! Help!!!

Hi, Milan.

I have read your advice and has added NO_WIN32_LEAN_AND_MEAN in MY
projects (rather then in VirtualTrees packages :o).
But strange, why in BCB5 VirtualTrees worked without this definition.
Wizardry...

Thanks again.

--
Best regards,
Oleg

_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


re: Drag Source type???

From: "jimkueneman" [jimdk@m...]
Date: Wed Mar 13, 2002 3:56 am
Subject: Re: Drag Source type???

Hi Dion,

> Jim, If I use TDragObject and not TDragControlObject, it works with
VT.

Do I take this as we are in agreement that VT works as it should with
respect to the VCL D&D (or at least how Borland has defined it should
work). I am not sure if I take this as "yes it works but it is not
like it should be" or "yes it works and it is how it should be"

Jim


re: Printing example converted to Delphi

From: "james" [jamesnewid2000@y...]
Date: Wed Mar 13, 2002 8:38 am
Subject: Re: [VirtualTreeview] Printing example converted to Delphi

thanks very much.
I 'd like to print tree soon, worring about how to do.
rgds,
james.

----- Original Message -----
From: norgepaul
To: VirtualTreeview@yahoogroups.com
Sent: Tuesday, March 12, 2002 5:43 PM
Subject: [VirtualTreeview] Printing example converted to Delphi

Hi All,

I've converted Mathias Thorells C Builder Virtualtree printing
example into Delphi. It's now in the files section.

Hope this is of use to somebody.

If you improve it, please pass the improvements back to the group.

Cheers,
Paul Thornton

Yahoo! Groups Sponsor
ADVERTISEMENT

To unsubscribe from this group, send an email to:
VirtualTreeview-unsubscribe@egroups.com

Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.

[Non-text portions of this message have been removed]

 | Replies | Author | Date
5559 | Re: Printing example converted to Delphi | benadembaba | Wed 3/13/2002
5595 | Re: Printing example converted to Delphi | Mike Lischke | Sun 3/17/2002
5600 | Re: Printing example converted to Delphi | Jim Kueneman | Mon 3/18/2002
5623 | Re: Printing example converted to Delphi | Mike Lischke | Sat 3/23/2002
5625 | Re: Printing example converted to Delphi | Jim Kueneman | Sat 3/23/2002


re: Printing example converted to Delphi

From: "benadembaba" [adembaba@e...]
Date: Wed Mar 13, 2002 4:09 pm
Subject: Re: Printing example converted to Delphi

Hi Mike,

I wonder if it is not possible, or appropriate, to
integrate this code into VT itself.

Cheers,
Adem

--- In [VirtualTreeview@y...], "james" [jamesnewid2000@y...] wrote:
> thanks very much.
> I 'd like to print tree soon, worring about how to do.
> rgds,
> james.
>
> ----- Original Message -----
> From: norgepaul
> To: [VirtualTreeview@y...]
> Sent: Tuesday, March 12, 2002 5:43 PM
> Subject: [VirtualTreeview] Printing example converted to Delphi
>
>
> Hi All,
>
> I've converted Mathias Thorells C Builder Virtualtree printing
> example into Delphi. It's now in the files section.
>
> Hope this is of use to somebody.
>
> If you improve it, please pass the improvements back to the group.
>
> Cheers,
> Paul Thornton
>
>
> Yahoo! Groups Sponsor
> ADVERTISEMENT
>
>
>
>
> To unsubscribe from this group, send an email to:
> [VirtualTreeview-unsubscribe@e...]
>
>
>
> Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
>
>
>
> [Non-text portions of this message have been removed]

 | Replies | Author | Date
5595 | Re: Printing example converted to Delphi | Mike Lischke | Sun 3/17/2002
5600 | Re: Printing example converted to Delphi | Jim Kueneman | Mon 3/18/2002
5623 | Re: Printing example converted to Delphi | Mike Lischke | Sat 3/23/2002
5625 | Re: Printing example converted to Delphi | Jim Kueneman | Sat 3/23/2002


Simple Drag and Drop

From: "snoopy_garfield2002" [andreas.steibl@h...]
Date: Wed Mar 13, 2002 4:58 pm
Subject: Simple Drag and Drop

Hi
i would like to implement a simple Drag and Drop
i would like to reorder nodes with drag and drop (only in one
TreeView - not between two)

But what is the easiest way to do that ?

regards
Andreas

 | Replies | Author | Date
5562 | Re: Simple Drag and Drop | Jim Kueneman | Thu 3/14/2002
5597 | Re: Simple Drag and Drop | Mike Lischke | Sun 3/17/2002


InitNode sequence

From: "ePC TECH" [epctech@t...]
Date: Wed Mar 13, 2002 11:14 pm
Subject: InitNode sequence

I have always seen example of VT with random generation of tree,
but I try to generate a VT Tree from a Text like:

000
000,000
000,000,000
000,001
000,001,000
000,001,001
001
001,000
001,000,000
001,000,001

but I haven't found help or documentation on how tree is build in InitNode.
I tried to use Absolute index, but in Init node I obtained an error of stack
overflow.
Someone can help me on how method I can use to built my tree from a text file
where every line is the sequence of index from root to last node?

I have also another little question about the method absolute index.
Why, if I try to obtain the absoulte index from a code like this :
procedure TForm1.VTChange(Sender: TBaseVirtualTree; Node: PVirtualNode);
var
i,k : integer;
nodep : PVirtualNode;

begin
with Sender do
begin
// Start immediate editing as soon as another node gets focused.
if Assigned(Node) and (Node.Parent <> RootNode) and not
(tsIncrementalSearching in TreeStates) then
begin
// Note: the test whether a node can really be edited is done in the
OnEditing event.
// EditNode(Node, 1);
i:=VT.AbsoluteIndex(Node);
nodep := Node.Parent;
if assigned(Nodep) then k:=VT.AbsoluteIndex(Nodep);
showmessage('AbsIndex : '+inttostr(i)+#10#13+'ParentAbsIndex :
'+inttostr(k));
end;
end;
end;

I obtain the absolute index in the child nodes but not in the node on first
level?
Hello & Thanks
Marco

[Non-text portions of this message have been removed]

 | Replies | Author | Date
5563 | Re: InitNode sequence | Jim Kueneman | Thu 3/14/2002


re: Simple Drag and Drop

From: Jim Kueneman [jimdk@m...]
Date: Thu Mar 14, 2002 2:30 am
Subject: Re: [VirtualTreeview] Simple Drag and Drop

At 04:58 PM 3/13/2002 +0000, you wrote:
>Hi
>i would like to implement a simple Drag and Drop
>i would like to reorder nodes with drag and drop (only in one
>TreeView - not between two)
>
>But what is the easiest way to do that ?

Jim

unit Unit1;

interface

uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
VirtualTrees, ActiveX;

type
TForm1 = class(TForm)
VST: TVirtualStringTree;
procedure VSTDragAllowed(Sender: TBaseVirtualTree;
Node: PVirtualNode; Column: TColumnIndex; var Allowed: Boolean);
procedure FormCreate(Sender: TObject);
procedure VSTInitNode(Sender: TBaseVirtualTree; ParentNode,
Node: PVirtualNode; var InitialStates: TVirtualNodeInitStates);
procedure VSTFreeNode(Sender: TBaseVirtualTree; Node: PVirtualNode);
procedure VSTGetText(Sender: TBaseVirtualTree; Node: PVirtualNode;
Column: TColumnIndex; TextType: TVSTTextType;
var CellText: WideString);
procedure VSTDragDrop(Sender: TBaseVirtualTree; Source: TObject;
DataObject: IDataObject; Formats: TFormatArray; Shift: TShiftState;
Pt: TPoint; var Effect: Integer; Mode: TDropMode);
procedure VSTDragOver(Sender: TBaseVirtualTree; Source: TObject;
Shift: TShiftState; State: TDragState; Pt: TPoint; Mode: TDropMode;
var Effect: Integer; var Accept: Boolean);
private
{ Private declarations }
public
{ Public declarations }
end;

var
Form1: TForm1;

type
PData = ^TData;
TData = record
Caption: WideString;
end;

implementation

{$R *.DFM}

procedure TForm1.VSTDragAllowed(Sender: TBaseVirtualTree;
Node: PVirtualNode; Column: TColumnIndex; var Allowed: Boolean);
begin
Allowed := True
end;

procedure TForm1.FormCreate(Sender: TObject);
var
i: integer;
begin
VST.NodeDataSize := SizeOf(TData);
VST.BeginUpdate;
for i := 0 to 10 do
VST.AddChild(nil);
VST.EndUpdate
end;

procedure TForm1.VSTInitNode(Sender: TBaseVirtualTree; ParentNode,
Node: PVirtualNode; var InitialStates: TVirtualNodeInitStates);
var
Data: PData;
begin
Data := VST.GetNodeData(Node);
Data.Caption := IntToStr( Integer(Data));
end;

procedure TForm1.VSTFreeNode(Sender: TBaseVirtualTree; Node: PVirtualNode);
var
Data: PData;
begin
Data := VST.GetNodeData(Node);
Finalize(Data^);
end;

procedure TForm1.VSTGetText(Sender: TBaseVirtualTree; Node: PVirtualNode;
Column: TColumnIndex; TextType: TVSTTextType; var CellText: WideString);
var
Data: PData;
begin
Data := VST.GetNodeData(Node);
CellText := Data^.Caption
end;

procedure TForm1.VSTDragDrop(Sender: TBaseVirtualTree; Source: TObject;
DataObject: IDataObject; Formats: TFormatArray; Shift: TShiftState;
Pt: TPoint; var Effect: Integer; Mode: TDropMode);
var
Node: PVirtualNode;
DropMode: TVTNodeAttachMode;

begin
Node := VST.GetNodeAt(Pt.x, Pt.y);
if Assigned(Node) then
begin
case Mode of
dmAbove: DropMode := amInsertBefore;
dmOnNode: DropMode := amAddChildLast;
dmBelow: DropMode := amInsertAfter;
else
DropMode := amNoWhere
end;
VST.ProcessDrop(DataObject, Node, Effect, DropMode);
end
end;

procedure TForm1.VSTDragOver(Sender: TBaseVirtualTree; Source: TObject;
Shift: TShiftState; State: TDragState; Pt: TPoint; Mode: TDropMode;
var Effect: Integer; var Accept: Boolean);
begin
Accept := True;
Effect := DROPEFFECT_MOVE; // Only allow a move
end;

end.


re: InitNode sequence

From: Jim Kueneman [jimdk@m...]
Date: Thu Mar 14, 2002 3:35 am
Subject: Re: [VirtualTreeview] InitNode sequence

At 12:14 AM 3/14/2002 +0100, you wrote:
>I have always seen example of VT with random generation of tree,
>but I try to generate a VT Tree from a Text like:
>
>000
>000,000
>000,000,000
>000,001
>000,001,000
>000,001,001
>001
>001,000
>001,000,000
>001,000,001
>
>but I haven't found help or documentation on how tree is build in InitNode.
>I tried to use Absolute index, but in Init node I obtained an error of stack
>overflow.
>Someone can help me on how method I can use to built my tree from a text file
>where every line is the sequence of index from root to last node?

In order for VT not to drive you crazy it is necessary to make the leap and
forget all bad habits learned from TTreeview. VT is a linked list so any
absolute index type transversing of the tree is inefficent and always a
hack. If you can rethink your data so that it can know what to do with
only information stored in the parent node it is much better. What you are
doing is possible by doing a loop and using AddChild(). The result is a
PVirtualNode which you can check Node.ChildCount. If ChildCount is > 0
then you can use Node.GetFirstChild to get the first Child then
ChildNextSibling to "count" you way to the right node by index then check
that for a ChildCount. If you run out of nodes then AddChild. If
ChildCount = 0 then you can add AddChild.

I have never done this so I am not sure of any issues.

> // Start immediate editing as soon as another node gets focused.
> if Assigned(Node) and (Node.Parent <> RootNode) and not
> (tsIncrementalSearching in TreeStates) then
>
>I obtain the absolute index in the child nodes but not in the node on
>first level?

You have filtered out the first level nodes with (Node.Parent <> RootNode)
remove it then you get the top level nodes.

Jim

>


re: Printing example converted to Delphi

From: "Wim van der Vegt" [wvd_vegt@k...]
Date: Thu Mar 14, 2002 8:52 am
Subject: Re: [VirtualTreeview] Printing example converted to Delphi

Hi,

Got a small improvement, The following code can throw an exception because if
you don't have a large tree, PrtImg never gets assigned so it's not initialized
properly.

finally
// Cleanup
if Assigned(PrtImg) then
PrtImg.Free;

Fix is to add a :

PrtImg:=nil;

just before the try block.

Anyway thanks a lot, it was what i needed. I have rewritten it so it works with
my printer preview dialog that uses metacanvases to pre-render the printers
output. Perhaps an idea for your component too to render to a metacanvas that
is alike the printer and then render the metacanvas to the printer. Instead of
the StrectDIBits i used the metacanvas'es stretchdraw method to draw the tree
onto the canvas.

----------------
Wim van der Vegt

[Non-text portions of this message have been removed]


R: InitNode sequence

From: "ePC TECH" [epctech@t...]
Date: Thu Mar 14, 2002 8:54 am
Subject: R: [VirtualTreeview] InitNode sequence

Thanks for your suggestion, I know that with AddChild I can do my tree, but
this means that nobody with InitNode, can't do a tree prestructured?

Thanks for the second question, you are right.

Hello
Marco

----- Original Message -----
From: Jim Kueneman
To: VirtualTreeview@yahoogroups.com
Sent: Thursday, March 14, 2002 4:35 AM
Subject: Re: [VirtualTreeview] InitNode sequence

At 12:14 AM 3/14/2002 +0100, you wrote:
>I have always seen example of VT with random generation of tree,
>but I try to generate a VT Tree from a Text like:
>
>000
>000,000
>000,000,000
>000,001
>000,001,000
>000,001,001
>001
>001,000
>001,000,000
>001,000,001
>
>but I haven't found help or documentation on how tree is build in InitNode.
>I tried to use Absolute index, but in Init node I obtained an error of stack
>overflow.
>Someone can help me on how method I can use to built my tree from a text file
>where every line is the sequence of index from root to last node?

In order for VT not to drive you crazy it is necessary to make the leap and
forget all bad habits learned from TTreeview. VT is a linked list so any
absolute index type transversing of the tree is inefficent and always a
hack. If you can rethink your data so that it can know what to do with
only information stored in the parent node it is much better. What you are
doing is possible by doing a loop and using AddChild(). The result is a
PVirtualNode which you can check Node.ChildCount. If ChildCount is > 0
then you can use Node.GetFirstChild to get the first Child then
ChildNextSibling to "count" you way to the right node by index then check
that for a ChildCount. If you run out of nodes then AddChild. If
ChildCount = 0 then you can add AddChild.

I have never done this so I am not sure of any issues.

> // Start immediate editing as soon as another node gets focused.
> if Assigned(Node) and (Node.Parent <> RootNode) and not
> (tsIncrementalSearching in TreeStates) then
>
>I obtain the absolute index in the child nodes but not in the node on
>first level?

You have filtered out the first level nodes with (Node.Parent <> RootNode)
remove it then you get the top level nodes.

Jim

>

Yahoo! Groups Sponsor
ADVERTISEMENT

To unsubscribe from this group, send an email to:
VirtualTreeview-unsubscribe@egroups.com

Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.

[Non-text portions of this message have been removed]

 | Replies | Author | Date
5571 | Re: R: [VirtualTreeview] InitNode sequence | Jim Kueneman | Thu 3/14/2002
5593 | Re: InitNode sequence | Mike Lischke | Sun 3/17/2002


re: Printing example converted to Delphi

From: "Illya Kysil" [ikysil@u...]
Date: Thu Mar 14, 2002 8:57 am
Subject: Re: [VirtualTreeview] Printing example converted to Delphi

> finally
> // Cleanup
> if Assigned(PrtImg) then
> PrtImg.Free;
>
> Fix is to add a :
>
> PrtImg:=nil;
>
> just before the try block.
Or just use FreeAndNil(PrtImg).

Regards
Illya Kysil, software developer
Delphi/C/C++/Java/Forth/Assembler
If it is NOT SOURCE, it is NOT SOFTWARE. (C) NASA


"win32api" dependency fails when trying to compile in D6

From: "rrruuunnneee" [yahoo-alternate@l...]
Date: Thu Mar 14, 2002 9:21 am
Subject: "win32api" dependency fails when trying to compile in D6

I'm trying to compile the VirtualTreesD6.dpk package file,
but for some reason I'm getting an error message saying;

"Fatal error: Required package 'Win32API' not found"

This is a fresh install of D6-enterprise, so I haven't
managed to intentionally screw it up myself yet. I am
tempted to reinstall the whole thing, but don't know if
that's the answer.

I searched for any *win32api* files, but couldn't find
anything at all.

Is my install messed up, or do I need some third party
win32api package from somewhere?

 | Replies | Author | Date
5570 | Re: "win32api" dependency fails when trying to co | Jim Kueneman | Thu 3/14/2002
5573 | Re: "win32api" dependency fails when trying to co | rrruuunnneee | Thu 3/14/2002
5620 | Re: "win32api" dependency fails when trying to co | Mike Lischke | Sat 3/23/2002


re: Printing example converted to Delphi

From: "Wim van der Vegt" [wvd_vegt@k...]
Date: Thu Mar 14, 2002 9:55 am
Subject: Re: [VirtualTreeview] Printing example converted to Delphi

Hi,

I don't get this comment.

The problem i had was that PrtImg contained garbage (and wasn't used during the
procedure) so passed the Assigned test because it wasn't nil. FreeAndNil is
just a replacement for Free that sets it to nil afterwards. What i need is a
assingment to nil BEFORE the try loop so the Assiged test fails and PrtImg.Free
is skipped.

You could replace PrtImg.Free by FreeAndNil(PrtImg) but it wouldn't solve the
problem i had. It suppresses the compiler warnings when doing it in two
separate statements and is certainly not a bad programming practice.

----------------
Wim van der Vegt, Open University of the Netherlands, dep. Otec

> finally
> // Cleanup
> if Assigned(PrtImg) then
> PrtImg.Free;
>
> Fix is to add a :
>
> PrtImg:=nil;
>
> just before the try block.
Or just use FreeAndNil(PrtImg).

Regards
Illya Kysil, software developer

[Non-text portions of this message have been removed]


re: Printing example converted to Delphi

From: "Wim van der Vegt" [wvd_vegt@k...]
Date: Thu Mar 14, 2002 11:57 am
Subject: Re: [VirtualTreeview] Printing example converted to Delphi

Hi,

I updated the PrintVTree Routine a bit (removed what i tought where some bugs,
made it split in both
horizontal and vertical direction and simplyfied it a bit. Maybe some things
are not 100% yet but my printouts
looked good enough for me as it scales correctly independed of the size of the
tree. Furthermore does the
idea behind code also work with the metacanvas i use for print previews.

Only things i think are missing is printing the headers on each page and split
not at pagewidth/height
but at columns/rows. Furthermore is the tree printed as seen on screen thus
some text may be
clipped with a 3 dot ellipse.

--------------------<cut here

procedure PrintVTree(Tree: TVirtualStringTree; Prt: TPrinter);
var
OldFont : AnsiString; // Remembers the Printer Font
ImgRect, // Describes the dimensions of Img
TreeRect, // The total VTree dimensions
DestRect, // Dimensions of PrtImg
SrcRect: TRect; // Clip dimensions from Img -> PrtImg
p : TPoint; // Used by PaintTree
po : TVTInternalPaintOptions; // Used by PaintTree
Img, // Complete Tree is drawn to this TImage
PrtImg: TImage; // This is the TImage that gets printed
OldCol : TColor; // Remembers the VTree Color
pTxtHeight, // Height of font in the TPrinter.Canvas
vTxtHeight, // Height of font in the VTree Canvas
vPageWidth, vPageHeight, // Printer height in VTree resolution
xPageNum, yPageNum, // # of pages (except the occasional last one)
xPage, yPage: Integer; // Loop counter
Scale : Real; // Scale factor between Printer Canvas and VTree Canvas
begin
// Check both printer and tree are defined
if (not (Assigned(Prt))) and (not (Assigned(Tree))) then
Exit;

// Clear the paint options
po := [];

// Remember the Printer Font
OldFont := Prt.Canvas.Font.Name;

// Let the Printer use the same font as the VTree (maybe should be an
Assign() ?)
Prt.Canvas.Font.Name := tree.Font.Name;

// Create an image that will hold the complete VTree
Img := TImage.Create(nil);
PrtImg := nil;
try
Img.Visible := FALSE;

TreeRect := Tree.GetTreeRect;
Img.Width := TreeRect.Right - TreeRect.Left;
Img.Height := TreeRect.Bottom - TreeRect.Top;
Img.Picture.Bitmap.Width := Img.Width;
Img.Picture.Bitmap.Height := Img.Height;

p.x := 0;
p.y := 0;
ImgRect.Left := 0;
ImgRect.Top := 0;
ImgRect.Right := Img.Width - 1;
ImgRect.Bottom := Img.Height - 1;

// Force the background to white color during the rendering
OldCol := tree.Color;
tree.Color := clWhite;
tree.PaintTree(Img.Canvas, ImgRect, p, po);
tree.Color := OldCol;

// Activate the printer
Prt.BeginDoc;

// Now we can calculate the scaling :
pTxtHeight := Prt.Canvas.TextHeight('Tj');
vTxtHeight := tree.Canvas.TextHeight('Tj');

Scale := pTxtHeight / vTxtHeight;

// veg: Moved the following PrtImg code out of the if statements
// Create an Image that has the same dimensions as the Printer Canvas but
// scaled to the VTree resolution :
PrtImg := TImage.Create(nil);
PrtImg.Visible := FALSE;

vPageHeight := Round(Prt.PageHeight / Scale);
vPageWidth := Round(Prt.PageWidth / Scale);

//veg:We do a minumum of one page.
xPageNum := Trunc(Img.Width / vPageWidth);
yPageNum := Trunc(Img.Height / vPageHeight);

PrtImg.Width := vPageWidth; //veg:was Img.Width;
PrtImg.Height := vPageHeight;
PrtImg.Picture.Bitmap.Width := PrtImg.Width;
PrtImg.Picture.Bitmap.Height := PrtImg.Height;

// split vertically :
for yPage := 0 to yPageNum do
begin
DestRect.Left := 0;
DestRect.Top := 0;
DestRect.Right := PrtImg.Width;
DestRect.Bottom := PrtImg.Height;

// Split horizontally :
for xPage := 0 to xPageNum do
begin
SrcRect.Left := vPageWidth * xPage;
SrcRect.Top := vPageHeight * yPage;
SrcRect.Right := vPageWidth * xPage + PrtImg.Width;
SrcRect.Bottom := SrcRect.Top + vPageHeight;

// Clear the image
PrtImg.Canvas.Brush.Color := clWhite;
PrtImg.Canvas.FillRect(Rect(0, 0, PrtImg.Width, PrtImg.Height));
PrtImg.Canvas.CopyRect(DestRect, Img.Canvas, SrcRect);
PrtStretchDrawDIB(Prt.Canvas, Rect(0, 0, Prt.PageWidth,
Prt.PageHeight - 1), PrtImg.Picture.Bitmap);
if xPage <> xPageNum then
Prt.NewPage;
end;
if yPage <> yPageNum then
Prt.NewPage;
end;

Prt.Canvas.Font.Name := OldFont;
Prt.EndDoc;
finally
// Cleanup
if Assigned(PrtImg) then
FreeAndNil(PrtImg);
if Assigned(Img) then
FreeAndNil(Img);
end;
end;

--------------------<cut here

----------------
Wim van der Vegt

[Non-text portions of this message have been removed]

 | Replies | Author | Date
5619 | Re: Printing example converted to Delphi | Mike Lischke | Sat 3/23/2002


re: "win32api" dependency fails when trying to compile in D6

From: Jim Kueneman [jimdk@m...]
Date: Thu Mar 14, 2002 12:24 pm
Subject: Re: [VirtualTreeview] "win32api" dependency fails when trying to compile in D6

At 09:21 AM 3/14/2002 +0000, you wrote:
>I'm trying to compile the VirtualTreesD6.dpk package file,
>but for some reason I'm getting an error message saying;
>
>"Fatal error: Required package 'Win32API' not found"
>
>This is a fresh install of D6-enterprise, so I haven't
>managed to intentionally screw it up myself yet. I am
>tempted to reinstall the whole thing, but don't know if
>that's the answer.
>
>I searched for any *win32api* files, but couldn't find
>anything at all.
>
>Is my install messed up, or do I need some third party
>win32api package from somewhere?

I don't understand this as my install does not reference this at all, but
some do here is what was found on the news group:

>You can either download the win32api file from www.delphi-jedi.org, or
>simply remove it from the uses clause...

Jim

 | Replies | Author | Date
5573 | Re: "win32api" dependency fails when trying to co | rrruuunnneee | Thu 3/14/2002
5620 | Re: "win32api" dependency fails when trying to co | Mike Lischke | Sat 3/23/2002


re: R: InitNode sequence

From: Jim Kueneman [jimdk@m...]
Date: Thu Mar 14, 2002 12:36 pm
Subject: Re: R: [VirtualTreeview] InitNode sequence

At 09:54 AM 3/14/2002 +0100, you wrote:
>Thanks for your suggestion, I know that with AddChild I can do my tree,
>but this means that nobody with InitNode, can't do a tree prestructured?

Do you mean by InitNode is you want to use the virtual aspect of VT? You
can, expecially if you are defining the structure. I need to understand
your problem better before suggesting any details.

Jm


Check State

From: GIANNAKOPOULOS KOSTAS [kyan@s...]
Date: Thu Mar 14, 2002 1:09 pm
Subject: Check State

Is there a way to programmatically control the check state of a node while
at the same time disallowing the user to change it by clicking the checkbox?

I tried setting Allowed to False in the OnChecking event but i discovered
that if i do this then setting the CheckState property in code will not work
either.

I can imagine a solution with a state flag "FInternalChecking" but i was
wondering if there is a more elegant solution.

TIA

<KY>

 | Replies | Author | Date
5574 | Re: Check State | Werner Lehmann | Thu 3/14/2002
5575 | Re: Check State | GIANNAKOPOULOS KOSTAS | Thu 3/14/2002


re: "win32api" dependency fails when trying to compile in D6

From: "rrruuunnneee" [yahoo-alternate@l...]
Date: Thu Mar 14, 2002 1:22 pm
Subject: Re: "win32api" dependency fails when trying to compile in D6

> >Is my install messed up, or do I need some third party
> >win32api package from somewhere?
>
> I don't understand this as my install does not reference this at all, but
> some do here is what was found on the news group:
>
> >You can either download the win32api file from www.delphi-jedi.org, or
> >simply remove it from the uses clause...

ok, thanks for the answer!

i downloaded the win32api .zip and did the magic work (unzipped & added to
library path), but i still had to remove it from the "require" statement for it
to compile since there was nothing called win32api actually installed.

everything seems to be just fine now!

:)

 | Replies | Author | Date
5620 | Re: "win32api" dependency fails when trying to co | Mike Lischke | Sat 3/23/2002


re: Check State

From: Werner Lehmann [wl@b...]
Date: Thu Mar 14, 2002 2:02 pm
Subject: Re: [VirtualTreeview] Check State

GIANNAKOPOULOS KOSTAS wrote:
>
> Is there a way to programmatically control the check state of a node while
> at the same time disallowing the user to change it by clicking the checkbox?
>
> I tried setting Allowed to False in the OnChecking event but i discovered
> that if i do this then setting the CheckState property in code will not work
> either.
>
> I can imagine a solution with a state flag "FInternalChecking" but i was
> wondering if there is a more elegant solution.

The easiest would be to modify the TVirtualNode record's CheckState flag
directly. This way no events are triggered and do prevent it happening.
Of course, this requires an InvalidateNode if you want to see it on screen
if the node is currently visible. And tristate automatisms won't work either.

Werner


re: Check State

From: GIANNAKOPOULOS KOSTAS [kyan@s...]
Date: Thu Mar 14, 2002 4:18 pm
Subject: RE: [VirtualTreeview] Check State

Thank you for the fast reply Werner.

> The easiest would be to modify the TVirtualNode record's
> CheckState flag
> directly. This way no events are triggered and do prevent it
> happening.
> Of course, this requires an InvalidateNode if you want to see
> it on screen
> if the node is currently visible. And tristate automatisms
> won't work either.

I'm afraid there are things that the CheckState property does when assigned
that cannot be done with direct assignment to the node's CheckState flag:
tristate tracking and radiobuttons.

Well, i have neither of them, but i think i prefer the state flag approach,
just in case.

<KY>


re: BCB6 - old error again! Help!!!

From: Oleg Kraynov [olegvkr@y...]
Date: Thu Mar 14, 2002 8:25 pm
Subject: Re: [VirtualTreeview] BCB6 - old error again! Help!!!

Hi,

Oops, trouble.
if not defined WIN32_LEAN_AND_MEAN (defined NO_WIN32_LEAN_AND_MEAN)
then <windows.h> includes <winsock.h>(WinSocket 1.x). The libraries
xerces-c(XML) and TAO(CORBA) use <winsock2.h>(WinSocket 2.x).
Result: Multiple declaration... :o(
Has returned {$HPPEMIT '#include <ole2.h>'} once again and has
deleted NO_WIN32_LEAN_AND_MEAN - work, but new problem -
impossible include <shlobj.h> (contains definition of the structure
DROPFILES) - Multiple declaration once again. :o(
Has tired to fight...

--
Best regards,
Oleg

_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com

 | Replies | Author | Date
5578 | Re: BCB6 - old error again! Help!!! | Jim Kueneman | Thu 3/14/2002
5582 | Re[2]: [VirtualTreeview] BCB6 - old error again! | Oleg Kraynov | Fri 3/15/2002


Drag between two Trees

From: Lucas Franzen [luc@r...]
Date: Thu Mar 14, 2002 11:09 pm
Subject: Drag between two Trees

Hello,

I'm stuck on a drag'n'drop between two TVirtualStringTrees (sorry, still
2.65).

I want to move nodes from one treeview to another.

The treeview where's moved from is multi-selectable, there are several
columns so FullRow select is true, DragType is OLE.

Most of the time I try to move the selected nodes to the other treeview
there's no drag operation (dmAutomatic for both) taking place, but
further nodes within treeview are selected (ie when you're and moving
the mouse up/down thus trying to start the dragging, further nodes
above/below are selected).

When setting FullRowSelect to FALSE it seems to work all the time ...

Luc.

 | Replies | Author | Date
5579 | Re: Drag between two Trees | Jim Kueneman | Thu 3/14/2002
5580 | Re: Drag between two Trees | Lucas Franzen | Thu 3/14/2002


re: BCB6 - old error again! Help!!!

From: Jim Kueneman [jimdk@m...]
Date: Thu Mar 14, 2002 11:43 pm
Subject: Re: [VirtualTreeview] BCB6 - old error again! Help!!!

Hi

>Oops, trouble.

I saw on the Borland sight an update for BCB6 that deals with problems
compiling pas files, may help.

Jim

 | Replies | Author | Date
5582 | Re[2]: [VirtualTreeview] BCB6 - old error again! | Oleg Kraynov | Fri 3/15/2002


re: Drag between two Trees

From: Jim Kueneman [jimdk@m...]
Date: Thu Mar 14, 2002 11:45 pm
Subject: Re: [VirtualTreeview] Drag between two Trees

Hi

>When setting FullRowSelect to FALSE it seems to work all the time ...

Did that version have to toReport mode? If this is set then a click
outside the main column will be disregarded as a drag.

Jim


re: Drag between two Trees

From: Lucas Franzen [luc@r...]
Date: Thu Mar 14, 2002 11:41 pm
Subject: Re: [VirtualTreeview] Drag between two Trees

Jim Kueneman schrieb:
>
> Hi
>
> >When setting FullRowSelect to FALSE it seems to work all the time ...
>
> Did that version have to toReport mode? If this is set then a click
> outside the main column will be disregarded as a drag.

It has, but it is set to false.

I compared it to another VST which is working okay (I just copied it to
this form and assigned the TreeOptions properties simultaneously), but
this copied treeview had just one column ....

Luc.


re: Display of new child nodes.

From: marek jedlinski [eristic@l...]
Date: Fri Mar 15, 2002 8:54 am
Subject: Re: [VirtualTreeview] Display of new child nodes.

On Fri, 08 Mar 2002 01:45:12 +0100, Werner Lehmann wrote:

>I agree with Kostas. If you dont populate the tree completely but defer this
>to the OnExpand event no problems arise - the tree will init the nodes if it
>finds that the to-be-expanded node has the vsHasChildren flag set (you can see
>a little plus button) *and* there are currently no children.

As someone who's only taking the deep breath, as it were, before plunging
into VT for my new application, I have a major conceptual problem with
this. For instance, let's say the application starts up with a parent node,
a few child nodes under it, and a few "grandchild" (3rd level) nodes. Each
node's Data property points to some object managed by the application.

At this point, the 3rd level nodes will be initialized yet (the parent is
collapsed). Now, when the user deletes the parent, how will the application
know that child nodes are being deleted also? They don't yet exist, there's
no Data property that points to the application's objects, so how will the
app know to delete these objects, held by nodes VT has not yet asked for or
initialized?

Also, the requirement to provide the initial count of child objects seems
like a burden. Currently (using VT's predecessor, TTreeNT), I don't care
how many child nodes there are, I don't need to count them - I just read
data from file and add the nodes as they come. (My objects are held in a
flat TList, with a Level property that indicates node nesting.) This way,
the tree *is* the data structure: it provides not only the visual
representation, but also holds all information about the hierarchy of
objects. But this won't work with VT. Or am I on the wrong track entirely?

.marek

--
/"\ ASCII Ribbon Campaign - Say NO to HTML in email
\ / Homepage, PGP Public Key: http://www.pdi.net/~eristic/
X No ads, no nags freeware: http://www.pdi.net/~eristic/free/
/ \
Venture capitalists sleep like babies. They sleep for two hours,
then they wake up and cry, then sleep for two hours...


Re[2]: BCB6 - old error again! Help!!!

From: Oleg Kraynov [olegvkr@y...]
Date: Fri Mar 15, 2002 9:00 am
Subject: Re[2]: [VirtualTreeview] BCB6 - old error again! Help!!!

Hi, Jim.

JK> I saw on the Borland sight an update for BCB6 that deals with problems
JK> compiling pas files, may help.

No, this update corrects only problem with license.

--
Best regards,
Oleg

_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


re: Display of new child nodes.

From: Werner Lehmann [wl@b...]
Date: Fri Mar 15, 2002 11:18 am
Subject: Re: [VirtualTreeview] Display of new child nodes.

Hi Marek,

> As someone who's only taking the deep breath, as it were, before plunging
> into VT for my new application, I have a major conceptual problem with
> this. For instance, let's say the application starts up with a parent node,
> a few child nodes under it, and a few "grandchild" (3rd level) nodes. Each
> node's Data property points to some object managed by the application.

ok.

> At this point, the 3rd level nodes will be initialized yet (the parent is
> collapsed). Now, when the user deletes the parent, how will the application
> know that child nodes are being deleted also? They don't yet exist, there's
> no Data property that points to the application's objects, so how will the
> app know to delete these objects, held by nodes VT has not yet asked for or
> initialized?

Depends on how you handle it. One way is to say that nodes which are not init'ed
don't have any data which needs freeing. But if you have the data already in
your
list you can just as well add the node to the tree (initialized of course). If
I
understand you correctly you (1) have a list with all data already in memory
and
(2) add all nodes to the tree but do not init them. I don't see the advantage
of
this. Either init them or do not add them if they are not needed.

Basically if you want to use the VT to hold your tree hierarchy (and please
be aware that you are mixing a visual component with your data structure)
you have to take the consequences: every data item in your list must have
a corresponding node, hereby sacrificing the add-node-on-demand concept (if
and only if your complete data is already in memory).

I don't know how large your tree is and personally I won't mind this approach
unless I have a really huge number of nodes. The only alternative is to hold
the tree structure in your list itself so that you know what to do if you
are informed that the parent node is deleted. But I have found that it is more
efficient to leave this task to the tree instead of duplicating a child list
in each node's data.

> Also, the requirement to provide the initial count of child objects seems
> like a burden. Currently (using VT's predecessor, TTreeNT), I don't care
> how many child nodes there are, I don't need to count them - I just read
> data from file and add the nodes as they come. (My objects are held in a
> flat TList, with a Level property that indicates node nesting.) This way,
> the tree *is* the data structure: it provides not only the visual
> representation, but also holds all information about the hierarchy of
> objects. But this won't work with VT. Or am I on the wrong track entirely?

I have never worked with TTreeNT. But if you always fully init the tree you
should have the same concept. IMO here is this confusion about the 'virtual'
concept again.

Some people believe that 'virtual' refers to the concept that the tree has
only as many nodes as it needs to have at any given time. New nodes are added
when needed (usually OnExpand). I don't call this virtual because this is as
virtual as a standard TTreeview. Nothing special here.

The second notion of 'Virtual' is the concept of 'late data binding', the use
of OnInit et al. This can increase performance a lot but only under certain
circumstances. *If* you already use the add-on-demand concept and add all
childnodes at once (which is the purpose of OnInitChildren or ChildCount[])
IMO OnInit shows only advantages if the number of siblings is very big and
probably not all of them are ever needed for display (as is the case with Mikes
reason to develop the component, see motivation introduction in the help file).

And there is a third notion of 'virtual'. This is Microsofts understanding of
the word. The component does not hold application data - if it needs the data
it asks for it, OnGetText et al. Because the application has it already in
memory
there is no need to duplicate all or parts of it (see virtual listview).

Coming back to the problem of needing to know how many child nodes there are
for any parent node. If you don't have this information your data structure
probably does not hold it. Either change that or use the tree as hierarchy
but then always init everything (as I said already). In this case I recommend
to
use ChildCount[] instead of AddChild whenever possible as this is much less
overhead. It probably even pays to count new child nodes in the data structure
and then add them with ChildCount[].

</article> ;)

Werner


D5: How 2 installVT as Design-Package?

From: "mrquarc" [mrquarc@y...]
Date: Fri Mar 15, 2002 12:42 pm
Subject: D5: How 2 installVT as Design-Package?

Hi!

Somehow i cant's get the VT working with my Delphi 5 standard. I
tried the installation sequence described in the help file and also
to use the Register-Unit. So, after hundreds of different compiler
error etc. i now have the components in my palette, but now, when i
compile my VT application i stops compiling: internal error: L1496.

How do i correctly install VT to freshly installed Delphi 5 standard
w/ Win95? I want to use the VT as design time package.

regards,
Marc

 | Replies | Author | Date
5585 | Re: D5: How 2 installVT as Design-Package? | Ane Visser | Fri 3/15/2002
5587 | Re: D5: How 2 installVT as Design-Package? | mrquarc | Fri 3/15/2002
5586 | Re: D5: How 2 installVT as Design-Package? | Jim Kueneman | Fri 3/15/2002
5588 | Re: D5: How 2 installVT as Design-Package? | mrquarc | Fri 3/15/2002


re: D5: How 2 installVT as Design-Package?

From: "Ane Visser" [Visser.A@n...]
Date: Fri Mar 15, 2002 1:06 pm
Subject: Re: [VirtualTreeview] D5: How 2 installVT as Design-Package?

Hi Marc

I happened to install version 3.0.4 last night, and it installed it just fine.
Are you using that version as well (you can see it at the top of
VirtualTrees.pas).

If you go to file|open, select <installdir>\VirtualTreesD5.dpk, compile and
install, and after that open <installDir>\VirtualTreesd5d.dpk, compile and
install, you should get the components on the pallette. Don't give up. It's
worth the effort.

Ane Visser
-----Oorspronkelijk bericht-----
Van: mrquarc [mrquarc@y...]
Aan: VirtualTreeview@yahoogroups.com <VirtualTreeview@yahoogroups.com>
Datum: Friday, March 15, 2002 1:42 PM
Onderwerp: [VirtualTreeview] D5: How 2 installVT as Design-Package?

Hi!

Somehow i cant's get the VT working with my Delphi 5 standard. I
tried the installation sequence described in the help file and also
to use the Register-Unit. So, after hundreds of different compiler
error etc. i now have the components in my palette, but now, when i
compile my VT application i stops compiling: internal error: L1496.

How do i correctly install VT to freshly installed Delphi 5 standard
w/ Win95? I want to use the VT as design time package.

regards,
Marc

Yahoo! Groups Sponsor
ADVERTISEMENT

To unsubscribe from this group, send an email to:
VirtualTreeview-unsubscribe@egroups.com

Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.

[Non-text portions of this message have been removed]

 | Replies | Author | Date
5587 | Re: D5: How 2 installVT as Design-Package? | mrquarc | Fri 3/15/2002


re: D5: How 2 installVT as Design-Package?

From: Jim Kueneman [jimdk@m...]
Date: Fri Mar 15, 2002 1:29 pm
Subject: Re: [VirtualTreeview] D5: How 2 installVT as Design-Package?

Hi,

>error etc. i now have the components in my palette, but now, when i
>compile my VT application i stops compiling: internal error: L1496.

Delete all the DCU's associated with VT, the DOF files, the RES files that
corespond to the two PAS files (VirtualTreesD5,res and
VirtualTreesD5D.res). Then go back and recompile VirtualTreesD5.pas and
VirtualTreesD5D.pas and reinstall.

Jim

 | Replies | Author | Date
5588 | Re: D5: How 2 installVT as Design-Package? | mrquarc | Fri 3/15/2002


re: D5: How 2 installVT as Design-Package?

From: "mrquarc" [mrquarc@y...]
Date: Fri Mar 15, 2002 10:52 pm
Subject: Re: D5: How 2 installVT as Design-Package?

> If you go to file|open, select <installdir>\VirtualTreesD5.dpk,
>compile and install

i can't install this, because this isn't a designtime package.

>, and after that open <installDir>\VirtualTreesd5d.dpk, compile and
>install, you should get the components on the pallette. Don't give
>up. It's worth the effort.

ok, done, but still, this internal Error L1496 appears. :´(

i already installed Delphi again.

cu Marc


re: D5: How 2 installVT as Design-Package?

From: "mrquarc" [mrquarc@y...]
Date: Fri Mar 15, 2002 11:30 pm
Subject: Re: D5: How 2 installVT as Design-Package?

> >error etc. i now have the components in my palette, but now, when i
> >compile my VT application i stops compiling: internal error: L1496.
>
> Delete all the DCU's associated with VT, the DOF files, the RES
files that
> corespond to the two PAS files (VirtualTreesD5,res and
> VirtualTreesD5D.res). Then go back and recompile VirtualTreesD5.pas
and
> VirtualTreesD5D.pas and reinstall.

mega thanks. that was it!!!

ciao, marc :-)


Sort every Column

From: "Peter Evans" [pgevans@m...]
Date: Sun Mar 17, 2002 6:34 am
Subject: Sort every Column

I have successfully been able to sort one Column. This is using the Header
property and Header.SortColumn and coding the event CompareNodes.

By this means you can have the sort glyph on the one column header.

What if I want to have the sort glyph on each column header? Is there a way
to do this? Or even have the sort glyph on two Columns?

Regards, Peter Evans

 | Replies | Author | Date
5590 | Sort every Column | Peter Evans | Sun 3/17/2002
5591 | Sort every Column | Peter Evans | Sun 3/17/2002
5592 | Re: Sort every Column | jimkueneman | Sun 3/17/2002
5603 | Re: Sort every Column | Peter Evans | Tue 3/19/2002
5621 | Re: Sort every Column | Mike Lischke | Sat 3/23/2002


Sort every Column

From: "Peter Evans" [pgevans@m...]
Date: Sun Mar 17, 2002 1:04 am
Subject: Sort every Column

I have successfully been able to sort one Column. This is using the Header
property and Header.SortColumn and coding the event CompareNodes.

By this means you can have the sort glyph on the one column header.

What if I want to have the sort glyph on each column header? Is there a way
to do this? Or even have the sort glyph on two Columns?

Regards, Peter Evans


Sort every Column

From: "Peter Evans" [pgevans@m...]
Date: Sat Mar 16, 2002 5:27 am
Subject: Sort every Column

I have successfully been able to sort one Column. This is using the Header
property and Header.SortColumn and coding the event CompareNodes.

By this means you can have the sort glyph on the one column header.

What if I want to have the sort glyph on each column header? Is there a way
to do this?

Regards, Peter Evans


re: Sort every Column

From: "jimkueneman" [jimdk@m...]
Date: Sun Mar 17, 2002 6:24 pm
Subject: Re: Sort every Column

> What if I want to have the sort glyph on each column header? Is
there a way
> to do this? Or even have the sort glyph on two Columns?
>

I am fairly sure you will have to draw it yourself, in OnHeaderDraw.

Jim


re: InitNode sequence

From: "Mike Lischke" [lists@l...]
Date: Sun Mar 17, 2002 11:40 am
Subject: RE: [VirtualTreeview] InitNode sequence

> Thanks for your suggestion, I know that with AddChild I can do my tree, but
this means
> that nobody with InitNode, can't do a tree prestructured?

Of course you can. Imaging you read a text file and build your internal
structure. Then set up the
tree to visualize your structure by starting with the top level nodes (count
usually). Then,
whenever I node is needed, which is not yet initialized OnInitNode is triggered
and you can do a
connection between the node and your data, potentially loading more data, which
were not yet there.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: Latest version?

From: "Mike Lischke" [lists@l...]
Date: Sun Mar 17, 2002 10:25 am
Subject: RE: [VirtualTreeview] Latest version?

> The version I have of VT is 3.0.4. What is the latest version for
> Delphi 5? I looked in the Files area but there is no download for
> VT itself. All I can see is a Beta for CLX and a museum folder
> for old files. Shouldn't there be a file always pointing to the
> last released official (non beta) version?

No. How did you come to this impression? I had the betas in the file area all
the time. But why
should I keep the non-betas there if they can be downloaded from my homepage? I
have placed the CLX
version in the file area because it is again a beta version, but since it is
very special and needs
help from people who are likely not on this list, I also published it on my
homepage.

As already mentioned the latest version of VT is 3.1.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: Re: Printing example converted to Delphi

From: "Mike Lischke" [lists@l...]
Date: Sun Mar 17, 2002 10:54 am
Subject: RE: [VirtualTreeview] Re: Printing example converted to Delphi

Adem,

> I wonder if it is not possible, or appropriate, to
> integrate this code into VT itself.

Sure. As soon as YG is available again I'll get the code to integrate. I only
hoped all the time
somebody would come up with a solution which does not need stretch blits, but
instead DC scaling
(viewport and window extents), as this would yield better results.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net

 | Replies | Author | Date
5600 | Re: Printing example converted to Delphi | Jim Kueneman | Mon 3/18/2002
5623 | Re: Printing example converted to Delphi | Mike Lischke | Sat 3/23/2002
5625 | Re: Printing example converted to Delphi | Jim Kueneman | Sat 3/23/2002


re: RE: BCB6 - old error again! Help!!!

From: "Mike Lischke" [lists@l...]
Date: Sun Mar 17, 2002 10:26 am
Subject: RE: [VirtualTreeview] RE: BCB6 - old error again! Help!!!

> So, is there a way to fix VirtualTrees.pas so it would work in BCB6
> without modification? Or any project settings?

Any news on that? Has somebody already found out what to include in the VT
source to minimize extra
work for BCB6?

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: Simple Drag and Drop

From: "Mike Lischke" [lists@l...]
Date: Sun Mar 17, 2002 11:24 am
Subject: RE: [VirtualTreeview] Simple Drag and Drop

Hi Andreas,

> i would like to implement a simple Drag and Drop
> i would like to reorder nodes with drag and drop (only in one
> TreeView - not between two)

Well, just try to set drag mode to dmAutomatic and assign an event handler to
OnDragDrop. Depending
on the drop mode you can then call VT.MoveTo.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


Slow scrollwheel?

From: "ishemes" [ilan@s...]
Date: Sun Mar 17, 2002 11:10 pm
Subject: Slow scrollwheel?

I don't actually own a mouse with scrollwheel, but users that use my
application with VirtualTreeView components complain that the
scrollwheel only scrolls one line at a time. Other components seem
to scroll three lines at once. Is this some way user definable? Or
should I change the source?

I currently use a TVirtualStringTree component from release 3.1.2.

 | Replies | Author | Date
5599 | Re: Slow scrollwheel? | Jim Kueneman | Sun 3/17/2002
5622 | Re: Slow scrollwheel? | Mike Lischke | Sat 3/23/2002


re: Slow scrollwheel?

From: Jim Kueneman [jimdk@m...]
Date: Mon Mar 18, 2002 12:07 am
Subject: Re: [VirtualTreeview] Slow scrollwheel?

Hi,

>scrollwheel only scrolls one line at a time. Other components seem
>to scroll three lines at once. Is this some way user definable? Or
>should I change the source?

Looks like Mike should make this improvement to

procedure TBaseVirtualTree.CMMouseWheel(var Message: TCMMouseWheel);

var
....
pulScrollLines: integer;
begin
.....

if FRangeY > Cardinal(ClientHeight) then
begin
// scroll vertical if there's something to scroll...
if ssCtrl in ShiftState then
ScrollCount := WheelDelta div WHEEL_DELTA * (ClientHeight div
Integer(FDefaultNodeHeight))
else begin
SystemParametersInfo(SPI_GETWHEELSCROLLLINES, 0,
@pulScrollLines, 0); <<<< NEW
ScrollCount := WheelDelta div WHEEL_DELTA *
pulScrollLines; <<<<< CHANGED
end;
SetOffsetY(FOffsetY + ScrollCount * Integer(FDefaultNodeHeight));
end
.....
// ...else scroll horizontally
if ssCtrl in ShiftState then
ScrollCount := WheelDelta div WHEEL_DELTA * ClientWidth
else begin
SystemParametersInfo(SPI_GETWHEELSCROLLLINES, 0,
@pulScrollLines, 0); <<<< NEW
ScrollCount := WheelDelta div WHEEL_DELTA *
pulScrollLines; <<<<< CHANGED
end;
SetOffsetX(FOffsetX + ScrollCount * Integer(FIndent));

Jim

 | Replies | Author | Date
5622 | Re: Slow scrollwheel? | Mike Lischke | Sat 3/23/2002


re: Re: Printing example converted to Delphi

From: Jim Kueneman [jimdk@m...]
Date: Mon Mar 18, 2002 5:37 am
Subject: RE: [VirtualTreeview] Re: Printing example converted to Delphi

Hi Mike,

>Sure. As soon as YG is available again I'll get the code to integrate. I
>only hoped all the time
>somebody would come up with a solution which does not need stretch blits,
>but instead DC scaling
>(viewport and window extents), as this would yield better results.

Unfortunately it appears that you can't get rid if Stretch Blits
entirely. Passing a Canvas DC to PaintTree is futile. Windows does not
support BitBlting and various other copying methods across DC's of
different devices, so any Bitmap.Canvas bits that are blasted to the
Printer DC fail (although some printer drivers detect and will do this
operation). Nothing comes through on my system. PaintTree is advertised
to be able to work with a Printer Canvas and it simply won't work the way
it is unless painting operations in VT changed to DIBs or using
CreateCompatibleDC then CreateCompatibleBitmap for all drawing.

Do you have a working printing routine at work? How do you do it there?

Jim

 | Replies | Author | Date
5623 | Re: Printing example converted to Delphi | Mike Lischke | Sat 3/23/2002
5625 | Re: Printing example converted to Delphi | Jim Kueneman | Sat 3/23/2002


re: Re: Printing example converted to Delphi

From: "Wim van der Vegt" [wvd_vegt@k...]
Date: Mon Mar 18, 2002 10:39 am
Subject: Re: [VirtualTreeview] Re: Printing example converted to Delphi

Hi,

Have a look at metafilecanvas. I use it for print previews and used it's
stretchdraw to paint the VT onto it with success. It can be made compatible in
size with a lot of things including printers.

----------------
Wim van der Vegt

----- Original Message -----
From: Jim Kueneman
To: VirtualTreeview@yahoogroups.com
Sent: Monday, March 18, 2002 6:37 AM
Subject: RE: [VirtualTreeview] Re: Printing example converted to Delphi

Hi Mike,

>Sure. As soon as YG is available again I'll get the code to integrate. I
>only hoped all the time
>somebody would come up with a solution which does not need stretch blits,
>but instead DC scaling
>(viewport and window extents), as this would yield better results.

Unfortunately it appears that you can't get rid if Stretch Blits
entirely. Passing a Canvas DC to PaintTree is futile. Windows does not
support BitBlting and various other copying methods across DC's of
different devices, so any Bitmap.Canvas bits that are blasted to the
Printer DC fail (although some printer drivers detect and will do this
operation). Nothing comes through on my system. PaintTree is advertised
to be able to work with a Printer Canvas and it simply won't work the way
it is unless painting operations in VT changed to DIBs or using
CreateCompatibleDC then CreateCompatibleBitmap for all drawing.

Do you have a working printing routine at work? How do you do it there?

Jim

Yahoo! Groups Sponsor
ADVERTISEMENT

To unsubscribe from this group, send an email to:
VirtualTreeview-unsubscribe@egroups.com

Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.

[Non-text portions of this message have been removed]


UNSELECT

From: "Todor Huklev" [todhouk@i...]
Date: Mon Mar 18, 2002 1:58 pm
Subject: UNSELECT

Hi ALL!

Why after that (I want unselect tree):

VT.Selected[VT.FocusedNode] := false;
VT.FocusedNode:= nil;

VT is SELECED !!!

[Non-text portions of this message have been removed]

 | Replies | Author | Date
5604 | Re: UNSELECT | Jim Kueneman | Tue 3/19/2002


re: Re: Sort every Column

From: "Peter Evans" [pgevans@m...]
Date: Mon Mar 18, 2002 10:04 pm
Subject: Re: [VirtualTreeview] Re: Sort every Column

I'm sorry about the 3 posts, but kept getting errors sending to Yahoo Groups
over the weekend.

> I am fairly sure you will have to draw it yourself, in OnHeaderDraw.
>
>
Will try this, thanks,
Regards, Peter Evans


re: UNSELECT

From: Jim Kueneman [jimdk@m...]
Date: Tue Mar 19, 2002 12:57 am
Subject: Re: [VirtualTreeview] UNSELECT

At 03:58 PM 3/18/2002 +0200, you wrote:
>Hi ALL!
>
>Why after that (I want unselect tree):
>
>VT.Selected[VT.FocusedNode] := false;
>VT.FocusedNode:= nil;
>
>VT is SELECED !!!

Focus does not necessarily equal Selected

VT.Selected[VT.GetFirstSelected] := false;

Only fully works if multi select is not on or maybe VT.ClearSelection

Jim


images overwritten

From: "ei97005" [ei97005@f...]
Date: Tue Mar 19, 2002 10:22 am
Subject: images overwritten

Hi!

I'm using the TVirtualStringTree, and it has a TImageList linked with
5 images with 16X16 icon 256 colors. Then problem is that the first 3
appear OK, but the last 2 appear with the icon #1 over it!

What may be happening???

thanks

 | Replies | Author | Date
5606 | Re: images overwritten | Jim Kueneman | Tue 3/19/2002


re: images overwritten

From: Jim Kueneman [jimdk@m...]
Date: Tue Mar 19, 2002 1:07 pm
Subject: Re: [VirtualTreeview] images overwritten

>I'm using the TVirtualStringTree, and it has a TImageList linked with
>5 images with 16X16 icon 256 colors. Then problem is that the first 3
>appear OK, but the last 2 appear with the icon #1 over it!
>
>What may be happening???

Make sure you are checking for the Kind parameter in OnGetImageIndex and
only return an Image index for the propery type (mainly for ikNormal
and ikSelected) if you return a value for ikOverlay and the list does not
define any overlay image weird things happen.

Jim


problem with focus

From: "AndyPie" [fwd2@g...]
Date: Tue Mar 19, 2002 11:20 pm
Subject: problem with focus

Hi all,

I am using VT 3.1 in Delphi 5. In my Application I create the VT object
instance dynamically while runtime.

I have problems selecting my nodes. When clicking on the caption of the node
nothing happens (the node doesnt get focus). But when I click in the space
among the plus sign and the caption it gets the focus. Once it had the focus
there is no problem anymore.

Then I started the app again and tried to select some nodes by drawing a
rectangle with the mouse across the screen. I started the rectangle from the
right side. Now I saw what was wrong. When I draw it across the caption of
the nodes they stay white. Finally when I reached the space among the plus
sign and the caption, only this space turned blue.

Is there any attribute to control the width of the focus, or do i need to
initialise the nodes first?

Ciao
AndyPie

 | Replies | Author | Date
5608 | Re: problem with focus | Werner Lehmann | Wed 3/20/2002
5681 | Re: problem with focus | AndyPie | Sun 4/7/2002
5609 | Re: problem with focus | GIANNAKOPOULOS KOSTAS | Wed 3/20/2002


re: problem with focus

From: Werner Lehmann [wl@b...]
Date: Wed Mar 20, 2002 12:06 am
Subject: Re: [VirtualTreeview] problem with focus

AndyPie wrote:
>
> Is there any attribute to control the width of the focus, or do i need to
> initialise the nodes first?

VT caches the caption widths of the main column. It does so when a node is
initialized. Right after OnInitNode it will use OnGetText to get the node
caption to determine its width.

Hence, if you use AddChild and don't use OnInitNode it will initialize its
caption width with empty text because right after AddChild there is no data
associated to the node.

You can work around this by
* using OnInitNode properly (is not required see other ways)
* use AddChild with its optional parameter to init the node (only if you
have nothing but a pointer in your node data area)
* wrap your AddChild's with BeginUpdate and EndUpdate, VT will wait until
EndUpdate until it init's nodes, so you have time to init them manually

This applies also to InsertNode and ChildCount[] if OnInitNode is not used.

Werner

 | Replies | Author | Date
5681 | Re: problem with focus | AndyPie | Sun 4/7/2002


re: problem with focus

From: GIANNAKOPOULOS KOSTAS [kyan@s...]
Date: Wed Mar 20, 2002 9:20 am
Subject: RE: [VirtualTreeview] problem with focus

> You can work around this by
> * using OnInitNode properly (is not required see other ways)
> * use AddChild with its optional parameter to init the node
> (only if you
> have nothing but a pointer in your node data area)
> * wrap your AddChild's with BeginUpdate and EndUpdate, VT
> will wait until
> EndUpdate until it init's nodes, so you have time to init
> them manually

A fourth alternative appropriate when you are inserting one node at a time:
Do a ReinitNode right after you put your custom data in the data area of the
node. This will force the node to be initialized again and its text width
will be calculated properly. Something like:

var
Node: PVirtualNode;
begin
Node := VT.AddChild(nil);
PMyData(VT.GetNodeData(Node))^ := MyData;
VT.ReinitNode(Node, False);
end;

If you will be inserting many nodes i think you'd better use #3 instead.

<KY>


There are italian people in Mailing List

From: "ePC TECH" [epctech@t...]
Date: Wed Mar 20, 2002 9:40 am
Subject: There are italian people in Mailing List

If there are italian people in this mailing I'm interested to exchange opinion
about VT, I'm in Milan
Thanks and hello to everybody
Marco

[Non-text portions of this message have been removed]


Drag & Drop and Node Selection

From: Philip Wand [philip@l...]
Date: Thu Mar 21, 2002 10:39 am
Subject: Drag & Drop and Node Selection

Hi all,

A quick search through the group's message archive reveals this has been
asked before but I couldn't find the answer :(

For example,
http://groups.yahoo.com/group/VirtualTreeview/message/5427

To sum up: Is it possible in toReport mode for the drop target selection to
be activated only when the mouse is over the node caption -- thus mimicking
the behaviour of TListview?

At the moment it's impossible to drop stuff onto a VirtualTreeview without
bumping into all the nodes that are already in there :)

Thanks! Phil.


re: MIKE - Explorer

From: "Dion" [dion@n...]
Date: Thu Mar 21, 2002 11:53 am
Subject: RE: [VirtualTreeview] MIKE - Explorer

Hi Jim,

I looked at the example you posted on the examples site. The problem I had
with the solution was that after I used the right click, the left cllick
would not trigger the onchange(vt) event. I wanted the Explorer simulation,
but with the left click working. I am not an accomplished component or oop
programmer, but I made some changes to your example code. Please check it an
let me know if it meets your approval.

Regards,
Dion.

Code.
-----

type
TVirtualStringTreeEx = class(TVirtualStringTree)
private
FSavedSelectedNode: PVirtualNode;
FSavedFocusedNode: PVirtualNode;
FRightButtonClick: boolean; --> Dion
protected
procedure DoChange(Node: PVirtualNode); override;
procedure HandleRButtonUp;

procedure WMContextMenu(var Message: TWMContextMenu); message
WM_CONTEXTMENU;
procedure WMRButtonDown(var Message: TWMRButtonDown); message
WM_RBUTTONDOWN;
procedure WMLButtonDown(var Message: TWMLButtonDown); message
WM_LBUTTONDOWN;
procedure WMRButtonUp(var Message: TWMRButtonUp); message WM_RBUTTONUP;

property SavedFocusedNode: PVirtualNode read FSavedFocusedNode write
FSavedFocusedNode;
property SavedSelectedNode: PVirtualNode read FSavedSelectedNode write
FSavedSelectedNode;
end;

procedure Register;

implementation

procedure Register;
begin
RegisterComponents('Virtual Controls', [TVirtualStringTreeEx]);
end;

{ TVirtualStringTreeEx }

procedure TVirtualStringTreeEx.DoChange(Node: PVirtualNode);
begin
if (not FRightButtonClick) and (not Assigned(SavedSelectedNode))
en ---> Dion
inherited;
end;

procedure TVirtualStringTreeEx.HandleRButtonUp;
begin
if Assigned(SavedSelectedNode) then
begin
ClearSelection;
Selected[SavedSelectedNode] := True;
FocusedNode := FocusedNode;
end
end;

procedure TVirtualStringTreeEx.WMContextMenu(var Message: TWMContextMenu);
begin
inherited;
HandleRButtonUp;
end;

procedure TVirtualStringTreeEx.WMLButtonDown(var Message:
MLButtonDown); --> Dion
begin
FRightButtonClick := false;
SavedSelectedNode := nil ;
inherited;
end;

procedure TVirtualStringTreeEx.WMRButtonDown(var Message: TWMRButtonDown);
var
Node: PVirtualNode;
begin
FRightButtonClick := Message.Keys = MK_RBUTTON; --> Dion
Node := GetNodeAt(Message.xPos, Message.yPos);
if Assigned(Node) then
begin
SavedFocusedNode := FocusedNode;
SavedSelectedNode := GetFirstSelected;
ClearSelection;
FocusedNode := nil;
Selected[Node] := True;
end;
inherited;
end;

procedure TVirtualStringTreeEx.WMRButtonUp(var Message: TWMRButtonUp);
begin
inherited;
HandleRButtonUp;
end;

PSSSSS - Correction, Recommendations etc humbly accepted.

-----Original Message-----
From: Jim Kueneman [mailto:[jimdk@m...]]
Sent: Wednesday, February 20, 2002 5:37 AM
To: VirtualTreeview@yahoogroups.com
Subject: RE: [VirtualTreeview] MIKE - Explorer

Hi Dion,

>Sorry to disagree Jim, but run the VET demo app, expand one of the drives
so
>that some folders are visible. Select one by clicking on it. Now right
click
>another. The user will get the impression that the one right clicked on is
>the current folder. The right click menu pops up. Press escape. The
original
>selection is reinstated...

??....... Huh, I am but the selection does fire an OnChange in the
component (which will change the contents of the listview in the
ExplorerDemo.

Ok, I am fudging it look here

TContextMenuManager.RightClick

You will see I am doing what I suggested except I am not setting a flag to
stop the OnChange event action, which now looks possible.

Sorry I forgot I had done that. I only remember the OnChange problem and
assumed I did not implement it.

Jim

To unsubscribe from this group, send an email to:
VirtualTreeview-unsubscribe@egroups.com

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/

---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.314 / Virus Database: 175 - Release Date: 01/11/2002

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.314 / Virus Database: 175 - Release Date: 01/11/2002


FontChange handling in subclasses

From: Marco Rocci [mrocci@t...]
Date: Thu Mar 21, 2002 1:50 pm
Subject: FontChange handling in subclasses

Hi,

I'm writing a TCustomVirtualDrawTree descendant with default Text
drawing capabilities (similar to TCustomVirtualStringTree) but with no
internal Text storage... it uses a GetNodeText event.

I've looked through the VT source and noticed I already inherit some
useful code from TBaseVirtualTree, that has to do with canvas font
changing. But I'm having problems because this code is private, and
not protected.

I was just wondering if this is correct... I mean this code is used
only in the StringTree, but it is implemented in the BaseVirtualTree
as private. To use it in a DrawTree subclass I have to modify
TBaseVirtualTree so as to expose some things:
Protected
procedure RedirectFontChangeEvent(Canvas: TCanvas);
procedure RestoreFontChangeEvent(Canvas: TCanvas);
property CanvasFontChanged: Boolean read FFontChanged write
FFontChanged;

BTW - my compliments to Mike for this very useful component.

Regards,

--
Marco Rocci
MicroEra srl
Turin, Italy
-----------------
vota contro lo SPAM su: http://www.politik-digital.de/spam/

 | Replies | Author | Date
5656 | Re: FontChange handling in subclasses | Mike Lischke | Tue 4/2/2002


re: Can't use most VT Demos (at least not As-Is)

From: "benadembaba" [adembaba@e...]
Date: Thu Mar 21, 2002 11:29 pm
Subject: Re: Can't use most VT Demos (at least not As-Is)

Hi,

VT is liable to change far more often than the demos;
so it is only to be expected that some of the parameters
will need to be corrected in the demos. Mostly, we are
talking about methods/events that had Integer as column
index and are TColumnIndex now. You can easily correct
all the stuff by referring to the actual VT code.

About DesignSize property etc., you are right these
are D6 properties... These dont really hurt anyone;
you can safely press 'Ignore all' when IDE complains
about them on loading the project.

Cheers,

Adem

--- In [VirtualTreeview@y...], "eljarec" [eljarec@y...] wrote:
> Hi,
>
> I downloaded and installed VT yesterday and all went without a
hitch,
> however when I wanted to take a look at the demos I stumbled on a
> problem. It seems the person packaging the demos, has touched them
> with D6 and did not bother to include conditionals to separate any
> new D6 stuf from the other versions...
>
> As such most of the demos won't run because in D5 the TForm does
not
> know the DesignSize property, and there is no Variants unit in D5.
>
> Also I get in several of the demos errors about parameterlists
which
> are incomatible...probably also a result of touching with D6.
>
> TIA
> JarC
>
>
>
>
>
> To unsubscribe from this group, send an email to:
> [VirtualTreeview-unsubscribe@e...]
>
>
>
> Your use of Yahoo! Groups is subject to
http://docs.yahoo.com/info/terms/

 | Replies | Author | Date
5617 | Re: Can't use most VT Demos (at least not As-Is) | Jim Kueneman | Fri 3/22/2002


How to use Load on Demand - OnInitNode etc...

From: "Justin Stenning" [jstenning@e...]
Date: Thu Mar 21, 2002 11:39 pm
Subject: How to use Load on Demand - OnInitNode etc...

Sorry this is probably a stupid question....

I have been using VT for a little while now, from loading data from a
database to manipulating large lists of information already in memory. But I
am stuck in the mindset of that pesky TTreeView still...

I currently use the following method to build the tree regardless of where
the data is coming from (in some cases this can be very slow when a root
node has many children/grandchildren and so on):

vst.BeginUpdate
try
for i := 0 to someCount do
begin
// Parent is nil when the root items are being created.
aNode := vst.AddChild(parent);
aNodeData := vst.GetNodeData(aNode);
// Set the values in aNodeData.
end;
finally
vst.EndUpdate;
end;

What I would like to know is how one would go about using the load on demand
approach? i.e. if you have to do a query for the root items, and then
another for each root item to load the child objects it can take quite some
time.

Some questions about this I have are:

1) Do you need to know how many child items there are? i.e. setting the
ChildCount for the parent or do you just set "HasChildren" and work out how
many child items there are later? Do you need to create the nodes - in which
case I would need to know how many there are wouldn't I?

2) When OnInitNode, how would I go about knowing which record (eg from a
query) to load into the Nodes' data? Would I have to half initialise the
nodes data with an Id or something?

3) Or have I got all this wrong, and need to be re-educated? :-)

I fudged something like this by creating one subitem (a Placeholder with the
text "Loading...") when I knew the parent had child nodes, and then OnExpand
I would delete the placeholder and create all the child nodes using the
BeginUpdate,EndUpdate above...

I understand that there are countless ways in which all of this can be done,
and that a lot of this has to do with what information is stored in the
NodeData record... I just need some pointers in the correct direction...

Thanks,
Justin


re: Re: Can't use most VT Demos (at least not As-Is)

From: Jim Kueneman [jimdk@m...]
Date: Fri Mar 22, 2002 3:53 am
Subject: Re: [VirtualTreeview] Re: Can't use most VT Demos (at least not As-Is)

Hi,

>are D6 properties... These dont really hurt anyone;
>you can safely press 'Ignore all' when IDE complains
>about them on loading the project.

And the Varients unit can simply be removed for D5.

Jim


painting anomaly on expand

From: "Dion" [dion@n...]
Date: Sun Mar 24, 2002 1:40 am
Subject: painting anomaly on expand

Hi,

May I attach an image of less than 20K to illustate a situation?

Thanks,
Dion.

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.314 / Virus Database: 175 - Release Date: 01/11/2002

 | Replies | Author | Date
5657 | Re: painting anomaly on expand | Mike Lischke | Tue 4/2/2002


re: Printing example converted to Delphi

From: "Mike Lischke" [lists@l...]
Date: Sat Mar 23, 2002 5:23 pm
Subject: RE: [VirtualTreeview] Printing example converted to Delphi

Hi Wim and all,

> I updated the PrintVTree Routine a bit (removed what i tought where some
bugs, made it split in
both
> horizontal and vertical direction and simplyfied it a bit. Maybe some things
are not 100% yet but
my printouts
> looked good enough for me as it scales correctly independed of the size of
the tree.

Today I have included the code into the VT source and must say it works very
well. I cannot see any
problems arising from use of stretch blits on my HP G85. I also included header
printing, but found
some strange behavior. The header (on my XP box) in printed in themed fashion
but uses the wrong
colors. I don't understand how this can happen.

Another important point was to disable clear type output when printing. Since
the code does not
directly print to the printer all output uses clear type (the new antialiasing
technique) which uses
colored extra pixel to improve display quality. This looks quite strange,
though, on printer output.
Hence fonts must be temporarily changed. This introduces however the second
little glitch I found no
solution for: while resetting the old font for the tree works as expected, it
is ignored by the
header. I don't see any obvious reason, why the old font is not restored
(results in wrong header
display, after printing).

Anyway, I will upload a new patch to the YG file area tonight, so all
interested people can try it
out.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: Re: "win32api" dependency fails when trying to compile in D6

From: "Mike Lischke" [lists@l...]
Date: Sat Mar 23, 2002 5:27 pm
Subject: RE: [VirtualTreeview] Re: "win32api" dependency fails when trying to compile in D6

> i downloaded the win32api .zip and did the magic work (unzipped & added to
library path),
> but i still had to remove it from the "require" statement for it to compile
since there
> was nothing called win32api actually installed.

In fact, the win32api package was created by me, because I could not use some
interface units in
multiple projects/other packages. I have mailed Marcel a proposal to provide
packages directly in
his original version. I'm waiting for his answer.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: Sort every Column

From: "Mike Lischke" [lists@l...]
Date: Sat Mar 23, 2002 6:57 pm
Subject: RE: [VirtualTreeview] Sort every Column

Peter,

> What if I want to have the sort glyph on each column header? Is there a way
> to do this? Or even have the sort glyph on two Columns?

Painting the sort glyph in each column is not the problem, however the
managment needs some work. If
you like to implement that then go ahead and let me know when you are finished.
I'll happily include
your code then.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: Slow scrollwheel?

From: "Mike Lischke" [lists@l...]
Date: Sat Mar 23, 2002 7:17 pm
Subject: RE: [VirtualTreeview] Slow scrollwheel?

> Looks like Mike should make this improvement to

Good point. I have included your suggestion, Jim.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net


re: Re: Printing example converted to Delphi

From: "Mike Lischke" [lists@l...]
Date: Sat Mar 23, 2002 7:19 pm
Subject: RE: [VirtualTreeview] Re: Printing example converted to Delphi

> Unfortunately it appears that you can't get rid if Stretch Blits
> entirely. Passing a Canvas DC to PaintTree is futile. Windows does not
> support BitBlting and various other copying methods across DC's of
> different devices, so any Bitmap.Canvas bits that are blasted to the
> Printer DC fail (although some printer drivers detect and will do this
> operation).

Oh, I did not know this. Quite a while ago there was some discussion about the
problem with blitting
to the printer canvas, IIRC.

Fortunately, the results from the new print code are absolute ok and I don't
see any need to
implement some much more sophisticated but expensive solution.

Ciao, Mike
--
www.lischke-online.de
www.delphi-unicode.net

 | Replies | Author | Date
5625 | Re: Printing example converted to Delphi | Jim Kueneman | Sat 3/23/2002


New file uploaded to VirtualTreeview

From: VirtualTreeview@yahoogroups.com
Date: Sat Mar 23, 2002 7:24 pm
Subject: New file uploaded to VirtualTreeview

Hello,

This email message is a notification to let you know that
a file has been uploaded to the Files area of the VirtualTreeview
group.

File : /VirtualTreesPatch2.zip
Uploaded by : mikelischke [lists@l...]
Description : Second patch for Virtual Treeview.

You can access this file at the URL

http://groups.yahoo.com/group/VirtualTreeview/files/VirtualTreesPatch2.zip

To learn more about file sharing for your group, please visit

http://help.yahoo.com/help/us/groups/files

Regards,

mikelischke [lists@l...]


re: Re: Printing example converted to Delphi

From: Jim Kueneman [jimdk@m...]
Date: Sat Mar 23, 2002 10:06 pm
Subject: RE: [VirtualTreeview] Re: Printing example converted to Delphi

Hi Mike,

> > Unfortunately it appears that you can't get rid if Stretch Blits
> > entirely. Passing a Canvas DC to PaintTree is futile. Windows does not
> > support BitBlting and various other copying methods across DC's of
> > different devices, so any Bitmap.Canvas bits that are blasted to the
> > Printer DC fail (although some printer drivers detect and will do this
> > operation).
>
>Oh, I did not know this. Quite a while ago there was some discussion about
>the problem with blitting
>to the printer canvas, IIRC.

Me either until I was trying to implement the print like you suggested
using the Canvas to do the stretching. I could not get it to print so I
went on a search and found this out. I can't print most of VSTools this
way either so we are both in the same boat <G>

Jim


Editing node error - duplicate text

From: "njlo555" [njlo555@h...]
Date: Sat Mar 23, 2002 10:00 pm
Subject: Editing node error - duplicate text

Hi!

When editing a node in VT 3.1 on win98se (not win2k) something
strange happens: A little to the right of the treeview, the entered
text also appears (except the 3 first letters) on another control!?

Any hints/ideas?

Nikolaj


Storeing Objects to a Node

From: "snoopy_garfield2002" [andreas.steibl@h...]
Date: Mon Mar 25, 2002 8:53 am
Subject: Storeing Objects to a Node

What is the easiest methode for storeing classes to a Node, i would
like to store for every Node a Object, now i have a record

PVirtualInfo = ^TVirtualInfo;
TVirtualInfo = record
Data : TPMItem;
end;

and store this record to the node, and in the records ... i think you
see it ...

How can i store the Data direct into the Data of the node ?

Thanxs
Andreas

 | Replies | Author | Date
5628 | Re: Storeing Objects to a Node | Werner Lehmann | Mon 3/25/2002
5630 | Re: Storeing Objects to a Node | Marco Schlünß | Mon 3/25/2002
5634 | Re: Storeing Objects to a Node | Werner Lehmann | Tue 3/26/2002
5635 | Re: Storeing Objects to a Node | Marco Schlünß | Wed 3/27/2002


re: Storeing Objects to a Node

From: Werner Lehmann [wl@b...]
Date: Mon Mar 25, 2002 11:56 am
Subject: Re: [VirtualTreeview] Storeing Objects to a Node

snoopy_garfield2002 wrote:
>
> What is the easiest methode for storeing classes to a Node, i would
> like to store for every Node a Object, now i have a record

I use these routines. NodeDataSize must be >= SizeOf(Pointer).

//------------------------------------------------------------------------------
procedure SetObject(Tree: TBaseVirtualTree; Node: PVirtualNode; Obj: TObject);
var
Data: pointer;
begin
assert(Node <> nil);
Data := Tree.GetNodeData(Node);
assert(Data <> nil);
TObject(Data^) := Obj;
end;

//------------------------------------------------------------------------------
function GetObject(Tree: TBaseVirtualTree; Node: PVirtualNode): TObject;
var
Data: pointer;
begin
assert(Node <> nil);
Data := Tree.GetNodeData(Node);
if Data = nil then
Result := nil
else
Result := TObject(Data^);
end;

Werner


Faster Search and Replace

From: Roger MacRae [rogermacrae@c...]
Date: Mon Mar 25, 2002 3:45 pm
Subject: Faster Search and Replace

I am looking for a faster way to search and replace the contents of a node.

I have over 50000 nodes right now and it takes 20 seconds to find a given
node and then replace the contents. I am thinking that there must be a
faster to way to do it.

Any ideas would be greatly appreciated.

Thanks

 | Replies | Author | Date
5631 | Re: Faster Search and Replace | Jim Kueneman | Tue 3/26/2002
5632 | Re: Faster Search and Replace | Werner Lehmann | Tue 3/26/2002
5633 | Re: Faster Search and Replace | Roger MacRae | Tue 3/26/2002
5636 | Re: Faster Search and Replace | Werner Lehmann | Wed 3/27/2002
5645 | Re: Faster Search and Replace | benadembaba | Fri 3/29/2002


re: Storeing Objects to a Node

From: Marco Schlünß [dusty2202@y...]
Date: Mon Mar 25, 2002 7:21 pm
Subject: Re: [VirtualTreeview] Storeing Objects to a Node

be warned, if you are using objects of different classes!

> NodeDataSize must be >= SizeOf(Pointer).

it has to be

NodeDataSize must be >= 2*SizeOf(Pointer),

cause the classInformation beside the ObjectsData must have place!


re: Faster Search and Replace

From: Jim Kueneman [jimdk@m...]
Date: Tue Mar 26, 2002 12:20 am
Subject: Re: [VirtualTreeview] Faster Search and Replace

>I am looking for a faster way to search and replace the contents of a node.
>
>I have over 50000 nodes right now and it takes 20 seconds to find a given
>node and then replace the contents. I am thinking that there must be a
>faster to way to do it.
>
>Any ideas would be greatly appreciated.

I am sure looping through 50000 nodes does not take that long so the
bottleneck must be the actual comparison. In VET (VirtualExplorerTree) I
have found it is faster (usually *much* faster) to read in the nodes, do a
quicksort to sort then do a binary search to find the node. Better yet is
to keep a sorted list on the side and then do a binary search to track the
node.

Jim


re: Faster Search and Replace

From: Werner Lehmann [wl@b...]
Date: Tue Mar 26, 2002 12:43 pm
Subject: Re: [VirtualTreeview] Faster Search and Replace

Roger MacRae wrote:
>
> I am looking for a faster way to search and replace the contents of a node.
>
> I have over 50000 nodes right now and it takes 20 seconds to find a given
> node and then replace the contents. I am thinking that there must be a
> faster to way to do it.
>
> Any ideas would be greatly appreciated.

Unless for trivial small trees I am always storing just a pointer to my
own data structures in the node data area. This way I can find data much
faster (e.g. by using a sorted list and binary search as Jim pointed out).
The external data structure would have to keep a reference to the node
in many cases.

Werner

 | Replies | Author | Date
5633 | Re: Faster Search and Replace | Roger MacRae | Tue 3/26/2002


re: Faster Search and Replace

From: Roger MacRae [rogermacrae@c...]
Date: Tue Mar 26, 2002 1:29 pm
Subject: Re: [VirtualTreeview] Faster Search and Replace

>Unless for trivial small trees I am always storing just a pointer to my
>own data structures in the node data area. This way I can find data much
>faster (e.g. by using a sorted list and binary search as Jim pointed out).
>The external data structure would have to keep a reference to the node
>in many cases.

Can you provide any examples of this please?


re: Storeing Objects to a Node

From: Werner Lehmann [wl@b...]
Date: Tue Mar 26, 2002 2:04 pm
Subject: Re: [VirtualTreeview] Storeing Objects to a Node

Marco Schlünß wrote:
>
> be warned, if you are using objects of different classes!
>
> > NodeDataSize must be >= SizeOf(Pointer).
>
> it has to be
>
> NodeDataSize must be >= 2*SizeOf(Pointer),
>
> cause the classInformation beside the ObjectsData must have place!

I wonder why I can store objects in the items of a TList (as a
TObjectList also does which is derived from TList). Maybe you
should contact Borland and warn them that TObjectList is funda-
mentally flawed? ;)

Werner


re: Storeing Objects to a Node

From: Marco Schlünß [dusty2202@y...]
Date: Tue Mar 26, 2002 8:40 pm
Subject: Re: [VirtualTreeview] Storeing Objects to a Node

ups, sorry, just was trying to create an example, in Delphi 5 it just works as
you said,
but it must have been the other way before (don't know, if it was v3 oder v4),
cause i had
this issue before and built my own TObjectList.

SizeOf(TObject)=SizeOf(Pointer) says all!

very big sorry, for this misinformation, at least delphi 5 does it fine!


re: Faster Search and Replace

From: Werner Lehmann [wl@b...]
Date: Wed Mar 27, 2002 1:22 pm
Subject: Re: [VirtualTreeview] Faster Search and Replace

Hi Roger,

> >Unless for trivial small trees I am always storing just a pointer to my
> >own data structures in the node data area. This way I can find data much
> >faster (e.g. by using a sorted list and binary search as Jim pointed out).
> >The external data structure would have to keep a reference to the node
> >in many cases.
>
> Can you provide any examples of this please?

Examples for what? This is not a 3-liner and I am not going to paste excessive
amounts of my project here. Also, explaining binary search in a sorted list is
way off topic here and there are already many good sources in books and in the
internet.

Basically the approach looks something like this (example, several variations
possible): use a TObjectList to store all data (or a TList / array if you prefer
records over objects to hold node data). Each object has a field "Node:
PVirtualNode"
and your other node property fields (column data and whatever you need). To init
VT nodes you use only the object contained in the object list, hence the node
data
size is 4 bytes. You can use GetObject / SetObject routines which I posted
recently
in this YG.

Usually I have a constructor in the object which takes a parent node. When the
object
is created it adds a node to the VT under this parent, and provides this node
with one
of its properties:

TNodeData = class
private
FNode: PVirtualNode;

// Remove or uninit previous node if <> nil, then init new node with ANode
and
// set FNode. Only if you need to change the Node, of course.
procedure SetNode(ANode: PVirtualNode);
public
constructor Create(ParentNode: PVirtualNode);
destructor Destroy; override; // You could delete or uninit the node here
if you want
property Node: PVirtualNode read FNode write SetNode;
end;

You can also add a constructor parameter for the object list and the new node
adds
itself to the list. Adding a node could then be as easy as creating a new
instance
of TNodeData.

This approach allows you to easily loop through the data list to work with it.
(One advantage is that you don't tie the data to the tree - you can have data
objects without corresponding node in the tree.)

To find a particular item in the list the usual search algorithms apply. In many
cases the cited BinSearch suffices. This requires a sorted list and needs very
few steps to find a particular item. If you rarely search for an item it is
advisable to sort the list before you do the search, if you frequently need to
search for an item, keep the list sorted at all times (that is resort it after
each item added or, preferably, insert items at the correct sorted position,
which can be found easily with BinSearch. If you have the VCL source, look at
the
implementation of TStringList when Sorted := true. You can borrow the binsearch
code from it, too.)

It is also possible to keep some parallel index lists to sort the list over
different sort criteria if you need that.

Once you have found the item you need you could provide its Node member to the
VT method ScrollIntoView or whatever you like to do with it. This approach will
find items in your 50k list within some fractions of a second.

Werner


Please help

From: Roger MacRae [rogermacrae@c...]
Date: Wed Mar 27, 2002 9:25 pm
Subject: Please help

ok I am very confused and I can't seem to find alot of info or help.

It has been said on this list that using a stringlist to store my data will
increase the speed in which I can work with my data. I have searched
through the archives and scoured the internet and have yet to find out how
to do this.

The other thing that confuses me is how applying said method will improve
anything. Won't it increase the memory overhead. Take my grid for example.
If I understand all this correctly I have over 50000 nodes but when you
multiply that by the number of columns then I have over 350000 nodes. If I
took all that data and stored it in string lists then wouldn't the only
thing that I accomplish be that I am increasing my overhead to 700000?

Very confused

 | Replies | Author | Date
5638 | Re: Please help | Marco Rocci | Wed 3/27/2002
5639 | Re: Please help | Roger MacRae | Wed 3/27/2002
5641 | Re: Please help | Jim Kueneman | Thu 3/28/2002
5642 | Re: Please help | Roger MacRae | Thu 3/28/2002
5640 | Re: Please help | Werner Lehmann | Wed 3/27/2002


re: Please help

From: Marco Rocci [mrocci@t...]
Date: Wed Mar 27, 2002 9:54 pm
Subject: Re: [VirtualTreeview] Please help

On Wed, 27 Mar 2002 16:25:47 -0500, Roger MacRae [rogermacrae@c...]
wrote:

>ok I am very confused and I can't seem to find alot of info or help.
>
>It has been said on this list that using a stringlist to store my data will
>increase the speed in which I can work with my data. I have searched
>through the archives and scoured the internet and have yet to find out how
>to do this.

The point is that with that many nodes you cannot think that a sequential seek
is
optimized, so you need some external structure that works like an index.

>The other thing that confuses me is how applying said method will improve
>anything. Won't it increase the memory overhead. Take my grid for example.
>If I understand all this correctly I have over 50000 nodes but when you
>multiply that by the number of columns then I have over 350000 nodes. If I
>took all that data and stored it in string lists then wouldn't the only
>thing that I accomplish be that I am increasing my overhead to 700000?

You haven't yet stated what data you're associating with the nodes. Where are
you keeping
the contents of those 7 columns? Are you using a StringTree or a DrawTree?
What is
supporting each node? An object? A record? Do you only have those 7 text
properties or
do you have something else? What are you stuffing in the node data?

Anyway... you don't actually need to duplicate all the data... just the one you
want to
use to find nodes. Just like you don't typically need indexes on every column
of a table.
Do you need to search on any column? Maybe you could index just one column and
rebuild
the index if the user needs to search on another column. This index structure
just needs
to contain two things... an index key and a pointer to something that allows
you to reach
the tree node you're interested in.

Regards,

--
Marco Rocci
MicroEra srl
Turin, Italy

 | Replies | Author | Date
5639 | Re: Please help | Roger MacRae | Wed 3/27/2002
5641 | Re: Please help | Jim Kueneman | Thu 3/28/2002
5642 | Re: Please help | Roger MacRae | Thu 3/28/2002


re: Please help

From: Roger MacRae [rogermacrae@c...]
Date: Wed Mar 27, 2002 10:48 pm
Subject: Re: [VirtualTreeview] Please help

>You haven't yet stated what data you're associating with the nodes.

Sorry I am just associating plain text.

> Where are you keeping
>the contents of those 7 columns?

I am keeping it all in my record right now. I am not sure if that is the
right or wrong thing to do.
type
PGridData = ^TGridData;
TGridData = record
DataCol: array [0..50] of String;
end;

> Are you using a StringTree or a DrawTree?

Actually I am using a GridTree which is a descendant of StringTree.

> What is
>supporting each node? An object? A record?

A Record.

> Do you only have those 7 text properties or
>do you have something else? What are you stuffing in the node data?

All text. Everything that is stored is text.

>Anyway... you don't actually need to duplicate all the data... just the
>one you want to
>use to find nodes. Just like you don't typically need indexes on every
>column of a table.
>Do you need to search on any column?

Yes I need to be able to search on any column. My app will allow for
various search criteria which could be based on just one column or all
columns at the same time.

> Maybe you could index just one column and rebuild
>the index if the user needs to search on another column. This index
>structure just needs
>to contain two things... an index key and a pointer to something that
>allows you to reach
>the tree node you're interested in.

To constantly reindex would slow down my app don't you think? The reason I
started using vt in the first place was for speed and low memory overhead.

Sorry if I sound like I am arguing here but the whole indexing thing has
got me at a stand still. Up until I started trying to search through all
nodes for a given string everything was going fine. I can get to any
specific node with ease. That is not a problem. Right now I am just trying
to find a given string:

here is an example of what I am doing right now:

The user wants to find all items associated with Main Item 13459 and change
it's description to NONE
To find all those items every node in column 7 needs to be checked to see
it = 13459.
The way I do this now is to do the following:

Node := GetFirst;
For I := 1 to RootNodeCount-1 do
If Assigned(Node) then
begin
FGridData := PGridData(GetNodeData(Node));
CellText := FGridData.DataCol[7];
If (CellText = '13459') then FGridData.DataCol[3] := 'NONE';
Node := Node.NextSibling;
end;

Sorry if everything I am doing seems wrong but the documentation for vt
isn't great and the ways I am doing all this stuff works for me. Even this
search and replace works, it just doesn't work as fast as I had hoped it
would. Right now it takes 10 to 20 seconds to do this.

 | Replies | Author | Date
5641 | Re: Please help | Jim Kueneman | Thu 3/28/2002
5642 | Re: Please help | Roger MacRae | Thu 3/28/2002


re: Please help

From: Werner Lehmann [wl@b...]
Date: Wed Mar 27, 2002 11:29 pm
Subject: Re: [VirtualTreeview] Please help

Roger MacRae wrote:
>
> The user wants to find all items associated with Main Item 13459 and change
> it's description to NONE
> To find all those items every node in column 7 needs to be checked to see
> it = 13459.
> The way I do this now is to do the following:
>
> Node := GetFirst;
> For I := 1 to RootNodeCount-1 do
> If Assigned(Node) then
> begin
> FGridData := PGridData(GetNodeData(Node));
> CellText := FGridData.DataCol[7];
> If (CellText = '13459') then FGridData.DataCol[3] := 'NONE';
> Node := Node.NextSibling;
> end;
>
> Sorry if everything I am doing seems wrong but the documentation for vt
> isn't great and the ways I am doing all this stuff works for me. Even this
> search and replace works, it just doesn't work as fast as I had hoped it
> would. Right now it takes 10 to 20 seconds to do this.

Ok, I overlooked that you wanted to replace. But BinSearch helps here too.
You only need to find the first 13459 (fast) and all others would be in
subsequent order (even faster).

BTW, I never said that you would have to use a TStringList. Also, I did not
say that you must duplicate your data.

Werner


re: Please help

From: Jim Kueneman [jimdk@m...]
Date: Thu Mar 28, 2002 3:42 am
Subject: Re: [VirtualTreeview] Please help

Hi Roger,

>Sorry if everything I am doing seems wrong but the documentation for vt

No your issue is not really VT but how to search. You would have the same
issue with TTreeview/TListview (likely worse since you have to deal with
the Items property)

>isn't great and the ways I am doing all this stuff works for me. Even this
>search and replace works, it just doesn't work as fast as I had hoped it
>would. Right now it takes 10 to 20 seconds to do this.

The YG file area seems to be having problems so I put this on my website:

http://www.mindspring.com/~jimdk/HugeTreeSearch.zip

It does what you outlined but it will find and set

FGridData.DataCol[3] := 'NONE' to the target search string(s) and a few
dozen target string matches

in just a few milliseconds with 50000 nodes:

It shows the power of VT being able to separate the Data from the UI. It
has only a small overhead, an integer stored in each node to point to the
index of the associated data in the TList and a pointer added to your
record to point the record back to the associated Node.

Jim

 | Replies | Author | Date
5642 | Re: Please help | Roger MacRae | Thu 3/28/2002


re: Please help

From: Roger MacRae [rogermacrae@c...]
Date: Thu Mar 28, 2002 3:41 am
Subject: Re: [VirtualTreeview] Please help

> >Sorry if everything I am doing seems wrong but the documentation for vt
>
>No your issue is not really VT but how to search. You would have the same
>issue with TTreeview/TListview (likely worse since you have to deal with
>the Items property)
>
> >isn't great and the ways I am doing all this stuff works for me. Even this
> >search and replace works, it just doesn't work as fast as I had hoped it
> >would. Right now it takes 10 to 20 seconds to do this.
>
>The YG file area seems to be having problems so I put this on my website:
>
>http://www.mindspring.com/~jimdk/HugeTreeSearch.zip
>
>It does what you outlined but it will find and set
>
>FGridData.DataCol[3] := 'NONE' to the target search string(s) and a few
>dozen target string matches
>
>in just a few milliseconds with 50000 nodes:
>
>It shows the power of VT being able to separate the Data from the UI. It
>has only a small overhead, an integer stored in each node to point to the
>index of the associated data in the TList and a pointer added to your
>record to point the record back to the associated Node.

Thanks man. Will take a look and see if I can wrap my head around it.


TreeView problem?

From: "marc_g_69" [marc_g_69@y...]
Date: Thu Mar 28, 2002 10:59 am
Subject: TreeView problem?

Hi...

Situation:

I have a TMaskEdit control (in witch I store a DateTime value)with an
OnExitEvent assigned. I looks like this:

procedure TLog.MEDataStartExit(Sender: TObject);
begin
inherited;
MyRefresh();
end;

procedure TLog.MyRefresh();
begin
VSTreeView.Clear;
DM.LogCds.Filtered := False;

DM.m_LogDataStart := StrToDateTime(MEDataStart.Text);
DM.m_LogDataStop := StrToDateTime(MEDataStop.Text);

DM.LogCds.Filtered := True;
VSTreeView.RootNodeCount := DM.LogCds.RecordCount;
end;

And I have a ClientDataSet in the Data Module (LogCds) with an
associated OnFilterRecordEvent.It looks like this:

procedure TDM.LogCdsFilterRecord(DataSet: TDataSet; var Accept:
Boolean);
begin
Accept := ((m_LogDataStart <= DataSet.FieldByName
('Data').AsDateTime) and
(DataSet.FieldByName('Data').AsDateTime <
(m_LogDataStop + 1))

end;

The problem is that when I edit something in the MaskEdit control and
I select some node in the VSTreeView (the OnExitEvent is triggered
for the MaskEdit) -> Access Violation. I have in the OnInitNodeEvent
something like this

if VSTreeView.RootNodeCount = 0 then Exit;
Data := Sender.GetNodeData(Node);
Initialize(Data^);
try
DM.LogCds.RecNo := Node.Index+1;

Data.User := DM.LogCds.FieldByName('User').AsString;

.....

I had here for Node.Index a value of 535456565 (a have only 20 nodes
in the tree :)...)

There is no problem if I set focus on another control (It seems the
problem appears only when the next control is the VSTreeView).

Can you help me with this problem?
Thanks...

Congratulations Mike for the brilliant component...
Best regards, Radu from Romania.


VirtualDBTree Delphi demos?

From: "Todor Huklev" [todhouk@i...]
Date: Thu Mar 28, 2002 2:22 pm
Subject: VirtualDBTree Delphi demos?

Where can I find the VirtualDBTree Delphi demos ?

[Non-text portions of this message have been removed]


re: Faster Search and Replace

From: "benadembaba" [adembaba@e...]
Date: Mon Mar 25, 2002 11:35 pm
Subject: Re: Faster Search and Replace

--- In [VirtualTreeview@y...], Roger MacRae [rogermacrae@c...] wrote:
> I am looking for a faster way to search and replace the contents of
a node.
>
> I have over 50000 nodes right now and it takes 20 seconds to
> find a given node and then replace the contents. I am thinking
> that there must be a faster to way to do it.

Odd. This can not be due to VT itself, it must be to do
with the way you are storing your data.

Cheers,
Adem


Access Viloation when Accessing a MemoryStream dain the node'sdata

From: "shpatmorina" [bipbip@h...]
Date: Fri Mar 29, 2002 4:43 pm
Subject: Access Viloation when Accessing a MemoryStream dain the node'sdata

The Data of the nodes is this:

PDialogData = ^TDialogData;
TDialogData = record
ConvStrings: TMemoryStream;
Disappear, IsExitNode: Boolean;
end;

and here are the events:

procedure Tmainn.trDialogFreeNode(Sender: TBaseVirtualTree;
Node: PVirtualNode);
var
Data: PDialogData;
begin
Data := trDialog.GetNodeData(Node);
Finalize(Data^);
Data.ConvStrings.Free;
Data.ConvStrings := nil;
end;

GetNodeDataSize:
begin
NodeDataSize := SizeOf(TDialogData)
end;

procedure Tmainn.trDialogInitNode(Sender: TBaseVirtualTree; ParentNode,
Node: PVirtualNode; var InitialStates: TVirtualNodeInitStates);
var
DDPtr: PDialogData;
begin
DDPtr:=TrDialog.GetNodeData(Node);
Initialize(DDPtr^);
DDPtr^.IsExitNode := False;
DDPtr^.Disappear := False;
DDPtr^.ConvStrings:= TMemoryStream.Create;
end;

and, this is the OnChange event of the VT, in which I get the error(s):
procedure Tmainn.trDialogChange(Sender: TBaseVirtualTree;
Node: PVirtualNode);
begin
if Node = nil then exit;
edChoice.Text :=trDialog.Text[Node, trDialog.FocusedColumn];
Label1.Caption := IntToStr(Node.Index);
ChExitNode.Checked := PDialogData(trDialog.GetNodeData(Node)).IsExitNode;
ChDisappear.Checked := PDialogData(trDialog.GetNodeData(Node)).Disappear;

eaLines.Strings.LoadFromStream(PDialogData(trDialog.GetNodeData(Node)).ConvStrin\
gs);
end;

I get an error when trying to access the MemoryStream in the last line. But I
DO NOT get an error when I access the Booleans.
What have I done wrong ? Have I not added everything neccesary ? Any Ideas ?
Thanks in advance,..

 | Replies | Author | Date
5651 | Re: Access Viloation when Accessing a MemoryStrea | Jim Kueneman | Sun 3/31/2002
5655 | Re: Access Viloation when Accessing a MemoryStrea | shpatmorina | Tue 4/2/2002
5658 | Re: Access Viloation when Accessing a MemoryStrea | Jim Kueneman | Wed 4/3/2002
5660 | Re: Access Viloation when Accessing a MemoryStrea | shpatmorina | Wed 4/3/2002
5663 | Re: Access Viloation when Accessing a MemoryStrea | Jim Kueneman | Fri 4/5/2002
5665 | Re: Access Viloation when Accessing a MemoryStrea | shpatmorina | Fri 4/5/2002
5670 | Re: Access Viloation when Accessing a MemoryStrea | jimkueneman | Sat 4/6/2002
5672 | Re: Access Viloation when Accessing a MemoryStrea | shpatmorina | Sat 4/6/2002
5674 | Re: Access Viloation when Accessing a MemoryStrea | Jim Kueneman | Sat 4/6/2002


VT v313

From: Radu Mihai [marc_g_69@y...]
Date: Sat Mar 30, 2002 8:07 am
Subject: VT v313

Hi,

Can anybody tell me where I can find the required
package Win32API in the new version of the
VirtualTreeView? I seems that the version 304 didn't
needed it. I compiled the package without the
Win32API, and it worked. But the application crashed.
I had a form with a normal ListView and I had Access
Violation in kernel32.dll when I moved the mouse on
the header of the ListView... Is there a problem with
the new version? or did I did something wrong...?
Thanks...

__________________________________________________
Do You Yahoo!?
Yahoo! Greetings - send holiday greetings for Easter, Passover
http://greetings.yahoo.com/

 | Replies | Author | Date
5648 | Re: VT v313 | Gabriel Padilla | Sat 3/30/2002


re: VT v313

From: "Gabriel Padilla" [gpadilla@s...]
Date: Sat Mar 30, 2002 9:42 am
Subject: RE: [VirtualTreeview] VT v313

I just removed the reference and it recompiled.

Gabriel
-----Original Message-----
From: Radu Mihai [mailto:[marc_g_69@y...]]
Sent: Saturday, March 30, 2002 12:08 AM
To: VirtualTreeview@yahoogroups.com
Subject: [VirtualTreeview] VT v313

Hi,

Can anybody tell me where I can find the required
package Win32API in the new version of the
VirtualTreeView? I seems that the version 304 didn't
needed it. I compiled the package without the
Win32API, and it worked. But the application crashed.
I had a form with a normal ListView and I had Access
Violation in kernel32.dll when I moved the mouse on
the header of the ListView... Is there a problem with
the new version? or did I did something wrong...?
Thanks...

__________________________________________________
Do You Yahoo!?
Yahoo! Greetings - send holiday greetings for Easter, Passover
http://greetings.yahoo.com/

Yahoo! Groups Sponsor
ADVERTISEMENT

To unsubscribe from this group, send an email to:
VirtualTreeview-unsubscribe@egroups.com

Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.

[Non-text portions of this message have been removed]


Node Hints

From: "snoopy_garfield2002" [andreas.steibl@h...]
Date: Sat Mar 30, 2002 10:07 am
Subject: Node Hints

How does this with the Node Hints work ?
I have written a OnGetHint but this function is never be called.
What proeprties has i to set to can use this ?

regards
Andreas

 | Replies | Author | Date
5650 | Re: Node Hints | Werner Lehmann | Sun 3/31/2002


re: Node Hints

From: Werner Lehmann [wl@b...]
Date: Sun Mar 31, 2002 12:15 am
Subject: Re: [VirtualTreeview] Node Hints

snoopy_garfield2002 wrote:
>
> How does this with the Node Hints work ?
> I have written a OnGetHint but this function is never be called.
> What proeprties has i to set to can use this ?

HintMode should be <> hmTooltip. ShowHint should be true (unless parent
allows hint and ParentShowHint is true).

Werner


re: Access Viloation when Accessing a MemoryStream dain the node'sdata

From: Jim Kueneman [jimdk@m...]
Date: Sun Mar 31, 2002 6:25 am
Subject: Re: [VirtualTreeview] Access Viloation when Accessing a MemoryStream dain the node'sdata

Hi,

>I get an error when trying to access the MemoryStream in the last line.
>But I DO NOT get an error when I access the Booleans.
>What have I done wrong ? Have I not added everything neccesary ? Any Ideas ?
>Thanks in advance,..

You must have something wrong with the stream. What you have posted works
fine for me.

Jim

 | Replies | Author | Date
5655 | Re: Access Viloation when Accessing a MemoryStrea | shpatmorina | Tue 4/2/2002
5658 | Re: Access Viloation when Accessing a MemoryStrea | Jim Kueneman | Wed 4/3/2002
5660 | Re: Access Viloation when Accessing a MemoryStrea | shpatmorina | Wed 4/3/2002
5663 | Re: Access Viloation when Accessing a MemoryStrea | Jim Kueneman | Fri 4/5/2002
5665 | Re: Access Viloation when Accessing a MemoryStrea | shpatmorina | Fri 4/5/2002
5670 | Re: Access Viloation when Accessing a MemoryStrea | jimkueneman | Sat 4/6/2002
5672 | Re: Access Viloation when Accessing a MemoryStrea | shpatmorina | Sat 4/6/2002
5674 | Re: Access Viloation when Accessing a MemoryStrea | Jim Kueneman | Sat 4/6/2002


using AddChild( PVirtualNode, Void *)

From: "el_guapo5" [rhymebusta@h...]
Date: Sun Mar 31, 2002 11:02 pm
Subject: using AddChild( PVirtualNode, Void *)

hi i had been using VirtualTree 2.4(on Borland C++ Builder) for a
long while and am now porting it to v3.1 and i have come across some
issues.

the old implementation of AddChild was that it returned a
PVirtualNode while being passed the parent of the returned
PVirtualNode. Now i noticed that AddChild takes in a "Void *" that
references the user data.
what i was wondering if i could still leave my code so that i get the
node data using "node_data = VirtualStringTree1->GetNodeData(...)"
and then set the "node_data" to be whatever i want. OR do i have to
set the data first and then pass it in?
if i don't pass anything in would it still work or does the node have
to have some initial data?

 | Replies | Author | Date
5653 | Re: using AddChild( PVirtualNode, Void *) | Jim Kueneman | Mon 4/1/2002


re: using AddChild( PVirtualNode, Void *)

From: Jim Kueneman [jimdk@m...]
Date: Mon Apr 1, 2002 12:32 am
Subject: Re: [VirtualTreeview] using AddChild( PVirtualNode, Void *)

Hi,

>hat i was wondering if i could still leave my code so that i get the
>node data using "node_data = VirtualStringTree1->GetNodeData(...)"
>and then set the "node_data" to be whatever i want. OR do i have to
>set the data first and then pass it in?

The new param is completely optional. I was only to allow one to skip that
step if they only had a 4 byte value to be stored.

Jim


Small bug in 3.1.3 auto column size using ctrl+

From: "krazy.rm" [krazy@r...]
Date: Tue Apr 2, 2002 2:14 am
Subject: Small bug in 3.1.3 auto column size using ctrl+

procedure TVirtualTreeColumns.AnimatedResize(Column: TColumnIndex;
NewWidth: Integer);

If the NewWidth is smaller than the FMithWidth the column is resized
to NewWidth and on repaint is forced back to FMithWidth, the result
is very undesirable.

A simple solution would be to add the following line to insure the
new width is atlest FMinWidth.

if NewWidth < Items[Column].FMinWidth then
NewWidth := Items[Column].FMinWidth;

Regards,
Charles DeWeese

 | Replies | Author | Date
5675 | Re: Small bug in 3.1.3 auto column size using ctr | Mike Lischke | Sat 4/6/2002


re: Access Viloation when Accessing a MemoryStream dain the node'sdata

From: "shpatmorina" [bipbip@h...]
Date: Tue Apr 2, 2002 3:22 pm
Subject: Re: Access Viloation when Accessing a MemoryStream dain the node'sdata

--- In [VirtualTreeview@y...], Jim Kueneman [jimdk@m...] wrote:
>
> Hi,
>
> >I get an error when trying to access the MemoryStream in the last line.
> >But I DO NOT get an error when I access the Booleans.
> >What have I done wrong ? Have I not added everything neccesary ? Any Ideas ?
> >Thanks in advance,..
>
>
> You must have something wrong with the stream. What you have posted works
> fine for me.
>
> Jim

Well, I use(d) the memory stream to save a String List, but ince I could, I
changed it to a simple AnsiString (I'll save TStrings.Text in it), but it still
doesn't work. Access violation.
I access the string with this line of code in the OnChange event of the VT:
eaLines.Strings.Text:=PDialogData(trDialog.GetNodeData(Node)).ConvStrings;
eaLines is a ValueListEditor, a new component in Delphi 6.
....
so ?

 | Replies | Author | Date
5658 | Re: Access Viloation when Accessing a MemoryStrea | Jim Kueneman | Wed 4/3/2002
5660 | Re: Access Viloation when Accessing a MemoryStrea | shpatmorina | Wed 4/3/2002
5663 | Re: Access Viloation when Accessing a MemoryStrea | Jim Kueneman | Fri 4/5/2002
5665 | Re: Access Viloation when Accessing a MemoryStrea | shpatmorina | Fri 4/5/2002
5670 | Re: Access Viloation when Accessing a MemoryStrea | jimkueneman | Sat 4/6/2002
5672 | Re: Access Viloation when Accessing a MemoryStrea | shpatmorina | Sat 4/6/2002
5674 | Re: Access Viloation when Accessing a MemoryStrea | Jim Kueneman | Sat 4/6/2002


re: FontChange handling in subclasses

From: "Mike Lischke" [lists@l...]
Date: Tue Apr 2, 2002 5:52 pm
Subject: RE: [VirtualTreeview] FontChange handling in subclasses

Marco,

> I was just wondering if this is correct... I mean this code is used
> only in the StringTree, but it is implemented in the BaseVirtualTree
> as private.

Well, the implementation is in the base tree because it is closely related to
the paint events.

>To use it in a DrawTree subclass I have to modify
> TBaseVirtualTree so as to expose some things:

OK, I have done this exposure. You will get it with the next update.

> BTW - my compliments to Mike for this very useful component.

Thank you :-)

Ciao, Mike
--
www.delphi-gems.com
www.lischke-online.de
www.delphi-unicode.net


re: painting anomaly on expand

From: "Mike Lischke" [lists@l...]
Date: Tue Apr 2, 2002 6:28 pm
Subject: RE: [VirtualTreeview] painting anomaly on expand

Dion,

> May I attach an image of less than 20K to illustate a situation?

You can send it directly to me. Also look into the file area of YG. There is a
folder for images and
debugging.

Ciao, Mike
--
www.delphi-gems.com
www.lischke-online.de
www.delphi-unicode.net


re: Re: Access Viloation when Accessing a MemoryStream dain the node'sdata

From: Jim Kueneman [jimdk@m...]
Date: Wed Apr 3, 2002 12:30 am
Subject: Re: [VirtualTreeview] Re: Access Viloation when Accessing a MemoryStream dain the node'sdata

>Well, I use(d) the memory stream to save a String List, but ince I could,
>I changed it to a simple AnsiString (I'll save TStrings.Text in it), but
>it still doesn't work. Access violation.
>I access the string with this line of code in the OnChange event of the VT:
>eaLines.Strings.Text:=PDialogData(trDialog.GetNodeData(Node)).ConvStrings;
>eaLines is a ValueListEditor, a new component in Delphi 6.

Can you make a demo that has the problem so I can look at it? Post it the
the Yahoo Groups files area.

Jim

 | Replies | Author | Date
5660 | Re: Access Viloation when Accessing a MemoryStrea | shpatmorina | Wed 4/3/2002
5663 | Re: Access Viloation when Accessing a MemoryStrea | Jim Kueneman | Fri 4/5/2002
5665 | Re: Access Viloation when Accessing a MemoryStrea | shpatmorina | Fri 4/5/2002
5670 | Re: Access Viloation when Accessing a MemoryStrea | jimkueneman | Sat 4/6/2002
5672 | Re: Access Viloation when Accessing a MemoryStrea | shpatmorina | Sat 4/6/2002
5674 | Re: Access Viloation when Accessing a MemoryStrea | Jim Kueneman | Sat 4/6/2002


Small column bug

From: "jaschagordon" [jascha@c...]
Date: Wed Apr 3, 2002 9:50 am
Subject: Small column bug

Mike,

I found a very small bug in the VT columns (Version 3.1.3) that
causes the parent color option to be ignored when using a treeview in
a frame on a descendant form! In Assign, you need to set the Options
property after the Color property to allow the coParentColour option
to work correctly.

Regards and thanks for the best freeware I've used,

Jascha

procedure TVirtualTreeColumn.Assign(Source: TPersistent);

begin
if Source is TVirtualTreeColumn then
begin
BiDiMode := TVirtualTreeColumn(Source).BiDiMode;
ImageIndex := TVirtualTreeColumn(Source).ImageIndex;
Layout := TVirtualTreeColumn(Source).Layout;
Margin := TVirtualTreeColumn(Source).Margin;
MaxWidth := TVirtualTreeColumn(Source).MaxWidth;
MinWidth := TVirtualTreeColumn(Source).MinWidth;
Position := TVirtualTreeColumn(Source).Position;
Spacing := TVirtualTreeColumn(Source).Spacing;
Style := TVirtualTreeColumn(Source).Style;
Text := TVirtualTreeColumn(Source).Text;
Hint := TVirtualTreeColumn(Source).Hint;
Width := TVirtualTreeColumn(Source).Width;
Alignment := TVirtualTreeColumn(Source).Alignment;
Color := TVirtualTreeColumn(Source).Color;
//***
Options := TVirtualTreeColumn(Source).Options; {DJG move after
color assignment to allow parent color option to work correctly}
//***

Changed(False);
end
else
inherited Assign(Source);
end;

 | Replies | Author | Date
5676 | Re: Small column bug | Mike Lischke | Sat 4/6/2002


re: Access Viloation when Accessing a MemoryStream dain the node'sdata

From: "shpatmorina" [bipbip@h...]
Date: Wed Apr 3, 2002 3:27 pm
Subject: Re: Access Viloation when Accessing a MemoryStream dain the node'sdata

> Can you make a demo that has the problem so I can look at it? Post it the
> the Yahoo Groups files area.
>
> Jim

OK, I've uploaded the whole program ( since it is going to be freeare anyway, I
don't really care about the code, I just want it to work, and the users to like
it), but I'm not sure you'll understand much.
Its an application for making dialogs for a programming language for making
adventure games ( called AGAST )
http://groups.yahoo.com/group/VirtualTreeview/files/Dialobog.zip

It uses the RxLib Components, and some others in the about box that you don't
need anyway... and also in the code generation form there is a memo called
SyntaxMemo or something like that...
To see the problem, ( if you can compile it ) add some nodes by right clicking
and clicking 'New Dialog Choice', and then click one of them, change the value
of the ValueListEditor, switch to another node, and then switch back to the
node with the changed value.
I really hope that was enough.
Later...

 | Replies | Author | Date
5663 | Re: Access Viloation when Accessing a MemoryStrea | Jim Kueneman | Fri 4/5/2002
5665 | Re: Access Viloation when Accessing a MemoryStrea | shpatmorina | Fri 4/5/2002
5670 | Re: Access Viloation when Accessing a MemoryStrea | jimkueneman | Sat 4/6/2002
5672 | Re: Access Viloation when Accessing a MemoryStrea | shpatmorina | Sat 4/6/2002
5674 | Re: Access Viloation when Accessing a MemoryStrea | Jim Kueneman | Sat 4/6/2002


Strange AV resulting from JwaUxTheme

From: "fransbouwmans" [frans.bouwmans@z...]
Date: Thu Apr 4, 2002 2:21 pm
Subject: Strange AV resulting from JwaUxTheme

Hi,
Suddenly, my application in which I use a virtualstringtree generates
an AV when showing a form with a TListView with viewstyle vsReport.
I narrowed this down to the point that without any virtualtreeviews
in my application, just "using" the unit JwaUxTheme.pas does the
trick.
This seems very strange because no single function is called in this
module, just the initialisation which creates a critical section.

Spending some more time, I've found that removing the line
{$R WinXP.res}
solves my problem, don't know why but it does.

Frans Bouwmans

 | Replies | Author | Date
5662 | Re: Strange AV resulting from JwaUxTheme | Werner Lehmann | Thu 4/4/2002
5664 | Re: Strange AV resulting from JwaUxTheme | fransbouwmans | Fri 4/5/2002


re: Strange AV resulting from JwaUxTheme

From: Werner Lehmann [wl@b...]
Date: Thu Apr 4, 2002 7:31 pm
Subject: Re: [VirtualTreeview] Strange AV resulting from JwaUxTheme

Hi fransbouwmans,

> Spending some more time, I've found that removing the line
> {$R WinXP.res}
> solves my problem, don't know why but it does.

there is a known error with TListview and WinXP themes. And themes
are activated by this resource probably. You may want to search the
usenet with fulltextsearch.com to find some postings related to the
problem, including some VCL patches for TListview.

Werner

 | Replies | Author | Date
5664 | Re: Strange AV resulting from JwaUxTheme | fransbouwmans | Fri 4/5/2002


re: Re: Access Viloation when Accessing a MemoryStream dain the node'sdata

From: Jim Kueneman [jimdk@m...]
Date: Fri Apr 5, 2002 12:23 am
Subject: Re: [VirtualTreeview] Re: Access Viloation when Accessing a MemoryStream dain the node'sdata

Hi,

>To see the problem, ( if you can compile it ) add some nodes by right
>clicking and clicking 'New Dialog Choice', and then click one of them,
>change the value of the ValueListEditor, switch to another node, and then
>switch back to the node with the

Almost, what is this:

eaLines: TValueListEditor; ??? Apparently I need it <g>

Jim

 | Replies | Author | Date
5665 | Re: Access Viloation when Accessing a MemoryStrea | shpatmorina | Fri 4/5/2002
5670 | Re: Access Viloation when Accessing a MemoryStrea | jimkueneman | Sat 4/6/2002
5672 | Re: Access Viloation when Accessing a MemoryStrea | shpatmorina | Sat 4/6/2002
5674 | Re: Access Viloation when Accessing a MemoryStrea | Jim Kueneman | Sat 4/6/2002


re: Strange AV resulting from JwaUxTheme

From: "fransbouwmans" [frans.bouwmans@z...]
Date: Fri Apr 5, 2002 5:58 am
Subject: Re: Strange AV resulting from JwaUxTheme

> there is a known error with TListview and WinXP themes. And themes
> are activated by this resource probably. You may want to search the
> usenet with fulltextsearch.com to find some postings related to the
> problem, including some VCL patches for TListview.

I did find some remark on Mike's site. It says that the problem is
solved with update pack 2 for Delphi. Probably this is for Delphi 6
because for Delphi 5 there is no update pack 2 (I'm using Delphi 5E
on windows XP).
For now I solved the problem by using the JwaUxTheme from a previous
release (2.6.5) which does not show the problem.

Frans Bouwmans


re: Access Viloation when Accessing a MemoryStream dain the node'sdata

From: "shpatmorina" [bipbip@h...]
Date: Fri Apr 5, 2002 2:27 pm
Subject: Re: Access Viloation when Accessing a MemoryStream dain the node'sdata

> Almost, what is this:
>
> eaLines: TValueListEditor; ??? Apparently I need it <g>
>
> Jim

It's a component that comes with Delphi 6, it get a stringlist and divides the
.Names and Values into two columns
it isn't that important. Just replace it with a memo (and don't forget its
events)

Later..... again.

 | Replies | Author | Date
5670 | Re: Access Viloation when Accessing a MemoryStrea | jimkueneman | Sat 4/6/2002
5672 | Re: Access Viloation when Accessing a MemoryStrea | shpatmorina | Sat 4/6/2002
5674 | Re: Access Viloation when Accessing a MemoryStrea | Jim Kueneman | Sat 4/6/2002


New file uploaded to VirtualTreeview

From: VirtualTreeview@yahoogroups.com
Date: Fri Apr 5, 2002 4:50 pm
Subject: New file uploaded to VirtualTreeview

Hello,

This email message is a notification to let you know that
a file has been uploaded to the Files area of the VirtualTreeview
group.

File : /VirtualTreesPatch3.zip
Uploaded by : mikelischke [lists@l...]
Description : VT Patch 3

You can access this file at the URL

http://groups.yahoo.com/group/VirtualTreeview/files/VirtualTreesPatch3.zip

To learn more about file sharing for your group, please visit

http://help.yahoo.com/help/us/groups/files

Regards,

mikelischke [lists@l...]

 | Replies | Author | Date
5667 | Re: New file uploaded to VirtualTreeview | Mike Lischke | Fri 4/5/2002


re: New file uploaded to VirtualTreeview

From: "Mike Lischke" [lists@l...]
Date: Fri Apr 5, 2002 5:05 pm
Subject: RE: [VirtualTreeview] New file uploaded to VirtualTreeview

Hi all,

> This email message is a notification to let you know that
> a file has been uploaded to the Files area of the VirtualTreeview
> group.

This is the latest patch of VT with a few enhancements:

- Limited drag over hits in report mode (very much like in TListView).
- Standard splitter cursor included.
- Font change events and methods for painting are now in the protected section.

Ciao, Mike
--
www.delphi-gems.com
www.lischke-online.de
www.delphi-unicode.net


How to show colums in VirtualDBtree

From: [fribur@w...]
Date: Sat Apr 6, 2002 5:04 am
Subject: How to show colums in VirtualDBtree

Hi All,

Im would like to show a few colums in my TSimpleVirtualDBTree.
What is the easy en the best approach?
as far as i understand I don't have my own Node.data with DBVT
should i make my own descendant?

Im using
VirtualTreeView version 3.1.3
Delphi 6.02 Prof
DBVT with the cyrilic chars. (22-10-2001?) a version nr should be nice

[Non-text portions of this message have been removed]


Found a new interpreted language!

From: "babbouux" [babbouux@y...]
Date: Fri Apr 5, 2002 11:52 pm
Subject: Found a new interpreted language!

I am since a long time a delphi programmer

I find this product very interesting. I can execute interpreted code
directly on my PC microprocessor

http://www.hyperpanel.com/boot_direct.php3?ID=11500405

 | Replies | Author | Date
5671 | Re: Found a new interpreted language! | Mike Lischke | Sat 4/6/2002


re: Access Viloation when Accessing a MemoryStream dain the node'sdata

From: "jimkueneman" [jimdk@m...]
Date: Sat Apr 6, 2002 2:39 am
Subject: Re: Access Viloation when Accessing a MemoryStream dain the node'sdata

Hi,

> It's a component that comes with Delphi 6, it get a stringlist and
divides the .Names and Values into two columns
> it isn't that important. Just replace it with a memo (and don't
forget its events)
>

Ok, better read up on mixing PChar's and Delphi strings <G>:

procedure Tmainn.eaLinesKeyPress(Sender: TObject; var Key: Char);
begin
if SelectedNode = nil then exit;

// StrPCopy(@PDialogData(trDialog.GetNodeData
(SelectedNode)).ConvStrings, '');

// Why should ConvStrings be long enough to hold Text? Dynamic
strings can make you neglect the basics :^)
// You have to do SetLength(PDialogData(trDialog.GetNodeData
(SelectedNode)).ConvStrings, Length(eaLines.Strings.Text) + 1 before
// This would work.
// Also the @ is a bit suspicious

// StrPCopy(PChar(PDialogData(trDialog.GetNodeData
(SelectedNode)).ConvStrings), eaLines.Strings.Text);

// Just let Delphi handle the string allocation
PDialogData(trDialog.GetNodeData(SelectedNode)).ConvStrings := '';
PDialogData(trDialog.GetNodeData(SelectedNode)).ConvStrings :=
eaLines.Strings.Text

end;

Here the reason to call Finalize is to free the strings so

Data.ConvStrings := '';

is unnecessary

procedure Tmainn.trDialogFreeNode(Sender: TBaseVirtualTree;
Node: PVirtualNode);
var
Data: PDialogData;
begin
Data := trDialog.GetNodeData(Node);
Finalize(Data^); // VT uses GetMem so the dynamic strings are not
freed
//Data.ConvStrings.Free;
Data.ConvStrings := '';
end;

 | Replies | Author | Date
5672 | Re: Access Viloation when Accessing a MemoryStrea | shpatmorina | Sat 4/6/2002
5674 | Re: Access Viloation when Accessing a MemoryStrea | Jim Kueneman | Sat 4/6/2002


re: Found a new interpreted language!

From: "Mike Lischke" [lists@l...]
Date: Sat Apr 6, 2002 7:01 am
Subject: RE: [VirtualTreeview] Found a new interpreted language!

Joint today, banned right now.

Ciao, Mike
--
www.delphi-gems.com
www.lischke-online.de
www.delphi-unicode.net

> -----Original Message-----
> From: babbouux [mailto:[babbouux@y...]]
> Sent: Saturday, April 06, 2002 1:52 AM
> To: VirtualTreeview@yahoogroups.com
> Subject: [VirtualTreeview] Found a new interpreted language!
>
>
> I am since a long time a delphi programmer
>
> I find this product very interesting. I can execute interpreted code
> directly on my PC microprocessor


re: Access Viloation when Accessing a MemoryStream dain the node'sdata

From: "shpatmorina" [bipbip@h...]
Date: Sat Apr 6, 2002 9:18 am
Subject: Re: Access Viloation when Accessing a MemoryStream dain the node'sdata

Thanks a lot, man.
All the problems have been fixed now.
Oh and the StrPCopy part was there because before I started using VT,
ConvStrings was an array, and I just forgot that part there :/.
Er, ..something else... how do I exactly change the caption of the focused node
? I can't seen to find out...
Thanks again..

 | Replies | Author | Date
5674 | Re: Access Viloation when Accessing a MemoryStrea | Jim Kueneman | Sat 4/6/2002


OT: Yahoo privacy policy

From: "Mike Lischke" [lists@l...]
Date: Sat Apr 6, 2002 1:58 pm
Subject: OT: Yahoo privacy policy

All,

In case you were unaware, the folks at Yahoo have recently changed their
Privacy Policy. More information is available here:

http://www.theregister.co.uk/content/6/24683.html

"Yahoo! changed its privacy policy last week, contemptuously exposing all
of its registered users to third-party spam, marketing offers and cold
calls that they'd previously said they didn't want."

You can update your account preferences and change the "services" to which
you are enrolled by clicking here:

http://subscribe.yahoo.com/showaccount

Thanks to Philip Wand for making me aware of this affront. For Virtual Treeview
and GraphicEx users I recommend again to use the private newsgroups at
forums.talkto.net.

Ciao, Mike
--
www.delphi-gems.com
www.lischke-online.de
www.delphi-unicode.net

 | Replies | Author | Date
5678 | Re: OT: Yahoo privacy policy | this_is_koen | Sat 4/6/2002
5679 | Re: OT: Yahoo privacy policy | Mike Lischke | Sat 4/6/2002
5682 | Re: OT: Yahoo privacy policy | benadembaba | Sun 4/7/2002
5684 | Re: OT: Yahoo privacy policy | Mike Lischke | Sun 4/7/2002
5680 | Re: OT: Yahoo privacy policy | Peter Evans | Sun 4/7/2002


re: Re: Access Viloation when Accessing a MemoryStream dain the node'sdata

From: Jim Kueneman [jimdk@m...]
Date: Sat Apr 6, 2002 2:57 pm
Subject: Re: [VirtualTreeview] Re: Access Viloation when Accessing a MemoryStream dain the node'sdata

Hi

>Er, ..something else... how do I exactly change the caption of the focused
>node ? I can't seen to find out...
>Thanks again..

You mean when you press F2 and the tree goes into edit mode? When the use
presses return OnNewText is called. There you have the chance to take the
new string and store it in your data structure associated with that node
(remember VT does not store any data so if you don't respond to this
nothing happens!)

Jim


re: Small bug in 3.1.3 auto column size using ctrl+

From: "Mike Lischke" [lists@l...]
Date: Sat Apr 6, 2002 4:38 pm
Subject: RE: [VirtualTreeview] Small bug in 3.1.3 auto column size using ctrl+

Charles,

> If the NewWidth is smaller than the FMithWidth the column is resized
> to NewWidth and on repaint is forced back to FMithWidth, the result
> is very undesirable.

Good point. I have added your suggestion plus a test for maximum width (for
completeness).

Ciao, Mike
--
www.delphi-gems.com
www.lischke-online.de
www.delphi-unicode.net


re: Small column bug

From: "Mike Lischke" [lists@l...]
Date: Sat Apr 6, 2002 4:48 pm
Subject: RE: [VirtualTreeview] Small column bug

Hi Jascha,

> I found a very small bug in the VT columns (Version 3.1.3) that
> causes the parent color option to be ignored when using a treeview in
> a frame on a descendant form! In Assign, you need to set the Options
> property after the Color property to allow the coParentColour option
> to work correctly.

Yes, you are right. You can see the consideration of the options also in other
places (e.g. for
column and header load from stream) There I had this already implemented, but
did not think of the
assignment. Anyway, also this is fixed now.

Ciao, Mike
--
www.delphi-gems.com
www.lischke-online.de
www.delphi-unicode.net


New file uploaded to VirtualTreeview

From: VirtualTreeview@yahoogroups.com
Date: Sat Apr 6, 2002 5:02 pm
Subject: New file uploaded to VirtualTreeview

Hello,

This email message is a notification to let you know that
a file has been uploaded to the Files area of the VirtualTreeview
group.

File : /VirtualTreesPatch4.zip
Uploaded by : mikelischke [lists@l...]
Description : VT Patch 4, contains fixes for all reported bugs

You can access this file at the URL

http://groups.yahoo.com/group/VirtualTreeview/files/VirtualTreesPatch4.zip

To learn more about file sharing for your group, please visit

http://help.yahoo.com/help/us/groups/files

Regards,

mikelischke [lists@l...]


re: OT: Yahoo privacy policy

From: "this_is_koen" [kvds@g...]
Date: Sat Apr 6, 2002 8:03 pm
Subject: Re: OT: Yahoo privacy policy

--- In [VirtualTreeview@y...], "Mike Lischke" [lists@l...] wrote:
> All,
>
> In case you were unaware, the folks at Yahoo have recently changed
their
> Privacy Policy. More information is available here:
>
> http://www.theregister.co.uk/content/6/24683.html
>
> "Yahoo! changed its privacy policy last week, contemptuously
exposing all
> of its registered users to third-party spam, marketing offers and
cold
> calls that they'd previously said they didn't want."
>
> You can update your account preferences and change the "services"
to which
> you are enrolled by clicking here:
>
> http://subscribe.yahoo.com/showaccount
>
> Thanks to Philip Wand for making me aware of this affront. For
Virtual Treeview and GraphicEx users I recommend again to use the
private newsgroups at forums.talkto.net.
>
> Ciao, Mike
> --
> www.delphi-gems.com
> www.lischke-online.de
> www.delphi-unicode.net

Mike, as a moderator of this group, can you make the archives public?
That way I can still view the messages after I've deleted my account.

Thanks for all the work on a great component!

Koen

 | Replies | Author | Date
5679 | Re: OT: Yahoo privacy policy | Mike Lischke | Sat 4/6/2002
5682 | Re: OT: Yahoo privacy policy | benadembaba | Sun 4/7/2002
5684 | Re: OT: Yahoo privacy policy | Mike Lischke | Sun 4/7/2002


re: Re: OT: Yahoo privacy policy

From: "Mike Lischke" [lists@l...]
Date: Sat Apr 6, 2002 10:37 pm
Subject: RE: [VirtualTreeview] Re: OT: Yahoo privacy policy

> Mike, as a moderator of this group, can you make the archives public?
> That way I can still view the messages after I've deleted my account.

I just created a new Virtual Treeview mailing list at FreeLists.org. They are
also free, but
without any ads or other trouble. As soon as I have moved all users I will let
you know. We can keep
the list here at YG to keep the archive, but it will no longer be used for
communication, as soon as
everything is set up on FreeLists.org.

Ciao, Mike
--
www.delphi-gems.com
www.lischke-online.de
www.delphi-unicode.net

 | Replies | Author | Date
5682 | Re: OT: Yahoo privacy policy | benadembaba | Sun 4/7/2002
5684 | Re: OT: Yahoo privacy policy | Mike Lischke | Sun 4/7/2002


re: Re: OT: Yahoo privacy policy

From: "Peter Evans" [pgevans@m...]
Date: Sun Apr 7, 2002 12:28 am
Subject: Re: [VirtualTreeview] Re: OT: Yahoo privacy policy

> I just created a new Virtual Treeview mailing list at FreeLists.org. They
are also free, but
> without any ads or other trouble. As soon as I have moved all users I will
let you know. We can keep
> the list here at YG to keep the archive, but it will no longer be used for
communication, as soon as
> everything is set up on FreeLists.org.
>

Good!


re: problem with focus

From: "AndyPie" [fwd2@g...]
Date: Sun Apr 7, 2002 5:02 pm
Subject: [VirtualTreeview] RE: problem with focus

Hi Werner Lehmann and KY,

I use BeginUpdate/EndUpdate now and everything works fine.
Thanks for the help!

Regards
Andy


re: OT: Yahoo privacy policy

From: "benadembaba" [adembaba@e...]
Date: Sun Apr 7, 2002 7:51 pm
Subject: Re: OT: Yahoo privacy policy

> I just created a new Virtual Treeview mailing
> list at FreeLists.org. They are also free, but
> without any ads or other trouble. As soon as I
> have moved all users I will let you know. We
> can keep the list here at YG to keep the archive,
> but it will no longer be used for communication,
> as soon as everything is set up on FreeLists.org.

Hi Mike,

A blessing in disguise: While I initially hated the
guts of WebMail and portal stuff, over time I got
somewhat addicted to its convenience -of not having
your mailbox full of messages you are not sure you
want to read just now; or having to download so many
over slow link and then sort through them..

But, Yahoo! know about it too, and is going to put
paid to it anyhow. So, I sort of welcome the move
to FreeLists.Org --I will get another webmail
account to deal with the traffic ;-)

Cheers,
Adem

 | Replies | Author | Date
5684 | Re: OT: Yahoo privacy policy | Mike Lischke | Sun 4/7/2002


Error in v. 3.1.7

From: "Todor Huklev" [todhouk@i...]
Date: Sun Apr 7, 2002 8:23 pm
Subject: Error in v. 3.1.7

Hi All !

VT 3.1.7 (Patch 3) launch Range Check Error in PaintImage (line:12117) after
my procedure MarkDisabledNode. In VT 3.1.5 (Patch 2) work normaly!
What is wrong ? What is need ?

procedure TMainForm.MarkDisabledNode(Node: PVirtualNode; Mark_: boolean);
Var Node_ : PVirtualNode;
begin
If not Assigned(Node) then Exit;
VT.IsDisabled[Node]:= Mark_;
if Node.ChildCount = 0 then Exit;
Node_ := Node;
repeat
Node_:= VT.GetNext(Node_);
VT.IsDisabled[Node_]:= Mark_;
until Node_ = Node.LastChild;
end;

[Non-text portions of this message have been removed]

 | Replies | Author | Date
5714 | Re: Error in v. 3.1.7 | Mike Lischke | Sat 4/13/2002


re: Re: OT: Yahoo privacy policy

From: "Mike Lischke" [lists@l...]
Date: Sun Apr 7, 2002 9:26 pm
Subject: RE: [VirtualTreeview] Re: OT: Yahoo privacy policy

Hi Adem and all,

> > As soon as I have moved all users I will let you know.

The migration is done. It took only half an hour and most of you should not
have any trouble (except
setting the new mailing list address and perhaps some of the flags like digest
mode or so). If you
have a Yahoo account I recommend that you create a new one with another free
mailer.

> But, Yahoo! know about it too, and is going to put
> paid to it anyhow. So, I sort of welcome the move
> to FreeLists.Org --I will get another webmail
> account to deal with the traffic ;-)

I expected it for a long time now. When Yahoo took over the old lists (was it
egroups?) they
attached quite a lot of ads to each message (and placed it as header!), but
later they stopped that
and only had a small footer. As some may have encountered meanwhile YG placed
ads all over their
pages. So it was only a little step for them ...

Ciao, Mike
--
www.delphi-gems.com
www.lischke-online.de
www.delphi-unicode.net


how to install VT Ini, List etc

From: "gururamnath" [gururamnath@y...]
Date: Mon Apr 8, 2002 9:59 am
Subject: how to install VT Ini, List etc

Hello everyone,
When I tried installing the components in the "Virtual Stuff 2" , I
got an Error saying TColunIndex and Integer are not compatible...
Please let me know how I can install them in d6...thanks alot...
-regards,
Guru

 | Replies | Author | Date
5686 | Re: how to install VT Ini, List etc | Illya Kysil | Mon 4/8/2002
5687 | Re: how to install VT Ini, List etc | Wim van der Vegt | Mon 4/8/2002
5688 | Re: how to install VT Ini, List etc | GIANNAKOPOULOS KOSTAS | Mon 4/8/2002


re: how to install VT Ini, List etc

From: "Illya Kysil" [ikysil@u...]
Date: Mon Apr 8, 2002 10:04 am
Subject: Re: [VirtualTreeview] how to install VT Ini, List etc

> When I tried installing the components in the "Virtual Stuff 2" , I
> got an Error saying TColunIndex and Integer are not compatible...
> Please let me know how I can install them in d6...thanks alot...
You should change 'Column: Integer' to 'Column: TColumnIndex'...

Regards
Illya Kysil, software developer
Delphi/C/C++/Java/Forth/Assembler
If it is NOT SOURCE, it is NOT SOFTWARE. (C) NASA


re: how to install VT Ini, List etc

From: "Wim van der Vegt" [wvd_vegt@k...]
Date: Mon Apr 8, 2002 10:28 am
Subject: Re: [VirtualTreeview] how to install VT Ini, List etc

Hi,

It's not all, GetText has a parameter text of type (wide)string which has to
be changed to CellText (in both declarations and code).

I have an updated version of the controls and can e-mail or upload it to
yahoo if wanted, just let me know.

----------------
Wim van der Vegt

----- Original Message -----
From: "Illya Kysil" [ikysil@u...]
To: <VirtualTreeview@yahoogroups.com>
Sent: Monday, April 08, 2002 12:04 PM
Subject: Re: [VirtualTreeview] how to install VT Ini, List etc

> > When I tried installing the components in the "Virtual Stuff 2" , I
> > got an Error saying TColunIndex and Integer are not compatible...
> > Please let me know how I can install them in d6...thanks alot...
> You should change 'Column: Integer' to 'Column: TColumnIndex'...
>
> Regards
> Illya Kysil, software developer
> Delphi/C/C++/Java/Forth/Assembler
> If it is NOT SOURCE, it is NOT SOFTWARE. (C) NASA
>
>
>
> To unsubscribe from this group, send an email to:
> VirtualTreeview-unsubscribe@egroups.com
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>


re: how to install VT Ini, List etc

From: GIANNAKOPOULOS KOSTAS [kyan@s...]
Date: Mon Apr 8, 2002 10:37 am
Subject: RE: [VirtualTreeview] how to install VT Ini, List etc

> It's not all, GetText has a parameter text of type
> (wide)string which has to
> be changed to CellText (in both declarations and code).

No, it is not necessary to rename these parameters in existing event
handlers. Delphi requires that the number and data types of the parameters
match exactly, not their names.

I'm the one who asked Mike to give event handler parameters more descriptive
names than "Text" and "Index" to avoid name conflicts and i would never had
done that if it was necessary to rename all parameters in all existing event
handlers. Other VT users would have put a contract on my head in that case
<g>.


Equivalents ?

From: Guru Ramnath Kathiresan [gururamnath@y...]
Date: Tue Apr 9, 2002 3:41 am
Subject: Equivalents ?

Hello all,
I'm converting the TListview control to
TVirtualTreeStringData. I havent worked on the
Treeview control before...I have used the following
functions with the LV and I dont know what are their
equivalent in VT... please let me know about it...

1) lstvwObj.Items.selected - I have the Selected[pd] =
bool in VT, in that case should I have to use a
forloop to check all the items or do we have an
equivalent of ItemIndex ?

2) lstvwObjs.Items[j].Update;

3)lstvwObjs.Items[j].MakeVisible(true)

Thanks in advance...
-regards,
Guru

=====
Guru Ramnath Kathiresan
197 Windsor St, #3
Kearny,
NJ-07032,USA.
Ph : 201-997-8129
Hp : http://www.grewordlist.com

__________________________________________________
Do You Yahoo!?
Yahoo! Tax Center - online filing with TurboTax
http://taxes.yahoo.com/

 | Replies | Author | Date
5690 | Re: Equivalents ? | Jim Kueneman | Tue 4/9/2002
5691 | Re: Equivalents ? | Guru Ramnath Kathiresan | Tue 4/9/2002
5692 | Re: Equivalents ? | Jim Kueneman | Tue 4/9/2002
5694 | Re: Equivalents ? | eljarec | Tue 4/9/2002
5695 | Re: Equivalents ? | Jim Kueneman | Tue 4/9/2002


re: Equivalents ?

From: Jim Kueneman [jimdk@m...]
Date: Tue Apr 9, 2002 4:00 am
Subject: Re: [VirtualTreeview] Equivalents ?

Hi

>1) lstvwObj.Items.selected - I have the Selected[pd] =
>bool in VT, in that case should I have to use a

Node := GetFirstSelected;
while Assigned(Node) do
begin
...
Node := GetNextSelected(Node) // Think that is what it is
end

>forloop to check all the items or do we have an
>equivalent of ItemIndex ?

Not really a true equivalent since VT is a linked list.

AbsoluteIndex if you must.

>2) lstvwObjs.Items[j].Update;

InvalidateNode(Node);

>3)lstvwObjs.Items[j].MakeVisible(true)

ScrollIntoView

Jim

 | Replies | Author | Date
5691 | Re: Equivalents ? | Guru Ramnath Kathiresan | Tue 4/9/2002
5692 | Re: Equivalents ? | Jim Kueneman | Tue 4/9/2002
5694 | Re: Equivalents ? | eljarec | Tue 4/9/2002
5695 | Re: Equivalents ? | Jim Kueneman | Tue 4/9/2002


re: Equivalents ?

From: Guru Ramnath Kathiresan [gururamnath@y...]
Date: Tue Apr 9, 2002 4:16 am
Subject: Re: [VirtualTreeview] Equivalents ?

Hi Jim,
Thanks for the Answers... The Code Snippets u have
will be a Pointer to VirtualNode Type and It wont be a
VirtualListViewItem, how can I typecase it ?
-regards,
guru

--- Jim Kueneman [jimdk@m...] wrote:
>
> Hi
>
> >1) lstvwObj.Items.selected - I have the
> Selected[pd] =
> >bool in VT, in that case should I have to use a
>
> Node := GetFirstSelected;
> while Assigned(Node) do
> begin
> ...
> Node := GetNextSelected(Node) // Think that is
> what it is
> end
>
> >forloop to check all the items or do we have an
> >equivalent of ItemIndex ?
>
> Not really a true equivalent since VT is a linked
> list.
>
> AbsoluteIndex if you must.
>
> >2) lstvwObjs.Items[j].Update;
>
> InvalidateNode(Node);
>
> >3)lstvwObjs.Items[j].MakeVisible(true)
>
> ScrollIntoView
>
>
> Jim
>
>
> ------------------------ Yahoo! Groups Sponsor
>
> To unsubscribe from this group, send an email to:
> VirtualTreeview-unsubscribe@egroups.com
>
>
>
> Your use of Yahoo! Groups is subject to
> http://docs.yahoo.com/info/terms/
>
>

=====
Guru Ramnath Kathiresan
197 Windsor St, #3
Kearny,
NJ-07032,USA.
Ph : 201-997-8129
Hp : http://www.grewordlist.com

__________________________________________________
Do You Yahoo!?
Yahoo! Tax Center - online filing with TurboTax
http://taxes.yahoo.com/

 | Replies | Author | Date
5692 | Re: Equivalents ? | Jim Kueneman | Tue 4/9/2002
5694 | Re: Equivalents ? | eljarec | Tue 4/9/2002
5695 | Re: Equivalents ? | Jim Kueneman | Tue 4/9/2002


re: Equivalents ?

From: Jim Kueneman [jimdk@m...]
Date: Tue Apr 9, 2002 5:00 am
Subject: Re: [VirtualTreeview] Equivalents ?

Hi,

>Hi Jim,
>Thanks for the Answers... The Code Snippets u have
>will be a Pointer to VirtualNode Type and It wont be a
>VirtualListViewItem, how can I typecase it ?

No such thing as a VirtualListviewItem. VT completly separates the data
from the UI. You are responsible for setting up the data and assiciating
it with a node. All you get from VT is nodes then use

GetNodeData to retrive a pointer to your data.

Look at the demos for TTreeview and TListview emulator demo to help convert:

http://groups.yahoo.com/group/VirtualTreeview/files/Descendants/

or (better yet)

http://groups.yahoo.com/group/VirtualTreeview/files/Examples/Delphi_Examples/Mis\
c_Examples/

and look at the VT basics zip to show you how get get started with what I
said. If you want to use VT you have to lose the Treeview.Items and
Listview.Items bad habits or you will be fighting VT all the way. VT is a
link list, it is not a linear array. Think of it as "How can I store my
data such that if I know a node in the tree the data assiciated with that
node tells me everything I need to know to find other nodes (like its
children), find the real data, etc." The ultimate way to use VT is to be
able to not associate any data with a node and load the data only when VT
asks for it. The problem with this is you have to know how to get your
data using only the parent node (which should have already have data
assiciated with it so you can use it to store something that will help the
children get their data)

Jim

 | Replies | Author | Date
5694 | Re: Equivalents ? | eljarec | Tue 4/9/2002
5695 | Re: Equivalents ? | Jim Kueneman | Tue 4/9/2002


Yet Another Equivalent Question

From: Guru Ramnath Kathiresan [gururamnath@y...]
Date: Tue Apr 9, 2002 10:31 am
Subject: Yet Another Equivalent Question

Hello all,
With the help of Jim's answers and slightly going
through the examples, I completly converted the
Listview control to VT...

But I have some more problems with this conversion ...
the following are the problems I have :

1)Setting Image Index for a TVirtualListViewItem :
When I went though the example, it was shown that the
Data of the Node Object was assigned to a record
called PEntry (with the GetNodeData fnc )and then the
value of image of the record is set to the image
Index. When I tried to do that, I'm getting Out of
Memory Error...and the program is crashed!!!!
Can any one suggest me a way to add the StateIndex
like variable in the TVirtualListViewItem ?

2) I want to paint a whole item based on the subitems
value. In the paint events, I just got Node values...
how do I assign them to TVirtualListviewItem and then
get the subitems value and then Paint the Item
acccordigly ?

3)It seems when I add some text to the List , it is
not updated properly.... When I move the cursor to the
Item, it is getting painted and then the Text is shown
correctly... How can I make the text appear
automatically ?

4)As I asked in the prev. mail, the equivalent for
MakeVisible is suggested as ScrollIntoView; but when I
give the second parameter as either false or true ,
the last position where the Item is added is not
scrolled down... It was very smooth in listview..any
suggestions on that ?

Please suggest me some solutions to the above
mentioned problems...
thanks in advance...
-regards,
Guru

=====
Guru Ramnath Kathiresan
197 Windsor St, #3
Kearny,
NJ-07032,USA.
Ph : 201-997-8129
Hp : http://www.grewordlist.com

__________________________________________________
Do You Yahoo!?
Yahoo! Tax Center - online filing with TurboTax
http://taxes.yahoo.com/

 | Replies | Author | Date
5696 | Re: Yet Another Equivalent Question | Jim Kueneman | Tue 4/9/2002


re: Equivalents ?

From: "eljarec" [eljarec@y...]
Date: Tue Apr 9, 2002 12:25 pm
Subject: Re: Equivalents ?

--- In [VirtualTreeview@y...], Jim Kueneman [jimdk@m...] wrote:

> Think of it as "How can I store my data such that if I know a
> node in the tree the data associated with that node tells me
> everything I need to know to find other nodes (like its children),
> find the real data, etc."

But what if you want to somehow access data over which you have no
control in the way how and where it is stored...

> The ultimate way to use VT is to be able to not associate any data
> with a node and load the data only when VT asks for it.

true for any treeview IMO

> The problem with this is you have to know how to get your data
> using only the parent node (which should have already have data
> associated with it so you can use it to store something that will
> help the children get their data)

And this is where I am tripping at the moment. luckily I do not have
the ballast of bad TV or LV habits, as I have never even used these
before, this poses a problem at the same time getting used to
manipulating data in this way.

I am trying to get a grip on how to best process the query results
from what is currently in IE's cache and history.

The idea was to create a treeview with a gimmick, I wanted it to
reverse the host.domain.toplevel part of a URL, so that I could group
the display sorted on toplevel domains. In itself not that difficult,
but I can not see a way to prevent completely enumerating the
cache/history each time I open or close a branch.

The way I see it I need to at least enumerate the lot just to know
which toplevel domains, regular domains and hosts there are in order
to build the tree. And since this is very dynamic data which often
only exists during a browser session, I see no way to associate a
node to a particular entry, since that entry might be nolonger
existing after I close my browser...

I also can't store the data into a list and just use that list, as
then I would need to constantly monitor the cache and history for
changes to keep the list in sync...

...back to the drawing board for the next attempt...

JarC

 | Replies | Author | Date
5695 | Re: Equivalents ? | Jim Kueneman | Tue 4/9/2002


re: Re: Equivalents ?

From: Jim Kueneman [jimdk@m...]
Date: Tue Apr 9, 2002 1:02 pm
Subject: Re: [VirtualTreeview] Re: Equivalents ?

Hi,

>But what if you want to somehow access data over which you have no
>control in the way how and where it is stored...

Then you have to do it anyway you can. My VET it that way. I don't know
how many children there are until I enumerate the shell and find out.

>but I can not see a way to prevent completely enumerating the
>cache/history each time I open or close a branch.

You are taking about actually disk folders here right? Then it is not that
big of a deal the shell enumerates fast (have you see my VT derivative
Explorer components http://groups.yahoo.com/group/VirtualExplorerTree/)

>The way I see it I need to at least enumerate the lot just to know
>which toplevel domains, regular domains and hosts there are in order
>to build the tree. And since this is very dynamic data which often
>only exists during a browser session, I see no way to associate a
>node to a particular entry, since that entry might be nolonger
>existing after I close my browser...
>
>I also can't store the data into a list and just use that list, as
>then I would need to constantly monitor the cache and history for
>changes to keep the list in sync...

Again this is nothing more than listening to the shell seeing when files
are being deleted or created. VET uses an undocumented set of API to
monitor the SHChangeNotify calls but for this all you really need to to
monitor a couple folders so the documented FindFirstChangeNotification,
FindCloseChangeNotification, FindNextChangeNotification API set should work
just fine staring at the History and cache folders and subfolders.

VT should work just fine here although you won't be able to use it the most
efficent way. VET is not using it in the most efficent way either and the
most common comment I get is "WOW, your components are faster than Explorer!

Jim


re: Yet Another Equivalent Question

From: Jim Kueneman [jimdk@m...]
Date: Tue Apr 9, 2002 1:07 pm
Subject: Re: [VirtualTreeview] Yet Another Equivalent Question

At 03:31 AM 4/9/2002 -0700, you wrote:
>Hello all,
>With the help of Jim's answers and slightly going
>through the examples, I completly converted the
>Listview control to VT...
>
>But I have some more problems with this conversion ...
>the following are the problems I have :

1-3 you are likely not telling VT how much memory to reserve for the
record. Look at the example for an assignment to NodeDataSize. This will
tell VT to allocate memory for your data. If thats ok we will need to need
to see a compilable example of what you are doing.

>4)As I asked in the prev. mail, the equivalent for
>MakeVisible is suggested as ScrollIntoView; but when I
>give the second parameter as either false or true ,
>the last position where the Item is added is not
>scrolled down... It was very smooth in listview..any
>suggestions on that ?

Not sure if I understand. May be related to above.

Jim


Memory Leaks?

From: "acidleia" [mikael@i...]
Date: Wed Apr 10, 2002 7:25 pm
Subject: Memory Leaks?

Hello.

I am using the latest patch (4) on an application on Windows XP.
The application is developed in Delphi 6 (EE).
I use Sleuth CodeWatch3 to search for memory leaks.

When I run my application and start looking for leaks, everything is
OK (no leaks), unless the VirtualStringTree I use, doesn't have any
scrollbars. As soon as the scrollbars are automatically shown,
Sleuth reports that there are memory leaks.

The leaks are relatively small (20-56 bytes), but in a Tree
containing around 4200 nodes (same level, 2 columns) there are
around 12000 leaks reported. All nodes are freed correctly.

When browsing the call stack for a leak, it looks like it comes from
a call made in function TBaseVirtualTree.DoSetOffsetXY:

if Value.Y < (ClientHeight - Integer(FRangeY)) then
Value.Y := ClientHeight - Integer(FRangeY);

(But that might be incorrect).

Anyone else that have experienced these problems, or have any ideas
of what it can be caused about?

Thanks in advance,
Mikael Stalvik


dropeffect_copy problem

From: "gtmacgregor141" [gtm@o...]
Date: Wed Apr 10, 2002 10:05 pm
Subject: dropeffect_copy problem

Hi All,

I am using virtualtreeview 3.0.1 with BCB 5 and I think I am having a
problem with copying nodes within the same tree. I have implemented
a move and a copy in the treeview. Just dragging a nodr moves it to
the new location while holding the alt key and dragging (I check in
the drop to see if alt is held) copies. I do this by setting the
Effect to drageffect_copy or move in the DragDrop callback then call
processdrop.

I have both load and save node functions which read and write from
the stream.

It seems when I copy a node the original nodes data gets fubared at
some point after the loadnode. My nodedata has ansistrings in it,
does that matter?

SaveNode:
NodeData *tdata = (NodeData *)Sender->GetNodeData(Node);
Stream->Write((void *)&senderNewAgent, sizeof(bool));
Stream->Write((void *)(tdata), sizeof(NodeData));

If NodeData has strings then the size in not known. Or is the
nodedata freed somewhere after the loadnode.

Should I create a string, write that to the stream and parse it on
the other end?

Thanks

Glenn

 | Replies | Author | Date
5699 | Re: dropeffect_copy problem | Werner Lehmann | Thu 4/11/2002


re: dropeffect_copy problem

From: Werner Lehmann [wl@b...]
Date: Thu Apr 11, 2002 12:51 am
Subject: Re: [VirtualTreeview] dropeffect_copy problem

gtmacgregor141 wrote:
>
> I am using virtualtreeview 3.0.1 with BCB 5 and I think I am having a
> problem with copying nodes within the same tree. I have implemented
> a move and a copy in the treeview. Just dragging a nodr moves it to
> the new location while holding the alt key and dragging (I check in
> the drop to see if alt is held) copies. I do this by setting the
> Effect to drageffect_copy or move in the DragDrop callback then call
> processdrop.

Why "alt" instead of "ctrl" which is the platform default?

> It seems when I copy a node the original nodes data gets fubared at
> some point after the loadnode. My nodedata has ansistrings in it,
> does that matter?

Yes. AnsiStrings are ref'counted. You are copying the record data
to the stream and I guess that this does not handle the ref counts
correctly. Try these (handle each member of your struct individually):

//------------------------------------------------------------------------------
function ReadStringFromStream(Stream: TStream): string;
var
Len: Word;
begin
with Stream do
begin
ReadBuffer(Len, SizeOf(Len));
SetLength(result, Len);
ReadBuffer(PChar(result)^, Len);
end;
end;

//------------------------------------------------------------------------------
procedure WriteStringToStream(Stream: TStream; str: string);
var
Len: Word;
begin
Len := Length(str);
with Stream do
begin
WriteBuffer(Len, SizeOf(Len));
WriteBuffer(PChar(str)^, Len);
end;
end;

Or use ShortStrings which are not ref'counted but have a fixed size.

Werner


Spread Sheet

From: "Richter, Len" [len@c...]
Date: Thu Apr 11, 2002 2:41 pm
Subject: Spread Sheet

Has any know if Virtual Tree can be used as a spread sheet or know of a
component derived from VT? I want to load in comma separated data into a
spread sheet, select columns and graph it.
Also Create the headers in Excel with this cells merged and then save to XLS
file. Next load that file into VT which will automatically show the same
cells merge. All The header take 4 rows & Some Headers will take up 2
columns. I want to merge some columns/ROWS together (see Below):

+-------+---------------+----------------------+----------------------------
---

|TABLE | SIGNATURE | Differential Channel 2 |

+ +
+----------------------+-------------------------------

| | | 5000 mv - -5000mV |

+ +
+----------------------+-------------------------------

| | | 5000 mv - -5000mV |

+--------+--------------+-----------+------------+--------------------------
-----

|SAMPLE| AVERAGE | MAXIMUM | MINIMUM |

+---------+------------+--------------+------------+------------------------
-------

| | | |
|

[Non-text portions of this message have been removed]

 | Replies | Author | Date
5704 | Re: Spread Sheet | Jim Kueneman | Fri 4/12/2002


Problem with Addchild

From: "cst_marmotte" [cst_marmotte@y...]
Date: Thu Apr 11, 2002 3:49 pm
Subject: Problem with Addchild

Hi
I have a little probleme with the fonctionne Addchild.

I have Put a VirtualTreeview on Form and i tried to represent in a
tree imformation from a database. When I writing something on level
0, it works fine. But when i tried to write some imformation at level
1 or 2 i have always the same information instead of diferent.
I have see that i don't pass each time in the procedure
VTTableColonneGetText and the procedure VTTableColonneInitNode when i
have in the level 1 or 2.
Is that normal.

Here is my code

If somebody can help me. Thank's

unit CHILDWIN;

interface

uses Windows, Classes, Graphics, Forms, Controls, StdCtrls, DB,
mQuery,
mQueryOdbcPl, Grids, DBGrids, VirtualTrees,
ExtCtrls,mdatabas,QDialogs;

type
TMDIChild = class(TForm)
Panel1: TPanel;
VTTableColonne: TVirtualStringTree;
Panel2: TPanel;
DataSource1: TDataSource;
DBGrid1: TDBGrid;
mQuerypL1: TmQuerypL;
Splitter1: TSplitter;
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure FormCreate(Sender: TObject);
procedure VTTableColonneInitNode(Sender: TBaseVirtualTree;
ParentNode,
Node: PVirtualNode; var InitialStates: TVirtualNodeInitStates);
procedure VTTableColonneDblClick(Sender: TObject);
procedure VTTableColonneGetText(Sender: TBaseVirtualTree;
Node: PVirtualNode; Column: Integer; TextType: TVSTTextType;
var Text: WideString);
private
{ Private declarations }
Wdatabase:TmDataBase;
public
{ Public declarations }
Constructor Create(Aowner:Tcomponent;Pdatabase:TmDataBase);
end;

implementation

{$R *.dfm}

Type
TmyRec=Record
caption:String;
//Level:Integer;
End;
PMyRec=^TMyRec;
Var
cap:string;
{=====================================================================
=========}
{ Create }
{=====================================================================
=========}
Constructor TMDIChild.Create(Aowner:Tcomponent;Pdatabase:TmDataBase);
Begin
Wdatabase :=Pdatabase;
inherited create(Aowner);
End;
{=====================================================================
=========}
{ Create }
{=====================================================================
=========}
procedure TMDIChild.FormCreate(Sender: TObject);
Var
node,nodeP:PVirtualNode;
ListTable:TstringList;
i:Integer;
Vdata:PMyRec;
begin
VTTableColonne.NodeDataSize:=Sizeof(PMyRec);
cap:= 'Table';
nodeP:=VTTableColonne.AddChild(nil) ;
ListTable:=TstringList.Create;
Wdatabase.GetTableNames(ListTable);
For i:=0 To ListTable.Count-1 Do
Begin
cap:= ListTable.Strings[i];
node:=VTTableColonne.AddChild(nodeP);
End;
ListTable.Free;
end;
{=====================================================================
=========}
{
VTTableColonneInitNode }
{=====================================================================
=========}
procedure TMDIChild.VTTableColonneInitNode(Sender: TBaseVirtualTree;
ParentNode, Node: PVirtualNode; var InitialStates:
TVirtualNodeInitStates);
Var
Vdata:PMyRec;
// ParentData: PMyNodeData;
Level:Integer;
t:WideString;
begin

with Sender do
begin
VData := GetNodeData(Node);
Vdata.caption:=cap;
End;

end;
{=====================================================================
=========}
{ FormClose }
{=====================================================================
=========}
procedure TMDIChild.FormClose(Sender: TObject; var Action:
TCloseAction);
begin
Action := caFree;
end;

{=====================================================================
=========}
procedure TMDIChild.VTTableColonneDblClick(Sender: TObject);
Var
ListColonne:TstringList;
Vdata:PMyRec;
i:Integer;
node:PVirtualNode;
t:TVirtualNodeInitStates;
begin
ListColonne:=TstringList.create;
VTTableColonne.NodeDataSize:=Sizeof(PMyRec);
If Assigned(VTTableColonne.FocusedNode) Then
Begin
Vdata:=VTTableColonne.GetNodeData(VTTableColonne.FocusedNode);
Wdatabase.GetColumnNames(Vdata.caption,ListColonne);
For i:=0 To ListColonne.Count-1 Do
Begin
cap:= ListColonne.Strings[i];
node:=VTTableColonne.AddChild
(VTTableColonne.FocusedNode);//On ajoute des parents a savoir des
tables
End;
End;
ListColonne.Free;
end;

procedure TMDIChild.VTTableColonneGetText(Sender: TBaseVirtualTree;
Node: PVirtualNode; Column: Integer; TextType: TVSTTextType;
var Text: WideString);
Var
Vdata:PMyRec;
begin
Vdata:=sender.GetNodeData(Node);
If assigned(VData) Then
Text:=Vdata.caption;
end;

end.

 | Replies | Author | Date
5703 | Re: Problem with Addchild | Werner Lehmann | Thu 4/11/2002


AbsoluteIndex and Search

From: "ePC TECH" [epctech@t...]
Date: Thu Apr 11, 2002 4:18 pm
Subject: AbsoluteIndex and Search

How can I find a node in te TVirtualStringTree by the value of its
absoluteindex?
My problem is:
first I checked a Node
than if I checked another node, under some circumstances, I must delete the
checked of another node that I previously checked.
I thought that by AbsoluteIndex this would be possible but I haven't found
an example like in TTreeView:
node := TTreeview(Sender).items[x] where x is the absoluteIndex
Someone can help to solve my problem?
Hello
Marco

[Non-text portions of this message have been removed]

 | Replies | Author | Date
5705 | Re: AbsoluteIndex and Search | Jim Kueneman | Fri 4/12/2002
5707 | Re: AbsoluteIndex and Search | Milan Vandrovec | Fri 4/12/2002
5713 | Re: AbsoluteIndex and Search | eljarec | Sat 4/13/2002
5710 | Re: AbsoluteIndex and Search | Milan Vandrovec | Fri 4/12/2002


re: Problem with Addchild

From: Werner Lehmann [wl@b...]
Date: Thu Apr 11, 2002 7:25 pm
Subject: Re: [VirtualTreeview] Problem with Addchild

cst_marmotte wrote:
>
> VTTableColonne.NodeDataSize:=Sizeof(PMyRec);

=>

VTTableColonne.NodeDataSize:=Sizeof(TMyRec);

Werner


re: Spread Sheet

From: Jim Kueneman [jimdk@m...]
Date: Fri Apr 12, 2002 2:28 am
Subject: Re: [VirtualTreeview] Spread Sheet

At 08:41 AM 4/11/2002 -0600, you wrote:
>Has any know if Virtual Tree can be used as a spread sheet or know of a
>component derived from VT? I want to load in comma separated data into a
>spread sheet, select columns and graph it.
>Also Create the headers in Excel with this cells merged and then save to XLS
>file. Next load that file into VT which will automatically show the same
>cells merge. All The header take 4 rows & Some Headers will take up 2
>columns. I want to merge some columns/ROWS together (see Below):

Not really sure. I think trying to deal with the selection of just a
column is not possible with VT unless you do it all in the Customdraw events.

Jim


re: AbsoluteIndex and Search

From: Jim Kueneman [jimdk@m...]
Date: Fri Apr 12, 2002 2:38 am
Subject: Re: [VirtualTreeview] AbsoluteIndex and Search

At 06:18 PM 4/11/2002 +0200, you wrote:
>How can I find a node in te TVirtualStringTree by the value of its
>absoluteindex?
>My problem is:
>first I checked a Node
>than if I checked another node, under some circumstances, I must delete the
>checked of another node that I previously checked.
>I thought that by AbsoluteIndex this would be possible but I haven't found
>an example like in TTreeView:
> node := TTreeview(Sender).items[x] where x is the absoluteIndex
>Someone can help to solve my problem?

VT is a linked list so that type of assignment must be faked by recursing
the tree; Untested off the top of my head

Jim

procedure TCustomVirtualExplorerTree.InvalidateImageByIndex(ImageIndex:
integer);

function RecurseTree(ParentNode: PVirtualNode; const IndexToFind:
integer; var Count: integer): PVirtualNode;
var
Child: PVirtualNode;
NS: TNamespace;
begin
Result := nil;
Child := ParentNode.FirstChild;
while Assigned(Child) and (Count < IndexToFind) do
begin
if Count = IndexToFound then
Result := Child;
if Child.ChildCount > 0 then
RecurseTree(Child);
Child := Child.NextSibling;
end;
end;

var
Count: integer;
Node: PVirtualNode;
begin
Count := 0;
Node := RecurseTree(RootNode, 10, Count);
end;


R: AbsoluteIndex and Search

From: "ePC TECH" [epctech@t...]
Date: Fri Apr 12, 2002 12:46 pm
Subject: R: [VirtualTreeview] AbsoluteIndex and Search

Thanks for your suggestion.
I tried your example but there are some difference so I cannot execute it, but
I understand that AbsoluteIndex don't identify a Node forever.
If I add a node in the tree than all the node after that I inserted are
incremented of 1.
If I don't expand in VTInit all the tree, after every expansion changes
absolute index of many nodes.
Now my question is if there is a property in VT.Node that identify a Node
forever (or just in a session) and if there is a method for find it or,
instead, I must build by myself with data and function for searching.
In the second way I think many people have the same problems and perhaps many
of them are interested to see saome example of that function.
Thanks a lot
Marco

----- Original Message -----
From: Jim Kueneman
To: VirtualTreeview@yahoogroups.com
Sent: Friday, April 12, 2002 4:38 AM
Subject: Re: [VirtualTreeview] AbsoluteIndex and Search

At 06:18 PM 4/11/2002 +0200, you wrote:
>How can I find a node in te TVirtualStringTree by the value of its
>absoluteindex?
>My problem is:
>first I checked a Node
>than if I checked another node, under some circumstances, I must delete the
>checked of another node that I previously checked.
>I thought that by AbsoluteIndex this would be possible but I haven't found
>an example like in TTreeView:
> node := TTreeview(Sender).items[x] where x is the absoluteIndex
>Someone can help to solve my problem?

VT is a linked list so that type of assignment must be faked by recursing
the tree; Untested off the top of my head

Jim

procedure TCustomVirtualExplorerTree.InvalidateImageByIndex(ImageIndex:
integer);

function RecurseTree(ParentNode: PVirtualNode; const IndexToFind:
integer; var Count: integer): PVirtualNode;
var
Child: PVirtualNode;
NS: TNamespace;
begin
Result := nil;
Child := ParentNode.FirstChild;
while Assigned(Child) and (Count < IndexToFind) do
begin
if Count = IndexToFound then
Result := Child;
if Child.ChildCount > 0 then
RecurseTree(Child);
Child := Child.NextSibling;
end;
end;

var
Count: integer;
Node: PVirtualNode;
begin
Count := 0;
Node := RecurseTree(RootNode, 10, Count);
end;

Yahoo! Groups Sponsor
ADVERTISEMENT

To unsubscribe from this group, send an email to:
VirtualTreeview-unsubscribe@egroups.com

Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.

[Non-text portions of this message have been removed]

 | Replies | Author | Date
5708 | R: [VirtualTreeview] AbsoluteIndex and Search | ePC TECH | Fri 4/12/2002


re: AbsoluteIndex and Search

From: "Milan Vandrovec" [milan_va@s...]
Date: Fri Apr 12, 2002 1:13 pm
Subject: RE: [VirtualTreeview] AbsoluteIndex and Search

Hello.

> Now my question is if there is a property in VT.Node that
> identify a Node forever (or just in a session)

It *is* possible to keep the pointer to Node up-to-date in your record.
You only have to fill it in OnInitNode and clear it in OnFreeNode. I
didn't use D&D in that project, but it should be possible; if not, Mike
will surely agree to add Node parameter to any events where it's
missing.
So you can easily get associated PVirtualNode from your record using
this pointer. You cannot get more.

In your example, you'll have to check in OnFreeNode if the globally
stored last-checked-node is the freed node and do something about it if
it is (probably clear the last-checked-node).

Is this sufficient?

Milan Vandrovec

 | Replies | Author | Date
5713 | Re: AbsoluteIndex and Search | eljarec | Sat 4/13/2002


R: AbsoluteIndex and Search

From: "ePC TECH" [epctech@t...]
Date: Fri Apr 12, 2002 1:32 pm
Subject: R: [VirtualTreeview] AbsoluteIndex and Search

Can you show me an example of what I must write in OnInitNode (pointer to Node
up-to-date).
I haven't understand what's D&D.

>In your example, you'll have to check in OnFreeNode if the globally
>stored last-checked-node is the freed node and do something about it if
>it is (probably clear the last-checked-node).
What is "the globally stored last-checked-node"? It seems of some interesting
Thanks
Marco

----- Original Message -----
From: Milan Vandrovec
To: VirtualTreeview@yahoogroups.com
Sent: Friday, April 12, 2002 3:13 PM
Subject: RE: [VirtualTreeview] AbsoluteIndex and Search

Hello.

> Now my question is if there is a property in VT.Node that
> identify a Node forever (or just in a session)

It *is* possible to keep the pointer to Node up-to-date in your record.
You only have to fill it in OnInitNode and clear it in OnFreeNode. I
didn't use D&D in that project, but it should be possible; if not, Mike
will surely agree to add Node parameter to any events where it's
missing.
So you can easily get associated PVirtualNode from your record using
this pointer. You cannot get more.

In your example, you'll have to check in OnFreeNode if the globally
stored last-checked-node is the freed node and do something about it if
it is (probably clear the last-checked-node).

Is this sufficient?

Milan Vandrovec

Yahoo! Groups Sponsor
ADVERTISEMENT

To unsubscribe from this group, send an email to:
VirtualTreeview-unsubscribe@egroups.com

Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.

[Non-text portions of this message have been removed]


Merged Cells

From: "Richter, Len" [len@c...]
Date: Fri Apr 12, 2002 2:23 pm
Subject: Merged Cells

Does VT have merged cells if used as a stringgrid? If so, could I get an
example.

Len

[Non-text portions of this message have been removed]

 | Replies | Author | Date
5711 | Re: Merged Cells | Werner Lehmann | Fri 4/12/2002
5712 | Re: Merged Cells | Richter, Len | Fri 4/12/2002


re: AbsoluteIndex and Search

From: "Milan Vandrovec" [milan_va@s...]
Date: Fri Apr 12, 2002 2:26 pm
Subject: RE: [VirtualTreeview] AbsoluteIndex and Search

Hello.

> I haven't understand what's D&D.
Drag and Drop. It may require looking through all event handlers and
guess which should be implemented.

> Can you show me an example of what I must write in OnInitNode
> (pointer to Node up-to-date).

The idea is that the NodeData is a pointer to your record, which looks
like this:

TStationRecord=class; //similar to TStationPlace...

TStationPlace=class(TObject)
protected
FTreeNode: PVirtualNode;
FName: String;
public
stations: array of TStationRecord;
property TreeNode: PVirtualNode read GetTreeNode write FTreeNode;
end;

Also I used this:
TObjectPointer=record
ptr: TObject;
end;
PObjectPointer=^TObjectPointer;
but there is probably a better way. Anyway:

procedure TfrmMain.StationTreeInitNode(Sender: TBaseVirtualTree;
ParentNode, Node: PVirtualNode; var InitialStates:
TVirtualNodeInitStates);
var Place: TStationPlace;
begin
if (ParentNode=Sender.RootNode) or (ParentNode=nil) then
begin //first level: create Place
Place:=GlobalPlaces[Node.Index];
PObjectPointer(Sender.GetNodeData(Node)).ptr:=Place; //fill Node
data
Place.FTreeNode:=Node; //fill the Node pointer in my data
//standard OnInitNode continues from here on
if (Length(Place.stations)>0) then
Include(InitialStates, ivsHasChildren);
end
else
begin //second level: create Station in that Place

Place:=TStationPlace(PObjectPointer(Sender.GetNodeData(ParentNode)).ptr)
; //get Node's parent's Place

PObjectPointer(Sender.GetNodeData(Node)).ptr:=Place.stations[Node.Index]
; //fill Node's data with Station
Place.stations[Node.Index].treenode:=Node; //fill Station's Node
pointer
end;
end;

procedure TfrmMain.StationTreeFreeNode(Sender: TBaseVirtualTree; Node:
PVirtualNode);
var ptr: PObjectPointer;
begin
ptr:=PObjectPointer(Sender.GetNodeData(Node));
if (ptr.ptr is TStationPlace) then
(ptr.ptr as TStationPlace).treenode:=nil
else if (ptr.ptr is TStationRecord) then
(ptr.ptr as TStationRecord).treenode:=nil;
end;

function TStationPlace.GetTreeNode: PVirtualNode;
begin
if (FTreeNode=nil) then
frmMain.StationTree.ValidateChildren(nil, false);
Result:=FTreeNode;
end;

> What is "the globally stored last-checked-node"? It seems
> of some interesting

I thought you wanted to store the AbsoluteIndex of the one-and-only
checked Node there. Now it's PVirtualNode instead of Integer (or
Cardinal or whatever AbsoluteIndex is).

Milan Vandrovec


re: Merged Cells

From: Werner Lehmann [wl@b...]
Date: Fri Apr 12, 2002 3:13 pm
Subject: Re: [VirtualTreeview] Merged Cells

"Richter, Len" wrote:
>
> Does VT have merged cells if used as a stringgrid? If so, could I get an
> example.

It has an option to automatically span node text over columns but that's
all.

Werner


re: Merged Cells

From: "Richter, Len" [len@c...]
Date: Fri Apr 12, 2002 3:35 pm
Subject: RE: [VirtualTreeview] Merged Cells

I do see the option. Also I only want to merge the header columns. Is this
possible?

Len

-----Original Message-----
From: Werner Lehmann [mailto:[wl@b...]]
Sent: Friday, April 12, 2002 9:13 AM
To: VirtualTreeview@yahoogroups.com
Subject: Re: [VirtualTreeview] Merged Cells

"Richter, Len" wrote:
>
> Does VT have merged cells if used as a stringgrid? If so, could I get an
> example.

It has an option to automatically span node text over columns but that's
all.

Werner

Yahoo! Groups Sponsor

ADVERTISEMENT

<http://rd.yahoo.com/M=215002.1990895.3471383.1261774/D=egroupweb/S=17051153
62:HM/A=1000239/R=0/*http://ads.x10.com/?bHlhaG9vaG0xLmRhd=1018624418%3eM=21
5002.1990895.3471383.1261774/D=egroupweb/S=1705115362:HM/A=1000239/R=1>

<http://us.adserver.yahoo.com/l?M=215002.1990895.3471383.1261774/D=egroupmai
l/S=1705115362:HM/A=1000239/rand=622210185>

To unsubscribe from this group, send an email to:
VirtualTreeview-unsubscribe@egroups.com

Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service
<http://docs.yahoo.com/info/terms/> .

[Non-text portions of this message have been removed]


re: AbsoluteIndex and Search

From: "eljarec" [eljarec@y...]
Date: Sat Apr 13, 2002 11:13 am
Subject: Re: AbsoluteIndex and Search

--- In [VirtualTreeview@y...], "Milan Vandrovec" [milan_va@s...] wrote:
>
> > Now my question is if there is a property in VT.Node that
> > identify a Node forever (or just in a session)
>
> It *is* possible to keep the pointer to Node up-to-date in your
> record. You only have to fill it in OnInitNode and clear it in
> OnFreeNode.

[SNIP]

> So you can easily get associated PVirtualNode from your record using
> this pointer. You cannot get more.

I readily accept this, now what I have trouble accepting, come to
terms with, whatever, is the storing of this pointer into the data-
record. This either requires write access to the data (in my case not
possible) or the duplication of the data into either a memory
structure or temporary duplicate file...yet I can't see any other way
way to be able to directly associate, identify and locate a node with
information contained in the data...

Now what I have trouble with getting to terms with is this need then
to duplicate data if it's originally from a read-only source...it
just don't feel 'right'...but since I am 'forced by-design' of the
control, to create and maintain a list of 'caption' data anyways, it
becomes a moot point in the end, but it is a constant battle against
my feeling this not being the way it's design intended...because I
can not escape the feeling that when I would use VT I am not just
replacing a standard TV, but adding a separate display one yet still
needing to maintain a TV like memory struct to store 'caption' and
linkage/association data...

It's this that is currently hindering my ability to see how to
succesfully start using VT...:(

JarC


re: Error in v. 3.1.7

From: "Mike Lischke" [lists@l...]
Date: Sat Apr 13, 2002 5:02 pm
Subject: RE: [VirtualTreeview] Error in v. 3.1.7

Todor,

> VT 3.1.7 (Patch 3) launch Range Check Error in PaintImage (line:12117) after
> my procedure MarkDisabledNode. In VT 3.1.5 (Patch 2) work normaly!
> What is wrong ? What is need ?

The code you gave does not raise an exception. I wonder what your real problem
is. If it persists
then send me a demo which shows the problem, so I can try to fix it.

Ciao, Mike
--
www.delphi-gems.com
www.lischke-online.de
www.delphi-unicode.net


Mailing list migration

From: "Mike Lischke" [lists@l...]
Date: Sun Apr 14, 2002 9:24 am
Subject: Mailing list migration

Hi all,

the migration of the mailing list to Freelists.org is now successfully
finished. The YG mailing list is set to be an announcement list, so you cannot
post messages anymore. The old archive can now be accessed by everyone, even
non-members. Actually, I will unsubscribe everyone (except the current
moderators) from the list (so you don't have to fear any more spam caused by
the VT mailing list at YG). Use www.freelists.org/list/virtualtreeview in the
future for mails or, better still, the news group at
news://forums.talkto.net/delphi-gems.support.virtualtreeview.

Ciao, Mike
--
www.delphi-gems.com
www.lischke-online.de
www.delphi-unicode.net